index.js 1.3 MB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156281572815828159281602816128162281632816428165281662816728168281692817028171281722817328174281752817628177281782817928180281812818228183281842818528186281872818828189281902819128192281932819428195281962819728198281992820028201282022820328204282052820628207282082820928210282112821228213282142821528216282172821828219282202822128222282232822428225282262822728228282292823028231282322823328234282352823628237282382823928240282412824228243282442824528246282472824828249282502825128252282532825428255282562825728258282592826028261282622826328264282652826628267282682826928270282712827228273282742827528276282772827828279282802828128282282832828428285282862828728288282892829028291282922829328294282952829628297282982829928300283012830228303283042830528306283072830828309283102831128312283132831428315283162831728318283192832028321283222832328324283252832628327283282832928330283312833228333283342833528336283372833828339283402834128342283432834428345283462834728348283492835028351283522835328354283552835628357283582835928360283612836228363283642836528366283672836828369283702837128372283732837428375283762837728378283792838028381283822838328384283852838628387283882838928390283912839228393283942839528396283972839828399284002840128402284032840428405284062840728408284092841028411284122841328414284152841628417284182841928420284212842228423284242842528426284272842828429284302843128432284332843428435284362843728438284392844028441284422844328444284452844628447284482844928450284512845228453284542845528456284572845828459284602846128462284632846428465284662846728468284692847028471284722847328474284752847628477284782847928480284812848228483284842848528486284872848828489284902849128492284932849428495284962849728498284992850028501285022850328504285052850628507285082850928510285112851228513285142851528516285172851828519285202852128522285232852428525285262852728528285292853028531285322853328534285352853628537285382853928540285412854228543285442854528546285472854828549285502855128552285532855428555285562855728558285592856028561285622856328564285652856628567285682856928570285712857228573285742857528576285772857828579285802858128582285832858428585285862858728588285892859028591285922859328594285952859628597285982859928600286012860228603286042860528606286072860828609286102861128612286132861428615286162861728618286192862028621286222862328624286252862628627286282862928630286312863228633286342863528636286372863828639286402864128642286432864428645286462864728648286492865028651286522865328654286552865628657286582865928660286612866228663286642866528666286672866828669286702867128672286732867428675286762867728678286792868028681286822868328684286852868628687286882868928690286912869228693286942869528696286972869828699287002870128702287032870428705287062870728708287092871028711287122871328714287152871628717287182871928720287212872228723287242872528726287272872828729287302873128732287332873428735287362873728738287392874028741287422874328744287452874628747287482874928750287512875228753287542875528756287572875828759287602876128762287632876428765287662876728768287692877028771287722877328774287752877628777287782877928780287812878228783287842878528786287872878828789287902879128792287932879428795287962879728798287992880028801288022880328804288052880628807288082880928810288112881228813288142881528816288172881828819288202882128822288232882428825288262882728828288292883028831288322883328834288352883628837288382883928840288412884228843288442884528846288472884828849288502885128852288532885428855288562885728858288592886028861288622886328864288652886628867288682886928870288712887228873288742887528876288772887828879288802888128882288832888428885288862888728888288892889028891288922889328894288952889628897288982889928900289012890228903289042890528906289072890828909289102891128912289132891428915289162891728918289192892028921289222892328924289252892628927289282892928930289312893228933289342893528936289372893828939289402894128942289432894428945289462894728948289492895028951289522895328954289552895628957289582895928960289612896228963289642896528966289672896828969289702897128972289732897428975289762897728978289792898028981289822898328984289852898628987289882898928990289912899228993289942899528996289972899828999290002900129002290032900429005290062900729008290092901029011290122901329014290152901629017290182901929020290212902229023290242902529026290272902829029290302903129032290332903429035290362903729038290392904029041290422904329044290452904629047290482904929050290512905229053290542905529056290572905829059290602906129062290632906429065290662906729068290692907029071290722907329074290752907629077290782907929080290812908229083290842908529086290872908829089290902909129092290932909429095290962909729098290992910029101291022910329104291052910629107291082910929110291112911229113291142911529116291172911829119291202912129122291232912429125291262912729128291292913029131291322913329134291352913629137291382913929140291412914229143291442914529146291472914829149291502915129152291532915429155291562915729158291592916029161291622916329164291652916629167291682916929170291712917229173291742917529176291772917829179291802918129182291832918429185291862918729188291892919029191291922919329194291952919629197291982919929200292012920229203292042920529206292072920829209292102921129212292132921429215292162921729218292192922029221292222922329224292252922629227292282922929230292312923229233292342923529236292372923829239292402924129242292432924429245292462924729248292492925029251292522925329254292552925629257292582925929260292612926229263292642926529266292672926829269292702927129272292732927429275292762927729278292792928029281292822928329284292852928629287292882928929290292912929229293292942929529296292972929829299293002930129302293032930429305293062930729308293092931029311293122931329314293152931629317293182931929320293212932229323293242932529326293272932829329293302933129332293332933429335293362933729338293392934029341293422934329344293452934629347293482934929350293512935229353293542935529356293572935829359293602936129362293632936429365293662936729368293692937029371293722937329374293752937629377293782937929380293812938229383293842938529386293872938829389293902939129392293932939429395293962939729398293992940029401294022940329404294052940629407294082940929410294112941229413294142941529416294172941829419294202942129422294232942429425294262942729428294292943029431294322943329434294352943629437294382943929440294412944229443294442944529446294472944829449294502945129452294532945429455294562945729458294592946029461294622946329464294652946629467294682946929470294712947229473294742947529476294772947829479294802948129482294832948429485294862948729488294892949029491294922949329494294952949629497294982949929500295012950229503295042950529506295072950829509295102951129512295132951429515295162951729518295192952029521295222952329524295252952629527295282952929530295312953229533295342953529536295372953829539295402954129542295432954429545295462954729548295492955029551295522955329554295552955629557295582955929560295612956229563295642956529566295672956829569295702957129572295732957429575295762957729578295792958029581295822958329584295852958629587295882958929590295912959229593295942959529596295972959829599296002960129602296032960429605296062960729608296092961029611296122961329614296152961629617296182961929620296212962229623296242962529626296272962829629296302963129632296332963429635296362963729638296392964029641296422964329644296452964629647296482964929650296512965229653296542965529656296572965829659296602966129662296632966429665296662966729668296692967029671296722967329674296752967629677296782967929680296812968229683296842968529686296872968829689296902969129692296932969429695296962969729698296992970029701297022970329704297052970629707297082970929710297112971229713297142971529716297172971829719297202972129722297232972429725297262972729728297292973029731297322973329734297352973629737297382973929740297412974229743297442974529746297472974829749297502975129752297532975429755297562975729758297592976029761297622976329764297652976629767297682976929770297712977229773297742977529776297772977829779297802978129782297832978429785297862978729788297892979029791297922979329794297952979629797297982979929800298012980229803298042980529806298072980829809298102981129812298132981429815298162981729818298192982029821298222982329824298252982629827298282982929830298312983229833298342983529836298372983829839298402984129842298432984429845298462984729848298492985029851298522985329854298552985629857298582985929860298612986229863298642986529866298672986829869298702987129872298732987429875298762987729878298792988029881298822988329884298852988629887298882988929890298912989229893298942989529896298972989829899299002990129902299032990429905299062990729908299092991029911299122991329914299152991629917299182991929920299212992229923299242992529926299272992829929299302993129932299332993429935299362993729938299392994029941299422994329944299452994629947299482994929950299512995229953299542995529956299572995829959299602996129962299632996429965299662996729968299692997029971299722997329974299752997629977299782997929980299812998229983299842998529986299872998829989299902999129992299932999429995299962999729998299993000030001300023000330004300053000630007300083000930010300113001230013300143001530016300173001830019300203002130022300233002430025300263002730028300293003030031300323003330034300353003630037300383003930040300413004230043300443004530046300473004830049300503005130052300533005430055300563005730058300593006030061300623006330064300653006630067300683006930070300713007230073300743007530076300773007830079300803008130082300833008430085300863008730088300893009030091300923009330094300953009630097300983009930100301013010230103301043010530106301073010830109301103011130112301133011430115301163011730118301193012030121301223012330124301253012630127301283012930130301313013230133301343013530136301373013830139301403014130142301433014430145301463014730148301493015030151301523015330154301553015630157301583015930160301613016230163301643016530166301673016830169301703017130172301733017430175301763017730178301793018030181301823018330184301853018630187301883018930190301913019230193301943019530196301973019830199302003020130202302033020430205302063020730208302093021030211302123021330214302153021630217302183021930220302213022230223302243022530226302273022830229302303023130232302333023430235302363023730238302393024030241302423024330244302453024630247302483024930250302513025230253302543025530256302573025830259302603026130262302633026430265302663026730268302693027030271302723027330274302753027630277302783027930280302813028230283302843028530286302873028830289302903029130292302933029430295302963029730298302993030030301303023030330304303053030630307303083030930310303113031230313303143031530316303173031830319303203032130322303233032430325303263032730328303293033030331303323033330334303353033630337303383033930340303413034230343303443034530346303473034830349303503035130352303533035430355303563035730358303593036030361303623036330364303653036630367303683036930370303713037230373303743037530376303773037830379303803038130382303833038430385303863038730388303893039030391303923039330394303953039630397303983039930400304013040230403304043040530406304073040830409304103041130412304133041430415304163041730418304193042030421304223042330424304253042630427304283042930430304313043230433304343043530436304373043830439304403044130442304433044430445304463044730448304493045030451304523045330454304553045630457304583045930460304613046230463304643046530466304673046830469304703047130472304733047430475304763047730478304793048030481304823048330484304853048630487304883048930490304913049230493304943049530496304973049830499305003050130502305033050430505305063050730508305093051030511305123051330514305153051630517305183051930520305213052230523305243052530526305273052830529305303053130532305333053430535305363053730538305393054030541305423054330544305453054630547305483054930550305513055230553305543055530556305573055830559305603056130562305633056430565305663056730568305693057030571305723057330574305753057630577305783057930580305813058230583305843058530586305873058830589305903059130592305933059430595305963059730598305993060030601306023060330604306053060630607306083060930610306113061230613306143061530616306173061830619306203062130622306233062430625306263062730628306293063030631306323063330634306353063630637306383063930640306413064230643306443064530646306473064830649306503065130652306533065430655306563065730658306593066030661306623066330664306653066630667306683066930670306713067230673306743067530676306773067830679306803068130682306833068430685306863068730688306893069030691306923069330694306953069630697306983069930700307013070230703307043070530706307073070830709307103071130712307133071430715307163071730718307193072030721307223072330724307253072630727307283072930730307313073230733307343073530736307373073830739307403074130742307433074430745307463074730748307493075030751307523075330754307553075630757307583075930760307613076230763307643076530766307673076830769307703077130772307733077430775307763077730778307793078030781307823078330784307853078630787307883078930790307913079230793307943079530796307973079830799308003080130802308033080430805308063080730808308093081030811308123081330814308153081630817308183081930820308213082230823308243082530826308273082830829308303083130832308333083430835308363083730838308393084030841308423084330844308453084630847308483084930850308513085230853308543085530856308573085830859308603086130862308633086430865308663086730868308693087030871308723087330874308753087630877308783087930880308813088230883308843088530886308873088830889308903089130892308933089430895308963089730898308993090030901309023090330904309053090630907309083090930910309113091230913309143091530916309173091830919309203092130922309233092430925309263092730928309293093030931309323093330934309353093630937309383093930940309413094230943309443094530946309473094830949309503095130952309533095430955309563095730958309593096030961309623096330964309653096630967309683096930970309713097230973309743097530976309773097830979309803098130982309833098430985309863098730988309893099030991309923099330994309953099630997309983099931000310013100231003310043100531006310073100831009310103101131012310133101431015310163101731018310193102031021310223102331024310253102631027310283102931030310313103231033310343103531036310373103831039310403104131042310433104431045310463104731048310493105031051310523105331054310553105631057310583105931060310613106231063310643106531066310673106831069310703107131072310733107431075310763107731078310793108031081310823108331084310853108631087310883108931090310913109231093310943109531096310973109831099311003110131102311033110431105311063110731108311093111031111311123111331114311153111631117311183111931120311213112231123311243112531126311273112831129311303113131132311333113431135311363113731138311393114031141311423114331144311453114631147311483114931150311513115231153311543115531156311573115831159311603116131162311633116431165311663116731168311693117031171311723117331174311753117631177311783117931180311813118231183311843118531186311873118831189311903119131192311933119431195311963119731198311993120031201312023120331204312053120631207312083120931210312113121231213312143121531216312173121831219312203122131222312233122431225312263122731228312293123031231312323123331234312353123631237312383123931240312413124231243312443124531246312473124831249312503125131252312533125431255312563125731258312593126031261312623126331264312653126631267312683126931270312713127231273312743127531276312773127831279312803128131282312833128431285312863128731288312893129031291312923129331294312953129631297312983129931300313013130231303313043130531306313073130831309313103131131312313133131431315313163131731318313193132031321313223132331324313253132631327313283132931330313313133231333313343133531336313373133831339313403134131342313433134431345313463134731348313493135031351313523135331354313553135631357313583135931360313613136231363313643136531366313673136831369313703137131372313733137431375313763137731378313793138031381313823138331384313853138631387313883138931390313913139231393313943139531396313973139831399314003140131402314033140431405314063140731408314093141031411314123141331414314153141631417314183141931420314213142231423314243142531426314273142831429314303143131432314333143431435314363143731438314393144031441314423144331444314453144631447314483144931450314513145231453314543145531456314573145831459314603146131462314633146431465314663146731468314693147031471314723147331474314753147631477314783147931480314813148231483314843148531486314873148831489314903149131492314933149431495314963149731498314993150031501315023150331504315053150631507315083150931510315113151231513315143151531516315173151831519315203152131522315233152431525315263152731528315293153031531315323153331534315353153631537315383153931540315413154231543315443154531546315473154831549315503155131552315533155431555315563155731558315593156031561315623156331564315653156631567315683156931570315713157231573315743157531576315773157831579315803158131582315833158431585315863158731588315893159031591315923159331594315953159631597315983159931600316013160231603316043160531606316073160831609316103161131612316133161431615316163161731618316193162031621316223162331624316253162631627316283162931630316313163231633316343163531636316373163831639316403164131642316433164431645316463164731648316493165031651316523165331654316553165631657316583165931660316613166231663316643166531666316673166831669316703167131672316733167431675316763167731678316793168031681316823168331684316853168631687316883168931690316913169231693316943169531696316973169831699317003170131702317033170431705317063170731708317093171031711317123171331714317153171631717317183171931720317213172231723317243172531726317273172831729317303173131732317333173431735317363173731738317393174031741317423174331744317453174631747317483174931750317513175231753317543175531756317573175831759317603176131762317633176431765317663176731768317693177031771317723177331774317753177631777317783177931780317813178231783317843178531786317873178831789317903179131792317933179431795317963179731798317993180031801318023180331804318053180631807318083180931810318113181231813318143181531816318173181831819318203182131822318233182431825318263182731828318293183031831318323183331834318353183631837318383183931840318413184231843318443184531846318473184831849318503185131852318533185431855318563185731858318593186031861318623186331864318653186631867318683186931870318713187231873318743187531876318773187831879318803188131882318833188431885318863188731888318893189031891318923189331894318953189631897318983189931900319013190231903319043190531906319073190831909319103191131912319133191431915319163191731918319193192031921319223192331924319253192631927319283192931930319313193231933319343193531936319373193831939319403194131942319433194431945319463194731948319493195031951319523195331954319553195631957319583195931960319613196231963319643196531966319673196831969319703197131972319733197431975319763197731978319793198031981319823198331984319853198631987319883198931990319913199231993319943199531996319973199831999320003200132002320033200432005320063200732008320093201032011320123201332014320153201632017320183201932020320213202232023320243202532026320273202832029320303203132032320333203432035320363203732038320393204032041320423204332044320453204632047320483204932050320513205232053320543205532056320573205832059320603206132062320633206432065320663206732068320693207032071320723207332074320753207632077320783207932080320813208232083320843208532086320873208832089320903209132092320933209432095320963209732098320993210032101321023210332104321053210632107321083210932110321113211232113321143211532116321173211832119321203212132122321233212432125321263212732128321293213032131321323213332134321353213632137321383213932140321413214232143321443214532146321473214832149321503215132152321533215432155321563215732158321593216032161321623216332164321653216632167321683216932170321713217232173321743217532176321773217832179321803218132182321833218432185321863218732188321893219032191321923219332194321953219632197321983219932200322013220232203322043220532206322073220832209322103221132212322133221432215322163221732218322193222032221322223222332224322253222632227322283222932230322313223232233322343223532236322373223832239322403224132242322433224432245322463224732248322493225032251322523225332254322553225632257322583225932260322613226232263322643226532266322673226832269322703227132272322733227432275322763227732278322793228032281322823228332284322853228632287322883228932290322913229232293322943229532296322973229832299323003230132302323033230432305323063230732308323093231032311323123231332314323153231632317323183231932320323213232232323323243232532326323273232832329323303233132332323333233432335323363233732338323393234032341323423234332344323453234632347323483234932350323513235232353323543235532356323573235832359323603236132362323633236432365323663236732368323693237032371323723237332374323753237632377323783237932380323813238232383323843238532386323873238832389323903239132392323933239432395323963239732398323993240032401324023240332404324053240632407324083240932410324113241232413324143241532416324173241832419324203242132422324233242432425324263242732428324293243032431324323243332434324353243632437324383243932440324413244232443324443244532446324473244832449324503245132452324533245432455324563245732458324593246032461324623246332464324653246632467324683246932470324713247232473324743247532476324773247832479324803248132482324833248432485324863248732488324893249032491324923249332494324953249632497324983249932500325013250232503325043250532506325073250832509325103251132512325133251432515325163251732518325193252032521325223252332524325253252632527325283252932530325313253232533325343253532536325373253832539325403254132542325433254432545325463254732548325493255032551325523255332554325553255632557325583255932560325613256232563325643256532566325673256832569325703257132572325733257432575325763257732578325793258032581325823258332584325853258632587325883258932590325913259232593325943259532596325973259832599326003260132602326033260432605326063260732608326093261032611326123261332614326153261632617326183261932620326213262232623326243262532626326273262832629326303263132632326333263432635326363263732638326393264032641326423264332644326453264632647326483264932650326513265232653326543265532656326573265832659326603266132662326633266432665326663266732668326693267032671326723267332674326753267632677326783267932680326813268232683326843268532686326873268832689326903269132692326933269432695326963269732698326993270032701327023270332704327053270632707327083270932710327113271232713327143271532716327173271832719327203272132722327233272432725327263272732728327293273032731327323273332734327353273632737327383273932740327413274232743327443274532746327473274832749327503275132752327533275432755327563275732758327593276032761327623276332764327653276632767327683276932770327713277232773327743277532776327773277832779327803278132782327833278432785327863278732788327893279032791327923279332794327953279632797327983279932800328013280232803328043280532806328073280832809328103281132812328133281432815328163281732818328193282032821328223282332824328253282632827328283282932830328313283232833328343283532836328373283832839328403284132842328433284432845328463284732848328493285032851328523285332854328553285632857328583285932860328613286232863328643286532866328673286832869328703287132872328733287432875328763287732878328793288032881328823288332884328853288632887328883288932890328913289232893328943289532896328973289832899329003290132902329033290432905329063290732908329093291032911329123291332914329153291632917329183291932920329213292232923329243292532926329273292832929329303293132932329333293432935329363293732938329393294032941329423294332944329453294632947329483294932950329513295232953329543295532956329573295832959329603296132962329633296432965329663296732968329693297032971329723297332974329753297632977329783297932980329813298232983329843298532986329873298832989329903299132992329933299432995329963299732998329993300033001330023300333004330053300633007330083300933010330113301233013330143301533016330173301833019330203302133022330233302433025330263302733028330293303033031330323303333034330353303633037330383303933040330413304233043330443304533046330473304833049330503305133052330533305433055330563305733058330593306033061330623306333064330653306633067330683306933070330713307233073330743307533076330773307833079330803308133082330833308433085330863308733088330893309033091330923309333094330953309633097330983309933100331013310233103331043310533106331073310833109331103311133112331133311433115331163311733118331193312033121331223312333124331253312633127331283312933130331313313233133331343313533136331373313833139331403314133142331433314433145331463314733148331493315033151331523315333154331553315633157331583315933160331613316233163331643316533166331673316833169331703317133172331733317433175331763317733178331793318033181331823318333184331853318633187331883318933190331913319233193331943319533196331973319833199332003320133202332033320433205332063320733208332093321033211332123321333214332153321633217332183321933220332213322233223332243322533226332273322833229332303323133232332333323433235332363323733238332393324033241332423324333244332453324633247332483324933250332513325233253332543325533256332573325833259332603326133262332633326433265332663326733268332693327033271332723327333274332753327633277332783327933280332813328233283332843328533286332873328833289332903329133292332933329433295332963329733298332993330033301333023330333304333053330633307333083330933310333113331233313333143331533316333173331833319333203332133322333233332433325333263332733328333293333033331333323333333334333353333633337333383333933340333413334233343333443334533346333473334833349333503335133352333533335433355333563335733358333593336033361333623336333364333653336633367333683336933370333713337233373333743337533376333773337833379333803338133382333833338433385333863338733388333893339033391333923339333394333953339633397333983339933400334013340233403334043340533406334073340833409334103341133412334133341433415334163341733418334193342033421334223342333424334253342633427334283342933430334313343233433334343343533436334373343833439334403344133442334433344433445334463344733448334493345033451334523345333454334553345633457334583345933460334613346233463334643346533466334673346833469334703347133472334733347433475334763347733478334793348033481334823348333484334853348633487334883348933490334913349233493334943349533496334973349833499335003350133502335033350433505335063350733508335093351033511335123351333514335153351633517335183351933520335213352233523335243352533526335273352833529335303353133532335333353433535335363353733538335393354033541335423354333544335453354633547335483354933550335513355233553335543355533556335573355833559335603356133562335633356433565335663356733568335693357033571335723357333574335753357633577335783357933580335813358233583335843358533586335873358833589335903359133592335933359433595335963359733598335993360033601336023360333604336053360633607336083360933610336113361233613336143361533616336173361833619336203362133622336233362433625336263362733628336293363033631336323363333634336353363633637336383363933640336413364233643336443364533646336473364833649336503365133652336533365433655336563365733658336593366033661336623366333664336653366633667336683366933670336713367233673336743367533676336773367833679336803368133682336833368433685336863368733688336893369033691336923369333694336953369633697336983369933700337013370233703337043370533706337073370833709337103371133712337133371433715337163371733718337193372033721337223372333724337253372633727337283372933730337313373233733337343373533736337373373833739337403374133742337433374433745337463374733748337493375033751337523375333754337553375633757337583375933760337613376233763337643376533766337673376833769337703377133772337733377433775337763377733778337793378033781337823378333784337853378633787337883378933790337913379233793337943379533796337973379833799338003380133802338033380433805338063380733808338093381033811338123381333814338153381633817338183381933820338213382233823338243382533826338273382833829338303383133832338333383433835338363383733838338393384033841338423384333844338453384633847338483384933850338513385233853338543385533856338573385833859338603386133862338633386433865338663386733868338693387033871338723387333874338753387633877338783387933880338813388233883338843388533886338873388833889338903389133892338933389433895338963389733898338993390033901339023390333904339053390633907339083390933910339113391233913339143391533916339173391833919339203392133922339233392433925339263392733928339293393033931339323393333934339353393633937339383393933940339413394233943339443394533946339473394833949339503395133952339533395433955339563395733958339593396033961339623396333964339653396633967339683396933970339713397233973339743397533976339773397833979339803398133982339833398433985339863398733988339893399033991339923399333994339953399633997339983399934000340013400234003340043400534006340073400834009340103401134012340133401434015340163401734018340193402034021340223402334024340253402634027340283402934030340313403234033340343403534036340373403834039340403404134042340433404434045340463404734048340493405034051340523405334054340553405634057340583405934060340613406234063340643406534066340673406834069340703407134072340733407434075340763407734078340793408034081340823408334084340853408634087340883408934090340913409234093340943409534096340973409834099341003410134102341033410434105341063410734108341093411034111341123411334114341153411634117341183411934120341213412234123341243412534126341273412834129341303413134132341333413434135341363413734138341393414034141341423414334144341453414634147341483414934150341513415234153341543415534156341573415834159341603416134162341633416434165341663416734168341693417034171341723417334174341753417634177341783417934180341813418234183341843418534186341873418834189341903419134192341933419434195341963419734198341993420034201342023420334204342053420634207342083420934210342113421234213342143421534216342173421834219342203422134222342233422434225342263422734228342293423034231342323423334234342353423634237342383423934240342413424234243342443424534246342473424834249342503425134252342533425434255342563425734258342593426034261342623426334264342653426634267342683426934270342713427234273342743427534276342773427834279342803428134282342833428434285342863428734288342893429034291342923429334294342953429634297342983429934300343013430234303343043430534306343073430834309343103431134312343133431434315343163431734318343193432034321343223432334324343253432634327343283432934330343313433234333343343433534336343373433834339343403434134342343433434434345343463434734348343493435034351343523435334354343553435634357343583435934360343613436234363343643436534366343673436834369343703437134372343733437434375343763437734378343793438034381343823438334384343853438634387343883438934390343913439234393343943439534396343973439834399344003440134402344033440434405344063440734408344093441034411344123441334414344153441634417344183441934420344213442234423344243442534426344273442834429344303443134432344333443434435344363443734438344393444034441344423444334444344453444634447344483444934450344513445234453344543445534456344573445834459344603446134462344633446434465344663446734468344693447034471344723447334474344753447634477344783447934480344813448234483344843448534486344873448834489344903449134492344933449434495344963449734498344993450034501345023450334504345053450634507345083450934510345113451234513345143451534516345173451834519345203452134522345233452434525345263452734528345293453034531345323453334534345353453634537345383453934540345413454234543345443454534546345473454834549345503455134552345533455434555345563455734558345593456034561345623456334564345653456634567345683456934570345713457234573345743457534576345773457834579345803458134582345833458434585345863458734588345893459034591345923459334594345953459634597345983459934600346013460234603346043460534606346073460834609346103461134612346133461434615346163461734618346193462034621346223462334624346253462634627346283462934630346313463234633346343463534636346373463834639346403464134642346433464434645346463464734648346493465034651346523465334654346553465634657346583465934660346613466234663346643466534666346673466834669346703467134672346733467434675346763467734678346793468034681346823468334684346853468634687346883468934690346913469234693346943469534696346973469834699347003470134702347033470434705347063470734708347093471034711347123471334714347153471634717347183471934720347213472234723347243472534726347273472834729347303473134732347333473434735347363473734738347393474034741347423474334744347453474634747347483474934750347513475234753347543475534756347573475834759347603476134762347633476434765347663476734768347693477034771347723477334774347753477634777347783477934780347813478234783347843478534786347873478834789347903479134792347933479434795347963479734798347993480034801348023480334804348053480634807348083480934810348113481234813348143481534816348173481834819348203482134822348233482434825348263482734828348293483034831348323483334834348353483634837348383483934840348413484234843348443484534846348473484834849348503485134852348533485434855348563485734858348593486034861348623486334864348653486634867348683486934870348713487234873348743487534876348773487834879348803488134882348833488434885348863488734888348893489034891348923489334894348953489634897348983489934900349013490234903349043490534906349073490834909349103491134912349133491434915349163491734918349193492034921349223492334924349253492634927349283492934930349313493234933349343493534936349373493834939349403494134942349433494434945349463494734948349493495034951349523495334954349553495634957349583495934960349613496234963349643496534966349673496834969349703497134972349733497434975349763497734978349793498034981349823498334984349853498634987349883498934990349913499234993349943499534996349973499834999350003500135002350033500435005350063500735008350093501035011350123501335014350153501635017350183501935020350213502235023350243502535026350273502835029350303503135032350333503435035350363503735038350393504035041350423504335044350453504635047350483504935050350513505235053350543505535056350573505835059350603506135062350633506435065350663506735068350693507035071350723507335074350753507635077350783507935080350813508235083350843508535086350873508835089350903509135092350933509435095350963509735098350993510035101351023510335104351053510635107351083510935110351113511235113351143511535116351173511835119351203512135122351233512435125351263512735128351293513035131351323513335134351353513635137351383513935140351413514235143351443514535146351473514835149351503515135152351533515435155351563515735158351593516035161351623516335164351653516635167351683516935170351713517235173351743517535176351773517835179351803518135182351833518435185351863518735188351893519035191351923519335194351953519635197351983519935200352013520235203352043520535206352073520835209352103521135212352133521435215352163521735218352193522035221352223522335224352253522635227352283522935230352313523235233352343523535236352373523835239352403524135242352433524435245352463524735248352493525035251352523525335254352553525635257352583525935260352613526235263352643526535266352673526835269352703527135272352733527435275352763527735278352793528035281352823528335284352853528635287352883528935290352913529235293352943529535296352973529835299353003530135302353033530435305353063530735308353093531035311353123531335314353153531635317353183531935320353213532235323353243532535326353273532835329353303533135332353333533435335353363533735338353393534035341353423534335344353453534635347353483534935350353513535235353353543535535356353573535835359353603536135362353633536435365353663536735368353693537035371353723537335374353753537635377353783537935380353813538235383353843538535386353873538835389353903539135392353933539435395353963539735398353993540035401354023540335404354053540635407354083540935410354113541235413354143541535416354173541835419354203542135422354233542435425354263542735428354293543035431354323543335434354353543635437354383543935440354413544235443354443544535446354473544835449354503545135452354533545435455354563545735458354593546035461354623546335464354653546635467354683546935470354713547235473354743547535476354773547835479354803548135482354833548435485354863548735488354893549035491354923549335494354953549635497354983549935500355013550235503355043550535506355073550835509355103551135512355133551435515355163551735518355193552035521355223552335524355253552635527355283552935530355313553235533355343553535536355373553835539355403554135542355433554435545355463554735548355493555035551355523555335554355553555635557355583555935560355613556235563355643556535566355673556835569355703557135572355733557435575355763557735578355793558035581355823558335584355853558635587355883558935590355913559235593355943559535596355973559835599356003560135602356033560435605356063560735608356093561035611356123561335614356153561635617356183561935620356213562235623356243562535626356273562835629356303563135632356333563435635356363563735638356393564035641356423564335644356453564635647356483564935650356513565235653356543565535656356573565835659356603566135662356633566435665356663566735668356693567035671356723567335674356753567635677356783567935680356813568235683356843568535686356873568835689356903569135692356933569435695356963569735698356993570035701357023570335704357053570635707357083570935710357113571235713357143571535716357173571835719357203572135722357233572435725357263572735728357293573035731357323573335734357353573635737357383573935740357413574235743357443574535746357473574835749357503575135752357533575435755357563575735758357593576035761357623576335764357653576635767357683576935770357713577235773357743577535776357773577835779357803578135782357833578435785357863578735788357893579035791357923579335794357953579635797357983579935800358013580235803358043580535806358073580835809358103581135812358133581435815358163581735818358193582035821358223582335824358253582635827358283582935830358313583235833358343583535836358373583835839358403584135842358433584435845358463584735848358493585035851358523585335854358553585635857358583585935860358613586235863358643586535866358673586835869358703587135872358733587435875358763587735878358793588035881358823588335884358853588635887358883588935890358913589235893358943589535896358973589835899359003590135902359033590435905359063590735908359093591035911359123591335914359153591635917359183591935920359213592235923359243592535926359273592835929359303593135932359333593435935359363593735938359393594035941359423594335944359453594635947359483594935950359513595235953359543595535956359573595835959359603596135962359633596435965359663596735968359693597035971359723597335974359753597635977359783597935980359813598235983359843598535986359873598835989359903599135992359933599435995359963599735998359993600036001360023600336004360053600636007360083600936010360113601236013360143601536016360173601836019360203602136022360233602436025360263602736028360293603036031360323603336034360353603636037360383603936040360413604236043360443604536046360473604836049360503605136052360533605436055360563605736058360593606036061360623606336064360653606636067360683606936070360713607236073360743607536076360773607836079360803608136082360833608436085360863608736088360893609036091360923609336094360953609636097360983609936100361013610236103361043610536106361073610836109361103611136112361133611436115361163611736118361193612036121361223612336124361253612636127361283612936130361313613236133361343613536136361373613836139361403614136142361433614436145361463614736148361493615036151361523615336154361553615636157361583615936160361613616236163361643616536166361673616836169361703617136172361733617436175361763617736178361793618036181361823618336184361853618636187361883618936190361913619236193361943619536196361973619836199362003620136202362033620436205362063620736208362093621036211362123621336214362153621636217362183621936220362213622236223362243622536226362273622836229362303623136232362333623436235362363623736238362393624036241362423624336244362453624636247362483624936250362513625236253362543625536256362573625836259362603626136262362633626436265362663626736268362693627036271362723627336274362753627636277362783627936280362813628236283362843628536286362873628836289362903629136292362933629436295362963629736298362993630036301363023630336304363053630636307363083630936310363113631236313363143631536316363173631836319363203632136322363233632436325363263632736328363293633036331363323633336334363353633636337363383633936340363413634236343363443634536346363473634836349363503635136352363533635436355363563635736358363593636036361363623636336364363653636636367363683636936370363713637236373363743637536376363773637836379363803638136382363833638436385363863638736388363893639036391363923639336394363953639636397363983639936400364013640236403364043640536406364073640836409364103641136412364133641436415364163641736418364193642036421364223642336424364253642636427364283642936430364313643236433364343643536436364373643836439364403644136442364433644436445364463644736448364493645036451364523645336454364553645636457364583645936460364613646236463364643646536466364673646836469364703647136472364733647436475364763647736478364793648036481364823648336484364853648636487364883648936490364913649236493364943649536496364973649836499365003650136502365033650436505365063650736508365093651036511365123651336514365153651636517365183651936520365213652236523365243652536526365273652836529365303653136532365333653436535365363653736538365393654036541365423654336544365453654636547365483654936550365513655236553365543655536556365573655836559365603656136562365633656436565365663656736568365693657036571365723657336574365753657636577365783657936580365813658236583365843658536586365873658836589365903659136592365933659436595365963659736598365993660036601366023660336604366053660636607366083660936610366113661236613366143661536616366173661836619366203662136622366233662436625366263662736628366293663036631366323663336634366353663636637366383663936640366413664236643366443664536646366473664836649366503665136652366533665436655366563665736658366593666036661366623666336664366653666636667366683666936670366713667236673366743667536676366773667836679366803668136682366833668436685366863668736688366893669036691366923669336694366953669636697366983669936700367013670236703367043670536706367073670836709367103671136712367133671436715367163671736718367193672036721367223672336724367253672636727367283672936730367313673236733367343673536736367373673836739367403674136742367433674436745367463674736748367493675036751367523675336754367553675636757367583675936760367613676236763367643676536766367673676836769367703677136772367733677436775367763677736778367793678036781367823678336784367853678636787367883678936790367913679236793367943679536796367973679836799368003680136802368033680436805368063680736808368093681036811368123681336814368153681636817368183681936820368213682236823368243682536826368273682836829368303683136832368333683436835368363683736838368393684036841368423684336844368453684636847368483684936850368513685236853368543685536856368573685836859368603686136862368633686436865368663686736868368693687036871368723687336874368753687636877368783687936880368813688236883368843688536886368873688836889368903689136892368933689436895368963689736898368993690036901369023690336904369053690636907369083690936910369113691236913369143691536916369173691836919369203692136922369233692436925369263692736928369293693036931369323693336934369353693636937369383693936940369413694236943369443694536946369473694836949369503695136952369533695436955369563695736958369593696036961369623696336964369653696636967369683696936970369713697236973369743697536976369773697836979369803698136982369833698436985369863698736988369893699036991369923699336994369953699636997369983699937000370013700237003370043700537006370073700837009370103701137012370133701437015370163701737018370193702037021370223702337024370253702637027370283702937030370313703237033370343703537036370373703837039370403704137042370433704437045370463704737048370493705037051370523705337054370553705637057370583705937060370613706237063370643706537066370673706837069370703707137072370733707437075370763707737078370793708037081370823708337084370853708637087370883708937090370913709237093370943709537096370973709837099371003710137102371033710437105371063710737108371093711037111371123711337114371153711637117371183711937120371213712237123371243712537126371273712837129371303713137132371333713437135371363713737138371393714037141371423714337144371453714637147371483714937150371513715237153371543715537156371573715837159371603716137162371633716437165371663716737168371693717037171371723717337174371753717637177371783717937180371813718237183371843718537186371873718837189371903719137192371933719437195371963719737198371993720037201372023720337204372053720637207372083720937210372113721237213372143721537216372173721837219372203722137222372233722437225372263722737228372293723037231372323723337234372353723637237372383723937240372413724237243372443724537246372473724837249372503725137252372533725437255372563725737258372593726037261372623726337264372653726637267372683726937270372713727237273372743727537276372773727837279372803728137282372833728437285372863728737288372893729037291372923729337294372953729637297372983729937300373013730237303373043730537306373073730837309373103731137312373133731437315373163731737318373193732037321373223732337324373253732637327373283732937330373313733237333373343733537336373373733837339373403734137342373433734437345373463734737348373493735037351373523735337354373553735637357373583735937360373613736237363373643736537366373673736837369373703737137372373733737437375373763737737378373793738037381373823738337384373853738637387373883738937390373913739237393373943739537396373973739837399374003740137402374033740437405374063740737408374093741037411374123741337414374153741637417374183741937420374213742237423374243742537426374273742837429374303743137432374333743437435374363743737438374393744037441374423744337444374453744637447374483744937450374513745237453374543745537456374573745837459374603746137462374633746437465374663746737468374693747037471374723747337474374753747637477374783747937480374813748237483374843748537486374873748837489374903749137492374933749437495374963749737498374993750037501375023750337504375053750637507375083750937510375113751237513375143751537516375173751837519375203752137522375233752437525375263752737528375293753037531375323753337534375353753637537375383753937540375413754237543375443754537546375473754837549375503755137552375533755437555375563755737558375593756037561375623756337564375653756637567375683756937570375713757237573375743757537576375773757837579375803758137582375833758437585375863758737588375893759037591375923759337594375953759637597375983759937600376013760237603376043760537606376073760837609376103761137612376133761437615376163761737618376193762037621376223762337624376253762637627376283762937630376313763237633376343763537636376373763837639376403764137642376433764437645376463764737648376493765037651376523765337654376553765637657376583765937660376613766237663376643766537666376673766837669376703767137672376733767437675376763767737678376793768037681376823768337684376853768637687376883768937690376913769237693376943769537696376973769837699377003770137702377033770437705377063770737708377093771037711377123771337714377153771637717377183771937720377213772237723377243772537726377273772837729377303773137732377333773437735377363773737738377393774037741377423774337744377453774637747377483774937750377513775237753377543775537756377573775837759377603776137762377633776437765377663776737768377693777037771377723777337774377753777637777377783777937780377813778237783377843778537786377873778837789377903779137792377933779437795377963779737798377993780037801378023780337804378053780637807378083780937810378113781237813378143781537816378173781837819378203782137822378233782437825378263782737828378293783037831378323783337834378353783637837378383783937840378413784237843378443784537846378473784837849378503785137852378533785437855378563785737858378593786037861378623786337864378653786637867378683786937870378713787237873378743787537876378773787837879378803788137882378833788437885378863788737888378893789037891378923789337894378953789637897378983789937900379013790237903379043790537906379073790837909379103791137912379133791437915379163791737918379193792037921379223792337924379253792637927379283792937930379313793237933379343793537936379373793837939379403794137942379433794437945379463794737948379493795037951379523795337954379553795637957379583795937960379613796237963379643796537966379673796837969379703797137972379733797437975379763797737978379793798037981379823798337984379853798637987379883798937990379913799237993379943799537996379973799837999380003800138002380033800438005380063800738008380093801038011380123801338014380153801638017380183801938020380213802238023380243802538026380273802838029380303803138032380333803438035380363803738038380393804038041380423804338044380453804638047380483804938050380513805238053380543805538056380573805838059380603806138062380633806438065380663806738068380693807038071380723807338074380753807638077380783807938080380813808238083380843808538086380873808838089380903809138092380933809438095380963809738098380993810038101381023810338104381053810638107381083810938110381113811238113381143811538116381173811838119381203812138122381233812438125381263812738128381293813038131381323813338134381353813638137381383813938140381413814238143381443814538146381473814838149381503815138152381533815438155381563815738158381593816038161381623816338164381653816638167381683816938170381713817238173381743817538176381773817838179381803818138182381833818438185381863818738188381893819038191381923819338194381953819638197381983819938200382013820238203382043820538206382073820838209382103821138212382133821438215382163821738218382193822038221382223822338224382253822638227382283822938230382313823238233382343823538236382373823838239382403824138242382433824438245382463824738248382493825038251382523825338254382553825638257382583825938260382613826238263382643826538266382673826838269382703827138272382733827438275382763827738278382793828038281382823828338284382853828638287382883828938290382913829238293382943829538296382973829838299383003830138302383033830438305383063830738308383093831038311383123831338314383153831638317383183831938320383213832238323383243832538326383273832838329383303833138332383333833438335383363833738338383393834038341383423834338344383453834638347383483834938350383513835238353383543835538356383573835838359383603836138362383633836438365383663836738368383693837038371383723837338374383753837638377383783837938380383813838238383383843838538386383873838838389383903839138392383933839438395383963839738398383993840038401384023840338404384053840638407384083840938410384113841238413384143841538416384173841838419384203842138422384233842438425384263842738428384293843038431384323843338434384353843638437384383843938440384413844238443384443844538446384473844838449384503845138452384533845438455384563845738458384593846038461384623846338464384653846638467384683846938470384713847238473384743847538476
  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. // Configure host includeIf for worktrees
  408. const hostWorktreeIncludeKey = `includeIf.gitdir:${gitDir}/worktrees/*.path`;
  409. yield this.git.config(hostWorktreeIncludeKey, credentialsConfigPath);
  410. // Container git directory
  411. const workingDirectory = this.git.getWorkingDirectory();
  412. const githubWorkspace = process.env['GITHUB_WORKSPACE'];
  413. assert.ok(githubWorkspace, 'GITHUB_WORKSPACE is not defined');
  414. let relativePath = path.relative(githubWorkspace, workingDirectory);
  415. relativePath = relativePath.replace(/\\/g, '/'); // Use forward slashes, even on Windows
  416. const containerGitDir = path.posix.join('/github/workspace', relativePath, '.git');
  417. // Container credentials config path
  418. const containerCredentialsPath = path.posix.join('/github/runner_temp', path.basename(credentialsConfigPath));
  419. // Configure container includeIf
  420. const containerIncludeKey = `includeIf.gitdir:${containerGitDir}.path`;
  421. yield this.git.config(containerIncludeKey, containerCredentialsPath);
  422. // Configure container includeIf for worktrees
  423. const containerWorktreeIncludeKey = `includeIf.gitdir:${containerGitDir}/worktrees/*.path`;
  424. yield this.git.config(containerWorktreeIncludeKey, containerCredentialsPath);
  425. }
  426. });
  427. }
  428. /**
  429. * Gets or creates the path to the credentials config file in RUNNER_TEMP.
  430. * @returns The absolute path to the credentials config file
  431. */
  432. getCredentialsConfigPath() {
  433. if (this.credentialsConfigPath) {
  434. return this.credentialsConfigPath;
  435. }
  436. const runnerTemp = process.env['RUNNER_TEMP'] || '';
  437. assert.ok(runnerTemp, 'RUNNER_TEMP is not defined');
  438. // Create a unique filename for this checkout instance
  439. const configFileName = `git-credentials-${(0, uuid_1.v4)()}.config`;
  440. this.credentialsConfigPath = path.join(runnerTemp, configFileName);
  441. core.debug(`Credentials config path: ${this.credentialsConfigPath}`);
  442. return this.credentialsConfigPath;
  443. }
  444. /**
  445. * Removes SSH authentication configuration by cleaning up SSH keys,
  446. * known hosts files, and SSH command configurations.
  447. */
  448. removeSsh() {
  449. return __awaiter(this, void 0, void 0, function* () {
  450. var _a, _b;
  451. // SSH key
  452. const keyPath = this.sshKeyPath || stateHelper.SshKeyPath;
  453. if (keyPath) {
  454. try {
  455. core.info(`Removing SSH key '${keyPath}'`);
  456. yield io.rmRF(keyPath);
  457. }
  458. catch (err) {
  459. core.debug(`${(_a = err === null || err === void 0 ? void 0 : err.message) !== null && _a !== void 0 ? _a : err}`);
  460. core.warning(`Failed to remove SSH key '${keyPath}'`);
  461. }
  462. }
  463. // SSH known hosts
  464. const knownHostsPath = this.sshKnownHostsPath || stateHelper.SshKnownHostsPath;
  465. if (knownHostsPath) {
  466. try {
  467. core.info(`Removing SSH known hosts '${knownHostsPath}'`);
  468. yield io.rmRF(knownHostsPath);
  469. }
  470. catch (err) {
  471. core.debug(`${(_b = err === null || err === void 0 ? void 0 : err.message) !== null && _b !== void 0 ? _b : err}`);
  472. core.warning(`Failed to remove SSH known hosts '${knownHostsPath}'`);
  473. }
  474. }
  475. // SSH command
  476. core.info('Removing SSH command configuration');
  477. yield this.removeGitConfig(SSH_COMMAND_KEY);
  478. yield this.removeSubmoduleGitConfig(SSH_COMMAND_KEY);
  479. });
  480. }
  481. /**
  482. * Removes token-based authentication by cleaning up HTTP headers,
  483. * includeIf entries, and credentials config files.
  484. */
  485. removeToken() {
  486. return __awaiter(this, void 0, void 0, function* () {
  487. var _a;
  488. // Remove HTTP extra header
  489. core.info('Removing HTTP extra header');
  490. yield this.removeGitConfig(this.tokenConfigKey);
  491. yield this.removeSubmoduleGitConfig(this.tokenConfigKey);
  492. // Collect credentials config paths that need to be removed
  493. const credentialsPaths = new Set();
  494. // Remove includeIf entries that point to git-credentials-*.config files
  495. core.info('Removing includeIf entries pointing to credentials config files');
  496. const mainCredentialsPaths = yield this.removeIncludeIfCredentials();
  497. mainCredentialsPaths.forEach(path => credentialsPaths.add(path));
  498. // Remove submodule includeIf entries that point to git-credentials-*.config files
  499. const submoduleConfigPaths = yield this.git.getSubmoduleConfigPaths(true);
  500. for (const configPath of submoduleConfigPaths) {
  501. const submoduleCredentialsPaths = yield this.removeIncludeIfCredentials(configPath);
  502. submoduleCredentialsPaths.forEach(path => credentialsPaths.add(path));
  503. }
  504. // Remove credentials config files
  505. for (const credentialsPath of credentialsPaths) {
  506. // Only remove credentials config files if they are under RUNNER_TEMP
  507. const runnerTemp = process.env['RUNNER_TEMP'];
  508. assert.ok(runnerTemp, 'RUNNER_TEMP is not defined');
  509. if (credentialsPath.startsWith(runnerTemp)) {
  510. try {
  511. core.info(`Removing credentials config '${credentialsPath}'`);
  512. yield io.rmRF(credentialsPath);
  513. }
  514. catch (err) {
  515. core.debug(`${(_a = err === null || err === void 0 ? void 0 : err.message) !== null && _a !== void 0 ? _a : err}`);
  516. core.warning(`Failed to remove credentials config '${credentialsPath}'`);
  517. }
  518. }
  519. else {
  520. core.debug(`Skipping removal of credentials config '${credentialsPath}' - not under RUNNER_TEMP`);
  521. }
  522. }
  523. });
  524. }
  525. /**
  526. * Removes a git config key from the local repository config.
  527. * @param configKey The git config key to remove
  528. */
  529. removeGitConfig(configKey) {
  530. return __awaiter(this, void 0, void 0, function* () {
  531. if ((yield this.git.configExists(configKey)) &&
  532. !(yield this.git.tryConfigUnset(configKey))) {
  533. // Load the config contents
  534. core.warning(`Failed to remove '${configKey}' from the git config`);
  535. }
  536. });
  537. }
  538. /**
  539. * Removes a git config key from all submodule configs.
  540. * @param configKey The git config key to remove
  541. */
  542. removeSubmoduleGitConfig(configKey) {
  543. return __awaiter(this, void 0, void 0, function* () {
  544. const pattern = regexpHelper.escape(configKey);
  545. yield this.git.submoduleForeach(
  546. // Wrap the pipeline in quotes to make sure it's handled properly by submoduleForeach, rather than just the first part of the pipeline.
  547. `sh -c "git config --local --name-only --get-regexp '${pattern}' && git config --local --unset-all '${configKey}' || :"`, true);
  548. });
  549. }
  550. /**
  551. * Removes includeIf entries that point to git-credentials-*.config files.
  552. * @param configPath Optional path to a specific git config file to operate on
  553. * @returns Array of unique credentials config file paths that were found and removed
  554. */
  555. removeIncludeIfCredentials(configPath) {
  556. return __awaiter(this, void 0, void 0, function* () {
  557. const credentialsPaths = new Set();
  558. try {
  559. // Get all includeIf.gitdir keys
  560. const keys = yield this.git.tryGetConfigKeys('^includeIf\\.gitdir:', false, // globalConfig?
  561. configPath);
  562. for (const key of keys) {
  563. // Get all values for this key
  564. const values = yield this.git.tryGetConfigValues(key, false, // globalConfig?
  565. configPath);
  566. if (values.length > 0) {
  567. // Remove only values that match git-credentials-<uuid>.config pattern
  568. for (const value of values) {
  569. if (this.testCredentialsConfigPath(value)) {
  570. credentialsPaths.add(value);
  571. yield this.git.tryConfigUnsetValue(key, value, false, configPath);
  572. }
  573. }
  574. }
  575. }
  576. }
  577. catch (err) {
  578. // Ignore errors - this is cleanup code
  579. if (configPath) {
  580. core.debug(`Error during includeIf cleanup for ${configPath}: ${err}`);
  581. }
  582. else {
  583. core.debug(`Error during includeIf cleanup: ${err}`);
  584. }
  585. }
  586. return Array.from(credentialsPaths);
  587. });
  588. }
  589. /**
  590. * Tests if a path matches the git-credentials-*.config pattern.
  591. * @param path The path to test
  592. * @returns True if the path matches the credentials config pattern
  593. */
  594. testCredentialsConfigPath(path) {
  595. return /git-credentials-[0-9a-f-]+\.config$/i.test(path);
  596. }
  597. }
  598. /***/ }),
  599. /***/ 738:
  600. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  601. "use strict";
  602. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  603. if (k2 === undefined) k2 = k;
  604. var desc = Object.getOwnPropertyDescriptor(m, k);
  605. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  606. desc = { enumerable: true, get: function() { return m[k]; } };
  607. }
  608. Object.defineProperty(o, k2, desc);
  609. }) : (function(o, m, k, k2) {
  610. if (k2 === undefined) k2 = k;
  611. o[k2] = m[k];
  612. }));
  613. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  614. Object.defineProperty(o, "default", { enumerable: true, value: v });
  615. }) : function(o, v) {
  616. o["default"] = v;
  617. });
  618. var __importStar = (this && this.__importStar) || function (mod) {
  619. if (mod && mod.__esModule) return mod;
  620. var result = {};
  621. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  622. __setModuleDefault(result, mod);
  623. return result;
  624. };
  625. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  626. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  627. return new (P || (P = Promise))(function (resolve, reject) {
  628. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  629. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  630. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  631. step((generator = generator.apply(thisArg, _arguments || [])).next());
  632. });
  633. };
  634. Object.defineProperty(exports, "__esModule", ({ value: true }));
  635. exports.MinimumGitSparseCheckoutVersion = exports.MinimumGitVersion = void 0;
  636. exports.createCommandManager = createCommandManager;
  637. const core = __importStar(__nccwpck_require__(2186));
  638. const exec = __importStar(__nccwpck_require__(1514));
  639. const fs = __importStar(__nccwpck_require__(7147));
  640. const fshelper = __importStar(__nccwpck_require__(7219));
  641. const io = __importStar(__nccwpck_require__(7436));
  642. const path = __importStar(__nccwpck_require__(1017));
  643. const refHelper = __importStar(__nccwpck_require__(8601));
  644. const regexpHelper = __importStar(__nccwpck_require__(3120));
  645. const retryHelper = __importStar(__nccwpck_require__(2155));
  646. const git_version_1 = __nccwpck_require__(3142);
  647. // Auth header not supported before 2.9
  648. // Wire protocol v2 not supported before 2.18
  649. // sparse-checkout not [well-]supported before 2.28 (see https://github.com/actions/checkout/issues/1386)
  650. exports.MinimumGitVersion = new git_version_1.GitVersion('2.18');
  651. exports.MinimumGitSparseCheckoutVersion = new git_version_1.GitVersion('2.28');
  652. function createCommandManager(workingDirectory, lfs, doSparseCheckout) {
  653. return __awaiter(this, void 0, void 0, function* () {
  654. return yield GitCommandManager.createCommandManager(workingDirectory, lfs, doSparseCheckout);
  655. });
  656. }
  657. class GitCommandManager {
  658. // Private constructor; use createCommandManager()
  659. constructor() {
  660. this.gitEnv = {
  661. GIT_TERMINAL_PROMPT: '0', // Disable git prompt
  662. GCM_INTERACTIVE: 'Never' // Disable prompting for git credential manager
  663. };
  664. this.gitPath = '';
  665. this.lfs = false;
  666. this.doSparseCheckout = false;
  667. this.workingDirectory = '';
  668. this.gitVersion = new git_version_1.GitVersion();
  669. }
  670. branchDelete(remote, branch) {
  671. return __awaiter(this, void 0, void 0, function* () {
  672. const args = ['branch', '--delete', '--force'];
  673. if (remote) {
  674. args.push('--remote');
  675. }
  676. args.push(branch);
  677. yield this.execGit(args);
  678. });
  679. }
  680. branchExists(remote, pattern) {
  681. return __awaiter(this, void 0, void 0, function* () {
  682. const args = ['branch', '--list'];
  683. if (remote) {
  684. args.push('--remote');
  685. }
  686. args.push(pattern);
  687. const output = yield this.execGit(args);
  688. return !!output.stdout.trim();
  689. });
  690. }
  691. branchList(remote) {
  692. return __awaiter(this, void 0, void 0, function* () {
  693. const result = [];
  694. // Note, this implementation uses "rev-parse --symbolic-full-name" because the output from
  695. // "branch --list" is more difficult when in a detached HEAD state.
  696. // TODO(https://github.com/actions/checkout/issues/786): this implementation uses
  697. // "rev-parse --symbolic-full-name" because there is a bug
  698. // in Git 2.18 that causes "rev-parse --symbolic" to output symbolic full names. When
  699. // 2.18 is no longer supported, we can switch back to --symbolic.
  700. const args = ['rev-parse', '--symbolic-full-name'];
  701. if (remote) {
  702. args.push('--remotes=origin');
  703. }
  704. else {
  705. args.push('--branches');
  706. }
  707. const stderr = [];
  708. const errline = [];
  709. const stdout = [];
  710. const stdline = [];
  711. const listeners = {
  712. stderr: (data) => {
  713. stderr.push(data.toString());
  714. },
  715. errline: (data) => {
  716. errline.push(data.toString());
  717. },
  718. stdout: (data) => {
  719. stdout.push(data.toString());
  720. },
  721. stdline: (data) => {
  722. stdline.push(data.toString());
  723. }
  724. };
  725. // Suppress the output in order to avoid flooding annotations with innocuous errors.
  726. yield this.execGit(args, false, true, listeners);
  727. core.debug(`stderr callback is: ${stderr}`);
  728. core.debug(`errline callback is: ${errline}`);
  729. core.debug(`stdout callback is: ${stdout}`);
  730. core.debug(`stdline callback is: ${stdline}`);
  731. for (let branch of stdline) {
  732. branch = branch.trim();
  733. if (!branch) {
  734. continue;
  735. }
  736. if (branch.startsWith('refs/heads/')) {
  737. branch = branch.substring('refs/heads/'.length);
  738. }
  739. else if (branch.startsWith('refs/remotes/')) {
  740. branch = branch.substring('refs/remotes/'.length);
  741. }
  742. result.push(branch);
  743. }
  744. return result;
  745. });
  746. }
  747. disableSparseCheckout() {
  748. return __awaiter(this, void 0, void 0, function* () {
  749. yield this.execGit(['sparse-checkout', 'disable']);
  750. // Disabling 'sparse-checkout` leaves behind an undesirable side-effect in config (even in a pristine environment).
  751. yield this.tryConfigUnset('extensions.worktreeConfig', false);
  752. });
  753. }
  754. sparseCheckout(sparseCheckout) {
  755. return __awaiter(this, void 0, void 0, function* () {
  756. yield this.execGit(['sparse-checkout', 'set', ...sparseCheckout]);
  757. });
  758. }
  759. sparseCheckoutNonConeMode(sparseCheckout) {
  760. return __awaiter(this, void 0, void 0, function* () {
  761. yield this.execGit(['config', 'core.sparseCheckout', 'true']);
  762. const output = yield this.execGit([
  763. 'rev-parse',
  764. '--git-path',
  765. 'info/sparse-checkout'
  766. ]);
  767. const sparseCheckoutPath = path.join(this.workingDirectory, output.stdout.trimRight());
  768. yield fs.promises.appendFile(sparseCheckoutPath, `\n${sparseCheckout.join('\n')}\n`);
  769. });
  770. }
  771. checkout(ref, startPoint) {
  772. return __awaiter(this, void 0, void 0, function* () {
  773. const args = ['checkout', '--progress', '--force'];
  774. if (startPoint) {
  775. args.push('-B', ref, startPoint);
  776. }
  777. else {
  778. args.push(ref);
  779. }
  780. yield this.execGit(args);
  781. });
  782. }
  783. checkoutDetach() {
  784. return __awaiter(this, void 0, void 0, function* () {
  785. const args = ['checkout', '--detach'];
  786. yield this.execGit(args);
  787. });
  788. }
  789. config(configKey, configValue, globalConfig, add, configFile) {
  790. return __awaiter(this, void 0, void 0, function* () {
  791. const args = ['config'];
  792. if (configFile) {
  793. args.push('--file', configFile);
  794. }
  795. else {
  796. args.push(globalConfig ? '--global' : '--local');
  797. }
  798. if (add) {
  799. args.push('--add');
  800. }
  801. args.push(...[configKey, configValue]);
  802. yield this.execGit(args);
  803. });
  804. }
  805. configExists(configKey, globalConfig) {
  806. return __awaiter(this, void 0, void 0, function* () {
  807. const pattern = regexpHelper.escape(configKey);
  808. const output = yield this.execGit([
  809. 'config',
  810. globalConfig ? '--global' : '--local',
  811. '--name-only',
  812. '--get-regexp',
  813. pattern
  814. ], true);
  815. return output.exitCode === 0;
  816. });
  817. }
  818. fetch(refSpec, options) {
  819. return __awaiter(this, void 0, void 0, function* () {
  820. const args = ['-c', 'protocol.version=2', 'fetch'];
  821. if (!refSpec.some(x => x === refHelper.tagsRefSpec) && !options.fetchTags) {
  822. args.push('--no-tags');
  823. }
  824. args.push('--prune', '--no-recurse-submodules');
  825. if (options.showProgress) {
  826. args.push('--progress');
  827. }
  828. if (options.filter) {
  829. args.push(`--filter=${options.filter}`);
  830. }
  831. if (options.fetchDepth && options.fetchDepth > 0) {
  832. args.push(`--depth=${options.fetchDepth}`);
  833. }
  834. else if (fshelper.fileExistsSync(path.join(this.workingDirectory, '.git', 'shallow'))) {
  835. args.push('--unshallow');
  836. }
  837. args.push('origin');
  838. for (const arg of refSpec) {
  839. args.push(arg);
  840. }
  841. const that = this;
  842. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  843. yield that.execGit(args);
  844. }));
  845. });
  846. }
  847. getDefaultBranch(repositoryUrl) {
  848. return __awaiter(this, void 0, void 0, function* () {
  849. let output;
  850. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  851. output = yield this.execGit([
  852. 'ls-remote',
  853. '--quiet',
  854. '--exit-code',
  855. '--symref',
  856. repositoryUrl,
  857. 'HEAD'
  858. ]);
  859. }));
  860. if (output) {
  861. // Satisfy compiler, will always be set
  862. for (let line of output.stdout.trim().split('\n')) {
  863. line = line.trim();
  864. if (line.startsWith('ref:') || line.endsWith('HEAD')) {
  865. return line
  866. .substr('ref:'.length, line.length - 'ref:'.length - 'HEAD'.length)
  867. .trim();
  868. }
  869. }
  870. }
  871. throw new Error('Unexpected output when retrieving default branch');
  872. });
  873. }
  874. getSubmoduleConfigPaths(recursive) {
  875. return __awaiter(this, void 0, void 0, function* () {
  876. // Get submodule config file paths.
  877. // Use `--show-origin` to get the config file path for each submodule.
  878. const output = yield this.submoduleForeach(`git config --local --show-origin --name-only --get-regexp remote.origin.url`, recursive);
  879. // Extract config file paths from the output (lines starting with "file:").
  880. const configPaths = output.match(/(?<=(^|\n)file:)[^\t]+(?=\tremote\.origin\.url)/g) || [];
  881. return configPaths;
  882. });
  883. }
  884. getWorkingDirectory() {
  885. return this.workingDirectory;
  886. }
  887. init() {
  888. return __awaiter(this, void 0, void 0, function* () {
  889. yield this.execGit(['init', this.workingDirectory]);
  890. });
  891. }
  892. isDetached() {
  893. return __awaiter(this, void 0, void 0, function* () {
  894. // Note, "branch --show-current" would be simpler but isn't available until Git 2.22
  895. const output = yield this.execGit(['rev-parse', '--symbolic-full-name', '--verify', '--quiet', 'HEAD'], true);
  896. return !output.stdout.trim().startsWith('refs/heads/');
  897. });
  898. }
  899. lfsFetch(ref) {
  900. return __awaiter(this, void 0, void 0, function* () {
  901. const args = ['lfs', 'fetch', 'origin', ref];
  902. const that = this;
  903. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  904. yield that.execGit(args);
  905. }));
  906. });
  907. }
  908. lfsInstall() {
  909. return __awaiter(this, void 0, void 0, function* () {
  910. yield this.execGit(['lfs', 'install', '--local']);
  911. });
  912. }
  913. log1(format) {
  914. return __awaiter(this, void 0, void 0, function* () {
  915. const args = format ? ['log', '-1', format] : ['log', '-1'];
  916. const silent = format ? false : true;
  917. const output = yield this.execGit(args, false, silent);
  918. return output.stdout;
  919. });
  920. }
  921. remoteAdd(remoteName, remoteUrl) {
  922. return __awaiter(this, void 0, void 0, function* () {
  923. yield this.execGit(['remote', 'add', remoteName, remoteUrl]);
  924. });
  925. }
  926. removeEnvironmentVariable(name) {
  927. delete this.gitEnv[name];
  928. }
  929. /**
  930. * Resolves a ref to a SHA. For a branch or lightweight tag, the commit SHA is returned.
  931. * For an annotated tag, the tag SHA is returned.
  932. * @param {string} ref For example: 'refs/heads/main' or '/refs/tags/v1'
  933. * @returns {Promise<string>}
  934. */
  935. revParse(ref) {
  936. return __awaiter(this, void 0, void 0, function* () {
  937. const output = yield this.execGit(['rev-parse', ref]);
  938. return output.stdout.trim();
  939. });
  940. }
  941. setEnvironmentVariable(name, value) {
  942. this.gitEnv[name] = value;
  943. }
  944. shaExists(sha) {
  945. return __awaiter(this, void 0, void 0, function* () {
  946. const args = ['rev-parse', '--verify', '--quiet', `${sha}^{object}`];
  947. const output = yield this.execGit(args, true);
  948. return output.exitCode === 0;
  949. });
  950. }
  951. submoduleForeach(command, recursive) {
  952. return __awaiter(this, void 0, void 0, function* () {
  953. const args = ['submodule', 'foreach'];
  954. if (recursive) {
  955. args.push('--recursive');
  956. }
  957. args.push(command);
  958. const output = yield this.execGit(args);
  959. return output.stdout;
  960. });
  961. }
  962. submoduleSync(recursive) {
  963. return __awaiter(this, void 0, void 0, function* () {
  964. const args = ['submodule', 'sync'];
  965. if (recursive) {
  966. args.push('--recursive');
  967. }
  968. yield this.execGit(args);
  969. });
  970. }
  971. submoduleUpdate(fetchDepth, recursive) {
  972. return __awaiter(this, void 0, void 0, function* () {
  973. const args = ['-c', 'protocol.version=2'];
  974. args.push('submodule', 'update', '--init', '--force');
  975. if (fetchDepth > 0) {
  976. args.push(`--depth=${fetchDepth}`);
  977. }
  978. if (recursive) {
  979. args.push('--recursive');
  980. }
  981. yield this.execGit(args);
  982. });
  983. }
  984. submoduleStatus() {
  985. return __awaiter(this, void 0, void 0, function* () {
  986. const output = yield this.execGit(['submodule', 'status'], true);
  987. core.debug(output.stdout);
  988. return output.exitCode === 0;
  989. });
  990. }
  991. tagExists(pattern) {
  992. return __awaiter(this, void 0, void 0, function* () {
  993. const output = yield this.execGit(['tag', '--list', pattern]);
  994. return !!output.stdout.trim();
  995. });
  996. }
  997. tryClean() {
  998. return __awaiter(this, void 0, void 0, function* () {
  999. const output = yield this.execGit(['clean', '-ffdx'], true);
  1000. return output.exitCode === 0;
  1001. });
  1002. }
  1003. tryConfigUnset(configKey, globalConfig) {
  1004. return __awaiter(this, void 0, void 0, function* () {
  1005. const output = yield this.execGit([
  1006. 'config',
  1007. globalConfig ? '--global' : '--local',
  1008. '--unset-all',
  1009. configKey
  1010. ], true);
  1011. return output.exitCode === 0;
  1012. });
  1013. }
  1014. tryConfigUnsetValue(configKey, configValue, globalConfig, configFile) {
  1015. return __awaiter(this, void 0, void 0, function* () {
  1016. const args = ['config'];
  1017. if (configFile) {
  1018. args.push('--file', configFile);
  1019. }
  1020. else {
  1021. args.push(globalConfig ? '--global' : '--local');
  1022. }
  1023. args.push('--unset', configKey, configValue);
  1024. const output = yield this.execGit(args, true);
  1025. return output.exitCode === 0;
  1026. });
  1027. }
  1028. tryDisableAutomaticGarbageCollection() {
  1029. return __awaiter(this, void 0, void 0, function* () {
  1030. const output = yield this.execGit(['config', '--local', 'gc.auto', '0'], true);
  1031. return output.exitCode === 0;
  1032. });
  1033. }
  1034. tryGetFetchUrl() {
  1035. return __awaiter(this, void 0, void 0, function* () {
  1036. const output = yield this.execGit(['config', '--local', '--get', 'remote.origin.url'], true);
  1037. if (output.exitCode !== 0) {
  1038. return '';
  1039. }
  1040. const stdout = output.stdout.trim();
  1041. if (stdout.includes('\n')) {
  1042. return '';
  1043. }
  1044. return stdout;
  1045. });
  1046. }
  1047. tryGetConfigValues(configKey, globalConfig, configFile) {
  1048. return __awaiter(this, void 0, void 0, function* () {
  1049. const args = ['config'];
  1050. if (configFile) {
  1051. args.push('--file', configFile);
  1052. }
  1053. else {
  1054. args.push(globalConfig ? '--global' : '--local');
  1055. }
  1056. args.push('--get-all', configKey);
  1057. const output = yield this.execGit(args, true);
  1058. if (output.exitCode !== 0) {
  1059. return [];
  1060. }
  1061. return output.stdout
  1062. .trim()
  1063. .split('\n')
  1064. .filter(value => value.trim());
  1065. });
  1066. }
  1067. tryGetConfigKeys(pattern, globalConfig, configFile) {
  1068. return __awaiter(this, void 0, void 0, function* () {
  1069. const args = ['config'];
  1070. if (configFile) {
  1071. args.push('--file', configFile);
  1072. }
  1073. else {
  1074. args.push(globalConfig ? '--global' : '--local');
  1075. }
  1076. args.push('--name-only', '--get-regexp', pattern);
  1077. const output = yield this.execGit(args, true);
  1078. if (output.exitCode !== 0) {
  1079. return [];
  1080. }
  1081. return output.stdout
  1082. .trim()
  1083. .split('\n')
  1084. .filter(key => key.trim());
  1085. });
  1086. }
  1087. tryReset() {
  1088. return __awaiter(this, void 0, void 0, function* () {
  1089. const output = yield this.execGit(['reset', '--hard', 'HEAD'], true);
  1090. return output.exitCode === 0;
  1091. });
  1092. }
  1093. version() {
  1094. return __awaiter(this, void 0, void 0, function* () {
  1095. return this.gitVersion;
  1096. });
  1097. }
  1098. static createCommandManager(workingDirectory, lfs, doSparseCheckout) {
  1099. return __awaiter(this, void 0, void 0, function* () {
  1100. const result = new GitCommandManager();
  1101. yield result.initializeCommandManager(workingDirectory, lfs, doSparseCheckout);
  1102. return result;
  1103. });
  1104. }
  1105. execGit(args_1) {
  1106. return __awaiter(this, arguments, void 0, function* (args, allowAllExitCodes = false, silent = false, customListeners = {}) {
  1107. fshelper.directoryExistsSync(this.workingDirectory, true);
  1108. const result = new GitOutput();
  1109. const env = {};
  1110. for (const key of Object.keys(process.env)) {
  1111. env[key] = process.env[key];
  1112. }
  1113. for (const key of Object.keys(this.gitEnv)) {
  1114. env[key] = this.gitEnv[key];
  1115. }
  1116. const defaultListener = {
  1117. stdout: (data) => {
  1118. stdout.push(data.toString());
  1119. }
  1120. };
  1121. const mergedListeners = Object.assign(Object.assign({}, defaultListener), customListeners);
  1122. const stdout = [];
  1123. const options = {
  1124. cwd: this.workingDirectory,
  1125. env,
  1126. silent,
  1127. ignoreReturnCode: allowAllExitCodes,
  1128. listeners: mergedListeners
  1129. };
  1130. result.exitCode = yield exec.exec(`"${this.gitPath}"`, args, options);
  1131. result.stdout = stdout.join('');
  1132. core.debug(result.exitCode.toString());
  1133. core.debug(result.stdout);
  1134. return result;
  1135. });
  1136. }
  1137. initializeCommandManager(workingDirectory, lfs, doSparseCheckout) {
  1138. return __awaiter(this, void 0, void 0, function* () {
  1139. this.workingDirectory = workingDirectory;
  1140. // Git-lfs will try to pull down assets if any of the local/user/system setting exist.
  1141. // If the user didn't enable `LFS` in their pipeline definition, disable LFS fetch/checkout.
  1142. this.lfs = lfs;
  1143. if (!this.lfs) {
  1144. this.gitEnv['GIT_LFS_SKIP_SMUDGE'] = '1';
  1145. }
  1146. this.gitPath = yield io.which('git', true);
  1147. // Git version
  1148. core.debug('Getting git version');
  1149. this.gitVersion = new git_version_1.GitVersion();
  1150. let gitOutput = yield this.execGit(['version']);
  1151. let stdout = gitOutput.stdout.trim();
  1152. if (!stdout.includes('\n')) {
  1153. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  1154. if (match) {
  1155. this.gitVersion = new git_version_1.GitVersion(match[0]);
  1156. }
  1157. }
  1158. if (!this.gitVersion.isValid()) {
  1159. throw new Error('Unable to determine git version');
  1160. }
  1161. // Minimum git version
  1162. if (!this.gitVersion.checkMinimum(exports.MinimumGitVersion)) {
  1163. throw new Error(`Minimum required git version is ${exports.MinimumGitVersion}. Your git ('${this.gitPath}') is ${this.gitVersion}`);
  1164. }
  1165. if (this.lfs) {
  1166. // Git-lfs version
  1167. core.debug('Getting git-lfs version');
  1168. let gitLfsVersion = new git_version_1.GitVersion();
  1169. const gitLfsPath = yield io.which('git-lfs', true);
  1170. gitOutput = yield this.execGit(['lfs', 'version']);
  1171. stdout = gitOutput.stdout.trim();
  1172. if (!stdout.includes('\n')) {
  1173. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  1174. if (match) {
  1175. gitLfsVersion = new git_version_1.GitVersion(match[0]);
  1176. }
  1177. }
  1178. if (!gitLfsVersion.isValid()) {
  1179. throw new Error('Unable to determine git-lfs version');
  1180. }
  1181. // Minimum git-lfs version
  1182. // Note:
  1183. // - Auth header not supported before 2.1
  1184. const minimumGitLfsVersion = new git_version_1.GitVersion('2.1');
  1185. if (!gitLfsVersion.checkMinimum(minimumGitLfsVersion)) {
  1186. throw new Error(`Minimum required git-lfs version is ${minimumGitLfsVersion}. Your git-lfs ('${gitLfsPath}') is ${gitLfsVersion}`);
  1187. }
  1188. }
  1189. this.doSparseCheckout = doSparseCheckout;
  1190. if (this.doSparseCheckout) {
  1191. if (!this.gitVersion.checkMinimum(exports.MinimumGitSparseCheckoutVersion)) {
  1192. throw new Error(`Minimum Git version required for sparse checkout is ${exports.MinimumGitSparseCheckoutVersion}. Your git ('${this.gitPath}') is ${this.gitVersion}`);
  1193. }
  1194. }
  1195. // Set the user agent
  1196. const gitHttpUserAgent = `git/${this.gitVersion} (github-actions-checkout)`;
  1197. core.debug(`Set git useragent to: ${gitHttpUserAgent}`);
  1198. this.gitEnv['GIT_HTTP_USER_AGENT'] = gitHttpUserAgent;
  1199. });
  1200. }
  1201. }
  1202. class GitOutput {
  1203. constructor() {
  1204. this.stdout = '';
  1205. this.exitCode = 0;
  1206. }
  1207. }
  1208. /***/ }),
  1209. /***/ 8609:
  1210. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  1211. "use strict";
  1212. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  1213. if (k2 === undefined) k2 = k;
  1214. var desc = Object.getOwnPropertyDescriptor(m, k);
  1215. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  1216. desc = { enumerable: true, get: function() { return m[k]; } };
  1217. }
  1218. Object.defineProperty(o, k2, desc);
  1219. }) : (function(o, m, k, k2) {
  1220. if (k2 === undefined) k2 = k;
  1221. o[k2] = m[k];
  1222. }));
  1223. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  1224. Object.defineProperty(o, "default", { enumerable: true, value: v });
  1225. }) : function(o, v) {
  1226. o["default"] = v;
  1227. });
  1228. var __importStar = (this && this.__importStar) || function (mod) {
  1229. if (mod && mod.__esModule) return mod;
  1230. var result = {};
  1231. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  1232. __setModuleDefault(result, mod);
  1233. return result;
  1234. };
  1235. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  1236. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  1237. return new (P || (P = Promise))(function (resolve, reject) {
  1238. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  1239. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  1240. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  1241. step((generator = generator.apply(thisArg, _arguments || [])).next());
  1242. });
  1243. };
  1244. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1245. exports.prepareExistingDirectory = prepareExistingDirectory;
  1246. const assert = __importStar(__nccwpck_require__(9491));
  1247. const core = __importStar(__nccwpck_require__(2186));
  1248. const fs = __importStar(__nccwpck_require__(7147));
  1249. const fsHelper = __importStar(__nccwpck_require__(7219));
  1250. const io = __importStar(__nccwpck_require__(7436));
  1251. const path = __importStar(__nccwpck_require__(1017));
  1252. function prepareExistingDirectory(git, repositoryPath, repositoryUrl, clean, ref) {
  1253. return __awaiter(this, void 0, void 0, function* () {
  1254. var _a;
  1255. assert.ok(repositoryPath, 'Expected repositoryPath to be defined');
  1256. assert.ok(repositoryUrl, 'Expected repositoryUrl to be defined');
  1257. // Indicates whether to delete the directory contents
  1258. let remove = false;
  1259. // Check whether using git or REST API
  1260. if (!git) {
  1261. remove = true;
  1262. }
  1263. // Fetch URL does not match
  1264. else if (!fsHelper.directoryExistsSync(path.join(repositoryPath, '.git')) ||
  1265. repositoryUrl !== (yield git.tryGetFetchUrl())) {
  1266. remove = true;
  1267. }
  1268. else {
  1269. // Delete any index.lock and shallow.lock left by a previously canceled run or crashed git process
  1270. const lockPaths = [
  1271. path.join(repositoryPath, '.git', 'index.lock'),
  1272. path.join(repositoryPath, '.git', 'shallow.lock')
  1273. ];
  1274. for (const lockPath of lockPaths) {
  1275. try {
  1276. yield io.rmRF(lockPath);
  1277. }
  1278. catch (error) {
  1279. core.debug(`Unable to delete '${lockPath}'. ${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error}`);
  1280. }
  1281. }
  1282. try {
  1283. core.startGroup('Removing previously created refs, to avoid conflicts');
  1284. // Checkout detached HEAD
  1285. if (!(yield git.isDetached())) {
  1286. yield git.checkoutDetach();
  1287. }
  1288. // Remove all refs/heads/*
  1289. let branches = yield git.branchList(false);
  1290. for (const branch of branches) {
  1291. yield git.branchDelete(false, branch);
  1292. }
  1293. // Remove any conflicting refs/remotes/origin/*
  1294. // Example 1: Consider ref is refs/heads/foo and previously fetched refs/remotes/origin/foo/bar
  1295. // Example 2: Consider ref is refs/heads/foo/bar and previously fetched refs/remotes/origin/foo
  1296. if (ref) {
  1297. ref = ref.startsWith('refs/') ? ref : `refs/heads/${ref}`;
  1298. if (ref.startsWith('refs/heads/')) {
  1299. const upperName1 = ref.toUpperCase().substr('REFS/HEADS/'.length);
  1300. const upperName1Slash = `${upperName1}/`;
  1301. branches = yield git.branchList(true);
  1302. for (const branch of branches) {
  1303. const upperName2 = branch.substr('origin/'.length).toUpperCase();
  1304. const upperName2Slash = `${upperName2}/`;
  1305. if (upperName1.startsWith(upperName2Slash) ||
  1306. upperName2.startsWith(upperName1Slash)) {
  1307. yield git.branchDelete(true, branch);
  1308. }
  1309. }
  1310. }
  1311. }
  1312. core.endGroup();
  1313. // Check for submodules and delete any existing files if submodules are present
  1314. if (!(yield git.submoduleStatus())) {
  1315. remove = true;
  1316. core.info('Bad Submodules found, removing existing files');
  1317. }
  1318. // Clean
  1319. if (clean) {
  1320. core.startGroup('Cleaning the repository');
  1321. if (!(yield git.tryClean())) {
  1322. 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}'.`);
  1323. remove = true;
  1324. }
  1325. else if (!(yield git.tryReset())) {
  1326. remove = true;
  1327. }
  1328. core.endGroup();
  1329. if (remove) {
  1330. core.warning(`Unable to clean or reset the repository. The repository will be recreated instead.`);
  1331. }
  1332. }
  1333. }
  1334. catch (error) {
  1335. core.warning(`Unable to prepare the existing repository. The repository will be recreated instead.`);
  1336. remove = true;
  1337. }
  1338. }
  1339. if (remove) {
  1340. // Delete the contents of the directory. Don't delete the directory itself
  1341. // since it might be the current working directory.
  1342. core.info(`Deleting the contents of '${repositoryPath}'`);
  1343. for (const file of yield fs.promises.readdir(repositoryPath)) {
  1344. yield io.rmRF(path.join(repositoryPath, file));
  1345. }
  1346. }
  1347. });
  1348. }
  1349. /***/ }),
  1350. /***/ 9210:
  1351. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  1352. "use strict";
  1353. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  1354. if (k2 === undefined) k2 = k;
  1355. var desc = Object.getOwnPropertyDescriptor(m, k);
  1356. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  1357. desc = { enumerable: true, get: function() { return m[k]; } };
  1358. }
  1359. Object.defineProperty(o, k2, desc);
  1360. }) : (function(o, m, k, k2) {
  1361. if (k2 === undefined) k2 = k;
  1362. o[k2] = m[k];
  1363. }));
  1364. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  1365. Object.defineProperty(o, "default", { enumerable: true, value: v });
  1366. }) : function(o, v) {
  1367. o["default"] = v;
  1368. });
  1369. var __importStar = (this && this.__importStar) || function (mod) {
  1370. if (mod && mod.__esModule) return mod;
  1371. var result = {};
  1372. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  1373. __setModuleDefault(result, mod);
  1374. return result;
  1375. };
  1376. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  1377. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  1378. return new (P || (P = Promise))(function (resolve, reject) {
  1379. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  1380. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  1381. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  1382. step((generator = generator.apply(thisArg, _arguments || [])).next());
  1383. });
  1384. };
  1385. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1386. exports.getSource = getSource;
  1387. exports.cleanup = cleanup;
  1388. const core = __importStar(__nccwpck_require__(2186));
  1389. const fsHelper = __importStar(__nccwpck_require__(7219));
  1390. const gitAuthHelper = __importStar(__nccwpck_require__(2565));
  1391. const gitCommandManager = __importStar(__nccwpck_require__(738));
  1392. const gitDirectoryHelper = __importStar(__nccwpck_require__(8609));
  1393. const githubApiHelper = __importStar(__nccwpck_require__(138));
  1394. const io = __importStar(__nccwpck_require__(7436));
  1395. const path = __importStar(__nccwpck_require__(1017));
  1396. const refHelper = __importStar(__nccwpck_require__(8601));
  1397. const stateHelper = __importStar(__nccwpck_require__(4866));
  1398. const urlHelper = __importStar(__nccwpck_require__(9437));
  1399. const git_command_manager_1 = __nccwpck_require__(738);
  1400. function getSource(settings) {
  1401. return __awaiter(this, void 0, void 0, function* () {
  1402. // Repository URL
  1403. core.info(`Syncing repository: ${settings.repositoryOwner}/${settings.repositoryName}`);
  1404. const repositoryUrl = urlHelper.getFetchUrl(settings);
  1405. // Remove conflicting file path
  1406. if (fsHelper.fileExistsSync(settings.repositoryPath)) {
  1407. yield io.rmRF(settings.repositoryPath);
  1408. }
  1409. // Create directory
  1410. let isExisting = true;
  1411. if (!fsHelper.directoryExistsSync(settings.repositoryPath)) {
  1412. isExisting = false;
  1413. yield io.mkdirP(settings.repositoryPath);
  1414. }
  1415. // Git command manager
  1416. core.startGroup('Getting Git version info');
  1417. const git = yield getGitCommandManager(settings);
  1418. core.endGroup();
  1419. let authHelper = null;
  1420. try {
  1421. if (git) {
  1422. authHelper = gitAuthHelper.createAuthHelper(git, settings);
  1423. if (settings.setSafeDirectory) {
  1424. // 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
  1425. // Otherwise all git commands we run in a container fail
  1426. yield authHelper.configureTempGlobalConfig();
  1427. core.info(`Adding repository directory to the temporary git global config as a safe directory`);
  1428. yield git
  1429. .config('safe.directory', settings.repositoryPath, true, true)
  1430. .catch(error => {
  1431. core.info(`Failed to initialize safe directory with error: ${error}`);
  1432. });
  1433. stateHelper.setSafeDirectory();
  1434. }
  1435. }
  1436. // Prepare existing directory, otherwise recreate
  1437. if (isExisting) {
  1438. yield gitDirectoryHelper.prepareExistingDirectory(git, settings.repositoryPath, repositoryUrl, settings.clean, settings.ref);
  1439. }
  1440. if (!git) {
  1441. // Downloading using REST API
  1442. core.info(`The repository will be downloaded using the GitHub REST API`);
  1443. core.info(`To create a local Git repository instead, add Git ${gitCommandManager.MinimumGitVersion} or higher to the PATH`);
  1444. if (settings.submodules) {
  1445. 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.`);
  1446. }
  1447. else if (settings.sshKey) {
  1448. 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.`);
  1449. }
  1450. yield githubApiHelper.downloadRepository(settings.authToken, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit, settings.repositoryPath, settings.githubServerUrl);
  1451. return;
  1452. }
  1453. // Save state for POST action
  1454. stateHelper.setRepositoryPath(settings.repositoryPath);
  1455. // Initialize the repository
  1456. if (!fsHelper.directoryExistsSync(path.join(settings.repositoryPath, '.git'))) {
  1457. core.startGroup('Initializing the repository');
  1458. yield git.init();
  1459. yield git.remoteAdd('origin', repositoryUrl);
  1460. core.endGroup();
  1461. }
  1462. // Disable automatic garbage collection
  1463. core.startGroup('Disabling automatic garbage collection');
  1464. if (!(yield git.tryDisableAutomaticGarbageCollection())) {
  1465. core.warning(`Unable to turn off git automatic garbage collection. The git fetch operation may trigger garbage collection and cause a delay.`);
  1466. }
  1467. core.endGroup();
  1468. // If we didn't initialize it above, do it now
  1469. if (!authHelper) {
  1470. authHelper = gitAuthHelper.createAuthHelper(git, settings);
  1471. }
  1472. // Configure auth
  1473. core.startGroup('Setting up auth');
  1474. yield authHelper.configureAuth();
  1475. core.endGroup();
  1476. // Determine the default branch
  1477. if (!settings.ref && !settings.commit) {
  1478. core.startGroup('Determining the default branch');
  1479. if (settings.sshKey) {
  1480. settings.ref = yield git.getDefaultBranch(repositoryUrl);
  1481. }
  1482. else {
  1483. settings.ref = yield githubApiHelper.getDefaultBranch(settings.authToken, settings.repositoryOwner, settings.repositoryName, settings.githubServerUrl);
  1484. }
  1485. core.endGroup();
  1486. }
  1487. // LFS install
  1488. if (settings.lfs) {
  1489. yield git.lfsInstall();
  1490. }
  1491. // Fetch
  1492. core.startGroup('Fetching the repository');
  1493. const fetchOptions = {};
  1494. if (settings.filter) {
  1495. fetchOptions.filter = settings.filter;
  1496. }
  1497. else if (settings.sparseCheckout) {
  1498. fetchOptions.filter = 'blob:none';
  1499. }
  1500. if (settings.fetchDepth <= 0) {
  1501. // Fetch all branches and tags
  1502. let refSpec = refHelper.getRefSpecForAllHistory(settings.ref, settings.commit);
  1503. yield git.fetch(refSpec, fetchOptions);
  1504. // When all history is fetched, the ref we're interested in may have moved to a different
  1505. // commit (push or force push). If so, fetch again with a targeted refspec.
  1506. if (!(yield refHelper.testRef(git, settings.ref, settings.commit))) {
  1507. refSpec = refHelper.getRefSpec(settings.ref, settings.commit);
  1508. yield git.fetch(refSpec, fetchOptions);
  1509. }
  1510. }
  1511. else {
  1512. fetchOptions.fetchDepth = settings.fetchDepth;
  1513. fetchOptions.fetchTags = settings.fetchTags;
  1514. const refSpec = refHelper.getRefSpec(settings.ref, settings.commit);
  1515. yield git.fetch(refSpec, fetchOptions);
  1516. }
  1517. core.endGroup();
  1518. // Checkout info
  1519. core.startGroup('Determining the checkout info');
  1520. const checkoutInfo = yield refHelper.getCheckoutInfo(git, settings.ref, settings.commit);
  1521. core.endGroup();
  1522. // LFS fetch
  1523. // Explicit lfs-fetch to avoid slow checkout (fetches one lfs object at a time).
  1524. // Explicit lfs fetch will fetch lfs objects in parallel.
  1525. // For sparse checkouts, let `checkout` fetch the needed objects lazily.
  1526. if (settings.lfs && !settings.sparseCheckout) {
  1527. core.startGroup('Fetching LFS objects');
  1528. yield git.lfsFetch(checkoutInfo.startPoint || checkoutInfo.ref);
  1529. core.endGroup();
  1530. }
  1531. // Sparse checkout
  1532. if (!settings.sparseCheckout) {
  1533. let gitVersion = yield git.version();
  1534. // no need to disable sparse-checkout if the installed git runtime doesn't even support it.
  1535. if (gitVersion.checkMinimum(git_command_manager_1.MinimumGitSparseCheckoutVersion)) {
  1536. yield git.disableSparseCheckout();
  1537. }
  1538. }
  1539. else {
  1540. core.startGroup('Setting up sparse checkout');
  1541. if (settings.sparseCheckoutConeMode) {
  1542. yield git.sparseCheckout(settings.sparseCheckout);
  1543. }
  1544. else {
  1545. yield git.sparseCheckoutNonConeMode(settings.sparseCheckout);
  1546. }
  1547. core.endGroup();
  1548. }
  1549. // Checkout
  1550. core.startGroup('Checking out the ref');
  1551. yield git.checkout(checkoutInfo.ref, checkoutInfo.startPoint);
  1552. core.endGroup();
  1553. // Submodules
  1554. if (settings.submodules) {
  1555. // Temporarily override global config
  1556. core.startGroup('Setting up auth for fetching submodules');
  1557. yield authHelper.configureGlobalAuth();
  1558. core.endGroup();
  1559. // Checkout submodules
  1560. core.startGroup('Fetching submodules');
  1561. yield git.submoduleSync(settings.nestedSubmodules);
  1562. yield git.submoduleUpdate(settings.fetchDepth, settings.nestedSubmodules);
  1563. yield git.submoduleForeach('git config --local gc.auto 0', settings.nestedSubmodules);
  1564. core.endGroup();
  1565. // Persist credentials
  1566. if (settings.persistCredentials) {
  1567. core.startGroup('Persisting credentials for submodules');
  1568. yield authHelper.configureSubmoduleAuth();
  1569. core.endGroup();
  1570. }
  1571. }
  1572. // Get commit information
  1573. const commitInfo = yield git.log1();
  1574. // Log commit sha
  1575. const commitSHA = yield git.log1('--format=%H');
  1576. core.setOutput('commit', commitSHA.trim());
  1577. // Check for incorrect pull request merge commit
  1578. yield refHelper.checkCommitInfo(settings.authToken, commitInfo, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit, settings.githubServerUrl);
  1579. }
  1580. finally {
  1581. // Remove auth
  1582. if (authHelper) {
  1583. if (!settings.persistCredentials) {
  1584. core.startGroup('Removing auth');
  1585. yield authHelper.removeAuth();
  1586. core.endGroup();
  1587. }
  1588. authHelper.removeGlobalConfig();
  1589. }
  1590. }
  1591. });
  1592. }
  1593. function cleanup(repositoryPath) {
  1594. return __awaiter(this, void 0, void 0, function* () {
  1595. // Repo exists?
  1596. if (!repositoryPath ||
  1597. !fsHelper.fileExistsSync(path.join(repositoryPath, '.git', 'config'))) {
  1598. return;
  1599. }
  1600. let git;
  1601. try {
  1602. git = yield gitCommandManager.createCommandManager(repositoryPath, false, false);
  1603. }
  1604. catch (_a) {
  1605. return;
  1606. }
  1607. // Remove auth
  1608. const authHelper = gitAuthHelper.createAuthHelper(git);
  1609. try {
  1610. if (stateHelper.PostSetSafeDirectory) {
  1611. // 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
  1612. // Otherwise all git commands we run in a container fail
  1613. yield authHelper.configureTempGlobalConfig();
  1614. core.info(`Adding repository directory to the temporary git global config as a safe directory`);
  1615. yield git
  1616. .config('safe.directory', repositoryPath, true, true)
  1617. .catch(error => {
  1618. core.info(`Failed to initialize safe directory with error: ${error}`);
  1619. });
  1620. }
  1621. yield authHelper.removeAuth();
  1622. }
  1623. finally {
  1624. yield authHelper.removeGlobalConfig();
  1625. }
  1626. });
  1627. }
  1628. function getGitCommandManager(settings) {
  1629. return __awaiter(this, void 0, void 0, function* () {
  1630. core.info(`Working directory is '${settings.repositoryPath}'`);
  1631. try {
  1632. return yield gitCommandManager.createCommandManager(settings.repositoryPath, settings.lfs, settings.sparseCheckout != null);
  1633. }
  1634. catch (err) {
  1635. // Git is required for LFS
  1636. if (settings.lfs) {
  1637. throw err;
  1638. }
  1639. // Otherwise fallback to REST API
  1640. return undefined;
  1641. }
  1642. });
  1643. }
  1644. /***/ }),
  1645. /***/ 3142:
  1646. /***/ ((__unused_webpack_module, exports) => {
  1647. "use strict";
  1648. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1649. exports.GitVersion = void 0;
  1650. class GitVersion {
  1651. /**
  1652. * Used for comparing the version of git and git-lfs against the minimum required version
  1653. * @param version the version string, e.g. 1.2 or 1.2.3
  1654. */
  1655. constructor(version) {
  1656. this.major = NaN;
  1657. this.minor = NaN;
  1658. this.patch = NaN;
  1659. if (version) {
  1660. const match = version.match(/^(\d+)\.(\d+)(\.(\d+))?$/);
  1661. if (match) {
  1662. this.major = Number(match[1]);
  1663. this.minor = Number(match[2]);
  1664. if (match[4]) {
  1665. this.patch = Number(match[4]);
  1666. }
  1667. }
  1668. }
  1669. }
  1670. /**
  1671. * Compares the instance against a minimum required version
  1672. * @param minimum Minimum version
  1673. */
  1674. checkMinimum(minimum) {
  1675. if (!minimum.isValid()) {
  1676. throw new Error('Arg minimum is not a valid version');
  1677. }
  1678. // Major is insufficient
  1679. if (this.major < minimum.major) {
  1680. return false;
  1681. }
  1682. // Major is equal
  1683. if (this.major === minimum.major) {
  1684. // Minor is insufficient
  1685. if (this.minor < minimum.minor) {
  1686. return false;
  1687. }
  1688. // Minor is equal
  1689. if (this.minor === minimum.minor) {
  1690. // Patch is insufficient
  1691. if (this.patch && this.patch < (minimum.patch || 0)) {
  1692. return false;
  1693. }
  1694. }
  1695. }
  1696. return true;
  1697. }
  1698. /**
  1699. * Indicates whether the instance was constructed from a valid version string
  1700. */
  1701. isValid() {
  1702. return !isNaN(this.major);
  1703. }
  1704. /**
  1705. * Returns the version as a string, e.g. 1.2 or 1.2.3
  1706. */
  1707. toString() {
  1708. let result = '';
  1709. if (this.isValid()) {
  1710. result = `${this.major}.${this.minor}`;
  1711. if (!isNaN(this.patch)) {
  1712. result += `.${this.patch}`;
  1713. }
  1714. }
  1715. return result;
  1716. }
  1717. }
  1718. exports.GitVersion = GitVersion;
  1719. /***/ }),
  1720. /***/ 138:
  1721. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  1722. "use strict";
  1723. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  1724. if (k2 === undefined) k2 = k;
  1725. var desc = Object.getOwnPropertyDescriptor(m, k);
  1726. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  1727. desc = { enumerable: true, get: function() { return m[k]; } };
  1728. }
  1729. Object.defineProperty(o, k2, desc);
  1730. }) : (function(o, m, k, k2) {
  1731. if (k2 === undefined) k2 = k;
  1732. o[k2] = m[k];
  1733. }));
  1734. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  1735. Object.defineProperty(o, "default", { enumerable: true, value: v });
  1736. }) : function(o, v) {
  1737. o["default"] = v;
  1738. });
  1739. var __importStar = (this && this.__importStar) || function (mod) {
  1740. if (mod && mod.__esModule) return mod;
  1741. var result = {};
  1742. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  1743. __setModuleDefault(result, mod);
  1744. return result;
  1745. };
  1746. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  1747. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  1748. return new (P || (P = Promise))(function (resolve, reject) {
  1749. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  1750. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  1751. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  1752. step((generator = generator.apply(thisArg, _arguments || [])).next());
  1753. });
  1754. };
  1755. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1756. exports.downloadRepository = downloadRepository;
  1757. exports.getDefaultBranch = getDefaultBranch;
  1758. const assert = __importStar(__nccwpck_require__(9491));
  1759. const core = __importStar(__nccwpck_require__(2186));
  1760. const fs = __importStar(__nccwpck_require__(7147));
  1761. const github = __importStar(__nccwpck_require__(5438));
  1762. const io = __importStar(__nccwpck_require__(7436));
  1763. const path = __importStar(__nccwpck_require__(1017));
  1764. const retryHelper = __importStar(__nccwpck_require__(2155));
  1765. const toolCache = __importStar(__nccwpck_require__(7784));
  1766. const uuid_1 = __nccwpck_require__(5840);
  1767. const url_helper_1 = __nccwpck_require__(9437);
  1768. const IS_WINDOWS = process.platform === 'win32';
  1769. function downloadRepository(authToken, owner, repo, ref, commit, repositoryPath, baseUrl) {
  1770. return __awaiter(this, void 0, void 0, function* () {
  1771. // Determine the default branch
  1772. if (!ref && !commit) {
  1773. core.info('Determining the default branch');
  1774. ref = yield getDefaultBranch(authToken, owner, repo, baseUrl);
  1775. }
  1776. // Download the archive
  1777. let archiveData = yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  1778. core.info('Downloading the archive');
  1779. return yield downloadArchive(authToken, owner, repo, ref, commit, baseUrl);
  1780. }));
  1781. // Write archive to disk
  1782. core.info('Writing archive to disk');
  1783. const uniqueId = (0, uuid_1.v4)();
  1784. const archivePath = IS_WINDOWS
  1785. ? path.join(repositoryPath, `${uniqueId}.zip`)
  1786. : path.join(repositoryPath, `${uniqueId}.tar.gz`);
  1787. yield fs.promises.writeFile(archivePath, archiveData);
  1788. archiveData = Buffer.from(''); // Free memory
  1789. // Extract archive
  1790. core.info('Extracting the archive');
  1791. const extractPath = path.join(repositoryPath, uniqueId);
  1792. yield io.mkdirP(extractPath);
  1793. if (IS_WINDOWS) {
  1794. yield toolCache.extractZip(archivePath, extractPath);
  1795. }
  1796. else {
  1797. yield toolCache.extractTar(archivePath, extractPath);
  1798. }
  1799. yield io.rmRF(archivePath);
  1800. // Determine the path of the repository content. The archive contains
  1801. // a top-level folder and the repository content is inside.
  1802. const archiveFileNames = yield fs.promises.readdir(extractPath);
  1803. assert.ok(archiveFileNames.length == 1, 'Expected exactly one directory inside archive');
  1804. const archiveVersion = archiveFileNames[0]; // The top-level folder name includes the short SHA
  1805. core.info(`Resolved version ${archiveVersion}`);
  1806. const tempRepositoryPath = path.join(extractPath, archiveVersion);
  1807. // Move the files
  1808. for (const fileName of yield fs.promises.readdir(tempRepositoryPath)) {
  1809. const sourcePath = path.join(tempRepositoryPath, fileName);
  1810. const targetPath = path.join(repositoryPath, fileName);
  1811. if (IS_WINDOWS) {
  1812. yield io.cp(sourcePath, targetPath, { recursive: true }); // Copy on Windows (Windows Defender may have a lock)
  1813. }
  1814. else {
  1815. yield io.mv(sourcePath, targetPath);
  1816. }
  1817. }
  1818. yield io.rmRF(extractPath);
  1819. });
  1820. }
  1821. /**
  1822. * Looks up the default branch name
  1823. */
  1824. function getDefaultBranch(authToken, owner, repo, baseUrl) {
  1825. return __awaiter(this, void 0, void 0, function* () {
  1826. return yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  1827. core.info('Retrieving the default branch name');
  1828. const octokit = github.getOctokit(authToken, {
  1829. baseUrl: (0, url_helper_1.getServerApiUrl)(baseUrl)
  1830. });
  1831. let result;
  1832. try {
  1833. // Get the default branch from the repo info
  1834. const response = yield octokit.rest.repos.get({ owner, repo });
  1835. result = response.data.default_branch;
  1836. assert.ok(result, 'default_branch cannot be empty');
  1837. }
  1838. catch (err) {
  1839. // Handle .wiki repo
  1840. if ((err === null || err === void 0 ? void 0 : err.status) === 404 &&
  1841. repo.toUpperCase().endsWith('.WIKI')) {
  1842. result = 'master';
  1843. }
  1844. // Otherwise error
  1845. else {
  1846. throw err;
  1847. }
  1848. }
  1849. // Print the default branch
  1850. core.info(`Default branch '${result}'`);
  1851. // Prefix with 'refs/heads'
  1852. if (!result.startsWith('refs/')) {
  1853. result = `refs/heads/${result}`;
  1854. }
  1855. return result;
  1856. }));
  1857. });
  1858. }
  1859. function downloadArchive(authToken, owner, repo, ref, commit, baseUrl) {
  1860. return __awaiter(this, void 0, void 0, function* () {
  1861. const octokit = github.getOctokit(authToken, {
  1862. baseUrl: (0, url_helper_1.getServerApiUrl)(baseUrl)
  1863. });
  1864. const download = IS_WINDOWS
  1865. ? octokit.rest.repos.downloadZipballArchive
  1866. : octokit.rest.repos.downloadTarballArchive;
  1867. const response = yield download({
  1868. owner: owner,
  1869. repo: repo,
  1870. ref: commit || ref
  1871. });
  1872. return Buffer.from(response.data); // response.data is ArrayBuffer
  1873. });
  1874. }
  1875. /***/ }),
  1876. /***/ 5480:
  1877. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  1878. "use strict";
  1879. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  1880. if (k2 === undefined) k2 = k;
  1881. var desc = Object.getOwnPropertyDescriptor(m, k);
  1882. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  1883. desc = { enumerable: true, get: function() { return m[k]; } };
  1884. }
  1885. Object.defineProperty(o, k2, desc);
  1886. }) : (function(o, m, k, k2) {
  1887. if (k2 === undefined) k2 = k;
  1888. o[k2] = m[k];
  1889. }));
  1890. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  1891. Object.defineProperty(o, "default", { enumerable: true, value: v });
  1892. }) : function(o, v) {
  1893. o["default"] = v;
  1894. });
  1895. var __importStar = (this && this.__importStar) || function (mod) {
  1896. if (mod && mod.__esModule) return mod;
  1897. var result = {};
  1898. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  1899. __setModuleDefault(result, mod);
  1900. return result;
  1901. };
  1902. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  1903. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  1904. return new (P || (P = Promise))(function (resolve, reject) {
  1905. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  1906. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  1907. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  1908. step((generator = generator.apply(thisArg, _arguments || [])).next());
  1909. });
  1910. };
  1911. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1912. exports.getInputs = getInputs;
  1913. const core = __importStar(__nccwpck_require__(2186));
  1914. const fsHelper = __importStar(__nccwpck_require__(7219));
  1915. const github = __importStar(__nccwpck_require__(5438));
  1916. const path = __importStar(__nccwpck_require__(1017));
  1917. const workflowContextHelper = __importStar(__nccwpck_require__(9568));
  1918. function getInputs() {
  1919. return __awaiter(this, void 0, void 0, function* () {
  1920. const result = {};
  1921. // GitHub workspace
  1922. let githubWorkspacePath = process.env['GITHUB_WORKSPACE'];
  1923. if (!githubWorkspacePath) {
  1924. throw new Error('GITHUB_WORKSPACE not defined');
  1925. }
  1926. githubWorkspacePath = path.resolve(githubWorkspacePath);
  1927. core.debug(`GITHUB_WORKSPACE = '${githubWorkspacePath}'`);
  1928. fsHelper.directoryExistsSync(githubWorkspacePath, true);
  1929. // Qualified repository
  1930. const qualifiedRepository = core.getInput('repository') ||
  1931. `${github.context.repo.owner}/${github.context.repo.repo}`;
  1932. core.debug(`qualified repository = '${qualifiedRepository}'`);
  1933. const splitRepository = qualifiedRepository.split('/');
  1934. if (splitRepository.length !== 2 ||
  1935. !splitRepository[0] ||
  1936. !splitRepository[1]) {
  1937. throw new Error(`Invalid repository '${qualifiedRepository}'. Expected format {owner}/{repo}.`);
  1938. }
  1939. result.repositoryOwner = splitRepository[0];
  1940. result.repositoryName = splitRepository[1];
  1941. // Repository path
  1942. result.repositoryPath = core.getInput('path') || '.';
  1943. result.repositoryPath = path.resolve(githubWorkspacePath, result.repositoryPath);
  1944. if (!(result.repositoryPath + path.sep).startsWith(githubWorkspacePath + path.sep)) {
  1945. throw new Error(`Repository path '${result.repositoryPath}' is not under '${githubWorkspacePath}'`);
  1946. }
  1947. // Workflow repository?
  1948. const isWorkflowRepository = qualifiedRepository.toUpperCase() ===
  1949. `${github.context.repo.owner}/${github.context.repo.repo}`.toUpperCase();
  1950. // Source branch, source version
  1951. result.ref = core.getInput('ref');
  1952. if (!result.ref) {
  1953. if (isWorkflowRepository) {
  1954. result.ref = github.context.ref;
  1955. result.commit = github.context.sha;
  1956. // Some events have an unqualifed ref. For example when a PR is merged (pull_request closed event),
  1957. // the ref is unqualifed like "main" instead of "refs/heads/main".
  1958. if (result.commit && result.ref && !result.ref.startsWith('refs/')) {
  1959. result.ref = `refs/heads/${result.ref}`;
  1960. }
  1961. }
  1962. }
  1963. // SHA?
  1964. else if (result.ref.match(/^[0-9a-fA-F]{40}$/)) {
  1965. result.commit = result.ref;
  1966. result.ref = '';
  1967. }
  1968. core.debug(`ref = '${result.ref}'`);
  1969. core.debug(`commit = '${result.commit}'`);
  1970. // Clean
  1971. result.clean = (core.getInput('clean') || 'true').toUpperCase() === 'TRUE';
  1972. core.debug(`clean = ${result.clean}`);
  1973. // Filter
  1974. const filter = core.getInput('filter');
  1975. if (filter) {
  1976. result.filter = filter;
  1977. }
  1978. core.debug(`filter = ${result.filter}`);
  1979. // Sparse checkout
  1980. const sparseCheckout = core.getMultilineInput('sparse-checkout');
  1981. if (sparseCheckout.length) {
  1982. result.sparseCheckout = sparseCheckout;
  1983. core.debug(`sparse checkout = ${result.sparseCheckout}`);
  1984. }
  1985. result.sparseCheckoutConeMode =
  1986. (core.getInput('sparse-checkout-cone-mode') || 'true').toUpperCase() ===
  1987. 'TRUE';
  1988. // Fetch depth
  1989. result.fetchDepth = Math.floor(Number(core.getInput('fetch-depth') || '1'));
  1990. if (isNaN(result.fetchDepth) || result.fetchDepth < 0) {
  1991. result.fetchDepth = 0;
  1992. }
  1993. core.debug(`fetch depth = ${result.fetchDepth}`);
  1994. // Fetch tags
  1995. result.fetchTags =
  1996. (core.getInput('fetch-tags') || 'false').toUpperCase() === 'TRUE';
  1997. core.debug(`fetch tags = ${result.fetchTags}`);
  1998. // Show fetch progress
  1999. result.showProgress =
  2000. (core.getInput('show-progress') || 'true').toUpperCase() === 'TRUE';
  2001. core.debug(`show progress = ${result.showProgress}`);
  2002. // LFS
  2003. result.lfs = (core.getInput('lfs') || 'false').toUpperCase() === 'TRUE';
  2004. core.debug(`lfs = ${result.lfs}`);
  2005. // Submodules
  2006. result.submodules = false;
  2007. result.nestedSubmodules = false;
  2008. const submodulesString = (core.getInput('submodules') || '').toUpperCase();
  2009. if (submodulesString == 'RECURSIVE') {
  2010. result.submodules = true;
  2011. result.nestedSubmodules = true;
  2012. }
  2013. else if (submodulesString == 'TRUE') {
  2014. result.submodules = true;
  2015. }
  2016. core.debug(`submodules = ${result.submodules}`);
  2017. core.debug(`recursive submodules = ${result.nestedSubmodules}`);
  2018. // Auth token
  2019. result.authToken = core.getInput('token', { required: true });
  2020. // SSH
  2021. result.sshKey = core.getInput('ssh-key');
  2022. result.sshKnownHosts = core.getInput('ssh-known-hosts');
  2023. result.sshStrict =
  2024. (core.getInput('ssh-strict') || 'true').toUpperCase() === 'TRUE';
  2025. result.sshUser = core.getInput('ssh-user');
  2026. // Persist credentials
  2027. result.persistCredentials =
  2028. (core.getInput('persist-credentials') || 'false').toUpperCase() === 'TRUE';
  2029. // Workflow organization ID
  2030. result.workflowOrganizationId =
  2031. yield workflowContextHelper.getOrganizationId();
  2032. // Set safe.directory in git global config.
  2033. result.setSafeDirectory =
  2034. (core.getInput('set-safe-directory') || 'true').toUpperCase() === 'TRUE';
  2035. // Determine the GitHub URL that the repository is being hosted from
  2036. result.githubServerUrl = core.getInput('github-server-url');
  2037. core.debug(`GitHub Host URL = ${result.githubServerUrl}`);
  2038. return result;
  2039. });
  2040. }
  2041. /***/ }),
  2042. /***/ 3109:
  2043. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2044. "use strict";
  2045. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2046. if (k2 === undefined) k2 = k;
  2047. var desc = Object.getOwnPropertyDescriptor(m, k);
  2048. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2049. desc = { enumerable: true, get: function() { return m[k]; } };
  2050. }
  2051. Object.defineProperty(o, k2, desc);
  2052. }) : (function(o, m, k, k2) {
  2053. if (k2 === undefined) k2 = k;
  2054. o[k2] = m[k];
  2055. }));
  2056. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2057. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2058. }) : function(o, v) {
  2059. o["default"] = v;
  2060. });
  2061. var __importStar = (this && this.__importStar) || function (mod) {
  2062. if (mod && mod.__esModule) return mod;
  2063. var result = {};
  2064. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2065. __setModuleDefault(result, mod);
  2066. return result;
  2067. };
  2068. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2069. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2070. return new (P || (P = Promise))(function (resolve, reject) {
  2071. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2072. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2073. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2074. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2075. });
  2076. };
  2077. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2078. const core = __importStar(__nccwpck_require__(2186));
  2079. const coreCommand = __importStar(__nccwpck_require__(7351));
  2080. const gitSourceProvider = __importStar(__nccwpck_require__(9210));
  2081. const inputHelper = __importStar(__nccwpck_require__(5480));
  2082. const path = __importStar(__nccwpck_require__(1017));
  2083. const stateHelper = __importStar(__nccwpck_require__(4866));
  2084. function run() {
  2085. return __awaiter(this, void 0, void 0, function* () {
  2086. var _a;
  2087. try {
  2088. const sourceSettings = yield inputHelper.getInputs();
  2089. try {
  2090. // Register problem matcher
  2091. coreCommand.issueCommand('add-matcher', {}, path.join(__dirname, 'problem-matcher.json'));
  2092. // Get sources
  2093. yield gitSourceProvider.getSource(sourceSettings);
  2094. core.setOutput('ref', sourceSettings.ref);
  2095. }
  2096. finally {
  2097. // Unregister problem matcher
  2098. coreCommand.issueCommand('remove-matcher', { owner: 'checkout-git' }, '');
  2099. }
  2100. }
  2101. catch (error) {
  2102. core.setFailed(`${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error}`);
  2103. }
  2104. });
  2105. }
  2106. function cleanup() {
  2107. return __awaiter(this, void 0, void 0, function* () {
  2108. var _a;
  2109. try {
  2110. yield gitSourceProvider.cleanup(stateHelper.RepositoryPath);
  2111. }
  2112. catch (error) {
  2113. core.warning(`${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error}`);
  2114. }
  2115. });
  2116. }
  2117. // Main
  2118. if (!stateHelper.IsPost) {
  2119. run();
  2120. }
  2121. // Post
  2122. else {
  2123. cleanup();
  2124. }
  2125. /***/ }),
  2126. /***/ 8601:
  2127. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2128. "use strict";
  2129. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2130. if (k2 === undefined) k2 = k;
  2131. var desc = Object.getOwnPropertyDescriptor(m, k);
  2132. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2133. desc = { enumerable: true, get: function() { return m[k]; } };
  2134. }
  2135. Object.defineProperty(o, k2, desc);
  2136. }) : (function(o, m, k, k2) {
  2137. if (k2 === undefined) k2 = k;
  2138. o[k2] = m[k];
  2139. }));
  2140. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2141. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2142. }) : function(o, v) {
  2143. o["default"] = v;
  2144. });
  2145. var __importStar = (this && this.__importStar) || function (mod) {
  2146. if (mod && mod.__esModule) return mod;
  2147. var result = {};
  2148. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2149. __setModuleDefault(result, mod);
  2150. return result;
  2151. };
  2152. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2153. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2154. return new (P || (P = Promise))(function (resolve, reject) {
  2155. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2156. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2157. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2158. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2159. });
  2160. };
  2161. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2162. exports.tagsRefSpec = void 0;
  2163. exports.getCheckoutInfo = getCheckoutInfo;
  2164. exports.getRefSpecForAllHistory = getRefSpecForAllHistory;
  2165. exports.getRefSpec = getRefSpec;
  2166. exports.testRef = testRef;
  2167. exports.checkCommitInfo = checkCommitInfo;
  2168. const core = __importStar(__nccwpck_require__(2186));
  2169. const github = __importStar(__nccwpck_require__(5438));
  2170. const url_helper_1 = __nccwpck_require__(9437);
  2171. exports.tagsRefSpec = '+refs/tags/*:refs/tags/*';
  2172. function getCheckoutInfo(git, ref, commit) {
  2173. return __awaiter(this, void 0, void 0, function* () {
  2174. if (!git) {
  2175. throw new Error('Arg git cannot be empty');
  2176. }
  2177. if (!ref && !commit) {
  2178. throw new Error('Args ref and commit cannot both be empty');
  2179. }
  2180. const result = {};
  2181. const upperRef = (ref || '').toUpperCase();
  2182. // SHA only
  2183. if (!ref) {
  2184. result.ref = commit;
  2185. }
  2186. // refs/heads/
  2187. else if (upperRef.startsWith('REFS/HEADS/')) {
  2188. const branch = ref.substring('refs/heads/'.length);
  2189. result.ref = branch;
  2190. result.startPoint = `refs/remotes/origin/${branch}`;
  2191. }
  2192. // refs/pull/
  2193. else if (upperRef.startsWith('REFS/PULL/')) {
  2194. const branch = ref.substring('refs/pull/'.length);
  2195. result.ref = `refs/remotes/pull/${branch}`;
  2196. }
  2197. // refs/tags/
  2198. else if (upperRef.startsWith('REFS/TAGS/')) {
  2199. result.ref = ref;
  2200. }
  2201. // refs/
  2202. else if (upperRef.startsWith('REFS/')) {
  2203. result.ref = commit ? commit : ref;
  2204. }
  2205. // Unqualified ref, check for a matching branch or tag
  2206. else {
  2207. if (yield git.branchExists(true, `origin/${ref}`)) {
  2208. result.ref = ref;
  2209. result.startPoint = `refs/remotes/origin/${ref}`;
  2210. }
  2211. else if (yield git.tagExists(`${ref}`)) {
  2212. result.ref = `refs/tags/${ref}`;
  2213. }
  2214. else {
  2215. throw new Error(`A branch or tag with the name '${ref}' could not be found`);
  2216. }
  2217. }
  2218. return result;
  2219. });
  2220. }
  2221. function getRefSpecForAllHistory(ref, commit) {
  2222. const result = ['+refs/heads/*:refs/remotes/origin/*', exports.tagsRefSpec];
  2223. if (ref && ref.toUpperCase().startsWith('REFS/PULL/')) {
  2224. const branch = ref.substring('refs/pull/'.length);
  2225. result.push(`+${commit || ref}:refs/remotes/pull/${branch}`);
  2226. }
  2227. return result;
  2228. }
  2229. function getRefSpec(ref, commit) {
  2230. if (!ref && !commit) {
  2231. throw new Error('Args ref and commit cannot both be empty');
  2232. }
  2233. const upperRef = (ref || '').toUpperCase();
  2234. // SHA
  2235. if (commit) {
  2236. // refs/heads
  2237. if (upperRef.startsWith('REFS/HEADS/')) {
  2238. const branch = ref.substring('refs/heads/'.length);
  2239. return [`+${commit}:refs/remotes/origin/${branch}`];
  2240. }
  2241. // refs/pull/
  2242. else if (upperRef.startsWith('REFS/PULL/')) {
  2243. const branch = ref.substring('refs/pull/'.length);
  2244. return [`+${commit}:refs/remotes/pull/${branch}`];
  2245. }
  2246. // refs/tags/
  2247. else if (upperRef.startsWith('REFS/TAGS/')) {
  2248. return [`+${commit}:${ref}`];
  2249. }
  2250. // Otherwise no destination ref
  2251. else {
  2252. return [commit];
  2253. }
  2254. }
  2255. // Unqualified ref, check for a matching branch or tag
  2256. else if (!upperRef.startsWith('REFS/')) {
  2257. return [
  2258. `+refs/heads/${ref}*:refs/remotes/origin/${ref}*`,
  2259. `+refs/tags/${ref}*:refs/tags/${ref}*`
  2260. ];
  2261. }
  2262. // refs/heads/
  2263. else if (upperRef.startsWith('REFS/HEADS/')) {
  2264. const branch = ref.substring('refs/heads/'.length);
  2265. return [`+${ref}:refs/remotes/origin/${branch}`];
  2266. }
  2267. // refs/pull/
  2268. else if (upperRef.startsWith('REFS/PULL/')) {
  2269. const branch = ref.substring('refs/pull/'.length);
  2270. return [`+${ref}:refs/remotes/pull/${branch}`];
  2271. }
  2272. // refs/tags/
  2273. else {
  2274. return [`+${ref}:${ref}`];
  2275. }
  2276. }
  2277. /**
  2278. * Tests whether the initial fetch created the ref at the expected commit
  2279. */
  2280. function testRef(git, ref, commit) {
  2281. return __awaiter(this, void 0, void 0, function* () {
  2282. if (!git) {
  2283. throw new Error('Arg git cannot be empty');
  2284. }
  2285. if (!ref && !commit) {
  2286. throw new Error('Args ref and commit cannot both be empty');
  2287. }
  2288. // No SHA? Nothing to test
  2289. if (!commit) {
  2290. return true;
  2291. }
  2292. // SHA only?
  2293. else if (!ref) {
  2294. return yield git.shaExists(commit);
  2295. }
  2296. const upperRef = ref.toUpperCase();
  2297. // refs/heads/
  2298. if (upperRef.startsWith('REFS/HEADS/')) {
  2299. const branch = ref.substring('refs/heads/'.length);
  2300. return ((yield git.branchExists(true, `origin/${branch}`)) &&
  2301. commit === (yield git.revParse(`refs/remotes/origin/${branch}`)));
  2302. }
  2303. // refs/pull/
  2304. else if (upperRef.startsWith('REFS/PULL/')) {
  2305. // Assume matches because fetched using the commit
  2306. return true;
  2307. }
  2308. // refs/tags/
  2309. else if (upperRef.startsWith('REFS/TAGS/')) {
  2310. const tagName = ref.substring('refs/tags/'.length);
  2311. return ((yield git.tagExists(tagName)) && commit === (yield git.revParse(ref)));
  2312. }
  2313. // Unexpected
  2314. else {
  2315. core.debug(`Unexpected ref format '${ref}' when testing ref info`);
  2316. return true;
  2317. }
  2318. });
  2319. }
  2320. function checkCommitInfo(token, commitInfo, repositoryOwner, repositoryName, ref, commit, baseUrl) {
  2321. return __awaiter(this, void 0, void 0, function* () {
  2322. var _a;
  2323. try {
  2324. // GHES?
  2325. if ((0, url_helper_1.isGhes)(baseUrl)) {
  2326. return;
  2327. }
  2328. // Auth token?
  2329. if (!token) {
  2330. return;
  2331. }
  2332. // Public PR synchronize, for workflow repo?
  2333. if (fromPayload('repository.private') !== false ||
  2334. github.context.eventName !== 'pull_request' ||
  2335. fromPayload('action') !== 'synchronize' ||
  2336. repositoryOwner !== github.context.repo.owner ||
  2337. repositoryName !== github.context.repo.repo ||
  2338. ref !== github.context.ref ||
  2339. !ref.startsWith('refs/pull/') ||
  2340. commit !== github.context.sha) {
  2341. return;
  2342. }
  2343. // Head SHA
  2344. const expectedHeadSha = fromPayload('after');
  2345. if (!expectedHeadSha) {
  2346. core.debug('Unable to determine head sha');
  2347. return;
  2348. }
  2349. // Base SHA
  2350. const expectedBaseSha = fromPayload('pull_request.base.sha');
  2351. if (!expectedBaseSha) {
  2352. core.debug('Unable to determine base sha');
  2353. return;
  2354. }
  2355. // Expected message?
  2356. const expectedMessage = `Merge ${expectedHeadSha} into ${expectedBaseSha}`;
  2357. if (commitInfo.indexOf(expectedMessage) >= 0) {
  2358. return;
  2359. }
  2360. // Extract details from message
  2361. const match = commitInfo.match(/Merge ([0-9a-f]{40}) into ([0-9a-f]{40})/);
  2362. if (!match) {
  2363. core.debug('Unexpected message format');
  2364. return;
  2365. }
  2366. // Post telemetry
  2367. const actualHeadSha = match[1];
  2368. if (actualHeadSha !== expectedHeadSha) {
  2369. core.debug(`Expected head sha ${expectedHeadSha}; actual head sha ${actualHeadSha}`);
  2370. const octokit = github.getOctokit(token, {
  2371. baseUrl: (0, url_helper_1.getServerApiUrl)(baseUrl),
  2372. 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})`
  2373. });
  2374. yield octokit.rest.repos.get({
  2375. owner: repositoryOwner,
  2376. repo: repositoryName
  2377. });
  2378. }
  2379. }
  2380. catch (err) {
  2381. core.debug(`Error when validating commit info: ${(_a = err === null || err === void 0 ? void 0 : err.stack) !== null && _a !== void 0 ? _a : err}`);
  2382. }
  2383. });
  2384. }
  2385. function fromPayload(path) {
  2386. return select(github.context.payload, path);
  2387. }
  2388. function select(obj, path) {
  2389. if (!obj) {
  2390. return undefined;
  2391. }
  2392. const i = path.indexOf('.');
  2393. if (i < 0) {
  2394. return obj[path];
  2395. }
  2396. const key = path.substr(0, i);
  2397. return select(obj[key], path.substr(i + 1));
  2398. }
  2399. /***/ }),
  2400. /***/ 3120:
  2401. /***/ ((__unused_webpack_module, exports) => {
  2402. "use strict";
  2403. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2404. exports.escape = escape;
  2405. function escape(value) {
  2406. return value.replace(/[^a-zA-Z0-9_]/g, x => {
  2407. return `\\${x}`;
  2408. });
  2409. }
  2410. /***/ }),
  2411. /***/ 2155:
  2412. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2413. "use strict";
  2414. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2415. if (k2 === undefined) k2 = k;
  2416. var desc = Object.getOwnPropertyDescriptor(m, k);
  2417. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2418. desc = { enumerable: true, get: function() { return m[k]; } };
  2419. }
  2420. Object.defineProperty(o, k2, desc);
  2421. }) : (function(o, m, k, k2) {
  2422. if (k2 === undefined) k2 = k;
  2423. o[k2] = m[k];
  2424. }));
  2425. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2426. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2427. }) : function(o, v) {
  2428. o["default"] = v;
  2429. });
  2430. var __importStar = (this && this.__importStar) || function (mod) {
  2431. if (mod && mod.__esModule) return mod;
  2432. var result = {};
  2433. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2434. __setModuleDefault(result, mod);
  2435. return result;
  2436. };
  2437. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2438. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2439. return new (P || (P = Promise))(function (resolve, reject) {
  2440. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2441. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2442. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2443. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2444. });
  2445. };
  2446. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2447. exports.RetryHelper = void 0;
  2448. exports.execute = execute;
  2449. const core = __importStar(__nccwpck_require__(2186));
  2450. const defaultMaxAttempts = 3;
  2451. const defaultMinSeconds = 10;
  2452. const defaultMaxSeconds = 20;
  2453. class RetryHelper {
  2454. constructor(maxAttempts = defaultMaxAttempts, minSeconds = defaultMinSeconds, maxSeconds = defaultMaxSeconds) {
  2455. this.maxAttempts = maxAttempts;
  2456. this.minSeconds = Math.floor(minSeconds);
  2457. this.maxSeconds = Math.floor(maxSeconds);
  2458. if (this.minSeconds > this.maxSeconds) {
  2459. throw new Error('min seconds should be less than or equal to max seconds');
  2460. }
  2461. }
  2462. execute(action) {
  2463. return __awaiter(this, void 0, void 0, function* () {
  2464. let attempt = 1;
  2465. while (attempt < this.maxAttempts) {
  2466. // Try
  2467. try {
  2468. return yield action();
  2469. }
  2470. catch (err) {
  2471. core.info(err === null || err === void 0 ? void 0 : err.message);
  2472. }
  2473. // Sleep
  2474. const seconds = this.getSleepAmount();
  2475. core.info(`Waiting ${seconds} seconds before trying again`);
  2476. yield this.sleep(seconds);
  2477. attempt++;
  2478. }
  2479. // Last attempt
  2480. return yield action();
  2481. });
  2482. }
  2483. getSleepAmount() {
  2484. return (Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) +
  2485. this.minSeconds);
  2486. }
  2487. sleep(seconds) {
  2488. return __awaiter(this, void 0, void 0, function* () {
  2489. return new Promise(resolve => setTimeout(resolve, seconds * 1000));
  2490. });
  2491. }
  2492. }
  2493. exports.RetryHelper = RetryHelper;
  2494. function execute(action) {
  2495. return __awaiter(this, void 0, void 0, function* () {
  2496. const retryHelper = new RetryHelper();
  2497. return yield retryHelper.execute(action);
  2498. });
  2499. }
  2500. /***/ }),
  2501. /***/ 4866:
  2502. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2503. "use strict";
  2504. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2505. if (k2 === undefined) k2 = k;
  2506. var desc = Object.getOwnPropertyDescriptor(m, k);
  2507. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2508. desc = { enumerable: true, get: function() { return m[k]; } };
  2509. }
  2510. Object.defineProperty(o, k2, desc);
  2511. }) : (function(o, m, k, k2) {
  2512. if (k2 === undefined) k2 = k;
  2513. o[k2] = m[k];
  2514. }));
  2515. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2516. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2517. }) : function(o, v) {
  2518. o["default"] = v;
  2519. });
  2520. var __importStar = (this && this.__importStar) || function (mod) {
  2521. if (mod && mod.__esModule) return mod;
  2522. var result = {};
  2523. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2524. __setModuleDefault(result, mod);
  2525. return result;
  2526. };
  2527. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2528. exports.SshKnownHostsPath = exports.SshKeyPath = exports.PostSetSafeDirectory = exports.RepositoryPath = exports.IsPost = void 0;
  2529. exports.setRepositoryPath = setRepositoryPath;
  2530. exports.setSshKeyPath = setSshKeyPath;
  2531. exports.setSshKnownHostsPath = setSshKnownHostsPath;
  2532. exports.setSafeDirectory = setSafeDirectory;
  2533. const core = __importStar(__nccwpck_require__(2186));
  2534. /**
  2535. * Indicates whether the POST action is running
  2536. */
  2537. exports.IsPost = !!core.getState('isPost');
  2538. /**
  2539. * The repository path for the POST action. The value is empty during the MAIN action.
  2540. */
  2541. exports.RepositoryPath = core.getState('repositoryPath');
  2542. /**
  2543. * The set-safe-directory for the POST action. The value is set if input: 'safe-directory' is set during the MAIN action.
  2544. */
  2545. exports.PostSetSafeDirectory = core.getState('setSafeDirectory') === 'true';
  2546. /**
  2547. * The SSH key path for the POST action. The value is empty during the MAIN action.
  2548. */
  2549. exports.SshKeyPath = core.getState('sshKeyPath');
  2550. /**
  2551. * The SSH known hosts path for the POST action. The value is empty during the MAIN action.
  2552. */
  2553. exports.SshKnownHostsPath = core.getState('sshKnownHostsPath');
  2554. /**
  2555. * Save the repository path so the POST action can retrieve the value.
  2556. */
  2557. function setRepositoryPath(repositoryPath) {
  2558. core.saveState('repositoryPath', repositoryPath);
  2559. }
  2560. /**
  2561. * Save the SSH key path so the POST action can retrieve the value.
  2562. */
  2563. function setSshKeyPath(sshKeyPath) {
  2564. core.saveState('sshKeyPath', sshKeyPath);
  2565. }
  2566. /**
  2567. * Save the SSH known hosts path so the POST action can retrieve the value.
  2568. */
  2569. function setSshKnownHostsPath(sshKnownHostsPath) {
  2570. core.saveState('sshKnownHostsPath', sshKnownHostsPath);
  2571. }
  2572. /**
  2573. * Save the set-safe-directory input so the POST action can retrieve the value.
  2574. */
  2575. function setSafeDirectory() {
  2576. core.saveState('setSafeDirectory', 'true');
  2577. }
  2578. // Publish a variable so that when the POST action runs, it can determine it should run the cleanup logic.
  2579. // This is necessary since we don't have a separate entry point.
  2580. if (!exports.IsPost) {
  2581. core.saveState('isPost', 'true');
  2582. }
  2583. /***/ }),
  2584. /***/ 9437:
  2585. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2586. "use strict";
  2587. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2588. if (k2 === undefined) k2 = k;
  2589. var desc = Object.getOwnPropertyDescriptor(m, k);
  2590. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2591. desc = { enumerable: true, get: function() { return m[k]; } };
  2592. }
  2593. Object.defineProperty(o, k2, desc);
  2594. }) : (function(o, m, k, k2) {
  2595. if (k2 === undefined) k2 = k;
  2596. o[k2] = m[k];
  2597. }));
  2598. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2599. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2600. }) : function(o, v) {
  2601. o["default"] = v;
  2602. });
  2603. var __importStar = (this && this.__importStar) || function (mod) {
  2604. if (mod && mod.__esModule) return mod;
  2605. var result = {};
  2606. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2607. __setModuleDefault(result, mod);
  2608. return result;
  2609. };
  2610. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2611. exports.getFetchUrl = getFetchUrl;
  2612. exports.getServerUrl = getServerUrl;
  2613. exports.getServerApiUrl = getServerApiUrl;
  2614. exports.isGhes = isGhes;
  2615. const assert = __importStar(__nccwpck_require__(9491));
  2616. const url_1 = __nccwpck_require__(7310);
  2617. function getFetchUrl(settings) {
  2618. assert.ok(settings.repositoryOwner, 'settings.repositoryOwner must be defined');
  2619. assert.ok(settings.repositoryName, 'settings.repositoryName must be defined');
  2620. const serviceUrl = getServerUrl(settings.githubServerUrl);
  2621. const encodedOwner = encodeURIComponent(settings.repositoryOwner);
  2622. const encodedName = encodeURIComponent(settings.repositoryName);
  2623. if (settings.sshKey) {
  2624. const user = settings.sshUser.length > 0 ? settings.sshUser : 'git';
  2625. return `${user}@${serviceUrl.hostname}:${encodedOwner}/${encodedName}.git`;
  2626. }
  2627. // "origin" is SCHEME://HOSTNAME[:PORT]
  2628. return `${serviceUrl.origin}/${encodedOwner}/${encodedName}`;
  2629. }
  2630. function getServerUrl(url) {
  2631. let resolvedUrl = process.env['GITHUB_SERVER_URL'] || 'https://github.com';
  2632. if (hasContent(url, WhitespaceMode.Trim)) {
  2633. resolvedUrl = url;
  2634. }
  2635. return new url_1.URL(resolvedUrl);
  2636. }
  2637. function getServerApiUrl(url) {
  2638. if (hasContent(url, WhitespaceMode.Trim)) {
  2639. let serverUrl = getServerUrl(url);
  2640. if (isGhes(url)) {
  2641. serverUrl.pathname = 'api/v3';
  2642. }
  2643. else {
  2644. serverUrl.hostname = 'api.' + serverUrl.hostname;
  2645. }
  2646. return pruneSuffix(serverUrl.toString(), '/');
  2647. }
  2648. return process.env['GITHUB_API_URL'] || 'https://api.github.com';
  2649. }
  2650. function isGhes(url) {
  2651. const ghUrl = new url_1.URL(url || process.env['GITHUB_SERVER_URL'] || 'https://github.com');
  2652. const hostname = ghUrl.hostname.trimEnd().toUpperCase();
  2653. const isGitHubHost = hostname === 'GITHUB.COM';
  2654. const isGitHubEnterpriseCloudHost = hostname.endsWith('.GHE.COM');
  2655. const isLocalHost = hostname.endsWith('.LOCALHOST');
  2656. return !isGitHubHost && !isGitHubEnterpriseCloudHost && !isLocalHost;
  2657. }
  2658. function pruneSuffix(text, suffix) {
  2659. if (hasContent(suffix, WhitespaceMode.Preserve) && (text === null || text === void 0 ? void 0 : text.endsWith(suffix))) {
  2660. return text.substring(0, text.length - suffix.length);
  2661. }
  2662. return text;
  2663. }
  2664. var WhitespaceMode;
  2665. (function (WhitespaceMode) {
  2666. WhitespaceMode[WhitespaceMode["Trim"] = 0] = "Trim";
  2667. WhitespaceMode[WhitespaceMode["Preserve"] = 1] = "Preserve";
  2668. })(WhitespaceMode || (WhitespaceMode = {}));
  2669. function hasContent(text, whitespaceMode) {
  2670. let refinedText = text !== null && text !== void 0 ? text : '';
  2671. if (whitespaceMode == WhitespaceMode.Trim) {
  2672. refinedText = refinedText.trim();
  2673. }
  2674. return refinedText.length > 0;
  2675. }
  2676. /***/ }),
  2677. /***/ 9568:
  2678. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2679. "use strict";
  2680. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2681. if (k2 === undefined) k2 = k;
  2682. var desc = Object.getOwnPropertyDescriptor(m, k);
  2683. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2684. desc = { enumerable: true, get: function() { return m[k]; } };
  2685. }
  2686. Object.defineProperty(o, k2, desc);
  2687. }) : (function(o, m, k, k2) {
  2688. if (k2 === undefined) k2 = k;
  2689. o[k2] = m[k];
  2690. }));
  2691. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2692. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2693. }) : function(o, v) {
  2694. o["default"] = v;
  2695. });
  2696. var __importStar = (this && this.__importStar) || function (mod) {
  2697. if (mod && mod.__esModule) return mod;
  2698. var result = {};
  2699. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2700. __setModuleDefault(result, mod);
  2701. return result;
  2702. };
  2703. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2704. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2705. return new (P || (P = Promise))(function (resolve, reject) {
  2706. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2707. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2708. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2709. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2710. });
  2711. };
  2712. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2713. exports.getOrganizationId = getOrganizationId;
  2714. const core = __importStar(__nccwpck_require__(2186));
  2715. const fs = __importStar(__nccwpck_require__(7147));
  2716. /**
  2717. * Gets the organization ID of the running workflow or undefined if the value cannot be loaded from the GITHUB_EVENT_PATH
  2718. */
  2719. function getOrganizationId() {
  2720. return __awaiter(this, void 0, void 0, function* () {
  2721. var _a, _b;
  2722. try {
  2723. const eventPath = process.env.GITHUB_EVENT_PATH;
  2724. if (!eventPath) {
  2725. core.debug(`GITHUB_EVENT_PATH is not defined`);
  2726. return;
  2727. }
  2728. const content = yield fs.promises.readFile(eventPath, { encoding: 'utf8' });
  2729. const event = JSON.parse(content);
  2730. 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;
  2731. if (typeof id !== 'number') {
  2732. core.debug('Repository owner ID not found within GITHUB event info');
  2733. return;
  2734. }
  2735. return id;
  2736. }
  2737. catch (err) {
  2738. core.debug(`Unable to load organization ID from GITHUB_EVENT_PATH: ${err.message || err}`);
  2739. }
  2740. });
  2741. }
  2742. /***/ }),
  2743. /***/ 7351:
  2744. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2745. "use strict";
  2746. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2747. if (k2 === undefined) k2 = k;
  2748. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  2749. }) : (function(o, m, k, k2) {
  2750. if (k2 === undefined) k2 = k;
  2751. o[k2] = m[k];
  2752. }));
  2753. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2754. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2755. }) : function(o, v) {
  2756. o["default"] = v;
  2757. });
  2758. var __importStar = (this && this.__importStar) || function (mod) {
  2759. if (mod && mod.__esModule) return mod;
  2760. var result = {};
  2761. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2762. __setModuleDefault(result, mod);
  2763. return result;
  2764. };
  2765. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2766. exports.issue = exports.issueCommand = void 0;
  2767. const os = __importStar(__nccwpck_require__(2037));
  2768. const utils_1 = __nccwpck_require__(5278);
  2769. /**
  2770. * Commands
  2771. *
  2772. * Command Format:
  2773. * ::name key=value,key=value::message
  2774. *
  2775. * Examples:
  2776. * ::warning::This is the message
  2777. * ::set-env name=MY_VAR::some value
  2778. */
  2779. function issueCommand(command, properties, message) {
  2780. const cmd = new Command(command, properties, message);
  2781. process.stdout.write(cmd.toString() + os.EOL);
  2782. }
  2783. exports.issueCommand = issueCommand;
  2784. function issue(name, message = '') {
  2785. issueCommand(name, {}, message);
  2786. }
  2787. exports.issue = issue;
  2788. const CMD_STRING = '::';
  2789. class Command {
  2790. constructor(command, properties, message) {
  2791. if (!command) {
  2792. command = 'missing.command';
  2793. }
  2794. this.command = command;
  2795. this.properties = properties;
  2796. this.message = message;
  2797. }
  2798. toString() {
  2799. let cmdStr = CMD_STRING + this.command;
  2800. if (this.properties && Object.keys(this.properties).length > 0) {
  2801. cmdStr += ' ';
  2802. let first = true;
  2803. for (const key in this.properties) {
  2804. if (this.properties.hasOwnProperty(key)) {
  2805. const val = this.properties[key];
  2806. if (val) {
  2807. if (first) {
  2808. first = false;
  2809. }
  2810. else {
  2811. cmdStr += ',';
  2812. }
  2813. cmdStr += `${key}=${escapeProperty(val)}`;
  2814. }
  2815. }
  2816. }
  2817. }
  2818. cmdStr += `${CMD_STRING}${escapeData(this.message)}`;
  2819. return cmdStr;
  2820. }
  2821. }
  2822. function escapeData(s) {
  2823. return utils_1.toCommandValue(s)
  2824. .replace(/%/g, '%25')
  2825. .replace(/\r/g, '%0D')
  2826. .replace(/\n/g, '%0A');
  2827. }
  2828. function escapeProperty(s) {
  2829. return utils_1.toCommandValue(s)
  2830. .replace(/%/g, '%25')
  2831. .replace(/\r/g, '%0D')
  2832. .replace(/\n/g, '%0A')
  2833. .replace(/:/g, '%3A')
  2834. .replace(/,/g, '%2C');
  2835. }
  2836. //# sourceMappingURL=command.js.map
  2837. /***/ }),
  2838. /***/ 2186:
  2839. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2840. "use strict";
  2841. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2842. if (k2 === undefined) k2 = k;
  2843. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  2844. }) : (function(o, m, k, k2) {
  2845. if (k2 === undefined) k2 = k;
  2846. o[k2] = m[k];
  2847. }));
  2848. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2849. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2850. }) : function(o, v) {
  2851. o["default"] = v;
  2852. });
  2853. var __importStar = (this && this.__importStar) || function (mod) {
  2854. if (mod && mod.__esModule) return mod;
  2855. var result = {};
  2856. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2857. __setModuleDefault(result, mod);
  2858. return result;
  2859. };
  2860. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2861. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2862. return new (P || (P = Promise))(function (resolve, reject) {
  2863. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2864. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2865. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2866. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2867. });
  2868. };
  2869. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2870. 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;
  2871. const command_1 = __nccwpck_require__(7351);
  2872. const file_command_1 = __nccwpck_require__(717);
  2873. const utils_1 = __nccwpck_require__(5278);
  2874. const os = __importStar(__nccwpck_require__(2037));
  2875. const path = __importStar(__nccwpck_require__(1017));
  2876. const oidc_utils_1 = __nccwpck_require__(8041);
  2877. /**
  2878. * The code to exit an action
  2879. */
  2880. var ExitCode;
  2881. (function (ExitCode) {
  2882. /**
  2883. * A code indicating that the action was successful
  2884. */
  2885. ExitCode[ExitCode["Success"] = 0] = "Success";
  2886. /**
  2887. * A code indicating that the action was a failure
  2888. */
  2889. ExitCode[ExitCode["Failure"] = 1] = "Failure";
  2890. })(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
  2891. //-----------------------------------------------------------------------
  2892. // Variables
  2893. //-----------------------------------------------------------------------
  2894. /**
  2895. * Sets env variable for this action and future actions in the job
  2896. * @param name the name of the variable to set
  2897. * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify
  2898. */
  2899. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  2900. function exportVariable(name, val) {
  2901. const convertedVal = utils_1.toCommandValue(val);
  2902. process.env[name] = convertedVal;
  2903. const filePath = process.env['GITHUB_ENV'] || '';
  2904. if (filePath) {
  2905. return file_command_1.issueFileCommand('ENV', file_command_1.prepareKeyValueMessage(name, val));
  2906. }
  2907. command_1.issueCommand('set-env', { name }, convertedVal);
  2908. }
  2909. exports.exportVariable = exportVariable;
  2910. /**
  2911. * Registers a secret which will get masked from logs
  2912. * @param secret value of the secret
  2913. */
  2914. function setSecret(secret) {
  2915. command_1.issueCommand('add-mask', {}, secret);
  2916. }
  2917. exports.setSecret = setSecret;
  2918. /**
  2919. * Prepends inputPath to the PATH (for this action and future actions)
  2920. * @param inputPath
  2921. */
  2922. function addPath(inputPath) {
  2923. const filePath = process.env['GITHUB_PATH'] || '';
  2924. if (filePath) {
  2925. file_command_1.issueFileCommand('PATH', inputPath);
  2926. }
  2927. else {
  2928. command_1.issueCommand('add-path', {}, inputPath);
  2929. }
  2930. process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
  2931. }
  2932. exports.addPath = addPath;
  2933. /**
  2934. * Gets the value of an input.
  2935. * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed.
  2936. * Returns an empty string if the value is not defined.
  2937. *
  2938. * @param name name of the input to get
  2939. * @param options optional. See InputOptions.
  2940. * @returns string
  2941. */
  2942. function getInput(name, options) {
  2943. const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';
  2944. if (options && options.required && !val) {
  2945. throw new Error(`Input required and not supplied: ${name}`);
  2946. }
  2947. if (options && options.trimWhitespace === false) {
  2948. return val;
  2949. }
  2950. return val.trim();
  2951. }
  2952. exports.getInput = getInput;
  2953. /**
  2954. * Gets the values of an multiline input. Each value is also trimmed.
  2955. *
  2956. * @param name name of the input to get
  2957. * @param options optional. See InputOptions.
  2958. * @returns string[]
  2959. *
  2960. */
  2961. function getMultilineInput(name, options) {
  2962. const inputs = getInput(name, options)
  2963. .split('\n')
  2964. .filter(x => x !== '');
  2965. if (options && options.trimWhitespace === false) {
  2966. return inputs;
  2967. }
  2968. return inputs.map(input => input.trim());
  2969. }
  2970. exports.getMultilineInput = getMultilineInput;
  2971. /**
  2972. * Gets the input value of the boolean type in the YAML 1.2 "core schema" specification.
  2973. * Support boolean input list: `true | True | TRUE | false | False | FALSE` .
  2974. * The return value is also in boolean type.
  2975. * ref: https://yaml.org/spec/1.2/spec.html#id2804923
  2976. *
  2977. * @param name name of the input to get
  2978. * @param options optional. See InputOptions.
  2979. * @returns boolean
  2980. */
  2981. function getBooleanInput(name, options) {
  2982. const trueValue = ['true', 'True', 'TRUE'];
  2983. const falseValue = ['false', 'False', 'FALSE'];
  2984. const val = getInput(name, options);
  2985. if (trueValue.includes(val))
  2986. return true;
  2987. if (falseValue.includes(val))
  2988. return false;
  2989. throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${name}\n` +
  2990. `Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);
  2991. }
  2992. exports.getBooleanInput = getBooleanInput;
  2993. /**
  2994. * Sets the value of an output.
  2995. *
  2996. * @param name name of the output to set
  2997. * @param value value to store. Non-string values will be converted to a string via JSON.stringify
  2998. */
  2999. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  3000. function setOutput(name, value) {
  3001. const filePath = process.env['GITHUB_OUTPUT'] || '';
  3002. if (filePath) {
  3003. return file_command_1.issueFileCommand('OUTPUT', file_command_1.prepareKeyValueMessage(name, value));
  3004. }
  3005. process.stdout.write(os.EOL);
  3006. command_1.issueCommand('set-output', { name }, utils_1.toCommandValue(value));
  3007. }
  3008. exports.setOutput = setOutput;
  3009. /**
  3010. * Enables or disables the echoing of commands into stdout for the rest of the step.
  3011. * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.
  3012. *
  3013. */
  3014. function setCommandEcho(enabled) {
  3015. command_1.issue('echo', enabled ? 'on' : 'off');
  3016. }
  3017. exports.setCommandEcho = setCommandEcho;
  3018. //-----------------------------------------------------------------------
  3019. // Results
  3020. //-----------------------------------------------------------------------
  3021. /**
  3022. * Sets the action status to failed.
  3023. * When the action exits it will be with an exit code of 1
  3024. * @param message add error issue message
  3025. */
  3026. function setFailed(message) {
  3027. process.exitCode = ExitCode.Failure;
  3028. error(message);
  3029. }
  3030. exports.setFailed = setFailed;
  3031. //-----------------------------------------------------------------------
  3032. // Logging Commands
  3033. //-----------------------------------------------------------------------
  3034. /**
  3035. * Gets whether Actions Step Debug is on or not
  3036. */
  3037. function isDebug() {
  3038. return process.env['RUNNER_DEBUG'] === '1';
  3039. }
  3040. exports.isDebug = isDebug;
  3041. /**
  3042. * Writes debug message to user log
  3043. * @param message debug message
  3044. */
  3045. function debug(message) {
  3046. command_1.issueCommand('debug', {}, message);
  3047. }
  3048. exports.debug = debug;
  3049. /**
  3050. * Adds an error issue
  3051. * @param message error issue message. Errors will be converted to string via toString()
  3052. * @param properties optional properties to add to the annotation.
  3053. */
  3054. function error(message, properties = {}) {
  3055. command_1.issueCommand('error', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
  3056. }
  3057. exports.error = error;
  3058. /**
  3059. * Adds a warning issue
  3060. * @param message warning issue message. Errors will be converted to string via toString()
  3061. * @param properties optional properties to add to the annotation.
  3062. */
  3063. function warning(message, properties = {}) {
  3064. command_1.issueCommand('warning', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
  3065. }
  3066. exports.warning = warning;
  3067. /**
  3068. * Adds a notice issue
  3069. * @param message notice issue message. Errors will be converted to string via toString()
  3070. * @param properties optional properties to add to the annotation.
  3071. */
  3072. function notice(message, properties = {}) {
  3073. command_1.issueCommand('notice', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
  3074. }
  3075. exports.notice = notice;
  3076. /**
  3077. * Writes info to log with console.log.
  3078. * @param message info message
  3079. */
  3080. function info(message) {
  3081. process.stdout.write(message + os.EOL);
  3082. }
  3083. exports.info = info;
  3084. /**
  3085. * Begin an output group.
  3086. *
  3087. * Output until the next `groupEnd` will be foldable in this group
  3088. *
  3089. * @param name The name of the output group
  3090. */
  3091. function startGroup(name) {
  3092. command_1.issue('group', name);
  3093. }
  3094. exports.startGroup = startGroup;
  3095. /**
  3096. * End an output group.
  3097. */
  3098. function endGroup() {
  3099. command_1.issue('endgroup');
  3100. }
  3101. exports.endGroup = endGroup;
  3102. /**
  3103. * Wrap an asynchronous function call in a group.
  3104. *
  3105. * Returns the same type as the function itself.
  3106. *
  3107. * @param name The name of the group
  3108. * @param fn The function to wrap in the group
  3109. */
  3110. function group(name, fn) {
  3111. return __awaiter(this, void 0, void 0, function* () {
  3112. startGroup(name);
  3113. let result;
  3114. try {
  3115. result = yield fn();
  3116. }
  3117. finally {
  3118. endGroup();
  3119. }
  3120. return result;
  3121. });
  3122. }
  3123. exports.group = group;
  3124. //-----------------------------------------------------------------------
  3125. // Wrapper action state
  3126. //-----------------------------------------------------------------------
  3127. /**
  3128. * Saves state for current action, the state can only be retrieved by this action's post job execution.
  3129. *
  3130. * @param name name of the state to store
  3131. * @param value value to store. Non-string values will be converted to a string via JSON.stringify
  3132. */
  3133. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  3134. function saveState(name, value) {
  3135. const filePath = process.env['GITHUB_STATE'] || '';
  3136. if (filePath) {
  3137. return file_command_1.issueFileCommand('STATE', file_command_1.prepareKeyValueMessage(name, value));
  3138. }
  3139. command_1.issueCommand('save-state', { name }, utils_1.toCommandValue(value));
  3140. }
  3141. exports.saveState = saveState;
  3142. /**
  3143. * Gets the value of an state set by this action's main execution.
  3144. *
  3145. * @param name name of the state to get
  3146. * @returns string
  3147. */
  3148. function getState(name) {
  3149. return process.env[`STATE_${name}`] || '';
  3150. }
  3151. exports.getState = getState;
  3152. function getIDToken(aud) {
  3153. return __awaiter(this, void 0, void 0, function* () {
  3154. return yield oidc_utils_1.OidcClient.getIDToken(aud);
  3155. });
  3156. }
  3157. exports.getIDToken = getIDToken;
  3158. /**
  3159. * Summary exports
  3160. */
  3161. var summary_1 = __nccwpck_require__(1327);
  3162. Object.defineProperty(exports, "summary", ({ enumerable: true, get: function () { return summary_1.summary; } }));
  3163. /**
  3164. * @deprecated use core.summary
  3165. */
  3166. var summary_2 = __nccwpck_require__(1327);
  3167. Object.defineProperty(exports, "markdownSummary", ({ enumerable: true, get: function () { return summary_2.markdownSummary; } }));
  3168. /**
  3169. * Path exports
  3170. */
  3171. var path_utils_1 = __nccwpck_require__(2981);
  3172. Object.defineProperty(exports, "toPosixPath", ({ enumerable: true, get: function () { return path_utils_1.toPosixPath; } }));
  3173. Object.defineProperty(exports, "toWin32Path", ({ enumerable: true, get: function () { return path_utils_1.toWin32Path; } }));
  3174. Object.defineProperty(exports, "toPlatformPath", ({ enumerable: true, get: function () { return path_utils_1.toPlatformPath; } }));
  3175. //# sourceMappingURL=core.js.map
  3176. /***/ }),
  3177. /***/ 717:
  3178. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  3179. "use strict";
  3180. // For internal use, subject to change.
  3181. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  3182. if (k2 === undefined) k2 = k;
  3183. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  3184. }) : (function(o, m, k, k2) {
  3185. if (k2 === undefined) k2 = k;
  3186. o[k2] = m[k];
  3187. }));
  3188. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  3189. Object.defineProperty(o, "default", { enumerable: true, value: v });
  3190. }) : function(o, v) {
  3191. o["default"] = v;
  3192. });
  3193. var __importStar = (this && this.__importStar) || function (mod) {
  3194. if (mod && mod.__esModule) return mod;
  3195. var result = {};
  3196. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  3197. __setModuleDefault(result, mod);
  3198. return result;
  3199. };
  3200. Object.defineProperty(exports, "__esModule", ({ value: true }));
  3201. exports.prepareKeyValueMessage = exports.issueFileCommand = void 0;
  3202. // We use any as a valid input type
  3203. /* eslint-disable @typescript-eslint/no-explicit-any */
  3204. const fs = __importStar(__nccwpck_require__(7147));
  3205. const os = __importStar(__nccwpck_require__(2037));
  3206. const uuid_1 = __nccwpck_require__(8974);
  3207. const utils_1 = __nccwpck_require__(5278);
  3208. function issueFileCommand(command, message) {
  3209. const filePath = process.env[`GITHUB_${command}`];
  3210. if (!filePath) {
  3211. throw new Error(`Unable to find environment variable for file command ${command}`);
  3212. }
  3213. if (!fs.existsSync(filePath)) {
  3214. throw new Error(`Missing file at path: ${filePath}`);
  3215. }
  3216. fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {
  3217. encoding: 'utf8'
  3218. });
  3219. }
  3220. exports.issueFileCommand = issueFileCommand;
  3221. function prepareKeyValueMessage(key, value) {
  3222. const delimiter = `ghadelimiter_${uuid_1.v4()}`;
  3223. const convertedValue = utils_1.toCommandValue(value);
  3224. // These should realistically never happen, but just in case someone finds a
  3225. // way to exploit uuid generation let's not allow keys or values that contain
  3226. // the delimiter.
  3227. if (key.includes(delimiter)) {
  3228. throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`);
  3229. }
  3230. if (convertedValue.includes(delimiter)) {
  3231. throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`);
  3232. }
  3233. return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`;
  3234. }
  3235. exports.prepareKeyValueMessage = prepareKeyValueMessage;
  3236. //# sourceMappingURL=file-command.js.map
  3237. /***/ }),
  3238. /***/ 8041:
  3239. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  3240. "use strict";
  3241. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  3242. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  3243. return new (P || (P = Promise))(function (resolve, reject) {
  3244. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  3245. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  3246. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  3247. step((generator = generator.apply(thisArg, _arguments || [])).next());
  3248. });
  3249. };
  3250. Object.defineProperty(exports, "__esModule", ({ value: true }));
  3251. exports.OidcClient = void 0;
  3252. const http_client_1 = __nccwpck_require__(6255);
  3253. const auth_1 = __nccwpck_require__(5526);
  3254. const core_1 = __nccwpck_require__(2186);
  3255. class OidcClient {
  3256. static createHttpClient(allowRetry = true, maxRetry = 10) {
  3257. const requestOptions = {
  3258. allowRetries: allowRetry,
  3259. maxRetries: maxRetry
  3260. };
  3261. return new http_client_1.HttpClient('actions/oidc-client', [new auth_1.BearerCredentialHandler(OidcClient.getRequestToken())], requestOptions);
  3262. }
  3263. static getRequestToken() {
  3264. const token = process.env['ACTIONS_ID_TOKEN_REQUEST_TOKEN'];
  3265. if (!token) {
  3266. throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable');
  3267. }
  3268. return token;
  3269. }
  3270. static getIDTokenUrl() {
  3271. const runtimeUrl = process.env['ACTIONS_ID_TOKEN_REQUEST_URL'];
  3272. if (!runtimeUrl) {
  3273. throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable');
  3274. }
  3275. return runtimeUrl;
  3276. }
  3277. static getCall(id_token_url) {
  3278. var _a;
  3279. return __awaiter(this, void 0, void 0, function* () {
  3280. const httpclient = OidcClient.createHttpClient();
  3281. const res = yield httpclient
  3282. .getJson(id_token_url)
  3283. .catch(error => {
  3284. throw new Error(`Failed to get ID Token. \n
  3285. Error Code : ${error.statusCode}\n
  3286. Error Message: ${error.message}`);
  3287. });
  3288. const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value;
  3289. if (!id_token) {
  3290. throw new Error('Response json body do not have ID Token field');
  3291. }
  3292. return id_token;
  3293. });
  3294. }
  3295. static getIDToken(audience) {
  3296. return __awaiter(this, void 0, void 0, function* () {
  3297. try {
  3298. // New ID Token is requested from action service
  3299. let id_token_url = OidcClient.getIDTokenUrl();
  3300. if (audience) {
  3301. const encodedAudience = encodeURIComponent(audience);
  3302. id_token_url = `${id_token_url}&audience=${encodedAudience}`;
  3303. }
  3304. core_1.debug(`ID token url is ${id_token_url}`);
  3305. const id_token = yield OidcClient.getCall(id_token_url);
  3306. core_1.setSecret(id_token);
  3307. return id_token;
  3308. }
  3309. catch (error) {
  3310. throw new Error(`Error message: ${error.message}`);
  3311. }
  3312. });
  3313. }
  3314. }
  3315. exports.OidcClient = OidcClient;
  3316. //# sourceMappingURL=oidc-utils.js.map
  3317. /***/ }),
  3318. /***/ 2981:
  3319. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  3320. "use strict";
  3321. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  3322. if (k2 === undefined) k2 = k;
  3323. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  3324. }) : (function(o, m, k, k2) {
  3325. if (k2 === undefined) k2 = k;
  3326. o[k2] = m[k];
  3327. }));
  3328. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  3329. Object.defineProperty(o, "default", { enumerable: true, value: v });
  3330. }) : function(o, v) {
  3331. o["default"] = v;
  3332. });
  3333. var __importStar = (this && this.__importStar) || function (mod) {
  3334. if (mod && mod.__esModule) return mod;
  3335. var result = {};
  3336. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  3337. __setModuleDefault(result, mod);
  3338. return result;
  3339. };
  3340. Object.defineProperty(exports, "__esModule", ({ value: true }));
  3341. exports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = void 0;
  3342. const path = __importStar(__nccwpck_require__(1017));
  3343. /**
  3344. * toPosixPath converts the given path to the posix form. On Windows, \\ will be
  3345. * replaced with /.
  3346. *
  3347. * @param pth. Path to transform.
  3348. * @return string Posix path.
  3349. */
  3350. function toPosixPath(pth) {
  3351. return pth.replace(/[\\]/g, '/');
  3352. }
  3353. exports.toPosixPath = toPosixPath;
  3354. /**
  3355. * toWin32Path converts the given path to the win32 form. On Linux, / will be
  3356. * replaced with \\.
  3357. *
  3358. * @param pth. Path to transform.
  3359. * @return string Win32 path.
  3360. */
  3361. function toWin32Path(pth) {
  3362. return pth.replace(/[/]/g, '\\');
  3363. }
  3364. exports.toWin32Path = toWin32Path;
  3365. /**
  3366. * toPlatformPath converts the given path to a platform-specific path. It does
  3367. * this by replacing instances of / and \ with the platform-specific path
  3368. * separator.
  3369. *
  3370. * @param pth The path to platformize.
  3371. * @return string The platform-specific path.
  3372. */
  3373. function toPlatformPath(pth) {
  3374. return pth.replace(/[/\\]/g, path.sep);
  3375. }
  3376. exports.toPlatformPath = toPlatformPath;
  3377. //# sourceMappingURL=path-utils.js.map
  3378. /***/ }),
  3379. /***/ 1327:
  3380. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  3381. "use strict";
  3382. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  3383. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  3384. return new (P || (P = Promise))(function (resolve, reject) {
  3385. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  3386. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  3387. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  3388. step((generator = generator.apply(thisArg, _arguments || [])).next());
  3389. });
  3390. };
  3391. Object.defineProperty(exports, "__esModule", ({ value: true }));
  3392. exports.summary = exports.markdownSummary = exports.SUMMARY_DOCS_URL = exports.SUMMARY_ENV_VAR = void 0;
  3393. const os_1 = __nccwpck_require__(2037);
  3394. const fs_1 = __nccwpck_require__(7147);
  3395. const { access, appendFile, writeFile } = fs_1.promises;
  3396. exports.SUMMARY_ENV_VAR = 'GITHUB_STEP_SUMMARY';
  3397. exports.SUMMARY_DOCS_URL = 'https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary';
  3398. class Summary {
  3399. constructor() {
  3400. this._buffer = '';
  3401. }
  3402. /**
  3403. * Finds the summary file path from the environment, rejects if env var is not found or file does not exist
  3404. * Also checks r/w permissions.
  3405. *
  3406. * @returns step summary file path
  3407. */
  3408. filePath() {
  3409. return __awaiter(this, void 0, void 0, function* () {
  3410. if (this._filePath) {
  3411. return this._filePath;
  3412. }
  3413. const pathFromEnv = process.env[exports.SUMMARY_ENV_VAR];
  3414. if (!pathFromEnv) {
  3415. throw new Error(`Unable to find environment variable for $${exports.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);
  3416. }
  3417. try {
  3418. yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK);
  3419. }
  3420. catch (_a) {
  3421. throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`);
  3422. }
  3423. this._filePath = pathFromEnv;
  3424. return this._filePath;
  3425. });
  3426. }
  3427. /**
  3428. * Wraps content in an HTML tag, adding any HTML attributes
  3429. *
  3430. * @param {string} tag HTML tag to wrap
  3431. * @param {string | null} content content within the tag
  3432. * @param {[attribute: string]: string} attrs key-value list of HTML attributes to add
  3433. *
  3434. * @returns {string} content wrapped in HTML element
  3435. */
  3436. wrap(tag, content, attrs = {}) {
  3437. const htmlAttrs = Object.entries(attrs)
  3438. .map(([key, value]) => ` ${key}="${value}"`)
  3439. .join('');
  3440. if (!content) {
  3441. return `<${tag}${htmlAttrs}>`;
  3442. }
  3443. return `<${tag}${htmlAttrs}>${content}</${tag}>`;
  3444. }
  3445. /**
  3446. * Writes text in the buffer to the summary buffer file and empties buffer. Will append by default.
  3447. *
  3448. * @param {SummaryWriteOptions} [options] (optional) options for write operation
  3449. *
  3450. * @returns {Promise<Summary>} summary instance
  3451. */
  3452. write(options) {
  3453. return __awaiter(this, void 0, void 0, function* () {
  3454. const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite);
  3455. const filePath = yield this.filePath();
  3456. const writeFunc = overwrite ? writeFile : appendFile;
  3457. yield writeFunc(filePath, this._buffer, { encoding: 'utf8' });
  3458. return this.emptyBuffer();
  3459. });
  3460. }
  3461. /**
  3462. * Clears the summary buffer and wipes the summary file
  3463. *
  3464. * @returns {Summary} summary instance
  3465. */
  3466. clear() {
  3467. return __awaiter(this, void 0, void 0, function* () {
  3468. return this.emptyBuffer().write({ overwrite: true });
  3469. });
  3470. }
  3471. /**
  3472. * Returns the current summary buffer as a string
  3473. *
  3474. * @returns {string} string of summary buffer
  3475. */
  3476. stringify() {
  3477. return this._buffer;
  3478. }
  3479. /**
  3480. * If the summary buffer is empty
  3481. *
  3482. * @returns {boolen} true if the buffer is empty
  3483. */
  3484. isEmptyBuffer() {
  3485. return this._buffer.length === 0;
  3486. }
  3487. /**
  3488. * Resets the summary buffer without writing to summary file
  3489. *
  3490. * @returns {Summary} summary instance
  3491. */
  3492. emptyBuffer() {
  3493. this._buffer = '';
  3494. return this;
  3495. }
  3496. /**
  3497. * Adds raw text to the summary buffer
  3498. *
  3499. * @param {string} text content to add
  3500. * @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false)
  3501. *
  3502. * @returns {Summary} summary instance
  3503. */
  3504. addRaw(text, addEOL = false) {
  3505. this._buffer += text;
  3506. return addEOL ? this.addEOL() : this;
  3507. }
  3508. /**
  3509. * Adds the operating system-specific end-of-line marker to the buffer
  3510. *
  3511. * @returns {Summary} summary instance
  3512. */
  3513. addEOL() {
  3514. return this.addRaw(os_1.EOL);
  3515. }
  3516. /**
  3517. * Adds an HTML codeblock to the summary buffer
  3518. *
  3519. * @param {string} code content to render within fenced code block
  3520. * @param {string} lang (optional) language to syntax highlight code
  3521. *
  3522. * @returns {Summary} summary instance
  3523. */
  3524. addCodeBlock(code, lang) {
  3525. const attrs = Object.assign({}, (lang && { lang }));
  3526. const element = this.wrap('pre', this.wrap('code', code), attrs);
  3527. return this.addRaw(element).addEOL();
  3528. }
  3529. /**
  3530. * Adds an HTML list to the summary buffer
  3531. *
  3532. * @param {string[]} items list of items to render
  3533. * @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false)
  3534. *
  3535. * @returns {Summary} summary instance
  3536. */
  3537. addList(items, ordered = false) {
  3538. const tag = ordered ? 'ol' : 'ul';
  3539. const listItems = items.map(item => this.wrap('li', item)).join('');
  3540. const element = this.wrap(tag, listItems);
  3541. return this.addRaw(element).addEOL();
  3542. }
  3543. /**
  3544. * Adds an HTML table to the summary buffer
  3545. *
  3546. * @param {SummaryTableCell[]} rows table rows
  3547. *
  3548. * @returns {Summary} summary instance
  3549. */
  3550. addTable(rows) {
  3551. const tableBody = rows
  3552. .map(row => {
  3553. const cells = row
  3554. .map(cell => {
  3555. if (typeof cell === 'string') {
  3556. return this.wrap('td', cell);
  3557. }
  3558. const { header, data, colspan, rowspan } = cell;
  3559. const tag = header ? 'th' : 'td';
  3560. const attrs = Object.assign(Object.assign({}, (colspan && { colspan })), (rowspan && { rowspan }));
  3561. return this.wrap(tag, data, attrs);
  3562. })
  3563. .join('');
  3564. return this.wrap('tr', cells);
  3565. })
  3566. .join('');
  3567. const element = this.wrap('table', tableBody);
  3568. return this.addRaw(element).addEOL();
  3569. }
  3570. /**
  3571. * Adds a collapsable HTML details element to the summary buffer
  3572. *
  3573. * @param {string} label text for the closed state
  3574. * @param {string} content collapsable content
  3575. *
  3576. * @returns {Summary} summary instance
  3577. */
  3578. addDetails(label, content) {
  3579. const element = this.wrap('details', this.wrap('summary', label) + content);
  3580. return this.addRaw(element).addEOL();
  3581. }
  3582. /**
  3583. * Adds an HTML image tag to the summary buffer
  3584. *
  3585. * @param {string} src path to the image you to embed
  3586. * @param {string} alt text description of the image
  3587. * @param {SummaryImageOptions} options (optional) addition image attributes
  3588. *
  3589. * @returns {Summary} summary instance
  3590. */
  3591. addImage(src, alt, options) {
  3592. const { width, height } = options || {};
  3593. const attrs = Object.assign(Object.assign({}, (width && { width })), (height && { height }));
  3594. const element = this.wrap('img', null, Object.assign({ src, alt }, attrs));
  3595. return this.addRaw(element).addEOL();
  3596. }
  3597. /**
  3598. * Adds an HTML section heading element
  3599. *
  3600. * @param {string} text heading text
  3601. * @param {number | string} [level=1] (optional) the heading level, default: 1
  3602. *
  3603. * @returns {Summary} summary instance
  3604. */
  3605. addHeading(text, level) {
  3606. const tag = `h${level}`;
  3607. const allowedTag = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(tag)
  3608. ? tag
  3609. : 'h1';
  3610. const element = this.wrap(allowedTag, text);
  3611. return this.addRaw(element).addEOL();
  3612. }
  3613. /**
  3614. * Adds an HTML thematic break (<hr>) to the summary buffer
  3615. *
  3616. * @returns {Summary} summary instance
  3617. */
  3618. addSeparator() {
  3619. const element = this.wrap('hr', null);
  3620. return this.addRaw(element).addEOL();
  3621. }
  3622. /**
  3623. * Adds an HTML line break (<br>) to the summary buffer
  3624. *
  3625. * @returns {Summary} summary instance
  3626. */
  3627. addBreak() {
  3628. const element = this.wrap('br', null);
  3629. return this.addRaw(element).addEOL();
  3630. }
  3631. /**
  3632. * Adds an HTML blockquote to the summary buffer
  3633. *
  3634. * @param {string} text quote text
  3635. * @param {string} cite (optional) citation url
  3636. *
  3637. * @returns {Summary} summary instance
  3638. */
  3639. addQuote(text, cite) {
  3640. const attrs = Object.assign({}, (cite && { cite }));
  3641. const element = this.wrap('blockquote', text, attrs);
  3642. return this.addRaw(element).addEOL();
  3643. }
  3644. /**
  3645. * Adds an HTML anchor tag to the summary buffer
  3646. *
  3647. * @param {string} text link text/content
  3648. * @param {string} href hyperlink
  3649. *
  3650. * @returns {Summary} summary instance
  3651. */
  3652. addLink(text, href) {
  3653. const element = this.wrap('a', text, { href });
  3654. return this.addRaw(element).addEOL();
  3655. }
  3656. }
  3657. const _summary = new Summary();
  3658. /**
  3659. * @deprecated use `core.summary`
  3660. */
  3661. exports.markdownSummary = _summary;
  3662. exports.summary = _summary;
  3663. //# sourceMappingURL=summary.js.map
  3664. /***/ }),
  3665. /***/ 5278:
  3666. /***/ ((__unused_webpack_module, exports) => {
  3667. "use strict";
  3668. // We use any as a valid input type
  3669. /* eslint-disable @typescript-eslint/no-explicit-any */
  3670. Object.defineProperty(exports, "__esModule", ({ value: true }));
  3671. exports.toCommandProperties = exports.toCommandValue = void 0;
  3672. /**
  3673. * Sanitizes an input into a string so it can be passed into issueCommand safely
  3674. * @param input input to sanitize into a string
  3675. */
  3676. function toCommandValue(input) {
  3677. if (input === null || input === undefined) {
  3678. return '';
  3679. }
  3680. else if (typeof input === 'string' || input instanceof String) {
  3681. return input;
  3682. }
  3683. return JSON.stringify(input);
  3684. }
  3685. exports.toCommandValue = toCommandValue;
  3686. /**
  3687. *
  3688. * @param annotationProperties
  3689. * @returns The command properties to send with the actual annotation command
  3690. * See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646
  3691. */
  3692. function toCommandProperties(annotationProperties) {
  3693. if (!Object.keys(annotationProperties).length) {
  3694. return {};
  3695. }
  3696. return {
  3697. title: annotationProperties.title,
  3698. file: annotationProperties.file,
  3699. line: annotationProperties.startLine,
  3700. endLine: annotationProperties.endLine,
  3701. col: annotationProperties.startColumn,
  3702. endColumn: annotationProperties.endColumn
  3703. };
  3704. }
  3705. exports.toCommandProperties = toCommandProperties;
  3706. //# sourceMappingURL=utils.js.map
  3707. /***/ }),
  3708. /***/ 8974:
  3709. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3710. "use strict";
  3711. Object.defineProperty(exports, "__esModule", ({
  3712. value: true
  3713. }));
  3714. Object.defineProperty(exports, "v1", ({
  3715. enumerable: true,
  3716. get: function () {
  3717. return _v.default;
  3718. }
  3719. }));
  3720. Object.defineProperty(exports, "v3", ({
  3721. enumerable: true,
  3722. get: function () {
  3723. return _v2.default;
  3724. }
  3725. }));
  3726. Object.defineProperty(exports, "v4", ({
  3727. enumerable: true,
  3728. get: function () {
  3729. return _v3.default;
  3730. }
  3731. }));
  3732. Object.defineProperty(exports, "v5", ({
  3733. enumerable: true,
  3734. get: function () {
  3735. return _v4.default;
  3736. }
  3737. }));
  3738. Object.defineProperty(exports, "NIL", ({
  3739. enumerable: true,
  3740. get: function () {
  3741. return _nil.default;
  3742. }
  3743. }));
  3744. Object.defineProperty(exports, "version", ({
  3745. enumerable: true,
  3746. get: function () {
  3747. return _version.default;
  3748. }
  3749. }));
  3750. Object.defineProperty(exports, "validate", ({
  3751. enumerable: true,
  3752. get: function () {
  3753. return _validate.default;
  3754. }
  3755. }));
  3756. Object.defineProperty(exports, "stringify", ({
  3757. enumerable: true,
  3758. get: function () {
  3759. return _stringify.default;
  3760. }
  3761. }));
  3762. Object.defineProperty(exports, "parse", ({
  3763. enumerable: true,
  3764. get: function () {
  3765. return _parse.default;
  3766. }
  3767. }));
  3768. var _v = _interopRequireDefault(__nccwpck_require__(1595));
  3769. var _v2 = _interopRequireDefault(__nccwpck_require__(6993));
  3770. var _v3 = _interopRequireDefault(__nccwpck_require__(1472));
  3771. var _v4 = _interopRequireDefault(__nccwpck_require__(6217));
  3772. var _nil = _interopRequireDefault(__nccwpck_require__(2381));
  3773. var _version = _interopRequireDefault(__nccwpck_require__(427));
  3774. var _validate = _interopRequireDefault(__nccwpck_require__(2609));
  3775. var _stringify = _interopRequireDefault(__nccwpck_require__(1458));
  3776. var _parse = _interopRequireDefault(__nccwpck_require__(6385));
  3777. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3778. /***/ }),
  3779. /***/ 5842:
  3780. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3781. "use strict";
  3782. Object.defineProperty(exports, "__esModule", ({
  3783. value: true
  3784. }));
  3785. exports["default"] = void 0;
  3786. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  3787. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3788. function md5(bytes) {
  3789. if (Array.isArray(bytes)) {
  3790. bytes = Buffer.from(bytes);
  3791. } else if (typeof bytes === 'string') {
  3792. bytes = Buffer.from(bytes, 'utf8');
  3793. }
  3794. return _crypto.default.createHash('md5').update(bytes).digest();
  3795. }
  3796. var _default = md5;
  3797. exports["default"] = _default;
  3798. /***/ }),
  3799. /***/ 2381:
  3800. /***/ ((__unused_webpack_module, exports) => {
  3801. "use strict";
  3802. Object.defineProperty(exports, "__esModule", ({
  3803. value: true
  3804. }));
  3805. exports["default"] = void 0;
  3806. var _default = '00000000-0000-0000-0000-000000000000';
  3807. exports["default"] = _default;
  3808. /***/ }),
  3809. /***/ 6385:
  3810. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3811. "use strict";
  3812. Object.defineProperty(exports, "__esModule", ({
  3813. value: true
  3814. }));
  3815. exports["default"] = void 0;
  3816. var _validate = _interopRequireDefault(__nccwpck_require__(2609));
  3817. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3818. function parse(uuid) {
  3819. if (!(0, _validate.default)(uuid)) {
  3820. throw TypeError('Invalid UUID');
  3821. }
  3822. let v;
  3823. const arr = new Uint8Array(16); // Parse ########-....-....-....-............
  3824. arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;
  3825. arr[1] = v >>> 16 & 0xff;
  3826. arr[2] = v >>> 8 & 0xff;
  3827. arr[3] = v & 0xff; // Parse ........-####-....-....-............
  3828. arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;
  3829. arr[5] = v & 0xff; // Parse ........-....-####-....-............
  3830. arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;
  3831. arr[7] = v & 0xff; // Parse ........-....-....-####-............
  3832. arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;
  3833. arr[9] = v & 0xff; // Parse ........-....-....-....-############
  3834. // (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes)
  3835. arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;
  3836. arr[11] = v / 0x100000000 & 0xff;
  3837. arr[12] = v >>> 24 & 0xff;
  3838. arr[13] = v >>> 16 & 0xff;
  3839. arr[14] = v >>> 8 & 0xff;
  3840. arr[15] = v & 0xff;
  3841. return arr;
  3842. }
  3843. var _default = parse;
  3844. exports["default"] = _default;
  3845. /***/ }),
  3846. /***/ 6230:
  3847. /***/ ((__unused_webpack_module, exports) => {
  3848. "use strict";
  3849. Object.defineProperty(exports, "__esModule", ({
  3850. value: true
  3851. }));
  3852. exports["default"] = void 0;
  3853. 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;
  3854. exports["default"] = _default;
  3855. /***/ }),
  3856. /***/ 9784:
  3857. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3858. "use strict";
  3859. Object.defineProperty(exports, "__esModule", ({
  3860. value: true
  3861. }));
  3862. exports["default"] = rng;
  3863. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  3864. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3865. const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate
  3866. let poolPtr = rnds8Pool.length;
  3867. function rng() {
  3868. if (poolPtr > rnds8Pool.length - 16) {
  3869. _crypto.default.randomFillSync(rnds8Pool);
  3870. poolPtr = 0;
  3871. }
  3872. return rnds8Pool.slice(poolPtr, poolPtr += 16);
  3873. }
  3874. /***/ }),
  3875. /***/ 8844:
  3876. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3877. "use strict";
  3878. Object.defineProperty(exports, "__esModule", ({
  3879. value: true
  3880. }));
  3881. exports["default"] = void 0;
  3882. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  3883. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3884. function sha1(bytes) {
  3885. if (Array.isArray(bytes)) {
  3886. bytes = Buffer.from(bytes);
  3887. } else if (typeof bytes === 'string') {
  3888. bytes = Buffer.from(bytes, 'utf8');
  3889. }
  3890. return _crypto.default.createHash('sha1').update(bytes).digest();
  3891. }
  3892. var _default = sha1;
  3893. exports["default"] = _default;
  3894. /***/ }),
  3895. /***/ 1458:
  3896. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3897. "use strict";
  3898. Object.defineProperty(exports, "__esModule", ({
  3899. value: true
  3900. }));
  3901. exports["default"] = void 0;
  3902. var _validate = _interopRequireDefault(__nccwpck_require__(2609));
  3903. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3904. /**
  3905. * Convert array of 16 byte values to UUID string format of the form:
  3906. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  3907. */
  3908. const byteToHex = [];
  3909. for (let i = 0; i < 256; ++i) {
  3910. byteToHex.push((i + 0x100).toString(16).substr(1));
  3911. }
  3912. function stringify(arr, offset = 0) {
  3913. // Note: Be careful editing this code! It's been tuned for performance
  3914. // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
  3915. 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
  3916. // of the following:
  3917. // - One or more input array values don't map to a hex octet (leading to
  3918. // "undefined" in the uuid)
  3919. // - Invalid input values for the RFC `version` or `variant` fields
  3920. if (!(0, _validate.default)(uuid)) {
  3921. throw TypeError('Stringified UUID is invalid');
  3922. }
  3923. return uuid;
  3924. }
  3925. var _default = stringify;
  3926. exports["default"] = _default;
  3927. /***/ }),
  3928. /***/ 1595:
  3929. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3930. "use strict";
  3931. Object.defineProperty(exports, "__esModule", ({
  3932. value: true
  3933. }));
  3934. exports["default"] = void 0;
  3935. var _rng = _interopRequireDefault(__nccwpck_require__(9784));
  3936. var _stringify = _interopRequireDefault(__nccwpck_require__(1458));
  3937. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3938. // **`v1()` - Generate time-based UUID**
  3939. //
  3940. // Inspired by https://github.com/LiosK/UUID.js
  3941. // and http://docs.python.org/library/uuid.html
  3942. let _nodeId;
  3943. let _clockseq; // Previous uuid creation time
  3944. let _lastMSecs = 0;
  3945. let _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details
  3946. function v1(options, buf, offset) {
  3947. let i = buf && offset || 0;
  3948. const b = buf || new Array(16);
  3949. options = options || {};
  3950. let node = options.node || _nodeId;
  3951. let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not
  3952. // specified. We do this lazily to minimize issues related to insufficient
  3953. // system entropy. See #189
  3954. if (node == null || clockseq == null) {
  3955. const seedBytes = options.random || (options.rng || _rng.default)();
  3956. if (node == null) {
  3957. // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
  3958. node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];
  3959. }
  3960. if (clockseq == null) {
  3961. // Per 4.2.2, randomize (14 bit) clockseq
  3962. clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
  3963. }
  3964. } // UUID timestamps are 100 nano-second units since the Gregorian epoch,
  3965. // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
  3966. // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
  3967. // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
  3968. let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock
  3969. // cycle to simulate higher resolution clock
  3970. let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)
  3971. const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression
  3972. if (dt < 0 && options.clockseq === undefined) {
  3973. clockseq = clockseq + 1 & 0x3fff;
  3974. } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
  3975. // time interval
  3976. if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
  3977. nsecs = 0;
  3978. } // Per 4.2.1.2 Throw error if too many uuids are requested
  3979. if (nsecs >= 10000) {
  3980. throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");
  3981. }
  3982. _lastMSecs = msecs;
  3983. _lastNSecs = nsecs;
  3984. _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
  3985. msecs += 12219292800000; // `time_low`
  3986. const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
  3987. b[i++] = tl >>> 24 & 0xff;
  3988. b[i++] = tl >>> 16 & 0xff;
  3989. b[i++] = tl >>> 8 & 0xff;
  3990. b[i++] = tl & 0xff; // `time_mid`
  3991. const tmh = msecs / 0x100000000 * 10000 & 0xfffffff;
  3992. b[i++] = tmh >>> 8 & 0xff;
  3993. b[i++] = tmh & 0xff; // `time_high_and_version`
  3994. b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
  3995. b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
  3996. b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`
  3997. b[i++] = clockseq & 0xff; // `node`
  3998. for (let n = 0; n < 6; ++n) {
  3999. b[i + n] = node[n];
  4000. }
  4001. return buf || (0, _stringify.default)(b);
  4002. }
  4003. var _default = v1;
  4004. exports["default"] = _default;
  4005. /***/ }),
  4006. /***/ 6993:
  4007. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  4008. "use strict";
  4009. Object.defineProperty(exports, "__esModule", ({
  4010. value: true
  4011. }));
  4012. exports["default"] = void 0;
  4013. var _v = _interopRequireDefault(__nccwpck_require__(5920));
  4014. var _md = _interopRequireDefault(__nccwpck_require__(5842));
  4015. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4016. const v3 = (0, _v.default)('v3', 0x30, _md.default);
  4017. var _default = v3;
  4018. exports["default"] = _default;
  4019. /***/ }),
  4020. /***/ 5920:
  4021. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  4022. "use strict";
  4023. Object.defineProperty(exports, "__esModule", ({
  4024. value: true
  4025. }));
  4026. exports["default"] = _default;
  4027. exports.URL = exports.DNS = void 0;
  4028. var _stringify = _interopRequireDefault(__nccwpck_require__(1458));
  4029. var _parse = _interopRequireDefault(__nccwpck_require__(6385));
  4030. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4031. function stringToBytes(str) {
  4032. str = unescape(encodeURIComponent(str)); // UTF8 escape
  4033. const bytes = [];
  4034. for (let i = 0; i < str.length; ++i) {
  4035. bytes.push(str.charCodeAt(i));
  4036. }
  4037. return bytes;
  4038. }
  4039. const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
  4040. exports.DNS = DNS;
  4041. const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';
  4042. exports.URL = URL;
  4043. function _default(name, version, hashfunc) {
  4044. function generateUUID(value, namespace, buf, offset) {
  4045. if (typeof value === 'string') {
  4046. value = stringToBytes(value);
  4047. }
  4048. if (typeof namespace === 'string') {
  4049. namespace = (0, _parse.default)(namespace);
  4050. }
  4051. if (namespace.length !== 16) {
  4052. throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');
  4053. } // Compute hash of namespace and value, Per 4.3
  4054. // Future: Use spread syntax when supported on all platforms, e.g. `bytes =
  4055. // hashfunc([...namespace, ... value])`
  4056. let bytes = new Uint8Array(16 + value.length);
  4057. bytes.set(namespace);
  4058. bytes.set(value, namespace.length);
  4059. bytes = hashfunc(bytes);
  4060. bytes[6] = bytes[6] & 0x0f | version;
  4061. bytes[8] = bytes[8] & 0x3f | 0x80;
  4062. if (buf) {
  4063. offset = offset || 0;
  4064. for (let i = 0; i < 16; ++i) {
  4065. buf[offset + i] = bytes[i];
  4066. }
  4067. return buf;
  4068. }
  4069. return (0, _stringify.default)(bytes);
  4070. } // Function#name is not settable on some platforms (#270)
  4071. try {
  4072. generateUUID.name = name; // eslint-disable-next-line no-empty
  4073. } catch (err) {} // For CommonJS default export support
  4074. generateUUID.DNS = DNS;
  4075. generateUUID.URL = URL;
  4076. return generateUUID;
  4077. }
  4078. /***/ }),
  4079. /***/ 1472:
  4080. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  4081. "use strict";
  4082. Object.defineProperty(exports, "__esModule", ({
  4083. value: true
  4084. }));
  4085. exports["default"] = void 0;
  4086. var _rng = _interopRequireDefault(__nccwpck_require__(9784));
  4087. var _stringify = _interopRequireDefault(__nccwpck_require__(1458));
  4088. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4089. function v4(options, buf, offset) {
  4090. options = options || {};
  4091. const rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  4092. rnds[6] = rnds[6] & 0x0f | 0x40;
  4093. rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
  4094. if (buf) {
  4095. offset = offset || 0;
  4096. for (let i = 0; i < 16; ++i) {
  4097. buf[offset + i] = rnds[i];
  4098. }
  4099. return buf;
  4100. }
  4101. return (0, _stringify.default)(rnds);
  4102. }
  4103. var _default = v4;
  4104. exports["default"] = _default;
  4105. /***/ }),
  4106. /***/ 6217:
  4107. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  4108. "use strict";
  4109. Object.defineProperty(exports, "__esModule", ({
  4110. value: true
  4111. }));
  4112. exports["default"] = void 0;
  4113. var _v = _interopRequireDefault(__nccwpck_require__(5920));
  4114. var _sha = _interopRequireDefault(__nccwpck_require__(8844));
  4115. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4116. const v5 = (0, _v.default)('v5', 0x50, _sha.default);
  4117. var _default = v5;
  4118. exports["default"] = _default;
  4119. /***/ }),
  4120. /***/ 2609:
  4121. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  4122. "use strict";
  4123. Object.defineProperty(exports, "__esModule", ({
  4124. value: true
  4125. }));
  4126. exports["default"] = void 0;
  4127. var _regex = _interopRequireDefault(__nccwpck_require__(6230));
  4128. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4129. function validate(uuid) {
  4130. return typeof uuid === 'string' && _regex.default.test(uuid);
  4131. }
  4132. var _default = validate;
  4133. exports["default"] = _default;
  4134. /***/ }),
  4135. /***/ 427:
  4136. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  4137. "use strict";
  4138. Object.defineProperty(exports, "__esModule", ({
  4139. value: true
  4140. }));
  4141. exports["default"] = void 0;
  4142. var _validate = _interopRequireDefault(__nccwpck_require__(2609));
  4143. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4144. function version(uuid) {
  4145. if (!(0, _validate.default)(uuid)) {
  4146. throw TypeError('Invalid UUID');
  4147. }
  4148. return parseInt(uuid.substr(14, 1), 16);
  4149. }
  4150. var _default = version;
  4151. exports["default"] = _default;
  4152. /***/ }),
  4153. /***/ 1514:
  4154. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  4155. "use strict";
  4156. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  4157. if (k2 === undefined) k2 = k;
  4158. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  4159. }) : (function(o, m, k, k2) {
  4160. if (k2 === undefined) k2 = k;
  4161. o[k2] = m[k];
  4162. }));
  4163. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  4164. Object.defineProperty(o, "default", { enumerable: true, value: v });
  4165. }) : function(o, v) {
  4166. o["default"] = v;
  4167. });
  4168. var __importStar = (this && this.__importStar) || function (mod) {
  4169. if (mod && mod.__esModule) return mod;
  4170. var result = {};
  4171. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  4172. __setModuleDefault(result, mod);
  4173. return result;
  4174. };
  4175. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4176. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4177. return new (P || (P = Promise))(function (resolve, reject) {
  4178. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4179. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4180. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4181. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4182. });
  4183. };
  4184. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4185. exports.getExecOutput = exports.exec = void 0;
  4186. const string_decoder_1 = __nccwpck_require__(1576);
  4187. const tr = __importStar(__nccwpck_require__(8159));
  4188. /**
  4189. * Exec a command.
  4190. * Output will be streamed to the live console.
  4191. * Returns promise with return code
  4192. *
  4193. * @param commandLine command to execute (can include additional args). Must be correctly escaped.
  4194. * @param args optional arguments for tool. Escaping is handled by the lib.
  4195. * @param options optional exec options. See ExecOptions
  4196. * @returns Promise<number> exit code
  4197. */
  4198. function exec(commandLine, args, options) {
  4199. return __awaiter(this, void 0, void 0, function* () {
  4200. const commandArgs = tr.argStringToArray(commandLine);
  4201. if (commandArgs.length === 0) {
  4202. throw new Error(`Parameter 'commandLine' cannot be null or empty.`);
  4203. }
  4204. // Path to tool to execute should be first arg
  4205. const toolPath = commandArgs[0];
  4206. args = commandArgs.slice(1).concat(args || []);
  4207. const runner = new tr.ToolRunner(toolPath, args, options);
  4208. return runner.exec();
  4209. });
  4210. }
  4211. exports.exec = exec;
  4212. /**
  4213. * Exec a command and get the output.
  4214. * Output will be streamed to the live console.
  4215. * Returns promise with the exit code and collected stdout and stderr
  4216. *
  4217. * @param commandLine command to execute (can include additional args). Must be correctly escaped.
  4218. * @param args optional arguments for tool. Escaping is handled by the lib.
  4219. * @param options optional exec options. See ExecOptions
  4220. * @returns Promise<ExecOutput> exit code, stdout, and stderr
  4221. */
  4222. function getExecOutput(commandLine, args, options) {
  4223. var _a, _b;
  4224. return __awaiter(this, void 0, void 0, function* () {
  4225. let stdout = '';
  4226. let stderr = '';
  4227. //Using string decoder covers the case where a mult-byte character is split
  4228. const stdoutDecoder = new string_decoder_1.StringDecoder('utf8');
  4229. const stderrDecoder = new string_decoder_1.StringDecoder('utf8');
  4230. const originalStdoutListener = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.stdout;
  4231. const originalStdErrListener = (_b = options === null || options === void 0 ? void 0 : options.listeners) === null || _b === void 0 ? void 0 : _b.stderr;
  4232. const stdErrListener = (data) => {
  4233. stderr += stderrDecoder.write(data);
  4234. if (originalStdErrListener) {
  4235. originalStdErrListener(data);
  4236. }
  4237. };
  4238. const stdOutListener = (data) => {
  4239. stdout += stdoutDecoder.write(data);
  4240. if (originalStdoutListener) {
  4241. originalStdoutListener(data);
  4242. }
  4243. };
  4244. const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener });
  4245. const exitCode = yield exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners }));
  4246. //flush any remaining characters
  4247. stdout += stdoutDecoder.end();
  4248. stderr += stderrDecoder.end();
  4249. return {
  4250. exitCode,
  4251. stdout,
  4252. stderr
  4253. };
  4254. });
  4255. }
  4256. exports.getExecOutput = getExecOutput;
  4257. //# sourceMappingURL=exec.js.map
  4258. /***/ }),
  4259. /***/ 8159:
  4260. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  4261. "use strict";
  4262. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  4263. if (k2 === undefined) k2 = k;
  4264. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  4265. }) : (function(o, m, k, k2) {
  4266. if (k2 === undefined) k2 = k;
  4267. o[k2] = m[k];
  4268. }));
  4269. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  4270. Object.defineProperty(o, "default", { enumerable: true, value: v });
  4271. }) : function(o, v) {
  4272. o["default"] = v;
  4273. });
  4274. var __importStar = (this && this.__importStar) || function (mod) {
  4275. if (mod && mod.__esModule) return mod;
  4276. var result = {};
  4277. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  4278. __setModuleDefault(result, mod);
  4279. return result;
  4280. };
  4281. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4282. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4283. return new (P || (P = Promise))(function (resolve, reject) {
  4284. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4285. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4286. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4287. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4288. });
  4289. };
  4290. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4291. exports.argStringToArray = exports.ToolRunner = void 0;
  4292. const os = __importStar(__nccwpck_require__(2037));
  4293. const events = __importStar(__nccwpck_require__(2361));
  4294. const child = __importStar(__nccwpck_require__(2081));
  4295. const path = __importStar(__nccwpck_require__(1017));
  4296. const io = __importStar(__nccwpck_require__(7436));
  4297. const ioUtil = __importStar(__nccwpck_require__(1962));
  4298. const timers_1 = __nccwpck_require__(9512);
  4299. /* eslint-disable @typescript-eslint/unbound-method */
  4300. const IS_WINDOWS = process.platform === 'win32';
  4301. /*
  4302. * Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way.
  4303. */
  4304. class ToolRunner extends events.EventEmitter {
  4305. constructor(toolPath, args, options) {
  4306. super();
  4307. if (!toolPath) {
  4308. throw new Error("Parameter 'toolPath' cannot be null or empty.");
  4309. }
  4310. this.toolPath = toolPath;
  4311. this.args = args || [];
  4312. this.options = options || {};
  4313. }
  4314. _debug(message) {
  4315. if (this.options.listeners && this.options.listeners.debug) {
  4316. this.options.listeners.debug(message);
  4317. }
  4318. }
  4319. _getCommandString(options, noPrefix) {
  4320. const toolPath = this._getSpawnFileName();
  4321. const args = this._getSpawnArgs(options);
  4322. let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool
  4323. if (IS_WINDOWS) {
  4324. // Windows + cmd file
  4325. if (this._isCmdFile()) {
  4326. cmd += toolPath;
  4327. for (const a of args) {
  4328. cmd += ` ${a}`;
  4329. }
  4330. }
  4331. // Windows + verbatim
  4332. else if (options.windowsVerbatimArguments) {
  4333. cmd += `"${toolPath}"`;
  4334. for (const a of args) {
  4335. cmd += ` ${a}`;
  4336. }
  4337. }
  4338. // Windows (regular)
  4339. else {
  4340. cmd += this._windowsQuoteCmdArg(toolPath);
  4341. for (const a of args) {
  4342. cmd += ` ${this._windowsQuoteCmdArg(a)}`;
  4343. }
  4344. }
  4345. }
  4346. else {
  4347. // OSX/Linux - this can likely be improved with some form of quoting.
  4348. // creating processes on Unix is fundamentally different than Windows.
  4349. // on Unix, execvp() takes an arg array.
  4350. cmd += toolPath;
  4351. for (const a of args) {
  4352. cmd += ` ${a}`;
  4353. }
  4354. }
  4355. return cmd;
  4356. }
  4357. _processLineBuffer(data, strBuffer, onLine) {
  4358. try {
  4359. let s = strBuffer + data.toString();
  4360. let n = s.indexOf(os.EOL);
  4361. while (n > -1) {
  4362. const line = s.substring(0, n);
  4363. onLine(line);
  4364. // the rest of the string ...
  4365. s = s.substring(n + os.EOL.length);
  4366. n = s.indexOf(os.EOL);
  4367. }
  4368. return s;
  4369. }
  4370. catch (err) {
  4371. // streaming lines to console is best effort. Don't fail a build.
  4372. this._debug(`error processing line. Failed with error ${err}`);
  4373. return '';
  4374. }
  4375. }
  4376. _getSpawnFileName() {
  4377. if (IS_WINDOWS) {
  4378. if (this._isCmdFile()) {
  4379. return process.env['COMSPEC'] || 'cmd.exe';
  4380. }
  4381. }
  4382. return this.toolPath;
  4383. }
  4384. _getSpawnArgs(options) {
  4385. if (IS_WINDOWS) {
  4386. if (this._isCmdFile()) {
  4387. let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`;
  4388. for (const a of this.args) {
  4389. argline += ' ';
  4390. argline += options.windowsVerbatimArguments
  4391. ? a
  4392. : this._windowsQuoteCmdArg(a);
  4393. }
  4394. argline += '"';
  4395. return [argline];
  4396. }
  4397. }
  4398. return this.args;
  4399. }
  4400. _endsWith(str, end) {
  4401. return str.endsWith(end);
  4402. }
  4403. _isCmdFile() {
  4404. const upperToolPath = this.toolPath.toUpperCase();
  4405. return (this._endsWith(upperToolPath, '.CMD') ||
  4406. this._endsWith(upperToolPath, '.BAT'));
  4407. }
  4408. _windowsQuoteCmdArg(arg) {
  4409. // for .exe, apply the normal quoting rules that libuv applies
  4410. if (!this._isCmdFile()) {
  4411. return this._uvQuoteCmdArg(arg);
  4412. }
  4413. // otherwise apply quoting rules specific to the cmd.exe command line parser.
  4414. // the libuv rules are generic and are not designed specifically for cmd.exe
  4415. // command line parser.
  4416. //
  4417. // for a detailed description of the cmd.exe command line parser, refer to
  4418. // http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912
  4419. // need quotes for empty arg
  4420. if (!arg) {
  4421. return '""';
  4422. }
  4423. // determine whether the arg needs to be quoted
  4424. const cmdSpecialChars = [
  4425. ' ',
  4426. '\t',
  4427. '&',
  4428. '(',
  4429. ')',
  4430. '[',
  4431. ']',
  4432. '{',
  4433. '}',
  4434. '^',
  4435. '=',
  4436. ';',
  4437. '!',
  4438. "'",
  4439. '+',
  4440. ',',
  4441. '`',
  4442. '~',
  4443. '|',
  4444. '<',
  4445. '>',
  4446. '"'
  4447. ];
  4448. let needsQuotes = false;
  4449. for (const char of arg) {
  4450. if (cmdSpecialChars.some(x => x === char)) {
  4451. needsQuotes = true;
  4452. break;
  4453. }
  4454. }
  4455. // short-circuit if quotes not needed
  4456. if (!needsQuotes) {
  4457. return arg;
  4458. }
  4459. // the following quoting rules are very similar to the rules that by libuv applies.
  4460. //
  4461. // 1) wrap the string in quotes
  4462. //
  4463. // 2) double-up quotes - i.e. " => ""
  4464. //
  4465. // this is different from the libuv quoting rules. libuv replaces " with \", which unfortunately
  4466. // doesn't work well with a cmd.exe command line.
  4467. //
  4468. // note, replacing " with "" also works well if the arg is passed to a downstream .NET console app.
  4469. // for example, the command line:
  4470. // foo.exe "myarg:""my val"""
  4471. // is parsed by a .NET console app into an arg array:
  4472. // [ "myarg:\"my val\"" ]
  4473. // which is the same end result when applying libuv quoting rules. although the actual
  4474. // command line from libuv quoting rules would look like:
  4475. // foo.exe "myarg:\"my val\""
  4476. //
  4477. // 3) double-up slashes that precede a quote,
  4478. // e.g. hello \world => "hello \world"
  4479. // hello\"world => "hello\\""world"
  4480. // hello\\"world => "hello\\\\""world"
  4481. // hello world\ => "hello world\\"
  4482. //
  4483. // technically this is not required for a cmd.exe command line, or the batch argument parser.
  4484. // the reasons for including this as a .cmd quoting rule are:
  4485. //
  4486. // a) this is optimized for the scenario where the argument is passed from the .cmd file to an
  4487. // external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule.
  4488. //
  4489. // b) it's what we've been doing previously (by deferring to node default behavior) and we
  4490. // haven't heard any complaints about that aspect.
  4491. //
  4492. // note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be
  4493. // escaped when used on the command line directly - even though within a .cmd file % can be escaped
  4494. // by using %%.
  4495. //
  4496. // the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts
  4497. // the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing.
  4498. //
  4499. // one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would
  4500. // often work, since it is unlikely that var^ would exist, and the ^ character is removed when the
  4501. // variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args
  4502. // to an external program.
  4503. //
  4504. // an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file.
  4505. // % can be escaped within a .cmd file.
  4506. let reverse = '"';
  4507. let quoteHit = true;
  4508. for (let i = arg.length; i > 0; i--) {
  4509. // walk the string in reverse
  4510. reverse += arg[i - 1];
  4511. if (quoteHit && arg[i - 1] === '\\') {
  4512. reverse += '\\'; // double the slash
  4513. }
  4514. else if (arg[i - 1] === '"') {
  4515. quoteHit = true;
  4516. reverse += '"'; // double the quote
  4517. }
  4518. else {
  4519. quoteHit = false;
  4520. }
  4521. }
  4522. reverse += '"';
  4523. return reverse
  4524. .split('')
  4525. .reverse()
  4526. .join('');
  4527. }
  4528. _uvQuoteCmdArg(arg) {
  4529. // Tool runner wraps child_process.spawn() and needs to apply the same quoting as
  4530. // Node in certain cases where the undocumented spawn option windowsVerbatimArguments
  4531. // is used.
  4532. //
  4533. // Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV,
  4534. // see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details),
  4535. // pasting copyright notice from Node within this function:
  4536. //
  4537. // Copyright Joyent, Inc. and other Node contributors. All rights reserved.
  4538. //
  4539. // Permission is hereby granted, free of charge, to any person obtaining a copy
  4540. // of this software and associated documentation files (the "Software"), to
  4541. // deal in the Software without restriction, including without limitation the
  4542. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  4543. // sell copies of the Software, and to permit persons to whom the Software is
  4544. // furnished to do so, subject to the following conditions:
  4545. //
  4546. // The above copyright notice and this permission notice shall be included in
  4547. // all copies or substantial portions of the Software.
  4548. //
  4549. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  4550. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  4551. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  4552. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  4553. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  4554. // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  4555. // IN THE SOFTWARE.
  4556. if (!arg) {
  4557. // Need double quotation for empty argument
  4558. return '""';
  4559. }
  4560. if (!arg.includes(' ') && !arg.includes('\t') && !arg.includes('"')) {
  4561. // No quotation needed
  4562. return arg;
  4563. }
  4564. if (!arg.includes('"') && !arg.includes('\\')) {
  4565. // No embedded double quotes or backslashes, so I can just wrap
  4566. // quote marks around the whole thing.
  4567. return `"${arg}"`;
  4568. }
  4569. // Expected input/output:
  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
  4578. // input : hello\"world
  4579. // output: "hello\\\"world"
  4580. // input : hello\\"world
  4581. // output: "hello\\\\\"world"
  4582. // input : hello world\
  4583. // output: "hello world\\" - note the comment in libuv actually reads "hello world\"
  4584. // but it appears the comment is wrong, it should be "hello world\\"
  4585. let reverse = '"';
  4586. let quoteHit = true;
  4587. for (let i = arg.length; i > 0; i--) {
  4588. // walk the string in reverse
  4589. reverse += arg[i - 1];
  4590. if (quoteHit && arg[i - 1] === '\\') {
  4591. reverse += '\\';
  4592. }
  4593. else if (arg[i - 1] === '"') {
  4594. quoteHit = true;
  4595. reverse += '\\';
  4596. }
  4597. else {
  4598. quoteHit = false;
  4599. }
  4600. }
  4601. reverse += '"';
  4602. return reverse
  4603. .split('')
  4604. .reverse()
  4605. .join('');
  4606. }
  4607. _cloneExecOptions(options) {
  4608. options = options || {};
  4609. const result = {
  4610. cwd: options.cwd || process.cwd(),
  4611. env: options.env || process.env,
  4612. silent: options.silent || false,
  4613. windowsVerbatimArguments: options.windowsVerbatimArguments || false,
  4614. failOnStdErr: options.failOnStdErr || false,
  4615. ignoreReturnCode: options.ignoreReturnCode || false,
  4616. delay: options.delay || 10000
  4617. };
  4618. result.outStream = options.outStream || process.stdout;
  4619. result.errStream = options.errStream || process.stderr;
  4620. return result;
  4621. }
  4622. _getSpawnOptions(options, toolPath) {
  4623. options = options || {};
  4624. const result = {};
  4625. result.cwd = options.cwd;
  4626. result.env = options.env;
  4627. result['windowsVerbatimArguments'] =
  4628. options.windowsVerbatimArguments || this._isCmdFile();
  4629. if (options.windowsVerbatimArguments) {
  4630. result.argv0 = `"${toolPath}"`;
  4631. }
  4632. return result;
  4633. }
  4634. /**
  4635. * Exec a tool.
  4636. * Output will be streamed to the live console.
  4637. * Returns promise with return code
  4638. *
  4639. * @param tool path to tool to exec
  4640. * @param options optional exec options. See ExecOptions
  4641. * @returns number
  4642. */
  4643. exec() {
  4644. return __awaiter(this, void 0, void 0, function* () {
  4645. // root the tool path if it is unrooted and contains relative pathing
  4646. if (!ioUtil.isRooted(this.toolPath) &&
  4647. (this.toolPath.includes('/') ||
  4648. (IS_WINDOWS && this.toolPath.includes('\\')))) {
  4649. // prefer options.cwd if it is specified, however options.cwd may also need to be rooted
  4650. this.toolPath = path.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath);
  4651. }
  4652. // if the tool is only a file name, then resolve it from the PATH
  4653. // otherwise verify it exists (add extension on Windows if necessary)
  4654. this.toolPath = yield io.which(this.toolPath, true);
  4655. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  4656. this._debug(`exec tool: ${this.toolPath}`);
  4657. this._debug('arguments:');
  4658. for (const arg of this.args) {
  4659. this._debug(` ${arg}`);
  4660. }
  4661. const optionsNonNull = this._cloneExecOptions(this.options);
  4662. if (!optionsNonNull.silent && optionsNonNull.outStream) {
  4663. optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL);
  4664. }
  4665. const state = new ExecState(optionsNonNull, this.toolPath);
  4666. state.on('debug', (message) => {
  4667. this._debug(message);
  4668. });
  4669. if (this.options.cwd && !(yield ioUtil.exists(this.options.cwd))) {
  4670. return reject(new Error(`The cwd: ${this.options.cwd} does not exist!`));
  4671. }
  4672. const fileName = this._getSpawnFileName();
  4673. const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName));
  4674. let stdbuffer = '';
  4675. if (cp.stdout) {
  4676. cp.stdout.on('data', (data) => {
  4677. if (this.options.listeners && this.options.listeners.stdout) {
  4678. this.options.listeners.stdout(data);
  4679. }
  4680. if (!optionsNonNull.silent && optionsNonNull.outStream) {
  4681. optionsNonNull.outStream.write(data);
  4682. }
  4683. stdbuffer = this._processLineBuffer(data, stdbuffer, (line) => {
  4684. if (this.options.listeners && this.options.listeners.stdline) {
  4685. this.options.listeners.stdline(line);
  4686. }
  4687. });
  4688. });
  4689. }
  4690. let errbuffer = '';
  4691. if (cp.stderr) {
  4692. cp.stderr.on('data', (data) => {
  4693. state.processStderr = true;
  4694. if (this.options.listeners && this.options.listeners.stderr) {
  4695. this.options.listeners.stderr(data);
  4696. }
  4697. if (!optionsNonNull.silent &&
  4698. optionsNonNull.errStream &&
  4699. optionsNonNull.outStream) {
  4700. const s = optionsNonNull.failOnStdErr
  4701. ? optionsNonNull.errStream
  4702. : optionsNonNull.outStream;
  4703. s.write(data);
  4704. }
  4705. errbuffer = this._processLineBuffer(data, errbuffer, (line) => {
  4706. if (this.options.listeners && this.options.listeners.errline) {
  4707. this.options.listeners.errline(line);
  4708. }
  4709. });
  4710. });
  4711. }
  4712. cp.on('error', (err) => {
  4713. state.processError = err.message;
  4714. state.processExited = true;
  4715. state.processClosed = true;
  4716. state.CheckComplete();
  4717. });
  4718. cp.on('exit', (code) => {
  4719. state.processExitCode = code;
  4720. state.processExited = true;
  4721. this._debug(`Exit code ${code} received from tool '${this.toolPath}'`);
  4722. state.CheckComplete();
  4723. });
  4724. cp.on('close', (code) => {
  4725. state.processExitCode = code;
  4726. state.processExited = true;
  4727. state.processClosed = true;
  4728. this._debug(`STDIO streams have closed for tool '${this.toolPath}'`);
  4729. state.CheckComplete();
  4730. });
  4731. state.on('done', (error, exitCode) => {
  4732. if (stdbuffer.length > 0) {
  4733. this.emit('stdline', stdbuffer);
  4734. }
  4735. if (errbuffer.length > 0) {
  4736. this.emit('errline', errbuffer);
  4737. }
  4738. cp.removeAllListeners();
  4739. if (error) {
  4740. reject(error);
  4741. }
  4742. else {
  4743. resolve(exitCode);
  4744. }
  4745. });
  4746. if (this.options.input) {
  4747. if (!cp.stdin) {
  4748. throw new Error('child process missing stdin');
  4749. }
  4750. cp.stdin.end(this.options.input);
  4751. }
  4752. }));
  4753. });
  4754. }
  4755. }
  4756. exports.ToolRunner = ToolRunner;
  4757. /**
  4758. * Convert an arg string to an array of args. Handles escaping
  4759. *
  4760. * @param argString string of arguments
  4761. * @returns string[] array of arguments
  4762. */
  4763. function argStringToArray(argString) {
  4764. const args = [];
  4765. let inQuotes = false;
  4766. let escaped = false;
  4767. let arg = '';
  4768. function append(c) {
  4769. // we only escape double quotes.
  4770. if (escaped && c !== '"') {
  4771. arg += '\\';
  4772. }
  4773. arg += c;
  4774. escaped = false;
  4775. }
  4776. for (let i = 0; i < argString.length; i++) {
  4777. const c = argString.charAt(i);
  4778. if (c === '"') {
  4779. if (!escaped) {
  4780. inQuotes = !inQuotes;
  4781. }
  4782. else {
  4783. append(c);
  4784. }
  4785. continue;
  4786. }
  4787. if (c === '\\' && escaped) {
  4788. append(c);
  4789. continue;
  4790. }
  4791. if (c === '\\' && inQuotes) {
  4792. escaped = true;
  4793. continue;
  4794. }
  4795. if (c === ' ' && !inQuotes) {
  4796. if (arg.length > 0) {
  4797. args.push(arg);
  4798. arg = '';
  4799. }
  4800. continue;
  4801. }
  4802. append(c);
  4803. }
  4804. if (arg.length > 0) {
  4805. args.push(arg.trim());
  4806. }
  4807. return args;
  4808. }
  4809. exports.argStringToArray = argStringToArray;
  4810. class ExecState extends events.EventEmitter {
  4811. constructor(options, toolPath) {
  4812. super();
  4813. this.processClosed = false; // tracks whether the process has exited and stdio is closed
  4814. this.processError = '';
  4815. this.processExitCode = 0;
  4816. this.processExited = false; // tracks whether the process has exited
  4817. this.processStderr = false; // tracks whether stderr was written to
  4818. this.delay = 10000; // 10 seconds
  4819. this.done = false;
  4820. this.timeout = null;
  4821. if (!toolPath) {
  4822. throw new Error('toolPath must not be empty');
  4823. }
  4824. this.options = options;
  4825. this.toolPath = toolPath;
  4826. if (options.delay) {
  4827. this.delay = options.delay;
  4828. }
  4829. }
  4830. CheckComplete() {
  4831. if (this.done) {
  4832. return;
  4833. }
  4834. if (this.processClosed) {
  4835. this._setResult();
  4836. }
  4837. else if (this.processExited) {
  4838. this.timeout = timers_1.setTimeout(ExecState.HandleTimeout, this.delay, this);
  4839. }
  4840. }
  4841. _debug(message) {
  4842. this.emit('debug', message);
  4843. }
  4844. _setResult() {
  4845. // determine whether there is an error
  4846. let error;
  4847. if (this.processExited) {
  4848. if (this.processError) {
  4849. 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}`);
  4850. }
  4851. else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) {
  4852. error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`);
  4853. }
  4854. else if (this.processStderr && this.options.failOnStdErr) {
  4855. error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`);
  4856. }
  4857. }
  4858. // clear the timeout
  4859. if (this.timeout) {
  4860. clearTimeout(this.timeout);
  4861. this.timeout = null;
  4862. }
  4863. this.done = true;
  4864. this.emit('done', error, this.processExitCode);
  4865. }
  4866. static HandleTimeout(state) {
  4867. if (state.done) {
  4868. return;
  4869. }
  4870. if (!state.processClosed && state.processExited) {
  4871. const message = `The STDIO streams did not close within ${state.delay /
  4872. 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.`;
  4873. state._debug(message);
  4874. }
  4875. state._setResult();
  4876. }
  4877. }
  4878. //# sourceMappingURL=toolrunner.js.map
  4879. /***/ }),
  4880. /***/ 4087:
  4881. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  4882. "use strict";
  4883. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4884. exports.Context = void 0;
  4885. const fs_1 = __nccwpck_require__(7147);
  4886. const os_1 = __nccwpck_require__(2037);
  4887. class Context {
  4888. /**
  4889. * Hydrate the context from the environment
  4890. */
  4891. constructor() {
  4892. var _a, _b, _c;
  4893. this.payload = {};
  4894. if (process.env.GITHUB_EVENT_PATH) {
  4895. if ((0, fs_1.existsSync)(process.env.GITHUB_EVENT_PATH)) {
  4896. this.payload = JSON.parse((0, fs_1.readFileSync)(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' }));
  4897. }
  4898. else {
  4899. const path = process.env.GITHUB_EVENT_PATH;
  4900. process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${os_1.EOL}`);
  4901. }
  4902. }
  4903. this.eventName = process.env.GITHUB_EVENT_NAME;
  4904. this.sha = process.env.GITHUB_SHA;
  4905. this.ref = process.env.GITHUB_REF;
  4906. this.workflow = process.env.GITHUB_WORKFLOW;
  4907. this.action = process.env.GITHUB_ACTION;
  4908. this.actor = process.env.GITHUB_ACTOR;
  4909. this.job = process.env.GITHUB_JOB;
  4910. this.runNumber = parseInt(process.env.GITHUB_RUN_NUMBER, 10);
  4911. this.runId = parseInt(process.env.GITHUB_RUN_ID, 10);
  4912. this.apiUrl = (_a = process.env.GITHUB_API_URL) !== null && _a !== void 0 ? _a : `https://api.github.com`;
  4913. this.serverUrl = (_b = process.env.GITHUB_SERVER_URL) !== null && _b !== void 0 ? _b : `https://github.com`;
  4914. this.graphqlUrl =
  4915. (_c = process.env.GITHUB_GRAPHQL_URL) !== null && _c !== void 0 ? _c : `https://api.github.com/graphql`;
  4916. }
  4917. get issue() {
  4918. const payload = this.payload;
  4919. return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pull_request || payload).number });
  4920. }
  4921. get repo() {
  4922. if (process.env.GITHUB_REPOSITORY) {
  4923. const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');
  4924. return { owner, repo };
  4925. }
  4926. if (this.payload.repository) {
  4927. return {
  4928. owner: this.payload.repository.owner.login,
  4929. repo: this.payload.repository.name
  4930. };
  4931. }
  4932. throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'");
  4933. }
  4934. }
  4935. exports.Context = Context;
  4936. //# sourceMappingURL=context.js.map
  4937. /***/ }),
  4938. /***/ 5438:
  4939. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  4940. "use strict";
  4941. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  4942. if (k2 === undefined) k2 = k;
  4943. var desc = Object.getOwnPropertyDescriptor(m, k);
  4944. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  4945. desc = { enumerable: true, get: function() { return m[k]; } };
  4946. }
  4947. Object.defineProperty(o, k2, desc);
  4948. }) : (function(o, m, k, k2) {
  4949. if (k2 === undefined) k2 = k;
  4950. o[k2] = m[k];
  4951. }));
  4952. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  4953. Object.defineProperty(o, "default", { enumerable: true, value: v });
  4954. }) : function(o, v) {
  4955. o["default"] = v;
  4956. });
  4957. var __importStar = (this && this.__importStar) || function (mod) {
  4958. if (mod && mod.__esModule) return mod;
  4959. var result = {};
  4960. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  4961. __setModuleDefault(result, mod);
  4962. return result;
  4963. };
  4964. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4965. exports.getOctokit = exports.context = void 0;
  4966. const Context = __importStar(__nccwpck_require__(4087));
  4967. const utils_1 = __nccwpck_require__(3030);
  4968. exports.context = new Context.Context();
  4969. /**
  4970. * Returns a hydrated octokit ready to use for GitHub Actions
  4971. *
  4972. * @param token the repo PAT or GITHUB_TOKEN
  4973. * @param options other options to set
  4974. */
  4975. function getOctokit(token, options, ...additionalPlugins) {
  4976. const GitHubWithPlugins = utils_1.GitHub.plugin(...additionalPlugins);
  4977. return new GitHubWithPlugins((0, utils_1.getOctokitOptions)(token, options));
  4978. }
  4979. exports.getOctokit = getOctokit;
  4980. //# sourceMappingURL=github.js.map
  4981. /***/ }),
  4982. /***/ 7914:
  4983. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  4984. "use strict";
  4985. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  4986. if (k2 === undefined) k2 = k;
  4987. var desc = Object.getOwnPropertyDescriptor(m, k);
  4988. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  4989. desc = { enumerable: true, get: function() { return m[k]; } };
  4990. }
  4991. Object.defineProperty(o, k2, desc);
  4992. }) : (function(o, m, k, k2) {
  4993. if (k2 === undefined) k2 = k;
  4994. o[k2] = m[k];
  4995. }));
  4996. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  4997. Object.defineProperty(o, "default", { enumerable: true, value: v });
  4998. }) : function(o, v) {
  4999. o["default"] = v;
  5000. });
  5001. var __importStar = (this && this.__importStar) || function (mod) {
  5002. if (mod && mod.__esModule) return mod;
  5003. var result = {};
  5004. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  5005. __setModuleDefault(result, mod);
  5006. return result;
  5007. };
  5008. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  5009. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  5010. return new (P || (P = Promise))(function (resolve, reject) {
  5011. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5012. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  5013. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  5014. step((generator = generator.apply(thisArg, _arguments || [])).next());
  5015. });
  5016. };
  5017. Object.defineProperty(exports, "__esModule", ({ value: true }));
  5018. exports.getApiBaseUrl = exports.getProxyFetch = exports.getProxyAgentDispatcher = exports.getProxyAgent = exports.getAuthString = void 0;
  5019. const httpClient = __importStar(__nccwpck_require__(6255));
  5020. const undici_1 = __nccwpck_require__(1773);
  5021. function getAuthString(token, options) {
  5022. if (!token && !options.auth) {
  5023. throw new Error('Parameter token or opts.auth is required');
  5024. }
  5025. else if (token && options.auth) {
  5026. throw new Error('Parameters token and opts.auth may not both be specified');
  5027. }
  5028. return typeof options.auth === 'string' ? options.auth : `token ${token}`;
  5029. }
  5030. exports.getAuthString = getAuthString;
  5031. function getProxyAgent(destinationUrl) {
  5032. const hc = new httpClient.HttpClient();
  5033. return hc.getAgent(destinationUrl);
  5034. }
  5035. exports.getProxyAgent = getProxyAgent;
  5036. function getProxyAgentDispatcher(destinationUrl) {
  5037. const hc = new httpClient.HttpClient();
  5038. return hc.getAgentDispatcher(destinationUrl);
  5039. }
  5040. exports.getProxyAgentDispatcher = getProxyAgentDispatcher;
  5041. function getProxyFetch(destinationUrl) {
  5042. const httpDispatcher = getProxyAgentDispatcher(destinationUrl);
  5043. const proxyFetch = (url, opts) => __awaiter(this, void 0, void 0, function* () {
  5044. return (0, undici_1.fetch)(url, Object.assign(Object.assign({}, opts), { dispatcher: httpDispatcher }));
  5045. });
  5046. return proxyFetch;
  5047. }
  5048. exports.getProxyFetch = getProxyFetch;
  5049. function getApiBaseUrl() {
  5050. return process.env['GITHUB_API_URL'] || 'https://api.github.com';
  5051. }
  5052. exports.getApiBaseUrl = getApiBaseUrl;
  5053. //# sourceMappingURL=utils.js.map
  5054. /***/ }),
  5055. /***/ 3030:
  5056. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  5057. "use strict";
  5058. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  5059. if (k2 === undefined) k2 = k;
  5060. var desc = Object.getOwnPropertyDescriptor(m, k);
  5061. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  5062. desc = { enumerable: true, get: function() { return m[k]; } };
  5063. }
  5064. Object.defineProperty(o, k2, desc);
  5065. }) : (function(o, m, k, k2) {
  5066. if (k2 === undefined) k2 = k;
  5067. o[k2] = m[k];
  5068. }));
  5069. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  5070. Object.defineProperty(o, "default", { enumerable: true, value: v });
  5071. }) : function(o, v) {
  5072. o["default"] = v;
  5073. });
  5074. var __importStar = (this && this.__importStar) || function (mod) {
  5075. if (mod && mod.__esModule) return mod;
  5076. var result = {};
  5077. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  5078. __setModuleDefault(result, mod);
  5079. return result;
  5080. };
  5081. Object.defineProperty(exports, "__esModule", ({ value: true }));
  5082. exports.getOctokitOptions = exports.GitHub = exports.defaults = exports.context = void 0;
  5083. const Context = __importStar(__nccwpck_require__(4087));
  5084. const Utils = __importStar(__nccwpck_require__(7914));
  5085. // octokit + plugins
  5086. const core_1 = __nccwpck_require__(6762);
  5087. const plugin_rest_endpoint_methods_1 = __nccwpck_require__(3044);
  5088. const plugin_paginate_rest_1 = __nccwpck_require__(4193);
  5089. exports.context = new Context.Context();
  5090. const baseUrl = Utils.getApiBaseUrl();
  5091. exports.defaults = {
  5092. baseUrl,
  5093. request: {
  5094. agent: Utils.getProxyAgent(baseUrl),
  5095. fetch: Utils.getProxyFetch(baseUrl)
  5096. }
  5097. };
  5098. exports.GitHub = core_1.Octokit.plugin(plugin_rest_endpoint_methods_1.restEndpointMethods, plugin_paginate_rest_1.paginateRest).defaults(exports.defaults);
  5099. /**
  5100. * Convience function to correctly format Octokit Options to pass into the constructor.
  5101. *
  5102. * @param token the repo PAT or GITHUB_TOKEN
  5103. * @param options other options to set
  5104. */
  5105. function getOctokitOptions(token, options) {
  5106. const opts = Object.assign({}, options || {}); // Shallow clone - don't mutate the object provided by the caller
  5107. // Auth
  5108. const auth = Utils.getAuthString(token, opts);
  5109. if (auth) {
  5110. opts.auth = auth;
  5111. }
  5112. return opts;
  5113. }
  5114. exports.getOctokitOptions = getOctokitOptions;
  5115. //# sourceMappingURL=utils.js.map
  5116. /***/ }),
  5117. /***/ 5526:
  5118. /***/ (function(__unused_webpack_module, exports) {
  5119. "use strict";
  5120. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  5121. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  5122. return new (P || (P = Promise))(function (resolve, reject) {
  5123. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5124. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  5125. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  5126. step((generator = generator.apply(thisArg, _arguments || [])).next());
  5127. });
  5128. };
  5129. Object.defineProperty(exports, "__esModule", ({ value: true }));
  5130. exports.PersonalAccessTokenCredentialHandler = exports.BearerCredentialHandler = exports.BasicCredentialHandler = void 0;
  5131. class BasicCredentialHandler {
  5132. constructor(username, password) {
  5133. this.username = username;
  5134. this.password = password;
  5135. }
  5136. prepareRequest(options) {
  5137. if (!options.headers) {
  5138. throw Error('The request has no headers');
  5139. }
  5140. options.headers['Authorization'] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString('base64')}`;
  5141. }
  5142. // This handler cannot handle 401
  5143. canHandleAuthentication() {
  5144. return false;
  5145. }
  5146. handleAuthentication() {
  5147. return __awaiter(this, void 0, void 0, function* () {
  5148. throw new Error('not implemented');
  5149. });
  5150. }
  5151. }
  5152. exports.BasicCredentialHandler = BasicCredentialHandler;
  5153. class BearerCredentialHandler {
  5154. constructor(token) {
  5155. this.token = token;
  5156. }
  5157. // currently implements pre-authorization
  5158. // TODO: support preAuth = false where it hooks on 401
  5159. prepareRequest(options) {
  5160. if (!options.headers) {
  5161. throw Error('The request has no headers');
  5162. }
  5163. options.headers['Authorization'] = `Bearer ${this.token}`;
  5164. }
  5165. // This handler cannot handle 401
  5166. canHandleAuthentication() {
  5167. return false;
  5168. }
  5169. handleAuthentication() {
  5170. return __awaiter(this, void 0, void 0, function* () {
  5171. throw new Error('not implemented');
  5172. });
  5173. }
  5174. }
  5175. exports.BearerCredentialHandler = BearerCredentialHandler;
  5176. class PersonalAccessTokenCredentialHandler {
  5177. constructor(token) {
  5178. this.token = token;
  5179. }
  5180. // currently implements pre-authorization
  5181. // TODO: support preAuth = false where it hooks on 401
  5182. prepareRequest(options) {
  5183. if (!options.headers) {
  5184. throw Error('The request has no headers');
  5185. }
  5186. options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`;
  5187. }
  5188. // This handler cannot handle 401
  5189. canHandleAuthentication() {
  5190. return false;
  5191. }
  5192. handleAuthentication() {
  5193. return __awaiter(this, void 0, void 0, function* () {
  5194. throw new Error('not implemented');
  5195. });
  5196. }
  5197. }
  5198. exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler;
  5199. //# sourceMappingURL=auth.js.map
  5200. /***/ }),
  5201. /***/ 6255:
  5202. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  5203. "use strict";
  5204. /* eslint-disable @typescript-eslint/no-explicit-any */
  5205. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  5206. if (k2 === undefined) k2 = k;
  5207. var desc = Object.getOwnPropertyDescriptor(m, k);
  5208. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  5209. desc = { enumerable: true, get: function() { return m[k]; } };
  5210. }
  5211. Object.defineProperty(o, k2, desc);
  5212. }) : (function(o, m, k, k2) {
  5213. if (k2 === undefined) k2 = k;
  5214. o[k2] = m[k];
  5215. }));
  5216. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  5217. Object.defineProperty(o, "default", { enumerable: true, value: v });
  5218. }) : function(o, v) {
  5219. o["default"] = v;
  5220. });
  5221. var __importStar = (this && this.__importStar) || function (mod) {
  5222. if (mod && mod.__esModule) return mod;
  5223. var result = {};
  5224. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  5225. __setModuleDefault(result, mod);
  5226. return result;
  5227. };
  5228. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  5229. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  5230. return new (P || (P = Promise))(function (resolve, reject) {
  5231. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5232. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  5233. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  5234. step((generator = generator.apply(thisArg, _arguments || [])).next());
  5235. });
  5236. };
  5237. Object.defineProperty(exports, "__esModule", ({ value: true }));
  5238. exports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpClientError = exports.getProxyUrl = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0;
  5239. const http = __importStar(__nccwpck_require__(3685));
  5240. const https = __importStar(__nccwpck_require__(5687));
  5241. const pm = __importStar(__nccwpck_require__(9835));
  5242. const tunnel = __importStar(__nccwpck_require__(4294));
  5243. const undici_1 = __nccwpck_require__(1773);
  5244. var HttpCodes;
  5245. (function (HttpCodes) {
  5246. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  5247. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  5248. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  5249. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  5250. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  5251. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  5252. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  5253. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  5254. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  5255. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  5256. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  5257. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  5258. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  5259. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  5260. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  5261. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  5262. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  5263. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  5264. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  5265. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  5266. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  5267. HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests";
  5268. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  5269. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  5270. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  5271. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  5272. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  5273. })(HttpCodes || (exports.HttpCodes = HttpCodes = {}));
  5274. var Headers;
  5275. (function (Headers) {
  5276. Headers["Accept"] = "accept";
  5277. Headers["ContentType"] = "content-type";
  5278. })(Headers || (exports.Headers = Headers = {}));
  5279. var MediaTypes;
  5280. (function (MediaTypes) {
  5281. MediaTypes["ApplicationJson"] = "application/json";
  5282. })(MediaTypes || (exports.MediaTypes = MediaTypes = {}));
  5283. /**
  5284. * Returns the proxy URL, depending upon the supplied url and proxy environment variables.
  5285. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  5286. */
  5287. function getProxyUrl(serverUrl) {
  5288. const proxyUrl = pm.getProxyUrl(new URL(serverUrl));
  5289. return proxyUrl ? proxyUrl.href : '';
  5290. }
  5291. exports.getProxyUrl = getProxyUrl;
  5292. const HttpRedirectCodes = [
  5293. HttpCodes.MovedPermanently,
  5294. HttpCodes.ResourceMoved,
  5295. HttpCodes.SeeOther,
  5296. HttpCodes.TemporaryRedirect,
  5297. HttpCodes.PermanentRedirect
  5298. ];
  5299. const HttpResponseRetryCodes = [
  5300. HttpCodes.BadGateway,
  5301. HttpCodes.ServiceUnavailable,
  5302. HttpCodes.GatewayTimeout
  5303. ];
  5304. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  5305. const ExponentialBackoffCeiling = 10;
  5306. const ExponentialBackoffTimeSlice = 5;
  5307. class HttpClientError extends Error {
  5308. constructor(message, statusCode) {
  5309. super(message);
  5310. this.name = 'HttpClientError';
  5311. this.statusCode = statusCode;
  5312. Object.setPrototypeOf(this, HttpClientError.prototype);
  5313. }
  5314. }
  5315. exports.HttpClientError = HttpClientError;
  5316. class HttpClientResponse {
  5317. constructor(message) {
  5318. this.message = message;
  5319. }
  5320. readBody() {
  5321. return __awaiter(this, void 0, void 0, function* () {
  5322. return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
  5323. let output = Buffer.alloc(0);
  5324. this.message.on('data', (chunk) => {
  5325. output = Buffer.concat([output, chunk]);
  5326. });
  5327. this.message.on('end', () => {
  5328. resolve(output.toString());
  5329. });
  5330. }));
  5331. });
  5332. }
  5333. readBodyBuffer() {
  5334. return __awaiter(this, void 0, void 0, function* () {
  5335. return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
  5336. const chunks = [];
  5337. this.message.on('data', (chunk) => {
  5338. chunks.push(chunk);
  5339. });
  5340. this.message.on('end', () => {
  5341. resolve(Buffer.concat(chunks));
  5342. });
  5343. }));
  5344. });
  5345. }
  5346. }
  5347. exports.HttpClientResponse = HttpClientResponse;
  5348. function isHttps(requestUrl) {
  5349. const parsedUrl = new URL(requestUrl);
  5350. return parsedUrl.protocol === 'https:';
  5351. }
  5352. exports.isHttps = isHttps;
  5353. class HttpClient {
  5354. constructor(userAgent, handlers, requestOptions) {
  5355. this._ignoreSslError = false;
  5356. this._allowRedirects = true;
  5357. this._allowRedirectDowngrade = false;
  5358. this._maxRedirects = 50;
  5359. this._allowRetries = false;
  5360. this._maxRetries = 1;
  5361. this._keepAlive = false;
  5362. this._disposed = false;
  5363. this.userAgent = userAgent;
  5364. this.handlers = handlers || [];
  5365. this.requestOptions = requestOptions;
  5366. if (requestOptions) {
  5367. if (requestOptions.ignoreSslError != null) {
  5368. this._ignoreSslError = requestOptions.ignoreSslError;
  5369. }
  5370. this._socketTimeout = requestOptions.socketTimeout;
  5371. if (requestOptions.allowRedirects != null) {
  5372. this._allowRedirects = requestOptions.allowRedirects;
  5373. }
  5374. if (requestOptions.allowRedirectDowngrade != null) {
  5375. this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;
  5376. }
  5377. if (requestOptions.maxRedirects != null) {
  5378. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  5379. }
  5380. if (requestOptions.keepAlive != null) {
  5381. this._keepAlive = requestOptions.keepAlive;
  5382. }
  5383. if (requestOptions.allowRetries != null) {
  5384. this._allowRetries = requestOptions.allowRetries;
  5385. }
  5386. if (requestOptions.maxRetries != null) {
  5387. this._maxRetries = requestOptions.maxRetries;
  5388. }
  5389. }
  5390. }
  5391. options(requestUrl, additionalHeaders) {
  5392. return __awaiter(this, void 0, void 0, function* () {
  5393. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  5394. });
  5395. }
  5396. get(requestUrl, additionalHeaders) {
  5397. return __awaiter(this, void 0, void 0, function* () {
  5398. return this.request('GET', requestUrl, null, additionalHeaders || {});
  5399. });
  5400. }
  5401. del(requestUrl, additionalHeaders) {
  5402. return __awaiter(this, void 0, void 0, function* () {
  5403. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  5404. });
  5405. }
  5406. post(requestUrl, data, additionalHeaders) {
  5407. return __awaiter(this, void 0, void 0, function* () {
  5408. return this.request('POST', requestUrl, data, additionalHeaders || {});
  5409. });
  5410. }
  5411. patch(requestUrl, data, additionalHeaders) {
  5412. return __awaiter(this, void 0, void 0, function* () {
  5413. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  5414. });
  5415. }
  5416. put(requestUrl, data, additionalHeaders) {
  5417. return __awaiter(this, void 0, void 0, function* () {
  5418. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  5419. });
  5420. }
  5421. head(requestUrl, additionalHeaders) {
  5422. return __awaiter(this, void 0, void 0, function* () {
  5423. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  5424. });
  5425. }
  5426. sendStream(verb, requestUrl, stream, additionalHeaders) {
  5427. return __awaiter(this, void 0, void 0, function* () {
  5428. return this.request(verb, requestUrl, stream, additionalHeaders);
  5429. });
  5430. }
  5431. /**
  5432. * Gets a typed object from an endpoint
  5433. * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise
  5434. */
  5435. getJson(requestUrl, additionalHeaders = {}) {
  5436. return __awaiter(this, void 0, void 0, function* () {
  5437. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  5438. const res = yield this.get(requestUrl, additionalHeaders);
  5439. return this._processResponse(res, this.requestOptions);
  5440. });
  5441. }
  5442. postJson(requestUrl, obj, additionalHeaders = {}) {
  5443. return __awaiter(this, void 0, void 0, function* () {
  5444. const data = JSON.stringify(obj, null, 2);
  5445. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  5446. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  5447. const res = yield this.post(requestUrl, data, additionalHeaders);
  5448. return this._processResponse(res, this.requestOptions);
  5449. });
  5450. }
  5451. putJson(requestUrl, obj, additionalHeaders = {}) {
  5452. return __awaiter(this, void 0, void 0, function* () {
  5453. const data = JSON.stringify(obj, null, 2);
  5454. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  5455. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  5456. const res = yield this.put(requestUrl, data, additionalHeaders);
  5457. return this._processResponse(res, this.requestOptions);
  5458. });
  5459. }
  5460. patchJson(requestUrl, obj, additionalHeaders = {}) {
  5461. return __awaiter(this, void 0, void 0, function* () {
  5462. const data = JSON.stringify(obj, null, 2);
  5463. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  5464. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  5465. const res = yield this.patch(requestUrl, data, additionalHeaders);
  5466. return this._processResponse(res, this.requestOptions);
  5467. });
  5468. }
  5469. /**
  5470. * Makes a raw http request.
  5471. * All other methods such as get, post, patch, and request ultimately call this.
  5472. * Prefer get, del, post and patch
  5473. */
  5474. request(verb, requestUrl, data, headers) {
  5475. return __awaiter(this, void 0, void 0, function* () {
  5476. if (this._disposed) {
  5477. throw new Error('Client has already been disposed.');
  5478. }
  5479. const parsedUrl = new URL(requestUrl);
  5480. let info = this._prepareRequest(verb, parsedUrl, headers);
  5481. // Only perform retries on reads since writes may not be idempotent.
  5482. const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb)
  5483. ? this._maxRetries + 1
  5484. : 1;
  5485. let numTries = 0;
  5486. let response;
  5487. do {
  5488. response = yield this.requestRaw(info, data);
  5489. // Check if it's an authentication challenge
  5490. if (response &&
  5491. response.message &&
  5492. response.message.statusCode === HttpCodes.Unauthorized) {
  5493. let authenticationHandler;
  5494. for (const handler of this.handlers) {
  5495. if (handler.canHandleAuthentication(response)) {
  5496. authenticationHandler = handler;
  5497. break;
  5498. }
  5499. }
  5500. if (authenticationHandler) {
  5501. return authenticationHandler.handleAuthentication(this, info, data);
  5502. }
  5503. else {
  5504. // We have received an unauthorized response but have no handlers to handle it.
  5505. // Let the response return to the caller.
  5506. return response;
  5507. }
  5508. }
  5509. let redirectsRemaining = this._maxRedirects;
  5510. while (response.message.statusCode &&
  5511. HttpRedirectCodes.includes(response.message.statusCode) &&
  5512. this._allowRedirects &&
  5513. redirectsRemaining > 0) {
  5514. const redirectUrl = response.message.headers['location'];
  5515. if (!redirectUrl) {
  5516. // if there's no location to redirect to, we won't
  5517. break;
  5518. }
  5519. const parsedRedirectUrl = new URL(redirectUrl);
  5520. if (parsedUrl.protocol === 'https:' &&
  5521. parsedUrl.protocol !== parsedRedirectUrl.protocol &&
  5522. !this._allowRedirectDowngrade) {
  5523. 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.');
  5524. }
  5525. // we need to finish reading the response before reassigning response
  5526. // which will leak the open socket.
  5527. yield response.readBody();
  5528. // strip authorization header if redirected to a different hostname
  5529. if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {
  5530. for (const header in headers) {
  5531. // header names are case insensitive
  5532. if (header.toLowerCase() === 'authorization') {
  5533. delete headers[header];
  5534. }
  5535. }
  5536. }
  5537. // let's make the request with the new redirectUrl
  5538. info = this._prepareRequest(verb, parsedRedirectUrl, headers);
  5539. response = yield this.requestRaw(info, data);
  5540. redirectsRemaining--;
  5541. }
  5542. if (!response.message.statusCode ||
  5543. !HttpResponseRetryCodes.includes(response.message.statusCode)) {
  5544. // If not a retry code, return immediately instead of retrying
  5545. return response;
  5546. }
  5547. numTries += 1;
  5548. if (numTries < maxTries) {
  5549. yield response.readBody();
  5550. yield this._performExponentialBackoff(numTries);
  5551. }
  5552. } while (numTries < maxTries);
  5553. return response;
  5554. });
  5555. }
  5556. /**
  5557. * Needs to be called if keepAlive is set to true in request options.
  5558. */
  5559. dispose() {
  5560. if (this._agent) {
  5561. this._agent.destroy();
  5562. }
  5563. this._disposed = true;
  5564. }
  5565. /**
  5566. * Raw request.
  5567. * @param info
  5568. * @param data
  5569. */
  5570. requestRaw(info, data) {
  5571. return __awaiter(this, void 0, void 0, function* () {
  5572. return new Promise((resolve, reject) => {
  5573. function callbackForResult(err, res) {
  5574. if (err) {
  5575. reject(err);
  5576. }
  5577. else if (!res) {
  5578. // If `err` is not passed, then `res` must be passed.
  5579. reject(new Error('Unknown error'));
  5580. }
  5581. else {
  5582. resolve(res);
  5583. }
  5584. }
  5585. this.requestRawWithCallback(info, data, callbackForResult);
  5586. });
  5587. });
  5588. }
  5589. /**
  5590. * Raw request with callback.
  5591. * @param info
  5592. * @param data
  5593. * @param onResult
  5594. */
  5595. requestRawWithCallback(info, data, onResult) {
  5596. if (typeof data === 'string') {
  5597. if (!info.options.headers) {
  5598. info.options.headers = {};
  5599. }
  5600. info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');
  5601. }
  5602. let callbackCalled = false;
  5603. function handleResult(err, res) {
  5604. if (!callbackCalled) {
  5605. callbackCalled = true;
  5606. onResult(err, res);
  5607. }
  5608. }
  5609. const req = info.httpModule.request(info.options, (msg) => {
  5610. const res = new HttpClientResponse(msg);
  5611. handleResult(undefined, res);
  5612. });
  5613. let socket;
  5614. req.on('socket', sock => {
  5615. socket = sock;
  5616. });
  5617. // If we ever get disconnected, we want the socket to timeout eventually
  5618. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  5619. if (socket) {
  5620. socket.end();
  5621. }
  5622. handleResult(new Error(`Request timeout: ${info.options.path}`));
  5623. });
  5624. req.on('error', function (err) {
  5625. // err has statusCode property
  5626. // res should have headers
  5627. handleResult(err);
  5628. });
  5629. if (data && typeof data === 'string') {
  5630. req.write(data, 'utf8');
  5631. }
  5632. if (data && typeof data !== 'string') {
  5633. data.on('close', function () {
  5634. req.end();
  5635. });
  5636. data.pipe(req);
  5637. }
  5638. else {
  5639. req.end();
  5640. }
  5641. }
  5642. /**
  5643. * Gets an http agent. This function is useful when you need an http agent that handles
  5644. * routing through a proxy server - depending upon the url and proxy environment variables.
  5645. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  5646. */
  5647. getAgent(serverUrl) {
  5648. const parsedUrl = new URL(serverUrl);
  5649. return this._getAgent(parsedUrl);
  5650. }
  5651. getAgentDispatcher(serverUrl) {
  5652. const parsedUrl = new URL(serverUrl);
  5653. const proxyUrl = pm.getProxyUrl(parsedUrl);
  5654. const useProxy = proxyUrl && proxyUrl.hostname;
  5655. if (!useProxy) {
  5656. return;
  5657. }
  5658. return this._getProxyAgentDispatcher(parsedUrl, proxyUrl);
  5659. }
  5660. _prepareRequest(method, requestUrl, headers) {
  5661. const info = {};
  5662. info.parsedUrl = requestUrl;
  5663. const usingSsl = info.parsedUrl.protocol === 'https:';
  5664. info.httpModule = usingSsl ? https : http;
  5665. const defaultPort = usingSsl ? 443 : 80;
  5666. info.options = {};
  5667. info.options.host = info.parsedUrl.hostname;
  5668. info.options.port = info.parsedUrl.port
  5669. ? parseInt(info.parsedUrl.port)
  5670. : defaultPort;
  5671. info.options.path =
  5672. (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  5673. info.options.method = method;
  5674. info.options.headers = this._mergeHeaders(headers);
  5675. if (this.userAgent != null) {
  5676. info.options.headers['user-agent'] = this.userAgent;
  5677. }
  5678. info.options.agent = this._getAgent(info.parsedUrl);
  5679. // gives handlers an opportunity to participate
  5680. if (this.handlers) {
  5681. for (const handler of this.handlers) {
  5682. handler.prepareRequest(info.options);
  5683. }
  5684. }
  5685. return info;
  5686. }
  5687. _mergeHeaders(headers) {
  5688. if (this.requestOptions && this.requestOptions.headers) {
  5689. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {}));
  5690. }
  5691. return lowercaseKeys(headers || {});
  5692. }
  5693. _getExistingOrDefaultHeader(additionalHeaders, header, _default) {
  5694. let clientHeader;
  5695. if (this.requestOptions && this.requestOptions.headers) {
  5696. clientHeader = lowercaseKeys(this.requestOptions.headers)[header];
  5697. }
  5698. return additionalHeaders[header] || clientHeader || _default;
  5699. }
  5700. _getAgent(parsedUrl) {
  5701. let agent;
  5702. const proxyUrl = pm.getProxyUrl(parsedUrl);
  5703. const useProxy = proxyUrl && proxyUrl.hostname;
  5704. if (this._keepAlive && useProxy) {
  5705. agent = this._proxyAgent;
  5706. }
  5707. if (!useProxy) {
  5708. agent = this._agent;
  5709. }
  5710. // if agent is already assigned use that agent.
  5711. if (agent) {
  5712. return agent;
  5713. }
  5714. const usingSsl = parsedUrl.protocol === 'https:';
  5715. let maxSockets = 100;
  5716. if (this.requestOptions) {
  5717. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  5718. }
  5719. // This is `useProxy` again, but we need to check `proxyURl` directly for TypeScripts's flow analysis.
  5720. if (proxyUrl && proxyUrl.hostname) {
  5721. const agentOptions = {
  5722. maxSockets,
  5723. keepAlive: this._keepAlive,
  5724. proxy: Object.assign(Object.assign({}, ((proxyUrl.username || proxyUrl.password) && {
  5725. proxyAuth: `${proxyUrl.username}:${proxyUrl.password}`
  5726. })), { host: proxyUrl.hostname, port: proxyUrl.port })
  5727. };
  5728. let tunnelAgent;
  5729. const overHttps = proxyUrl.protocol === 'https:';
  5730. if (usingSsl) {
  5731. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  5732. }
  5733. else {
  5734. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  5735. }
  5736. agent = tunnelAgent(agentOptions);
  5737. this._proxyAgent = agent;
  5738. }
  5739. // if tunneling agent isn't assigned create a new agent
  5740. if (!agent) {
  5741. const options = { keepAlive: this._keepAlive, maxSockets };
  5742. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  5743. this._agent = agent;
  5744. }
  5745. if (usingSsl && this._ignoreSslError) {
  5746. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  5747. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  5748. // we have to cast it to any and change it directly
  5749. agent.options = Object.assign(agent.options || {}, {
  5750. rejectUnauthorized: false
  5751. });
  5752. }
  5753. return agent;
  5754. }
  5755. _getProxyAgentDispatcher(parsedUrl, proxyUrl) {
  5756. let proxyAgent;
  5757. if (this._keepAlive) {
  5758. proxyAgent = this._proxyAgentDispatcher;
  5759. }
  5760. // if agent is already assigned use that agent.
  5761. if (proxyAgent) {
  5762. return proxyAgent;
  5763. }
  5764. const usingSsl = parsedUrl.protocol === 'https:';
  5765. proxyAgent = new undici_1.ProxyAgent(Object.assign({ uri: proxyUrl.href, pipelining: !this._keepAlive ? 0 : 1 }, ((proxyUrl.username || proxyUrl.password) && {
  5766. token: `${proxyUrl.username}:${proxyUrl.password}`
  5767. })));
  5768. this._proxyAgentDispatcher = proxyAgent;
  5769. if (usingSsl && this._ignoreSslError) {
  5770. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  5771. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  5772. // we have to cast it to any and change it directly
  5773. proxyAgent.options = Object.assign(proxyAgent.options.requestTls || {}, {
  5774. rejectUnauthorized: false
  5775. });
  5776. }
  5777. return proxyAgent;
  5778. }
  5779. _performExponentialBackoff(retryNumber) {
  5780. return __awaiter(this, void 0, void 0, function* () {
  5781. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  5782. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  5783. return new Promise(resolve => setTimeout(() => resolve(), ms));
  5784. });
  5785. }
  5786. _processResponse(res, options) {
  5787. return __awaiter(this, void 0, void 0, function* () {
  5788. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  5789. const statusCode = res.message.statusCode || 0;
  5790. const response = {
  5791. statusCode,
  5792. result: null,
  5793. headers: {}
  5794. };
  5795. // not found leads to null obj returned
  5796. if (statusCode === HttpCodes.NotFound) {
  5797. resolve(response);
  5798. }
  5799. // get the result from the body
  5800. function dateTimeDeserializer(key, value) {
  5801. if (typeof value === 'string') {
  5802. const a = new Date(value);
  5803. if (!isNaN(a.valueOf())) {
  5804. return a;
  5805. }
  5806. }
  5807. return value;
  5808. }
  5809. let obj;
  5810. let contents;
  5811. try {
  5812. contents = yield res.readBody();
  5813. if (contents && contents.length > 0) {
  5814. if (options && options.deserializeDates) {
  5815. obj = JSON.parse(contents, dateTimeDeserializer);
  5816. }
  5817. else {
  5818. obj = JSON.parse(contents);
  5819. }
  5820. response.result = obj;
  5821. }
  5822. response.headers = res.message.headers;
  5823. }
  5824. catch (err) {
  5825. // Invalid resource (contents not json); leaving result obj null
  5826. }
  5827. // note that 3xx redirects are handled by the http layer.
  5828. if (statusCode > 299) {
  5829. let msg;
  5830. // if exception/error in body, attempt to get better error
  5831. if (obj && obj.message) {
  5832. msg = obj.message;
  5833. }
  5834. else if (contents && contents.length > 0) {
  5835. // it may be the case that the exception is in the body message as string
  5836. msg = contents;
  5837. }
  5838. else {
  5839. msg = `Failed request: (${statusCode})`;
  5840. }
  5841. const err = new HttpClientError(msg, statusCode);
  5842. err.result = response.result;
  5843. reject(err);
  5844. }
  5845. else {
  5846. resolve(response);
  5847. }
  5848. }));
  5849. });
  5850. }
  5851. }
  5852. exports.HttpClient = HttpClient;
  5853. const lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});
  5854. //# sourceMappingURL=index.js.map
  5855. /***/ }),
  5856. /***/ 9835:
  5857. /***/ ((__unused_webpack_module, exports) => {
  5858. "use strict";
  5859. Object.defineProperty(exports, "__esModule", ({ value: true }));
  5860. exports.checkBypass = exports.getProxyUrl = void 0;
  5861. function getProxyUrl(reqUrl) {
  5862. const usingSsl = reqUrl.protocol === 'https:';
  5863. if (checkBypass(reqUrl)) {
  5864. return undefined;
  5865. }
  5866. const proxyVar = (() => {
  5867. if (usingSsl) {
  5868. return process.env['https_proxy'] || process.env['HTTPS_PROXY'];
  5869. }
  5870. else {
  5871. return process.env['http_proxy'] || process.env['HTTP_PROXY'];
  5872. }
  5873. })();
  5874. if (proxyVar) {
  5875. try {
  5876. return new URL(proxyVar);
  5877. }
  5878. catch (_a) {
  5879. if (!proxyVar.startsWith('http://') && !proxyVar.startsWith('https://'))
  5880. return new URL(`http://${proxyVar}`);
  5881. }
  5882. }
  5883. else {
  5884. return undefined;
  5885. }
  5886. }
  5887. exports.getProxyUrl = getProxyUrl;
  5888. function checkBypass(reqUrl) {
  5889. if (!reqUrl.hostname) {
  5890. return false;
  5891. }
  5892. const reqHost = reqUrl.hostname;
  5893. if (isLoopbackAddress(reqHost)) {
  5894. return true;
  5895. }
  5896. const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';
  5897. if (!noProxy) {
  5898. return false;
  5899. }
  5900. // Determine the request port
  5901. let reqPort;
  5902. if (reqUrl.port) {
  5903. reqPort = Number(reqUrl.port);
  5904. }
  5905. else if (reqUrl.protocol === 'http:') {
  5906. reqPort = 80;
  5907. }
  5908. else if (reqUrl.protocol === 'https:') {
  5909. reqPort = 443;
  5910. }
  5911. // Format the request hostname and hostname with port
  5912. const upperReqHosts = [reqUrl.hostname.toUpperCase()];
  5913. if (typeof reqPort === 'number') {
  5914. upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);
  5915. }
  5916. // Compare request host against noproxy
  5917. for (const upperNoProxyItem of noProxy
  5918. .split(',')
  5919. .map(x => x.trim().toUpperCase())
  5920. .filter(x => x)) {
  5921. if (upperNoProxyItem === '*' ||
  5922. upperReqHosts.some(x => x === upperNoProxyItem ||
  5923. x.endsWith(`.${upperNoProxyItem}`) ||
  5924. (upperNoProxyItem.startsWith('.') &&
  5925. x.endsWith(`${upperNoProxyItem}`)))) {
  5926. return true;
  5927. }
  5928. }
  5929. return false;
  5930. }
  5931. exports.checkBypass = checkBypass;
  5932. function isLoopbackAddress(host) {
  5933. const hostLower = host.toLowerCase();
  5934. return (hostLower === 'localhost' ||
  5935. hostLower.startsWith('127.') ||
  5936. hostLower.startsWith('[::1]') ||
  5937. hostLower.startsWith('[0:0:0:0:0:0:0:1]'));
  5938. }
  5939. //# sourceMappingURL=proxy.js.map
  5940. /***/ }),
  5941. /***/ 1962:
  5942. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  5943. "use strict";
  5944. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  5945. if (k2 === undefined) k2 = k;
  5946. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  5947. }) : (function(o, m, k, k2) {
  5948. if (k2 === undefined) k2 = k;
  5949. o[k2] = m[k];
  5950. }));
  5951. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  5952. Object.defineProperty(o, "default", { enumerable: true, value: v });
  5953. }) : function(o, v) {
  5954. o["default"] = v;
  5955. });
  5956. var __importStar = (this && this.__importStar) || function (mod) {
  5957. if (mod && mod.__esModule) return mod;
  5958. var result = {};
  5959. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  5960. __setModuleDefault(result, mod);
  5961. return result;
  5962. };
  5963. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  5964. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  5965. return new (P || (P = Promise))(function (resolve, reject) {
  5966. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5967. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  5968. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  5969. step((generator = generator.apply(thisArg, _arguments || [])).next());
  5970. });
  5971. };
  5972. var _a;
  5973. Object.defineProperty(exports, "__esModule", ({ value: true }));
  5974. 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;
  5975. const fs = __importStar(__nccwpck_require__(7147));
  5976. const path = __importStar(__nccwpck_require__(1017));
  5977. _a = fs.promises
  5978. // export const {open} = 'fs'
  5979. , 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;
  5980. // export const {open} = 'fs'
  5981. exports.IS_WINDOWS = process.platform === 'win32';
  5982. // See https://github.com/nodejs/node/blob/d0153aee367422d0858105abec186da4dff0a0c5/deps/uv/include/uv/win.h#L691
  5983. exports.UV_FS_O_EXLOCK = 0x10000000;
  5984. exports.READONLY = fs.constants.O_RDONLY;
  5985. function exists(fsPath) {
  5986. return __awaiter(this, void 0, void 0, function* () {
  5987. try {
  5988. yield exports.stat(fsPath);
  5989. }
  5990. catch (err) {
  5991. if (err.code === 'ENOENT') {
  5992. return false;
  5993. }
  5994. throw err;
  5995. }
  5996. return true;
  5997. });
  5998. }
  5999. exports.exists = exists;
  6000. function isDirectory(fsPath, useStat = false) {
  6001. return __awaiter(this, void 0, void 0, function* () {
  6002. const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath);
  6003. return stats.isDirectory();
  6004. });
  6005. }
  6006. exports.isDirectory = isDirectory;
  6007. /**
  6008. * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:
  6009. * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases).
  6010. */
  6011. function isRooted(p) {
  6012. p = normalizeSeparators(p);
  6013. if (!p) {
  6014. throw new Error('isRooted() parameter "p" cannot be empty');
  6015. }
  6016. if (exports.IS_WINDOWS) {
  6017. return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello
  6018. ); // e.g. C: or C:\hello
  6019. }
  6020. return p.startsWith('/');
  6021. }
  6022. exports.isRooted = isRooted;
  6023. /**
  6024. * Best effort attempt to determine whether a file exists and is executable.
  6025. * @param filePath file path to check
  6026. * @param extensions additional file extensions to try
  6027. * @return if file exists and is executable, returns the file path. otherwise empty string.
  6028. */
  6029. function tryGetExecutablePath(filePath, extensions) {
  6030. return __awaiter(this, void 0, void 0, function* () {
  6031. let stats = undefined;
  6032. try {
  6033. // test file exists
  6034. stats = yield exports.stat(filePath);
  6035. }
  6036. catch (err) {
  6037. if (err.code !== 'ENOENT') {
  6038. // eslint-disable-next-line no-console
  6039. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  6040. }
  6041. }
  6042. if (stats && stats.isFile()) {
  6043. if (exports.IS_WINDOWS) {
  6044. // on Windows, test for valid extension
  6045. const upperExt = path.extname(filePath).toUpperCase();
  6046. if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) {
  6047. return filePath;
  6048. }
  6049. }
  6050. else {
  6051. if (isUnixExecutable(stats)) {
  6052. return filePath;
  6053. }
  6054. }
  6055. }
  6056. // try each extension
  6057. const originalFilePath = filePath;
  6058. for (const extension of extensions) {
  6059. filePath = originalFilePath + extension;
  6060. stats = undefined;
  6061. try {
  6062. stats = yield exports.stat(filePath);
  6063. }
  6064. catch (err) {
  6065. if (err.code !== 'ENOENT') {
  6066. // eslint-disable-next-line no-console
  6067. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  6068. }
  6069. }
  6070. if (stats && stats.isFile()) {
  6071. if (exports.IS_WINDOWS) {
  6072. // preserve the case of the actual file (since an extension was appended)
  6073. try {
  6074. const directory = path.dirname(filePath);
  6075. const upperName = path.basename(filePath).toUpperCase();
  6076. for (const actualName of yield exports.readdir(directory)) {
  6077. if (upperName === actualName.toUpperCase()) {
  6078. filePath = path.join(directory, actualName);
  6079. break;
  6080. }
  6081. }
  6082. }
  6083. catch (err) {
  6084. // eslint-disable-next-line no-console
  6085. console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`);
  6086. }
  6087. return filePath;
  6088. }
  6089. else {
  6090. if (isUnixExecutable(stats)) {
  6091. return filePath;
  6092. }
  6093. }
  6094. }
  6095. }
  6096. return '';
  6097. });
  6098. }
  6099. exports.tryGetExecutablePath = tryGetExecutablePath;
  6100. function normalizeSeparators(p) {
  6101. p = p || '';
  6102. if (exports.IS_WINDOWS) {
  6103. // convert slashes on Windows
  6104. p = p.replace(/\//g, '\\');
  6105. // remove redundant slashes
  6106. return p.replace(/\\\\+/g, '\\');
  6107. }
  6108. // remove redundant slashes
  6109. return p.replace(/\/\/+/g, '/');
  6110. }
  6111. // on Mac/Linux, test the execute bit
  6112. // R W X R W X R W X
  6113. // 256 128 64 32 16 8 4 2 1
  6114. function isUnixExecutable(stats) {
  6115. return ((stats.mode & 1) > 0 ||
  6116. ((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||
  6117. ((stats.mode & 64) > 0 && stats.uid === process.getuid()));
  6118. }
  6119. // Get the path of cmd.exe in windows
  6120. function getCmdPath() {
  6121. var _a;
  6122. return (_a = process.env['COMSPEC']) !== null && _a !== void 0 ? _a : `cmd.exe`;
  6123. }
  6124. exports.getCmdPath = getCmdPath;
  6125. //# sourceMappingURL=io-util.js.map
  6126. /***/ }),
  6127. /***/ 7436:
  6128. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  6129. "use strict";
  6130. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  6131. if (k2 === undefined) k2 = k;
  6132. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  6133. }) : (function(o, m, k, k2) {
  6134. if (k2 === undefined) k2 = k;
  6135. o[k2] = m[k];
  6136. }));
  6137. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  6138. Object.defineProperty(o, "default", { enumerable: true, value: v });
  6139. }) : function(o, v) {
  6140. o["default"] = v;
  6141. });
  6142. var __importStar = (this && this.__importStar) || function (mod) {
  6143. if (mod && mod.__esModule) return mod;
  6144. var result = {};
  6145. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  6146. __setModuleDefault(result, mod);
  6147. return result;
  6148. };
  6149. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6150. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6151. return new (P || (P = Promise))(function (resolve, reject) {
  6152. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6153. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6154. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6155. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6156. });
  6157. };
  6158. Object.defineProperty(exports, "__esModule", ({ value: true }));
  6159. exports.findInPath = exports.which = exports.mkdirP = exports.rmRF = exports.mv = exports.cp = void 0;
  6160. const assert_1 = __nccwpck_require__(9491);
  6161. const path = __importStar(__nccwpck_require__(1017));
  6162. const ioUtil = __importStar(__nccwpck_require__(1962));
  6163. /**
  6164. * Copies a file or folder.
  6165. * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js
  6166. *
  6167. * @param source source path
  6168. * @param dest destination path
  6169. * @param options optional. See CopyOptions.
  6170. */
  6171. function cp(source, dest, options = {}) {
  6172. return __awaiter(this, void 0, void 0, function* () {
  6173. const { force, recursive, copySourceDirectory } = readCopyOptions(options);
  6174. const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null;
  6175. // Dest is an existing file, but not forcing
  6176. if (destStat && destStat.isFile() && !force) {
  6177. return;
  6178. }
  6179. // If dest is an existing directory, should copy inside.
  6180. const newDest = destStat && destStat.isDirectory() && copySourceDirectory
  6181. ? path.join(dest, path.basename(source))
  6182. : dest;
  6183. if (!(yield ioUtil.exists(source))) {
  6184. throw new Error(`no such file or directory: ${source}`);
  6185. }
  6186. const sourceStat = yield ioUtil.stat(source);
  6187. if (sourceStat.isDirectory()) {
  6188. if (!recursive) {
  6189. throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`);
  6190. }
  6191. else {
  6192. yield cpDirRecursive(source, newDest, 0, force);
  6193. }
  6194. }
  6195. else {
  6196. if (path.relative(source, newDest) === '') {
  6197. // a file cannot be copied to itself
  6198. throw new Error(`'${newDest}' and '${source}' are the same file`);
  6199. }
  6200. yield copyFile(source, newDest, force);
  6201. }
  6202. });
  6203. }
  6204. exports.cp = cp;
  6205. /**
  6206. * Moves a path.
  6207. *
  6208. * @param source source path
  6209. * @param dest destination path
  6210. * @param options optional. See MoveOptions.
  6211. */
  6212. function mv(source, dest, options = {}) {
  6213. return __awaiter(this, void 0, void 0, function* () {
  6214. if (yield ioUtil.exists(dest)) {
  6215. let destExists = true;
  6216. if (yield ioUtil.isDirectory(dest)) {
  6217. // If dest is directory copy src into dest
  6218. dest = path.join(dest, path.basename(source));
  6219. destExists = yield ioUtil.exists(dest);
  6220. }
  6221. if (destExists) {
  6222. if (options.force == null || options.force) {
  6223. yield rmRF(dest);
  6224. }
  6225. else {
  6226. throw new Error('Destination already exists');
  6227. }
  6228. }
  6229. }
  6230. yield mkdirP(path.dirname(dest));
  6231. yield ioUtil.rename(source, dest);
  6232. });
  6233. }
  6234. exports.mv = mv;
  6235. /**
  6236. * Remove a path recursively with force
  6237. *
  6238. * @param inputPath path to remove
  6239. */
  6240. function rmRF(inputPath) {
  6241. return __awaiter(this, void 0, void 0, function* () {
  6242. if (ioUtil.IS_WINDOWS) {
  6243. // Check for invalid characters
  6244. // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file
  6245. if (/[*"<>|]/.test(inputPath)) {
  6246. throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows');
  6247. }
  6248. }
  6249. try {
  6250. // note if path does not exist, error is silent
  6251. yield ioUtil.rm(inputPath, {
  6252. force: true,
  6253. maxRetries: 3,
  6254. recursive: true,
  6255. retryDelay: 300
  6256. });
  6257. }
  6258. catch (err) {
  6259. throw new Error(`File was unable to be removed ${err}`);
  6260. }
  6261. });
  6262. }
  6263. exports.rmRF = rmRF;
  6264. /**
  6265. * Make a directory. Creates the full path with folders in between
  6266. * Will throw if it fails
  6267. *
  6268. * @param fsPath path to create
  6269. * @returns Promise<void>
  6270. */
  6271. function mkdirP(fsPath) {
  6272. return __awaiter(this, void 0, void 0, function* () {
  6273. assert_1.ok(fsPath, 'a path argument must be provided');
  6274. yield ioUtil.mkdir(fsPath, { recursive: true });
  6275. });
  6276. }
  6277. exports.mkdirP = mkdirP;
  6278. /**
  6279. * Returns path of a tool had the tool actually been invoked. Resolves via paths.
  6280. * If you check and the tool does not exist, it will throw.
  6281. *
  6282. * @param tool name of the tool
  6283. * @param check whether to check if tool exists
  6284. * @returns Promise<string> path to tool
  6285. */
  6286. function which(tool, check) {
  6287. return __awaiter(this, void 0, void 0, function* () {
  6288. if (!tool) {
  6289. throw new Error("parameter 'tool' is required");
  6290. }
  6291. // recursive when check=true
  6292. if (check) {
  6293. const result = yield which(tool, false);
  6294. if (!result) {
  6295. if (ioUtil.IS_WINDOWS) {
  6296. 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.`);
  6297. }
  6298. else {
  6299. 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.`);
  6300. }
  6301. }
  6302. return result;
  6303. }
  6304. const matches = yield findInPath(tool);
  6305. if (matches && matches.length > 0) {
  6306. return matches[0];
  6307. }
  6308. return '';
  6309. });
  6310. }
  6311. exports.which = which;
  6312. /**
  6313. * Returns a list of all occurrences of the given tool on the system path.
  6314. *
  6315. * @returns Promise<string[]> the paths of the tool
  6316. */
  6317. function findInPath(tool) {
  6318. return __awaiter(this, void 0, void 0, function* () {
  6319. if (!tool) {
  6320. throw new Error("parameter 'tool' is required");
  6321. }
  6322. // build the list of extensions to try
  6323. const extensions = [];
  6324. if (ioUtil.IS_WINDOWS && process.env['PATHEXT']) {
  6325. for (const extension of process.env['PATHEXT'].split(path.delimiter)) {
  6326. if (extension) {
  6327. extensions.push(extension);
  6328. }
  6329. }
  6330. }
  6331. // if it's rooted, return it if exists. otherwise return empty.
  6332. if (ioUtil.isRooted(tool)) {
  6333. const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions);
  6334. if (filePath) {
  6335. return [filePath];
  6336. }
  6337. return [];
  6338. }
  6339. // if any path separators, return empty
  6340. if (tool.includes(path.sep)) {
  6341. return [];
  6342. }
  6343. // build the list of directories
  6344. //
  6345. // Note, technically "where" checks the current directory on Windows. From a toolkit perspective,
  6346. // it feels like we should not do this. Checking the current directory seems like more of a use
  6347. // case of a shell, and the which() function exposed by the toolkit should strive for consistency
  6348. // across platforms.
  6349. const directories = [];
  6350. if (process.env.PATH) {
  6351. for (const p of process.env.PATH.split(path.delimiter)) {
  6352. if (p) {
  6353. directories.push(p);
  6354. }
  6355. }
  6356. }
  6357. // find all matches
  6358. const matches = [];
  6359. for (const directory of directories) {
  6360. const filePath = yield ioUtil.tryGetExecutablePath(path.join(directory, tool), extensions);
  6361. if (filePath) {
  6362. matches.push(filePath);
  6363. }
  6364. }
  6365. return matches;
  6366. });
  6367. }
  6368. exports.findInPath = findInPath;
  6369. function readCopyOptions(options) {
  6370. const force = options.force == null ? true : options.force;
  6371. const recursive = Boolean(options.recursive);
  6372. const copySourceDirectory = options.copySourceDirectory == null
  6373. ? true
  6374. : Boolean(options.copySourceDirectory);
  6375. return { force, recursive, copySourceDirectory };
  6376. }
  6377. function cpDirRecursive(sourceDir, destDir, currentDepth, force) {
  6378. return __awaiter(this, void 0, void 0, function* () {
  6379. // Ensure there is not a run away recursive copy
  6380. if (currentDepth >= 255)
  6381. return;
  6382. currentDepth++;
  6383. yield mkdirP(destDir);
  6384. const files = yield ioUtil.readdir(sourceDir);
  6385. for (const fileName of files) {
  6386. const srcFile = `${sourceDir}/${fileName}`;
  6387. const destFile = `${destDir}/${fileName}`;
  6388. const srcFileStat = yield ioUtil.lstat(srcFile);
  6389. if (srcFileStat.isDirectory()) {
  6390. // Recurse
  6391. yield cpDirRecursive(srcFile, destFile, currentDepth, force);
  6392. }
  6393. else {
  6394. yield copyFile(srcFile, destFile, force);
  6395. }
  6396. }
  6397. // Change the mode for the newly created directory
  6398. yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode);
  6399. });
  6400. }
  6401. // Buffered file copy
  6402. function copyFile(srcFile, destFile, force) {
  6403. return __awaiter(this, void 0, void 0, function* () {
  6404. if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) {
  6405. // unlink/re-link it
  6406. try {
  6407. yield ioUtil.lstat(destFile);
  6408. yield ioUtil.unlink(destFile);
  6409. }
  6410. catch (e) {
  6411. // Try to override file permission
  6412. if (e.code === 'EPERM') {
  6413. yield ioUtil.chmod(destFile, '0666');
  6414. yield ioUtil.unlink(destFile);
  6415. }
  6416. // other errors = it doesn't exist, no work to do
  6417. }
  6418. // Copy over symlink
  6419. const symlinkFull = yield ioUtil.readlink(srcFile);
  6420. yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null);
  6421. }
  6422. else if (!(yield ioUtil.exists(destFile)) || force) {
  6423. yield ioUtil.copyFile(srcFile, destFile);
  6424. }
  6425. });
  6426. }
  6427. //# sourceMappingURL=io.js.map
  6428. /***/ }),
  6429. /***/ 2473:
  6430. /***/ (function(module, exports, __nccwpck_require__) {
  6431. "use strict";
  6432. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  6433. if (k2 === undefined) k2 = k;
  6434. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  6435. }) : (function(o, m, k, k2) {
  6436. if (k2 === undefined) k2 = k;
  6437. o[k2] = m[k];
  6438. }));
  6439. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  6440. Object.defineProperty(o, "default", { enumerable: true, value: v });
  6441. }) : function(o, v) {
  6442. o["default"] = v;
  6443. });
  6444. var __importStar = (this && this.__importStar) || function (mod) {
  6445. if (mod && mod.__esModule) return mod;
  6446. var result = {};
  6447. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  6448. __setModuleDefault(result, mod);
  6449. return result;
  6450. };
  6451. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6452. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6453. return new (P || (P = Promise))(function (resolve, reject) {
  6454. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6455. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6456. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6457. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6458. });
  6459. };
  6460. Object.defineProperty(exports, "__esModule", ({ value: true }));
  6461. exports._readLinuxVersionFile = exports._getOsVersion = exports._findMatch = void 0;
  6462. const semver = __importStar(__nccwpck_require__(5911));
  6463. const core_1 = __nccwpck_require__(2186);
  6464. // needs to be require for core node modules to be mocked
  6465. /* eslint @typescript-eslint/no-require-imports: 0 */
  6466. const os = __nccwpck_require__(2037);
  6467. const cp = __nccwpck_require__(2081);
  6468. const fs = __nccwpck_require__(7147);
  6469. function _findMatch(versionSpec, stable, candidates, archFilter) {
  6470. return __awaiter(this, void 0, void 0, function* () {
  6471. const platFilter = os.platform();
  6472. let result;
  6473. let match;
  6474. let file;
  6475. for (const candidate of candidates) {
  6476. const version = candidate.version;
  6477. core_1.debug(`check ${version} satisfies ${versionSpec}`);
  6478. if (semver.satisfies(version, versionSpec) &&
  6479. (!stable || candidate.stable === stable)) {
  6480. file = candidate.files.find(item => {
  6481. core_1.debug(`${item.arch}===${archFilter} && ${item.platform}===${platFilter}`);
  6482. let chk = item.arch === archFilter && item.platform === platFilter;
  6483. if (chk && item.platform_version) {
  6484. const osVersion = module.exports._getOsVersion();
  6485. if (osVersion === item.platform_version) {
  6486. chk = true;
  6487. }
  6488. else {
  6489. chk = semver.satisfies(osVersion, item.platform_version);
  6490. }
  6491. }
  6492. return chk;
  6493. });
  6494. if (file) {
  6495. core_1.debug(`matched ${candidate.version}`);
  6496. match = candidate;
  6497. break;
  6498. }
  6499. }
  6500. }
  6501. if (match && file) {
  6502. // clone since we're mutating the file list to be only the file that matches
  6503. result = Object.assign({}, match);
  6504. result.files = [file];
  6505. }
  6506. return result;
  6507. });
  6508. }
  6509. exports._findMatch = _findMatch;
  6510. function _getOsVersion() {
  6511. // TODO: add windows and other linux, arm variants
  6512. // right now filtering on version is only an ubuntu and macos scenario for tools we build for hosted (python)
  6513. const plat = os.platform();
  6514. let version = '';
  6515. if (plat === 'darwin') {
  6516. version = cp.execSync('sw_vers -productVersion').toString();
  6517. }
  6518. else if (plat === 'linux') {
  6519. // lsb_release process not in some containers, readfile
  6520. // Run cat /etc/lsb-release
  6521. // DISTRIB_ID=Ubuntu
  6522. // DISTRIB_RELEASE=18.04
  6523. // DISTRIB_CODENAME=bionic
  6524. // DISTRIB_DESCRIPTION="Ubuntu 18.04.4 LTS"
  6525. const lsbContents = module.exports._readLinuxVersionFile();
  6526. if (lsbContents) {
  6527. const lines = lsbContents.split('\n');
  6528. for (const line of lines) {
  6529. const parts = line.split('=');
  6530. if (parts.length === 2 &&
  6531. (parts[0].trim() === 'VERSION_ID' ||
  6532. parts[0].trim() === 'DISTRIB_RELEASE')) {
  6533. version = parts[1]
  6534. .trim()
  6535. .replace(/^"/, '')
  6536. .replace(/"$/, '');
  6537. break;
  6538. }
  6539. }
  6540. }
  6541. }
  6542. return version;
  6543. }
  6544. exports._getOsVersion = _getOsVersion;
  6545. function _readLinuxVersionFile() {
  6546. const lsbReleaseFile = '/etc/lsb-release';
  6547. const osReleaseFile = '/etc/os-release';
  6548. let contents = '';
  6549. if (fs.existsSync(lsbReleaseFile)) {
  6550. contents = fs.readFileSync(lsbReleaseFile).toString();
  6551. }
  6552. else if (fs.existsSync(osReleaseFile)) {
  6553. contents = fs.readFileSync(osReleaseFile).toString();
  6554. }
  6555. return contents;
  6556. }
  6557. exports._readLinuxVersionFile = _readLinuxVersionFile;
  6558. //# sourceMappingURL=manifest.js.map
  6559. /***/ }),
  6560. /***/ 8279:
  6561. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  6562. "use strict";
  6563. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  6564. if (k2 === undefined) k2 = k;
  6565. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  6566. }) : (function(o, m, k, k2) {
  6567. if (k2 === undefined) k2 = k;
  6568. o[k2] = m[k];
  6569. }));
  6570. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  6571. Object.defineProperty(o, "default", { enumerable: true, value: v });
  6572. }) : function(o, v) {
  6573. o["default"] = v;
  6574. });
  6575. var __importStar = (this && this.__importStar) || function (mod) {
  6576. if (mod && mod.__esModule) return mod;
  6577. var result = {};
  6578. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  6579. __setModuleDefault(result, mod);
  6580. return result;
  6581. };
  6582. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6583. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6584. return new (P || (P = Promise))(function (resolve, reject) {
  6585. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6586. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6587. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6588. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6589. });
  6590. };
  6591. Object.defineProperty(exports, "__esModule", ({ value: true }));
  6592. exports.RetryHelper = void 0;
  6593. const core = __importStar(__nccwpck_require__(2186));
  6594. /**
  6595. * Internal class for retries
  6596. */
  6597. class RetryHelper {
  6598. constructor(maxAttempts, minSeconds, maxSeconds) {
  6599. if (maxAttempts < 1) {
  6600. throw new Error('max attempts should be greater than or equal to 1');
  6601. }
  6602. this.maxAttempts = maxAttempts;
  6603. this.minSeconds = Math.floor(minSeconds);
  6604. this.maxSeconds = Math.floor(maxSeconds);
  6605. if (this.minSeconds > this.maxSeconds) {
  6606. throw new Error('min seconds should be less than or equal to max seconds');
  6607. }
  6608. }
  6609. execute(action, isRetryable) {
  6610. return __awaiter(this, void 0, void 0, function* () {
  6611. let attempt = 1;
  6612. while (attempt < this.maxAttempts) {
  6613. // Try
  6614. try {
  6615. return yield action();
  6616. }
  6617. catch (err) {
  6618. if (isRetryable && !isRetryable(err)) {
  6619. throw err;
  6620. }
  6621. core.info(err.message);
  6622. }
  6623. // Sleep
  6624. const seconds = this.getSleepAmount();
  6625. core.info(`Waiting ${seconds} seconds before trying again`);
  6626. yield this.sleep(seconds);
  6627. attempt++;
  6628. }
  6629. // Last attempt
  6630. return yield action();
  6631. });
  6632. }
  6633. getSleepAmount() {
  6634. return (Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) +
  6635. this.minSeconds);
  6636. }
  6637. sleep(seconds) {
  6638. return __awaiter(this, void 0, void 0, function* () {
  6639. return new Promise(resolve => setTimeout(resolve, seconds * 1000));
  6640. });
  6641. }
  6642. }
  6643. exports.RetryHelper = RetryHelper;
  6644. //# sourceMappingURL=retry-helper.js.map
  6645. /***/ }),
  6646. /***/ 7784:
  6647. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  6648. "use strict";
  6649. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  6650. if (k2 === undefined) k2 = k;
  6651. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  6652. }) : (function(o, m, k, k2) {
  6653. if (k2 === undefined) k2 = k;
  6654. o[k2] = m[k];
  6655. }));
  6656. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  6657. Object.defineProperty(o, "default", { enumerable: true, value: v });
  6658. }) : function(o, v) {
  6659. o["default"] = v;
  6660. });
  6661. var __importStar = (this && this.__importStar) || function (mod) {
  6662. if (mod && mod.__esModule) return mod;
  6663. var result = {};
  6664. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  6665. __setModuleDefault(result, mod);
  6666. return result;
  6667. };
  6668. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6669. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6670. return new (P || (P = Promise))(function (resolve, reject) {
  6671. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6672. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6673. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6674. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6675. });
  6676. };
  6677. var __importDefault = (this && this.__importDefault) || function (mod) {
  6678. return (mod && mod.__esModule) ? mod : { "default": mod };
  6679. };
  6680. Object.defineProperty(exports, "__esModule", ({ value: true }));
  6681. 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;
  6682. const core = __importStar(__nccwpck_require__(2186));
  6683. const io = __importStar(__nccwpck_require__(7436));
  6684. const fs = __importStar(__nccwpck_require__(7147));
  6685. const mm = __importStar(__nccwpck_require__(2473));
  6686. const os = __importStar(__nccwpck_require__(2037));
  6687. const path = __importStar(__nccwpck_require__(1017));
  6688. const httpm = __importStar(__nccwpck_require__(6255));
  6689. const semver = __importStar(__nccwpck_require__(5911));
  6690. const stream = __importStar(__nccwpck_require__(2781));
  6691. const util = __importStar(__nccwpck_require__(3837));
  6692. const assert_1 = __nccwpck_require__(9491);
  6693. const v4_1 = __importDefault(__nccwpck_require__(7468));
  6694. const exec_1 = __nccwpck_require__(1514);
  6695. const retry_helper_1 = __nccwpck_require__(8279);
  6696. class HTTPError extends Error {
  6697. constructor(httpStatusCode) {
  6698. super(`Unexpected HTTP response: ${httpStatusCode}`);
  6699. this.httpStatusCode = httpStatusCode;
  6700. Object.setPrototypeOf(this, new.target.prototype);
  6701. }
  6702. }
  6703. exports.HTTPError = HTTPError;
  6704. const IS_WINDOWS = process.platform === 'win32';
  6705. const IS_MAC = process.platform === 'darwin';
  6706. const userAgent = 'actions/tool-cache';
  6707. /**
  6708. * Download a tool from an url and stream it into a file
  6709. *
  6710. * @param url url of tool to download
  6711. * @param dest path to download tool
  6712. * @param auth authorization header
  6713. * @param headers other headers
  6714. * @returns path to downloaded tool
  6715. */
  6716. function downloadTool(url, dest, auth, headers) {
  6717. return __awaiter(this, void 0, void 0, function* () {
  6718. dest = dest || path.join(_getTempDirectory(), v4_1.default());
  6719. yield io.mkdirP(path.dirname(dest));
  6720. core.debug(`Downloading ${url}`);
  6721. core.debug(`Destination ${dest}`);
  6722. const maxAttempts = 3;
  6723. const minSeconds = _getGlobal('TEST_DOWNLOAD_TOOL_RETRY_MIN_SECONDS', 10);
  6724. const maxSeconds = _getGlobal('TEST_DOWNLOAD_TOOL_RETRY_MAX_SECONDS', 20);
  6725. const retryHelper = new retry_helper_1.RetryHelper(maxAttempts, minSeconds, maxSeconds);
  6726. return yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  6727. return yield downloadToolAttempt(url, dest || '', auth, headers);
  6728. }), (err) => {
  6729. if (err instanceof HTTPError && err.httpStatusCode) {
  6730. // Don't retry anything less than 500, except 408 Request Timeout and 429 Too Many Requests
  6731. if (err.httpStatusCode < 500 &&
  6732. err.httpStatusCode !== 408 &&
  6733. err.httpStatusCode !== 429) {
  6734. return false;
  6735. }
  6736. }
  6737. // Otherwise retry
  6738. return true;
  6739. });
  6740. });
  6741. }
  6742. exports.downloadTool = downloadTool;
  6743. function downloadToolAttempt(url, dest, auth, headers) {
  6744. return __awaiter(this, void 0, void 0, function* () {
  6745. if (fs.existsSync(dest)) {
  6746. throw new Error(`Destination file path ${dest} already exists`);
  6747. }
  6748. // Get the response headers
  6749. const http = new httpm.HttpClient(userAgent, [], {
  6750. allowRetries: false
  6751. });
  6752. if (auth) {
  6753. core.debug('set auth');
  6754. if (headers === undefined) {
  6755. headers = {};
  6756. }
  6757. headers.authorization = auth;
  6758. }
  6759. const response = yield http.get(url, headers);
  6760. if (response.message.statusCode !== 200) {
  6761. const err = new HTTPError(response.message.statusCode);
  6762. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  6763. throw err;
  6764. }
  6765. // Download the response body
  6766. const pipeline = util.promisify(stream.pipeline);
  6767. const responseMessageFactory = _getGlobal('TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY', () => response.message);
  6768. const readStream = responseMessageFactory();
  6769. let succeeded = false;
  6770. try {
  6771. yield pipeline(readStream, fs.createWriteStream(dest));
  6772. core.debug('download complete');
  6773. succeeded = true;
  6774. return dest;
  6775. }
  6776. finally {
  6777. // Error, delete dest before retry
  6778. if (!succeeded) {
  6779. core.debug('download failed');
  6780. try {
  6781. yield io.rmRF(dest);
  6782. }
  6783. catch (err) {
  6784. core.debug(`Failed to delete '${dest}'. ${err.message}`);
  6785. }
  6786. }
  6787. }
  6788. });
  6789. }
  6790. /**
  6791. * Extract a .7z file
  6792. *
  6793. * @param file path to the .7z file
  6794. * @param dest destination directory. Optional.
  6795. * @param _7zPath path to 7zr.exe. Optional, for long path support. Most .7z archives do not have this
  6796. * problem. If your .7z archive contains very long paths, you can pass the path to 7zr.exe which will
  6797. * gracefully handle long paths. By default 7zdec.exe is used because it is a very small program and is
  6798. * bundled with the tool lib. However it does not support long paths. 7zr.exe is the reduced command line
  6799. * interface, it is smaller than the full command line interface, and it does support long paths. At the
  6800. * time of this writing, it is freely available from the LZMA SDK that is available on the 7zip website.
  6801. * Be sure to check the current license agreement. If 7zr.exe is bundled with your action, then the path
  6802. * to 7zr.exe can be pass to this function.
  6803. * @returns path to the destination directory
  6804. */
  6805. function extract7z(file, dest, _7zPath) {
  6806. return __awaiter(this, void 0, void 0, function* () {
  6807. assert_1.ok(IS_WINDOWS, 'extract7z() not supported on current OS');
  6808. assert_1.ok(file, 'parameter "file" is required');
  6809. dest = yield _createExtractFolder(dest);
  6810. const originalCwd = process.cwd();
  6811. process.chdir(dest);
  6812. if (_7zPath) {
  6813. try {
  6814. const logLevel = core.isDebug() ? '-bb1' : '-bb0';
  6815. const args = [
  6816. 'x',
  6817. logLevel,
  6818. '-bd',
  6819. '-sccUTF-8',
  6820. file
  6821. ];
  6822. const options = {
  6823. silent: true
  6824. };
  6825. yield exec_1.exec(`"${_7zPath}"`, args, options);
  6826. }
  6827. finally {
  6828. process.chdir(originalCwd);
  6829. }
  6830. }
  6831. else {
  6832. const escapedScript = path
  6833. .join(__dirname, '..', 'scripts', 'Invoke-7zdec.ps1')
  6834. .replace(/'/g, "''")
  6835. .replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  6836. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  6837. const escapedTarget = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  6838. const command = `& '${escapedScript}' -Source '${escapedFile}' -Target '${escapedTarget}'`;
  6839. const args = [
  6840. '-NoLogo',
  6841. '-Sta',
  6842. '-NoProfile',
  6843. '-NonInteractive',
  6844. '-ExecutionPolicy',
  6845. 'Unrestricted',
  6846. '-Command',
  6847. command
  6848. ];
  6849. const options = {
  6850. silent: true
  6851. };
  6852. try {
  6853. const powershellPath = yield io.which('powershell', true);
  6854. yield exec_1.exec(`"${powershellPath}"`, args, options);
  6855. }
  6856. finally {
  6857. process.chdir(originalCwd);
  6858. }
  6859. }
  6860. return dest;
  6861. });
  6862. }
  6863. exports.extract7z = extract7z;
  6864. /**
  6865. * Extract a compressed tar archive
  6866. *
  6867. * @param file path to the tar
  6868. * @param dest destination directory. Optional.
  6869. * @param flags flags for the tar command to use for extraction. Defaults to 'xz' (extracting gzipped tars). Optional.
  6870. * @returns path to the destination directory
  6871. */
  6872. function extractTar(file, dest, flags = 'xz') {
  6873. return __awaiter(this, void 0, void 0, function* () {
  6874. if (!file) {
  6875. throw new Error("parameter 'file' is required");
  6876. }
  6877. // Create dest
  6878. dest = yield _createExtractFolder(dest);
  6879. // Determine whether GNU tar
  6880. core.debug('Checking tar --version');
  6881. let versionOutput = '';
  6882. yield exec_1.exec('tar --version', [], {
  6883. ignoreReturnCode: true,
  6884. silent: true,
  6885. listeners: {
  6886. stdout: (data) => (versionOutput += data.toString()),
  6887. stderr: (data) => (versionOutput += data.toString())
  6888. }
  6889. });
  6890. core.debug(versionOutput.trim());
  6891. const isGnuTar = versionOutput.toUpperCase().includes('GNU TAR');
  6892. // Initialize args
  6893. let args;
  6894. if (flags instanceof Array) {
  6895. args = flags;
  6896. }
  6897. else {
  6898. args = [flags];
  6899. }
  6900. if (core.isDebug() && !flags.includes('v')) {
  6901. args.push('-v');
  6902. }
  6903. let destArg = dest;
  6904. let fileArg = file;
  6905. if (IS_WINDOWS && isGnuTar) {
  6906. args.push('--force-local');
  6907. destArg = dest.replace(/\\/g, '/');
  6908. // Technically only the dest needs to have `/` but for aesthetic consistency
  6909. // convert slashes in the file arg too.
  6910. fileArg = file.replace(/\\/g, '/');
  6911. }
  6912. if (isGnuTar) {
  6913. // Suppress warnings when using GNU tar to extract archives created by BSD tar
  6914. args.push('--warning=no-unknown-keyword');
  6915. args.push('--overwrite');
  6916. }
  6917. args.push('-C', destArg, '-f', fileArg);
  6918. yield exec_1.exec(`tar`, args);
  6919. return dest;
  6920. });
  6921. }
  6922. exports.extractTar = extractTar;
  6923. /**
  6924. * Extract a xar compatible archive
  6925. *
  6926. * @param file path to the archive
  6927. * @param dest destination directory. Optional.
  6928. * @param flags flags for the xar. Optional.
  6929. * @returns path to the destination directory
  6930. */
  6931. function extractXar(file, dest, flags = []) {
  6932. return __awaiter(this, void 0, void 0, function* () {
  6933. assert_1.ok(IS_MAC, 'extractXar() not supported on current OS');
  6934. assert_1.ok(file, 'parameter "file" is required');
  6935. dest = yield _createExtractFolder(dest);
  6936. let args;
  6937. if (flags instanceof Array) {
  6938. args = flags;
  6939. }
  6940. else {
  6941. args = [flags];
  6942. }
  6943. args.push('-x', '-C', dest, '-f', file);
  6944. if (core.isDebug()) {
  6945. args.push('-v');
  6946. }
  6947. const xarPath = yield io.which('xar', true);
  6948. yield exec_1.exec(`"${xarPath}"`, _unique(args));
  6949. return dest;
  6950. });
  6951. }
  6952. exports.extractXar = extractXar;
  6953. /**
  6954. * Extract a zip
  6955. *
  6956. * @param file path to the zip
  6957. * @param dest destination directory. Optional.
  6958. * @returns path to the destination directory
  6959. */
  6960. function extractZip(file, dest) {
  6961. return __awaiter(this, void 0, void 0, function* () {
  6962. if (!file) {
  6963. throw new Error("parameter 'file' is required");
  6964. }
  6965. dest = yield _createExtractFolder(dest);
  6966. if (IS_WINDOWS) {
  6967. yield extractZipWin(file, dest);
  6968. }
  6969. else {
  6970. yield extractZipNix(file, dest);
  6971. }
  6972. return dest;
  6973. });
  6974. }
  6975. exports.extractZip = extractZip;
  6976. function extractZipWin(file, dest) {
  6977. return __awaiter(this, void 0, void 0, function* () {
  6978. // build the powershell command
  6979. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  6980. const escapedDest = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  6981. const pwshPath = yield io.which('pwsh', false);
  6982. //To match the file overwrite behavior on nix systems, we use the overwrite = true flag for ExtractToDirectory
  6983. //and the -Force flag for Expand-Archive as a fallback
  6984. if (pwshPath) {
  6985. //attempt to use pwsh with ExtractToDirectory, if this fails attempt Expand-Archive
  6986. const pwshCommand = [
  6987. `$ErrorActionPreference = 'Stop' ;`,
  6988. `try { Add-Type -AssemblyName System.IO.Compression.ZipFile } catch { } ;`,
  6989. `try { [System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}', $true) }`,
  6990. `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 $_ } } ;`
  6991. ].join(' ');
  6992. const args = [
  6993. '-NoLogo',
  6994. '-NoProfile',
  6995. '-NonInteractive',
  6996. '-ExecutionPolicy',
  6997. 'Unrestricted',
  6998. '-Command',
  6999. pwshCommand
  7000. ];
  7001. core.debug(`Using pwsh at path: ${pwshPath}`);
  7002. yield exec_1.exec(`"${pwshPath}"`, args);
  7003. }
  7004. else {
  7005. const powershellCommand = [
  7006. `$ErrorActionPreference = 'Stop' ;`,
  7007. `try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ;`,
  7008. `if ((Get-Command -Name Expand-Archive -Module Microsoft.PowerShell.Archive -ErrorAction Ignore)) { Expand-Archive -LiteralPath '${escapedFile}' -DestinationPath '${escapedDest}' -Force }`,
  7009. `else {[System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}', $true) }`
  7010. ].join(' ');
  7011. const args = [
  7012. '-NoLogo',
  7013. '-Sta',
  7014. '-NoProfile',
  7015. '-NonInteractive',
  7016. '-ExecutionPolicy',
  7017. 'Unrestricted',
  7018. '-Command',
  7019. powershellCommand
  7020. ];
  7021. const powershellPath = yield io.which('powershell', true);
  7022. core.debug(`Using powershell at path: ${powershellPath}`);
  7023. yield exec_1.exec(`"${powershellPath}"`, args);
  7024. }
  7025. });
  7026. }
  7027. function extractZipNix(file, dest) {
  7028. return __awaiter(this, void 0, void 0, function* () {
  7029. const unzipPath = yield io.which('unzip', true);
  7030. const args = [file];
  7031. if (!core.isDebug()) {
  7032. args.unshift('-q');
  7033. }
  7034. args.unshift('-o'); //overwrite with -o, otherwise a prompt is shown which freezes the run
  7035. yield exec_1.exec(`"${unzipPath}"`, args, { cwd: dest });
  7036. });
  7037. }
  7038. /**
  7039. * Caches a directory and installs it into the tool cacheDir
  7040. *
  7041. * @param sourceDir the directory to cache into tools
  7042. * @param tool tool name
  7043. * @param version version of the tool. semver format
  7044. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  7045. */
  7046. function cacheDir(sourceDir, tool, version, arch) {
  7047. return __awaiter(this, void 0, void 0, function* () {
  7048. version = semver.clean(version) || version;
  7049. arch = arch || os.arch();
  7050. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  7051. core.debug(`source dir: ${sourceDir}`);
  7052. if (!fs.statSync(sourceDir).isDirectory()) {
  7053. throw new Error('sourceDir is not a directory');
  7054. }
  7055. // Create the tool dir
  7056. const destPath = yield _createToolPath(tool, version, arch);
  7057. // copy each child item. do not move. move can fail on Windows
  7058. // due to anti-virus software having an open handle on a file.
  7059. for (const itemName of fs.readdirSync(sourceDir)) {
  7060. const s = path.join(sourceDir, itemName);
  7061. yield io.cp(s, destPath, { recursive: true });
  7062. }
  7063. // write .complete
  7064. _completeToolPath(tool, version, arch);
  7065. return destPath;
  7066. });
  7067. }
  7068. exports.cacheDir = cacheDir;
  7069. /**
  7070. * Caches a downloaded file (GUID) and installs it
  7071. * into the tool cache with a given targetName
  7072. *
  7073. * @param sourceFile the file to cache into tools. Typically a result of downloadTool which is a guid.
  7074. * @param targetFile the name of the file name in the tools directory
  7075. * @param tool tool name
  7076. * @param version version of the tool. semver format
  7077. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  7078. */
  7079. function cacheFile(sourceFile, targetFile, tool, version, arch) {
  7080. return __awaiter(this, void 0, void 0, function* () {
  7081. version = semver.clean(version) || version;
  7082. arch = arch || os.arch();
  7083. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  7084. core.debug(`source file: ${sourceFile}`);
  7085. if (!fs.statSync(sourceFile).isFile()) {
  7086. throw new Error('sourceFile is not a file');
  7087. }
  7088. // create the tool dir
  7089. const destFolder = yield _createToolPath(tool, version, arch);
  7090. // copy instead of move. move can fail on Windows due to
  7091. // anti-virus software having an open handle on a file.
  7092. const destPath = path.join(destFolder, targetFile);
  7093. core.debug(`destination file ${destPath}`);
  7094. yield io.cp(sourceFile, destPath);
  7095. // write .complete
  7096. _completeToolPath(tool, version, arch);
  7097. return destFolder;
  7098. });
  7099. }
  7100. exports.cacheFile = cacheFile;
  7101. /**
  7102. * Finds the path to a tool version in the local installed tool cache
  7103. *
  7104. * @param toolName name of the tool
  7105. * @param versionSpec version of the tool
  7106. * @param arch optional arch. defaults to arch of computer
  7107. */
  7108. function find(toolName, versionSpec, arch) {
  7109. if (!toolName) {
  7110. throw new Error('toolName parameter is required');
  7111. }
  7112. if (!versionSpec) {
  7113. throw new Error('versionSpec parameter is required');
  7114. }
  7115. arch = arch || os.arch();
  7116. // attempt to resolve an explicit version
  7117. if (!isExplicitVersion(versionSpec)) {
  7118. const localVersions = findAllVersions(toolName, arch);
  7119. const match = evaluateVersions(localVersions, versionSpec);
  7120. versionSpec = match;
  7121. }
  7122. // check for the explicit version in the cache
  7123. let toolPath = '';
  7124. if (versionSpec) {
  7125. versionSpec = semver.clean(versionSpec) || '';
  7126. const cachePath = path.join(_getCacheDirectory(), toolName, versionSpec, arch);
  7127. core.debug(`checking cache: ${cachePath}`);
  7128. if (fs.existsSync(cachePath) && fs.existsSync(`${cachePath}.complete`)) {
  7129. core.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`);
  7130. toolPath = cachePath;
  7131. }
  7132. else {
  7133. core.debug('not found');
  7134. }
  7135. }
  7136. return toolPath;
  7137. }
  7138. exports.find = find;
  7139. /**
  7140. * Finds the paths to all versions of a tool that are installed in the local tool cache
  7141. *
  7142. * @param toolName name of the tool
  7143. * @param arch optional arch. defaults to arch of computer
  7144. */
  7145. function findAllVersions(toolName, arch) {
  7146. const versions = [];
  7147. arch = arch || os.arch();
  7148. const toolPath = path.join(_getCacheDirectory(), toolName);
  7149. if (fs.existsSync(toolPath)) {
  7150. const children = fs.readdirSync(toolPath);
  7151. for (const child of children) {
  7152. if (isExplicitVersion(child)) {
  7153. const fullPath = path.join(toolPath, child, arch || '');
  7154. if (fs.existsSync(fullPath) && fs.existsSync(`${fullPath}.complete`)) {
  7155. versions.push(child);
  7156. }
  7157. }
  7158. }
  7159. }
  7160. return versions;
  7161. }
  7162. exports.findAllVersions = findAllVersions;
  7163. function getManifestFromRepo(owner, repo, auth, branch = 'master') {
  7164. return __awaiter(this, void 0, void 0, function* () {
  7165. let releases = [];
  7166. const treeUrl = `https://api.github.com/repos/${owner}/${repo}/git/trees/${branch}`;
  7167. const http = new httpm.HttpClient('tool-cache');
  7168. const headers = {};
  7169. if (auth) {
  7170. core.debug('set auth');
  7171. headers.authorization = auth;
  7172. }
  7173. const response = yield http.getJson(treeUrl, headers);
  7174. if (!response.result) {
  7175. return releases;
  7176. }
  7177. let manifestUrl = '';
  7178. for (const item of response.result.tree) {
  7179. if (item.path === 'versions-manifest.json') {
  7180. manifestUrl = item.url;
  7181. break;
  7182. }
  7183. }
  7184. headers['accept'] = 'application/vnd.github.VERSION.raw';
  7185. let versionsRaw = yield (yield http.get(manifestUrl, headers)).readBody();
  7186. if (versionsRaw) {
  7187. // shouldn't be needed but protects against invalid json saved with BOM
  7188. versionsRaw = versionsRaw.replace(/^\uFEFF/, '');
  7189. try {
  7190. releases = JSON.parse(versionsRaw);
  7191. }
  7192. catch (_a) {
  7193. core.debug('Invalid json');
  7194. }
  7195. }
  7196. return releases;
  7197. });
  7198. }
  7199. exports.getManifestFromRepo = getManifestFromRepo;
  7200. function findFromManifest(versionSpec, stable, manifest, archFilter = os.arch()) {
  7201. return __awaiter(this, void 0, void 0, function* () {
  7202. // wrap the internal impl
  7203. const match = yield mm._findMatch(versionSpec, stable, manifest, archFilter);
  7204. return match;
  7205. });
  7206. }
  7207. exports.findFromManifest = findFromManifest;
  7208. function _createExtractFolder(dest) {
  7209. return __awaiter(this, void 0, void 0, function* () {
  7210. if (!dest) {
  7211. // create a temp dir
  7212. dest = path.join(_getTempDirectory(), v4_1.default());
  7213. }
  7214. yield io.mkdirP(dest);
  7215. return dest;
  7216. });
  7217. }
  7218. function _createToolPath(tool, version, arch) {
  7219. return __awaiter(this, void 0, void 0, function* () {
  7220. const folderPath = path.join(_getCacheDirectory(), tool, semver.clean(version) || version, arch || '');
  7221. core.debug(`destination ${folderPath}`);
  7222. const markerPath = `${folderPath}.complete`;
  7223. yield io.rmRF(folderPath);
  7224. yield io.rmRF(markerPath);
  7225. yield io.mkdirP(folderPath);
  7226. return folderPath;
  7227. });
  7228. }
  7229. function _completeToolPath(tool, version, arch) {
  7230. const folderPath = path.join(_getCacheDirectory(), tool, semver.clean(version) || version, arch || '');
  7231. const markerPath = `${folderPath}.complete`;
  7232. fs.writeFileSync(markerPath, '');
  7233. core.debug('finished caching tool');
  7234. }
  7235. /**
  7236. * Check if version string is explicit
  7237. *
  7238. * @param versionSpec version string to check
  7239. */
  7240. function isExplicitVersion(versionSpec) {
  7241. const c = semver.clean(versionSpec) || '';
  7242. core.debug(`isExplicit: ${c}`);
  7243. const valid = semver.valid(c) != null;
  7244. core.debug(`explicit? ${valid}`);
  7245. return valid;
  7246. }
  7247. exports.isExplicitVersion = isExplicitVersion;
  7248. /**
  7249. * Get the highest satisfiying semantic version in `versions` which satisfies `versionSpec`
  7250. *
  7251. * @param versions array of versions to evaluate
  7252. * @param versionSpec semantic version spec to satisfy
  7253. */
  7254. function evaluateVersions(versions, versionSpec) {
  7255. let version = '';
  7256. core.debug(`evaluating ${versions.length} versions`);
  7257. versions = versions.sort((a, b) => {
  7258. if (semver.gt(a, b)) {
  7259. return 1;
  7260. }
  7261. return -1;
  7262. });
  7263. for (let i = versions.length - 1; i >= 0; i--) {
  7264. const potential = versions[i];
  7265. const satisfied = semver.satisfies(potential, versionSpec);
  7266. if (satisfied) {
  7267. version = potential;
  7268. break;
  7269. }
  7270. }
  7271. if (version) {
  7272. core.debug(`matched: ${version}`);
  7273. }
  7274. else {
  7275. core.debug('match not found');
  7276. }
  7277. return version;
  7278. }
  7279. exports.evaluateVersions = evaluateVersions;
  7280. /**
  7281. * Gets RUNNER_TOOL_CACHE
  7282. */
  7283. function _getCacheDirectory() {
  7284. const cacheDirectory = process.env['RUNNER_TOOL_CACHE'] || '';
  7285. assert_1.ok(cacheDirectory, 'Expected RUNNER_TOOL_CACHE to be defined');
  7286. return cacheDirectory;
  7287. }
  7288. /**
  7289. * Gets RUNNER_TEMP
  7290. */
  7291. function _getTempDirectory() {
  7292. const tempDirectory = process.env['RUNNER_TEMP'] || '';
  7293. assert_1.ok(tempDirectory, 'Expected RUNNER_TEMP to be defined');
  7294. return tempDirectory;
  7295. }
  7296. /**
  7297. * Gets a global variable
  7298. */
  7299. function _getGlobal(key, defaultValue) {
  7300. /* eslint-disable @typescript-eslint/no-explicit-any */
  7301. const value = global[key];
  7302. /* eslint-enable @typescript-eslint/no-explicit-any */
  7303. return value !== undefined ? value : defaultValue;
  7304. }
  7305. /**
  7306. * Returns an array of unique values.
  7307. * @param values Values to make unique.
  7308. */
  7309. function _unique(values) {
  7310. return Array.from(new Set(values));
  7311. }
  7312. //# sourceMappingURL=tool-cache.js.map
  7313. /***/ }),
  7314. /***/ 7701:
  7315. /***/ ((module) => {
  7316. /**
  7317. * Convert array of 16 byte values to UUID string format of the form:
  7318. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  7319. */
  7320. var byteToHex = [];
  7321. for (var i = 0; i < 256; ++i) {
  7322. byteToHex[i] = (i + 0x100).toString(16).substr(1);
  7323. }
  7324. function bytesToUuid(buf, offset) {
  7325. var i = offset || 0;
  7326. var bth = byteToHex;
  7327. // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
  7328. return ([
  7329. bth[buf[i++]], bth[buf[i++]],
  7330. bth[buf[i++]], bth[buf[i++]], '-',
  7331. bth[buf[i++]], bth[buf[i++]], '-',
  7332. bth[buf[i++]], bth[buf[i++]], '-',
  7333. bth[buf[i++]], bth[buf[i++]], '-',
  7334. bth[buf[i++]], bth[buf[i++]],
  7335. bth[buf[i++]], bth[buf[i++]],
  7336. bth[buf[i++]], bth[buf[i++]]
  7337. ]).join('');
  7338. }
  7339. module.exports = bytesToUuid;
  7340. /***/ }),
  7341. /***/ 7269:
  7342. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  7343. // Unique ID creation requires a high quality random # generator. In node.js
  7344. // this is pretty straight-forward - we use the crypto API.
  7345. var crypto = __nccwpck_require__(6113);
  7346. module.exports = function nodeRNG() {
  7347. return crypto.randomBytes(16);
  7348. };
  7349. /***/ }),
  7350. /***/ 7468:
  7351. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  7352. var rng = __nccwpck_require__(7269);
  7353. var bytesToUuid = __nccwpck_require__(7701);
  7354. function v4(options, buf, offset) {
  7355. var i = buf && offset || 0;
  7356. if (typeof(options) == 'string') {
  7357. buf = options === 'binary' ? new Array(16) : null;
  7358. options = null;
  7359. }
  7360. options = options || {};
  7361. var rnds = options.random || (options.rng || rng)();
  7362. // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  7363. rnds[6] = (rnds[6] & 0x0f) | 0x40;
  7364. rnds[8] = (rnds[8] & 0x3f) | 0x80;
  7365. // Copy bytes to buffer, if provided
  7366. if (buf) {
  7367. for (var ii = 0; ii < 16; ++ii) {
  7368. buf[i + ii] = rnds[ii];
  7369. }
  7370. }
  7371. return buf || bytesToUuid(rnds);
  7372. }
  7373. module.exports = v4;
  7374. /***/ }),
  7375. /***/ 334:
  7376. /***/ ((module) => {
  7377. "use strict";
  7378. var __defProp = Object.defineProperty;
  7379. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  7380. var __getOwnPropNames = Object.getOwnPropertyNames;
  7381. var __hasOwnProp = Object.prototype.hasOwnProperty;
  7382. var __export = (target, all) => {
  7383. for (var name in all)
  7384. __defProp(target, name, { get: all[name], enumerable: true });
  7385. };
  7386. var __copyProps = (to, from, except, desc) => {
  7387. if (from && typeof from === "object" || typeof from === "function") {
  7388. for (let key of __getOwnPropNames(from))
  7389. if (!__hasOwnProp.call(to, key) && key !== except)
  7390. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  7391. }
  7392. return to;
  7393. };
  7394. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  7395. // pkg/dist-src/index.js
  7396. var dist_src_exports = {};
  7397. __export(dist_src_exports, {
  7398. createTokenAuth: () => createTokenAuth
  7399. });
  7400. module.exports = __toCommonJS(dist_src_exports);
  7401. // pkg/dist-src/auth.js
  7402. var REGEX_IS_INSTALLATION_LEGACY = /^v1\./;
  7403. var REGEX_IS_INSTALLATION = /^ghs_/;
  7404. var REGEX_IS_USER_TO_SERVER = /^ghu_/;
  7405. async function auth(token) {
  7406. const isApp = token.split(/\./).length === 3;
  7407. const isInstallation = REGEX_IS_INSTALLATION_LEGACY.test(token) || REGEX_IS_INSTALLATION.test(token);
  7408. const isUserToServer = REGEX_IS_USER_TO_SERVER.test(token);
  7409. const tokenType = isApp ? "app" : isInstallation ? "installation" : isUserToServer ? "user-to-server" : "oauth";
  7410. return {
  7411. type: "token",
  7412. token,
  7413. tokenType
  7414. };
  7415. }
  7416. // pkg/dist-src/with-authorization-prefix.js
  7417. function withAuthorizationPrefix(token) {
  7418. if (token.split(/\./).length === 3) {
  7419. return `bearer ${token}`;
  7420. }
  7421. return `token ${token}`;
  7422. }
  7423. // pkg/dist-src/hook.js
  7424. async function hook(token, request, route, parameters) {
  7425. const endpoint = request.endpoint.merge(
  7426. route,
  7427. parameters
  7428. );
  7429. endpoint.headers.authorization = withAuthorizationPrefix(token);
  7430. return request(endpoint);
  7431. }
  7432. // pkg/dist-src/index.js
  7433. var createTokenAuth = function createTokenAuth2(token) {
  7434. if (!token) {
  7435. throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");
  7436. }
  7437. if (typeof token !== "string") {
  7438. throw new Error(
  7439. "[@octokit/auth-token] Token passed to createTokenAuth is not a string"
  7440. );
  7441. }
  7442. token = token.replace(/^(token|bearer) +/i, "");
  7443. return Object.assign(auth.bind(null, token), {
  7444. hook: hook.bind(null, token)
  7445. });
  7446. };
  7447. // Annotate the CommonJS export names for ESM import in node:
  7448. 0 && (0);
  7449. /***/ }),
  7450. /***/ 6762:
  7451. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  7452. "use strict";
  7453. var __defProp = Object.defineProperty;
  7454. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  7455. var __getOwnPropNames = Object.getOwnPropertyNames;
  7456. var __hasOwnProp = Object.prototype.hasOwnProperty;
  7457. var __export = (target, all) => {
  7458. for (var name in all)
  7459. __defProp(target, name, { get: all[name], enumerable: true });
  7460. };
  7461. var __copyProps = (to, from, except, desc) => {
  7462. if (from && typeof from === "object" || typeof from === "function") {
  7463. for (let key of __getOwnPropNames(from))
  7464. if (!__hasOwnProp.call(to, key) && key !== except)
  7465. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  7466. }
  7467. return to;
  7468. };
  7469. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  7470. // pkg/dist-src/index.js
  7471. var dist_src_exports = {};
  7472. __export(dist_src_exports, {
  7473. Octokit: () => Octokit
  7474. });
  7475. module.exports = __toCommonJS(dist_src_exports);
  7476. var import_universal_user_agent = __nccwpck_require__(5030);
  7477. var import_before_after_hook = __nccwpck_require__(3682);
  7478. var import_request = __nccwpck_require__(6234);
  7479. var import_graphql = __nccwpck_require__(8467);
  7480. var import_auth_token = __nccwpck_require__(334);
  7481. // pkg/dist-src/version.js
  7482. var VERSION = "5.2.0";
  7483. // pkg/dist-src/index.js
  7484. var noop = () => {
  7485. };
  7486. var consoleWarn = console.warn.bind(console);
  7487. var consoleError = console.error.bind(console);
  7488. var userAgentTrail = `octokit-core.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`;
  7489. var Octokit = class {
  7490. static {
  7491. this.VERSION = VERSION;
  7492. }
  7493. static defaults(defaults) {
  7494. const OctokitWithDefaults = class extends this {
  7495. constructor(...args) {
  7496. const options = args[0] || {};
  7497. if (typeof defaults === "function") {
  7498. super(defaults(options));
  7499. return;
  7500. }
  7501. super(
  7502. Object.assign(
  7503. {},
  7504. defaults,
  7505. options,
  7506. options.userAgent && defaults.userAgent ? {
  7507. userAgent: `${options.userAgent} ${defaults.userAgent}`
  7508. } : null
  7509. )
  7510. );
  7511. }
  7512. };
  7513. return OctokitWithDefaults;
  7514. }
  7515. static {
  7516. this.plugins = [];
  7517. }
  7518. /**
  7519. * Attach a plugin (or many) to your Octokit instance.
  7520. *
  7521. * @example
  7522. * const API = Octokit.plugin(plugin1, plugin2, plugin3, ...)
  7523. */
  7524. static plugin(...newPlugins) {
  7525. const currentPlugins = this.plugins;
  7526. const NewOctokit = class extends this {
  7527. static {
  7528. this.plugins = currentPlugins.concat(
  7529. newPlugins.filter((plugin) => !currentPlugins.includes(plugin))
  7530. );
  7531. }
  7532. };
  7533. return NewOctokit;
  7534. }
  7535. constructor(options = {}) {
  7536. const hook = new import_before_after_hook.Collection();
  7537. const requestDefaults = {
  7538. baseUrl: import_request.request.endpoint.DEFAULTS.baseUrl,
  7539. headers: {},
  7540. request: Object.assign({}, options.request, {
  7541. // @ts-ignore internal usage only, no need to type
  7542. hook: hook.bind(null, "request")
  7543. }),
  7544. mediaType: {
  7545. previews: [],
  7546. format: ""
  7547. }
  7548. };
  7549. requestDefaults.headers["user-agent"] = options.userAgent ? `${options.userAgent} ${userAgentTrail}` : userAgentTrail;
  7550. if (options.baseUrl) {
  7551. requestDefaults.baseUrl = options.baseUrl;
  7552. }
  7553. if (options.previews) {
  7554. requestDefaults.mediaType.previews = options.previews;
  7555. }
  7556. if (options.timeZone) {
  7557. requestDefaults.headers["time-zone"] = options.timeZone;
  7558. }
  7559. this.request = import_request.request.defaults(requestDefaults);
  7560. this.graphql = (0, import_graphql.withCustomRequest)(this.request).defaults(requestDefaults);
  7561. this.log = Object.assign(
  7562. {
  7563. debug: noop,
  7564. info: noop,
  7565. warn: consoleWarn,
  7566. error: consoleError
  7567. },
  7568. options.log
  7569. );
  7570. this.hook = hook;
  7571. if (!options.authStrategy) {
  7572. if (!options.auth) {
  7573. this.auth = async () => ({
  7574. type: "unauthenticated"
  7575. });
  7576. } else {
  7577. const auth = (0, import_auth_token.createTokenAuth)(options.auth);
  7578. hook.wrap("request", auth.hook);
  7579. this.auth = auth;
  7580. }
  7581. } else {
  7582. const { authStrategy, ...otherOptions } = options;
  7583. const auth = authStrategy(
  7584. Object.assign(
  7585. {
  7586. request: this.request,
  7587. log: this.log,
  7588. // we pass the current octokit instance as well as its constructor options
  7589. // to allow for authentication strategies that return a new octokit instance
  7590. // that shares the same internal state as the current one. The original
  7591. // requirement for this was the "event-octokit" authentication strategy
  7592. // of https://github.com/probot/octokit-auth-probot.
  7593. octokit: this,
  7594. octokitOptions: otherOptions
  7595. },
  7596. options.auth
  7597. )
  7598. );
  7599. hook.wrap("request", auth.hook);
  7600. this.auth = auth;
  7601. }
  7602. const classConstructor = this.constructor;
  7603. for (let i = 0; i < classConstructor.plugins.length; ++i) {
  7604. Object.assign(this, classConstructor.plugins[i](this, options));
  7605. }
  7606. }
  7607. };
  7608. // Annotate the CommonJS export names for ESM import in node:
  7609. 0 && (0);
  7610. /***/ }),
  7611. /***/ 9440:
  7612. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  7613. "use strict";
  7614. var __defProp = Object.defineProperty;
  7615. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  7616. var __getOwnPropNames = Object.getOwnPropertyNames;
  7617. var __hasOwnProp = Object.prototype.hasOwnProperty;
  7618. var __export = (target, all) => {
  7619. for (var name in all)
  7620. __defProp(target, name, { get: all[name], enumerable: true });
  7621. };
  7622. var __copyProps = (to, from, except, desc) => {
  7623. if (from && typeof from === "object" || typeof from === "function") {
  7624. for (let key of __getOwnPropNames(from))
  7625. if (!__hasOwnProp.call(to, key) && key !== except)
  7626. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  7627. }
  7628. return to;
  7629. };
  7630. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  7631. // pkg/dist-src/index.js
  7632. var dist_src_exports = {};
  7633. __export(dist_src_exports, {
  7634. endpoint: () => endpoint
  7635. });
  7636. module.exports = __toCommonJS(dist_src_exports);
  7637. // pkg/dist-src/defaults.js
  7638. var import_universal_user_agent = __nccwpck_require__(5030);
  7639. // pkg/dist-src/version.js
  7640. var VERSION = "9.0.6";
  7641. // pkg/dist-src/defaults.js
  7642. var userAgent = `octokit-endpoint.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`;
  7643. var DEFAULTS = {
  7644. method: "GET",
  7645. baseUrl: "https://api.github.com",
  7646. headers: {
  7647. accept: "application/vnd.github.v3+json",
  7648. "user-agent": userAgent
  7649. },
  7650. mediaType: {
  7651. format: ""
  7652. }
  7653. };
  7654. // pkg/dist-src/util/lowercase-keys.js
  7655. function lowercaseKeys(object) {
  7656. if (!object) {
  7657. return {};
  7658. }
  7659. return Object.keys(object).reduce((newObj, key) => {
  7660. newObj[key.toLowerCase()] = object[key];
  7661. return newObj;
  7662. }, {});
  7663. }
  7664. // pkg/dist-src/util/is-plain-object.js
  7665. function isPlainObject(value) {
  7666. if (typeof value !== "object" || value === null)
  7667. return false;
  7668. if (Object.prototype.toString.call(value) !== "[object Object]")
  7669. return false;
  7670. const proto = Object.getPrototypeOf(value);
  7671. if (proto === null)
  7672. return true;
  7673. const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
  7674. return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
  7675. }
  7676. // pkg/dist-src/util/merge-deep.js
  7677. function mergeDeep(defaults, options) {
  7678. const result = Object.assign({}, defaults);
  7679. Object.keys(options).forEach((key) => {
  7680. if (isPlainObject(options[key])) {
  7681. if (!(key in defaults))
  7682. Object.assign(result, { [key]: options[key] });
  7683. else
  7684. result[key] = mergeDeep(defaults[key], options[key]);
  7685. } else {
  7686. Object.assign(result, { [key]: options[key] });
  7687. }
  7688. });
  7689. return result;
  7690. }
  7691. // pkg/dist-src/util/remove-undefined-properties.js
  7692. function removeUndefinedProperties(obj) {
  7693. for (const key in obj) {
  7694. if (obj[key] === void 0) {
  7695. delete obj[key];
  7696. }
  7697. }
  7698. return obj;
  7699. }
  7700. // pkg/dist-src/merge.js
  7701. function merge(defaults, route, options) {
  7702. if (typeof route === "string") {
  7703. let [method, url] = route.split(" ");
  7704. options = Object.assign(url ? { method, url } : { url: method }, options);
  7705. } else {
  7706. options = Object.assign({}, route);
  7707. }
  7708. options.headers = lowercaseKeys(options.headers);
  7709. removeUndefinedProperties(options);
  7710. removeUndefinedProperties(options.headers);
  7711. const mergedOptions = mergeDeep(defaults || {}, options);
  7712. if (options.url === "/graphql") {
  7713. if (defaults && defaults.mediaType.previews?.length) {
  7714. mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(
  7715. (preview) => !mergedOptions.mediaType.previews.includes(preview)
  7716. ).concat(mergedOptions.mediaType.previews);
  7717. }
  7718. mergedOptions.mediaType.previews = (mergedOptions.mediaType.previews || []).map((preview) => preview.replace(/-preview/, ""));
  7719. }
  7720. return mergedOptions;
  7721. }
  7722. // pkg/dist-src/util/add-query-parameters.js
  7723. function addQueryParameters(url, parameters) {
  7724. const separator = /\?/.test(url) ? "&" : "?";
  7725. const names = Object.keys(parameters);
  7726. if (names.length === 0) {
  7727. return url;
  7728. }
  7729. return url + separator + names.map((name) => {
  7730. if (name === "q") {
  7731. return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+");
  7732. }
  7733. return `${name}=${encodeURIComponent(parameters[name])}`;
  7734. }).join("&");
  7735. }
  7736. // pkg/dist-src/util/extract-url-variable-names.js
  7737. var urlVariableRegex = /\{[^{}}]+\}/g;
  7738. function removeNonChars(variableName) {
  7739. return variableName.replace(/(?:^\W+)|(?:(?<!\W)\W+$)/g, "").split(/,/);
  7740. }
  7741. function extractUrlVariableNames(url) {
  7742. const matches = url.match(urlVariableRegex);
  7743. if (!matches) {
  7744. return [];
  7745. }
  7746. return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
  7747. }
  7748. // pkg/dist-src/util/omit.js
  7749. function omit(object, keysToOmit) {
  7750. const result = { __proto__: null };
  7751. for (const key of Object.keys(object)) {
  7752. if (keysToOmit.indexOf(key) === -1) {
  7753. result[key] = object[key];
  7754. }
  7755. }
  7756. return result;
  7757. }
  7758. // pkg/dist-src/util/url-template.js
  7759. function encodeReserved(str) {
  7760. return str.split(/(%[0-9A-Fa-f]{2})/g).map(function(part) {
  7761. if (!/%[0-9A-Fa-f]/.test(part)) {
  7762. part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]");
  7763. }
  7764. return part;
  7765. }).join("");
  7766. }
  7767. function encodeUnreserved(str) {
  7768. return encodeURIComponent(str).replace(/[!'()*]/g, function(c) {
  7769. return "%" + c.charCodeAt(0).toString(16).toUpperCase();
  7770. });
  7771. }
  7772. function encodeValue(operator, value, key) {
  7773. value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value);
  7774. if (key) {
  7775. return encodeUnreserved(key) + "=" + value;
  7776. } else {
  7777. return value;
  7778. }
  7779. }
  7780. function isDefined(value) {
  7781. return value !== void 0 && value !== null;
  7782. }
  7783. function isKeyOperator(operator) {
  7784. return operator === ";" || operator === "&" || operator === "?";
  7785. }
  7786. function getValues(context, operator, key, modifier) {
  7787. var value = context[key], result = [];
  7788. if (isDefined(value) && value !== "") {
  7789. if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
  7790. value = value.toString();
  7791. if (modifier && modifier !== "*") {
  7792. value = value.substring(0, parseInt(modifier, 10));
  7793. }
  7794. result.push(
  7795. encodeValue(operator, value, isKeyOperator(operator) ? key : "")
  7796. );
  7797. } else {
  7798. if (modifier === "*") {
  7799. if (Array.isArray(value)) {
  7800. value.filter(isDefined).forEach(function(value2) {
  7801. result.push(
  7802. encodeValue(operator, value2, isKeyOperator(operator) ? key : "")
  7803. );
  7804. });
  7805. } else {
  7806. Object.keys(value).forEach(function(k) {
  7807. if (isDefined(value[k])) {
  7808. result.push(encodeValue(operator, value[k], k));
  7809. }
  7810. });
  7811. }
  7812. } else {
  7813. const tmp = [];
  7814. if (Array.isArray(value)) {
  7815. value.filter(isDefined).forEach(function(value2) {
  7816. tmp.push(encodeValue(operator, value2));
  7817. });
  7818. } else {
  7819. Object.keys(value).forEach(function(k) {
  7820. if (isDefined(value[k])) {
  7821. tmp.push(encodeUnreserved(k));
  7822. tmp.push(encodeValue(operator, value[k].toString()));
  7823. }
  7824. });
  7825. }
  7826. if (isKeyOperator(operator)) {
  7827. result.push(encodeUnreserved(key) + "=" + tmp.join(","));
  7828. } else if (tmp.length !== 0) {
  7829. result.push(tmp.join(","));
  7830. }
  7831. }
  7832. }
  7833. } else {
  7834. if (operator === ";") {
  7835. if (isDefined(value)) {
  7836. result.push(encodeUnreserved(key));
  7837. }
  7838. } else if (value === "" && (operator === "&" || operator === "?")) {
  7839. result.push(encodeUnreserved(key) + "=");
  7840. } else if (value === "") {
  7841. result.push("");
  7842. }
  7843. }
  7844. return result;
  7845. }
  7846. function parseUrl(template) {
  7847. return {
  7848. expand: expand.bind(null, template)
  7849. };
  7850. }
  7851. function expand(template, context) {
  7852. var operators = ["+", "#", ".", "/", ";", "?", "&"];
  7853. template = template.replace(
  7854. /\{([^\{\}]+)\}|([^\{\}]+)/g,
  7855. function(_, expression, literal) {
  7856. if (expression) {
  7857. let operator = "";
  7858. const values = [];
  7859. if (operators.indexOf(expression.charAt(0)) !== -1) {
  7860. operator = expression.charAt(0);
  7861. expression = expression.substr(1);
  7862. }
  7863. expression.split(/,/g).forEach(function(variable) {
  7864. var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
  7865. values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
  7866. });
  7867. if (operator && operator !== "+") {
  7868. var separator = ",";
  7869. if (operator === "?") {
  7870. separator = "&";
  7871. } else if (operator !== "#") {
  7872. separator = operator;
  7873. }
  7874. return (values.length !== 0 ? operator : "") + values.join(separator);
  7875. } else {
  7876. return values.join(",");
  7877. }
  7878. } else {
  7879. return encodeReserved(literal);
  7880. }
  7881. }
  7882. );
  7883. if (template === "/") {
  7884. return template;
  7885. } else {
  7886. return template.replace(/\/$/, "");
  7887. }
  7888. }
  7889. // pkg/dist-src/parse.js
  7890. function parse(options) {
  7891. let method = options.method.toUpperCase();
  7892. let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{$1}");
  7893. let headers = Object.assign({}, options.headers);
  7894. let body;
  7895. let parameters = omit(options, [
  7896. "method",
  7897. "baseUrl",
  7898. "url",
  7899. "headers",
  7900. "request",
  7901. "mediaType"
  7902. ]);
  7903. const urlVariableNames = extractUrlVariableNames(url);
  7904. url = parseUrl(url).expand(parameters);
  7905. if (!/^http/.test(url)) {
  7906. url = options.baseUrl + url;
  7907. }
  7908. const omittedParameters = Object.keys(options).filter((option) => urlVariableNames.includes(option)).concat("baseUrl");
  7909. const remainingParameters = omit(parameters, omittedParameters);
  7910. const isBinaryRequest = /application\/octet-stream/i.test(headers.accept);
  7911. if (!isBinaryRequest) {
  7912. if (options.mediaType.format) {
  7913. headers.accept = headers.accept.split(/,/).map(
  7914. (format) => format.replace(
  7915. /application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,
  7916. `application/vnd$1$2.${options.mediaType.format}`
  7917. )
  7918. ).join(",");
  7919. }
  7920. if (url.endsWith("/graphql")) {
  7921. if (options.mediaType.previews?.length) {
  7922. const previewsFromAcceptHeader = headers.accept.match(/(?<![\w-])[\w-]+(?=-preview)/g) || [];
  7923. headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map((preview) => {
  7924. const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json";
  7925. return `application/vnd.github.${preview}-preview${format}`;
  7926. }).join(",");
  7927. }
  7928. }
  7929. }
  7930. if (["GET", "HEAD"].includes(method)) {
  7931. url = addQueryParameters(url, remainingParameters);
  7932. } else {
  7933. if ("data" in remainingParameters) {
  7934. body = remainingParameters.data;
  7935. } else {
  7936. if (Object.keys(remainingParameters).length) {
  7937. body = remainingParameters;
  7938. }
  7939. }
  7940. }
  7941. if (!headers["content-type"] && typeof body !== "undefined") {
  7942. headers["content-type"] = "application/json; charset=utf-8";
  7943. }
  7944. if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") {
  7945. body = "";
  7946. }
  7947. return Object.assign(
  7948. { method, url, headers },
  7949. typeof body !== "undefined" ? { body } : null,
  7950. options.request ? { request: options.request } : null
  7951. );
  7952. }
  7953. // pkg/dist-src/endpoint-with-defaults.js
  7954. function endpointWithDefaults(defaults, route, options) {
  7955. return parse(merge(defaults, route, options));
  7956. }
  7957. // pkg/dist-src/with-defaults.js
  7958. function withDefaults(oldDefaults, newDefaults) {
  7959. const DEFAULTS2 = merge(oldDefaults, newDefaults);
  7960. const endpoint2 = endpointWithDefaults.bind(null, DEFAULTS2);
  7961. return Object.assign(endpoint2, {
  7962. DEFAULTS: DEFAULTS2,
  7963. defaults: withDefaults.bind(null, DEFAULTS2),
  7964. merge: merge.bind(null, DEFAULTS2),
  7965. parse
  7966. });
  7967. }
  7968. // pkg/dist-src/index.js
  7969. var endpoint = withDefaults(null, DEFAULTS);
  7970. // Annotate the CommonJS export names for ESM import in node:
  7971. 0 && (0);
  7972. /***/ }),
  7973. /***/ 8467:
  7974. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  7975. "use strict";
  7976. var __defProp = Object.defineProperty;
  7977. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  7978. var __getOwnPropNames = Object.getOwnPropertyNames;
  7979. var __hasOwnProp = Object.prototype.hasOwnProperty;
  7980. var __export = (target, all) => {
  7981. for (var name in all)
  7982. __defProp(target, name, { get: all[name], enumerable: true });
  7983. };
  7984. var __copyProps = (to, from, except, desc) => {
  7985. if (from && typeof from === "object" || typeof from === "function") {
  7986. for (let key of __getOwnPropNames(from))
  7987. if (!__hasOwnProp.call(to, key) && key !== except)
  7988. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  7989. }
  7990. return to;
  7991. };
  7992. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  7993. // pkg/dist-src/index.js
  7994. var dist_src_exports = {};
  7995. __export(dist_src_exports, {
  7996. GraphqlResponseError: () => GraphqlResponseError,
  7997. graphql: () => graphql2,
  7998. withCustomRequest: () => withCustomRequest
  7999. });
  8000. module.exports = __toCommonJS(dist_src_exports);
  8001. var import_request3 = __nccwpck_require__(6234);
  8002. var import_universal_user_agent = __nccwpck_require__(5030);
  8003. // pkg/dist-src/version.js
  8004. var VERSION = "7.1.0";
  8005. // pkg/dist-src/with-defaults.js
  8006. var import_request2 = __nccwpck_require__(6234);
  8007. // pkg/dist-src/graphql.js
  8008. var import_request = __nccwpck_require__(6234);
  8009. // pkg/dist-src/error.js
  8010. function _buildMessageForResponseErrors(data) {
  8011. return `Request failed due to following response errors:
  8012. ` + data.errors.map((e) => ` - ${e.message}`).join("\n");
  8013. }
  8014. var GraphqlResponseError = class extends Error {
  8015. constructor(request2, headers, response) {
  8016. super(_buildMessageForResponseErrors(response));
  8017. this.request = request2;
  8018. this.headers = headers;
  8019. this.response = response;
  8020. this.name = "GraphqlResponseError";
  8021. this.errors = response.errors;
  8022. this.data = response.data;
  8023. if (Error.captureStackTrace) {
  8024. Error.captureStackTrace(this, this.constructor);
  8025. }
  8026. }
  8027. };
  8028. // pkg/dist-src/graphql.js
  8029. var NON_VARIABLE_OPTIONS = [
  8030. "method",
  8031. "baseUrl",
  8032. "url",
  8033. "headers",
  8034. "request",
  8035. "query",
  8036. "mediaType"
  8037. ];
  8038. var FORBIDDEN_VARIABLE_OPTIONS = ["query", "method", "url"];
  8039. var GHES_V3_SUFFIX_REGEX = /\/api\/v3\/?$/;
  8040. function graphql(request2, query, options) {
  8041. if (options) {
  8042. if (typeof query === "string" && "query" in options) {
  8043. return Promise.reject(
  8044. new Error(`[@octokit/graphql] "query" cannot be used as variable name`)
  8045. );
  8046. }
  8047. for (const key in options) {
  8048. if (!FORBIDDEN_VARIABLE_OPTIONS.includes(key))
  8049. continue;
  8050. return Promise.reject(
  8051. new Error(
  8052. `[@octokit/graphql] "${key}" cannot be used as variable name`
  8053. )
  8054. );
  8055. }
  8056. }
  8057. const parsedOptions = typeof query === "string" ? Object.assign({ query }, options) : query;
  8058. const requestOptions = Object.keys(
  8059. parsedOptions
  8060. ).reduce((result, key) => {
  8061. if (NON_VARIABLE_OPTIONS.includes(key)) {
  8062. result[key] = parsedOptions[key];
  8063. return result;
  8064. }
  8065. if (!result.variables) {
  8066. result.variables = {};
  8067. }
  8068. result.variables[key] = parsedOptions[key];
  8069. return result;
  8070. }, {});
  8071. const baseUrl = parsedOptions.baseUrl || request2.endpoint.DEFAULTS.baseUrl;
  8072. if (GHES_V3_SUFFIX_REGEX.test(baseUrl)) {
  8073. requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX, "/api/graphql");
  8074. }
  8075. return request2(requestOptions).then((response) => {
  8076. if (response.data.errors) {
  8077. const headers = {};
  8078. for (const key of Object.keys(response.headers)) {
  8079. headers[key] = response.headers[key];
  8080. }
  8081. throw new GraphqlResponseError(
  8082. requestOptions,
  8083. headers,
  8084. response.data
  8085. );
  8086. }
  8087. return response.data.data;
  8088. });
  8089. }
  8090. // pkg/dist-src/with-defaults.js
  8091. function withDefaults(request2, newDefaults) {
  8092. const newRequest = request2.defaults(newDefaults);
  8093. const newApi = (query, options) => {
  8094. return graphql(newRequest, query, options);
  8095. };
  8096. return Object.assign(newApi, {
  8097. defaults: withDefaults.bind(null, newRequest),
  8098. endpoint: newRequest.endpoint
  8099. });
  8100. }
  8101. // pkg/dist-src/index.js
  8102. var graphql2 = withDefaults(import_request3.request, {
  8103. headers: {
  8104. "user-agent": `octokit-graphql.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`
  8105. },
  8106. method: "POST",
  8107. url: "/graphql"
  8108. });
  8109. function withCustomRequest(customRequest) {
  8110. return withDefaults(customRequest, {
  8111. method: "POST",
  8112. url: "/graphql"
  8113. });
  8114. }
  8115. // Annotate the CommonJS export names for ESM import in node:
  8116. 0 && (0);
  8117. /***/ }),
  8118. /***/ 4193:
  8119. /***/ ((module) => {
  8120. "use strict";
  8121. var __defProp = Object.defineProperty;
  8122. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  8123. var __getOwnPropNames = Object.getOwnPropertyNames;
  8124. var __hasOwnProp = Object.prototype.hasOwnProperty;
  8125. var __export = (target, all) => {
  8126. for (var name in all)
  8127. __defProp(target, name, { get: all[name], enumerable: true });
  8128. };
  8129. var __copyProps = (to, from, except, desc) => {
  8130. if (from && typeof from === "object" || typeof from === "function") {
  8131. for (let key of __getOwnPropNames(from))
  8132. if (!__hasOwnProp.call(to, key) && key !== except)
  8133. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  8134. }
  8135. return to;
  8136. };
  8137. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  8138. // pkg/dist-src/index.js
  8139. var dist_src_exports = {};
  8140. __export(dist_src_exports, {
  8141. composePaginateRest: () => composePaginateRest,
  8142. isPaginatingEndpoint: () => isPaginatingEndpoint,
  8143. paginateRest: () => paginateRest,
  8144. paginatingEndpoints: () => paginatingEndpoints
  8145. });
  8146. module.exports = __toCommonJS(dist_src_exports);
  8147. // pkg/dist-src/version.js
  8148. var VERSION = "9.2.2";
  8149. // pkg/dist-src/normalize-paginated-list-response.js
  8150. function normalizePaginatedListResponse(response) {
  8151. if (!response.data) {
  8152. return {
  8153. ...response,
  8154. data: []
  8155. };
  8156. }
  8157. const responseNeedsNormalization = "total_count" in response.data && !("url" in response.data);
  8158. if (!responseNeedsNormalization)
  8159. return response;
  8160. const incompleteResults = response.data.incomplete_results;
  8161. const repositorySelection = response.data.repository_selection;
  8162. const totalCount = response.data.total_count;
  8163. delete response.data.incomplete_results;
  8164. delete response.data.repository_selection;
  8165. delete response.data.total_count;
  8166. const namespaceKey = Object.keys(response.data)[0];
  8167. const data = response.data[namespaceKey];
  8168. response.data = data;
  8169. if (typeof incompleteResults !== "undefined") {
  8170. response.data.incomplete_results = incompleteResults;
  8171. }
  8172. if (typeof repositorySelection !== "undefined") {
  8173. response.data.repository_selection = repositorySelection;
  8174. }
  8175. response.data.total_count = totalCount;
  8176. return response;
  8177. }
  8178. // pkg/dist-src/iterator.js
  8179. function iterator(octokit, route, parameters) {
  8180. const options = typeof route === "function" ? route.endpoint(parameters) : octokit.request.endpoint(route, parameters);
  8181. const requestMethod = typeof route === "function" ? route : octokit.request;
  8182. const method = options.method;
  8183. const headers = options.headers;
  8184. let url = options.url;
  8185. return {
  8186. [Symbol.asyncIterator]: () => ({
  8187. async next() {
  8188. if (!url)
  8189. return { done: true };
  8190. try {
  8191. const response = await requestMethod({ method, url, headers });
  8192. const normalizedResponse = normalizePaginatedListResponse(response);
  8193. url = ((normalizedResponse.headers.link || "").match(
  8194. /<([^<>]+)>;\s*rel="next"/
  8195. ) || [])[1];
  8196. return { value: normalizedResponse };
  8197. } catch (error) {
  8198. if (error.status !== 409)
  8199. throw error;
  8200. url = "";
  8201. return {
  8202. value: {
  8203. status: 200,
  8204. headers: {},
  8205. data: []
  8206. }
  8207. };
  8208. }
  8209. }
  8210. })
  8211. };
  8212. }
  8213. // pkg/dist-src/paginate.js
  8214. function paginate(octokit, route, parameters, mapFn) {
  8215. if (typeof parameters === "function") {
  8216. mapFn = parameters;
  8217. parameters = void 0;
  8218. }
  8219. return gather(
  8220. octokit,
  8221. [],
  8222. iterator(octokit, route, parameters)[Symbol.asyncIterator](),
  8223. mapFn
  8224. );
  8225. }
  8226. function gather(octokit, results, iterator2, mapFn) {
  8227. return iterator2.next().then((result) => {
  8228. if (result.done) {
  8229. return results;
  8230. }
  8231. let earlyExit = false;
  8232. function done() {
  8233. earlyExit = true;
  8234. }
  8235. results = results.concat(
  8236. mapFn ? mapFn(result.value, done) : result.value.data
  8237. );
  8238. if (earlyExit) {
  8239. return results;
  8240. }
  8241. return gather(octokit, results, iterator2, mapFn);
  8242. });
  8243. }
  8244. // pkg/dist-src/compose-paginate.js
  8245. var composePaginateRest = Object.assign(paginate, {
  8246. iterator
  8247. });
  8248. // pkg/dist-src/generated/paginating-endpoints.js
  8249. var paginatingEndpoints = [
  8250. "GET /advisories",
  8251. "GET /app/hook/deliveries",
  8252. "GET /app/installation-requests",
  8253. "GET /app/installations",
  8254. "GET /assignments/{assignment_id}/accepted_assignments",
  8255. "GET /classrooms",
  8256. "GET /classrooms/{classroom_id}/assignments",
  8257. "GET /enterprises/{enterprise}/dependabot/alerts",
  8258. "GET /enterprises/{enterprise}/secret-scanning/alerts",
  8259. "GET /events",
  8260. "GET /gists",
  8261. "GET /gists/public",
  8262. "GET /gists/starred",
  8263. "GET /gists/{gist_id}/comments",
  8264. "GET /gists/{gist_id}/commits",
  8265. "GET /gists/{gist_id}/forks",
  8266. "GET /installation/repositories",
  8267. "GET /issues",
  8268. "GET /licenses",
  8269. "GET /marketplace_listing/plans",
  8270. "GET /marketplace_listing/plans/{plan_id}/accounts",
  8271. "GET /marketplace_listing/stubbed/plans",
  8272. "GET /marketplace_listing/stubbed/plans/{plan_id}/accounts",
  8273. "GET /networks/{owner}/{repo}/events",
  8274. "GET /notifications",
  8275. "GET /organizations",
  8276. "GET /orgs/{org}/actions/cache/usage-by-repository",
  8277. "GET /orgs/{org}/actions/permissions/repositories",
  8278. "GET /orgs/{org}/actions/runners",
  8279. "GET /orgs/{org}/actions/secrets",
  8280. "GET /orgs/{org}/actions/secrets/{secret_name}/repositories",
  8281. "GET /orgs/{org}/actions/variables",
  8282. "GET /orgs/{org}/actions/variables/{name}/repositories",
  8283. "GET /orgs/{org}/blocks",
  8284. "GET /orgs/{org}/code-scanning/alerts",
  8285. "GET /orgs/{org}/codespaces",
  8286. "GET /orgs/{org}/codespaces/secrets",
  8287. "GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories",
  8288. "GET /orgs/{org}/copilot/billing/seats",
  8289. "GET /orgs/{org}/dependabot/alerts",
  8290. "GET /orgs/{org}/dependabot/secrets",
  8291. "GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories",
  8292. "GET /orgs/{org}/events",
  8293. "GET /orgs/{org}/failed_invitations",
  8294. "GET /orgs/{org}/hooks",
  8295. "GET /orgs/{org}/hooks/{hook_id}/deliveries",
  8296. "GET /orgs/{org}/installations",
  8297. "GET /orgs/{org}/invitations",
  8298. "GET /orgs/{org}/invitations/{invitation_id}/teams",
  8299. "GET /orgs/{org}/issues",
  8300. "GET /orgs/{org}/members",
  8301. "GET /orgs/{org}/members/{username}/codespaces",
  8302. "GET /orgs/{org}/migrations",
  8303. "GET /orgs/{org}/migrations/{migration_id}/repositories",
  8304. "GET /orgs/{org}/organization-roles/{role_id}/teams",
  8305. "GET /orgs/{org}/organization-roles/{role_id}/users",
  8306. "GET /orgs/{org}/outside_collaborators",
  8307. "GET /orgs/{org}/packages",
  8308. "GET /orgs/{org}/packages/{package_type}/{package_name}/versions",
  8309. "GET /orgs/{org}/personal-access-token-requests",
  8310. "GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories",
  8311. "GET /orgs/{org}/personal-access-tokens",
  8312. "GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories",
  8313. "GET /orgs/{org}/projects",
  8314. "GET /orgs/{org}/properties/values",
  8315. "GET /orgs/{org}/public_members",
  8316. "GET /orgs/{org}/repos",
  8317. "GET /orgs/{org}/rulesets",
  8318. "GET /orgs/{org}/rulesets/rule-suites",
  8319. "GET /orgs/{org}/secret-scanning/alerts",
  8320. "GET /orgs/{org}/security-advisories",
  8321. "GET /orgs/{org}/teams",
  8322. "GET /orgs/{org}/teams/{team_slug}/discussions",
  8323. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments",
  8324. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions",
  8325. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions",
  8326. "GET /orgs/{org}/teams/{team_slug}/invitations",
  8327. "GET /orgs/{org}/teams/{team_slug}/members",
  8328. "GET /orgs/{org}/teams/{team_slug}/projects",
  8329. "GET /orgs/{org}/teams/{team_slug}/repos",
  8330. "GET /orgs/{org}/teams/{team_slug}/teams",
  8331. "GET /projects/columns/{column_id}/cards",
  8332. "GET /projects/{project_id}/collaborators",
  8333. "GET /projects/{project_id}/columns",
  8334. "GET /repos/{owner}/{repo}/actions/artifacts",
  8335. "GET /repos/{owner}/{repo}/actions/caches",
  8336. "GET /repos/{owner}/{repo}/actions/organization-secrets",
  8337. "GET /repos/{owner}/{repo}/actions/organization-variables",
  8338. "GET /repos/{owner}/{repo}/actions/runners",
  8339. "GET /repos/{owner}/{repo}/actions/runs",
  8340. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts",
  8341. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs",
  8342. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs",
  8343. "GET /repos/{owner}/{repo}/actions/secrets",
  8344. "GET /repos/{owner}/{repo}/actions/variables",
  8345. "GET /repos/{owner}/{repo}/actions/workflows",
  8346. "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs",
  8347. "GET /repos/{owner}/{repo}/activity",
  8348. "GET /repos/{owner}/{repo}/assignees",
  8349. "GET /repos/{owner}/{repo}/branches",
  8350. "GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations",
  8351. "GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs",
  8352. "GET /repos/{owner}/{repo}/code-scanning/alerts",
  8353. "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances",
  8354. "GET /repos/{owner}/{repo}/code-scanning/analyses",
  8355. "GET /repos/{owner}/{repo}/codespaces",
  8356. "GET /repos/{owner}/{repo}/codespaces/devcontainers",
  8357. "GET /repos/{owner}/{repo}/codespaces/secrets",
  8358. "GET /repos/{owner}/{repo}/collaborators",
  8359. "GET /repos/{owner}/{repo}/comments",
  8360. "GET /repos/{owner}/{repo}/comments/{comment_id}/reactions",
  8361. "GET /repos/{owner}/{repo}/commits",
  8362. "GET /repos/{owner}/{repo}/commits/{commit_sha}/comments",
  8363. "GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls",
  8364. "GET /repos/{owner}/{repo}/commits/{ref}/check-runs",
  8365. "GET /repos/{owner}/{repo}/commits/{ref}/check-suites",
  8366. "GET /repos/{owner}/{repo}/commits/{ref}/status",
  8367. "GET /repos/{owner}/{repo}/commits/{ref}/statuses",
  8368. "GET /repos/{owner}/{repo}/contributors",
  8369. "GET /repos/{owner}/{repo}/dependabot/alerts",
  8370. "GET /repos/{owner}/{repo}/dependabot/secrets",
  8371. "GET /repos/{owner}/{repo}/deployments",
  8372. "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses",
  8373. "GET /repos/{owner}/{repo}/environments",
  8374. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies",
  8375. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps",
  8376. "GET /repos/{owner}/{repo}/events",
  8377. "GET /repos/{owner}/{repo}/forks",
  8378. "GET /repos/{owner}/{repo}/hooks",
  8379. "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries",
  8380. "GET /repos/{owner}/{repo}/invitations",
  8381. "GET /repos/{owner}/{repo}/issues",
  8382. "GET /repos/{owner}/{repo}/issues/comments",
  8383. "GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions",
  8384. "GET /repos/{owner}/{repo}/issues/events",
  8385. "GET /repos/{owner}/{repo}/issues/{issue_number}/comments",
  8386. "GET /repos/{owner}/{repo}/issues/{issue_number}/events",
  8387. "GET /repos/{owner}/{repo}/issues/{issue_number}/labels",
  8388. "GET /repos/{owner}/{repo}/issues/{issue_number}/reactions",
  8389. "GET /repos/{owner}/{repo}/issues/{issue_number}/timeline",
  8390. "GET /repos/{owner}/{repo}/keys",
  8391. "GET /repos/{owner}/{repo}/labels",
  8392. "GET /repos/{owner}/{repo}/milestones",
  8393. "GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels",
  8394. "GET /repos/{owner}/{repo}/notifications",
  8395. "GET /repos/{owner}/{repo}/pages/builds",
  8396. "GET /repos/{owner}/{repo}/projects",
  8397. "GET /repos/{owner}/{repo}/pulls",
  8398. "GET /repos/{owner}/{repo}/pulls/comments",
  8399. "GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions",
  8400. "GET /repos/{owner}/{repo}/pulls/{pull_number}/comments",
  8401. "GET /repos/{owner}/{repo}/pulls/{pull_number}/commits",
  8402. "GET /repos/{owner}/{repo}/pulls/{pull_number}/files",
  8403. "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews",
  8404. "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments",
  8405. "GET /repos/{owner}/{repo}/releases",
  8406. "GET /repos/{owner}/{repo}/releases/{release_id}/assets",
  8407. "GET /repos/{owner}/{repo}/releases/{release_id}/reactions",
  8408. "GET /repos/{owner}/{repo}/rules/branches/{branch}",
  8409. "GET /repos/{owner}/{repo}/rulesets",
  8410. "GET /repos/{owner}/{repo}/rulesets/rule-suites",
  8411. "GET /repos/{owner}/{repo}/secret-scanning/alerts",
  8412. "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations",
  8413. "GET /repos/{owner}/{repo}/security-advisories",
  8414. "GET /repos/{owner}/{repo}/stargazers",
  8415. "GET /repos/{owner}/{repo}/subscribers",
  8416. "GET /repos/{owner}/{repo}/tags",
  8417. "GET /repos/{owner}/{repo}/teams",
  8418. "GET /repos/{owner}/{repo}/topics",
  8419. "GET /repositories",
  8420. "GET /repositories/{repository_id}/environments/{environment_name}/secrets",
  8421. "GET /repositories/{repository_id}/environments/{environment_name}/variables",
  8422. "GET /search/code",
  8423. "GET /search/commits",
  8424. "GET /search/issues",
  8425. "GET /search/labels",
  8426. "GET /search/repositories",
  8427. "GET /search/topics",
  8428. "GET /search/users",
  8429. "GET /teams/{team_id}/discussions",
  8430. "GET /teams/{team_id}/discussions/{discussion_number}/comments",
  8431. "GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions",
  8432. "GET /teams/{team_id}/discussions/{discussion_number}/reactions",
  8433. "GET /teams/{team_id}/invitations",
  8434. "GET /teams/{team_id}/members",
  8435. "GET /teams/{team_id}/projects",
  8436. "GET /teams/{team_id}/repos",
  8437. "GET /teams/{team_id}/teams",
  8438. "GET /user/blocks",
  8439. "GET /user/codespaces",
  8440. "GET /user/codespaces/secrets",
  8441. "GET /user/emails",
  8442. "GET /user/followers",
  8443. "GET /user/following",
  8444. "GET /user/gpg_keys",
  8445. "GET /user/installations",
  8446. "GET /user/installations/{installation_id}/repositories",
  8447. "GET /user/issues",
  8448. "GET /user/keys",
  8449. "GET /user/marketplace_purchases",
  8450. "GET /user/marketplace_purchases/stubbed",
  8451. "GET /user/memberships/orgs",
  8452. "GET /user/migrations",
  8453. "GET /user/migrations/{migration_id}/repositories",
  8454. "GET /user/orgs",
  8455. "GET /user/packages",
  8456. "GET /user/packages/{package_type}/{package_name}/versions",
  8457. "GET /user/public_emails",
  8458. "GET /user/repos",
  8459. "GET /user/repository_invitations",
  8460. "GET /user/social_accounts",
  8461. "GET /user/ssh_signing_keys",
  8462. "GET /user/starred",
  8463. "GET /user/subscriptions",
  8464. "GET /user/teams",
  8465. "GET /users",
  8466. "GET /users/{username}/events",
  8467. "GET /users/{username}/events/orgs/{org}",
  8468. "GET /users/{username}/events/public",
  8469. "GET /users/{username}/followers",
  8470. "GET /users/{username}/following",
  8471. "GET /users/{username}/gists",
  8472. "GET /users/{username}/gpg_keys",
  8473. "GET /users/{username}/keys",
  8474. "GET /users/{username}/orgs",
  8475. "GET /users/{username}/packages",
  8476. "GET /users/{username}/projects",
  8477. "GET /users/{username}/received_events",
  8478. "GET /users/{username}/received_events/public",
  8479. "GET /users/{username}/repos",
  8480. "GET /users/{username}/social_accounts",
  8481. "GET /users/{username}/ssh_signing_keys",
  8482. "GET /users/{username}/starred",
  8483. "GET /users/{username}/subscriptions"
  8484. ];
  8485. // pkg/dist-src/paginating-endpoints.js
  8486. function isPaginatingEndpoint(arg) {
  8487. if (typeof arg === "string") {
  8488. return paginatingEndpoints.includes(arg);
  8489. } else {
  8490. return false;
  8491. }
  8492. }
  8493. // pkg/dist-src/index.js
  8494. function paginateRest(octokit) {
  8495. return {
  8496. paginate: Object.assign(paginate.bind(null, octokit), {
  8497. iterator: iterator.bind(null, octokit)
  8498. })
  8499. };
  8500. }
  8501. paginateRest.VERSION = VERSION;
  8502. // Annotate the CommonJS export names for ESM import in node:
  8503. 0 && (0);
  8504. /***/ }),
  8505. /***/ 3044:
  8506. /***/ ((module) => {
  8507. "use strict";
  8508. var __defProp = Object.defineProperty;
  8509. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  8510. var __getOwnPropNames = Object.getOwnPropertyNames;
  8511. var __hasOwnProp = Object.prototype.hasOwnProperty;
  8512. var __export = (target, all) => {
  8513. for (var name in all)
  8514. __defProp(target, name, { get: all[name], enumerable: true });
  8515. };
  8516. var __copyProps = (to, from, except, desc) => {
  8517. if (from && typeof from === "object" || typeof from === "function") {
  8518. for (let key of __getOwnPropNames(from))
  8519. if (!__hasOwnProp.call(to, key) && key !== except)
  8520. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  8521. }
  8522. return to;
  8523. };
  8524. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  8525. // pkg/dist-src/index.js
  8526. var dist_src_exports = {};
  8527. __export(dist_src_exports, {
  8528. legacyRestEndpointMethods: () => legacyRestEndpointMethods,
  8529. restEndpointMethods: () => restEndpointMethods
  8530. });
  8531. module.exports = __toCommonJS(dist_src_exports);
  8532. // pkg/dist-src/version.js
  8533. var VERSION = "10.4.1";
  8534. // pkg/dist-src/generated/endpoints.js
  8535. var Endpoints = {
  8536. actions: {
  8537. addCustomLabelsToSelfHostedRunnerForOrg: [
  8538. "POST /orgs/{org}/actions/runners/{runner_id}/labels"
  8539. ],
  8540. addCustomLabelsToSelfHostedRunnerForRepo: [
  8541. "POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
  8542. ],
  8543. addSelectedRepoToOrgSecret: [
  8544. "PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"
  8545. ],
  8546. addSelectedRepoToOrgVariable: [
  8547. "PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"
  8548. ],
  8549. approveWorkflowRun: [
  8550. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve"
  8551. ],
  8552. cancelWorkflowRun: [
  8553. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel"
  8554. ],
  8555. createEnvironmentVariable: [
  8556. "POST /repositories/{repository_id}/environments/{environment_name}/variables"
  8557. ],
  8558. createOrUpdateEnvironmentSecret: [
  8559. "PUT /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"
  8560. ],
  8561. createOrUpdateOrgSecret: ["PUT /orgs/{org}/actions/secrets/{secret_name}"],
  8562. createOrUpdateRepoSecret: [
  8563. "PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}"
  8564. ],
  8565. createOrgVariable: ["POST /orgs/{org}/actions/variables"],
  8566. createRegistrationTokenForOrg: [
  8567. "POST /orgs/{org}/actions/runners/registration-token"
  8568. ],
  8569. createRegistrationTokenForRepo: [
  8570. "POST /repos/{owner}/{repo}/actions/runners/registration-token"
  8571. ],
  8572. createRemoveTokenForOrg: ["POST /orgs/{org}/actions/runners/remove-token"],
  8573. createRemoveTokenForRepo: [
  8574. "POST /repos/{owner}/{repo}/actions/runners/remove-token"
  8575. ],
  8576. createRepoVariable: ["POST /repos/{owner}/{repo}/actions/variables"],
  8577. createWorkflowDispatch: [
  8578. "POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches"
  8579. ],
  8580. deleteActionsCacheById: [
  8581. "DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}"
  8582. ],
  8583. deleteActionsCacheByKey: [
  8584. "DELETE /repos/{owner}/{repo}/actions/caches{?key,ref}"
  8585. ],
  8586. deleteArtifact: [
  8587. "DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"
  8588. ],
  8589. deleteEnvironmentSecret: [
  8590. "DELETE /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"
  8591. ],
  8592. deleteEnvironmentVariable: [
  8593. "DELETE /repositories/{repository_id}/environments/{environment_name}/variables/{name}"
  8594. ],
  8595. deleteOrgSecret: ["DELETE /orgs/{org}/actions/secrets/{secret_name}"],
  8596. deleteOrgVariable: ["DELETE /orgs/{org}/actions/variables/{name}"],
  8597. deleteRepoSecret: [
  8598. "DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}"
  8599. ],
  8600. deleteRepoVariable: [
  8601. "DELETE /repos/{owner}/{repo}/actions/variables/{name}"
  8602. ],
  8603. deleteSelfHostedRunnerFromOrg: [
  8604. "DELETE /orgs/{org}/actions/runners/{runner_id}"
  8605. ],
  8606. deleteSelfHostedRunnerFromRepo: [
  8607. "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}"
  8608. ],
  8609. deleteWorkflowRun: ["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}"],
  8610. deleteWorkflowRunLogs: [
  8611. "DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs"
  8612. ],
  8613. disableSelectedRepositoryGithubActionsOrganization: [
  8614. "DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}"
  8615. ],
  8616. disableWorkflow: [
  8617. "PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable"
  8618. ],
  8619. downloadArtifact: [
  8620. "GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}"
  8621. ],
  8622. downloadJobLogsForWorkflowRun: [
  8623. "GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs"
  8624. ],
  8625. downloadWorkflowRunAttemptLogs: [
  8626. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs"
  8627. ],
  8628. downloadWorkflowRunLogs: [
  8629. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs"
  8630. ],
  8631. enableSelectedRepositoryGithubActionsOrganization: [
  8632. "PUT /orgs/{org}/actions/permissions/repositories/{repository_id}"
  8633. ],
  8634. enableWorkflow: [
  8635. "PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable"
  8636. ],
  8637. forceCancelWorkflowRun: [
  8638. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/force-cancel"
  8639. ],
  8640. generateRunnerJitconfigForOrg: [
  8641. "POST /orgs/{org}/actions/runners/generate-jitconfig"
  8642. ],
  8643. generateRunnerJitconfigForRepo: [
  8644. "POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig"
  8645. ],
  8646. getActionsCacheList: ["GET /repos/{owner}/{repo}/actions/caches"],
  8647. getActionsCacheUsage: ["GET /repos/{owner}/{repo}/actions/cache/usage"],
  8648. getActionsCacheUsageByRepoForOrg: [
  8649. "GET /orgs/{org}/actions/cache/usage-by-repository"
  8650. ],
  8651. getActionsCacheUsageForOrg: ["GET /orgs/{org}/actions/cache/usage"],
  8652. getAllowedActionsOrganization: [
  8653. "GET /orgs/{org}/actions/permissions/selected-actions"
  8654. ],
  8655. getAllowedActionsRepository: [
  8656. "GET /repos/{owner}/{repo}/actions/permissions/selected-actions"
  8657. ],
  8658. getArtifact: ["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"],
  8659. getCustomOidcSubClaimForRepo: [
  8660. "GET /repos/{owner}/{repo}/actions/oidc/customization/sub"
  8661. ],
  8662. getEnvironmentPublicKey: [
  8663. "GET /repositories/{repository_id}/environments/{environment_name}/secrets/public-key"
  8664. ],
  8665. getEnvironmentSecret: [
  8666. "GET /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"
  8667. ],
  8668. getEnvironmentVariable: [
  8669. "GET /repositories/{repository_id}/environments/{environment_name}/variables/{name}"
  8670. ],
  8671. getGithubActionsDefaultWorkflowPermissionsOrganization: [
  8672. "GET /orgs/{org}/actions/permissions/workflow"
  8673. ],
  8674. getGithubActionsDefaultWorkflowPermissionsRepository: [
  8675. "GET /repos/{owner}/{repo}/actions/permissions/workflow"
  8676. ],
  8677. getGithubActionsPermissionsOrganization: [
  8678. "GET /orgs/{org}/actions/permissions"
  8679. ],
  8680. getGithubActionsPermissionsRepository: [
  8681. "GET /repos/{owner}/{repo}/actions/permissions"
  8682. ],
  8683. getJobForWorkflowRun: ["GET /repos/{owner}/{repo}/actions/jobs/{job_id}"],
  8684. getOrgPublicKey: ["GET /orgs/{org}/actions/secrets/public-key"],
  8685. getOrgSecret: ["GET /orgs/{org}/actions/secrets/{secret_name}"],
  8686. getOrgVariable: ["GET /orgs/{org}/actions/variables/{name}"],
  8687. getPendingDeploymentsForRun: [
  8688. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"
  8689. ],
  8690. getRepoPermissions: [
  8691. "GET /repos/{owner}/{repo}/actions/permissions",
  8692. {},
  8693. { renamed: ["actions", "getGithubActionsPermissionsRepository"] }
  8694. ],
  8695. getRepoPublicKey: ["GET /repos/{owner}/{repo}/actions/secrets/public-key"],
  8696. getRepoSecret: ["GET /repos/{owner}/{repo}/actions/secrets/{secret_name}"],
  8697. getRepoVariable: ["GET /repos/{owner}/{repo}/actions/variables/{name}"],
  8698. getReviewsForRun: [
  8699. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals"
  8700. ],
  8701. getSelfHostedRunnerForOrg: ["GET /orgs/{org}/actions/runners/{runner_id}"],
  8702. getSelfHostedRunnerForRepo: [
  8703. "GET /repos/{owner}/{repo}/actions/runners/{runner_id}"
  8704. ],
  8705. getWorkflow: ["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}"],
  8706. getWorkflowAccessToRepository: [
  8707. "GET /repos/{owner}/{repo}/actions/permissions/access"
  8708. ],
  8709. getWorkflowRun: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}"],
  8710. getWorkflowRunAttempt: [
  8711. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}"
  8712. ],
  8713. getWorkflowRunUsage: [
  8714. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing"
  8715. ],
  8716. getWorkflowUsage: [
  8717. "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing"
  8718. ],
  8719. listArtifactsForRepo: ["GET /repos/{owner}/{repo}/actions/artifacts"],
  8720. listEnvironmentSecrets: [
  8721. "GET /repositories/{repository_id}/environments/{environment_name}/secrets"
  8722. ],
  8723. listEnvironmentVariables: [
  8724. "GET /repositories/{repository_id}/environments/{environment_name}/variables"
  8725. ],
  8726. listJobsForWorkflowRun: [
  8727. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs"
  8728. ],
  8729. listJobsForWorkflowRunAttempt: [
  8730. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs"
  8731. ],
  8732. listLabelsForSelfHostedRunnerForOrg: [
  8733. "GET /orgs/{org}/actions/runners/{runner_id}/labels"
  8734. ],
  8735. listLabelsForSelfHostedRunnerForRepo: [
  8736. "GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
  8737. ],
  8738. listOrgSecrets: ["GET /orgs/{org}/actions/secrets"],
  8739. listOrgVariables: ["GET /orgs/{org}/actions/variables"],
  8740. listRepoOrganizationSecrets: [
  8741. "GET /repos/{owner}/{repo}/actions/organization-secrets"
  8742. ],
  8743. listRepoOrganizationVariables: [
  8744. "GET /repos/{owner}/{repo}/actions/organization-variables"
  8745. ],
  8746. listRepoSecrets: ["GET /repos/{owner}/{repo}/actions/secrets"],
  8747. listRepoVariables: ["GET /repos/{owner}/{repo}/actions/variables"],
  8748. listRepoWorkflows: ["GET /repos/{owner}/{repo}/actions/workflows"],
  8749. listRunnerApplicationsForOrg: ["GET /orgs/{org}/actions/runners/downloads"],
  8750. listRunnerApplicationsForRepo: [
  8751. "GET /repos/{owner}/{repo}/actions/runners/downloads"
  8752. ],
  8753. listSelectedReposForOrgSecret: [
  8754. "GET /orgs/{org}/actions/secrets/{secret_name}/repositories"
  8755. ],
  8756. listSelectedReposForOrgVariable: [
  8757. "GET /orgs/{org}/actions/variables/{name}/repositories"
  8758. ],
  8759. listSelectedRepositoriesEnabledGithubActionsOrganization: [
  8760. "GET /orgs/{org}/actions/permissions/repositories"
  8761. ],
  8762. listSelfHostedRunnersForOrg: ["GET /orgs/{org}/actions/runners"],
  8763. listSelfHostedRunnersForRepo: ["GET /repos/{owner}/{repo}/actions/runners"],
  8764. listWorkflowRunArtifacts: [
  8765. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts"
  8766. ],
  8767. listWorkflowRuns: [
  8768. "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs"
  8769. ],
  8770. listWorkflowRunsForRepo: ["GET /repos/{owner}/{repo}/actions/runs"],
  8771. reRunJobForWorkflowRun: [
  8772. "POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun"
  8773. ],
  8774. reRunWorkflow: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun"],
  8775. reRunWorkflowFailedJobs: [
  8776. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs"
  8777. ],
  8778. removeAllCustomLabelsFromSelfHostedRunnerForOrg: [
  8779. "DELETE /orgs/{org}/actions/runners/{runner_id}/labels"
  8780. ],
  8781. removeAllCustomLabelsFromSelfHostedRunnerForRepo: [
  8782. "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
  8783. ],
  8784. removeCustomLabelFromSelfHostedRunnerForOrg: [
  8785. "DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}"
  8786. ],
  8787. removeCustomLabelFromSelfHostedRunnerForRepo: [
  8788. "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name}"
  8789. ],
  8790. removeSelectedRepoFromOrgSecret: [
  8791. "DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"
  8792. ],
  8793. removeSelectedRepoFromOrgVariable: [
  8794. "DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"
  8795. ],
  8796. reviewCustomGatesForRun: [
  8797. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule"
  8798. ],
  8799. reviewPendingDeploymentsForRun: [
  8800. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"
  8801. ],
  8802. setAllowedActionsOrganization: [
  8803. "PUT /orgs/{org}/actions/permissions/selected-actions"
  8804. ],
  8805. setAllowedActionsRepository: [
  8806. "PUT /repos/{owner}/{repo}/actions/permissions/selected-actions"
  8807. ],
  8808. setCustomLabelsForSelfHostedRunnerForOrg: [
  8809. "PUT /orgs/{org}/actions/runners/{runner_id}/labels"
  8810. ],
  8811. setCustomLabelsForSelfHostedRunnerForRepo: [
  8812. "PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
  8813. ],
  8814. setCustomOidcSubClaimForRepo: [
  8815. "PUT /repos/{owner}/{repo}/actions/oidc/customization/sub"
  8816. ],
  8817. setGithubActionsDefaultWorkflowPermissionsOrganization: [
  8818. "PUT /orgs/{org}/actions/permissions/workflow"
  8819. ],
  8820. setGithubActionsDefaultWorkflowPermissionsRepository: [
  8821. "PUT /repos/{owner}/{repo}/actions/permissions/workflow"
  8822. ],
  8823. setGithubActionsPermissionsOrganization: [
  8824. "PUT /orgs/{org}/actions/permissions"
  8825. ],
  8826. setGithubActionsPermissionsRepository: [
  8827. "PUT /repos/{owner}/{repo}/actions/permissions"
  8828. ],
  8829. setSelectedReposForOrgSecret: [
  8830. "PUT /orgs/{org}/actions/secrets/{secret_name}/repositories"
  8831. ],
  8832. setSelectedReposForOrgVariable: [
  8833. "PUT /orgs/{org}/actions/variables/{name}/repositories"
  8834. ],
  8835. setSelectedRepositoriesEnabledGithubActionsOrganization: [
  8836. "PUT /orgs/{org}/actions/permissions/repositories"
  8837. ],
  8838. setWorkflowAccessToRepository: [
  8839. "PUT /repos/{owner}/{repo}/actions/permissions/access"
  8840. ],
  8841. updateEnvironmentVariable: [
  8842. "PATCH /repositories/{repository_id}/environments/{environment_name}/variables/{name}"
  8843. ],
  8844. updateOrgVariable: ["PATCH /orgs/{org}/actions/variables/{name}"],
  8845. updateRepoVariable: [
  8846. "PATCH /repos/{owner}/{repo}/actions/variables/{name}"
  8847. ]
  8848. },
  8849. activity: {
  8850. checkRepoIsStarredByAuthenticatedUser: ["GET /user/starred/{owner}/{repo}"],
  8851. deleteRepoSubscription: ["DELETE /repos/{owner}/{repo}/subscription"],
  8852. deleteThreadSubscription: [
  8853. "DELETE /notifications/threads/{thread_id}/subscription"
  8854. ],
  8855. getFeeds: ["GET /feeds"],
  8856. getRepoSubscription: ["GET /repos/{owner}/{repo}/subscription"],
  8857. getThread: ["GET /notifications/threads/{thread_id}"],
  8858. getThreadSubscriptionForAuthenticatedUser: [
  8859. "GET /notifications/threads/{thread_id}/subscription"
  8860. ],
  8861. listEventsForAuthenticatedUser: ["GET /users/{username}/events"],
  8862. listNotificationsForAuthenticatedUser: ["GET /notifications"],
  8863. listOrgEventsForAuthenticatedUser: [
  8864. "GET /users/{username}/events/orgs/{org}"
  8865. ],
  8866. listPublicEvents: ["GET /events"],
  8867. listPublicEventsForRepoNetwork: ["GET /networks/{owner}/{repo}/events"],
  8868. listPublicEventsForUser: ["GET /users/{username}/events/public"],
  8869. listPublicOrgEvents: ["GET /orgs/{org}/events"],
  8870. listReceivedEventsForUser: ["GET /users/{username}/received_events"],
  8871. listReceivedPublicEventsForUser: [
  8872. "GET /users/{username}/received_events/public"
  8873. ],
  8874. listRepoEvents: ["GET /repos/{owner}/{repo}/events"],
  8875. listRepoNotificationsForAuthenticatedUser: [
  8876. "GET /repos/{owner}/{repo}/notifications"
  8877. ],
  8878. listReposStarredByAuthenticatedUser: ["GET /user/starred"],
  8879. listReposStarredByUser: ["GET /users/{username}/starred"],
  8880. listReposWatchedByUser: ["GET /users/{username}/subscriptions"],
  8881. listStargazersForRepo: ["GET /repos/{owner}/{repo}/stargazers"],
  8882. listWatchedReposForAuthenticatedUser: ["GET /user/subscriptions"],
  8883. listWatchersForRepo: ["GET /repos/{owner}/{repo}/subscribers"],
  8884. markNotificationsAsRead: ["PUT /notifications"],
  8885. markRepoNotificationsAsRead: ["PUT /repos/{owner}/{repo}/notifications"],
  8886. markThreadAsDone: ["DELETE /notifications/threads/{thread_id}"],
  8887. markThreadAsRead: ["PATCH /notifications/threads/{thread_id}"],
  8888. setRepoSubscription: ["PUT /repos/{owner}/{repo}/subscription"],
  8889. setThreadSubscription: [
  8890. "PUT /notifications/threads/{thread_id}/subscription"
  8891. ],
  8892. starRepoForAuthenticatedUser: ["PUT /user/starred/{owner}/{repo}"],
  8893. unstarRepoForAuthenticatedUser: ["DELETE /user/starred/{owner}/{repo}"]
  8894. },
  8895. apps: {
  8896. addRepoToInstallation: [
  8897. "PUT /user/installations/{installation_id}/repositories/{repository_id}",
  8898. {},
  8899. { renamed: ["apps", "addRepoToInstallationForAuthenticatedUser"] }
  8900. ],
  8901. addRepoToInstallationForAuthenticatedUser: [
  8902. "PUT /user/installations/{installation_id}/repositories/{repository_id}"
  8903. ],
  8904. checkToken: ["POST /applications/{client_id}/token"],
  8905. createFromManifest: ["POST /app-manifests/{code}/conversions"],
  8906. createInstallationAccessToken: [
  8907. "POST /app/installations/{installation_id}/access_tokens"
  8908. ],
  8909. deleteAuthorization: ["DELETE /applications/{client_id}/grant"],
  8910. deleteInstallation: ["DELETE /app/installations/{installation_id}"],
  8911. deleteToken: ["DELETE /applications/{client_id}/token"],
  8912. getAuthenticated: ["GET /app"],
  8913. getBySlug: ["GET /apps/{app_slug}"],
  8914. getInstallation: ["GET /app/installations/{installation_id}"],
  8915. getOrgInstallation: ["GET /orgs/{org}/installation"],
  8916. getRepoInstallation: ["GET /repos/{owner}/{repo}/installation"],
  8917. getSubscriptionPlanForAccount: [
  8918. "GET /marketplace_listing/accounts/{account_id}"
  8919. ],
  8920. getSubscriptionPlanForAccountStubbed: [
  8921. "GET /marketplace_listing/stubbed/accounts/{account_id}"
  8922. ],
  8923. getUserInstallation: ["GET /users/{username}/installation"],
  8924. getWebhookConfigForApp: ["GET /app/hook/config"],
  8925. getWebhookDelivery: ["GET /app/hook/deliveries/{delivery_id}"],
  8926. listAccountsForPlan: ["GET /marketplace_listing/plans/{plan_id}/accounts"],
  8927. listAccountsForPlanStubbed: [
  8928. "GET /marketplace_listing/stubbed/plans/{plan_id}/accounts"
  8929. ],
  8930. listInstallationReposForAuthenticatedUser: [
  8931. "GET /user/installations/{installation_id}/repositories"
  8932. ],
  8933. listInstallationRequestsForAuthenticatedApp: [
  8934. "GET /app/installation-requests"
  8935. ],
  8936. listInstallations: ["GET /app/installations"],
  8937. listInstallationsForAuthenticatedUser: ["GET /user/installations"],
  8938. listPlans: ["GET /marketplace_listing/plans"],
  8939. listPlansStubbed: ["GET /marketplace_listing/stubbed/plans"],
  8940. listReposAccessibleToInstallation: ["GET /installation/repositories"],
  8941. listSubscriptionsForAuthenticatedUser: ["GET /user/marketplace_purchases"],
  8942. listSubscriptionsForAuthenticatedUserStubbed: [
  8943. "GET /user/marketplace_purchases/stubbed"
  8944. ],
  8945. listWebhookDeliveries: ["GET /app/hook/deliveries"],
  8946. redeliverWebhookDelivery: [
  8947. "POST /app/hook/deliveries/{delivery_id}/attempts"
  8948. ],
  8949. removeRepoFromInstallation: [
  8950. "DELETE /user/installations/{installation_id}/repositories/{repository_id}",
  8951. {},
  8952. { renamed: ["apps", "removeRepoFromInstallationForAuthenticatedUser"] }
  8953. ],
  8954. removeRepoFromInstallationForAuthenticatedUser: [
  8955. "DELETE /user/installations/{installation_id}/repositories/{repository_id}"
  8956. ],
  8957. resetToken: ["PATCH /applications/{client_id}/token"],
  8958. revokeInstallationAccessToken: ["DELETE /installation/token"],
  8959. scopeToken: ["POST /applications/{client_id}/token/scoped"],
  8960. suspendInstallation: ["PUT /app/installations/{installation_id}/suspended"],
  8961. unsuspendInstallation: [
  8962. "DELETE /app/installations/{installation_id}/suspended"
  8963. ],
  8964. updateWebhookConfigForApp: ["PATCH /app/hook/config"]
  8965. },
  8966. billing: {
  8967. getGithubActionsBillingOrg: ["GET /orgs/{org}/settings/billing/actions"],
  8968. getGithubActionsBillingUser: [
  8969. "GET /users/{username}/settings/billing/actions"
  8970. ],
  8971. getGithubPackagesBillingOrg: ["GET /orgs/{org}/settings/billing/packages"],
  8972. getGithubPackagesBillingUser: [
  8973. "GET /users/{username}/settings/billing/packages"
  8974. ],
  8975. getSharedStorageBillingOrg: [
  8976. "GET /orgs/{org}/settings/billing/shared-storage"
  8977. ],
  8978. getSharedStorageBillingUser: [
  8979. "GET /users/{username}/settings/billing/shared-storage"
  8980. ]
  8981. },
  8982. checks: {
  8983. create: ["POST /repos/{owner}/{repo}/check-runs"],
  8984. createSuite: ["POST /repos/{owner}/{repo}/check-suites"],
  8985. get: ["GET /repos/{owner}/{repo}/check-runs/{check_run_id}"],
  8986. getSuite: ["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}"],
  8987. listAnnotations: [
  8988. "GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations"
  8989. ],
  8990. listForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-runs"],
  8991. listForSuite: [
  8992. "GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs"
  8993. ],
  8994. listSuitesForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-suites"],
  8995. rerequestRun: [
  8996. "POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest"
  8997. ],
  8998. rerequestSuite: [
  8999. "POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest"
  9000. ],
  9001. setSuitesPreferences: [
  9002. "PATCH /repos/{owner}/{repo}/check-suites/preferences"
  9003. ],
  9004. update: ["PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}"]
  9005. },
  9006. codeScanning: {
  9007. deleteAnalysis: [
  9008. "DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}"
  9009. ],
  9010. getAlert: [
  9011. "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}",
  9012. {},
  9013. { renamedParameters: { alert_id: "alert_number" } }
  9014. ],
  9015. getAnalysis: [
  9016. "GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}"
  9017. ],
  9018. getCodeqlDatabase: [
  9019. "GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}"
  9020. ],
  9021. getDefaultSetup: ["GET /repos/{owner}/{repo}/code-scanning/default-setup"],
  9022. getSarif: ["GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}"],
  9023. listAlertInstances: [
  9024. "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances"
  9025. ],
  9026. listAlertsForOrg: ["GET /orgs/{org}/code-scanning/alerts"],
  9027. listAlertsForRepo: ["GET /repos/{owner}/{repo}/code-scanning/alerts"],
  9028. listAlertsInstances: [
  9029. "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances",
  9030. {},
  9031. { renamed: ["codeScanning", "listAlertInstances"] }
  9032. ],
  9033. listCodeqlDatabases: [
  9034. "GET /repos/{owner}/{repo}/code-scanning/codeql/databases"
  9035. ],
  9036. listRecentAnalyses: ["GET /repos/{owner}/{repo}/code-scanning/analyses"],
  9037. updateAlert: [
  9038. "PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}"
  9039. ],
  9040. updateDefaultSetup: [
  9041. "PATCH /repos/{owner}/{repo}/code-scanning/default-setup"
  9042. ],
  9043. uploadSarif: ["POST /repos/{owner}/{repo}/code-scanning/sarifs"]
  9044. },
  9045. codesOfConduct: {
  9046. getAllCodesOfConduct: ["GET /codes_of_conduct"],
  9047. getConductCode: ["GET /codes_of_conduct/{key}"]
  9048. },
  9049. codespaces: {
  9050. addRepositoryForSecretForAuthenticatedUser: [
  9051. "PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"
  9052. ],
  9053. addSelectedRepoToOrgSecret: [
  9054. "PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"
  9055. ],
  9056. checkPermissionsForDevcontainer: [
  9057. "GET /repos/{owner}/{repo}/codespaces/permissions_check"
  9058. ],
  9059. codespaceMachinesForAuthenticatedUser: [
  9060. "GET /user/codespaces/{codespace_name}/machines"
  9061. ],
  9062. createForAuthenticatedUser: ["POST /user/codespaces"],
  9063. createOrUpdateOrgSecret: [
  9064. "PUT /orgs/{org}/codespaces/secrets/{secret_name}"
  9065. ],
  9066. createOrUpdateRepoSecret: [
  9067. "PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"
  9068. ],
  9069. createOrUpdateSecretForAuthenticatedUser: [
  9070. "PUT /user/codespaces/secrets/{secret_name}"
  9071. ],
  9072. createWithPrForAuthenticatedUser: [
  9073. "POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces"
  9074. ],
  9075. createWithRepoForAuthenticatedUser: [
  9076. "POST /repos/{owner}/{repo}/codespaces"
  9077. ],
  9078. deleteForAuthenticatedUser: ["DELETE /user/codespaces/{codespace_name}"],
  9079. deleteFromOrganization: [
  9080. "DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name}"
  9081. ],
  9082. deleteOrgSecret: ["DELETE /orgs/{org}/codespaces/secrets/{secret_name}"],
  9083. deleteRepoSecret: [
  9084. "DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"
  9085. ],
  9086. deleteSecretForAuthenticatedUser: [
  9087. "DELETE /user/codespaces/secrets/{secret_name}"
  9088. ],
  9089. exportForAuthenticatedUser: [
  9090. "POST /user/codespaces/{codespace_name}/exports"
  9091. ],
  9092. getCodespacesForUserInOrg: [
  9093. "GET /orgs/{org}/members/{username}/codespaces"
  9094. ],
  9095. getExportDetailsForAuthenticatedUser: [
  9096. "GET /user/codespaces/{codespace_name}/exports/{export_id}"
  9097. ],
  9098. getForAuthenticatedUser: ["GET /user/codespaces/{codespace_name}"],
  9099. getOrgPublicKey: ["GET /orgs/{org}/codespaces/secrets/public-key"],
  9100. getOrgSecret: ["GET /orgs/{org}/codespaces/secrets/{secret_name}"],
  9101. getPublicKeyForAuthenticatedUser: [
  9102. "GET /user/codespaces/secrets/public-key"
  9103. ],
  9104. getRepoPublicKey: [
  9105. "GET /repos/{owner}/{repo}/codespaces/secrets/public-key"
  9106. ],
  9107. getRepoSecret: [
  9108. "GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"
  9109. ],
  9110. getSecretForAuthenticatedUser: [
  9111. "GET /user/codespaces/secrets/{secret_name}"
  9112. ],
  9113. listDevcontainersInRepositoryForAuthenticatedUser: [
  9114. "GET /repos/{owner}/{repo}/codespaces/devcontainers"
  9115. ],
  9116. listForAuthenticatedUser: ["GET /user/codespaces"],
  9117. listInOrganization: [
  9118. "GET /orgs/{org}/codespaces",
  9119. {},
  9120. { renamedParameters: { org_id: "org" } }
  9121. ],
  9122. listInRepositoryForAuthenticatedUser: [
  9123. "GET /repos/{owner}/{repo}/codespaces"
  9124. ],
  9125. listOrgSecrets: ["GET /orgs/{org}/codespaces/secrets"],
  9126. listRepoSecrets: ["GET /repos/{owner}/{repo}/codespaces/secrets"],
  9127. listRepositoriesForSecretForAuthenticatedUser: [
  9128. "GET /user/codespaces/secrets/{secret_name}/repositories"
  9129. ],
  9130. listSecretsForAuthenticatedUser: ["GET /user/codespaces/secrets"],
  9131. listSelectedReposForOrgSecret: [
  9132. "GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories"
  9133. ],
  9134. preFlightWithRepoForAuthenticatedUser: [
  9135. "GET /repos/{owner}/{repo}/codespaces/new"
  9136. ],
  9137. publishForAuthenticatedUser: [
  9138. "POST /user/codespaces/{codespace_name}/publish"
  9139. ],
  9140. removeRepositoryForSecretForAuthenticatedUser: [
  9141. "DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"
  9142. ],
  9143. removeSelectedRepoFromOrgSecret: [
  9144. "DELETE /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"
  9145. ],
  9146. repoMachinesForAuthenticatedUser: [
  9147. "GET /repos/{owner}/{repo}/codespaces/machines"
  9148. ],
  9149. setRepositoriesForSecretForAuthenticatedUser: [
  9150. "PUT /user/codespaces/secrets/{secret_name}/repositories"
  9151. ],
  9152. setSelectedReposForOrgSecret: [
  9153. "PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories"
  9154. ],
  9155. startForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/start"],
  9156. stopForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/stop"],
  9157. stopInOrganization: [
  9158. "POST /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop"
  9159. ],
  9160. updateForAuthenticatedUser: ["PATCH /user/codespaces/{codespace_name}"]
  9161. },
  9162. copilot: {
  9163. addCopilotSeatsForTeams: [
  9164. "POST /orgs/{org}/copilot/billing/selected_teams"
  9165. ],
  9166. addCopilotSeatsForUsers: [
  9167. "POST /orgs/{org}/copilot/billing/selected_users"
  9168. ],
  9169. cancelCopilotSeatAssignmentForTeams: [
  9170. "DELETE /orgs/{org}/copilot/billing/selected_teams"
  9171. ],
  9172. cancelCopilotSeatAssignmentForUsers: [
  9173. "DELETE /orgs/{org}/copilot/billing/selected_users"
  9174. ],
  9175. getCopilotOrganizationDetails: ["GET /orgs/{org}/copilot/billing"],
  9176. getCopilotSeatDetailsForUser: [
  9177. "GET /orgs/{org}/members/{username}/copilot"
  9178. ],
  9179. listCopilotSeats: ["GET /orgs/{org}/copilot/billing/seats"]
  9180. },
  9181. dependabot: {
  9182. addSelectedRepoToOrgSecret: [
  9183. "PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"
  9184. ],
  9185. createOrUpdateOrgSecret: [
  9186. "PUT /orgs/{org}/dependabot/secrets/{secret_name}"
  9187. ],
  9188. createOrUpdateRepoSecret: [
  9189. "PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"
  9190. ],
  9191. deleteOrgSecret: ["DELETE /orgs/{org}/dependabot/secrets/{secret_name}"],
  9192. deleteRepoSecret: [
  9193. "DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"
  9194. ],
  9195. getAlert: ["GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"],
  9196. getOrgPublicKey: ["GET /orgs/{org}/dependabot/secrets/public-key"],
  9197. getOrgSecret: ["GET /orgs/{org}/dependabot/secrets/{secret_name}"],
  9198. getRepoPublicKey: [
  9199. "GET /repos/{owner}/{repo}/dependabot/secrets/public-key"
  9200. ],
  9201. getRepoSecret: [
  9202. "GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"
  9203. ],
  9204. listAlertsForEnterprise: [
  9205. "GET /enterprises/{enterprise}/dependabot/alerts"
  9206. ],
  9207. listAlertsForOrg: ["GET /orgs/{org}/dependabot/alerts"],
  9208. listAlertsForRepo: ["GET /repos/{owner}/{repo}/dependabot/alerts"],
  9209. listOrgSecrets: ["GET /orgs/{org}/dependabot/secrets"],
  9210. listRepoSecrets: ["GET /repos/{owner}/{repo}/dependabot/secrets"],
  9211. listSelectedReposForOrgSecret: [
  9212. "GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories"
  9213. ],
  9214. removeSelectedRepoFromOrgSecret: [
  9215. "DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"
  9216. ],
  9217. setSelectedReposForOrgSecret: [
  9218. "PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories"
  9219. ],
  9220. updateAlert: [
  9221. "PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"
  9222. ]
  9223. },
  9224. dependencyGraph: {
  9225. createRepositorySnapshot: [
  9226. "POST /repos/{owner}/{repo}/dependency-graph/snapshots"
  9227. ],
  9228. diffRange: [
  9229. "GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead}"
  9230. ],
  9231. exportSbom: ["GET /repos/{owner}/{repo}/dependency-graph/sbom"]
  9232. },
  9233. emojis: { get: ["GET /emojis"] },
  9234. gists: {
  9235. checkIsStarred: ["GET /gists/{gist_id}/star"],
  9236. create: ["POST /gists"],
  9237. createComment: ["POST /gists/{gist_id}/comments"],
  9238. delete: ["DELETE /gists/{gist_id}"],
  9239. deleteComment: ["DELETE /gists/{gist_id}/comments/{comment_id}"],
  9240. fork: ["POST /gists/{gist_id}/forks"],
  9241. get: ["GET /gists/{gist_id}"],
  9242. getComment: ["GET /gists/{gist_id}/comments/{comment_id}"],
  9243. getRevision: ["GET /gists/{gist_id}/{sha}"],
  9244. list: ["GET /gists"],
  9245. listComments: ["GET /gists/{gist_id}/comments"],
  9246. listCommits: ["GET /gists/{gist_id}/commits"],
  9247. listForUser: ["GET /users/{username}/gists"],
  9248. listForks: ["GET /gists/{gist_id}/forks"],
  9249. listPublic: ["GET /gists/public"],
  9250. listStarred: ["GET /gists/starred"],
  9251. star: ["PUT /gists/{gist_id}/star"],
  9252. unstar: ["DELETE /gists/{gist_id}/star"],
  9253. update: ["PATCH /gists/{gist_id}"],
  9254. updateComment: ["PATCH /gists/{gist_id}/comments/{comment_id}"]
  9255. },
  9256. git: {
  9257. createBlob: ["POST /repos/{owner}/{repo}/git/blobs"],
  9258. createCommit: ["POST /repos/{owner}/{repo}/git/commits"],
  9259. createRef: ["POST /repos/{owner}/{repo}/git/refs"],
  9260. createTag: ["POST /repos/{owner}/{repo}/git/tags"],
  9261. createTree: ["POST /repos/{owner}/{repo}/git/trees"],
  9262. deleteRef: ["DELETE /repos/{owner}/{repo}/git/refs/{ref}"],
  9263. getBlob: ["GET /repos/{owner}/{repo}/git/blobs/{file_sha}"],
  9264. getCommit: ["GET /repos/{owner}/{repo}/git/commits/{commit_sha}"],
  9265. getRef: ["GET /repos/{owner}/{repo}/git/ref/{ref}"],
  9266. getTag: ["GET /repos/{owner}/{repo}/git/tags/{tag_sha}"],
  9267. getTree: ["GET /repos/{owner}/{repo}/git/trees/{tree_sha}"],
  9268. listMatchingRefs: ["GET /repos/{owner}/{repo}/git/matching-refs/{ref}"],
  9269. updateRef: ["PATCH /repos/{owner}/{repo}/git/refs/{ref}"]
  9270. },
  9271. gitignore: {
  9272. getAllTemplates: ["GET /gitignore/templates"],
  9273. getTemplate: ["GET /gitignore/templates/{name}"]
  9274. },
  9275. interactions: {
  9276. getRestrictionsForAuthenticatedUser: ["GET /user/interaction-limits"],
  9277. getRestrictionsForOrg: ["GET /orgs/{org}/interaction-limits"],
  9278. getRestrictionsForRepo: ["GET /repos/{owner}/{repo}/interaction-limits"],
  9279. getRestrictionsForYourPublicRepos: [
  9280. "GET /user/interaction-limits",
  9281. {},
  9282. { renamed: ["interactions", "getRestrictionsForAuthenticatedUser"] }
  9283. ],
  9284. removeRestrictionsForAuthenticatedUser: ["DELETE /user/interaction-limits"],
  9285. removeRestrictionsForOrg: ["DELETE /orgs/{org}/interaction-limits"],
  9286. removeRestrictionsForRepo: [
  9287. "DELETE /repos/{owner}/{repo}/interaction-limits"
  9288. ],
  9289. removeRestrictionsForYourPublicRepos: [
  9290. "DELETE /user/interaction-limits",
  9291. {},
  9292. { renamed: ["interactions", "removeRestrictionsForAuthenticatedUser"] }
  9293. ],
  9294. setRestrictionsForAuthenticatedUser: ["PUT /user/interaction-limits"],
  9295. setRestrictionsForOrg: ["PUT /orgs/{org}/interaction-limits"],
  9296. setRestrictionsForRepo: ["PUT /repos/{owner}/{repo}/interaction-limits"],
  9297. setRestrictionsForYourPublicRepos: [
  9298. "PUT /user/interaction-limits",
  9299. {},
  9300. { renamed: ["interactions", "setRestrictionsForAuthenticatedUser"] }
  9301. ]
  9302. },
  9303. issues: {
  9304. addAssignees: [
  9305. "POST /repos/{owner}/{repo}/issues/{issue_number}/assignees"
  9306. ],
  9307. addLabels: ["POST /repos/{owner}/{repo}/issues/{issue_number}/labels"],
  9308. checkUserCanBeAssigned: ["GET /repos/{owner}/{repo}/assignees/{assignee}"],
  9309. checkUserCanBeAssignedToIssue: [
  9310. "GET /repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}"
  9311. ],
  9312. create: ["POST /repos/{owner}/{repo}/issues"],
  9313. createComment: [
  9314. "POST /repos/{owner}/{repo}/issues/{issue_number}/comments"
  9315. ],
  9316. createLabel: ["POST /repos/{owner}/{repo}/labels"],
  9317. createMilestone: ["POST /repos/{owner}/{repo}/milestones"],
  9318. deleteComment: [
  9319. "DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}"
  9320. ],
  9321. deleteLabel: ["DELETE /repos/{owner}/{repo}/labels/{name}"],
  9322. deleteMilestone: [
  9323. "DELETE /repos/{owner}/{repo}/milestones/{milestone_number}"
  9324. ],
  9325. get: ["GET /repos/{owner}/{repo}/issues/{issue_number}"],
  9326. getComment: ["GET /repos/{owner}/{repo}/issues/comments/{comment_id}"],
  9327. getEvent: ["GET /repos/{owner}/{repo}/issues/events/{event_id}"],
  9328. getLabel: ["GET /repos/{owner}/{repo}/labels/{name}"],
  9329. getMilestone: ["GET /repos/{owner}/{repo}/milestones/{milestone_number}"],
  9330. list: ["GET /issues"],
  9331. listAssignees: ["GET /repos/{owner}/{repo}/assignees"],
  9332. listComments: ["GET /repos/{owner}/{repo}/issues/{issue_number}/comments"],
  9333. listCommentsForRepo: ["GET /repos/{owner}/{repo}/issues/comments"],
  9334. listEvents: ["GET /repos/{owner}/{repo}/issues/{issue_number}/events"],
  9335. listEventsForRepo: ["GET /repos/{owner}/{repo}/issues/events"],
  9336. listEventsForTimeline: [
  9337. "GET /repos/{owner}/{repo}/issues/{issue_number}/timeline"
  9338. ],
  9339. listForAuthenticatedUser: ["GET /user/issues"],
  9340. listForOrg: ["GET /orgs/{org}/issues"],
  9341. listForRepo: ["GET /repos/{owner}/{repo}/issues"],
  9342. listLabelsForMilestone: [
  9343. "GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels"
  9344. ],
  9345. listLabelsForRepo: ["GET /repos/{owner}/{repo}/labels"],
  9346. listLabelsOnIssue: [
  9347. "GET /repos/{owner}/{repo}/issues/{issue_number}/labels"
  9348. ],
  9349. listMilestones: ["GET /repos/{owner}/{repo}/milestones"],
  9350. lock: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/lock"],
  9351. removeAllLabels: [
  9352. "DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels"
  9353. ],
  9354. removeAssignees: [
  9355. "DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees"
  9356. ],
  9357. removeLabel: [
  9358. "DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}"
  9359. ],
  9360. setLabels: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/labels"],
  9361. unlock: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock"],
  9362. update: ["PATCH /repos/{owner}/{repo}/issues/{issue_number}"],
  9363. updateComment: ["PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}"],
  9364. updateLabel: ["PATCH /repos/{owner}/{repo}/labels/{name}"],
  9365. updateMilestone: [
  9366. "PATCH /repos/{owner}/{repo}/milestones/{milestone_number}"
  9367. ]
  9368. },
  9369. licenses: {
  9370. get: ["GET /licenses/{license}"],
  9371. getAllCommonlyUsed: ["GET /licenses"],
  9372. getForRepo: ["GET /repos/{owner}/{repo}/license"]
  9373. },
  9374. markdown: {
  9375. render: ["POST /markdown"],
  9376. renderRaw: [
  9377. "POST /markdown/raw",
  9378. { headers: { "content-type": "text/plain; charset=utf-8" } }
  9379. ]
  9380. },
  9381. meta: {
  9382. get: ["GET /meta"],
  9383. getAllVersions: ["GET /versions"],
  9384. getOctocat: ["GET /octocat"],
  9385. getZen: ["GET /zen"],
  9386. root: ["GET /"]
  9387. },
  9388. migrations: {
  9389. cancelImport: [
  9390. "DELETE /repos/{owner}/{repo}/import",
  9391. {},
  9392. {
  9393. deprecated: "octokit.rest.migrations.cancelImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#cancel-an-import"
  9394. }
  9395. ],
  9396. deleteArchiveForAuthenticatedUser: [
  9397. "DELETE /user/migrations/{migration_id}/archive"
  9398. ],
  9399. deleteArchiveForOrg: [
  9400. "DELETE /orgs/{org}/migrations/{migration_id}/archive"
  9401. ],
  9402. downloadArchiveForOrg: [
  9403. "GET /orgs/{org}/migrations/{migration_id}/archive"
  9404. ],
  9405. getArchiveForAuthenticatedUser: [
  9406. "GET /user/migrations/{migration_id}/archive"
  9407. ],
  9408. getCommitAuthors: [
  9409. "GET /repos/{owner}/{repo}/import/authors",
  9410. {},
  9411. {
  9412. deprecated: "octokit.rest.migrations.getCommitAuthors() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-commit-authors"
  9413. }
  9414. ],
  9415. getImportStatus: [
  9416. "GET /repos/{owner}/{repo}/import",
  9417. {},
  9418. {
  9419. deprecated: "octokit.rest.migrations.getImportStatus() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-an-import-status"
  9420. }
  9421. ],
  9422. getLargeFiles: [
  9423. "GET /repos/{owner}/{repo}/import/large_files",
  9424. {},
  9425. {
  9426. deprecated: "octokit.rest.migrations.getLargeFiles() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-large-files"
  9427. }
  9428. ],
  9429. getStatusForAuthenticatedUser: ["GET /user/migrations/{migration_id}"],
  9430. getStatusForOrg: ["GET /orgs/{org}/migrations/{migration_id}"],
  9431. listForAuthenticatedUser: ["GET /user/migrations"],
  9432. listForOrg: ["GET /orgs/{org}/migrations"],
  9433. listReposForAuthenticatedUser: [
  9434. "GET /user/migrations/{migration_id}/repositories"
  9435. ],
  9436. listReposForOrg: ["GET /orgs/{org}/migrations/{migration_id}/repositories"],
  9437. listReposForUser: [
  9438. "GET /user/migrations/{migration_id}/repositories",
  9439. {},
  9440. { renamed: ["migrations", "listReposForAuthenticatedUser"] }
  9441. ],
  9442. mapCommitAuthor: [
  9443. "PATCH /repos/{owner}/{repo}/import/authors/{author_id}",
  9444. {},
  9445. {
  9446. deprecated: "octokit.rest.migrations.mapCommitAuthor() is deprecated, see https://docs.github.com/rest/migrations/source-imports#map-a-commit-author"
  9447. }
  9448. ],
  9449. setLfsPreference: [
  9450. "PATCH /repos/{owner}/{repo}/import/lfs",
  9451. {},
  9452. {
  9453. deprecated: "octokit.rest.migrations.setLfsPreference() is deprecated, see https://docs.github.com/rest/migrations/source-imports#update-git-lfs-preference"
  9454. }
  9455. ],
  9456. startForAuthenticatedUser: ["POST /user/migrations"],
  9457. startForOrg: ["POST /orgs/{org}/migrations"],
  9458. startImport: [
  9459. "PUT /repos/{owner}/{repo}/import",
  9460. {},
  9461. {
  9462. deprecated: "octokit.rest.migrations.startImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#start-an-import"
  9463. }
  9464. ],
  9465. unlockRepoForAuthenticatedUser: [
  9466. "DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock"
  9467. ],
  9468. unlockRepoForOrg: [
  9469. "DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock"
  9470. ],
  9471. updateImport: [
  9472. "PATCH /repos/{owner}/{repo}/import",
  9473. {},
  9474. {
  9475. deprecated: "octokit.rest.migrations.updateImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#update-an-import"
  9476. }
  9477. ]
  9478. },
  9479. oidc: {
  9480. getOidcCustomSubTemplateForOrg: [
  9481. "GET /orgs/{org}/actions/oidc/customization/sub"
  9482. ],
  9483. updateOidcCustomSubTemplateForOrg: [
  9484. "PUT /orgs/{org}/actions/oidc/customization/sub"
  9485. ]
  9486. },
  9487. orgs: {
  9488. addSecurityManagerTeam: [
  9489. "PUT /orgs/{org}/security-managers/teams/{team_slug}"
  9490. ],
  9491. assignTeamToOrgRole: [
  9492. "PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"
  9493. ],
  9494. assignUserToOrgRole: [
  9495. "PUT /orgs/{org}/organization-roles/users/{username}/{role_id}"
  9496. ],
  9497. blockUser: ["PUT /orgs/{org}/blocks/{username}"],
  9498. cancelInvitation: ["DELETE /orgs/{org}/invitations/{invitation_id}"],
  9499. checkBlockedUser: ["GET /orgs/{org}/blocks/{username}"],
  9500. checkMembershipForUser: ["GET /orgs/{org}/members/{username}"],
  9501. checkPublicMembershipForUser: ["GET /orgs/{org}/public_members/{username}"],
  9502. convertMemberToOutsideCollaborator: [
  9503. "PUT /orgs/{org}/outside_collaborators/{username}"
  9504. ],
  9505. createCustomOrganizationRole: ["POST /orgs/{org}/organization-roles"],
  9506. createInvitation: ["POST /orgs/{org}/invitations"],
  9507. createOrUpdateCustomProperties: ["PATCH /orgs/{org}/properties/schema"],
  9508. createOrUpdateCustomPropertiesValuesForRepos: [
  9509. "PATCH /orgs/{org}/properties/values"
  9510. ],
  9511. createOrUpdateCustomProperty: [
  9512. "PUT /orgs/{org}/properties/schema/{custom_property_name}"
  9513. ],
  9514. createWebhook: ["POST /orgs/{org}/hooks"],
  9515. delete: ["DELETE /orgs/{org}"],
  9516. deleteCustomOrganizationRole: [
  9517. "DELETE /orgs/{org}/organization-roles/{role_id}"
  9518. ],
  9519. deleteWebhook: ["DELETE /orgs/{org}/hooks/{hook_id}"],
  9520. enableOrDisableSecurityProductOnAllOrgRepos: [
  9521. "POST /orgs/{org}/{security_product}/{enablement}"
  9522. ],
  9523. get: ["GET /orgs/{org}"],
  9524. getAllCustomProperties: ["GET /orgs/{org}/properties/schema"],
  9525. getCustomProperty: [
  9526. "GET /orgs/{org}/properties/schema/{custom_property_name}"
  9527. ],
  9528. getMembershipForAuthenticatedUser: ["GET /user/memberships/orgs/{org}"],
  9529. getMembershipForUser: ["GET /orgs/{org}/memberships/{username}"],
  9530. getOrgRole: ["GET /orgs/{org}/organization-roles/{role_id}"],
  9531. getWebhook: ["GET /orgs/{org}/hooks/{hook_id}"],
  9532. getWebhookConfigForOrg: ["GET /orgs/{org}/hooks/{hook_id}/config"],
  9533. getWebhookDelivery: [
  9534. "GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}"
  9535. ],
  9536. list: ["GET /organizations"],
  9537. listAppInstallations: ["GET /orgs/{org}/installations"],
  9538. listBlockedUsers: ["GET /orgs/{org}/blocks"],
  9539. listCustomPropertiesValuesForRepos: ["GET /orgs/{org}/properties/values"],
  9540. listFailedInvitations: ["GET /orgs/{org}/failed_invitations"],
  9541. listForAuthenticatedUser: ["GET /user/orgs"],
  9542. listForUser: ["GET /users/{username}/orgs"],
  9543. listInvitationTeams: ["GET /orgs/{org}/invitations/{invitation_id}/teams"],
  9544. listMembers: ["GET /orgs/{org}/members"],
  9545. listMembershipsForAuthenticatedUser: ["GET /user/memberships/orgs"],
  9546. listOrgRoleTeams: ["GET /orgs/{org}/organization-roles/{role_id}/teams"],
  9547. listOrgRoleUsers: ["GET /orgs/{org}/organization-roles/{role_id}/users"],
  9548. listOrgRoles: ["GET /orgs/{org}/organization-roles"],
  9549. listOrganizationFineGrainedPermissions: [
  9550. "GET /orgs/{org}/organization-fine-grained-permissions"
  9551. ],
  9552. listOutsideCollaborators: ["GET /orgs/{org}/outside_collaborators"],
  9553. listPatGrantRepositories: [
  9554. "GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories"
  9555. ],
  9556. listPatGrantRequestRepositories: [
  9557. "GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories"
  9558. ],
  9559. listPatGrantRequests: ["GET /orgs/{org}/personal-access-token-requests"],
  9560. listPatGrants: ["GET /orgs/{org}/personal-access-tokens"],
  9561. listPendingInvitations: ["GET /orgs/{org}/invitations"],
  9562. listPublicMembers: ["GET /orgs/{org}/public_members"],
  9563. listSecurityManagerTeams: ["GET /orgs/{org}/security-managers"],
  9564. listWebhookDeliveries: ["GET /orgs/{org}/hooks/{hook_id}/deliveries"],
  9565. listWebhooks: ["GET /orgs/{org}/hooks"],
  9566. patchCustomOrganizationRole: [
  9567. "PATCH /orgs/{org}/organization-roles/{role_id}"
  9568. ],
  9569. pingWebhook: ["POST /orgs/{org}/hooks/{hook_id}/pings"],
  9570. redeliverWebhookDelivery: [
  9571. "POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"
  9572. ],
  9573. removeCustomProperty: [
  9574. "DELETE /orgs/{org}/properties/schema/{custom_property_name}"
  9575. ],
  9576. removeMember: ["DELETE /orgs/{org}/members/{username}"],
  9577. removeMembershipForUser: ["DELETE /orgs/{org}/memberships/{username}"],
  9578. removeOutsideCollaborator: [
  9579. "DELETE /orgs/{org}/outside_collaborators/{username}"
  9580. ],
  9581. removePublicMembershipForAuthenticatedUser: [
  9582. "DELETE /orgs/{org}/public_members/{username}"
  9583. ],
  9584. removeSecurityManagerTeam: [
  9585. "DELETE /orgs/{org}/security-managers/teams/{team_slug}"
  9586. ],
  9587. reviewPatGrantRequest: [
  9588. "POST /orgs/{org}/personal-access-token-requests/{pat_request_id}"
  9589. ],
  9590. reviewPatGrantRequestsInBulk: [
  9591. "POST /orgs/{org}/personal-access-token-requests"
  9592. ],
  9593. revokeAllOrgRolesTeam: [
  9594. "DELETE /orgs/{org}/organization-roles/teams/{team_slug}"
  9595. ],
  9596. revokeAllOrgRolesUser: [
  9597. "DELETE /orgs/{org}/organization-roles/users/{username}"
  9598. ],
  9599. revokeOrgRoleTeam: [
  9600. "DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"
  9601. ],
  9602. revokeOrgRoleUser: [
  9603. "DELETE /orgs/{org}/organization-roles/users/{username}/{role_id}"
  9604. ],
  9605. setMembershipForUser: ["PUT /orgs/{org}/memberships/{username}"],
  9606. setPublicMembershipForAuthenticatedUser: [
  9607. "PUT /orgs/{org}/public_members/{username}"
  9608. ],
  9609. unblockUser: ["DELETE /orgs/{org}/blocks/{username}"],
  9610. update: ["PATCH /orgs/{org}"],
  9611. updateMembershipForAuthenticatedUser: [
  9612. "PATCH /user/memberships/orgs/{org}"
  9613. ],
  9614. updatePatAccess: ["POST /orgs/{org}/personal-access-tokens/{pat_id}"],
  9615. updatePatAccesses: ["POST /orgs/{org}/personal-access-tokens"],
  9616. updateWebhook: ["PATCH /orgs/{org}/hooks/{hook_id}"],
  9617. updateWebhookConfigForOrg: ["PATCH /orgs/{org}/hooks/{hook_id}/config"]
  9618. },
  9619. packages: {
  9620. deletePackageForAuthenticatedUser: [
  9621. "DELETE /user/packages/{package_type}/{package_name}"
  9622. ],
  9623. deletePackageForOrg: [
  9624. "DELETE /orgs/{org}/packages/{package_type}/{package_name}"
  9625. ],
  9626. deletePackageForUser: [
  9627. "DELETE /users/{username}/packages/{package_type}/{package_name}"
  9628. ],
  9629. deletePackageVersionForAuthenticatedUser: [
  9630. "DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9631. ],
  9632. deletePackageVersionForOrg: [
  9633. "DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9634. ],
  9635. deletePackageVersionForUser: [
  9636. "DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9637. ],
  9638. getAllPackageVersionsForAPackageOwnedByAnOrg: [
  9639. "GET /orgs/{org}/packages/{package_type}/{package_name}/versions",
  9640. {},
  9641. { renamed: ["packages", "getAllPackageVersionsForPackageOwnedByOrg"] }
  9642. ],
  9643. getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser: [
  9644. "GET /user/packages/{package_type}/{package_name}/versions",
  9645. {},
  9646. {
  9647. renamed: [
  9648. "packages",
  9649. "getAllPackageVersionsForPackageOwnedByAuthenticatedUser"
  9650. ]
  9651. }
  9652. ],
  9653. getAllPackageVersionsForPackageOwnedByAuthenticatedUser: [
  9654. "GET /user/packages/{package_type}/{package_name}/versions"
  9655. ],
  9656. getAllPackageVersionsForPackageOwnedByOrg: [
  9657. "GET /orgs/{org}/packages/{package_type}/{package_name}/versions"
  9658. ],
  9659. getAllPackageVersionsForPackageOwnedByUser: [
  9660. "GET /users/{username}/packages/{package_type}/{package_name}/versions"
  9661. ],
  9662. getPackageForAuthenticatedUser: [
  9663. "GET /user/packages/{package_type}/{package_name}"
  9664. ],
  9665. getPackageForOrganization: [
  9666. "GET /orgs/{org}/packages/{package_type}/{package_name}"
  9667. ],
  9668. getPackageForUser: [
  9669. "GET /users/{username}/packages/{package_type}/{package_name}"
  9670. ],
  9671. getPackageVersionForAuthenticatedUser: [
  9672. "GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9673. ],
  9674. getPackageVersionForOrganization: [
  9675. "GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9676. ],
  9677. getPackageVersionForUser: [
  9678. "GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9679. ],
  9680. listDockerMigrationConflictingPackagesForAuthenticatedUser: [
  9681. "GET /user/docker/conflicts"
  9682. ],
  9683. listDockerMigrationConflictingPackagesForOrganization: [
  9684. "GET /orgs/{org}/docker/conflicts"
  9685. ],
  9686. listDockerMigrationConflictingPackagesForUser: [
  9687. "GET /users/{username}/docker/conflicts"
  9688. ],
  9689. listPackagesForAuthenticatedUser: ["GET /user/packages"],
  9690. listPackagesForOrganization: ["GET /orgs/{org}/packages"],
  9691. listPackagesForUser: ["GET /users/{username}/packages"],
  9692. restorePackageForAuthenticatedUser: [
  9693. "POST /user/packages/{package_type}/{package_name}/restore{?token}"
  9694. ],
  9695. restorePackageForOrg: [
  9696. "POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}"
  9697. ],
  9698. restorePackageForUser: [
  9699. "POST /users/{username}/packages/{package_type}/{package_name}/restore{?token}"
  9700. ],
  9701. restorePackageVersionForAuthenticatedUser: [
  9702. "POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"
  9703. ],
  9704. restorePackageVersionForOrg: [
  9705. "POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"
  9706. ],
  9707. restorePackageVersionForUser: [
  9708. "POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"
  9709. ]
  9710. },
  9711. projects: {
  9712. addCollaborator: ["PUT /projects/{project_id}/collaborators/{username}"],
  9713. createCard: ["POST /projects/columns/{column_id}/cards"],
  9714. createColumn: ["POST /projects/{project_id}/columns"],
  9715. createForAuthenticatedUser: ["POST /user/projects"],
  9716. createForOrg: ["POST /orgs/{org}/projects"],
  9717. createForRepo: ["POST /repos/{owner}/{repo}/projects"],
  9718. delete: ["DELETE /projects/{project_id}"],
  9719. deleteCard: ["DELETE /projects/columns/cards/{card_id}"],
  9720. deleteColumn: ["DELETE /projects/columns/{column_id}"],
  9721. get: ["GET /projects/{project_id}"],
  9722. getCard: ["GET /projects/columns/cards/{card_id}"],
  9723. getColumn: ["GET /projects/columns/{column_id}"],
  9724. getPermissionForUser: [
  9725. "GET /projects/{project_id}/collaborators/{username}/permission"
  9726. ],
  9727. listCards: ["GET /projects/columns/{column_id}/cards"],
  9728. listCollaborators: ["GET /projects/{project_id}/collaborators"],
  9729. listColumns: ["GET /projects/{project_id}/columns"],
  9730. listForOrg: ["GET /orgs/{org}/projects"],
  9731. listForRepo: ["GET /repos/{owner}/{repo}/projects"],
  9732. listForUser: ["GET /users/{username}/projects"],
  9733. moveCard: ["POST /projects/columns/cards/{card_id}/moves"],
  9734. moveColumn: ["POST /projects/columns/{column_id}/moves"],
  9735. removeCollaborator: [
  9736. "DELETE /projects/{project_id}/collaborators/{username}"
  9737. ],
  9738. update: ["PATCH /projects/{project_id}"],
  9739. updateCard: ["PATCH /projects/columns/cards/{card_id}"],
  9740. updateColumn: ["PATCH /projects/columns/{column_id}"]
  9741. },
  9742. pulls: {
  9743. checkIfMerged: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/merge"],
  9744. create: ["POST /repos/{owner}/{repo}/pulls"],
  9745. createReplyForReviewComment: [
  9746. "POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies"
  9747. ],
  9748. createReview: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],
  9749. createReviewComment: [
  9750. "POST /repos/{owner}/{repo}/pulls/{pull_number}/comments"
  9751. ],
  9752. deletePendingReview: [
  9753. "DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"
  9754. ],
  9755. deleteReviewComment: [
  9756. "DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}"
  9757. ],
  9758. dismissReview: [
  9759. "PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals"
  9760. ],
  9761. get: ["GET /repos/{owner}/{repo}/pulls/{pull_number}"],
  9762. getReview: [
  9763. "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"
  9764. ],
  9765. getReviewComment: ["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}"],
  9766. list: ["GET /repos/{owner}/{repo}/pulls"],
  9767. listCommentsForReview: [
  9768. "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments"
  9769. ],
  9770. listCommits: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/commits"],
  9771. listFiles: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/files"],
  9772. listRequestedReviewers: [
  9773. "GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"
  9774. ],
  9775. listReviewComments: [
  9776. "GET /repos/{owner}/{repo}/pulls/{pull_number}/comments"
  9777. ],
  9778. listReviewCommentsForRepo: ["GET /repos/{owner}/{repo}/pulls/comments"],
  9779. listReviews: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],
  9780. merge: ["PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge"],
  9781. removeRequestedReviewers: [
  9782. "DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"
  9783. ],
  9784. requestReviewers: [
  9785. "POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"
  9786. ],
  9787. submitReview: [
  9788. "POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events"
  9789. ],
  9790. update: ["PATCH /repos/{owner}/{repo}/pulls/{pull_number}"],
  9791. updateBranch: [
  9792. "PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch"
  9793. ],
  9794. updateReview: [
  9795. "PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"
  9796. ],
  9797. updateReviewComment: [
  9798. "PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}"
  9799. ]
  9800. },
  9801. rateLimit: { get: ["GET /rate_limit"] },
  9802. reactions: {
  9803. createForCommitComment: [
  9804. "POST /repos/{owner}/{repo}/comments/{comment_id}/reactions"
  9805. ],
  9806. createForIssue: [
  9807. "POST /repos/{owner}/{repo}/issues/{issue_number}/reactions"
  9808. ],
  9809. createForIssueComment: [
  9810. "POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"
  9811. ],
  9812. createForPullRequestReviewComment: [
  9813. "POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"
  9814. ],
  9815. createForRelease: [
  9816. "POST /repos/{owner}/{repo}/releases/{release_id}/reactions"
  9817. ],
  9818. createForTeamDiscussionCommentInOrg: [
  9819. "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"
  9820. ],
  9821. createForTeamDiscussionInOrg: [
  9822. "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"
  9823. ],
  9824. deleteForCommitComment: [
  9825. "DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}"
  9826. ],
  9827. deleteForIssue: [
  9828. "DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}"
  9829. ],
  9830. deleteForIssueComment: [
  9831. "DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}"
  9832. ],
  9833. deleteForPullRequestComment: [
  9834. "DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}"
  9835. ],
  9836. deleteForRelease: [
  9837. "DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}"
  9838. ],
  9839. deleteForTeamDiscussion: [
  9840. "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}"
  9841. ],
  9842. deleteForTeamDiscussionComment: [
  9843. "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}"
  9844. ],
  9845. listForCommitComment: [
  9846. "GET /repos/{owner}/{repo}/comments/{comment_id}/reactions"
  9847. ],
  9848. listForIssue: ["GET /repos/{owner}/{repo}/issues/{issue_number}/reactions"],
  9849. listForIssueComment: [
  9850. "GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"
  9851. ],
  9852. listForPullRequestReviewComment: [
  9853. "GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"
  9854. ],
  9855. listForRelease: [
  9856. "GET /repos/{owner}/{repo}/releases/{release_id}/reactions"
  9857. ],
  9858. listForTeamDiscussionCommentInOrg: [
  9859. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"
  9860. ],
  9861. listForTeamDiscussionInOrg: [
  9862. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"
  9863. ]
  9864. },
  9865. repos: {
  9866. acceptInvitation: [
  9867. "PATCH /user/repository_invitations/{invitation_id}",
  9868. {},
  9869. { renamed: ["repos", "acceptInvitationForAuthenticatedUser"] }
  9870. ],
  9871. acceptInvitationForAuthenticatedUser: [
  9872. "PATCH /user/repository_invitations/{invitation_id}"
  9873. ],
  9874. addAppAccessRestrictions: [
  9875. "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",
  9876. {},
  9877. { mapToData: "apps" }
  9878. ],
  9879. addCollaborator: ["PUT /repos/{owner}/{repo}/collaborators/{username}"],
  9880. addStatusCheckContexts: [
  9881. "POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",
  9882. {},
  9883. { mapToData: "contexts" }
  9884. ],
  9885. addTeamAccessRestrictions: [
  9886. "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",
  9887. {},
  9888. { mapToData: "teams" }
  9889. ],
  9890. addUserAccessRestrictions: [
  9891. "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",
  9892. {},
  9893. { mapToData: "users" }
  9894. ],
  9895. cancelPagesDeployment: [
  9896. "POST /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}/cancel"
  9897. ],
  9898. checkAutomatedSecurityFixes: [
  9899. "GET /repos/{owner}/{repo}/automated-security-fixes"
  9900. ],
  9901. checkCollaborator: ["GET /repos/{owner}/{repo}/collaborators/{username}"],
  9902. checkVulnerabilityAlerts: [
  9903. "GET /repos/{owner}/{repo}/vulnerability-alerts"
  9904. ],
  9905. codeownersErrors: ["GET /repos/{owner}/{repo}/codeowners/errors"],
  9906. compareCommits: ["GET /repos/{owner}/{repo}/compare/{base}...{head}"],
  9907. compareCommitsWithBasehead: [
  9908. "GET /repos/{owner}/{repo}/compare/{basehead}"
  9909. ],
  9910. createAutolink: ["POST /repos/{owner}/{repo}/autolinks"],
  9911. createCommitComment: [
  9912. "POST /repos/{owner}/{repo}/commits/{commit_sha}/comments"
  9913. ],
  9914. createCommitSignatureProtection: [
  9915. "POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
  9916. ],
  9917. createCommitStatus: ["POST /repos/{owner}/{repo}/statuses/{sha}"],
  9918. createDeployKey: ["POST /repos/{owner}/{repo}/keys"],
  9919. createDeployment: ["POST /repos/{owner}/{repo}/deployments"],
  9920. createDeploymentBranchPolicy: [
  9921. "POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"
  9922. ],
  9923. createDeploymentProtectionRule: [
  9924. "POST /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"
  9925. ],
  9926. createDeploymentStatus: [
  9927. "POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"
  9928. ],
  9929. createDispatchEvent: ["POST /repos/{owner}/{repo}/dispatches"],
  9930. createForAuthenticatedUser: ["POST /user/repos"],
  9931. createFork: ["POST /repos/{owner}/{repo}/forks"],
  9932. createInOrg: ["POST /orgs/{org}/repos"],
  9933. createOrUpdateCustomPropertiesValues: [
  9934. "PATCH /repos/{owner}/{repo}/properties/values"
  9935. ],
  9936. createOrUpdateEnvironment: [
  9937. "PUT /repos/{owner}/{repo}/environments/{environment_name}"
  9938. ],
  9939. createOrUpdateFileContents: ["PUT /repos/{owner}/{repo}/contents/{path}"],
  9940. createOrgRuleset: ["POST /orgs/{org}/rulesets"],
  9941. createPagesDeployment: ["POST /repos/{owner}/{repo}/pages/deployments"],
  9942. createPagesSite: ["POST /repos/{owner}/{repo}/pages"],
  9943. createRelease: ["POST /repos/{owner}/{repo}/releases"],
  9944. createRepoRuleset: ["POST /repos/{owner}/{repo}/rulesets"],
  9945. createTagProtection: ["POST /repos/{owner}/{repo}/tags/protection"],
  9946. createUsingTemplate: [
  9947. "POST /repos/{template_owner}/{template_repo}/generate"
  9948. ],
  9949. createWebhook: ["POST /repos/{owner}/{repo}/hooks"],
  9950. declineInvitation: [
  9951. "DELETE /user/repository_invitations/{invitation_id}",
  9952. {},
  9953. { renamed: ["repos", "declineInvitationForAuthenticatedUser"] }
  9954. ],
  9955. declineInvitationForAuthenticatedUser: [
  9956. "DELETE /user/repository_invitations/{invitation_id}"
  9957. ],
  9958. delete: ["DELETE /repos/{owner}/{repo}"],
  9959. deleteAccessRestrictions: [
  9960. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"
  9961. ],
  9962. deleteAdminBranchProtection: [
  9963. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"
  9964. ],
  9965. deleteAnEnvironment: [
  9966. "DELETE /repos/{owner}/{repo}/environments/{environment_name}"
  9967. ],
  9968. deleteAutolink: ["DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}"],
  9969. deleteBranchProtection: [
  9970. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection"
  9971. ],
  9972. deleteCommitComment: ["DELETE /repos/{owner}/{repo}/comments/{comment_id}"],
  9973. deleteCommitSignatureProtection: [
  9974. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
  9975. ],
  9976. deleteDeployKey: ["DELETE /repos/{owner}/{repo}/keys/{key_id}"],
  9977. deleteDeployment: [
  9978. "DELETE /repos/{owner}/{repo}/deployments/{deployment_id}"
  9979. ],
  9980. deleteDeploymentBranchPolicy: [
  9981. "DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
  9982. ],
  9983. deleteFile: ["DELETE /repos/{owner}/{repo}/contents/{path}"],
  9984. deleteInvitation: [
  9985. "DELETE /repos/{owner}/{repo}/invitations/{invitation_id}"
  9986. ],
  9987. deleteOrgRuleset: ["DELETE /orgs/{org}/rulesets/{ruleset_id}"],
  9988. deletePagesSite: ["DELETE /repos/{owner}/{repo}/pages"],
  9989. deletePullRequestReviewProtection: [
  9990. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
  9991. ],
  9992. deleteRelease: ["DELETE /repos/{owner}/{repo}/releases/{release_id}"],
  9993. deleteReleaseAsset: [
  9994. "DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}"
  9995. ],
  9996. deleteRepoRuleset: ["DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id}"],
  9997. deleteTagProtection: [
  9998. "DELETE /repos/{owner}/{repo}/tags/protection/{tag_protection_id}"
  9999. ],
  10000. deleteWebhook: ["DELETE /repos/{owner}/{repo}/hooks/{hook_id}"],
  10001. disableAutomatedSecurityFixes: [
  10002. "DELETE /repos/{owner}/{repo}/automated-security-fixes"
  10003. ],
  10004. disableDeploymentProtectionRule: [
  10005. "DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"
  10006. ],
  10007. disablePrivateVulnerabilityReporting: [
  10008. "DELETE /repos/{owner}/{repo}/private-vulnerability-reporting"
  10009. ],
  10010. disableVulnerabilityAlerts: [
  10011. "DELETE /repos/{owner}/{repo}/vulnerability-alerts"
  10012. ],
  10013. downloadArchive: [
  10014. "GET /repos/{owner}/{repo}/zipball/{ref}",
  10015. {},
  10016. { renamed: ["repos", "downloadZipballArchive"] }
  10017. ],
  10018. downloadTarballArchive: ["GET /repos/{owner}/{repo}/tarball/{ref}"],
  10019. downloadZipballArchive: ["GET /repos/{owner}/{repo}/zipball/{ref}"],
  10020. enableAutomatedSecurityFixes: [
  10021. "PUT /repos/{owner}/{repo}/automated-security-fixes"
  10022. ],
  10023. enablePrivateVulnerabilityReporting: [
  10024. "PUT /repos/{owner}/{repo}/private-vulnerability-reporting"
  10025. ],
  10026. enableVulnerabilityAlerts: [
  10027. "PUT /repos/{owner}/{repo}/vulnerability-alerts"
  10028. ],
  10029. generateReleaseNotes: [
  10030. "POST /repos/{owner}/{repo}/releases/generate-notes"
  10031. ],
  10032. get: ["GET /repos/{owner}/{repo}"],
  10033. getAccessRestrictions: [
  10034. "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"
  10035. ],
  10036. getAdminBranchProtection: [
  10037. "GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"
  10038. ],
  10039. getAllDeploymentProtectionRules: [
  10040. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"
  10041. ],
  10042. getAllEnvironments: ["GET /repos/{owner}/{repo}/environments"],
  10043. getAllStatusCheckContexts: [
  10044. "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"
  10045. ],
  10046. getAllTopics: ["GET /repos/{owner}/{repo}/topics"],
  10047. getAppsWithAccessToProtectedBranch: [
  10048. "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"
  10049. ],
  10050. getAutolink: ["GET /repos/{owner}/{repo}/autolinks/{autolink_id}"],
  10051. getBranch: ["GET /repos/{owner}/{repo}/branches/{branch}"],
  10052. getBranchProtection: [
  10053. "GET /repos/{owner}/{repo}/branches/{branch}/protection"
  10054. ],
  10055. getBranchRules: ["GET /repos/{owner}/{repo}/rules/branches/{branch}"],
  10056. getClones: ["GET /repos/{owner}/{repo}/traffic/clones"],
  10057. getCodeFrequencyStats: ["GET /repos/{owner}/{repo}/stats/code_frequency"],
  10058. getCollaboratorPermissionLevel: [
  10059. "GET /repos/{owner}/{repo}/collaborators/{username}/permission"
  10060. ],
  10061. getCombinedStatusForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/status"],
  10062. getCommit: ["GET /repos/{owner}/{repo}/commits/{ref}"],
  10063. getCommitActivityStats: ["GET /repos/{owner}/{repo}/stats/commit_activity"],
  10064. getCommitComment: ["GET /repos/{owner}/{repo}/comments/{comment_id}"],
  10065. getCommitSignatureProtection: [
  10066. "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
  10067. ],
  10068. getCommunityProfileMetrics: ["GET /repos/{owner}/{repo}/community/profile"],
  10069. getContent: ["GET /repos/{owner}/{repo}/contents/{path}"],
  10070. getContributorsStats: ["GET /repos/{owner}/{repo}/stats/contributors"],
  10071. getCustomDeploymentProtectionRule: [
  10072. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"
  10073. ],
  10074. getCustomPropertiesValues: ["GET /repos/{owner}/{repo}/properties/values"],
  10075. getDeployKey: ["GET /repos/{owner}/{repo}/keys/{key_id}"],
  10076. getDeployment: ["GET /repos/{owner}/{repo}/deployments/{deployment_id}"],
  10077. getDeploymentBranchPolicy: [
  10078. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
  10079. ],
  10080. getDeploymentStatus: [
  10081. "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}"
  10082. ],
  10083. getEnvironment: [
  10084. "GET /repos/{owner}/{repo}/environments/{environment_name}"
  10085. ],
  10086. getLatestPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/latest"],
  10087. getLatestRelease: ["GET /repos/{owner}/{repo}/releases/latest"],
  10088. getOrgRuleSuite: ["GET /orgs/{org}/rulesets/rule-suites/{rule_suite_id}"],
  10089. getOrgRuleSuites: ["GET /orgs/{org}/rulesets/rule-suites"],
  10090. getOrgRuleset: ["GET /orgs/{org}/rulesets/{ruleset_id}"],
  10091. getOrgRulesets: ["GET /orgs/{org}/rulesets"],
  10092. getPages: ["GET /repos/{owner}/{repo}/pages"],
  10093. getPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/{build_id}"],
  10094. getPagesDeployment: [
  10095. "GET /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}"
  10096. ],
  10097. getPagesHealthCheck: ["GET /repos/{owner}/{repo}/pages/health"],
  10098. getParticipationStats: ["GET /repos/{owner}/{repo}/stats/participation"],
  10099. getPullRequestReviewProtection: [
  10100. "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
  10101. ],
  10102. getPunchCardStats: ["GET /repos/{owner}/{repo}/stats/punch_card"],
  10103. getReadme: ["GET /repos/{owner}/{repo}/readme"],
  10104. getReadmeInDirectory: ["GET /repos/{owner}/{repo}/readme/{dir}"],
  10105. getRelease: ["GET /repos/{owner}/{repo}/releases/{release_id}"],
  10106. getReleaseAsset: ["GET /repos/{owner}/{repo}/releases/assets/{asset_id}"],
  10107. getReleaseByTag: ["GET /repos/{owner}/{repo}/releases/tags/{tag}"],
  10108. getRepoRuleSuite: [
  10109. "GET /repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}"
  10110. ],
  10111. getRepoRuleSuites: ["GET /repos/{owner}/{repo}/rulesets/rule-suites"],
  10112. getRepoRuleset: ["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}"],
  10113. getRepoRulesets: ["GET /repos/{owner}/{repo}/rulesets"],
  10114. getStatusChecksProtection: [
  10115. "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
  10116. ],
  10117. getTeamsWithAccessToProtectedBranch: [
  10118. "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams"
  10119. ],
  10120. getTopPaths: ["GET /repos/{owner}/{repo}/traffic/popular/paths"],
  10121. getTopReferrers: ["GET /repos/{owner}/{repo}/traffic/popular/referrers"],
  10122. getUsersWithAccessToProtectedBranch: [
  10123. "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users"
  10124. ],
  10125. getViews: ["GET /repos/{owner}/{repo}/traffic/views"],
  10126. getWebhook: ["GET /repos/{owner}/{repo}/hooks/{hook_id}"],
  10127. getWebhookConfigForRepo: [
  10128. "GET /repos/{owner}/{repo}/hooks/{hook_id}/config"
  10129. ],
  10130. getWebhookDelivery: [
  10131. "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}"
  10132. ],
  10133. listActivities: ["GET /repos/{owner}/{repo}/activity"],
  10134. listAutolinks: ["GET /repos/{owner}/{repo}/autolinks"],
  10135. listBranches: ["GET /repos/{owner}/{repo}/branches"],
  10136. listBranchesForHeadCommit: [
  10137. "GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head"
  10138. ],
  10139. listCollaborators: ["GET /repos/{owner}/{repo}/collaborators"],
  10140. listCommentsForCommit: [
  10141. "GET /repos/{owner}/{repo}/commits/{commit_sha}/comments"
  10142. ],
  10143. listCommitCommentsForRepo: ["GET /repos/{owner}/{repo}/comments"],
  10144. listCommitStatusesForRef: [
  10145. "GET /repos/{owner}/{repo}/commits/{ref}/statuses"
  10146. ],
  10147. listCommits: ["GET /repos/{owner}/{repo}/commits"],
  10148. listContributors: ["GET /repos/{owner}/{repo}/contributors"],
  10149. listCustomDeploymentRuleIntegrations: [
  10150. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps"
  10151. ],
  10152. listDeployKeys: ["GET /repos/{owner}/{repo}/keys"],
  10153. listDeploymentBranchPolicies: [
  10154. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"
  10155. ],
  10156. listDeploymentStatuses: [
  10157. "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"
  10158. ],
  10159. listDeployments: ["GET /repos/{owner}/{repo}/deployments"],
  10160. listForAuthenticatedUser: ["GET /user/repos"],
  10161. listForOrg: ["GET /orgs/{org}/repos"],
  10162. listForUser: ["GET /users/{username}/repos"],
  10163. listForks: ["GET /repos/{owner}/{repo}/forks"],
  10164. listInvitations: ["GET /repos/{owner}/{repo}/invitations"],
  10165. listInvitationsForAuthenticatedUser: ["GET /user/repository_invitations"],
  10166. listLanguages: ["GET /repos/{owner}/{repo}/languages"],
  10167. listPagesBuilds: ["GET /repos/{owner}/{repo}/pages/builds"],
  10168. listPublic: ["GET /repositories"],
  10169. listPullRequestsAssociatedWithCommit: [
  10170. "GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls"
  10171. ],
  10172. listReleaseAssets: [
  10173. "GET /repos/{owner}/{repo}/releases/{release_id}/assets"
  10174. ],
  10175. listReleases: ["GET /repos/{owner}/{repo}/releases"],
  10176. listTagProtection: ["GET /repos/{owner}/{repo}/tags/protection"],
  10177. listTags: ["GET /repos/{owner}/{repo}/tags"],
  10178. listTeams: ["GET /repos/{owner}/{repo}/teams"],
  10179. listWebhookDeliveries: [
  10180. "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries"
  10181. ],
  10182. listWebhooks: ["GET /repos/{owner}/{repo}/hooks"],
  10183. merge: ["POST /repos/{owner}/{repo}/merges"],
  10184. mergeUpstream: ["POST /repos/{owner}/{repo}/merge-upstream"],
  10185. pingWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/pings"],
  10186. redeliverWebhookDelivery: [
  10187. "POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"
  10188. ],
  10189. removeAppAccessRestrictions: [
  10190. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",
  10191. {},
  10192. { mapToData: "apps" }
  10193. ],
  10194. removeCollaborator: [
  10195. "DELETE /repos/{owner}/{repo}/collaborators/{username}"
  10196. ],
  10197. removeStatusCheckContexts: [
  10198. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",
  10199. {},
  10200. { mapToData: "contexts" }
  10201. ],
  10202. removeStatusCheckProtection: [
  10203. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
  10204. ],
  10205. removeTeamAccessRestrictions: [
  10206. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",
  10207. {},
  10208. { mapToData: "teams" }
  10209. ],
  10210. removeUserAccessRestrictions: [
  10211. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",
  10212. {},
  10213. { mapToData: "users" }
  10214. ],
  10215. renameBranch: ["POST /repos/{owner}/{repo}/branches/{branch}/rename"],
  10216. replaceAllTopics: ["PUT /repos/{owner}/{repo}/topics"],
  10217. requestPagesBuild: ["POST /repos/{owner}/{repo}/pages/builds"],
  10218. setAdminBranchProtection: [
  10219. "POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"
  10220. ],
  10221. setAppAccessRestrictions: [
  10222. "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",
  10223. {},
  10224. { mapToData: "apps" }
  10225. ],
  10226. setStatusCheckContexts: [
  10227. "PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",
  10228. {},
  10229. { mapToData: "contexts" }
  10230. ],
  10231. setTeamAccessRestrictions: [
  10232. "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",
  10233. {},
  10234. { mapToData: "teams" }
  10235. ],
  10236. setUserAccessRestrictions: [
  10237. "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",
  10238. {},
  10239. { mapToData: "users" }
  10240. ],
  10241. testPushWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/tests"],
  10242. transfer: ["POST /repos/{owner}/{repo}/transfer"],
  10243. update: ["PATCH /repos/{owner}/{repo}"],
  10244. updateBranchProtection: [
  10245. "PUT /repos/{owner}/{repo}/branches/{branch}/protection"
  10246. ],
  10247. updateCommitComment: ["PATCH /repos/{owner}/{repo}/comments/{comment_id}"],
  10248. updateDeploymentBranchPolicy: [
  10249. "PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
  10250. ],
  10251. updateInformationAboutPagesSite: ["PUT /repos/{owner}/{repo}/pages"],
  10252. updateInvitation: [
  10253. "PATCH /repos/{owner}/{repo}/invitations/{invitation_id}"
  10254. ],
  10255. updateOrgRuleset: ["PUT /orgs/{org}/rulesets/{ruleset_id}"],
  10256. updatePullRequestReviewProtection: [
  10257. "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
  10258. ],
  10259. updateRelease: ["PATCH /repos/{owner}/{repo}/releases/{release_id}"],
  10260. updateReleaseAsset: [
  10261. "PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}"
  10262. ],
  10263. updateRepoRuleset: ["PUT /repos/{owner}/{repo}/rulesets/{ruleset_id}"],
  10264. updateStatusCheckPotection: [
  10265. "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks",
  10266. {},
  10267. { renamed: ["repos", "updateStatusCheckProtection"] }
  10268. ],
  10269. updateStatusCheckProtection: [
  10270. "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
  10271. ],
  10272. updateWebhook: ["PATCH /repos/{owner}/{repo}/hooks/{hook_id}"],
  10273. updateWebhookConfigForRepo: [
  10274. "PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config"
  10275. ],
  10276. uploadReleaseAsset: [
  10277. "POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}",
  10278. { baseUrl: "https://uploads.github.com" }
  10279. ]
  10280. },
  10281. search: {
  10282. code: ["GET /search/code"],
  10283. commits: ["GET /search/commits"],
  10284. issuesAndPullRequests: ["GET /search/issues"],
  10285. labels: ["GET /search/labels"],
  10286. repos: ["GET /search/repositories"],
  10287. topics: ["GET /search/topics"],
  10288. users: ["GET /search/users"]
  10289. },
  10290. secretScanning: {
  10291. getAlert: [
  10292. "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"
  10293. ],
  10294. listAlertsForEnterprise: [
  10295. "GET /enterprises/{enterprise}/secret-scanning/alerts"
  10296. ],
  10297. listAlertsForOrg: ["GET /orgs/{org}/secret-scanning/alerts"],
  10298. listAlertsForRepo: ["GET /repos/{owner}/{repo}/secret-scanning/alerts"],
  10299. listLocationsForAlert: [
  10300. "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations"
  10301. ],
  10302. updateAlert: [
  10303. "PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"
  10304. ]
  10305. },
  10306. securityAdvisories: {
  10307. createFork: [
  10308. "POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/forks"
  10309. ],
  10310. createPrivateVulnerabilityReport: [
  10311. "POST /repos/{owner}/{repo}/security-advisories/reports"
  10312. ],
  10313. createRepositoryAdvisory: [
  10314. "POST /repos/{owner}/{repo}/security-advisories"
  10315. ],
  10316. createRepositoryAdvisoryCveRequest: [
  10317. "POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/cve"
  10318. ],
  10319. getGlobalAdvisory: ["GET /advisories/{ghsa_id}"],
  10320. getRepositoryAdvisory: [
  10321. "GET /repos/{owner}/{repo}/security-advisories/{ghsa_id}"
  10322. ],
  10323. listGlobalAdvisories: ["GET /advisories"],
  10324. listOrgRepositoryAdvisories: ["GET /orgs/{org}/security-advisories"],
  10325. listRepositoryAdvisories: ["GET /repos/{owner}/{repo}/security-advisories"],
  10326. updateRepositoryAdvisory: [
  10327. "PATCH /repos/{owner}/{repo}/security-advisories/{ghsa_id}"
  10328. ]
  10329. },
  10330. teams: {
  10331. addOrUpdateMembershipForUserInOrg: [
  10332. "PUT /orgs/{org}/teams/{team_slug}/memberships/{username}"
  10333. ],
  10334. addOrUpdateProjectPermissionsInOrg: [
  10335. "PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}"
  10336. ],
  10337. addOrUpdateRepoPermissionsInOrg: [
  10338. "PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
  10339. ],
  10340. checkPermissionsForProjectInOrg: [
  10341. "GET /orgs/{org}/teams/{team_slug}/projects/{project_id}"
  10342. ],
  10343. checkPermissionsForRepoInOrg: [
  10344. "GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
  10345. ],
  10346. create: ["POST /orgs/{org}/teams"],
  10347. createDiscussionCommentInOrg: [
  10348. "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"
  10349. ],
  10350. createDiscussionInOrg: ["POST /orgs/{org}/teams/{team_slug}/discussions"],
  10351. deleteDiscussionCommentInOrg: [
  10352. "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"
  10353. ],
  10354. deleteDiscussionInOrg: [
  10355. "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"
  10356. ],
  10357. deleteInOrg: ["DELETE /orgs/{org}/teams/{team_slug}"],
  10358. getByName: ["GET /orgs/{org}/teams/{team_slug}"],
  10359. getDiscussionCommentInOrg: [
  10360. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"
  10361. ],
  10362. getDiscussionInOrg: [
  10363. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"
  10364. ],
  10365. getMembershipForUserInOrg: [
  10366. "GET /orgs/{org}/teams/{team_slug}/memberships/{username}"
  10367. ],
  10368. list: ["GET /orgs/{org}/teams"],
  10369. listChildInOrg: ["GET /orgs/{org}/teams/{team_slug}/teams"],
  10370. listDiscussionCommentsInOrg: [
  10371. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"
  10372. ],
  10373. listDiscussionsInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions"],
  10374. listForAuthenticatedUser: ["GET /user/teams"],
  10375. listMembersInOrg: ["GET /orgs/{org}/teams/{team_slug}/members"],
  10376. listPendingInvitationsInOrg: [
  10377. "GET /orgs/{org}/teams/{team_slug}/invitations"
  10378. ],
  10379. listProjectsInOrg: ["GET /orgs/{org}/teams/{team_slug}/projects"],
  10380. listReposInOrg: ["GET /orgs/{org}/teams/{team_slug}/repos"],
  10381. removeMembershipForUserInOrg: [
  10382. "DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}"
  10383. ],
  10384. removeProjectInOrg: [
  10385. "DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}"
  10386. ],
  10387. removeRepoInOrg: [
  10388. "DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
  10389. ],
  10390. updateDiscussionCommentInOrg: [
  10391. "PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"
  10392. ],
  10393. updateDiscussionInOrg: [
  10394. "PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"
  10395. ],
  10396. updateInOrg: ["PATCH /orgs/{org}/teams/{team_slug}"]
  10397. },
  10398. users: {
  10399. addEmailForAuthenticated: [
  10400. "POST /user/emails",
  10401. {},
  10402. { renamed: ["users", "addEmailForAuthenticatedUser"] }
  10403. ],
  10404. addEmailForAuthenticatedUser: ["POST /user/emails"],
  10405. addSocialAccountForAuthenticatedUser: ["POST /user/social_accounts"],
  10406. block: ["PUT /user/blocks/{username}"],
  10407. checkBlocked: ["GET /user/blocks/{username}"],
  10408. checkFollowingForUser: ["GET /users/{username}/following/{target_user}"],
  10409. checkPersonIsFollowedByAuthenticated: ["GET /user/following/{username}"],
  10410. createGpgKeyForAuthenticated: [
  10411. "POST /user/gpg_keys",
  10412. {},
  10413. { renamed: ["users", "createGpgKeyForAuthenticatedUser"] }
  10414. ],
  10415. createGpgKeyForAuthenticatedUser: ["POST /user/gpg_keys"],
  10416. createPublicSshKeyForAuthenticated: [
  10417. "POST /user/keys",
  10418. {},
  10419. { renamed: ["users", "createPublicSshKeyForAuthenticatedUser"] }
  10420. ],
  10421. createPublicSshKeyForAuthenticatedUser: ["POST /user/keys"],
  10422. createSshSigningKeyForAuthenticatedUser: ["POST /user/ssh_signing_keys"],
  10423. deleteEmailForAuthenticated: [
  10424. "DELETE /user/emails",
  10425. {},
  10426. { renamed: ["users", "deleteEmailForAuthenticatedUser"] }
  10427. ],
  10428. deleteEmailForAuthenticatedUser: ["DELETE /user/emails"],
  10429. deleteGpgKeyForAuthenticated: [
  10430. "DELETE /user/gpg_keys/{gpg_key_id}",
  10431. {},
  10432. { renamed: ["users", "deleteGpgKeyForAuthenticatedUser"] }
  10433. ],
  10434. deleteGpgKeyForAuthenticatedUser: ["DELETE /user/gpg_keys/{gpg_key_id}"],
  10435. deletePublicSshKeyForAuthenticated: [
  10436. "DELETE /user/keys/{key_id}",
  10437. {},
  10438. { renamed: ["users", "deletePublicSshKeyForAuthenticatedUser"] }
  10439. ],
  10440. deletePublicSshKeyForAuthenticatedUser: ["DELETE /user/keys/{key_id}"],
  10441. deleteSocialAccountForAuthenticatedUser: ["DELETE /user/social_accounts"],
  10442. deleteSshSigningKeyForAuthenticatedUser: [
  10443. "DELETE /user/ssh_signing_keys/{ssh_signing_key_id}"
  10444. ],
  10445. follow: ["PUT /user/following/{username}"],
  10446. getAuthenticated: ["GET /user"],
  10447. getByUsername: ["GET /users/{username}"],
  10448. getContextForUser: ["GET /users/{username}/hovercard"],
  10449. getGpgKeyForAuthenticated: [
  10450. "GET /user/gpg_keys/{gpg_key_id}",
  10451. {},
  10452. { renamed: ["users", "getGpgKeyForAuthenticatedUser"] }
  10453. ],
  10454. getGpgKeyForAuthenticatedUser: ["GET /user/gpg_keys/{gpg_key_id}"],
  10455. getPublicSshKeyForAuthenticated: [
  10456. "GET /user/keys/{key_id}",
  10457. {},
  10458. { renamed: ["users", "getPublicSshKeyForAuthenticatedUser"] }
  10459. ],
  10460. getPublicSshKeyForAuthenticatedUser: ["GET /user/keys/{key_id}"],
  10461. getSshSigningKeyForAuthenticatedUser: [
  10462. "GET /user/ssh_signing_keys/{ssh_signing_key_id}"
  10463. ],
  10464. list: ["GET /users"],
  10465. listBlockedByAuthenticated: [
  10466. "GET /user/blocks",
  10467. {},
  10468. { renamed: ["users", "listBlockedByAuthenticatedUser"] }
  10469. ],
  10470. listBlockedByAuthenticatedUser: ["GET /user/blocks"],
  10471. listEmailsForAuthenticated: [
  10472. "GET /user/emails",
  10473. {},
  10474. { renamed: ["users", "listEmailsForAuthenticatedUser"] }
  10475. ],
  10476. listEmailsForAuthenticatedUser: ["GET /user/emails"],
  10477. listFollowedByAuthenticated: [
  10478. "GET /user/following",
  10479. {},
  10480. { renamed: ["users", "listFollowedByAuthenticatedUser"] }
  10481. ],
  10482. listFollowedByAuthenticatedUser: ["GET /user/following"],
  10483. listFollowersForAuthenticatedUser: ["GET /user/followers"],
  10484. listFollowersForUser: ["GET /users/{username}/followers"],
  10485. listFollowingForUser: ["GET /users/{username}/following"],
  10486. listGpgKeysForAuthenticated: [
  10487. "GET /user/gpg_keys",
  10488. {},
  10489. { renamed: ["users", "listGpgKeysForAuthenticatedUser"] }
  10490. ],
  10491. listGpgKeysForAuthenticatedUser: ["GET /user/gpg_keys"],
  10492. listGpgKeysForUser: ["GET /users/{username}/gpg_keys"],
  10493. listPublicEmailsForAuthenticated: [
  10494. "GET /user/public_emails",
  10495. {},
  10496. { renamed: ["users", "listPublicEmailsForAuthenticatedUser"] }
  10497. ],
  10498. listPublicEmailsForAuthenticatedUser: ["GET /user/public_emails"],
  10499. listPublicKeysForUser: ["GET /users/{username}/keys"],
  10500. listPublicSshKeysForAuthenticated: [
  10501. "GET /user/keys",
  10502. {},
  10503. { renamed: ["users", "listPublicSshKeysForAuthenticatedUser"] }
  10504. ],
  10505. listPublicSshKeysForAuthenticatedUser: ["GET /user/keys"],
  10506. listSocialAccountsForAuthenticatedUser: ["GET /user/social_accounts"],
  10507. listSocialAccountsForUser: ["GET /users/{username}/social_accounts"],
  10508. listSshSigningKeysForAuthenticatedUser: ["GET /user/ssh_signing_keys"],
  10509. listSshSigningKeysForUser: ["GET /users/{username}/ssh_signing_keys"],
  10510. setPrimaryEmailVisibilityForAuthenticated: [
  10511. "PATCH /user/email/visibility",
  10512. {},
  10513. { renamed: ["users", "setPrimaryEmailVisibilityForAuthenticatedUser"] }
  10514. ],
  10515. setPrimaryEmailVisibilityForAuthenticatedUser: [
  10516. "PATCH /user/email/visibility"
  10517. ],
  10518. unblock: ["DELETE /user/blocks/{username}"],
  10519. unfollow: ["DELETE /user/following/{username}"],
  10520. updateAuthenticated: ["PATCH /user"]
  10521. }
  10522. };
  10523. var endpoints_default = Endpoints;
  10524. // pkg/dist-src/endpoints-to-methods.js
  10525. var endpointMethodsMap = /* @__PURE__ */ new Map();
  10526. for (const [scope, endpoints] of Object.entries(endpoints_default)) {
  10527. for (const [methodName, endpoint] of Object.entries(endpoints)) {
  10528. const [route, defaults, decorations] = endpoint;
  10529. const [method, url] = route.split(/ /);
  10530. const endpointDefaults = Object.assign(
  10531. {
  10532. method,
  10533. url
  10534. },
  10535. defaults
  10536. );
  10537. if (!endpointMethodsMap.has(scope)) {
  10538. endpointMethodsMap.set(scope, /* @__PURE__ */ new Map());
  10539. }
  10540. endpointMethodsMap.get(scope).set(methodName, {
  10541. scope,
  10542. methodName,
  10543. endpointDefaults,
  10544. decorations
  10545. });
  10546. }
  10547. }
  10548. var handler = {
  10549. has({ scope }, methodName) {
  10550. return endpointMethodsMap.get(scope).has(methodName);
  10551. },
  10552. getOwnPropertyDescriptor(target, methodName) {
  10553. return {
  10554. value: this.get(target, methodName),
  10555. // ensures method is in the cache
  10556. configurable: true,
  10557. writable: true,
  10558. enumerable: true
  10559. };
  10560. },
  10561. defineProperty(target, methodName, descriptor) {
  10562. Object.defineProperty(target.cache, methodName, descriptor);
  10563. return true;
  10564. },
  10565. deleteProperty(target, methodName) {
  10566. delete target.cache[methodName];
  10567. return true;
  10568. },
  10569. ownKeys({ scope }) {
  10570. return [...endpointMethodsMap.get(scope).keys()];
  10571. },
  10572. set(target, methodName, value) {
  10573. return target.cache[methodName] = value;
  10574. },
  10575. get({ octokit, scope, cache }, methodName) {
  10576. if (cache[methodName]) {
  10577. return cache[methodName];
  10578. }
  10579. const method = endpointMethodsMap.get(scope).get(methodName);
  10580. if (!method) {
  10581. return void 0;
  10582. }
  10583. const { endpointDefaults, decorations } = method;
  10584. if (decorations) {
  10585. cache[methodName] = decorate(
  10586. octokit,
  10587. scope,
  10588. methodName,
  10589. endpointDefaults,
  10590. decorations
  10591. );
  10592. } else {
  10593. cache[methodName] = octokit.request.defaults(endpointDefaults);
  10594. }
  10595. return cache[methodName];
  10596. }
  10597. };
  10598. function endpointsToMethods(octokit) {
  10599. const newMethods = {};
  10600. for (const scope of endpointMethodsMap.keys()) {
  10601. newMethods[scope] = new Proxy({ octokit, scope, cache: {} }, handler);
  10602. }
  10603. return newMethods;
  10604. }
  10605. function decorate(octokit, scope, methodName, defaults, decorations) {
  10606. const requestWithDefaults = octokit.request.defaults(defaults);
  10607. function withDecorations(...args) {
  10608. let options = requestWithDefaults.endpoint.merge(...args);
  10609. if (decorations.mapToData) {
  10610. options = Object.assign({}, options, {
  10611. data: options[decorations.mapToData],
  10612. [decorations.mapToData]: void 0
  10613. });
  10614. return requestWithDefaults(options);
  10615. }
  10616. if (decorations.renamed) {
  10617. const [newScope, newMethodName] = decorations.renamed;
  10618. octokit.log.warn(
  10619. `octokit.${scope}.${methodName}() has been renamed to octokit.${newScope}.${newMethodName}()`
  10620. );
  10621. }
  10622. if (decorations.deprecated) {
  10623. octokit.log.warn(decorations.deprecated);
  10624. }
  10625. if (decorations.renamedParameters) {
  10626. const options2 = requestWithDefaults.endpoint.merge(...args);
  10627. for (const [name, alias] of Object.entries(
  10628. decorations.renamedParameters
  10629. )) {
  10630. if (name in options2) {
  10631. octokit.log.warn(
  10632. `"${name}" parameter is deprecated for "octokit.${scope}.${methodName}()". Use "${alias}" instead`
  10633. );
  10634. if (!(alias in options2)) {
  10635. options2[alias] = options2[name];
  10636. }
  10637. delete options2[name];
  10638. }
  10639. }
  10640. return requestWithDefaults(options2);
  10641. }
  10642. return requestWithDefaults(...args);
  10643. }
  10644. return Object.assign(withDecorations, requestWithDefaults);
  10645. }
  10646. // pkg/dist-src/index.js
  10647. function restEndpointMethods(octokit) {
  10648. const api = endpointsToMethods(octokit);
  10649. return {
  10650. rest: api
  10651. };
  10652. }
  10653. restEndpointMethods.VERSION = VERSION;
  10654. function legacyRestEndpointMethods(octokit) {
  10655. const api = endpointsToMethods(octokit);
  10656. return {
  10657. ...api,
  10658. rest: api
  10659. };
  10660. }
  10661. legacyRestEndpointMethods.VERSION = VERSION;
  10662. // Annotate the CommonJS export names for ESM import in node:
  10663. 0 && (0);
  10664. /***/ }),
  10665. /***/ 537:
  10666. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  10667. "use strict";
  10668. var __create = Object.create;
  10669. var __defProp = Object.defineProperty;
  10670. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  10671. var __getOwnPropNames = Object.getOwnPropertyNames;
  10672. var __getProtoOf = Object.getPrototypeOf;
  10673. var __hasOwnProp = Object.prototype.hasOwnProperty;
  10674. var __export = (target, all) => {
  10675. for (var name in all)
  10676. __defProp(target, name, { get: all[name], enumerable: true });
  10677. };
  10678. var __copyProps = (to, from, except, desc) => {
  10679. if (from && typeof from === "object" || typeof from === "function") {
  10680. for (let key of __getOwnPropNames(from))
  10681. if (!__hasOwnProp.call(to, key) && key !== except)
  10682. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  10683. }
  10684. return to;
  10685. };
  10686. var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  10687. // If the importer is in node compatibility mode or this is not an ESM
  10688. // file that has been converted to a CommonJS file using a Babel-
  10689. // compatible transform (i.e. "__esModule" has not been set), then set
  10690. // "default" to the CommonJS "module.exports" for node compatibility.
  10691. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  10692. mod
  10693. ));
  10694. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  10695. // pkg/dist-src/index.js
  10696. var dist_src_exports = {};
  10697. __export(dist_src_exports, {
  10698. RequestError: () => RequestError
  10699. });
  10700. module.exports = __toCommonJS(dist_src_exports);
  10701. var import_deprecation = __nccwpck_require__(8932);
  10702. var import_once = __toESM(__nccwpck_require__(1223));
  10703. var logOnceCode = (0, import_once.default)((deprecation) => console.warn(deprecation));
  10704. var logOnceHeaders = (0, import_once.default)((deprecation) => console.warn(deprecation));
  10705. var RequestError = class extends Error {
  10706. constructor(message, statusCode, options) {
  10707. super(message);
  10708. if (Error.captureStackTrace) {
  10709. Error.captureStackTrace(this, this.constructor);
  10710. }
  10711. this.name = "HttpError";
  10712. this.status = statusCode;
  10713. let headers;
  10714. if ("headers" in options && typeof options.headers !== "undefined") {
  10715. headers = options.headers;
  10716. }
  10717. if ("response" in options) {
  10718. this.response = options.response;
  10719. headers = options.response.headers;
  10720. }
  10721. const requestCopy = Object.assign({}, options.request);
  10722. if (options.request.headers.authorization) {
  10723. requestCopy.headers = Object.assign({}, options.request.headers, {
  10724. authorization: options.request.headers.authorization.replace(
  10725. /(?<! ) .*$/,
  10726. " [REDACTED]"
  10727. )
  10728. });
  10729. }
  10730. requestCopy.url = requestCopy.url.replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]").replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
  10731. this.request = requestCopy;
  10732. Object.defineProperty(this, "code", {
  10733. get() {
  10734. logOnceCode(
  10735. new import_deprecation.Deprecation(
  10736. "[@octokit/request-error] `error.code` is deprecated, use `error.status`."
  10737. )
  10738. );
  10739. return statusCode;
  10740. }
  10741. });
  10742. Object.defineProperty(this, "headers", {
  10743. get() {
  10744. logOnceHeaders(
  10745. new import_deprecation.Deprecation(
  10746. "[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`."
  10747. )
  10748. );
  10749. return headers || {};
  10750. }
  10751. });
  10752. }
  10753. };
  10754. // Annotate the CommonJS export names for ESM import in node:
  10755. 0 && (0);
  10756. /***/ }),
  10757. /***/ 6234:
  10758. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  10759. "use strict";
  10760. var __defProp = Object.defineProperty;
  10761. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  10762. var __getOwnPropNames = Object.getOwnPropertyNames;
  10763. var __hasOwnProp = Object.prototype.hasOwnProperty;
  10764. var __export = (target, all) => {
  10765. for (var name in all)
  10766. __defProp(target, name, { get: all[name], enumerable: true });
  10767. };
  10768. var __copyProps = (to, from, except, desc) => {
  10769. if (from && typeof from === "object" || typeof from === "function") {
  10770. for (let key of __getOwnPropNames(from))
  10771. if (!__hasOwnProp.call(to, key) && key !== except)
  10772. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  10773. }
  10774. return to;
  10775. };
  10776. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  10777. // pkg/dist-src/index.js
  10778. var dist_src_exports = {};
  10779. __export(dist_src_exports, {
  10780. request: () => request
  10781. });
  10782. module.exports = __toCommonJS(dist_src_exports);
  10783. var import_endpoint = __nccwpck_require__(9440);
  10784. var import_universal_user_agent = __nccwpck_require__(5030);
  10785. // pkg/dist-src/version.js
  10786. var VERSION = "8.4.1";
  10787. // pkg/dist-src/is-plain-object.js
  10788. function isPlainObject(value) {
  10789. if (typeof value !== "object" || value === null)
  10790. return false;
  10791. if (Object.prototype.toString.call(value) !== "[object Object]")
  10792. return false;
  10793. const proto = Object.getPrototypeOf(value);
  10794. if (proto === null)
  10795. return true;
  10796. const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
  10797. return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
  10798. }
  10799. // pkg/dist-src/fetch-wrapper.js
  10800. var import_request_error = __nccwpck_require__(537);
  10801. // pkg/dist-src/get-buffer-response.js
  10802. function getBufferResponse(response) {
  10803. return response.arrayBuffer();
  10804. }
  10805. // pkg/dist-src/fetch-wrapper.js
  10806. function fetchWrapper(requestOptions) {
  10807. var _a, _b, _c, _d;
  10808. const log = requestOptions.request && requestOptions.request.log ? requestOptions.request.log : console;
  10809. const parseSuccessResponseBody = ((_a = requestOptions.request) == null ? void 0 : _a.parseSuccessResponseBody) !== false;
  10810. if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {
  10811. requestOptions.body = JSON.stringify(requestOptions.body);
  10812. }
  10813. let headers = {};
  10814. let status;
  10815. let url;
  10816. let { fetch } = globalThis;
  10817. if ((_b = requestOptions.request) == null ? void 0 : _b.fetch) {
  10818. fetch = requestOptions.request.fetch;
  10819. }
  10820. if (!fetch) {
  10821. throw new Error(
  10822. "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"
  10823. );
  10824. }
  10825. return fetch(requestOptions.url, {
  10826. method: requestOptions.method,
  10827. body: requestOptions.body,
  10828. redirect: (_c = requestOptions.request) == null ? void 0 : _c.redirect,
  10829. headers: requestOptions.headers,
  10830. signal: (_d = requestOptions.request) == null ? void 0 : _d.signal,
  10831. // duplex must be set if request.body is ReadableStream or Async Iterables.
  10832. // See https://fetch.spec.whatwg.org/#dom-requestinit-duplex.
  10833. ...requestOptions.body && { duplex: "half" }
  10834. }).then(async (response) => {
  10835. url = response.url;
  10836. status = response.status;
  10837. for (const keyAndValue of response.headers) {
  10838. headers[keyAndValue[0]] = keyAndValue[1];
  10839. }
  10840. if ("deprecation" in headers) {
  10841. const matches = headers.link && headers.link.match(/<([^<>]+)>; rel="deprecation"/);
  10842. const deprecationLink = matches && matches.pop();
  10843. log.warn(
  10844. `[@octokit/request] "${requestOptions.method} ${requestOptions.url}" is deprecated. It is scheduled to be removed on ${headers.sunset}${deprecationLink ? `. See ${deprecationLink}` : ""}`
  10845. );
  10846. }
  10847. if (status === 204 || status === 205) {
  10848. return;
  10849. }
  10850. if (requestOptions.method === "HEAD") {
  10851. if (status < 400) {
  10852. return;
  10853. }
  10854. throw new import_request_error.RequestError(response.statusText, status, {
  10855. response: {
  10856. url,
  10857. status,
  10858. headers,
  10859. data: void 0
  10860. },
  10861. request: requestOptions
  10862. });
  10863. }
  10864. if (status === 304) {
  10865. throw new import_request_error.RequestError("Not modified", status, {
  10866. response: {
  10867. url,
  10868. status,
  10869. headers,
  10870. data: await getResponseData(response)
  10871. },
  10872. request: requestOptions
  10873. });
  10874. }
  10875. if (status >= 400) {
  10876. const data = await getResponseData(response);
  10877. const error = new import_request_error.RequestError(toErrorMessage(data), status, {
  10878. response: {
  10879. url,
  10880. status,
  10881. headers,
  10882. data
  10883. },
  10884. request: requestOptions
  10885. });
  10886. throw error;
  10887. }
  10888. return parseSuccessResponseBody ? await getResponseData(response) : response.body;
  10889. }).then((data) => {
  10890. return {
  10891. status,
  10892. url,
  10893. headers,
  10894. data
  10895. };
  10896. }).catch((error) => {
  10897. if (error instanceof import_request_error.RequestError)
  10898. throw error;
  10899. else if (error.name === "AbortError")
  10900. throw error;
  10901. let message = error.message;
  10902. if (error.name === "TypeError" && "cause" in error) {
  10903. if (error.cause instanceof Error) {
  10904. message = error.cause.message;
  10905. } else if (typeof error.cause === "string") {
  10906. message = error.cause;
  10907. }
  10908. }
  10909. throw new import_request_error.RequestError(message, 500, {
  10910. request: requestOptions
  10911. });
  10912. });
  10913. }
  10914. async function getResponseData(response) {
  10915. const contentType = response.headers.get("content-type");
  10916. if (/application\/json/.test(contentType)) {
  10917. return response.json().catch(() => response.text()).catch(() => "");
  10918. }
  10919. if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) {
  10920. return response.text();
  10921. }
  10922. return getBufferResponse(response);
  10923. }
  10924. function toErrorMessage(data) {
  10925. if (typeof data === "string")
  10926. return data;
  10927. let suffix;
  10928. if ("documentation_url" in data) {
  10929. suffix = ` - ${data.documentation_url}`;
  10930. } else {
  10931. suffix = "";
  10932. }
  10933. if ("message" in data) {
  10934. if (Array.isArray(data.errors)) {
  10935. return `${data.message}: ${data.errors.map(JSON.stringify).join(", ")}${suffix}`;
  10936. }
  10937. return `${data.message}${suffix}`;
  10938. }
  10939. return `Unknown error: ${JSON.stringify(data)}`;
  10940. }
  10941. // pkg/dist-src/with-defaults.js
  10942. function withDefaults(oldEndpoint, newDefaults) {
  10943. const endpoint2 = oldEndpoint.defaults(newDefaults);
  10944. const newApi = function(route, parameters) {
  10945. const endpointOptions = endpoint2.merge(route, parameters);
  10946. if (!endpointOptions.request || !endpointOptions.request.hook) {
  10947. return fetchWrapper(endpoint2.parse(endpointOptions));
  10948. }
  10949. const request2 = (route2, parameters2) => {
  10950. return fetchWrapper(
  10951. endpoint2.parse(endpoint2.merge(route2, parameters2))
  10952. );
  10953. };
  10954. Object.assign(request2, {
  10955. endpoint: endpoint2,
  10956. defaults: withDefaults.bind(null, endpoint2)
  10957. });
  10958. return endpointOptions.request.hook(request2, endpointOptions);
  10959. };
  10960. return Object.assign(newApi, {
  10961. endpoint: endpoint2,
  10962. defaults: withDefaults.bind(null, endpoint2)
  10963. });
  10964. }
  10965. // pkg/dist-src/index.js
  10966. var request = withDefaults(import_endpoint.endpoint, {
  10967. headers: {
  10968. "user-agent": `octokit-request.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`
  10969. }
  10970. });
  10971. // Annotate the CommonJS export names for ESM import in node:
  10972. 0 && (0);
  10973. /***/ }),
  10974. /***/ 3682:
  10975. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  10976. var register = __nccwpck_require__(4670);
  10977. var addHook = __nccwpck_require__(5549);
  10978. var removeHook = __nccwpck_require__(6819);
  10979. // bind with array of arguments: https://stackoverflow.com/a/21792913
  10980. var bind = Function.bind;
  10981. var bindable = bind.bind(bind);
  10982. function bindApi(hook, state, name) {
  10983. var removeHookRef = bindable(removeHook, null).apply(
  10984. null,
  10985. name ? [state, name] : [state]
  10986. );
  10987. hook.api = { remove: removeHookRef };
  10988. hook.remove = removeHookRef;
  10989. ["before", "error", "after", "wrap"].forEach(function (kind) {
  10990. var args = name ? [state, kind, name] : [state, kind];
  10991. hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args);
  10992. });
  10993. }
  10994. function HookSingular() {
  10995. var singularHookName = "h";
  10996. var singularHookState = {
  10997. registry: {},
  10998. };
  10999. var singularHook = register.bind(null, singularHookState, singularHookName);
  11000. bindApi(singularHook, singularHookState, singularHookName);
  11001. return singularHook;
  11002. }
  11003. function HookCollection() {
  11004. var state = {
  11005. registry: {},
  11006. };
  11007. var hook = register.bind(null, state);
  11008. bindApi(hook, state);
  11009. return hook;
  11010. }
  11011. var collectionHookDeprecationMessageDisplayed = false;
  11012. function Hook() {
  11013. if (!collectionHookDeprecationMessageDisplayed) {
  11014. console.warn(
  11015. '[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4'
  11016. );
  11017. collectionHookDeprecationMessageDisplayed = true;
  11018. }
  11019. return HookCollection();
  11020. }
  11021. Hook.Singular = HookSingular.bind();
  11022. Hook.Collection = HookCollection.bind();
  11023. module.exports = Hook;
  11024. // expose constructors as a named property for TypeScript
  11025. module.exports.Hook = Hook;
  11026. module.exports.Singular = Hook.Singular;
  11027. module.exports.Collection = Hook.Collection;
  11028. /***/ }),
  11029. /***/ 5549:
  11030. /***/ ((module) => {
  11031. module.exports = addHook;
  11032. function addHook(state, kind, name, hook) {
  11033. var orig = hook;
  11034. if (!state.registry[name]) {
  11035. state.registry[name] = [];
  11036. }
  11037. if (kind === "before") {
  11038. hook = function (method, options) {
  11039. return Promise.resolve()
  11040. .then(orig.bind(null, options))
  11041. .then(method.bind(null, options));
  11042. };
  11043. }
  11044. if (kind === "after") {
  11045. hook = function (method, options) {
  11046. var result;
  11047. return Promise.resolve()
  11048. .then(method.bind(null, options))
  11049. .then(function (result_) {
  11050. result = result_;
  11051. return orig(result, options);
  11052. })
  11053. .then(function () {
  11054. return result;
  11055. });
  11056. };
  11057. }
  11058. if (kind === "error") {
  11059. hook = function (method, options) {
  11060. return Promise.resolve()
  11061. .then(method.bind(null, options))
  11062. .catch(function (error) {
  11063. return orig(error, options);
  11064. });
  11065. };
  11066. }
  11067. state.registry[name].push({
  11068. hook: hook,
  11069. orig: orig,
  11070. });
  11071. }
  11072. /***/ }),
  11073. /***/ 4670:
  11074. /***/ ((module) => {
  11075. module.exports = register;
  11076. function register(state, name, method, options) {
  11077. if (typeof method !== "function") {
  11078. throw new Error("method for before hook must be a function");
  11079. }
  11080. if (!options) {
  11081. options = {};
  11082. }
  11083. if (Array.isArray(name)) {
  11084. return name.reverse().reduce(function (callback, name) {
  11085. return register.bind(null, state, name, callback, options);
  11086. }, method)();
  11087. }
  11088. return Promise.resolve().then(function () {
  11089. if (!state.registry[name]) {
  11090. return method(options);
  11091. }
  11092. return state.registry[name].reduce(function (method, registered) {
  11093. return registered.hook.bind(null, method, options);
  11094. }, method)();
  11095. });
  11096. }
  11097. /***/ }),
  11098. /***/ 6819:
  11099. /***/ ((module) => {
  11100. module.exports = removeHook;
  11101. function removeHook(state, name, method) {
  11102. if (!state.registry[name]) {
  11103. return;
  11104. }
  11105. var index = state.registry[name]
  11106. .map(function (registered) {
  11107. return registered.orig;
  11108. })
  11109. .indexOf(method);
  11110. if (index === -1) {
  11111. return;
  11112. }
  11113. state.registry[name].splice(index, 1);
  11114. }
  11115. /***/ }),
  11116. /***/ 8932:
  11117. /***/ ((__unused_webpack_module, exports) => {
  11118. "use strict";
  11119. Object.defineProperty(exports, "__esModule", ({ value: true }));
  11120. class Deprecation extends Error {
  11121. constructor(message) {
  11122. super(message); // Maintains proper stack trace (only available on V8)
  11123. /* istanbul ignore next */
  11124. if (Error.captureStackTrace) {
  11125. Error.captureStackTrace(this, this.constructor);
  11126. }
  11127. this.name = 'Deprecation';
  11128. }
  11129. }
  11130. exports.Deprecation = Deprecation;
  11131. /***/ }),
  11132. /***/ 1223:
  11133. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  11134. var wrappy = __nccwpck_require__(2940)
  11135. module.exports = wrappy(once)
  11136. module.exports.strict = wrappy(onceStrict)
  11137. once.proto = once(function () {
  11138. Object.defineProperty(Function.prototype, 'once', {
  11139. value: function () {
  11140. return once(this)
  11141. },
  11142. configurable: true
  11143. })
  11144. Object.defineProperty(Function.prototype, 'onceStrict', {
  11145. value: function () {
  11146. return onceStrict(this)
  11147. },
  11148. configurable: true
  11149. })
  11150. })
  11151. function once (fn) {
  11152. var f = function () {
  11153. if (f.called) return f.value
  11154. f.called = true
  11155. return f.value = fn.apply(this, arguments)
  11156. }
  11157. f.called = false
  11158. return f
  11159. }
  11160. function onceStrict (fn) {
  11161. var f = function () {
  11162. if (f.called)
  11163. throw new Error(f.onceError)
  11164. f.called = true
  11165. return f.value = fn.apply(this, arguments)
  11166. }
  11167. var name = fn.name || 'Function wrapped with `once`'
  11168. f.onceError = name + " shouldn't be called more than once"
  11169. f.called = false
  11170. return f
  11171. }
  11172. /***/ }),
  11173. /***/ 5911:
  11174. /***/ ((module, exports) => {
  11175. exports = module.exports = SemVer
  11176. var debug
  11177. /* istanbul ignore next */
  11178. if (typeof process === 'object' &&
  11179. process.env &&
  11180. process.env.NODE_DEBUG &&
  11181. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  11182. debug = function () {
  11183. var args = Array.prototype.slice.call(arguments, 0)
  11184. args.unshift('SEMVER')
  11185. console.log.apply(console, args)
  11186. }
  11187. } else {
  11188. debug = function () {}
  11189. }
  11190. // Note: this is the semver.org version of the spec that it implements
  11191. // Not necessarily the package version of this code.
  11192. exports.SEMVER_SPEC_VERSION = '2.0.0'
  11193. var MAX_LENGTH = 256
  11194. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  11195. /* istanbul ignore next */ 9007199254740991
  11196. // Max safe segment length for coercion.
  11197. var MAX_SAFE_COMPONENT_LENGTH = 16
  11198. var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6
  11199. // The actual regexps go on exports.re
  11200. var re = exports.re = []
  11201. var safeRe = exports.safeRe = []
  11202. var src = exports.src = []
  11203. var t = exports.tokens = {}
  11204. var R = 0
  11205. function tok (n) {
  11206. t[n] = R++
  11207. }
  11208. var LETTERDASHNUMBER = '[a-zA-Z0-9-]'
  11209. // Replace some greedy regex tokens to prevent regex dos issues. These regex are
  11210. // used internally via the safeRe object since all inputs in this library get
  11211. // normalized first to trim and collapse all extra whitespace. The original
  11212. // regexes are exported for userland consumption and lower level usage. A
  11213. // future breaking change could export the safer regex only with a note that
  11214. // all input should have extra whitespace removed.
  11215. var safeRegexReplacements = [
  11216. ['\\s', 1],
  11217. ['\\d', MAX_LENGTH],
  11218. [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH],
  11219. ]
  11220. function makeSafeRe (value) {
  11221. for (var i = 0; i < safeRegexReplacements.length; i++) {
  11222. var token = safeRegexReplacements[i][0]
  11223. var max = safeRegexReplacements[i][1]
  11224. value = value
  11225. .split(token + '*').join(token + '{0,' + max + '}')
  11226. .split(token + '+').join(token + '{1,' + max + '}')
  11227. }
  11228. return value
  11229. }
  11230. // The following Regular Expressions can be used for tokenizing,
  11231. // validating, and parsing SemVer version strings.
  11232. // ## Numeric Identifier
  11233. // A single `0`, or a non-zero digit followed by zero or more digits.
  11234. tok('NUMERICIDENTIFIER')
  11235. src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  11236. tok('NUMERICIDENTIFIERLOOSE')
  11237. src[t.NUMERICIDENTIFIERLOOSE] = '\\d+'
  11238. // ## Non-numeric Identifier
  11239. // Zero or more digits, followed by a letter or hyphen, and then zero or
  11240. // more letters, digits, or hyphens.
  11241. tok('NONNUMERICIDENTIFIER')
  11242. src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-]' + LETTERDASHNUMBER + '*'
  11243. // ## Main Version
  11244. // Three dot-separated numeric identifiers.
  11245. tok('MAINVERSION')
  11246. src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  11247. '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  11248. '(' + src[t.NUMERICIDENTIFIER] + ')'
  11249. tok('MAINVERSIONLOOSE')
  11250. src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  11251. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  11252. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')'
  11253. // ## Pre-release Version Identifier
  11254. // A numeric identifier, or a non-numeric identifier.
  11255. tok('PRERELEASEIDENTIFIER')
  11256. src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] +
  11257. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  11258. tok('PRERELEASEIDENTIFIERLOOSE')
  11259. src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] +
  11260. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  11261. // ## Pre-release Version
  11262. // Hyphen, followed by one or more dot-separated pre-release version
  11263. // identifiers.
  11264. tok('PRERELEASE')
  11265. src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] +
  11266. '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))'
  11267. tok('PRERELEASELOOSE')
  11268. src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] +
  11269. '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))'
  11270. // ## Build Metadata Identifier
  11271. // Any combination of digits, letters, or hyphens.
  11272. tok('BUILDIDENTIFIER')
  11273. src[t.BUILDIDENTIFIER] = LETTERDASHNUMBER + '+'
  11274. // ## Build Metadata
  11275. // Plus sign, followed by one or more period-separated build metadata
  11276. // identifiers.
  11277. tok('BUILD')
  11278. src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] +
  11279. '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))'
  11280. // ## Full Version String
  11281. // A main version, followed optionally by a pre-release version and
  11282. // build metadata.
  11283. // Note that the only major, minor, patch, and pre-release sections of
  11284. // the version string are capturing groups. The build metadata is not a
  11285. // capturing group, because it should not ever be used in version
  11286. // comparison.
  11287. tok('FULL')
  11288. tok('FULLPLAIN')
  11289. src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] +
  11290. src[t.PRERELEASE] + '?' +
  11291. src[t.BUILD] + '?'
  11292. src[t.FULL] = '^' + src[t.FULLPLAIN] + '$'
  11293. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  11294. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  11295. // common in the npm registry.
  11296. tok('LOOSEPLAIN')
  11297. src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] +
  11298. src[t.PRERELEASELOOSE] + '?' +
  11299. src[t.BUILD] + '?'
  11300. tok('LOOSE')
  11301. src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$'
  11302. tok('GTLT')
  11303. src[t.GTLT] = '((?:<|>)?=?)'
  11304. // Something like "2.*" or "1.2.x".
  11305. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  11306. // Only the first item is strictly required.
  11307. tok('XRANGEIDENTIFIERLOOSE')
  11308. src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  11309. tok('XRANGEIDENTIFIER')
  11310. src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*'
  11311. tok('XRANGEPLAIN')
  11312. src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' +
  11313. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  11314. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  11315. '(?:' + src[t.PRERELEASE] + ')?' +
  11316. src[t.BUILD] + '?' +
  11317. ')?)?'
  11318. tok('XRANGEPLAINLOOSE')
  11319. src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  11320. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  11321. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  11322. '(?:' + src[t.PRERELEASELOOSE] + ')?' +
  11323. src[t.BUILD] + '?' +
  11324. ')?)?'
  11325. tok('XRANGE')
  11326. src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$'
  11327. tok('XRANGELOOSE')
  11328. src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$'
  11329. // Coercion.
  11330. // Extract anything that could conceivably be a part of a valid semver
  11331. tok('COERCE')
  11332. src[t.COERCE] = '(^|[^\\d])' +
  11333. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  11334. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  11335. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  11336. '(?:$|[^\\d])'
  11337. tok('COERCERTL')
  11338. re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g')
  11339. safeRe[t.COERCERTL] = new RegExp(makeSafeRe(src[t.COERCE]), 'g')
  11340. // Tilde ranges.
  11341. // Meaning is "reasonably at or greater than"
  11342. tok('LONETILDE')
  11343. src[t.LONETILDE] = '(?:~>?)'
  11344. tok('TILDETRIM')
  11345. src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+'
  11346. re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g')
  11347. safeRe[t.TILDETRIM] = new RegExp(makeSafeRe(src[t.TILDETRIM]), 'g')
  11348. var tildeTrimReplace = '$1~'
  11349. tok('TILDE')
  11350. src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$'
  11351. tok('TILDELOOSE')
  11352. src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$'
  11353. // Caret ranges.
  11354. // Meaning is "at least and backwards compatible with"
  11355. tok('LONECARET')
  11356. src[t.LONECARET] = '(?:\\^)'
  11357. tok('CARETTRIM')
  11358. src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+'
  11359. re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g')
  11360. safeRe[t.CARETTRIM] = new RegExp(makeSafeRe(src[t.CARETTRIM]), 'g')
  11361. var caretTrimReplace = '$1^'
  11362. tok('CARET')
  11363. src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$'
  11364. tok('CARETLOOSE')
  11365. src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$'
  11366. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  11367. tok('COMPARATORLOOSE')
  11368. src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$'
  11369. tok('COMPARATOR')
  11370. src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$'
  11371. // An expression to strip any whitespace between the gtlt and the thing
  11372. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  11373. tok('COMPARATORTRIM')
  11374. src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] +
  11375. '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')'
  11376. // this one has to use the /g flag
  11377. re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g')
  11378. safeRe[t.COMPARATORTRIM] = new RegExp(makeSafeRe(src[t.COMPARATORTRIM]), 'g')
  11379. var comparatorTrimReplace = '$1$2$3'
  11380. // Something like `1.2.3 - 1.2.4`
  11381. // Note that these all use the loose form, because they'll be
  11382. // checked against either the strict or loose comparator form
  11383. // later.
  11384. tok('HYPHENRANGE')
  11385. src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' +
  11386. '\\s+-\\s+' +
  11387. '(' + src[t.XRANGEPLAIN] + ')' +
  11388. '\\s*$'
  11389. tok('HYPHENRANGELOOSE')
  11390. src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' +
  11391. '\\s+-\\s+' +
  11392. '(' + src[t.XRANGEPLAINLOOSE] + ')' +
  11393. '\\s*$'
  11394. // Star ranges basically just allow anything at all.
  11395. tok('STAR')
  11396. src[t.STAR] = '(<|>)?=?\\s*\\*'
  11397. // Compile to actual regexp objects.
  11398. // All are flag-free, unless they were created above with a flag.
  11399. for (var i = 0; i < R; i++) {
  11400. debug(i, src[i])
  11401. if (!re[i]) {
  11402. re[i] = new RegExp(src[i])
  11403. // Replace all greedy whitespace to prevent regex dos issues. These regex are
  11404. // used internally via the safeRe object since all inputs in this library get
  11405. // normalized first to trim and collapse all extra whitespace. The original
  11406. // regexes are exported for userland consumption and lower level usage. A
  11407. // future breaking change could export the safer regex only with a note that
  11408. // all input should have extra whitespace removed.
  11409. safeRe[i] = new RegExp(makeSafeRe(src[i]))
  11410. }
  11411. }
  11412. exports.parse = parse
  11413. function parse (version, options) {
  11414. if (!options || typeof options !== 'object') {
  11415. options = {
  11416. loose: !!options,
  11417. includePrerelease: false
  11418. }
  11419. }
  11420. if (version instanceof SemVer) {
  11421. return version
  11422. }
  11423. if (typeof version !== 'string') {
  11424. return null
  11425. }
  11426. if (version.length > MAX_LENGTH) {
  11427. return null
  11428. }
  11429. var r = options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL]
  11430. if (!r.test(version)) {
  11431. return null
  11432. }
  11433. try {
  11434. return new SemVer(version, options)
  11435. } catch (er) {
  11436. return null
  11437. }
  11438. }
  11439. exports.valid = valid
  11440. function valid (version, options) {
  11441. var v = parse(version, options)
  11442. return v ? v.version : null
  11443. }
  11444. exports.clean = clean
  11445. function clean (version, options) {
  11446. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  11447. return s ? s.version : null
  11448. }
  11449. exports.SemVer = SemVer
  11450. function SemVer (version, options) {
  11451. if (!options || typeof options !== 'object') {
  11452. options = {
  11453. loose: !!options,
  11454. includePrerelease: false
  11455. }
  11456. }
  11457. if (version instanceof SemVer) {
  11458. if (version.loose === options.loose) {
  11459. return version
  11460. } else {
  11461. version = version.version
  11462. }
  11463. } else if (typeof version !== 'string') {
  11464. throw new TypeError('Invalid Version: ' + version)
  11465. }
  11466. if (version.length > MAX_LENGTH) {
  11467. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  11468. }
  11469. if (!(this instanceof SemVer)) {
  11470. return new SemVer(version, options)
  11471. }
  11472. debug('SemVer', version, options)
  11473. this.options = options
  11474. this.loose = !!options.loose
  11475. var m = version.trim().match(options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL])
  11476. if (!m) {
  11477. throw new TypeError('Invalid Version: ' + version)
  11478. }
  11479. this.raw = version
  11480. // these are actually numbers
  11481. this.major = +m[1]
  11482. this.minor = +m[2]
  11483. this.patch = +m[3]
  11484. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  11485. throw new TypeError('Invalid major version')
  11486. }
  11487. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  11488. throw new TypeError('Invalid minor version')
  11489. }
  11490. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  11491. throw new TypeError('Invalid patch version')
  11492. }
  11493. // numberify any prerelease numeric ids
  11494. if (!m[4]) {
  11495. this.prerelease = []
  11496. } else {
  11497. this.prerelease = m[4].split('.').map(function (id) {
  11498. if (/^[0-9]+$/.test(id)) {
  11499. var num = +id
  11500. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  11501. return num
  11502. }
  11503. }
  11504. return id
  11505. })
  11506. }
  11507. this.build = m[5] ? m[5].split('.') : []
  11508. this.format()
  11509. }
  11510. SemVer.prototype.format = function () {
  11511. this.version = this.major + '.' + this.minor + '.' + this.patch
  11512. if (this.prerelease.length) {
  11513. this.version += '-' + this.prerelease.join('.')
  11514. }
  11515. return this.version
  11516. }
  11517. SemVer.prototype.toString = function () {
  11518. return this.version
  11519. }
  11520. SemVer.prototype.compare = function (other) {
  11521. debug('SemVer.compare', this.version, this.options, other)
  11522. if (!(other instanceof SemVer)) {
  11523. other = new SemVer(other, this.options)
  11524. }
  11525. return this.compareMain(other) || this.comparePre(other)
  11526. }
  11527. SemVer.prototype.compareMain = function (other) {
  11528. if (!(other instanceof SemVer)) {
  11529. other = new SemVer(other, this.options)
  11530. }
  11531. return compareIdentifiers(this.major, other.major) ||
  11532. compareIdentifiers(this.minor, other.minor) ||
  11533. compareIdentifiers(this.patch, other.patch)
  11534. }
  11535. SemVer.prototype.comparePre = function (other) {
  11536. if (!(other instanceof SemVer)) {
  11537. other = new SemVer(other, this.options)
  11538. }
  11539. // NOT having a prerelease is > having one
  11540. if (this.prerelease.length && !other.prerelease.length) {
  11541. return -1
  11542. } else if (!this.prerelease.length && other.prerelease.length) {
  11543. return 1
  11544. } else if (!this.prerelease.length && !other.prerelease.length) {
  11545. return 0
  11546. }
  11547. var i = 0
  11548. do {
  11549. var a = this.prerelease[i]
  11550. var b = other.prerelease[i]
  11551. debug('prerelease compare', i, a, b)
  11552. if (a === undefined && b === undefined) {
  11553. return 0
  11554. } else if (b === undefined) {
  11555. return 1
  11556. } else if (a === undefined) {
  11557. return -1
  11558. } else if (a === b) {
  11559. continue
  11560. } else {
  11561. return compareIdentifiers(a, b)
  11562. }
  11563. } while (++i)
  11564. }
  11565. SemVer.prototype.compareBuild = function (other) {
  11566. if (!(other instanceof SemVer)) {
  11567. other = new SemVer(other, this.options)
  11568. }
  11569. var i = 0
  11570. do {
  11571. var a = this.build[i]
  11572. var b = other.build[i]
  11573. debug('prerelease compare', i, a, b)
  11574. if (a === undefined && b === undefined) {
  11575. return 0
  11576. } else if (b === undefined) {
  11577. return 1
  11578. } else if (a === undefined) {
  11579. return -1
  11580. } else if (a === b) {
  11581. continue
  11582. } else {
  11583. return compareIdentifiers(a, b)
  11584. }
  11585. } while (++i)
  11586. }
  11587. // preminor will bump the version up to the next minor release, and immediately
  11588. // down to pre-release. premajor and prepatch work the same way.
  11589. SemVer.prototype.inc = function (release, identifier) {
  11590. switch (release) {
  11591. case 'premajor':
  11592. this.prerelease.length = 0
  11593. this.patch = 0
  11594. this.minor = 0
  11595. this.major++
  11596. this.inc('pre', identifier)
  11597. break
  11598. case 'preminor':
  11599. this.prerelease.length = 0
  11600. this.patch = 0
  11601. this.minor++
  11602. this.inc('pre', identifier)
  11603. break
  11604. case 'prepatch':
  11605. // If this is already a prerelease, it will bump to the next version
  11606. // drop any prereleases that might already exist, since they are not
  11607. // relevant at this point.
  11608. this.prerelease.length = 0
  11609. this.inc('patch', identifier)
  11610. this.inc('pre', identifier)
  11611. break
  11612. // If the input is a non-prerelease version, this acts the same as
  11613. // prepatch.
  11614. case 'prerelease':
  11615. if (this.prerelease.length === 0) {
  11616. this.inc('patch', identifier)
  11617. }
  11618. this.inc('pre', identifier)
  11619. break
  11620. case 'major':
  11621. // If this is a pre-major version, bump up to the same major version.
  11622. // Otherwise increment major.
  11623. // 1.0.0-5 bumps to 1.0.0
  11624. // 1.1.0 bumps to 2.0.0
  11625. if (this.minor !== 0 ||
  11626. this.patch !== 0 ||
  11627. this.prerelease.length === 0) {
  11628. this.major++
  11629. }
  11630. this.minor = 0
  11631. this.patch = 0
  11632. this.prerelease = []
  11633. break
  11634. case 'minor':
  11635. // If this is a pre-minor version, bump up to the same minor version.
  11636. // Otherwise increment minor.
  11637. // 1.2.0-5 bumps to 1.2.0
  11638. // 1.2.1 bumps to 1.3.0
  11639. if (this.patch !== 0 || this.prerelease.length === 0) {
  11640. this.minor++
  11641. }
  11642. this.patch = 0
  11643. this.prerelease = []
  11644. break
  11645. case 'patch':
  11646. // If this is not a pre-release version, it will increment the patch.
  11647. // If it is a pre-release it will bump up to the same patch version.
  11648. // 1.2.0-5 patches to 1.2.0
  11649. // 1.2.0 patches to 1.2.1
  11650. if (this.prerelease.length === 0) {
  11651. this.patch++
  11652. }
  11653. this.prerelease = []
  11654. break
  11655. // This probably shouldn't be used publicly.
  11656. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  11657. case 'pre':
  11658. if (this.prerelease.length === 0) {
  11659. this.prerelease = [0]
  11660. } else {
  11661. var i = this.prerelease.length
  11662. while (--i >= 0) {
  11663. if (typeof this.prerelease[i] === 'number') {
  11664. this.prerelease[i]++
  11665. i = -2
  11666. }
  11667. }
  11668. if (i === -1) {
  11669. // didn't increment anything
  11670. this.prerelease.push(0)
  11671. }
  11672. }
  11673. if (identifier) {
  11674. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  11675. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  11676. if (this.prerelease[0] === identifier) {
  11677. if (isNaN(this.prerelease[1])) {
  11678. this.prerelease = [identifier, 0]
  11679. }
  11680. } else {
  11681. this.prerelease = [identifier, 0]
  11682. }
  11683. }
  11684. break
  11685. default:
  11686. throw new Error('invalid increment argument: ' + release)
  11687. }
  11688. this.format()
  11689. this.raw = this.version
  11690. return this
  11691. }
  11692. exports.inc = inc
  11693. function inc (version, release, loose, identifier) {
  11694. if (typeof (loose) === 'string') {
  11695. identifier = loose
  11696. loose = undefined
  11697. }
  11698. try {
  11699. return new SemVer(version, loose).inc(release, identifier).version
  11700. } catch (er) {
  11701. return null
  11702. }
  11703. }
  11704. exports.diff = diff
  11705. function diff (version1, version2) {
  11706. if (eq(version1, version2)) {
  11707. return null
  11708. } else {
  11709. var v1 = parse(version1)
  11710. var v2 = parse(version2)
  11711. var prefix = ''
  11712. if (v1.prerelease.length || v2.prerelease.length) {
  11713. prefix = 'pre'
  11714. var defaultResult = 'prerelease'
  11715. }
  11716. for (var key in v1) {
  11717. if (key === 'major' || key === 'minor' || key === 'patch') {
  11718. if (v1[key] !== v2[key]) {
  11719. return prefix + key
  11720. }
  11721. }
  11722. }
  11723. return defaultResult // may be undefined
  11724. }
  11725. }
  11726. exports.compareIdentifiers = compareIdentifiers
  11727. var numeric = /^[0-9]+$/
  11728. function compareIdentifiers (a, b) {
  11729. var anum = numeric.test(a)
  11730. var bnum = numeric.test(b)
  11731. if (anum && bnum) {
  11732. a = +a
  11733. b = +b
  11734. }
  11735. return a === b ? 0
  11736. : (anum && !bnum) ? -1
  11737. : (bnum && !anum) ? 1
  11738. : a < b ? -1
  11739. : 1
  11740. }
  11741. exports.rcompareIdentifiers = rcompareIdentifiers
  11742. function rcompareIdentifiers (a, b) {
  11743. return compareIdentifiers(b, a)
  11744. }
  11745. exports.major = major
  11746. function major (a, loose) {
  11747. return new SemVer(a, loose).major
  11748. }
  11749. exports.minor = minor
  11750. function minor (a, loose) {
  11751. return new SemVer(a, loose).minor
  11752. }
  11753. exports.patch = patch
  11754. function patch (a, loose) {
  11755. return new SemVer(a, loose).patch
  11756. }
  11757. exports.compare = compare
  11758. function compare (a, b, loose) {
  11759. return new SemVer(a, loose).compare(new SemVer(b, loose))
  11760. }
  11761. exports.compareLoose = compareLoose
  11762. function compareLoose (a, b) {
  11763. return compare(a, b, true)
  11764. }
  11765. exports.compareBuild = compareBuild
  11766. function compareBuild (a, b, loose) {
  11767. var versionA = new SemVer(a, loose)
  11768. var versionB = new SemVer(b, loose)
  11769. return versionA.compare(versionB) || versionA.compareBuild(versionB)
  11770. }
  11771. exports.rcompare = rcompare
  11772. function rcompare (a, b, loose) {
  11773. return compare(b, a, loose)
  11774. }
  11775. exports.sort = sort
  11776. function sort (list, loose) {
  11777. return list.sort(function (a, b) {
  11778. return exports.compareBuild(a, b, loose)
  11779. })
  11780. }
  11781. exports.rsort = rsort
  11782. function rsort (list, loose) {
  11783. return list.sort(function (a, b) {
  11784. return exports.compareBuild(b, a, loose)
  11785. })
  11786. }
  11787. exports.gt = gt
  11788. function gt (a, b, loose) {
  11789. return compare(a, b, loose) > 0
  11790. }
  11791. exports.lt = lt
  11792. function lt (a, b, loose) {
  11793. return compare(a, b, loose) < 0
  11794. }
  11795. exports.eq = eq
  11796. function eq (a, b, loose) {
  11797. return compare(a, b, loose) === 0
  11798. }
  11799. exports.neq = neq
  11800. function neq (a, b, loose) {
  11801. return compare(a, b, loose) !== 0
  11802. }
  11803. exports.gte = gte
  11804. function gte (a, b, loose) {
  11805. return compare(a, b, loose) >= 0
  11806. }
  11807. exports.lte = lte
  11808. function lte (a, b, loose) {
  11809. return compare(a, b, loose) <= 0
  11810. }
  11811. exports.cmp = cmp
  11812. function cmp (a, op, b, loose) {
  11813. switch (op) {
  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. if (typeof a === 'object')
  11822. a = a.version
  11823. if (typeof b === 'object')
  11824. b = b.version
  11825. return a !== b
  11826. case '':
  11827. case '=':
  11828. case '==':
  11829. return eq(a, b, loose)
  11830. case '!=':
  11831. return neq(a, b, loose)
  11832. case '>':
  11833. return gt(a, b, loose)
  11834. case '>=':
  11835. return gte(a, b, loose)
  11836. case '<':
  11837. return lt(a, b, loose)
  11838. case '<=':
  11839. return lte(a, b, loose)
  11840. default:
  11841. throw new TypeError('Invalid operator: ' + op)
  11842. }
  11843. }
  11844. exports.Comparator = Comparator
  11845. function Comparator (comp, options) {
  11846. if (!options || typeof options !== 'object') {
  11847. options = {
  11848. loose: !!options,
  11849. includePrerelease: false
  11850. }
  11851. }
  11852. if (comp instanceof Comparator) {
  11853. if (comp.loose === !!options.loose) {
  11854. return comp
  11855. } else {
  11856. comp = comp.value
  11857. }
  11858. }
  11859. if (!(this instanceof Comparator)) {
  11860. return new Comparator(comp, options)
  11861. }
  11862. comp = comp.trim().split(/\s+/).join(' ')
  11863. debug('comparator', comp, options)
  11864. this.options = options
  11865. this.loose = !!options.loose
  11866. this.parse(comp)
  11867. if (this.semver === ANY) {
  11868. this.value = ''
  11869. } else {
  11870. this.value = this.operator + this.semver.version
  11871. }
  11872. debug('comp', this)
  11873. }
  11874. var ANY = {}
  11875. Comparator.prototype.parse = function (comp) {
  11876. var r = this.options.loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]
  11877. var m = comp.match(r)
  11878. if (!m) {
  11879. throw new TypeError('Invalid comparator: ' + comp)
  11880. }
  11881. this.operator = m[1] !== undefined ? m[1] : ''
  11882. if (this.operator === '=') {
  11883. this.operator = ''
  11884. }
  11885. // if it literally is just '>' or '' then allow anything.
  11886. if (!m[2]) {
  11887. this.semver = ANY
  11888. } else {
  11889. this.semver = new SemVer(m[2], this.options.loose)
  11890. }
  11891. }
  11892. Comparator.prototype.toString = function () {
  11893. return this.value
  11894. }
  11895. Comparator.prototype.test = function (version) {
  11896. debug('Comparator.test', version, this.options.loose)
  11897. if (this.semver === ANY || version === ANY) {
  11898. return true
  11899. }
  11900. if (typeof version === 'string') {
  11901. try {
  11902. version = new SemVer(version, this.options)
  11903. } catch (er) {
  11904. return false
  11905. }
  11906. }
  11907. return cmp(version, this.operator, this.semver, this.options)
  11908. }
  11909. Comparator.prototype.intersects = function (comp, options) {
  11910. if (!(comp instanceof Comparator)) {
  11911. throw new TypeError('a Comparator is required')
  11912. }
  11913. if (!options || typeof options !== 'object') {
  11914. options = {
  11915. loose: !!options,
  11916. includePrerelease: false
  11917. }
  11918. }
  11919. var rangeTmp
  11920. if (this.operator === '') {
  11921. if (this.value === '') {
  11922. return true
  11923. }
  11924. rangeTmp = new Range(comp.value, options)
  11925. return satisfies(this.value, rangeTmp, options)
  11926. } else if (comp.operator === '') {
  11927. if (comp.value === '') {
  11928. return true
  11929. }
  11930. rangeTmp = new Range(this.value, options)
  11931. return satisfies(comp.semver, rangeTmp, options)
  11932. }
  11933. var sameDirectionIncreasing =
  11934. (this.operator === '>=' || this.operator === '>') &&
  11935. (comp.operator === '>=' || comp.operator === '>')
  11936. var sameDirectionDecreasing =
  11937. (this.operator === '<=' || this.operator === '<') &&
  11938. (comp.operator === '<=' || comp.operator === '<')
  11939. var sameSemVer = this.semver.version === comp.semver.version
  11940. var differentDirectionsInclusive =
  11941. (this.operator === '>=' || this.operator === '<=') &&
  11942. (comp.operator === '>=' || comp.operator === '<=')
  11943. var oppositeDirectionsLessThan =
  11944. cmp(this.semver, '<', comp.semver, options) &&
  11945. ((this.operator === '>=' || this.operator === '>') &&
  11946. (comp.operator === '<=' || comp.operator === '<'))
  11947. var oppositeDirectionsGreaterThan =
  11948. cmp(this.semver, '>', comp.semver, options) &&
  11949. ((this.operator === '<=' || this.operator === '<') &&
  11950. (comp.operator === '>=' || comp.operator === '>'))
  11951. return sameDirectionIncreasing || sameDirectionDecreasing ||
  11952. (sameSemVer && differentDirectionsInclusive) ||
  11953. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  11954. }
  11955. exports.Range = Range
  11956. function Range (range, options) {
  11957. if (!options || typeof options !== 'object') {
  11958. options = {
  11959. loose: !!options,
  11960. includePrerelease: false
  11961. }
  11962. }
  11963. if (range instanceof Range) {
  11964. if (range.loose === !!options.loose &&
  11965. range.includePrerelease === !!options.includePrerelease) {
  11966. return range
  11967. } else {
  11968. return new Range(range.raw, options)
  11969. }
  11970. }
  11971. if (range instanceof Comparator) {
  11972. return new Range(range.value, options)
  11973. }
  11974. if (!(this instanceof Range)) {
  11975. return new Range(range, options)
  11976. }
  11977. this.options = options
  11978. this.loose = !!options.loose
  11979. this.includePrerelease = !!options.includePrerelease
  11980. // First reduce all whitespace as much as possible so we do not have to rely
  11981. // on potentially slow regexes like \s*. This is then stored and used for
  11982. // future error messages as well.
  11983. this.raw = range
  11984. .trim()
  11985. .split(/\s+/)
  11986. .join(' ')
  11987. // First, split based on boolean or ||
  11988. this.set = this.raw.split('||').map(function (range) {
  11989. return this.parseRange(range.trim())
  11990. }, this).filter(function (c) {
  11991. // throw out any that are not relevant for whatever reason
  11992. return c.length
  11993. })
  11994. if (!this.set.length) {
  11995. throw new TypeError('Invalid SemVer Range: ' + this.raw)
  11996. }
  11997. this.format()
  11998. }
  11999. Range.prototype.format = function () {
  12000. this.range = this.set.map(function (comps) {
  12001. return comps.join(' ').trim()
  12002. }).join('||').trim()
  12003. return this.range
  12004. }
  12005. Range.prototype.toString = function () {
  12006. return this.range
  12007. }
  12008. Range.prototype.parseRange = function (range) {
  12009. var loose = this.options.loose
  12010. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  12011. var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE]
  12012. range = range.replace(hr, hyphenReplace)
  12013. debug('hyphen replace', range)
  12014. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  12015. range = range.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace)
  12016. debug('comparator trim', range, safeRe[t.COMPARATORTRIM])
  12017. // `~ 1.2.3` => `~1.2.3`
  12018. range = range.replace(safeRe[t.TILDETRIM], tildeTrimReplace)
  12019. // `^ 1.2.3` => `^1.2.3`
  12020. range = range.replace(safeRe[t.CARETTRIM], caretTrimReplace)
  12021. // normalize spaces
  12022. range = range.split(/\s+/).join(' ')
  12023. // At this point, the range is completely trimmed and
  12024. // ready to be split into comparators.
  12025. var compRe = loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]
  12026. var set = range.split(' ').map(function (comp) {
  12027. return parseComparator(comp, this.options)
  12028. }, this).join(' ').split(/\s+/)
  12029. if (this.options.loose) {
  12030. // in loose mode, throw out any that are not valid comparators
  12031. set = set.filter(function (comp) {
  12032. return !!comp.match(compRe)
  12033. })
  12034. }
  12035. set = set.map(function (comp) {
  12036. return new Comparator(comp, this.options)
  12037. }, this)
  12038. return set
  12039. }
  12040. Range.prototype.intersects = function (range, options) {
  12041. if (!(range instanceof Range)) {
  12042. throw new TypeError('a Range is required')
  12043. }
  12044. return this.set.some(function (thisComparators) {
  12045. return (
  12046. isSatisfiable(thisComparators, options) &&
  12047. range.set.some(function (rangeComparators) {
  12048. return (
  12049. isSatisfiable(rangeComparators, options) &&
  12050. thisComparators.every(function (thisComparator) {
  12051. return rangeComparators.every(function (rangeComparator) {
  12052. return thisComparator.intersects(rangeComparator, options)
  12053. })
  12054. })
  12055. )
  12056. })
  12057. )
  12058. })
  12059. }
  12060. // take a set of comparators and determine whether there
  12061. // exists a version which can satisfy it
  12062. function isSatisfiable (comparators, options) {
  12063. var result = true
  12064. var remainingComparators = comparators.slice()
  12065. var testComparator = remainingComparators.pop()
  12066. while (result && remainingComparators.length) {
  12067. result = remainingComparators.every(function (otherComparator) {
  12068. return testComparator.intersects(otherComparator, options)
  12069. })
  12070. testComparator = remainingComparators.pop()
  12071. }
  12072. return result
  12073. }
  12074. // Mostly just for testing and legacy API reasons
  12075. exports.toComparators = toComparators
  12076. function toComparators (range, options) {
  12077. return new Range(range, options).set.map(function (comp) {
  12078. return comp.map(function (c) {
  12079. return c.value
  12080. }).join(' ').trim().split(' ')
  12081. })
  12082. }
  12083. // comprised of xranges, tildes, stars, and gtlt's at this point.
  12084. // already replaced the hyphen ranges
  12085. // turn into a set of JUST comparators.
  12086. function parseComparator (comp, options) {
  12087. debug('comp', comp, options)
  12088. comp = replaceCarets(comp, options)
  12089. debug('caret', comp)
  12090. comp = replaceTildes(comp, options)
  12091. debug('tildes', comp)
  12092. comp = replaceXRanges(comp, options)
  12093. debug('xrange', comp)
  12094. comp = replaceStars(comp, options)
  12095. debug('stars', comp)
  12096. return comp
  12097. }
  12098. function isX (id) {
  12099. return !id || id.toLowerCase() === 'x' || id === '*'
  12100. }
  12101. // ~, ~> --> * (any, kinda silly)
  12102. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  12103. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  12104. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  12105. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  12106. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  12107. function replaceTildes (comp, options) {
  12108. return comp.trim().split(/\s+/).map(function (comp) {
  12109. return replaceTilde(comp, options)
  12110. }).join(' ')
  12111. }
  12112. function replaceTilde (comp, options) {
  12113. var r = options.loose ? safeRe[t.TILDELOOSE] : safeRe[t.TILDE]
  12114. return comp.replace(r, function (_, M, m, p, pr) {
  12115. debug('tilde', comp, _, M, m, p, pr)
  12116. var ret
  12117. if (isX(M)) {
  12118. ret = ''
  12119. } else if (isX(m)) {
  12120. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  12121. } else if (isX(p)) {
  12122. // ~1.2 == >=1.2.0 <1.3.0
  12123. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  12124. } else if (pr) {
  12125. debug('replaceTilde pr', pr)
  12126. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  12127. ' <' + M + '.' + (+m + 1) + '.0'
  12128. } else {
  12129. // ~1.2.3 == >=1.2.3 <1.3.0
  12130. ret = '>=' + M + '.' + m + '.' + p +
  12131. ' <' + M + '.' + (+m + 1) + '.0'
  12132. }
  12133. debug('tilde return', ret)
  12134. return ret
  12135. })
  12136. }
  12137. // ^ --> * (any, kinda silly)
  12138. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  12139. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  12140. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  12141. // ^1.2.3 --> >=1.2.3 <2.0.0
  12142. // ^1.2.0 --> >=1.2.0 <2.0.0
  12143. function replaceCarets (comp, options) {
  12144. return comp.trim().split(/\s+/).map(function (comp) {
  12145. return replaceCaret(comp, options)
  12146. }).join(' ')
  12147. }
  12148. function replaceCaret (comp, options) {
  12149. debug('caret', comp, options)
  12150. var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[t.CARET]
  12151. return comp.replace(r, function (_, M, m, p, pr) {
  12152. debug('caret', comp, _, M, m, p, pr)
  12153. var ret
  12154. if (isX(M)) {
  12155. ret = ''
  12156. } else if (isX(m)) {
  12157. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  12158. } else if (isX(p)) {
  12159. if (M === '0') {
  12160. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  12161. } else {
  12162. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  12163. }
  12164. } else if (pr) {
  12165. debug('replaceCaret pr', pr)
  12166. if (M === '0') {
  12167. if (m === '0') {
  12168. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  12169. ' <' + M + '.' + m + '.' + (+p + 1)
  12170. } else {
  12171. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  12172. ' <' + M + '.' + (+m + 1) + '.0'
  12173. }
  12174. } else {
  12175. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  12176. ' <' + (+M + 1) + '.0.0'
  12177. }
  12178. } else {
  12179. debug('no pr')
  12180. if (M === '0') {
  12181. if (m === '0') {
  12182. ret = '>=' + M + '.' + m + '.' + p +
  12183. ' <' + M + '.' + m + '.' + (+p + 1)
  12184. } else {
  12185. ret = '>=' + M + '.' + m + '.' + p +
  12186. ' <' + M + '.' + (+m + 1) + '.0'
  12187. }
  12188. } else {
  12189. ret = '>=' + M + '.' + m + '.' + p +
  12190. ' <' + (+M + 1) + '.0.0'
  12191. }
  12192. }
  12193. debug('caret return', ret)
  12194. return ret
  12195. })
  12196. }
  12197. function replaceXRanges (comp, options) {
  12198. debug('replaceXRanges', comp, options)
  12199. return comp.split(/\s+/).map(function (comp) {
  12200. return replaceXRange(comp, options)
  12201. }).join(' ')
  12202. }
  12203. function replaceXRange (comp, options) {
  12204. comp = comp.trim()
  12205. var r = options.loose ? safeRe[t.XRANGELOOSE] : safeRe[t.XRANGE]
  12206. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  12207. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  12208. var xM = isX(M)
  12209. var xm = xM || isX(m)
  12210. var xp = xm || isX(p)
  12211. var anyX = xp
  12212. if (gtlt === '=' && anyX) {
  12213. gtlt = ''
  12214. }
  12215. // if we're including prereleases in the match, then we need
  12216. // to fix this to -0, the lowest possible prerelease value
  12217. pr = options.includePrerelease ? '-0' : ''
  12218. if (xM) {
  12219. if (gtlt === '>' || gtlt === '<') {
  12220. // nothing is allowed
  12221. ret = '<0.0.0-0'
  12222. } else {
  12223. // nothing is forbidden
  12224. ret = '*'
  12225. }
  12226. } else if (gtlt && anyX) {
  12227. // we know patch is an x, because we have any x at all.
  12228. // replace X with 0
  12229. if (xm) {
  12230. m = 0
  12231. }
  12232. p = 0
  12233. if (gtlt === '>') {
  12234. // >1 => >=2.0.0
  12235. // >1.2 => >=1.3.0
  12236. // >1.2.3 => >= 1.2.4
  12237. gtlt = '>='
  12238. if (xm) {
  12239. M = +M + 1
  12240. m = 0
  12241. p = 0
  12242. } else {
  12243. m = +m + 1
  12244. p = 0
  12245. }
  12246. } else if (gtlt === '<=') {
  12247. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  12248. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  12249. gtlt = '<'
  12250. if (xm) {
  12251. M = +M + 1
  12252. } else {
  12253. m = +m + 1
  12254. }
  12255. }
  12256. ret = gtlt + M + '.' + m + '.' + p + pr
  12257. } else if (xm) {
  12258. ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr
  12259. } else if (xp) {
  12260. ret = '>=' + M + '.' + m + '.0' + pr +
  12261. ' <' + M + '.' + (+m + 1) + '.0' + pr
  12262. }
  12263. debug('xRange return', ret)
  12264. return ret
  12265. })
  12266. }
  12267. // Because * is AND-ed with everything else in the comparator,
  12268. // and '' means "any version", just remove the *s entirely.
  12269. function replaceStars (comp, options) {
  12270. debug('replaceStars', comp, options)
  12271. // Looseness is ignored here. star is always as loose as it gets!
  12272. return comp.trim().replace(safeRe[t.STAR], '')
  12273. }
  12274. // This function is passed to string.replace(re[t.HYPHENRANGE])
  12275. // M, m, patch, prerelease, build
  12276. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  12277. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  12278. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  12279. function hyphenReplace ($0,
  12280. from, fM, fm, fp, fpr, fb,
  12281. to, tM, tm, tp, tpr, tb) {
  12282. if (isX(fM)) {
  12283. from = ''
  12284. } else if (isX(fm)) {
  12285. from = '>=' + fM + '.0.0'
  12286. } else if (isX(fp)) {
  12287. from = '>=' + fM + '.' + fm + '.0'
  12288. } else {
  12289. from = '>=' + from
  12290. }
  12291. if (isX(tM)) {
  12292. to = ''
  12293. } else if (isX(tm)) {
  12294. to = '<' + (+tM + 1) + '.0.0'
  12295. } else if (isX(tp)) {
  12296. to = '<' + tM + '.' + (+tm + 1) + '.0'
  12297. } else if (tpr) {
  12298. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  12299. } else {
  12300. to = '<=' + to
  12301. }
  12302. return (from + ' ' + to).trim()
  12303. }
  12304. // if ANY of the sets match ALL of its comparators, then pass
  12305. Range.prototype.test = function (version) {
  12306. if (!version) {
  12307. return false
  12308. }
  12309. if (typeof version === 'string') {
  12310. try {
  12311. version = new SemVer(version, this.options)
  12312. } catch (er) {
  12313. return false
  12314. }
  12315. }
  12316. for (var i = 0; i < this.set.length; i++) {
  12317. if (testSet(this.set[i], version, this.options)) {
  12318. return true
  12319. }
  12320. }
  12321. return false
  12322. }
  12323. function testSet (set, version, options) {
  12324. for (var i = 0; i < set.length; i++) {
  12325. if (!set[i].test(version)) {
  12326. return false
  12327. }
  12328. }
  12329. if (version.prerelease.length && !options.includePrerelease) {
  12330. // Find the set of versions that are allowed to have prereleases
  12331. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  12332. // That should allow `1.2.3-pr.2` to pass.
  12333. // However, `1.2.4-alpha.notready` should NOT be allowed,
  12334. // even though it's within the range set by the comparators.
  12335. for (i = 0; i < set.length; i++) {
  12336. debug(set[i].semver)
  12337. if (set[i].semver === ANY) {
  12338. continue
  12339. }
  12340. if (set[i].semver.prerelease.length > 0) {
  12341. var allowed = set[i].semver
  12342. if (allowed.major === version.major &&
  12343. allowed.minor === version.minor &&
  12344. allowed.patch === version.patch) {
  12345. return true
  12346. }
  12347. }
  12348. }
  12349. // Version has a -pre, but it's not one of the ones we like.
  12350. return false
  12351. }
  12352. return true
  12353. }
  12354. exports.satisfies = satisfies
  12355. function satisfies (version, range, options) {
  12356. try {
  12357. range = new Range(range, options)
  12358. } catch (er) {
  12359. return false
  12360. }
  12361. return range.test(version)
  12362. }
  12363. exports.maxSatisfying = maxSatisfying
  12364. function maxSatisfying (versions, range, options) {
  12365. var max = null
  12366. var maxSV = null
  12367. try {
  12368. var rangeObj = new Range(range, options)
  12369. } catch (er) {
  12370. return null
  12371. }
  12372. versions.forEach(function (v) {
  12373. if (rangeObj.test(v)) {
  12374. // satisfies(v, range, options)
  12375. if (!max || maxSV.compare(v) === -1) {
  12376. // compare(max, v, true)
  12377. max = v
  12378. maxSV = new SemVer(max, options)
  12379. }
  12380. }
  12381. })
  12382. return max
  12383. }
  12384. exports.minSatisfying = minSatisfying
  12385. function minSatisfying (versions, range, options) {
  12386. var min = null
  12387. var minSV = null
  12388. try {
  12389. var rangeObj = new Range(range, options)
  12390. } catch (er) {
  12391. return null
  12392. }
  12393. versions.forEach(function (v) {
  12394. if (rangeObj.test(v)) {
  12395. // satisfies(v, range, options)
  12396. if (!min || minSV.compare(v) === 1) {
  12397. // compare(min, v, true)
  12398. min = v
  12399. minSV = new SemVer(min, options)
  12400. }
  12401. }
  12402. })
  12403. return min
  12404. }
  12405. exports.minVersion = minVersion
  12406. function minVersion (range, loose) {
  12407. range = new Range(range, loose)
  12408. var minver = new SemVer('0.0.0')
  12409. if (range.test(minver)) {
  12410. return minver
  12411. }
  12412. minver = new SemVer('0.0.0-0')
  12413. if (range.test(minver)) {
  12414. return minver
  12415. }
  12416. minver = null
  12417. for (var i = 0; i < range.set.length; ++i) {
  12418. var comparators = range.set[i]
  12419. comparators.forEach(function (comparator) {
  12420. // Clone to avoid manipulating the comparator's semver object.
  12421. var compver = new SemVer(comparator.semver.version)
  12422. switch (comparator.operator) {
  12423. case '>':
  12424. if (compver.prerelease.length === 0) {
  12425. compver.patch++
  12426. } else {
  12427. compver.prerelease.push(0)
  12428. }
  12429. compver.raw = compver.format()
  12430. /* fallthrough */
  12431. case '':
  12432. case '>=':
  12433. if (!minver || gt(minver, compver)) {
  12434. minver = compver
  12435. }
  12436. break
  12437. case '<':
  12438. case '<=':
  12439. /* Ignore maximum versions */
  12440. break
  12441. /* istanbul ignore next */
  12442. default:
  12443. throw new Error('Unexpected operation: ' + comparator.operator)
  12444. }
  12445. })
  12446. }
  12447. if (minver && range.test(minver)) {
  12448. return minver
  12449. }
  12450. return null
  12451. }
  12452. exports.validRange = validRange
  12453. function validRange (range, options) {
  12454. try {
  12455. // Return '*' instead of '' so that truthiness works.
  12456. // This will throw if it's invalid anyway
  12457. return new Range(range, options).range || '*'
  12458. } catch (er) {
  12459. return null
  12460. }
  12461. }
  12462. // Determine if version is less than all the versions possible in the range
  12463. exports.ltr = ltr
  12464. function ltr (version, range, options) {
  12465. return outside(version, range, '<', options)
  12466. }
  12467. // Determine if version is greater than all the versions possible in the range.
  12468. exports.gtr = gtr
  12469. function gtr (version, range, options) {
  12470. return outside(version, range, '>', options)
  12471. }
  12472. exports.outside = outside
  12473. function outside (version, range, hilo, options) {
  12474. version = new SemVer(version, options)
  12475. range = new Range(range, options)
  12476. var gtfn, ltefn, ltfn, comp, ecomp
  12477. switch (hilo) {
  12478. case '>':
  12479. gtfn = gt
  12480. ltefn = lte
  12481. ltfn = lt
  12482. comp = '>'
  12483. ecomp = '>='
  12484. break
  12485. case '<':
  12486. gtfn = lt
  12487. ltefn = gte
  12488. ltfn = gt
  12489. comp = '<'
  12490. ecomp = '<='
  12491. break
  12492. default:
  12493. throw new TypeError('Must provide a hilo val of "<" or ">"')
  12494. }
  12495. // If it satisifes the range it is not outside
  12496. if (satisfies(version, range, options)) {
  12497. return false
  12498. }
  12499. // From now on, variable terms are as if we're in "gtr" mode.
  12500. // but note that everything is flipped for the "ltr" function.
  12501. for (var i = 0; i < range.set.length; ++i) {
  12502. var comparators = range.set[i]
  12503. var high = null
  12504. var low = null
  12505. comparators.forEach(function (comparator) {
  12506. if (comparator.semver === ANY) {
  12507. comparator = new Comparator('>=0.0.0')
  12508. }
  12509. high = high || comparator
  12510. low = low || comparator
  12511. if (gtfn(comparator.semver, high.semver, options)) {
  12512. high = comparator
  12513. } else if (ltfn(comparator.semver, low.semver, options)) {
  12514. low = comparator
  12515. }
  12516. })
  12517. // If the edge version comparator has a operator then our version
  12518. // isn't outside it
  12519. if (high.operator === comp || high.operator === ecomp) {
  12520. return false
  12521. }
  12522. // If the lowest version comparator has an operator and our version
  12523. // is less than it then it isn't higher than the range
  12524. if ((!low.operator || low.operator === comp) &&
  12525. ltefn(version, low.semver)) {
  12526. return false
  12527. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  12528. return false
  12529. }
  12530. }
  12531. return true
  12532. }
  12533. exports.prerelease = prerelease
  12534. function prerelease (version, options) {
  12535. var parsed = parse(version, options)
  12536. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  12537. }
  12538. exports.intersects = intersects
  12539. function intersects (r1, r2, options) {
  12540. r1 = new Range(r1, options)
  12541. r2 = new Range(r2, options)
  12542. return r1.intersects(r2)
  12543. }
  12544. exports.coerce = coerce
  12545. function coerce (version, options) {
  12546. if (version instanceof SemVer) {
  12547. return version
  12548. }
  12549. if (typeof version === 'number') {
  12550. version = String(version)
  12551. }
  12552. if (typeof version !== 'string') {
  12553. return null
  12554. }
  12555. options = options || {}
  12556. var match = null
  12557. if (!options.rtl) {
  12558. match = version.match(safeRe[t.COERCE])
  12559. } else {
  12560. // Find the right-most coercible string that does not share
  12561. // a terminus with a more left-ward coercible string.
  12562. // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
  12563. //
  12564. // Walk through the string checking with a /g regexp
  12565. // Manually set the index so as to pick up overlapping matches.
  12566. // Stop when we get a match that ends at the string end, since no
  12567. // coercible string can be more right-ward without the same terminus.
  12568. var next
  12569. while ((next = safeRe[t.COERCERTL].exec(version)) &&
  12570. (!match || match.index + match[0].length !== version.length)
  12571. ) {
  12572. if (!match ||
  12573. next.index + next[0].length !== match.index + match[0].length) {
  12574. match = next
  12575. }
  12576. safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length
  12577. }
  12578. // leave it in a clean state
  12579. safeRe[t.COERCERTL].lastIndex = -1
  12580. }
  12581. if (match === null) {
  12582. return null
  12583. }
  12584. return parse(match[2] +
  12585. '.' + (match[3] || '0') +
  12586. '.' + (match[4] || '0'), options)
  12587. }
  12588. /***/ }),
  12589. /***/ 4294:
  12590. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  12591. module.exports = __nccwpck_require__(4219);
  12592. /***/ }),
  12593. /***/ 4219:
  12594. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  12595. "use strict";
  12596. var net = __nccwpck_require__(1808);
  12597. var tls = __nccwpck_require__(4404);
  12598. var http = __nccwpck_require__(3685);
  12599. var https = __nccwpck_require__(5687);
  12600. var events = __nccwpck_require__(2361);
  12601. var assert = __nccwpck_require__(9491);
  12602. var util = __nccwpck_require__(3837);
  12603. exports.httpOverHttp = httpOverHttp;
  12604. exports.httpsOverHttp = httpsOverHttp;
  12605. exports.httpOverHttps = httpOverHttps;
  12606. exports.httpsOverHttps = httpsOverHttps;
  12607. function httpOverHttp(options) {
  12608. var agent = new TunnelingAgent(options);
  12609. agent.request = http.request;
  12610. return agent;
  12611. }
  12612. function httpsOverHttp(options) {
  12613. var agent = new TunnelingAgent(options);
  12614. agent.request = http.request;
  12615. agent.createSocket = createSecureSocket;
  12616. agent.defaultPort = 443;
  12617. return agent;
  12618. }
  12619. function httpOverHttps(options) {
  12620. var agent = new TunnelingAgent(options);
  12621. agent.request = https.request;
  12622. return agent;
  12623. }
  12624. function httpsOverHttps(options) {
  12625. var agent = new TunnelingAgent(options);
  12626. agent.request = https.request;
  12627. agent.createSocket = createSecureSocket;
  12628. agent.defaultPort = 443;
  12629. return agent;
  12630. }
  12631. function TunnelingAgent(options) {
  12632. var self = this;
  12633. self.options = options || {};
  12634. self.proxyOptions = self.options.proxy || {};
  12635. self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;
  12636. self.requests = [];
  12637. self.sockets = [];
  12638. self.on('free', function onFree(socket, host, port, localAddress) {
  12639. var options = toOptions(host, port, localAddress);
  12640. for (var i = 0, len = self.requests.length; i < len; ++i) {
  12641. var pending = self.requests[i];
  12642. if (pending.host === options.host && pending.port === options.port) {
  12643. // Detect the request to connect same origin server,
  12644. // reuse the connection.
  12645. self.requests.splice(i, 1);
  12646. pending.request.onSocket(socket);
  12647. return;
  12648. }
  12649. }
  12650. socket.destroy();
  12651. self.removeSocket(socket);
  12652. });
  12653. }
  12654. util.inherits(TunnelingAgent, events.EventEmitter);
  12655. TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {
  12656. var self = this;
  12657. var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));
  12658. if (self.sockets.length >= this.maxSockets) {
  12659. // We are over limit so we'll add it to the queue.
  12660. self.requests.push(options);
  12661. return;
  12662. }
  12663. // If we are under maxSockets create a new one.
  12664. self.createSocket(options, function(socket) {
  12665. socket.on('free', onFree);
  12666. socket.on('close', onCloseOrRemove);
  12667. socket.on('agentRemove', onCloseOrRemove);
  12668. req.onSocket(socket);
  12669. function onFree() {
  12670. self.emit('free', socket, options);
  12671. }
  12672. function onCloseOrRemove(err) {
  12673. self.removeSocket(socket);
  12674. socket.removeListener('free', onFree);
  12675. socket.removeListener('close', onCloseOrRemove);
  12676. socket.removeListener('agentRemove', onCloseOrRemove);
  12677. }
  12678. });
  12679. };
  12680. TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
  12681. var self = this;
  12682. var placeholder = {};
  12683. self.sockets.push(placeholder);
  12684. var connectOptions = mergeOptions({}, self.proxyOptions, {
  12685. method: 'CONNECT',
  12686. path: options.host + ':' + options.port,
  12687. agent: false,
  12688. headers: {
  12689. host: options.host + ':' + options.port
  12690. }
  12691. });
  12692. if (options.localAddress) {
  12693. connectOptions.localAddress = options.localAddress;
  12694. }
  12695. if (connectOptions.proxyAuth) {
  12696. connectOptions.headers = connectOptions.headers || {};
  12697. connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
  12698. new Buffer(connectOptions.proxyAuth).toString('base64');
  12699. }
  12700. debug('making CONNECT request');
  12701. var connectReq = self.request(connectOptions);
  12702. connectReq.useChunkedEncodingByDefault = false; // for v0.6
  12703. connectReq.once('response', onResponse); // for v0.6
  12704. connectReq.once('upgrade', onUpgrade); // for v0.6
  12705. connectReq.once('connect', onConnect); // for v0.7 or later
  12706. connectReq.once('error', onError);
  12707. connectReq.end();
  12708. function onResponse(res) {
  12709. // Very hacky. This is necessary to avoid http-parser leaks.
  12710. res.upgrade = true;
  12711. }
  12712. function onUpgrade(res, socket, head) {
  12713. // Hacky.
  12714. process.nextTick(function() {
  12715. onConnect(res, socket, head);
  12716. });
  12717. }
  12718. function onConnect(res, socket, head) {
  12719. connectReq.removeAllListeners();
  12720. socket.removeAllListeners();
  12721. if (res.statusCode !== 200) {
  12722. debug('tunneling socket could not be established, statusCode=%d',
  12723. res.statusCode);
  12724. socket.destroy();
  12725. var error = new Error('tunneling socket could not be established, ' +
  12726. 'statusCode=' + res.statusCode);
  12727. error.code = 'ECONNRESET';
  12728. options.request.emit('error', error);
  12729. self.removeSocket(placeholder);
  12730. return;
  12731. }
  12732. if (head.length > 0) {
  12733. debug('got illegal response body from proxy');
  12734. socket.destroy();
  12735. var error = new Error('got illegal response body from proxy');
  12736. error.code = 'ECONNRESET';
  12737. options.request.emit('error', error);
  12738. self.removeSocket(placeholder);
  12739. return;
  12740. }
  12741. debug('tunneling connection has established');
  12742. self.sockets[self.sockets.indexOf(placeholder)] = socket;
  12743. return cb(socket);
  12744. }
  12745. function onError(cause) {
  12746. connectReq.removeAllListeners();
  12747. debug('tunneling socket could not be established, cause=%s\n',
  12748. cause.message, cause.stack);
  12749. var error = new Error('tunneling socket could not be established, ' +
  12750. 'cause=' + cause.message);
  12751. error.code = 'ECONNRESET';
  12752. options.request.emit('error', error);
  12753. self.removeSocket(placeholder);
  12754. }
  12755. };
  12756. TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
  12757. var pos = this.sockets.indexOf(socket)
  12758. if (pos === -1) {
  12759. return;
  12760. }
  12761. this.sockets.splice(pos, 1);
  12762. var pending = this.requests.shift();
  12763. if (pending) {
  12764. // If we have pending requests and a socket gets closed a new one
  12765. // needs to be created to take over in the pool for the one that closed.
  12766. this.createSocket(pending, function(socket) {
  12767. pending.request.onSocket(socket);
  12768. });
  12769. }
  12770. };
  12771. function createSecureSocket(options, cb) {
  12772. var self = this;
  12773. TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
  12774. var hostHeader = options.request.getHeader('host');
  12775. var tlsOptions = mergeOptions({}, self.options, {
  12776. socket: socket,
  12777. servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host
  12778. });
  12779. // 0 is dummy port for v0.6
  12780. var secureSocket = tls.connect(0, tlsOptions);
  12781. self.sockets[self.sockets.indexOf(socket)] = secureSocket;
  12782. cb(secureSocket);
  12783. });
  12784. }
  12785. function toOptions(host, port, localAddress) {
  12786. if (typeof host === 'string') { // since v0.10
  12787. return {
  12788. host: host,
  12789. port: port,
  12790. localAddress: localAddress
  12791. };
  12792. }
  12793. return host; // for v0.11 or later
  12794. }
  12795. function mergeOptions(target) {
  12796. for (var i = 1, len = arguments.length; i < len; ++i) {
  12797. var overrides = arguments[i];
  12798. if (typeof overrides === 'object') {
  12799. var keys = Object.keys(overrides);
  12800. for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
  12801. var k = keys[j];
  12802. if (overrides[k] !== undefined) {
  12803. target[k] = overrides[k];
  12804. }
  12805. }
  12806. }
  12807. }
  12808. return target;
  12809. }
  12810. var debug;
  12811. if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
  12812. debug = function() {
  12813. var args = Array.prototype.slice.call(arguments);
  12814. if (typeof args[0] === 'string') {
  12815. args[0] = 'TUNNEL: ' + args[0];
  12816. } else {
  12817. args.unshift('TUNNEL:');
  12818. }
  12819. console.error.apply(console, args);
  12820. }
  12821. } else {
  12822. debug = function() {};
  12823. }
  12824. exports.debug = debug; // for test
  12825. /***/ }),
  12826. /***/ 1773:
  12827. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  12828. "use strict";
  12829. const Client = __nccwpck_require__(3598)
  12830. const Dispatcher = __nccwpck_require__(412)
  12831. const errors = __nccwpck_require__(8045)
  12832. const Pool = __nccwpck_require__(4634)
  12833. const BalancedPool = __nccwpck_require__(7931)
  12834. const Agent = __nccwpck_require__(7890)
  12835. const util = __nccwpck_require__(3983)
  12836. const { InvalidArgumentError } = errors
  12837. const api = __nccwpck_require__(4059)
  12838. const buildConnector = __nccwpck_require__(2067)
  12839. const MockClient = __nccwpck_require__(8687)
  12840. const MockAgent = __nccwpck_require__(6771)
  12841. const MockPool = __nccwpck_require__(6193)
  12842. const mockErrors = __nccwpck_require__(888)
  12843. const ProxyAgent = __nccwpck_require__(7858)
  12844. const RetryHandler = __nccwpck_require__(2286)
  12845. const { getGlobalDispatcher, setGlobalDispatcher } = __nccwpck_require__(1892)
  12846. const DecoratorHandler = __nccwpck_require__(6930)
  12847. const RedirectHandler = __nccwpck_require__(2860)
  12848. const createRedirectInterceptor = __nccwpck_require__(8861)
  12849. let hasCrypto
  12850. try {
  12851. __nccwpck_require__(6113)
  12852. hasCrypto = true
  12853. } catch {
  12854. hasCrypto = false
  12855. }
  12856. Object.assign(Dispatcher.prototype, api)
  12857. module.exports.Dispatcher = Dispatcher
  12858. module.exports.Client = Client
  12859. module.exports.Pool = Pool
  12860. module.exports.BalancedPool = BalancedPool
  12861. module.exports.Agent = Agent
  12862. module.exports.ProxyAgent = ProxyAgent
  12863. module.exports.RetryHandler = RetryHandler
  12864. module.exports.DecoratorHandler = DecoratorHandler
  12865. module.exports.RedirectHandler = RedirectHandler
  12866. module.exports.createRedirectInterceptor = createRedirectInterceptor
  12867. module.exports.buildConnector = buildConnector
  12868. module.exports.errors = errors
  12869. function makeDispatcher (fn) {
  12870. return (url, opts, handler) => {
  12871. if (typeof opts === 'function') {
  12872. handler = opts
  12873. opts = null
  12874. }
  12875. if (!url || (typeof url !== 'string' && typeof url !== 'object' && !(url instanceof URL))) {
  12876. throw new InvalidArgumentError('invalid url')
  12877. }
  12878. if (opts != null && typeof opts !== 'object') {
  12879. throw new InvalidArgumentError('invalid opts')
  12880. }
  12881. if (opts && opts.path != null) {
  12882. if (typeof opts.path !== 'string') {
  12883. throw new InvalidArgumentError('invalid opts.path')
  12884. }
  12885. let path = opts.path
  12886. if (!opts.path.startsWith('/')) {
  12887. path = `/${path}`
  12888. }
  12889. url = new URL(util.parseOrigin(url).origin + path)
  12890. } else {
  12891. if (!opts) {
  12892. opts = typeof url === 'object' ? url : {}
  12893. }
  12894. url = util.parseURL(url)
  12895. }
  12896. const { agent, dispatcher = getGlobalDispatcher() } = opts
  12897. if (agent) {
  12898. throw new InvalidArgumentError('unsupported opts.agent. Did you mean opts.client?')
  12899. }
  12900. return fn.call(dispatcher, {
  12901. ...opts,
  12902. origin: url.origin,
  12903. path: url.search ? `${url.pathname}${url.search}` : url.pathname,
  12904. method: opts.method || (opts.body ? 'PUT' : 'GET')
  12905. }, handler)
  12906. }
  12907. }
  12908. module.exports.setGlobalDispatcher = setGlobalDispatcher
  12909. module.exports.getGlobalDispatcher = getGlobalDispatcher
  12910. if (util.nodeMajor > 16 || (util.nodeMajor === 16 && util.nodeMinor >= 8)) {
  12911. let fetchImpl = null
  12912. module.exports.fetch = async function fetch (resource) {
  12913. if (!fetchImpl) {
  12914. fetchImpl = (__nccwpck_require__(4881).fetch)
  12915. }
  12916. try {
  12917. return await fetchImpl(...arguments)
  12918. } catch (err) {
  12919. if (typeof err === 'object') {
  12920. Error.captureStackTrace(err, this)
  12921. }
  12922. throw err
  12923. }
  12924. }
  12925. module.exports.Headers = __nccwpck_require__(554).Headers
  12926. module.exports.Response = __nccwpck_require__(7823).Response
  12927. module.exports.Request = __nccwpck_require__(8359).Request
  12928. module.exports.FormData = __nccwpck_require__(2015).FormData
  12929. module.exports.File = __nccwpck_require__(8511).File
  12930. module.exports.FileReader = __nccwpck_require__(1446).FileReader
  12931. const { setGlobalOrigin, getGlobalOrigin } = __nccwpck_require__(1246)
  12932. module.exports.setGlobalOrigin = setGlobalOrigin
  12933. module.exports.getGlobalOrigin = getGlobalOrigin
  12934. const { CacheStorage } = __nccwpck_require__(7907)
  12935. const { kConstruct } = __nccwpck_require__(9174)
  12936. // Cache & CacheStorage are tightly coupled with fetch. Even if it may run
  12937. // in an older version of Node, it doesn't have any use without fetch.
  12938. module.exports.caches = new CacheStorage(kConstruct)
  12939. }
  12940. if (util.nodeMajor >= 16) {
  12941. const { deleteCookie, getCookies, getSetCookies, setCookie } = __nccwpck_require__(1724)
  12942. module.exports.deleteCookie = deleteCookie
  12943. module.exports.getCookies = getCookies
  12944. module.exports.getSetCookies = getSetCookies
  12945. module.exports.setCookie = setCookie
  12946. const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(685)
  12947. module.exports.parseMIMEType = parseMIMEType
  12948. module.exports.serializeAMimeType = serializeAMimeType
  12949. }
  12950. if (util.nodeMajor >= 18 && hasCrypto) {
  12951. const { WebSocket } = __nccwpck_require__(4284)
  12952. module.exports.WebSocket = WebSocket
  12953. }
  12954. module.exports.request = makeDispatcher(api.request)
  12955. module.exports.stream = makeDispatcher(api.stream)
  12956. module.exports.pipeline = makeDispatcher(api.pipeline)
  12957. module.exports.connect = makeDispatcher(api.connect)
  12958. module.exports.upgrade = makeDispatcher(api.upgrade)
  12959. module.exports.MockClient = MockClient
  12960. module.exports.MockPool = MockPool
  12961. module.exports.MockAgent = MockAgent
  12962. module.exports.mockErrors = mockErrors
  12963. /***/ }),
  12964. /***/ 7890:
  12965. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  12966. "use strict";
  12967. const { InvalidArgumentError } = __nccwpck_require__(8045)
  12968. const { kClients, kRunning, kClose, kDestroy, kDispatch, kInterceptors } = __nccwpck_require__(2785)
  12969. const DispatcherBase = __nccwpck_require__(4839)
  12970. const Pool = __nccwpck_require__(4634)
  12971. const Client = __nccwpck_require__(3598)
  12972. const util = __nccwpck_require__(3983)
  12973. const createRedirectInterceptor = __nccwpck_require__(8861)
  12974. const { WeakRef, FinalizationRegistry } = __nccwpck_require__(6436)()
  12975. const kOnConnect = Symbol('onConnect')
  12976. const kOnDisconnect = Symbol('onDisconnect')
  12977. const kOnConnectionError = Symbol('onConnectionError')
  12978. const kMaxRedirections = Symbol('maxRedirections')
  12979. const kOnDrain = Symbol('onDrain')
  12980. const kFactory = Symbol('factory')
  12981. const kFinalizer = Symbol('finalizer')
  12982. const kOptions = Symbol('options')
  12983. function defaultFactory (origin, opts) {
  12984. return opts && opts.connections === 1
  12985. ? new Client(origin, opts)
  12986. : new Pool(origin, opts)
  12987. }
  12988. class Agent extends DispatcherBase {
  12989. constructor ({ factory = defaultFactory, maxRedirections = 0, connect, ...options } = {}) {
  12990. super()
  12991. if (typeof factory !== 'function') {
  12992. throw new InvalidArgumentError('factory must be a function.')
  12993. }
  12994. if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {
  12995. throw new InvalidArgumentError('connect must be a function or an object')
  12996. }
  12997. if (!Number.isInteger(maxRedirections) || maxRedirections < 0) {
  12998. throw new InvalidArgumentError('maxRedirections must be a positive number')
  12999. }
  13000. if (connect && typeof connect !== 'function') {
  13001. connect = { ...connect }
  13002. }
  13003. this[kInterceptors] = options.interceptors && options.interceptors.Agent && Array.isArray(options.interceptors.Agent)
  13004. ? options.interceptors.Agent
  13005. : [createRedirectInterceptor({ maxRedirections })]
  13006. this[kOptions] = { ...util.deepClone(options), connect }
  13007. this[kOptions].interceptors = options.interceptors
  13008. ? { ...options.interceptors }
  13009. : undefined
  13010. this[kMaxRedirections] = maxRedirections
  13011. this[kFactory] = factory
  13012. this[kClients] = new Map()
  13013. this[kFinalizer] = new FinalizationRegistry(/* istanbul ignore next: gc is undeterministic */ key => {
  13014. const ref = this[kClients].get(key)
  13015. if (ref !== undefined && ref.deref() === undefined) {
  13016. this[kClients].delete(key)
  13017. }
  13018. })
  13019. const agent = this
  13020. this[kOnDrain] = (origin, targets) => {
  13021. agent.emit('drain', origin, [agent, ...targets])
  13022. }
  13023. this[kOnConnect] = (origin, targets) => {
  13024. agent.emit('connect', origin, [agent, ...targets])
  13025. }
  13026. this[kOnDisconnect] = (origin, targets, err) => {
  13027. agent.emit('disconnect', origin, [agent, ...targets], err)
  13028. }
  13029. this[kOnConnectionError] = (origin, targets, err) => {
  13030. agent.emit('connectionError', origin, [agent, ...targets], err)
  13031. }
  13032. }
  13033. get [kRunning] () {
  13034. let ret = 0
  13035. for (const ref of this[kClients].values()) {
  13036. const client = ref.deref()
  13037. /* istanbul ignore next: gc is undeterministic */
  13038. if (client) {
  13039. ret += client[kRunning]
  13040. }
  13041. }
  13042. return ret
  13043. }
  13044. [kDispatch] (opts, handler) {
  13045. let key
  13046. if (opts.origin && (typeof opts.origin === 'string' || opts.origin instanceof URL)) {
  13047. key = String(opts.origin)
  13048. } else {
  13049. throw new InvalidArgumentError('opts.origin must be a non-empty string or URL.')
  13050. }
  13051. const ref = this[kClients].get(key)
  13052. let dispatcher = ref ? ref.deref() : null
  13053. if (!dispatcher) {
  13054. dispatcher = this[kFactory](opts.origin, this[kOptions])
  13055. .on('drain', this[kOnDrain])
  13056. .on('connect', this[kOnConnect])
  13057. .on('disconnect', this[kOnDisconnect])
  13058. .on('connectionError', this[kOnConnectionError])
  13059. this[kClients].set(key, new WeakRef(dispatcher))
  13060. this[kFinalizer].register(dispatcher, key)
  13061. }
  13062. return dispatcher.dispatch(opts, handler)
  13063. }
  13064. async [kClose] () {
  13065. const closePromises = []
  13066. for (const ref of this[kClients].values()) {
  13067. const client = ref.deref()
  13068. /* istanbul ignore else: gc is undeterministic */
  13069. if (client) {
  13070. closePromises.push(client.close())
  13071. }
  13072. }
  13073. await Promise.all(closePromises)
  13074. }
  13075. async [kDestroy] (err) {
  13076. const destroyPromises = []
  13077. for (const ref of this[kClients].values()) {
  13078. const client = ref.deref()
  13079. /* istanbul ignore else: gc is undeterministic */
  13080. if (client) {
  13081. destroyPromises.push(client.destroy(err))
  13082. }
  13083. }
  13084. await Promise.all(destroyPromises)
  13085. }
  13086. }
  13087. module.exports = Agent
  13088. /***/ }),
  13089. /***/ 7032:
  13090. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13091. const { addAbortListener } = __nccwpck_require__(3983)
  13092. const { RequestAbortedError } = __nccwpck_require__(8045)
  13093. const kListener = Symbol('kListener')
  13094. const kSignal = Symbol('kSignal')
  13095. function abort (self) {
  13096. if (self.abort) {
  13097. self.abort()
  13098. } else {
  13099. self.onError(new RequestAbortedError())
  13100. }
  13101. }
  13102. function addSignal (self, signal) {
  13103. self[kSignal] = null
  13104. self[kListener] = null
  13105. if (!signal) {
  13106. return
  13107. }
  13108. if (signal.aborted) {
  13109. abort(self)
  13110. return
  13111. }
  13112. self[kSignal] = signal
  13113. self[kListener] = () => {
  13114. abort(self)
  13115. }
  13116. addAbortListener(self[kSignal], self[kListener])
  13117. }
  13118. function removeSignal (self) {
  13119. if (!self[kSignal]) {
  13120. return
  13121. }
  13122. if ('removeEventListener' in self[kSignal]) {
  13123. self[kSignal].removeEventListener('abort', self[kListener])
  13124. } else {
  13125. self[kSignal].removeListener('abort', self[kListener])
  13126. }
  13127. self[kSignal] = null
  13128. self[kListener] = null
  13129. }
  13130. module.exports = {
  13131. addSignal,
  13132. removeSignal
  13133. }
  13134. /***/ }),
  13135. /***/ 9744:
  13136. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13137. "use strict";
  13138. const { AsyncResource } = __nccwpck_require__(852)
  13139. const { InvalidArgumentError, RequestAbortedError, SocketError } = __nccwpck_require__(8045)
  13140. const util = __nccwpck_require__(3983)
  13141. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  13142. class ConnectHandler extends AsyncResource {
  13143. constructor (opts, callback) {
  13144. if (!opts || typeof opts !== 'object') {
  13145. throw new InvalidArgumentError('invalid opts')
  13146. }
  13147. if (typeof callback !== 'function') {
  13148. throw new InvalidArgumentError('invalid callback')
  13149. }
  13150. const { signal, opaque, responseHeaders } = opts
  13151. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  13152. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  13153. }
  13154. super('UNDICI_CONNECT')
  13155. this.opaque = opaque || null
  13156. this.responseHeaders = responseHeaders || null
  13157. this.callback = callback
  13158. this.abort = null
  13159. addSignal(this, signal)
  13160. }
  13161. onConnect (abort, context) {
  13162. if (!this.callback) {
  13163. throw new RequestAbortedError()
  13164. }
  13165. this.abort = abort
  13166. this.context = context
  13167. }
  13168. onHeaders () {
  13169. throw new SocketError('bad connect', null)
  13170. }
  13171. onUpgrade (statusCode, rawHeaders, socket) {
  13172. const { callback, opaque, context } = this
  13173. removeSignal(this)
  13174. this.callback = null
  13175. let headers = rawHeaders
  13176. // Indicates is an HTTP2Session
  13177. if (headers != null) {
  13178. headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13179. }
  13180. this.runInAsyncScope(callback, null, null, {
  13181. statusCode,
  13182. headers,
  13183. socket,
  13184. opaque,
  13185. context
  13186. })
  13187. }
  13188. onError (err) {
  13189. const { callback, opaque } = this
  13190. removeSignal(this)
  13191. if (callback) {
  13192. this.callback = null
  13193. queueMicrotask(() => {
  13194. this.runInAsyncScope(callback, null, err, { opaque })
  13195. })
  13196. }
  13197. }
  13198. }
  13199. function connect (opts, callback) {
  13200. if (callback === undefined) {
  13201. return new Promise((resolve, reject) => {
  13202. connect.call(this, opts, (err, data) => {
  13203. return err ? reject(err) : resolve(data)
  13204. })
  13205. })
  13206. }
  13207. try {
  13208. const connectHandler = new ConnectHandler(opts, callback)
  13209. this.dispatch({ ...opts, method: 'CONNECT' }, connectHandler)
  13210. } catch (err) {
  13211. if (typeof callback !== 'function') {
  13212. throw err
  13213. }
  13214. const opaque = opts && opts.opaque
  13215. queueMicrotask(() => callback(err, { opaque }))
  13216. }
  13217. }
  13218. module.exports = connect
  13219. /***/ }),
  13220. /***/ 8752:
  13221. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13222. "use strict";
  13223. const {
  13224. Readable,
  13225. Duplex,
  13226. PassThrough
  13227. } = __nccwpck_require__(2781)
  13228. const {
  13229. InvalidArgumentError,
  13230. InvalidReturnValueError,
  13231. RequestAbortedError
  13232. } = __nccwpck_require__(8045)
  13233. const util = __nccwpck_require__(3983)
  13234. const { AsyncResource } = __nccwpck_require__(852)
  13235. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  13236. const assert = __nccwpck_require__(9491)
  13237. const kResume = Symbol('resume')
  13238. class PipelineRequest extends Readable {
  13239. constructor () {
  13240. super({ autoDestroy: true })
  13241. this[kResume] = null
  13242. }
  13243. _read () {
  13244. const { [kResume]: resume } = this
  13245. if (resume) {
  13246. this[kResume] = null
  13247. resume()
  13248. }
  13249. }
  13250. _destroy (err, callback) {
  13251. this._read()
  13252. callback(err)
  13253. }
  13254. }
  13255. class PipelineResponse extends Readable {
  13256. constructor (resume) {
  13257. super({ autoDestroy: true })
  13258. this[kResume] = resume
  13259. }
  13260. _read () {
  13261. this[kResume]()
  13262. }
  13263. _destroy (err, callback) {
  13264. if (!err && !this._readableState.endEmitted) {
  13265. err = new RequestAbortedError()
  13266. }
  13267. callback(err)
  13268. }
  13269. }
  13270. class PipelineHandler extends AsyncResource {
  13271. constructor (opts, handler) {
  13272. if (!opts || typeof opts !== 'object') {
  13273. throw new InvalidArgumentError('invalid opts')
  13274. }
  13275. if (typeof handler !== 'function') {
  13276. throw new InvalidArgumentError('invalid handler')
  13277. }
  13278. const { signal, method, opaque, onInfo, responseHeaders } = opts
  13279. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  13280. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  13281. }
  13282. if (method === 'CONNECT') {
  13283. throw new InvalidArgumentError('invalid method')
  13284. }
  13285. if (onInfo && typeof onInfo !== 'function') {
  13286. throw new InvalidArgumentError('invalid onInfo callback')
  13287. }
  13288. super('UNDICI_PIPELINE')
  13289. this.opaque = opaque || null
  13290. this.responseHeaders = responseHeaders || null
  13291. this.handler = handler
  13292. this.abort = null
  13293. this.context = null
  13294. this.onInfo = onInfo || null
  13295. this.req = new PipelineRequest().on('error', util.nop)
  13296. this.ret = new Duplex({
  13297. readableObjectMode: opts.objectMode,
  13298. autoDestroy: true,
  13299. read: () => {
  13300. const { body } = this
  13301. if (body && body.resume) {
  13302. body.resume()
  13303. }
  13304. },
  13305. write: (chunk, encoding, callback) => {
  13306. const { req } = this
  13307. if (req.push(chunk, encoding) || req._readableState.destroyed) {
  13308. callback()
  13309. } else {
  13310. req[kResume] = callback
  13311. }
  13312. },
  13313. destroy: (err, callback) => {
  13314. const { body, req, res, ret, abort } = this
  13315. if (!err && !ret._readableState.endEmitted) {
  13316. err = new RequestAbortedError()
  13317. }
  13318. if (abort && err) {
  13319. abort()
  13320. }
  13321. util.destroy(body, err)
  13322. util.destroy(req, err)
  13323. util.destroy(res, err)
  13324. removeSignal(this)
  13325. callback(err)
  13326. }
  13327. }).on('prefinish', () => {
  13328. const { req } = this
  13329. // Node < 15 does not call _final in same tick.
  13330. req.push(null)
  13331. })
  13332. this.res = null
  13333. addSignal(this, signal)
  13334. }
  13335. onConnect (abort, context) {
  13336. const { ret, res } = this
  13337. assert(!res, 'pipeline cannot be retried')
  13338. if (ret.destroyed) {
  13339. throw new RequestAbortedError()
  13340. }
  13341. this.abort = abort
  13342. this.context = context
  13343. }
  13344. onHeaders (statusCode, rawHeaders, resume) {
  13345. const { opaque, handler, context } = this
  13346. if (statusCode < 200) {
  13347. if (this.onInfo) {
  13348. const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13349. this.onInfo({ statusCode, headers })
  13350. }
  13351. return
  13352. }
  13353. this.res = new PipelineResponse(resume)
  13354. let body
  13355. try {
  13356. this.handler = null
  13357. const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13358. body = this.runInAsyncScope(handler, null, {
  13359. statusCode,
  13360. headers,
  13361. opaque,
  13362. body: this.res,
  13363. context
  13364. })
  13365. } catch (err) {
  13366. this.res.on('error', util.nop)
  13367. throw err
  13368. }
  13369. if (!body || typeof body.on !== 'function') {
  13370. throw new InvalidReturnValueError('expected Readable')
  13371. }
  13372. body
  13373. .on('data', (chunk) => {
  13374. const { ret, body } = this
  13375. if (!ret.push(chunk) && body.pause) {
  13376. body.pause()
  13377. }
  13378. })
  13379. .on('error', (err) => {
  13380. const { ret } = this
  13381. util.destroy(ret, err)
  13382. })
  13383. .on('end', () => {
  13384. const { ret } = this
  13385. ret.push(null)
  13386. })
  13387. .on('close', () => {
  13388. const { ret } = this
  13389. if (!ret._readableState.ended) {
  13390. util.destroy(ret, new RequestAbortedError())
  13391. }
  13392. })
  13393. this.body = body
  13394. }
  13395. onData (chunk) {
  13396. const { res } = this
  13397. return res.push(chunk)
  13398. }
  13399. onComplete (trailers) {
  13400. const { res } = this
  13401. res.push(null)
  13402. }
  13403. onError (err) {
  13404. const { ret } = this
  13405. this.handler = null
  13406. util.destroy(ret, err)
  13407. }
  13408. }
  13409. function pipeline (opts, handler) {
  13410. try {
  13411. const pipelineHandler = new PipelineHandler(opts, handler)
  13412. this.dispatch({ ...opts, body: pipelineHandler.req }, pipelineHandler)
  13413. return pipelineHandler.ret
  13414. } catch (err) {
  13415. return new PassThrough().destroy(err)
  13416. }
  13417. }
  13418. module.exports = pipeline
  13419. /***/ }),
  13420. /***/ 5448:
  13421. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13422. "use strict";
  13423. const Readable = __nccwpck_require__(3858)
  13424. const {
  13425. InvalidArgumentError,
  13426. RequestAbortedError
  13427. } = __nccwpck_require__(8045)
  13428. const util = __nccwpck_require__(3983)
  13429. const { getResolveErrorBodyCallback } = __nccwpck_require__(7474)
  13430. const { AsyncResource } = __nccwpck_require__(852)
  13431. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  13432. class RequestHandler extends AsyncResource {
  13433. constructor (opts, callback) {
  13434. if (!opts || typeof opts !== 'object') {
  13435. throw new InvalidArgumentError('invalid opts')
  13436. }
  13437. const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError, highWaterMark } = opts
  13438. try {
  13439. if (typeof callback !== 'function') {
  13440. throw new InvalidArgumentError('invalid callback')
  13441. }
  13442. if (highWaterMark && (typeof highWaterMark !== 'number' || highWaterMark < 0)) {
  13443. throw new InvalidArgumentError('invalid highWaterMark')
  13444. }
  13445. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  13446. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  13447. }
  13448. if (method === 'CONNECT') {
  13449. throw new InvalidArgumentError('invalid method')
  13450. }
  13451. if (onInfo && typeof onInfo !== 'function') {
  13452. throw new InvalidArgumentError('invalid onInfo callback')
  13453. }
  13454. super('UNDICI_REQUEST')
  13455. } catch (err) {
  13456. if (util.isStream(body)) {
  13457. util.destroy(body.on('error', util.nop), err)
  13458. }
  13459. throw err
  13460. }
  13461. this.responseHeaders = responseHeaders || null
  13462. this.opaque = opaque || null
  13463. this.callback = callback
  13464. this.res = null
  13465. this.abort = null
  13466. this.body = body
  13467. this.trailers = {}
  13468. this.context = null
  13469. this.onInfo = onInfo || null
  13470. this.throwOnError = throwOnError
  13471. this.highWaterMark = highWaterMark
  13472. if (util.isStream(body)) {
  13473. body.on('error', (err) => {
  13474. this.onError(err)
  13475. })
  13476. }
  13477. addSignal(this, signal)
  13478. }
  13479. onConnect (abort, context) {
  13480. if (!this.callback) {
  13481. throw new RequestAbortedError()
  13482. }
  13483. this.abort = abort
  13484. this.context = context
  13485. }
  13486. onHeaders (statusCode, rawHeaders, resume, statusMessage) {
  13487. const { callback, opaque, abort, context, responseHeaders, highWaterMark } = this
  13488. const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13489. if (statusCode < 200) {
  13490. if (this.onInfo) {
  13491. this.onInfo({ statusCode, headers })
  13492. }
  13493. return
  13494. }
  13495. const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers
  13496. const contentType = parsedHeaders['content-type']
  13497. const body = new Readable({ resume, abort, contentType, highWaterMark })
  13498. this.callback = null
  13499. this.res = body
  13500. if (callback !== null) {
  13501. if (this.throwOnError && statusCode >= 400) {
  13502. this.runInAsyncScope(getResolveErrorBodyCallback, null,
  13503. { callback, body, contentType, statusCode, statusMessage, headers }
  13504. )
  13505. } else {
  13506. this.runInAsyncScope(callback, null, null, {
  13507. statusCode,
  13508. headers,
  13509. trailers: this.trailers,
  13510. opaque,
  13511. body,
  13512. context
  13513. })
  13514. }
  13515. }
  13516. }
  13517. onData (chunk) {
  13518. const { res } = this
  13519. return res.push(chunk)
  13520. }
  13521. onComplete (trailers) {
  13522. const { res } = this
  13523. removeSignal(this)
  13524. util.parseHeaders(trailers, this.trailers)
  13525. res.push(null)
  13526. }
  13527. onError (err) {
  13528. const { res, callback, body, opaque } = this
  13529. removeSignal(this)
  13530. if (callback) {
  13531. // TODO: Does this need queueMicrotask?
  13532. this.callback = null
  13533. queueMicrotask(() => {
  13534. this.runInAsyncScope(callback, null, err, { opaque })
  13535. })
  13536. }
  13537. if (res) {
  13538. this.res = null
  13539. // Ensure all queued handlers are invoked before destroying res.
  13540. queueMicrotask(() => {
  13541. util.destroy(res, err)
  13542. })
  13543. }
  13544. if (body) {
  13545. this.body = null
  13546. util.destroy(body, err)
  13547. }
  13548. }
  13549. }
  13550. function request (opts, callback) {
  13551. if (callback === undefined) {
  13552. return new Promise((resolve, reject) => {
  13553. request.call(this, opts, (err, data) => {
  13554. return err ? reject(err) : resolve(data)
  13555. })
  13556. })
  13557. }
  13558. try {
  13559. this.dispatch(opts, new RequestHandler(opts, callback))
  13560. } catch (err) {
  13561. if (typeof callback !== 'function') {
  13562. throw err
  13563. }
  13564. const opaque = opts && opts.opaque
  13565. queueMicrotask(() => callback(err, { opaque }))
  13566. }
  13567. }
  13568. module.exports = request
  13569. module.exports.RequestHandler = RequestHandler
  13570. /***/ }),
  13571. /***/ 5395:
  13572. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13573. "use strict";
  13574. const { finished, PassThrough } = __nccwpck_require__(2781)
  13575. const {
  13576. InvalidArgumentError,
  13577. InvalidReturnValueError,
  13578. RequestAbortedError
  13579. } = __nccwpck_require__(8045)
  13580. const util = __nccwpck_require__(3983)
  13581. const { getResolveErrorBodyCallback } = __nccwpck_require__(7474)
  13582. const { AsyncResource } = __nccwpck_require__(852)
  13583. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  13584. class StreamHandler extends AsyncResource {
  13585. constructor (opts, factory, callback) {
  13586. if (!opts || typeof opts !== 'object') {
  13587. throw new InvalidArgumentError('invalid opts')
  13588. }
  13589. const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError } = opts
  13590. try {
  13591. if (typeof callback !== 'function') {
  13592. throw new InvalidArgumentError('invalid callback')
  13593. }
  13594. if (typeof factory !== 'function') {
  13595. throw new InvalidArgumentError('invalid factory')
  13596. }
  13597. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  13598. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  13599. }
  13600. if (method === 'CONNECT') {
  13601. throw new InvalidArgumentError('invalid method')
  13602. }
  13603. if (onInfo && typeof onInfo !== 'function') {
  13604. throw new InvalidArgumentError('invalid onInfo callback')
  13605. }
  13606. super('UNDICI_STREAM')
  13607. } catch (err) {
  13608. if (util.isStream(body)) {
  13609. util.destroy(body.on('error', util.nop), err)
  13610. }
  13611. throw err
  13612. }
  13613. this.responseHeaders = responseHeaders || null
  13614. this.opaque = opaque || null
  13615. this.factory = factory
  13616. this.callback = callback
  13617. this.res = null
  13618. this.abort = null
  13619. this.context = null
  13620. this.trailers = null
  13621. this.body = body
  13622. this.onInfo = onInfo || null
  13623. this.throwOnError = throwOnError || false
  13624. if (util.isStream(body)) {
  13625. body.on('error', (err) => {
  13626. this.onError(err)
  13627. })
  13628. }
  13629. addSignal(this, signal)
  13630. }
  13631. onConnect (abort, context) {
  13632. if (!this.callback) {
  13633. throw new RequestAbortedError()
  13634. }
  13635. this.abort = abort
  13636. this.context = context
  13637. }
  13638. onHeaders (statusCode, rawHeaders, resume, statusMessage) {
  13639. const { factory, opaque, context, callback, responseHeaders } = this
  13640. const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13641. if (statusCode < 200) {
  13642. if (this.onInfo) {
  13643. this.onInfo({ statusCode, headers })
  13644. }
  13645. return
  13646. }
  13647. this.factory = null
  13648. let res
  13649. if (this.throwOnError && statusCode >= 400) {
  13650. const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers
  13651. const contentType = parsedHeaders['content-type']
  13652. res = new PassThrough()
  13653. this.callback = null
  13654. this.runInAsyncScope(getResolveErrorBodyCallback, null,
  13655. { callback, body: res, contentType, statusCode, statusMessage, headers }
  13656. )
  13657. } else {
  13658. if (factory === null) {
  13659. return
  13660. }
  13661. res = this.runInAsyncScope(factory, null, {
  13662. statusCode,
  13663. headers,
  13664. opaque,
  13665. context
  13666. })
  13667. if (
  13668. !res ||
  13669. typeof res.write !== 'function' ||
  13670. typeof res.end !== 'function' ||
  13671. typeof res.on !== 'function'
  13672. ) {
  13673. throw new InvalidReturnValueError('expected Writable')
  13674. }
  13675. // TODO: Avoid finished. It registers an unnecessary amount of listeners.
  13676. finished(res, { readable: false }, (err) => {
  13677. const { callback, res, opaque, trailers, abort } = this
  13678. this.res = null
  13679. if (err || !res.readable) {
  13680. util.destroy(res, err)
  13681. }
  13682. this.callback = null
  13683. this.runInAsyncScope(callback, null, err || null, { opaque, trailers })
  13684. if (err) {
  13685. abort()
  13686. }
  13687. })
  13688. }
  13689. res.on('drain', resume)
  13690. this.res = res
  13691. const needDrain = res.writableNeedDrain !== undefined
  13692. ? res.writableNeedDrain
  13693. : res._writableState && res._writableState.needDrain
  13694. return needDrain !== true
  13695. }
  13696. onData (chunk) {
  13697. const { res } = this
  13698. return res ? res.write(chunk) : true
  13699. }
  13700. onComplete (trailers) {
  13701. const { res } = this
  13702. removeSignal(this)
  13703. if (!res) {
  13704. return
  13705. }
  13706. this.trailers = util.parseHeaders(trailers)
  13707. res.end()
  13708. }
  13709. onError (err) {
  13710. const { res, callback, opaque, body } = this
  13711. removeSignal(this)
  13712. this.factory = null
  13713. if (res) {
  13714. this.res = null
  13715. util.destroy(res, err)
  13716. } else if (callback) {
  13717. this.callback = null
  13718. queueMicrotask(() => {
  13719. this.runInAsyncScope(callback, null, err, { opaque })
  13720. })
  13721. }
  13722. if (body) {
  13723. this.body = null
  13724. util.destroy(body, err)
  13725. }
  13726. }
  13727. }
  13728. function stream (opts, factory, callback) {
  13729. if (callback === undefined) {
  13730. return new Promise((resolve, reject) => {
  13731. stream.call(this, opts, factory, (err, data) => {
  13732. return err ? reject(err) : resolve(data)
  13733. })
  13734. })
  13735. }
  13736. try {
  13737. this.dispatch(opts, new StreamHandler(opts, factory, callback))
  13738. } catch (err) {
  13739. if (typeof callback !== 'function') {
  13740. throw err
  13741. }
  13742. const opaque = opts && opts.opaque
  13743. queueMicrotask(() => callback(err, { opaque }))
  13744. }
  13745. }
  13746. module.exports = stream
  13747. /***/ }),
  13748. /***/ 6923:
  13749. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13750. "use strict";
  13751. const { InvalidArgumentError, RequestAbortedError, SocketError } = __nccwpck_require__(8045)
  13752. const { AsyncResource } = __nccwpck_require__(852)
  13753. const util = __nccwpck_require__(3983)
  13754. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  13755. const assert = __nccwpck_require__(9491)
  13756. class UpgradeHandler extends AsyncResource {
  13757. constructor (opts, callback) {
  13758. if (!opts || typeof opts !== 'object') {
  13759. throw new InvalidArgumentError('invalid opts')
  13760. }
  13761. if (typeof callback !== 'function') {
  13762. throw new InvalidArgumentError('invalid callback')
  13763. }
  13764. const { signal, opaque, responseHeaders } = opts
  13765. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  13766. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  13767. }
  13768. super('UNDICI_UPGRADE')
  13769. this.responseHeaders = responseHeaders || null
  13770. this.opaque = opaque || null
  13771. this.callback = callback
  13772. this.abort = null
  13773. this.context = null
  13774. addSignal(this, signal)
  13775. }
  13776. onConnect (abort, context) {
  13777. if (!this.callback) {
  13778. throw new RequestAbortedError()
  13779. }
  13780. this.abort = abort
  13781. this.context = null
  13782. }
  13783. onHeaders () {
  13784. throw new SocketError('bad upgrade', null)
  13785. }
  13786. onUpgrade (statusCode, rawHeaders, socket) {
  13787. const { callback, opaque, context } = this
  13788. assert.strictEqual(statusCode, 101)
  13789. removeSignal(this)
  13790. this.callback = null
  13791. const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13792. this.runInAsyncScope(callback, null, null, {
  13793. headers,
  13794. socket,
  13795. opaque,
  13796. context
  13797. })
  13798. }
  13799. onError (err) {
  13800. const { callback, opaque } = this
  13801. removeSignal(this)
  13802. if (callback) {
  13803. this.callback = null
  13804. queueMicrotask(() => {
  13805. this.runInAsyncScope(callback, null, err, { opaque })
  13806. })
  13807. }
  13808. }
  13809. }
  13810. function upgrade (opts, callback) {
  13811. if (callback === undefined) {
  13812. return new Promise((resolve, reject) => {
  13813. upgrade.call(this, opts, (err, data) => {
  13814. return err ? reject(err) : resolve(data)
  13815. })
  13816. })
  13817. }
  13818. try {
  13819. const upgradeHandler = new UpgradeHandler(opts, callback)
  13820. this.dispatch({
  13821. ...opts,
  13822. method: opts.method || 'GET',
  13823. upgrade: opts.protocol || 'Websocket'
  13824. }, upgradeHandler)
  13825. } catch (err) {
  13826. if (typeof callback !== 'function') {
  13827. throw err
  13828. }
  13829. const opaque = opts && opts.opaque
  13830. queueMicrotask(() => callback(err, { opaque }))
  13831. }
  13832. }
  13833. module.exports = upgrade
  13834. /***/ }),
  13835. /***/ 4059:
  13836. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13837. "use strict";
  13838. module.exports.request = __nccwpck_require__(5448)
  13839. module.exports.stream = __nccwpck_require__(5395)
  13840. module.exports.pipeline = __nccwpck_require__(8752)
  13841. module.exports.upgrade = __nccwpck_require__(6923)
  13842. module.exports.connect = __nccwpck_require__(9744)
  13843. /***/ }),
  13844. /***/ 3858:
  13845. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13846. "use strict";
  13847. // Ported from https://github.com/nodejs/undici/pull/907
  13848. const assert = __nccwpck_require__(9491)
  13849. const { Readable } = __nccwpck_require__(2781)
  13850. const { RequestAbortedError, NotSupportedError, InvalidArgumentError } = __nccwpck_require__(8045)
  13851. const util = __nccwpck_require__(3983)
  13852. const { ReadableStreamFrom, toUSVString } = __nccwpck_require__(3983)
  13853. let Blob
  13854. const kConsume = Symbol('kConsume')
  13855. const kReading = Symbol('kReading')
  13856. const kBody = Symbol('kBody')
  13857. const kAbort = Symbol('abort')
  13858. const kContentType = Symbol('kContentType')
  13859. const noop = () => {}
  13860. module.exports = class BodyReadable extends Readable {
  13861. constructor ({
  13862. resume,
  13863. abort,
  13864. contentType = '',
  13865. highWaterMark = 64 * 1024 // Same as nodejs fs streams.
  13866. }) {
  13867. super({
  13868. autoDestroy: true,
  13869. read: resume,
  13870. highWaterMark
  13871. })
  13872. this._readableState.dataEmitted = false
  13873. this[kAbort] = abort
  13874. this[kConsume] = null
  13875. this[kBody] = null
  13876. this[kContentType] = contentType
  13877. // Is stream being consumed through Readable API?
  13878. // This is an optimization so that we avoid checking
  13879. // for 'data' and 'readable' listeners in the hot path
  13880. // inside push().
  13881. this[kReading] = false
  13882. }
  13883. destroy (err) {
  13884. if (this.destroyed) {
  13885. // Node < 16
  13886. return this
  13887. }
  13888. if (!err && !this._readableState.endEmitted) {
  13889. err = new RequestAbortedError()
  13890. }
  13891. if (err) {
  13892. this[kAbort]()
  13893. }
  13894. return super.destroy(err)
  13895. }
  13896. emit (ev, ...args) {
  13897. if (ev === 'data') {
  13898. // Node < 16.7
  13899. this._readableState.dataEmitted = true
  13900. } else if (ev === 'error') {
  13901. // Node < 16
  13902. this._readableState.errorEmitted = true
  13903. }
  13904. return super.emit(ev, ...args)
  13905. }
  13906. on (ev, ...args) {
  13907. if (ev === 'data' || ev === 'readable') {
  13908. this[kReading] = true
  13909. }
  13910. return super.on(ev, ...args)
  13911. }
  13912. addListener (ev, ...args) {
  13913. return this.on(ev, ...args)
  13914. }
  13915. off (ev, ...args) {
  13916. const ret = super.off(ev, ...args)
  13917. if (ev === 'data' || ev === 'readable') {
  13918. this[kReading] = (
  13919. this.listenerCount('data') > 0 ||
  13920. this.listenerCount('readable') > 0
  13921. )
  13922. }
  13923. return ret
  13924. }
  13925. removeListener (ev, ...args) {
  13926. return this.off(ev, ...args)
  13927. }
  13928. push (chunk) {
  13929. if (this[kConsume] && chunk !== null && this.readableLength === 0) {
  13930. consumePush(this[kConsume], chunk)
  13931. return this[kReading] ? super.push(chunk) : true
  13932. }
  13933. return super.push(chunk)
  13934. }
  13935. // https://fetch.spec.whatwg.org/#dom-body-text
  13936. async text () {
  13937. return consume(this, 'text')
  13938. }
  13939. // https://fetch.spec.whatwg.org/#dom-body-json
  13940. async json () {
  13941. return consume(this, 'json')
  13942. }
  13943. // https://fetch.spec.whatwg.org/#dom-body-blob
  13944. async blob () {
  13945. return consume(this, 'blob')
  13946. }
  13947. // https://fetch.spec.whatwg.org/#dom-body-arraybuffer
  13948. async arrayBuffer () {
  13949. return consume(this, 'arrayBuffer')
  13950. }
  13951. // https://fetch.spec.whatwg.org/#dom-body-formdata
  13952. async formData () {
  13953. // TODO: Implement.
  13954. throw new NotSupportedError()
  13955. }
  13956. // https://fetch.spec.whatwg.org/#dom-body-bodyused
  13957. get bodyUsed () {
  13958. return util.isDisturbed(this)
  13959. }
  13960. // https://fetch.spec.whatwg.org/#dom-body-body
  13961. get body () {
  13962. if (!this[kBody]) {
  13963. this[kBody] = ReadableStreamFrom(this)
  13964. if (this[kConsume]) {
  13965. // TODO: Is this the best way to force a lock?
  13966. this[kBody].getReader() // Ensure stream is locked.
  13967. assert(this[kBody].locked)
  13968. }
  13969. }
  13970. return this[kBody]
  13971. }
  13972. dump (opts) {
  13973. let limit = opts && Number.isFinite(opts.limit) ? opts.limit : 262144
  13974. const signal = opts && opts.signal
  13975. if (signal) {
  13976. try {
  13977. if (typeof signal !== 'object' || !('aborted' in signal)) {
  13978. throw new InvalidArgumentError('signal must be an AbortSignal')
  13979. }
  13980. util.throwIfAborted(signal)
  13981. } catch (err) {
  13982. return Promise.reject(err)
  13983. }
  13984. }
  13985. if (this.closed) {
  13986. return Promise.resolve(null)
  13987. }
  13988. return new Promise((resolve, reject) => {
  13989. const signalListenerCleanup = signal
  13990. ? util.addAbortListener(signal, () => {
  13991. this.destroy()
  13992. })
  13993. : noop
  13994. this
  13995. .on('close', function () {
  13996. signalListenerCleanup()
  13997. if (signal && signal.aborted) {
  13998. reject(signal.reason || Object.assign(new Error('The operation was aborted'), { name: 'AbortError' }))
  13999. } else {
  14000. resolve(null)
  14001. }
  14002. })
  14003. .on('error', noop)
  14004. .on('data', function (chunk) {
  14005. limit -= chunk.length
  14006. if (limit <= 0) {
  14007. this.destroy()
  14008. }
  14009. })
  14010. .resume()
  14011. })
  14012. }
  14013. }
  14014. // https://streams.spec.whatwg.org/#readablestream-locked
  14015. function isLocked (self) {
  14016. // Consume is an implicit lock.
  14017. return (self[kBody] && self[kBody].locked === true) || self[kConsume]
  14018. }
  14019. // https://fetch.spec.whatwg.org/#body-unusable
  14020. function isUnusable (self) {
  14021. return util.isDisturbed(self) || isLocked(self)
  14022. }
  14023. async function consume (stream, type) {
  14024. if (isUnusable(stream)) {
  14025. throw new TypeError('unusable')
  14026. }
  14027. assert(!stream[kConsume])
  14028. return new Promise((resolve, reject) => {
  14029. stream[kConsume] = {
  14030. type,
  14031. stream,
  14032. resolve,
  14033. reject,
  14034. length: 0,
  14035. body: []
  14036. }
  14037. stream
  14038. .on('error', function (err) {
  14039. consumeFinish(this[kConsume], err)
  14040. })
  14041. .on('close', function () {
  14042. if (this[kConsume].body !== null) {
  14043. consumeFinish(this[kConsume], new RequestAbortedError())
  14044. }
  14045. })
  14046. process.nextTick(consumeStart, stream[kConsume])
  14047. })
  14048. }
  14049. function consumeStart (consume) {
  14050. if (consume.body === null) {
  14051. return
  14052. }
  14053. const { _readableState: state } = consume.stream
  14054. for (const chunk of state.buffer) {
  14055. consumePush(consume, chunk)
  14056. }
  14057. if (state.endEmitted) {
  14058. consumeEnd(this[kConsume])
  14059. } else {
  14060. consume.stream.on('end', function () {
  14061. consumeEnd(this[kConsume])
  14062. })
  14063. }
  14064. consume.stream.resume()
  14065. while (consume.stream.read() != null) {
  14066. // Loop
  14067. }
  14068. }
  14069. function consumeEnd (consume) {
  14070. const { type, body, resolve, stream, length } = consume
  14071. try {
  14072. if (type === 'text') {
  14073. resolve(toUSVString(Buffer.concat(body)))
  14074. } else if (type === 'json') {
  14075. resolve(JSON.parse(Buffer.concat(body)))
  14076. } else if (type === 'arrayBuffer') {
  14077. const dst = new Uint8Array(length)
  14078. let pos = 0
  14079. for (const buf of body) {
  14080. dst.set(buf, pos)
  14081. pos += buf.byteLength
  14082. }
  14083. resolve(dst.buffer)
  14084. } else if (type === 'blob') {
  14085. if (!Blob) {
  14086. Blob = (__nccwpck_require__(4300).Blob)
  14087. }
  14088. resolve(new Blob(body, { type: stream[kContentType] }))
  14089. }
  14090. consumeFinish(consume)
  14091. } catch (err) {
  14092. stream.destroy(err)
  14093. }
  14094. }
  14095. function consumePush (consume, chunk) {
  14096. consume.length += chunk.length
  14097. consume.body.push(chunk)
  14098. }
  14099. function consumeFinish (consume, err) {
  14100. if (consume.body === null) {
  14101. return
  14102. }
  14103. if (err) {
  14104. consume.reject(err)
  14105. } else {
  14106. consume.resolve()
  14107. }
  14108. consume.type = null
  14109. consume.stream = null
  14110. consume.resolve = null
  14111. consume.reject = null
  14112. consume.length = 0
  14113. consume.body = null
  14114. }
  14115. /***/ }),
  14116. /***/ 7474:
  14117. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  14118. const assert = __nccwpck_require__(9491)
  14119. const {
  14120. ResponseStatusCodeError
  14121. } = __nccwpck_require__(8045)
  14122. const { toUSVString } = __nccwpck_require__(3983)
  14123. async function getResolveErrorBodyCallback ({ callback, body, contentType, statusCode, statusMessage, headers }) {
  14124. assert(body)
  14125. let chunks = []
  14126. let limit = 0
  14127. for await (const chunk of body) {
  14128. chunks.push(chunk)
  14129. limit += chunk.length
  14130. if (limit > 128 * 1024) {
  14131. chunks = null
  14132. break
  14133. }
  14134. }
  14135. if (statusCode === 204 || !contentType || !chunks) {
  14136. process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers))
  14137. return
  14138. }
  14139. try {
  14140. if (contentType.startsWith('application/json')) {
  14141. const payload = JSON.parse(toUSVString(Buffer.concat(chunks)))
  14142. process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers, payload))
  14143. return
  14144. }
  14145. if (contentType.startsWith('text/')) {
  14146. const payload = toUSVString(Buffer.concat(chunks))
  14147. process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers, payload))
  14148. return
  14149. }
  14150. } catch (err) {
  14151. // Process in a fallback if error
  14152. }
  14153. process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers))
  14154. }
  14155. module.exports = { getResolveErrorBodyCallback }
  14156. /***/ }),
  14157. /***/ 7931:
  14158. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  14159. "use strict";
  14160. const {
  14161. BalancedPoolMissingUpstreamError,
  14162. InvalidArgumentError
  14163. } = __nccwpck_require__(8045)
  14164. const {
  14165. PoolBase,
  14166. kClients,
  14167. kNeedDrain,
  14168. kAddClient,
  14169. kRemoveClient,
  14170. kGetDispatcher
  14171. } = __nccwpck_require__(3198)
  14172. const Pool = __nccwpck_require__(4634)
  14173. const { kUrl, kInterceptors } = __nccwpck_require__(2785)
  14174. const { parseOrigin } = __nccwpck_require__(3983)
  14175. const kFactory = Symbol('factory')
  14176. const kOptions = Symbol('options')
  14177. const kGreatestCommonDivisor = Symbol('kGreatestCommonDivisor')
  14178. const kCurrentWeight = Symbol('kCurrentWeight')
  14179. const kIndex = Symbol('kIndex')
  14180. const kWeight = Symbol('kWeight')
  14181. const kMaxWeightPerServer = Symbol('kMaxWeightPerServer')
  14182. const kErrorPenalty = Symbol('kErrorPenalty')
  14183. function getGreatestCommonDivisor (a, b) {
  14184. if (b === 0) return a
  14185. return getGreatestCommonDivisor(b, a % b)
  14186. }
  14187. function defaultFactory (origin, opts) {
  14188. return new Pool(origin, opts)
  14189. }
  14190. class BalancedPool extends PoolBase {
  14191. constructor (upstreams = [], { factory = defaultFactory, ...opts } = {}) {
  14192. super()
  14193. this[kOptions] = opts
  14194. this[kIndex] = -1
  14195. this[kCurrentWeight] = 0
  14196. this[kMaxWeightPerServer] = this[kOptions].maxWeightPerServer || 100
  14197. this[kErrorPenalty] = this[kOptions].errorPenalty || 15
  14198. if (!Array.isArray(upstreams)) {
  14199. upstreams = [upstreams]
  14200. }
  14201. if (typeof factory !== 'function') {
  14202. throw new InvalidArgumentError('factory must be a function.')
  14203. }
  14204. this[kInterceptors] = opts.interceptors && opts.interceptors.BalancedPool && Array.isArray(opts.interceptors.BalancedPool)
  14205. ? opts.interceptors.BalancedPool
  14206. : []
  14207. this[kFactory] = factory
  14208. for (const upstream of upstreams) {
  14209. this.addUpstream(upstream)
  14210. }
  14211. this._updateBalancedPoolStats()
  14212. }
  14213. addUpstream (upstream) {
  14214. const upstreamOrigin = parseOrigin(upstream).origin
  14215. if (this[kClients].find((pool) => (
  14216. pool[kUrl].origin === upstreamOrigin &&
  14217. pool.closed !== true &&
  14218. pool.destroyed !== true
  14219. ))) {
  14220. return this
  14221. }
  14222. const pool = this[kFactory](upstreamOrigin, Object.assign({}, this[kOptions]))
  14223. this[kAddClient](pool)
  14224. pool.on('connect', () => {
  14225. pool[kWeight] = Math.min(this[kMaxWeightPerServer], pool[kWeight] + this[kErrorPenalty])
  14226. })
  14227. pool.on('connectionError', () => {
  14228. pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty])
  14229. this._updateBalancedPoolStats()
  14230. })
  14231. pool.on('disconnect', (...args) => {
  14232. const err = args[2]
  14233. if (err && err.code === 'UND_ERR_SOCKET') {
  14234. // decrease the weight of the pool.
  14235. pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty])
  14236. this._updateBalancedPoolStats()
  14237. }
  14238. })
  14239. for (const client of this[kClients]) {
  14240. client[kWeight] = this[kMaxWeightPerServer]
  14241. }
  14242. this._updateBalancedPoolStats()
  14243. return this
  14244. }
  14245. _updateBalancedPoolStats () {
  14246. this[kGreatestCommonDivisor] = this[kClients].map(p => p[kWeight]).reduce(getGreatestCommonDivisor, 0)
  14247. }
  14248. removeUpstream (upstream) {
  14249. const upstreamOrigin = parseOrigin(upstream).origin
  14250. const pool = this[kClients].find((pool) => (
  14251. pool[kUrl].origin === upstreamOrigin &&
  14252. pool.closed !== true &&
  14253. pool.destroyed !== true
  14254. ))
  14255. if (pool) {
  14256. this[kRemoveClient](pool)
  14257. }
  14258. return this
  14259. }
  14260. get upstreams () {
  14261. return this[kClients]
  14262. .filter(dispatcher => dispatcher.closed !== true && dispatcher.destroyed !== true)
  14263. .map((p) => p[kUrl].origin)
  14264. }
  14265. [kGetDispatcher] () {
  14266. // We validate that pools is greater than 0,
  14267. // otherwise we would have to wait until an upstream
  14268. // is added, which might never happen.
  14269. if (this[kClients].length === 0) {
  14270. throw new BalancedPoolMissingUpstreamError()
  14271. }
  14272. const dispatcher = this[kClients].find(dispatcher => (
  14273. !dispatcher[kNeedDrain] &&
  14274. dispatcher.closed !== true &&
  14275. dispatcher.destroyed !== true
  14276. ))
  14277. if (!dispatcher) {
  14278. return
  14279. }
  14280. const allClientsBusy = this[kClients].map(pool => pool[kNeedDrain]).reduce((a, b) => a && b, true)
  14281. if (allClientsBusy) {
  14282. return
  14283. }
  14284. let counter = 0
  14285. let maxWeightIndex = this[kClients].findIndex(pool => !pool[kNeedDrain])
  14286. while (counter++ < this[kClients].length) {
  14287. this[kIndex] = (this[kIndex] + 1) % this[kClients].length
  14288. const pool = this[kClients][this[kIndex]]
  14289. // find pool index with the largest weight
  14290. if (pool[kWeight] > this[kClients][maxWeightIndex][kWeight] && !pool[kNeedDrain]) {
  14291. maxWeightIndex = this[kIndex]
  14292. }
  14293. // decrease the current weight every `this[kClients].length`.
  14294. if (this[kIndex] === 0) {
  14295. // Set the current weight to the next lower weight.
  14296. this[kCurrentWeight] = this[kCurrentWeight] - this[kGreatestCommonDivisor]
  14297. if (this[kCurrentWeight] <= 0) {
  14298. this[kCurrentWeight] = this[kMaxWeightPerServer]
  14299. }
  14300. }
  14301. if (pool[kWeight] >= this[kCurrentWeight] && (!pool[kNeedDrain])) {
  14302. return pool
  14303. }
  14304. }
  14305. this[kCurrentWeight] = this[kClients][maxWeightIndex][kWeight]
  14306. this[kIndex] = maxWeightIndex
  14307. return this[kClients][maxWeightIndex]
  14308. }
  14309. }
  14310. module.exports = BalancedPool
  14311. /***/ }),
  14312. /***/ 6101:
  14313. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  14314. "use strict";
  14315. const { kConstruct } = __nccwpck_require__(9174)
  14316. const { urlEquals, fieldValues: getFieldValues } = __nccwpck_require__(2396)
  14317. const { kEnumerableProperty, isDisturbed } = __nccwpck_require__(3983)
  14318. const { kHeadersList } = __nccwpck_require__(2785)
  14319. const { webidl } = __nccwpck_require__(1744)
  14320. const { Response, cloneResponse } = __nccwpck_require__(7823)
  14321. const { Request } = __nccwpck_require__(8359)
  14322. const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(5861)
  14323. const { fetching } = __nccwpck_require__(4881)
  14324. const { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = __nccwpck_require__(2538)
  14325. const assert = __nccwpck_require__(9491)
  14326. const { getGlobalDispatcher } = __nccwpck_require__(1892)
  14327. /**
  14328. * @see https://w3c.github.io/ServiceWorker/#dfn-cache-batch-operation
  14329. * @typedef {Object} CacheBatchOperation
  14330. * @property {'delete' | 'put'} type
  14331. * @property {any} request
  14332. * @property {any} response
  14333. * @property {import('../../types/cache').CacheQueryOptions} options
  14334. */
  14335. /**
  14336. * @see https://w3c.github.io/ServiceWorker/#dfn-request-response-list
  14337. * @typedef {[any, any][]} requestResponseList
  14338. */
  14339. class Cache {
  14340. /**
  14341. * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-request-response-list
  14342. * @type {requestResponseList}
  14343. */
  14344. #relevantRequestResponseList
  14345. constructor () {
  14346. if (arguments[0] !== kConstruct) {
  14347. webidl.illegalConstructor()
  14348. }
  14349. this.#relevantRequestResponseList = arguments[1]
  14350. }
  14351. async match (request, options = {}) {
  14352. webidl.brandCheck(this, Cache)
  14353. webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.match' })
  14354. request = webidl.converters.RequestInfo(request)
  14355. options = webidl.converters.CacheQueryOptions(options)
  14356. const p = await this.matchAll(request, options)
  14357. if (p.length === 0) {
  14358. return
  14359. }
  14360. return p[0]
  14361. }
  14362. async matchAll (request = undefined, options = {}) {
  14363. webidl.brandCheck(this, Cache)
  14364. if (request !== undefined) request = webidl.converters.RequestInfo(request)
  14365. options = webidl.converters.CacheQueryOptions(options)
  14366. // 1.
  14367. let r = null
  14368. // 2.
  14369. if (request !== undefined) {
  14370. if (request instanceof Request) {
  14371. // 2.1.1
  14372. r = request[kState]
  14373. // 2.1.2
  14374. if (r.method !== 'GET' && !options.ignoreMethod) {
  14375. return []
  14376. }
  14377. } else if (typeof request === 'string') {
  14378. // 2.2.1
  14379. r = new Request(request)[kState]
  14380. }
  14381. }
  14382. // 5.
  14383. // 5.1
  14384. const responses = []
  14385. // 5.2
  14386. if (request === undefined) {
  14387. // 5.2.1
  14388. for (const requestResponse of this.#relevantRequestResponseList) {
  14389. responses.push(requestResponse[1])
  14390. }
  14391. } else { // 5.3
  14392. // 5.3.1
  14393. const requestResponses = this.#queryCache(r, options)
  14394. // 5.3.2
  14395. for (const requestResponse of requestResponses) {
  14396. responses.push(requestResponse[1])
  14397. }
  14398. }
  14399. // 5.4
  14400. // We don't implement CORs so we don't need to loop over the responses, yay!
  14401. // 5.5.1
  14402. const responseList = []
  14403. // 5.5.2
  14404. for (const response of responses) {
  14405. // 5.5.2.1
  14406. const responseObject = new Response(response.body?.source ?? null)
  14407. const body = responseObject[kState].body
  14408. responseObject[kState] = response
  14409. responseObject[kState].body = body
  14410. responseObject[kHeaders][kHeadersList] = response.headersList
  14411. responseObject[kHeaders][kGuard] = 'immutable'
  14412. responseList.push(responseObject)
  14413. }
  14414. // 6.
  14415. return Object.freeze(responseList)
  14416. }
  14417. async add (request) {
  14418. webidl.brandCheck(this, Cache)
  14419. webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.add' })
  14420. request = webidl.converters.RequestInfo(request)
  14421. // 1.
  14422. const requests = [request]
  14423. // 2.
  14424. const responseArrayPromise = this.addAll(requests)
  14425. // 3.
  14426. return await responseArrayPromise
  14427. }
  14428. async addAll (requests) {
  14429. webidl.brandCheck(this, Cache)
  14430. webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.addAll' })
  14431. requests = webidl.converters['sequence<RequestInfo>'](requests)
  14432. // 1.
  14433. const responsePromises = []
  14434. // 2.
  14435. const requestList = []
  14436. // 3.
  14437. for (const request of requests) {
  14438. if (typeof request === 'string') {
  14439. continue
  14440. }
  14441. // 3.1
  14442. const r = request[kState]
  14443. // 3.2
  14444. if (!urlIsHttpHttpsScheme(r.url) || r.method !== 'GET') {
  14445. throw webidl.errors.exception({
  14446. header: 'Cache.addAll',
  14447. message: 'Expected http/s scheme when method is not GET.'
  14448. })
  14449. }
  14450. }
  14451. // 4.
  14452. /** @type {ReturnType<typeof fetching>[]} */
  14453. const fetchControllers = []
  14454. // 5.
  14455. for (const request of requests) {
  14456. // 5.1
  14457. const r = new Request(request)[kState]
  14458. // 5.2
  14459. if (!urlIsHttpHttpsScheme(r.url)) {
  14460. throw webidl.errors.exception({
  14461. header: 'Cache.addAll',
  14462. message: 'Expected http/s scheme.'
  14463. })
  14464. }
  14465. // 5.4
  14466. r.initiator = 'fetch'
  14467. r.destination = 'subresource'
  14468. // 5.5
  14469. requestList.push(r)
  14470. // 5.6
  14471. const responsePromise = createDeferredPromise()
  14472. // 5.7
  14473. fetchControllers.push(fetching({
  14474. request: r,
  14475. dispatcher: getGlobalDispatcher(),
  14476. processResponse (response) {
  14477. // 1.
  14478. if (response.type === 'error' || response.status === 206 || response.status < 200 || response.status > 299) {
  14479. responsePromise.reject(webidl.errors.exception({
  14480. header: 'Cache.addAll',
  14481. message: 'Received an invalid status code or the request failed.'
  14482. }))
  14483. } else if (response.headersList.contains('vary')) { // 2.
  14484. // 2.1
  14485. const fieldValues = getFieldValues(response.headersList.get('vary'))
  14486. // 2.2
  14487. for (const fieldValue of fieldValues) {
  14488. // 2.2.1
  14489. if (fieldValue === '*') {
  14490. responsePromise.reject(webidl.errors.exception({
  14491. header: 'Cache.addAll',
  14492. message: 'invalid vary field value'
  14493. }))
  14494. for (const controller of fetchControllers) {
  14495. controller.abort()
  14496. }
  14497. return
  14498. }
  14499. }
  14500. }
  14501. },
  14502. processResponseEndOfBody (response) {
  14503. // 1.
  14504. if (response.aborted) {
  14505. responsePromise.reject(new DOMException('aborted', 'AbortError'))
  14506. return
  14507. }
  14508. // 2.
  14509. responsePromise.resolve(response)
  14510. }
  14511. }))
  14512. // 5.8
  14513. responsePromises.push(responsePromise.promise)
  14514. }
  14515. // 6.
  14516. const p = Promise.all(responsePromises)
  14517. // 7.
  14518. const responses = await p
  14519. // 7.1
  14520. const operations = []
  14521. // 7.2
  14522. let index = 0
  14523. // 7.3
  14524. for (const response of responses) {
  14525. // 7.3.1
  14526. /** @type {CacheBatchOperation} */
  14527. const operation = {
  14528. type: 'put', // 7.3.2
  14529. request: requestList[index], // 7.3.3
  14530. response // 7.3.4
  14531. }
  14532. operations.push(operation) // 7.3.5
  14533. index++ // 7.3.6
  14534. }
  14535. // 7.5
  14536. const cacheJobPromise = createDeferredPromise()
  14537. // 7.6.1
  14538. let errorData = null
  14539. // 7.6.2
  14540. try {
  14541. this.#batchCacheOperations(operations)
  14542. } catch (e) {
  14543. errorData = e
  14544. }
  14545. // 7.6.3
  14546. queueMicrotask(() => {
  14547. // 7.6.3.1
  14548. if (errorData === null) {
  14549. cacheJobPromise.resolve(undefined)
  14550. } else {
  14551. // 7.6.3.2
  14552. cacheJobPromise.reject(errorData)
  14553. }
  14554. })
  14555. // 7.7
  14556. return cacheJobPromise.promise
  14557. }
  14558. async put (request, response) {
  14559. webidl.brandCheck(this, Cache)
  14560. webidl.argumentLengthCheck(arguments, 2, { header: 'Cache.put' })
  14561. request = webidl.converters.RequestInfo(request)
  14562. response = webidl.converters.Response(response)
  14563. // 1.
  14564. let innerRequest = null
  14565. // 2.
  14566. if (request instanceof Request) {
  14567. innerRequest = request[kState]
  14568. } else { // 3.
  14569. innerRequest = new Request(request)[kState]
  14570. }
  14571. // 4.
  14572. if (!urlIsHttpHttpsScheme(innerRequest.url) || innerRequest.method !== 'GET') {
  14573. throw webidl.errors.exception({
  14574. header: 'Cache.put',
  14575. message: 'Expected an http/s scheme when method is not GET'
  14576. })
  14577. }
  14578. // 5.
  14579. const innerResponse = response[kState]
  14580. // 6.
  14581. if (innerResponse.status === 206) {
  14582. throw webidl.errors.exception({
  14583. header: 'Cache.put',
  14584. message: 'Got 206 status'
  14585. })
  14586. }
  14587. // 7.
  14588. if (innerResponse.headersList.contains('vary')) {
  14589. // 7.1.
  14590. const fieldValues = getFieldValues(innerResponse.headersList.get('vary'))
  14591. // 7.2.
  14592. for (const fieldValue of fieldValues) {
  14593. // 7.2.1
  14594. if (fieldValue === '*') {
  14595. throw webidl.errors.exception({
  14596. header: 'Cache.put',
  14597. message: 'Got * vary field value'
  14598. })
  14599. }
  14600. }
  14601. }
  14602. // 8.
  14603. if (innerResponse.body && (isDisturbed(innerResponse.body.stream) || innerResponse.body.stream.locked)) {
  14604. throw webidl.errors.exception({
  14605. header: 'Cache.put',
  14606. message: 'Response body is locked or disturbed'
  14607. })
  14608. }
  14609. // 9.
  14610. const clonedResponse = cloneResponse(innerResponse)
  14611. // 10.
  14612. const bodyReadPromise = createDeferredPromise()
  14613. // 11.
  14614. if (innerResponse.body != null) {
  14615. // 11.1
  14616. const stream = innerResponse.body.stream
  14617. // 11.2
  14618. const reader = stream.getReader()
  14619. // 11.3
  14620. readAllBytes(reader).then(bodyReadPromise.resolve, bodyReadPromise.reject)
  14621. } else {
  14622. bodyReadPromise.resolve(undefined)
  14623. }
  14624. // 12.
  14625. /** @type {CacheBatchOperation[]} */
  14626. const operations = []
  14627. // 13.
  14628. /** @type {CacheBatchOperation} */
  14629. const operation = {
  14630. type: 'put', // 14.
  14631. request: innerRequest, // 15.
  14632. response: clonedResponse // 16.
  14633. }
  14634. // 17.
  14635. operations.push(operation)
  14636. // 19.
  14637. const bytes = await bodyReadPromise.promise
  14638. if (clonedResponse.body != null) {
  14639. clonedResponse.body.source = bytes
  14640. }
  14641. // 19.1
  14642. const cacheJobPromise = createDeferredPromise()
  14643. // 19.2.1
  14644. let errorData = null
  14645. // 19.2.2
  14646. try {
  14647. this.#batchCacheOperations(operations)
  14648. } catch (e) {
  14649. errorData = e
  14650. }
  14651. // 19.2.3
  14652. queueMicrotask(() => {
  14653. // 19.2.3.1
  14654. if (errorData === null) {
  14655. cacheJobPromise.resolve()
  14656. } else { // 19.2.3.2
  14657. cacheJobPromise.reject(errorData)
  14658. }
  14659. })
  14660. return cacheJobPromise.promise
  14661. }
  14662. async delete (request, options = {}) {
  14663. webidl.brandCheck(this, Cache)
  14664. webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.delete' })
  14665. request = webidl.converters.RequestInfo(request)
  14666. options = webidl.converters.CacheQueryOptions(options)
  14667. /**
  14668. * @type {Request}
  14669. */
  14670. let r = null
  14671. if (request instanceof Request) {
  14672. r = request[kState]
  14673. if (r.method !== 'GET' && !options.ignoreMethod) {
  14674. return false
  14675. }
  14676. } else {
  14677. assert(typeof request === 'string')
  14678. r = new Request(request)[kState]
  14679. }
  14680. /** @type {CacheBatchOperation[]} */
  14681. const operations = []
  14682. /** @type {CacheBatchOperation} */
  14683. const operation = {
  14684. type: 'delete',
  14685. request: r,
  14686. options
  14687. }
  14688. operations.push(operation)
  14689. const cacheJobPromise = createDeferredPromise()
  14690. let errorData = null
  14691. let requestResponses
  14692. try {
  14693. requestResponses = this.#batchCacheOperations(operations)
  14694. } catch (e) {
  14695. errorData = e
  14696. }
  14697. queueMicrotask(() => {
  14698. if (errorData === null) {
  14699. cacheJobPromise.resolve(!!requestResponses?.length)
  14700. } else {
  14701. cacheJobPromise.reject(errorData)
  14702. }
  14703. })
  14704. return cacheJobPromise.promise
  14705. }
  14706. /**
  14707. * @see https://w3c.github.io/ServiceWorker/#dom-cache-keys
  14708. * @param {any} request
  14709. * @param {import('../../types/cache').CacheQueryOptions} options
  14710. * @returns {readonly Request[]}
  14711. */
  14712. async keys (request = undefined, options = {}) {
  14713. webidl.brandCheck(this, Cache)
  14714. if (request !== undefined) request = webidl.converters.RequestInfo(request)
  14715. options = webidl.converters.CacheQueryOptions(options)
  14716. // 1.
  14717. let r = null
  14718. // 2.
  14719. if (request !== undefined) {
  14720. // 2.1
  14721. if (request instanceof Request) {
  14722. // 2.1.1
  14723. r = request[kState]
  14724. // 2.1.2
  14725. if (r.method !== 'GET' && !options.ignoreMethod) {
  14726. return []
  14727. }
  14728. } else if (typeof request === 'string') { // 2.2
  14729. r = new Request(request)[kState]
  14730. }
  14731. }
  14732. // 4.
  14733. const promise = createDeferredPromise()
  14734. // 5.
  14735. // 5.1
  14736. const requests = []
  14737. // 5.2
  14738. if (request === undefined) {
  14739. // 5.2.1
  14740. for (const requestResponse of this.#relevantRequestResponseList) {
  14741. // 5.2.1.1
  14742. requests.push(requestResponse[0])
  14743. }
  14744. } else { // 5.3
  14745. // 5.3.1
  14746. const requestResponses = this.#queryCache(r, options)
  14747. // 5.3.2
  14748. for (const requestResponse of requestResponses) {
  14749. // 5.3.2.1
  14750. requests.push(requestResponse[0])
  14751. }
  14752. }
  14753. // 5.4
  14754. queueMicrotask(() => {
  14755. // 5.4.1
  14756. const requestList = []
  14757. // 5.4.2
  14758. for (const request of requests) {
  14759. const requestObject = new Request('https://a')
  14760. requestObject[kState] = request
  14761. requestObject[kHeaders][kHeadersList] = request.headersList
  14762. requestObject[kHeaders][kGuard] = 'immutable'
  14763. requestObject[kRealm] = request.client
  14764. // 5.4.2.1
  14765. requestList.push(requestObject)
  14766. }
  14767. // 5.4.3
  14768. promise.resolve(Object.freeze(requestList))
  14769. })
  14770. return promise.promise
  14771. }
  14772. /**
  14773. * @see https://w3c.github.io/ServiceWorker/#batch-cache-operations-algorithm
  14774. * @param {CacheBatchOperation[]} operations
  14775. * @returns {requestResponseList}
  14776. */
  14777. #batchCacheOperations (operations) {
  14778. // 1.
  14779. const cache = this.#relevantRequestResponseList
  14780. // 2.
  14781. const backupCache = [...cache]
  14782. // 3.
  14783. const addedItems = []
  14784. // 4.1
  14785. const resultList = []
  14786. try {
  14787. // 4.2
  14788. for (const operation of operations) {
  14789. // 4.2.1
  14790. if (operation.type !== 'delete' && operation.type !== 'put') {
  14791. throw webidl.errors.exception({
  14792. header: 'Cache.#batchCacheOperations',
  14793. message: 'operation type does not match "delete" or "put"'
  14794. })
  14795. }
  14796. // 4.2.2
  14797. if (operation.type === 'delete' && operation.response != null) {
  14798. throw webidl.errors.exception({
  14799. header: 'Cache.#batchCacheOperations',
  14800. message: 'delete operation should not have an associated response'
  14801. })
  14802. }
  14803. // 4.2.3
  14804. if (this.#queryCache(operation.request, operation.options, addedItems).length) {
  14805. throw new DOMException('???', 'InvalidStateError')
  14806. }
  14807. // 4.2.4
  14808. let requestResponses
  14809. // 4.2.5
  14810. if (operation.type === 'delete') {
  14811. // 4.2.5.1
  14812. requestResponses = this.#queryCache(operation.request, operation.options)
  14813. // TODO: the spec is wrong, this is needed to pass WPTs
  14814. if (requestResponses.length === 0) {
  14815. return []
  14816. }
  14817. // 4.2.5.2
  14818. for (const requestResponse of requestResponses) {
  14819. const idx = cache.indexOf(requestResponse)
  14820. assert(idx !== -1)
  14821. // 4.2.5.2.1
  14822. cache.splice(idx, 1)
  14823. }
  14824. } else if (operation.type === 'put') { // 4.2.6
  14825. // 4.2.6.1
  14826. if (operation.response == null) {
  14827. throw webidl.errors.exception({
  14828. header: 'Cache.#batchCacheOperations',
  14829. message: 'put operation should have an associated response'
  14830. })
  14831. }
  14832. // 4.2.6.2
  14833. const r = operation.request
  14834. // 4.2.6.3
  14835. if (!urlIsHttpHttpsScheme(r.url)) {
  14836. throw webidl.errors.exception({
  14837. header: 'Cache.#batchCacheOperations',
  14838. message: 'expected http or https scheme'
  14839. })
  14840. }
  14841. // 4.2.6.4
  14842. if (r.method !== 'GET') {
  14843. throw webidl.errors.exception({
  14844. header: 'Cache.#batchCacheOperations',
  14845. message: 'not get method'
  14846. })
  14847. }
  14848. // 4.2.6.5
  14849. if (operation.options != null) {
  14850. throw webidl.errors.exception({
  14851. header: 'Cache.#batchCacheOperations',
  14852. message: 'options must not be defined'
  14853. })
  14854. }
  14855. // 4.2.6.6
  14856. requestResponses = this.#queryCache(operation.request)
  14857. // 4.2.6.7
  14858. for (const requestResponse of requestResponses) {
  14859. const idx = cache.indexOf(requestResponse)
  14860. assert(idx !== -1)
  14861. // 4.2.6.7.1
  14862. cache.splice(idx, 1)
  14863. }
  14864. // 4.2.6.8
  14865. cache.push([operation.request, operation.response])
  14866. // 4.2.6.10
  14867. addedItems.push([operation.request, operation.response])
  14868. }
  14869. // 4.2.7
  14870. resultList.push([operation.request, operation.response])
  14871. }
  14872. // 4.3
  14873. return resultList
  14874. } catch (e) { // 5.
  14875. // 5.1
  14876. this.#relevantRequestResponseList.length = 0
  14877. // 5.2
  14878. this.#relevantRequestResponseList = backupCache
  14879. // 5.3
  14880. throw e
  14881. }
  14882. }
  14883. /**
  14884. * @see https://w3c.github.io/ServiceWorker/#query-cache
  14885. * @param {any} requestQuery
  14886. * @param {import('../../types/cache').CacheQueryOptions} options
  14887. * @param {requestResponseList} targetStorage
  14888. * @returns {requestResponseList}
  14889. */
  14890. #queryCache (requestQuery, options, targetStorage) {
  14891. /** @type {requestResponseList} */
  14892. const resultList = []
  14893. const storage = targetStorage ?? this.#relevantRequestResponseList
  14894. for (const requestResponse of storage) {
  14895. const [cachedRequest, cachedResponse] = requestResponse
  14896. if (this.#requestMatchesCachedItem(requestQuery, cachedRequest, cachedResponse, options)) {
  14897. resultList.push(requestResponse)
  14898. }
  14899. }
  14900. return resultList
  14901. }
  14902. /**
  14903. * @see https://w3c.github.io/ServiceWorker/#request-matches-cached-item-algorithm
  14904. * @param {any} requestQuery
  14905. * @param {any} request
  14906. * @param {any | null} response
  14907. * @param {import('../../types/cache').CacheQueryOptions | undefined} options
  14908. * @returns {boolean}
  14909. */
  14910. #requestMatchesCachedItem (requestQuery, request, response = null, options) {
  14911. // if (options?.ignoreMethod === false && request.method === 'GET') {
  14912. // return false
  14913. // }
  14914. const queryURL = new URL(requestQuery.url)
  14915. const cachedURL = new URL(request.url)
  14916. if (options?.ignoreSearch) {
  14917. cachedURL.search = ''
  14918. queryURL.search = ''
  14919. }
  14920. if (!urlEquals(queryURL, cachedURL, true)) {
  14921. return false
  14922. }
  14923. if (
  14924. response == null ||
  14925. options?.ignoreVary ||
  14926. !response.headersList.contains('vary')
  14927. ) {
  14928. return true
  14929. }
  14930. const fieldValues = getFieldValues(response.headersList.get('vary'))
  14931. for (const fieldValue of fieldValues) {
  14932. if (fieldValue === '*') {
  14933. return false
  14934. }
  14935. const requestValue = request.headersList.get(fieldValue)
  14936. const queryValue = requestQuery.headersList.get(fieldValue)
  14937. // If one has the header and the other doesn't, or one has
  14938. // a different value than the other, return false
  14939. if (requestValue !== queryValue) {
  14940. return false
  14941. }
  14942. }
  14943. return true
  14944. }
  14945. }
  14946. Object.defineProperties(Cache.prototype, {
  14947. [Symbol.toStringTag]: {
  14948. value: 'Cache',
  14949. configurable: true
  14950. },
  14951. match: kEnumerableProperty,
  14952. matchAll: kEnumerableProperty,
  14953. add: kEnumerableProperty,
  14954. addAll: kEnumerableProperty,
  14955. put: kEnumerableProperty,
  14956. delete: kEnumerableProperty,
  14957. keys: kEnumerableProperty
  14958. })
  14959. const cacheQueryOptionConverters = [
  14960. {
  14961. key: 'ignoreSearch',
  14962. converter: webidl.converters.boolean,
  14963. defaultValue: false
  14964. },
  14965. {
  14966. key: 'ignoreMethod',
  14967. converter: webidl.converters.boolean,
  14968. defaultValue: false
  14969. },
  14970. {
  14971. key: 'ignoreVary',
  14972. converter: webidl.converters.boolean,
  14973. defaultValue: false
  14974. }
  14975. ]
  14976. webidl.converters.CacheQueryOptions = webidl.dictionaryConverter(cacheQueryOptionConverters)
  14977. webidl.converters.MultiCacheQueryOptions = webidl.dictionaryConverter([
  14978. ...cacheQueryOptionConverters,
  14979. {
  14980. key: 'cacheName',
  14981. converter: webidl.converters.DOMString
  14982. }
  14983. ])
  14984. webidl.converters.Response = webidl.interfaceConverter(Response)
  14985. webidl.converters['sequence<RequestInfo>'] = webidl.sequenceConverter(
  14986. webidl.converters.RequestInfo
  14987. )
  14988. module.exports = {
  14989. Cache
  14990. }
  14991. /***/ }),
  14992. /***/ 7907:
  14993. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  14994. "use strict";
  14995. const { kConstruct } = __nccwpck_require__(9174)
  14996. const { Cache } = __nccwpck_require__(6101)
  14997. const { webidl } = __nccwpck_require__(1744)
  14998. const { kEnumerableProperty } = __nccwpck_require__(3983)
  14999. class CacheStorage {
  15000. /**
  15001. * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-name-to-cache-map
  15002. * @type {Map<string, import('./cache').requestResponseList}
  15003. */
  15004. #caches = new Map()
  15005. constructor () {
  15006. if (arguments[0] !== kConstruct) {
  15007. webidl.illegalConstructor()
  15008. }
  15009. }
  15010. async match (request, options = {}) {
  15011. webidl.brandCheck(this, CacheStorage)
  15012. webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.match' })
  15013. request = webidl.converters.RequestInfo(request)
  15014. options = webidl.converters.MultiCacheQueryOptions(options)
  15015. // 1.
  15016. if (options.cacheName != null) {
  15017. // 1.1.1.1
  15018. if (this.#caches.has(options.cacheName)) {
  15019. // 1.1.1.1.1
  15020. const cacheList = this.#caches.get(options.cacheName)
  15021. const cache = new Cache(kConstruct, cacheList)
  15022. return await cache.match(request, options)
  15023. }
  15024. } else { // 2.
  15025. // 2.2
  15026. for (const cacheList of this.#caches.values()) {
  15027. const cache = new Cache(kConstruct, cacheList)
  15028. // 2.2.1.2
  15029. const response = await cache.match(request, options)
  15030. if (response !== undefined) {
  15031. return response
  15032. }
  15033. }
  15034. }
  15035. }
  15036. /**
  15037. * @see https://w3c.github.io/ServiceWorker/#cache-storage-has
  15038. * @param {string} cacheName
  15039. * @returns {Promise<boolean>}
  15040. */
  15041. async has (cacheName) {
  15042. webidl.brandCheck(this, CacheStorage)
  15043. webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.has' })
  15044. cacheName = webidl.converters.DOMString(cacheName)
  15045. // 2.1.1
  15046. // 2.2
  15047. return this.#caches.has(cacheName)
  15048. }
  15049. /**
  15050. * @see https://w3c.github.io/ServiceWorker/#dom-cachestorage-open
  15051. * @param {string} cacheName
  15052. * @returns {Promise<Cache>}
  15053. */
  15054. async open (cacheName) {
  15055. webidl.brandCheck(this, CacheStorage)
  15056. webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.open' })
  15057. cacheName = webidl.converters.DOMString(cacheName)
  15058. // 2.1
  15059. if (this.#caches.has(cacheName)) {
  15060. // await caches.open('v1') !== await caches.open('v1')
  15061. // 2.1.1
  15062. const cache = this.#caches.get(cacheName)
  15063. // 2.1.1.1
  15064. return new Cache(kConstruct, cache)
  15065. }
  15066. // 2.2
  15067. const cache = []
  15068. // 2.3
  15069. this.#caches.set(cacheName, cache)
  15070. // 2.4
  15071. return new Cache(kConstruct, cache)
  15072. }
  15073. /**
  15074. * @see https://w3c.github.io/ServiceWorker/#cache-storage-delete
  15075. * @param {string} cacheName
  15076. * @returns {Promise<boolean>}
  15077. */
  15078. async delete (cacheName) {
  15079. webidl.brandCheck(this, CacheStorage)
  15080. webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.delete' })
  15081. cacheName = webidl.converters.DOMString(cacheName)
  15082. return this.#caches.delete(cacheName)
  15083. }
  15084. /**
  15085. * @see https://w3c.github.io/ServiceWorker/#cache-storage-keys
  15086. * @returns {string[]}
  15087. */
  15088. async keys () {
  15089. webidl.brandCheck(this, CacheStorage)
  15090. // 2.1
  15091. const keys = this.#caches.keys()
  15092. // 2.2
  15093. return [...keys]
  15094. }
  15095. }
  15096. Object.defineProperties(CacheStorage.prototype, {
  15097. [Symbol.toStringTag]: {
  15098. value: 'CacheStorage',
  15099. configurable: true
  15100. },
  15101. match: kEnumerableProperty,
  15102. has: kEnumerableProperty,
  15103. open: kEnumerableProperty,
  15104. delete: kEnumerableProperty,
  15105. keys: kEnumerableProperty
  15106. })
  15107. module.exports = {
  15108. CacheStorage
  15109. }
  15110. /***/ }),
  15111. /***/ 9174:
  15112. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  15113. "use strict";
  15114. module.exports = {
  15115. kConstruct: (__nccwpck_require__(2785).kConstruct)
  15116. }
  15117. /***/ }),
  15118. /***/ 2396:
  15119. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  15120. "use strict";
  15121. const assert = __nccwpck_require__(9491)
  15122. const { URLSerializer } = __nccwpck_require__(685)
  15123. const { isValidHeaderName } = __nccwpck_require__(2538)
  15124. /**
  15125. * @see https://url.spec.whatwg.org/#concept-url-equals
  15126. * @param {URL} A
  15127. * @param {URL} B
  15128. * @param {boolean | undefined} excludeFragment
  15129. * @returns {boolean}
  15130. */
  15131. function urlEquals (A, B, excludeFragment = false) {
  15132. const serializedA = URLSerializer(A, excludeFragment)
  15133. const serializedB = URLSerializer(B, excludeFragment)
  15134. return serializedA === serializedB
  15135. }
  15136. /**
  15137. * @see https://github.com/chromium/chromium/blob/694d20d134cb553d8d89e5500b9148012b1ba299/content/browser/cache_storage/cache_storage_cache.cc#L260-L262
  15138. * @param {string} header
  15139. */
  15140. function fieldValues (header) {
  15141. assert(header !== null)
  15142. const values = []
  15143. for (let value of header.split(',')) {
  15144. value = value.trim()
  15145. if (!value.length) {
  15146. continue
  15147. } else if (!isValidHeaderName(value)) {
  15148. continue
  15149. }
  15150. values.push(value)
  15151. }
  15152. return values
  15153. }
  15154. module.exports = {
  15155. urlEquals,
  15156. fieldValues
  15157. }
  15158. /***/ }),
  15159. /***/ 3598:
  15160. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  15161. "use strict";
  15162. // @ts-check
  15163. /* global WebAssembly */
  15164. const assert = __nccwpck_require__(9491)
  15165. const net = __nccwpck_require__(1808)
  15166. const http = __nccwpck_require__(3685)
  15167. const { pipeline } = __nccwpck_require__(2781)
  15168. const util = __nccwpck_require__(3983)
  15169. const timers = __nccwpck_require__(9459)
  15170. const Request = __nccwpck_require__(2905)
  15171. const DispatcherBase = __nccwpck_require__(4839)
  15172. const {
  15173. RequestContentLengthMismatchError,
  15174. ResponseContentLengthMismatchError,
  15175. InvalidArgumentError,
  15176. RequestAbortedError,
  15177. HeadersTimeoutError,
  15178. HeadersOverflowError,
  15179. SocketError,
  15180. InformationalError,
  15181. BodyTimeoutError,
  15182. HTTPParserError,
  15183. ResponseExceededMaxSizeError,
  15184. ClientDestroyedError
  15185. } = __nccwpck_require__(8045)
  15186. const buildConnector = __nccwpck_require__(2067)
  15187. const {
  15188. kUrl,
  15189. kReset,
  15190. kServerName,
  15191. kClient,
  15192. kBusy,
  15193. kParser,
  15194. kConnect,
  15195. kBlocking,
  15196. kResuming,
  15197. kRunning,
  15198. kPending,
  15199. kSize,
  15200. kWriting,
  15201. kQueue,
  15202. kConnected,
  15203. kConnecting,
  15204. kNeedDrain,
  15205. kNoRef,
  15206. kKeepAliveDefaultTimeout,
  15207. kHostHeader,
  15208. kPendingIdx,
  15209. kRunningIdx,
  15210. kError,
  15211. kPipelining,
  15212. kSocket,
  15213. kKeepAliveTimeoutValue,
  15214. kMaxHeadersSize,
  15215. kKeepAliveMaxTimeout,
  15216. kKeepAliveTimeoutThreshold,
  15217. kHeadersTimeout,
  15218. kBodyTimeout,
  15219. kStrictContentLength,
  15220. kConnector,
  15221. kMaxRedirections,
  15222. kMaxRequests,
  15223. kCounter,
  15224. kClose,
  15225. kDestroy,
  15226. kDispatch,
  15227. kInterceptors,
  15228. kLocalAddress,
  15229. kMaxResponseSize,
  15230. kHTTPConnVersion,
  15231. // HTTP2
  15232. kHost,
  15233. kHTTP2Session,
  15234. kHTTP2SessionState,
  15235. kHTTP2BuildRequest,
  15236. kHTTP2CopyHeaders,
  15237. kHTTP1BuildRequest
  15238. } = __nccwpck_require__(2785)
  15239. /** @type {import('http2')} */
  15240. let http2
  15241. try {
  15242. http2 = __nccwpck_require__(5158)
  15243. } catch {
  15244. // @ts-ignore
  15245. http2 = { constants: {} }
  15246. }
  15247. const {
  15248. constants: {
  15249. HTTP2_HEADER_AUTHORITY,
  15250. HTTP2_HEADER_METHOD,
  15251. HTTP2_HEADER_PATH,
  15252. HTTP2_HEADER_SCHEME,
  15253. HTTP2_HEADER_CONTENT_LENGTH,
  15254. HTTP2_HEADER_EXPECT,
  15255. HTTP2_HEADER_STATUS
  15256. }
  15257. } = http2
  15258. // Experimental
  15259. let h2ExperimentalWarned = false
  15260. const FastBuffer = Buffer[Symbol.species]
  15261. const kClosedResolve = Symbol('kClosedResolve')
  15262. const channels = {}
  15263. try {
  15264. const diagnosticsChannel = __nccwpck_require__(7643)
  15265. channels.sendHeaders = diagnosticsChannel.channel('undici:client:sendHeaders')
  15266. channels.beforeConnect = diagnosticsChannel.channel('undici:client:beforeConnect')
  15267. channels.connectError = diagnosticsChannel.channel('undici:client:connectError')
  15268. channels.connected = diagnosticsChannel.channel('undici:client:connected')
  15269. } catch {
  15270. channels.sendHeaders = { hasSubscribers: false }
  15271. channels.beforeConnect = { hasSubscribers: false }
  15272. channels.connectError = { hasSubscribers: false }
  15273. channels.connected = { hasSubscribers: false }
  15274. }
  15275. /**
  15276. * @type {import('../types/client').default}
  15277. */
  15278. class Client extends DispatcherBase {
  15279. /**
  15280. *
  15281. * @param {string|URL} url
  15282. * @param {import('../types/client').Client.Options} options
  15283. */
  15284. constructor (url, {
  15285. interceptors,
  15286. maxHeaderSize,
  15287. headersTimeout,
  15288. socketTimeout,
  15289. requestTimeout,
  15290. connectTimeout,
  15291. bodyTimeout,
  15292. idleTimeout,
  15293. keepAlive,
  15294. keepAliveTimeout,
  15295. maxKeepAliveTimeout,
  15296. keepAliveMaxTimeout,
  15297. keepAliveTimeoutThreshold,
  15298. socketPath,
  15299. pipelining,
  15300. tls,
  15301. strictContentLength,
  15302. maxCachedSessions,
  15303. maxRedirections,
  15304. connect,
  15305. maxRequestsPerClient,
  15306. localAddress,
  15307. maxResponseSize,
  15308. autoSelectFamily,
  15309. autoSelectFamilyAttemptTimeout,
  15310. // h2
  15311. allowH2,
  15312. maxConcurrentStreams
  15313. } = {}) {
  15314. super()
  15315. if (keepAlive !== undefined) {
  15316. throw new InvalidArgumentError('unsupported keepAlive, use pipelining=0 instead')
  15317. }
  15318. if (socketTimeout !== undefined) {
  15319. throw new InvalidArgumentError('unsupported socketTimeout, use headersTimeout & bodyTimeout instead')
  15320. }
  15321. if (requestTimeout !== undefined) {
  15322. throw new InvalidArgumentError('unsupported requestTimeout, use headersTimeout & bodyTimeout instead')
  15323. }
  15324. if (idleTimeout !== undefined) {
  15325. throw new InvalidArgumentError('unsupported idleTimeout, use keepAliveTimeout instead')
  15326. }
  15327. if (maxKeepAliveTimeout !== undefined) {
  15328. throw new InvalidArgumentError('unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead')
  15329. }
  15330. if (maxHeaderSize != null && !Number.isFinite(maxHeaderSize)) {
  15331. throw new InvalidArgumentError('invalid maxHeaderSize')
  15332. }
  15333. if (socketPath != null && typeof socketPath !== 'string') {
  15334. throw new InvalidArgumentError('invalid socketPath')
  15335. }
  15336. if (connectTimeout != null && (!Number.isFinite(connectTimeout) || connectTimeout < 0)) {
  15337. throw new InvalidArgumentError('invalid connectTimeout')
  15338. }
  15339. if (keepAliveTimeout != null && (!Number.isFinite(keepAliveTimeout) || keepAliveTimeout <= 0)) {
  15340. throw new InvalidArgumentError('invalid keepAliveTimeout')
  15341. }
  15342. if (keepAliveMaxTimeout != null && (!Number.isFinite(keepAliveMaxTimeout) || keepAliveMaxTimeout <= 0)) {
  15343. throw new InvalidArgumentError('invalid keepAliveMaxTimeout')
  15344. }
  15345. if (keepAliveTimeoutThreshold != null && !Number.isFinite(keepAliveTimeoutThreshold)) {
  15346. throw new InvalidArgumentError('invalid keepAliveTimeoutThreshold')
  15347. }
  15348. if (headersTimeout != null && (!Number.isInteger(headersTimeout) || headersTimeout < 0)) {
  15349. throw new InvalidArgumentError('headersTimeout must be a positive integer or zero')
  15350. }
  15351. if (bodyTimeout != null && (!Number.isInteger(bodyTimeout) || bodyTimeout < 0)) {
  15352. throw new InvalidArgumentError('bodyTimeout must be a positive integer or zero')
  15353. }
  15354. if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {
  15355. throw new InvalidArgumentError('connect must be a function or an object')
  15356. }
  15357. if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) {
  15358. throw new InvalidArgumentError('maxRedirections must be a positive number')
  15359. }
  15360. if (maxRequestsPerClient != null && (!Number.isInteger(maxRequestsPerClient) || maxRequestsPerClient < 0)) {
  15361. throw new InvalidArgumentError('maxRequestsPerClient must be a positive number')
  15362. }
  15363. if (localAddress != null && (typeof localAddress !== 'string' || net.isIP(localAddress) === 0)) {
  15364. throw new InvalidArgumentError('localAddress must be valid string IP address')
  15365. }
  15366. if (maxResponseSize != null && (!Number.isInteger(maxResponseSize) || maxResponseSize < -1)) {
  15367. throw new InvalidArgumentError('maxResponseSize must be a positive number')
  15368. }
  15369. if (
  15370. autoSelectFamilyAttemptTimeout != null &&
  15371. (!Number.isInteger(autoSelectFamilyAttemptTimeout) || autoSelectFamilyAttemptTimeout < -1)
  15372. ) {
  15373. throw new InvalidArgumentError('autoSelectFamilyAttemptTimeout must be a positive number')
  15374. }
  15375. // h2
  15376. if (allowH2 != null && typeof allowH2 !== 'boolean') {
  15377. throw new InvalidArgumentError('allowH2 must be a valid boolean value')
  15378. }
  15379. if (maxConcurrentStreams != null && (typeof maxConcurrentStreams !== 'number' || maxConcurrentStreams < 1)) {
  15380. throw new InvalidArgumentError('maxConcurrentStreams must be a possitive integer, greater than 0')
  15381. }
  15382. if (typeof connect !== 'function') {
  15383. connect = buildConnector({
  15384. ...tls,
  15385. maxCachedSessions,
  15386. allowH2,
  15387. socketPath,
  15388. timeout: connectTimeout,
  15389. ...(util.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined),
  15390. ...connect
  15391. })
  15392. }
  15393. this[kInterceptors] = interceptors && interceptors.Client && Array.isArray(interceptors.Client)
  15394. ? interceptors.Client
  15395. : [createRedirectInterceptor({ maxRedirections })]
  15396. this[kUrl] = util.parseOrigin(url)
  15397. this[kConnector] = connect
  15398. this[kSocket] = null
  15399. this[kPipelining] = pipelining != null ? pipelining : 1
  15400. this[kMaxHeadersSize] = maxHeaderSize || http.maxHeaderSize
  15401. this[kKeepAliveDefaultTimeout] = keepAliveTimeout == null ? 4e3 : keepAliveTimeout
  15402. this[kKeepAliveMaxTimeout] = keepAliveMaxTimeout == null ? 600e3 : keepAliveMaxTimeout
  15403. this[kKeepAliveTimeoutThreshold] = keepAliveTimeoutThreshold == null ? 1e3 : keepAliveTimeoutThreshold
  15404. this[kKeepAliveTimeoutValue] = this[kKeepAliveDefaultTimeout]
  15405. this[kServerName] = null
  15406. this[kLocalAddress] = localAddress != null ? localAddress : null
  15407. this[kResuming] = 0 // 0, idle, 1, scheduled, 2 resuming
  15408. this[kNeedDrain] = 0 // 0, idle, 1, scheduled, 2 resuming
  15409. this[kHostHeader] = `host: ${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ''}\r\n`
  15410. this[kBodyTimeout] = bodyTimeout != null ? bodyTimeout : 300e3
  15411. this[kHeadersTimeout] = headersTimeout != null ? headersTimeout : 300e3
  15412. this[kStrictContentLength] = strictContentLength == null ? true : strictContentLength
  15413. this[kMaxRedirections] = maxRedirections
  15414. this[kMaxRequests] = maxRequestsPerClient
  15415. this[kClosedResolve] = null
  15416. this[kMaxResponseSize] = maxResponseSize > -1 ? maxResponseSize : -1
  15417. this[kHTTPConnVersion] = 'h1'
  15418. // HTTP/2
  15419. this[kHTTP2Session] = null
  15420. this[kHTTP2SessionState] = !allowH2
  15421. ? null
  15422. : {
  15423. // streams: null, // Fixed queue of streams - For future support of `push`
  15424. openStreams: 0, // Keep track of them to decide wether or not unref the session
  15425. maxConcurrentStreams: maxConcurrentStreams != null ? maxConcurrentStreams : 100 // Max peerConcurrentStreams for a Node h2 server
  15426. }
  15427. this[kHost] = `${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ''}`
  15428. // kQueue is built up of 3 sections separated by
  15429. // the kRunningIdx and kPendingIdx indices.
  15430. // | complete | running | pending |
  15431. // ^ kRunningIdx ^ kPendingIdx ^ kQueue.length
  15432. // kRunningIdx points to the first running element.
  15433. // kPendingIdx points to the first pending element.
  15434. // This implements a fast queue with an amortized
  15435. // time of O(1).
  15436. this[kQueue] = []
  15437. this[kRunningIdx] = 0
  15438. this[kPendingIdx] = 0
  15439. }
  15440. get pipelining () {
  15441. return this[kPipelining]
  15442. }
  15443. set pipelining (value) {
  15444. this[kPipelining] = value
  15445. resume(this, true)
  15446. }
  15447. get [kPending] () {
  15448. return this[kQueue].length - this[kPendingIdx]
  15449. }
  15450. get [kRunning] () {
  15451. return this[kPendingIdx] - this[kRunningIdx]
  15452. }
  15453. get [kSize] () {
  15454. return this[kQueue].length - this[kRunningIdx]
  15455. }
  15456. get [kConnected] () {
  15457. return !!this[kSocket] && !this[kConnecting] && !this[kSocket].destroyed
  15458. }
  15459. get [kBusy] () {
  15460. const socket = this[kSocket]
  15461. return (
  15462. (socket && (socket[kReset] || socket[kWriting] || socket[kBlocking])) ||
  15463. (this[kSize] >= (this[kPipelining] || 1)) ||
  15464. this[kPending] > 0
  15465. )
  15466. }
  15467. /* istanbul ignore: only used for test */
  15468. [kConnect] (cb) {
  15469. connect(this)
  15470. this.once('connect', cb)
  15471. }
  15472. [kDispatch] (opts, handler) {
  15473. const origin = opts.origin || this[kUrl].origin
  15474. const request = this[kHTTPConnVersion] === 'h2'
  15475. ? Request[kHTTP2BuildRequest](origin, opts, handler)
  15476. : Request[kHTTP1BuildRequest](origin, opts, handler)
  15477. this[kQueue].push(request)
  15478. if (this[kResuming]) {
  15479. // Do nothing.
  15480. } else if (util.bodyLength(request.body) == null && util.isIterable(request.body)) {
  15481. // Wait a tick in case stream/iterator is ended in the same tick.
  15482. this[kResuming] = 1
  15483. process.nextTick(resume, this)
  15484. } else {
  15485. resume(this, true)
  15486. }
  15487. if (this[kResuming] && this[kNeedDrain] !== 2 && this[kBusy]) {
  15488. this[kNeedDrain] = 2
  15489. }
  15490. return this[kNeedDrain] < 2
  15491. }
  15492. async [kClose] () {
  15493. // TODO: for H2 we need to gracefully flush the remaining enqueued
  15494. // request and close each stream.
  15495. return new Promise((resolve) => {
  15496. if (!this[kSize]) {
  15497. resolve(null)
  15498. } else {
  15499. this[kClosedResolve] = resolve
  15500. }
  15501. })
  15502. }
  15503. async [kDestroy] (err) {
  15504. return new Promise((resolve) => {
  15505. const requests = this[kQueue].splice(this[kPendingIdx])
  15506. for (let i = 0; i < requests.length; i++) {
  15507. const request = requests[i]
  15508. errorRequest(this, request, err)
  15509. }
  15510. const callback = () => {
  15511. if (this[kClosedResolve]) {
  15512. // TODO (fix): Should we error here with ClientDestroyedError?
  15513. this[kClosedResolve]()
  15514. this[kClosedResolve] = null
  15515. }
  15516. resolve()
  15517. }
  15518. if (this[kHTTP2Session] != null) {
  15519. util.destroy(this[kHTTP2Session], err)
  15520. this[kHTTP2Session] = null
  15521. this[kHTTP2SessionState] = null
  15522. }
  15523. if (!this[kSocket]) {
  15524. queueMicrotask(callback)
  15525. } else {
  15526. util.destroy(this[kSocket].on('close', callback), err)
  15527. }
  15528. resume(this)
  15529. })
  15530. }
  15531. }
  15532. function onHttp2SessionError (err) {
  15533. assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')
  15534. this[kSocket][kError] = err
  15535. onError(this[kClient], err)
  15536. }
  15537. function onHttp2FrameError (type, code, id) {
  15538. const err = new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`)
  15539. if (id === 0) {
  15540. this[kSocket][kError] = err
  15541. onError(this[kClient], err)
  15542. }
  15543. }
  15544. function onHttp2SessionEnd () {
  15545. util.destroy(this, new SocketError('other side closed'))
  15546. util.destroy(this[kSocket], new SocketError('other side closed'))
  15547. }
  15548. function onHTTP2GoAway (code) {
  15549. const client = this[kClient]
  15550. const err = new InformationalError(`HTTP/2: "GOAWAY" frame received with code ${code}`)
  15551. client[kSocket] = null
  15552. client[kHTTP2Session] = null
  15553. if (client.destroyed) {
  15554. assert(this[kPending] === 0)
  15555. // Fail entire queue.
  15556. const requests = client[kQueue].splice(client[kRunningIdx])
  15557. for (let i = 0; i < requests.length; i++) {
  15558. const request = requests[i]
  15559. errorRequest(this, request, err)
  15560. }
  15561. } else if (client[kRunning] > 0) {
  15562. // Fail head of pipeline.
  15563. const request = client[kQueue][client[kRunningIdx]]
  15564. client[kQueue][client[kRunningIdx]++] = null
  15565. errorRequest(client, request, err)
  15566. }
  15567. client[kPendingIdx] = client[kRunningIdx]
  15568. assert(client[kRunning] === 0)
  15569. client.emit('disconnect',
  15570. client[kUrl],
  15571. [client],
  15572. err
  15573. )
  15574. resume(client)
  15575. }
  15576. const constants = __nccwpck_require__(953)
  15577. const createRedirectInterceptor = __nccwpck_require__(8861)
  15578. const EMPTY_BUF = Buffer.alloc(0)
  15579. async function lazyllhttp () {
  15580. const llhttpWasmData = process.env.JEST_WORKER_ID ? __nccwpck_require__(1145) : undefined
  15581. let mod
  15582. try {
  15583. mod = await WebAssembly.compile(Buffer.from(__nccwpck_require__(5627), 'base64'))
  15584. } catch (e) {
  15585. /* istanbul ignore next */
  15586. // We could check if the error was caused by the simd option not
  15587. // being enabled, but the occurring of this other error
  15588. // * https://github.com/emscripten-core/emscripten/issues/11495
  15589. // got me to remove that check to avoid breaking Node 12.
  15590. mod = await WebAssembly.compile(Buffer.from(llhttpWasmData || __nccwpck_require__(1145), 'base64'))
  15591. }
  15592. return await WebAssembly.instantiate(mod, {
  15593. env: {
  15594. /* eslint-disable camelcase */
  15595. wasm_on_url: (p, at, len) => {
  15596. /* istanbul ignore next */
  15597. return 0
  15598. },
  15599. wasm_on_status: (p, at, len) => {
  15600. assert.strictEqual(currentParser.ptr, p)
  15601. const start = at - currentBufferPtr + currentBufferRef.byteOffset
  15602. return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
  15603. },
  15604. wasm_on_message_begin: (p) => {
  15605. assert.strictEqual(currentParser.ptr, p)
  15606. return currentParser.onMessageBegin() || 0
  15607. },
  15608. wasm_on_header_field: (p, at, len) => {
  15609. assert.strictEqual(currentParser.ptr, p)
  15610. const start = at - currentBufferPtr + currentBufferRef.byteOffset
  15611. return currentParser.onHeaderField(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
  15612. },
  15613. wasm_on_header_value: (p, at, len) => {
  15614. assert.strictEqual(currentParser.ptr, p)
  15615. const start = at - currentBufferPtr + currentBufferRef.byteOffset
  15616. return currentParser.onHeaderValue(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
  15617. },
  15618. wasm_on_headers_complete: (p, statusCode, upgrade, shouldKeepAlive) => {
  15619. assert.strictEqual(currentParser.ptr, p)
  15620. return currentParser.onHeadersComplete(statusCode, Boolean(upgrade), Boolean(shouldKeepAlive)) || 0
  15621. },
  15622. wasm_on_body: (p, at, len) => {
  15623. assert.strictEqual(currentParser.ptr, p)
  15624. const start = at - currentBufferPtr + currentBufferRef.byteOffset
  15625. return currentParser.onBody(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
  15626. },
  15627. wasm_on_message_complete: (p) => {
  15628. assert.strictEqual(currentParser.ptr, p)
  15629. return currentParser.onMessageComplete() || 0
  15630. }
  15631. /* eslint-enable camelcase */
  15632. }
  15633. })
  15634. }
  15635. let llhttpInstance = null
  15636. let llhttpPromise = lazyllhttp()
  15637. llhttpPromise.catch()
  15638. let currentParser = null
  15639. let currentBufferRef = null
  15640. let currentBufferSize = 0
  15641. let currentBufferPtr = null
  15642. const TIMEOUT_HEADERS = 1
  15643. const TIMEOUT_BODY = 2
  15644. const TIMEOUT_IDLE = 3
  15645. class Parser {
  15646. constructor (client, socket, { exports }) {
  15647. assert(Number.isFinite(client[kMaxHeadersSize]) && client[kMaxHeadersSize] > 0)
  15648. this.llhttp = exports
  15649. this.ptr = this.llhttp.llhttp_alloc(constants.TYPE.RESPONSE)
  15650. this.client = client
  15651. this.socket = socket
  15652. this.timeout = null
  15653. this.timeoutValue = null
  15654. this.timeoutType = null
  15655. this.statusCode = null
  15656. this.statusText = ''
  15657. this.upgrade = false
  15658. this.headers = []
  15659. this.headersSize = 0
  15660. this.headersMaxSize = client[kMaxHeadersSize]
  15661. this.shouldKeepAlive = false
  15662. this.paused = false
  15663. this.resume = this.resume.bind(this)
  15664. this.bytesRead = 0
  15665. this.keepAlive = ''
  15666. this.contentLength = ''
  15667. this.connection = ''
  15668. this.maxResponseSize = client[kMaxResponseSize]
  15669. }
  15670. setTimeout (value, type) {
  15671. this.timeoutType = type
  15672. if (value !== this.timeoutValue) {
  15673. timers.clearTimeout(this.timeout)
  15674. if (value) {
  15675. this.timeout = timers.setTimeout(onParserTimeout, value, this)
  15676. // istanbul ignore else: only for jest
  15677. if (this.timeout.unref) {
  15678. this.timeout.unref()
  15679. }
  15680. } else {
  15681. this.timeout = null
  15682. }
  15683. this.timeoutValue = value
  15684. } else if (this.timeout) {
  15685. // istanbul ignore else: only for jest
  15686. if (this.timeout.refresh) {
  15687. this.timeout.refresh()
  15688. }
  15689. }
  15690. }
  15691. resume () {
  15692. if (this.socket.destroyed || !this.paused) {
  15693. return
  15694. }
  15695. assert(this.ptr != null)
  15696. assert(currentParser == null)
  15697. this.llhttp.llhttp_resume(this.ptr)
  15698. assert(this.timeoutType === TIMEOUT_BODY)
  15699. if (this.timeout) {
  15700. // istanbul ignore else: only for jest
  15701. if (this.timeout.refresh) {
  15702. this.timeout.refresh()
  15703. }
  15704. }
  15705. this.paused = false
  15706. this.execute(this.socket.read() || EMPTY_BUF) // Flush parser.
  15707. this.readMore()
  15708. }
  15709. readMore () {
  15710. while (!this.paused && this.ptr) {
  15711. const chunk = this.socket.read()
  15712. if (chunk === null) {
  15713. break
  15714. }
  15715. this.execute(chunk)
  15716. }
  15717. }
  15718. execute (data) {
  15719. assert(this.ptr != null)
  15720. assert(currentParser == null)
  15721. assert(!this.paused)
  15722. const { socket, llhttp } = this
  15723. if (data.length > currentBufferSize) {
  15724. if (currentBufferPtr) {
  15725. llhttp.free(currentBufferPtr)
  15726. }
  15727. currentBufferSize = Math.ceil(data.length / 4096) * 4096
  15728. currentBufferPtr = llhttp.malloc(currentBufferSize)
  15729. }
  15730. new Uint8Array(llhttp.memory.buffer, currentBufferPtr, currentBufferSize).set(data)
  15731. // Call `execute` on the wasm parser.
  15732. // We pass the `llhttp_parser` pointer address, the pointer address of buffer view data,
  15733. // and finally the length of bytes to parse.
  15734. // The return value is an error code or `constants.ERROR.OK`.
  15735. try {
  15736. let ret
  15737. try {
  15738. currentBufferRef = data
  15739. currentParser = this
  15740. ret = llhttp.llhttp_execute(this.ptr, currentBufferPtr, data.length)
  15741. /* eslint-disable-next-line no-useless-catch */
  15742. } catch (err) {
  15743. /* istanbul ignore next: difficult to make a test case for */
  15744. throw err
  15745. } finally {
  15746. currentParser = null
  15747. currentBufferRef = null
  15748. }
  15749. const offset = llhttp.llhttp_get_error_pos(this.ptr) - currentBufferPtr
  15750. if (ret === constants.ERROR.PAUSED_UPGRADE) {
  15751. this.onUpgrade(data.slice(offset))
  15752. } else if (ret === constants.ERROR.PAUSED) {
  15753. this.paused = true
  15754. socket.unshift(data.slice(offset))
  15755. } else if (ret !== constants.ERROR.OK) {
  15756. const ptr = llhttp.llhttp_get_error_reason(this.ptr)
  15757. let message = ''
  15758. /* istanbul ignore else: difficult to make a test case for */
  15759. if (ptr) {
  15760. const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0)
  15761. message =
  15762. 'Response does not match the HTTP/1.1 protocol (' +
  15763. Buffer.from(llhttp.memory.buffer, ptr, len).toString() +
  15764. ')'
  15765. }
  15766. throw new HTTPParserError(message, constants.ERROR[ret], data.slice(offset))
  15767. }
  15768. } catch (err) {
  15769. util.destroy(socket, err)
  15770. }
  15771. }
  15772. destroy () {
  15773. assert(this.ptr != null)
  15774. assert(currentParser == null)
  15775. this.llhttp.llhttp_free(this.ptr)
  15776. this.ptr = null
  15777. timers.clearTimeout(this.timeout)
  15778. this.timeout = null
  15779. this.timeoutValue = null
  15780. this.timeoutType = null
  15781. this.paused = false
  15782. }
  15783. onStatus (buf) {
  15784. this.statusText = buf.toString()
  15785. }
  15786. onMessageBegin () {
  15787. const { socket, client } = this
  15788. /* istanbul ignore next: difficult to make a test case for */
  15789. if (socket.destroyed) {
  15790. return -1
  15791. }
  15792. const request = client[kQueue][client[kRunningIdx]]
  15793. if (!request) {
  15794. return -1
  15795. }
  15796. }
  15797. onHeaderField (buf) {
  15798. const len = this.headers.length
  15799. if ((len & 1) === 0) {
  15800. this.headers.push(buf)
  15801. } else {
  15802. this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf])
  15803. }
  15804. this.trackHeader(buf.length)
  15805. }
  15806. onHeaderValue (buf) {
  15807. let len = this.headers.length
  15808. if ((len & 1) === 1) {
  15809. this.headers.push(buf)
  15810. len += 1
  15811. } else {
  15812. this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf])
  15813. }
  15814. const key = this.headers[len - 2]
  15815. if (key.length === 10 && key.toString().toLowerCase() === 'keep-alive') {
  15816. this.keepAlive += buf.toString()
  15817. } else if (key.length === 10 && key.toString().toLowerCase() === 'connection') {
  15818. this.connection += buf.toString()
  15819. } else if (key.length === 14 && key.toString().toLowerCase() === 'content-length') {
  15820. this.contentLength += buf.toString()
  15821. }
  15822. this.trackHeader(buf.length)
  15823. }
  15824. trackHeader (len) {
  15825. this.headersSize += len
  15826. if (this.headersSize >= this.headersMaxSize) {
  15827. util.destroy(this.socket, new HeadersOverflowError())
  15828. }
  15829. }
  15830. onUpgrade (head) {
  15831. const { upgrade, client, socket, headers, statusCode } = this
  15832. assert(upgrade)
  15833. const request = client[kQueue][client[kRunningIdx]]
  15834. assert(request)
  15835. assert(!socket.destroyed)
  15836. assert(socket === client[kSocket])
  15837. assert(!this.paused)
  15838. assert(request.upgrade || request.method === 'CONNECT')
  15839. this.statusCode = null
  15840. this.statusText = ''
  15841. this.shouldKeepAlive = null
  15842. assert(this.headers.length % 2 === 0)
  15843. this.headers = []
  15844. this.headersSize = 0
  15845. socket.unshift(head)
  15846. socket[kParser].destroy()
  15847. socket[kParser] = null
  15848. socket[kClient] = null
  15849. socket[kError] = null
  15850. socket
  15851. .removeListener('error', onSocketError)
  15852. .removeListener('readable', onSocketReadable)
  15853. .removeListener('end', onSocketEnd)
  15854. .removeListener('close', onSocketClose)
  15855. client[kSocket] = null
  15856. client[kQueue][client[kRunningIdx]++] = null
  15857. client.emit('disconnect', client[kUrl], [client], new InformationalError('upgrade'))
  15858. try {
  15859. request.onUpgrade(statusCode, headers, socket)
  15860. } catch (err) {
  15861. util.destroy(socket, err)
  15862. }
  15863. resume(client)
  15864. }
  15865. onHeadersComplete (statusCode, upgrade, shouldKeepAlive) {
  15866. const { client, socket, headers, statusText } = this
  15867. /* istanbul ignore next: difficult to make a test case for */
  15868. if (socket.destroyed) {
  15869. return -1
  15870. }
  15871. const request = client[kQueue][client[kRunningIdx]]
  15872. /* istanbul ignore next: difficult to make a test case for */
  15873. if (!request) {
  15874. return -1
  15875. }
  15876. assert(!this.upgrade)
  15877. assert(this.statusCode < 200)
  15878. if (statusCode === 100) {
  15879. util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket)))
  15880. return -1
  15881. }
  15882. /* this can only happen if server is misbehaving */
  15883. if (upgrade && !request.upgrade) {
  15884. util.destroy(socket, new SocketError('bad upgrade', util.getSocketInfo(socket)))
  15885. return -1
  15886. }
  15887. assert.strictEqual(this.timeoutType, TIMEOUT_HEADERS)
  15888. this.statusCode = statusCode
  15889. this.shouldKeepAlive = (
  15890. shouldKeepAlive ||
  15891. // Override llhttp value which does not allow keepAlive for HEAD.
  15892. (request.method === 'HEAD' && !socket[kReset] && this.connection.toLowerCase() === 'keep-alive')
  15893. )
  15894. if (this.statusCode >= 200) {
  15895. const bodyTimeout = request.bodyTimeout != null
  15896. ? request.bodyTimeout
  15897. : client[kBodyTimeout]
  15898. this.setTimeout(bodyTimeout, TIMEOUT_BODY)
  15899. } else if (this.timeout) {
  15900. // istanbul ignore else: only for jest
  15901. if (this.timeout.refresh) {
  15902. this.timeout.refresh()
  15903. }
  15904. }
  15905. if (request.method === 'CONNECT') {
  15906. assert(client[kRunning] === 1)
  15907. this.upgrade = true
  15908. return 2
  15909. }
  15910. if (upgrade) {
  15911. assert(client[kRunning] === 1)
  15912. this.upgrade = true
  15913. return 2
  15914. }
  15915. assert(this.headers.length % 2 === 0)
  15916. this.headers = []
  15917. this.headersSize = 0
  15918. if (this.shouldKeepAlive && client[kPipelining]) {
  15919. const keepAliveTimeout = this.keepAlive ? util.parseKeepAliveTimeout(this.keepAlive) : null
  15920. if (keepAliveTimeout != null) {
  15921. const timeout = Math.min(
  15922. keepAliveTimeout - client[kKeepAliveTimeoutThreshold],
  15923. client[kKeepAliveMaxTimeout]
  15924. )
  15925. if (timeout <= 0) {
  15926. socket[kReset] = true
  15927. } else {
  15928. client[kKeepAliveTimeoutValue] = timeout
  15929. }
  15930. } else {
  15931. client[kKeepAliveTimeoutValue] = client[kKeepAliveDefaultTimeout]
  15932. }
  15933. } else {
  15934. // Stop more requests from being dispatched.
  15935. socket[kReset] = true
  15936. }
  15937. const pause = request.onHeaders(statusCode, headers, this.resume, statusText) === false
  15938. if (request.aborted) {
  15939. return -1
  15940. }
  15941. if (request.method === 'HEAD') {
  15942. return 1
  15943. }
  15944. if (statusCode < 200) {
  15945. return 1
  15946. }
  15947. if (socket[kBlocking]) {
  15948. socket[kBlocking] = false
  15949. resume(client)
  15950. }
  15951. return pause ? constants.ERROR.PAUSED : 0
  15952. }
  15953. onBody (buf) {
  15954. const { client, socket, statusCode, maxResponseSize } = this
  15955. if (socket.destroyed) {
  15956. return -1
  15957. }
  15958. const request = client[kQueue][client[kRunningIdx]]
  15959. assert(request)
  15960. assert.strictEqual(this.timeoutType, TIMEOUT_BODY)
  15961. if (this.timeout) {
  15962. // istanbul ignore else: only for jest
  15963. if (this.timeout.refresh) {
  15964. this.timeout.refresh()
  15965. }
  15966. }
  15967. assert(statusCode >= 200)
  15968. if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) {
  15969. util.destroy(socket, new ResponseExceededMaxSizeError())
  15970. return -1
  15971. }
  15972. this.bytesRead += buf.length
  15973. if (request.onData(buf) === false) {
  15974. return constants.ERROR.PAUSED
  15975. }
  15976. }
  15977. onMessageComplete () {
  15978. const { client, socket, statusCode, upgrade, headers, contentLength, bytesRead, shouldKeepAlive } = this
  15979. if (socket.destroyed && (!statusCode || shouldKeepAlive)) {
  15980. return -1
  15981. }
  15982. if (upgrade) {
  15983. return
  15984. }
  15985. const request = client[kQueue][client[kRunningIdx]]
  15986. assert(request)
  15987. assert(statusCode >= 100)
  15988. this.statusCode = null
  15989. this.statusText = ''
  15990. this.bytesRead = 0
  15991. this.contentLength = ''
  15992. this.keepAlive = ''
  15993. this.connection = ''
  15994. assert(this.headers.length % 2 === 0)
  15995. this.headers = []
  15996. this.headersSize = 0
  15997. if (statusCode < 200) {
  15998. return
  15999. }
  16000. /* istanbul ignore next: should be handled by llhttp? */
  16001. if (request.method !== 'HEAD' && contentLength && bytesRead !== parseInt(contentLength, 10)) {
  16002. util.destroy(socket, new ResponseContentLengthMismatchError())
  16003. return -1
  16004. }
  16005. request.onComplete(headers)
  16006. client[kQueue][client[kRunningIdx]++] = null
  16007. if (socket[kWriting]) {
  16008. assert.strictEqual(client[kRunning], 0)
  16009. // Response completed before request.
  16010. util.destroy(socket, new InformationalError('reset'))
  16011. return constants.ERROR.PAUSED
  16012. } else if (!shouldKeepAlive) {
  16013. util.destroy(socket, new InformationalError('reset'))
  16014. return constants.ERROR.PAUSED
  16015. } else if (socket[kReset] && client[kRunning] === 0) {
  16016. // Destroy socket once all requests have completed.
  16017. // The request at the tail of the pipeline is the one
  16018. // that requested reset and no further requests should
  16019. // have been queued since then.
  16020. util.destroy(socket, new InformationalError('reset'))
  16021. return constants.ERROR.PAUSED
  16022. } else if (client[kPipelining] === 1) {
  16023. // We must wait a full event loop cycle to reuse this socket to make sure
  16024. // that non-spec compliant servers are not closing the connection even if they
  16025. // said they won't.
  16026. setImmediate(resume, client)
  16027. } else {
  16028. resume(client)
  16029. }
  16030. }
  16031. }
  16032. function onParserTimeout (parser) {
  16033. const { socket, timeoutType, client } = parser
  16034. /* istanbul ignore else */
  16035. if (timeoutType === TIMEOUT_HEADERS) {
  16036. if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) {
  16037. assert(!parser.paused, 'cannot be paused while waiting for headers')
  16038. util.destroy(socket, new HeadersTimeoutError())
  16039. }
  16040. } else if (timeoutType === TIMEOUT_BODY) {
  16041. if (!parser.paused) {
  16042. util.destroy(socket, new BodyTimeoutError())
  16043. }
  16044. } else if (timeoutType === TIMEOUT_IDLE) {
  16045. assert(client[kRunning] === 0 && client[kKeepAliveTimeoutValue])
  16046. util.destroy(socket, new InformationalError('socket idle timeout'))
  16047. }
  16048. }
  16049. function onSocketReadable () {
  16050. const { [kParser]: parser } = this
  16051. if (parser) {
  16052. parser.readMore()
  16053. }
  16054. }
  16055. function onSocketError (err) {
  16056. const { [kClient]: client, [kParser]: parser } = this
  16057. assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')
  16058. if (client[kHTTPConnVersion] !== 'h2') {
  16059. // On Mac OS, we get an ECONNRESET even if there is a full body to be forwarded
  16060. // to the user.
  16061. if (err.code === 'ECONNRESET' && parser.statusCode && !parser.shouldKeepAlive) {
  16062. // We treat all incoming data so for as a valid response.
  16063. parser.onMessageComplete()
  16064. return
  16065. }
  16066. }
  16067. this[kError] = err
  16068. onError(this[kClient], err)
  16069. }
  16070. function onError (client, err) {
  16071. if (
  16072. client[kRunning] === 0 &&
  16073. err.code !== 'UND_ERR_INFO' &&
  16074. err.code !== 'UND_ERR_SOCKET'
  16075. ) {
  16076. // Error is not caused by running request and not a recoverable
  16077. // socket error.
  16078. assert(client[kPendingIdx] === client[kRunningIdx])
  16079. const requests = client[kQueue].splice(client[kRunningIdx])
  16080. for (let i = 0; i < requests.length; i++) {
  16081. const request = requests[i]
  16082. errorRequest(client, request, err)
  16083. }
  16084. assert(client[kSize] === 0)
  16085. }
  16086. }
  16087. function onSocketEnd () {
  16088. const { [kParser]: parser, [kClient]: client } = this
  16089. if (client[kHTTPConnVersion] !== 'h2') {
  16090. if (parser.statusCode && !parser.shouldKeepAlive) {
  16091. // We treat all incoming data so far as a valid response.
  16092. parser.onMessageComplete()
  16093. return
  16094. }
  16095. }
  16096. util.destroy(this, new SocketError('other side closed', util.getSocketInfo(this)))
  16097. }
  16098. function onSocketClose () {
  16099. const { [kClient]: client, [kParser]: parser } = this
  16100. if (client[kHTTPConnVersion] === 'h1' && parser) {
  16101. if (!this[kError] && parser.statusCode && !parser.shouldKeepAlive) {
  16102. // We treat all incoming data so far as a valid response.
  16103. parser.onMessageComplete()
  16104. }
  16105. this[kParser].destroy()
  16106. this[kParser] = null
  16107. }
  16108. const err = this[kError] || new SocketError('closed', util.getSocketInfo(this))
  16109. client[kSocket] = null
  16110. if (client.destroyed) {
  16111. assert(client[kPending] === 0)
  16112. // Fail entire queue.
  16113. const requests = client[kQueue].splice(client[kRunningIdx])
  16114. for (let i = 0; i < requests.length; i++) {
  16115. const request = requests[i]
  16116. errorRequest(client, request, err)
  16117. }
  16118. } else if (client[kRunning] > 0 && err.code !== 'UND_ERR_INFO') {
  16119. // Fail head of pipeline.
  16120. const request = client[kQueue][client[kRunningIdx]]
  16121. client[kQueue][client[kRunningIdx]++] = null
  16122. errorRequest(client, request, err)
  16123. }
  16124. client[kPendingIdx] = client[kRunningIdx]
  16125. assert(client[kRunning] === 0)
  16126. client.emit('disconnect', client[kUrl], [client], err)
  16127. resume(client)
  16128. }
  16129. async function connect (client) {
  16130. assert(!client[kConnecting])
  16131. assert(!client[kSocket])
  16132. let { host, hostname, protocol, port } = client[kUrl]
  16133. // Resolve ipv6
  16134. if (hostname[0] === '[') {
  16135. const idx = hostname.indexOf(']')
  16136. assert(idx !== -1)
  16137. const ip = hostname.substring(1, idx)
  16138. assert(net.isIP(ip))
  16139. hostname = ip
  16140. }
  16141. client[kConnecting] = true
  16142. if (channels.beforeConnect.hasSubscribers) {
  16143. channels.beforeConnect.publish({
  16144. connectParams: {
  16145. host,
  16146. hostname,
  16147. protocol,
  16148. port,
  16149. servername: client[kServerName],
  16150. localAddress: client[kLocalAddress]
  16151. },
  16152. connector: client[kConnector]
  16153. })
  16154. }
  16155. try {
  16156. const socket = await new Promise((resolve, reject) => {
  16157. client[kConnector]({
  16158. host,
  16159. hostname,
  16160. protocol,
  16161. port,
  16162. servername: client[kServerName],
  16163. localAddress: client[kLocalAddress]
  16164. }, (err, socket) => {
  16165. if (err) {
  16166. reject(err)
  16167. } else {
  16168. resolve(socket)
  16169. }
  16170. })
  16171. })
  16172. if (client.destroyed) {
  16173. util.destroy(socket.on('error', () => {}), new ClientDestroyedError())
  16174. return
  16175. }
  16176. client[kConnecting] = false
  16177. assert(socket)
  16178. const isH2 = socket.alpnProtocol === 'h2'
  16179. if (isH2) {
  16180. if (!h2ExperimentalWarned) {
  16181. h2ExperimentalWarned = true
  16182. process.emitWarning('H2 support is experimental, expect them to change at any time.', {
  16183. code: 'UNDICI-H2'
  16184. })
  16185. }
  16186. const session = http2.connect(client[kUrl], {
  16187. createConnection: () => socket,
  16188. peerMaxConcurrentStreams: client[kHTTP2SessionState].maxConcurrentStreams
  16189. })
  16190. client[kHTTPConnVersion] = 'h2'
  16191. session[kClient] = client
  16192. session[kSocket] = socket
  16193. session.on('error', onHttp2SessionError)
  16194. session.on('frameError', onHttp2FrameError)
  16195. session.on('end', onHttp2SessionEnd)
  16196. session.on('goaway', onHTTP2GoAway)
  16197. session.on('close', onSocketClose)
  16198. session.unref()
  16199. client[kHTTP2Session] = session
  16200. socket[kHTTP2Session] = session
  16201. } else {
  16202. if (!llhttpInstance) {
  16203. llhttpInstance = await llhttpPromise
  16204. llhttpPromise = null
  16205. }
  16206. socket[kNoRef] = false
  16207. socket[kWriting] = false
  16208. socket[kReset] = false
  16209. socket[kBlocking] = false
  16210. socket[kParser] = new Parser(client, socket, llhttpInstance)
  16211. }
  16212. socket[kCounter] = 0
  16213. socket[kMaxRequests] = client[kMaxRequests]
  16214. socket[kClient] = client
  16215. socket[kError] = null
  16216. socket
  16217. .on('error', onSocketError)
  16218. .on('readable', onSocketReadable)
  16219. .on('end', onSocketEnd)
  16220. .on('close', onSocketClose)
  16221. client[kSocket] = socket
  16222. if (channels.connected.hasSubscribers) {
  16223. channels.connected.publish({
  16224. connectParams: {
  16225. host,
  16226. hostname,
  16227. protocol,
  16228. port,
  16229. servername: client[kServerName],
  16230. localAddress: client[kLocalAddress]
  16231. },
  16232. connector: client[kConnector],
  16233. socket
  16234. })
  16235. }
  16236. client.emit('connect', client[kUrl], [client])
  16237. } catch (err) {
  16238. if (client.destroyed) {
  16239. return
  16240. }
  16241. client[kConnecting] = false
  16242. if (channels.connectError.hasSubscribers) {
  16243. channels.connectError.publish({
  16244. connectParams: {
  16245. host,
  16246. hostname,
  16247. protocol,
  16248. port,
  16249. servername: client[kServerName],
  16250. localAddress: client[kLocalAddress]
  16251. },
  16252. connector: client[kConnector],
  16253. error: err
  16254. })
  16255. }
  16256. if (err.code === 'ERR_TLS_CERT_ALTNAME_INVALID') {
  16257. assert(client[kRunning] === 0)
  16258. while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) {
  16259. const request = client[kQueue][client[kPendingIdx]++]
  16260. errorRequest(client, request, err)
  16261. }
  16262. } else {
  16263. onError(client, err)
  16264. }
  16265. client.emit('connectionError', client[kUrl], [client], err)
  16266. }
  16267. resume(client)
  16268. }
  16269. function emitDrain (client) {
  16270. client[kNeedDrain] = 0
  16271. client.emit('drain', client[kUrl], [client])
  16272. }
  16273. function resume (client, sync) {
  16274. if (client[kResuming] === 2) {
  16275. return
  16276. }
  16277. client[kResuming] = 2
  16278. _resume(client, sync)
  16279. client[kResuming] = 0
  16280. if (client[kRunningIdx] > 256) {
  16281. client[kQueue].splice(0, client[kRunningIdx])
  16282. client[kPendingIdx] -= client[kRunningIdx]
  16283. client[kRunningIdx] = 0
  16284. }
  16285. }
  16286. function _resume (client, sync) {
  16287. while (true) {
  16288. if (client.destroyed) {
  16289. assert(client[kPending] === 0)
  16290. return
  16291. }
  16292. if (client[kClosedResolve] && !client[kSize]) {
  16293. client[kClosedResolve]()
  16294. client[kClosedResolve] = null
  16295. return
  16296. }
  16297. const socket = client[kSocket]
  16298. if (socket && !socket.destroyed && socket.alpnProtocol !== 'h2') {
  16299. if (client[kSize] === 0) {
  16300. if (!socket[kNoRef] && socket.unref) {
  16301. socket.unref()
  16302. socket[kNoRef] = true
  16303. }
  16304. } else if (socket[kNoRef] && socket.ref) {
  16305. socket.ref()
  16306. socket[kNoRef] = false
  16307. }
  16308. if (client[kSize] === 0) {
  16309. if (socket[kParser].timeoutType !== TIMEOUT_IDLE) {
  16310. socket[kParser].setTimeout(client[kKeepAliveTimeoutValue], TIMEOUT_IDLE)
  16311. }
  16312. } else if (client[kRunning] > 0 && socket[kParser].statusCode < 200) {
  16313. if (socket[kParser].timeoutType !== TIMEOUT_HEADERS) {
  16314. const request = client[kQueue][client[kRunningIdx]]
  16315. const headersTimeout = request.headersTimeout != null
  16316. ? request.headersTimeout
  16317. : client[kHeadersTimeout]
  16318. socket[kParser].setTimeout(headersTimeout, TIMEOUT_HEADERS)
  16319. }
  16320. }
  16321. }
  16322. if (client[kBusy]) {
  16323. client[kNeedDrain] = 2
  16324. } else if (client[kNeedDrain] === 2) {
  16325. if (sync) {
  16326. client[kNeedDrain] = 1
  16327. process.nextTick(emitDrain, client)
  16328. } else {
  16329. emitDrain(client)
  16330. }
  16331. continue
  16332. }
  16333. if (client[kPending] === 0) {
  16334. return
  16335. }
  16336. if (client[kRunning] >= (client[kPipelining] || 1)) {
  16337. return
  16338. }
  16339. const request = client[kQueue][client[kPendingIdx]]
  16340. if (client[kUrl].protocol === 'https:' && client[kServerName] !== request.servername) {
  16341. if (client[kRunning] > 0) {
  16342. return
  16343. }
  16344. client[kServerName] = request.servername
  16345. if (socket && socket.servername !== request.servername) {
  16346. util.destroy(socket, new InformationalError('servername changed'))
  16347. return
  16348. }
  16349. }
  16350. if (client[kConnecting]) {
  16351. return
  16352. }
  16353. if (!socket && !client[kHTTP2Session]) {
  16354. connect(client)
  16355. return
  16356. }
  16357. if (socket.destroyed || socket[kWriting] || socket[kReset] || socket[kBlocking]) {
  16358. return
  16359. }
  16360. if (client[kRunning] > 0 && !request.idempotent) {
  16361. // Non-idempotent request cannot be retried.
  16362. // Ensure that no other requests are inflight and
  16363. // could cause failure.
  16364. return
  16365. }
  16366. if (client[kRunning] > 0 && (request.upgrade || request.method === 'CONNECT')) {
  16367. // Don't dispatch an upgrade until all preceding requests have completed.
  16368. // A misbehaving server might upgrade the connection before all pipelined
  16369. // request has completed.
  16370. return
  16371. }
  16372. if (client[kRunning] > 0 && util.bodyLength(request.body) !== 0 &&
  16373. (util.isStream(request.body) || util.isAsyncIterable(request.body))) {
  16374. // Request with stream or iterator body can error while other requests
  16375. // are inflight and indirectly error those as well.
  16376. // Ensure this doesn't happen by waiting for inflight
  16377. // to complete before dispatching.
  16378. // Request with stream or iterator body cannot be retried.
  16379. // Ensure that no other requests are inflight and
  16380. // could cause failure.
  16381. return
  16382. }
  16383. if (!request.aborted && write(client, request)) {
  16384. client[kPendingIdx]++
  16385. } else {
  16386. client[kQueue].splice(client[kPendingIdx], 1)
  16387. }
  16388. }
  16389. }
  16390. // https://www.rfc-editor.org/rfc/rfc7230#section-3.3.2
  16391. function shouldSendContentLength (method) {
  16392. return method !== 'GET' && method !== 'HEAD' && method !== 'OPTIONS' && method !== 'TRACE' && method !== 'CONNECT'
  16393. }
  16394. function write (client, request) {
  16395. if (client[kHTTPConnVersion] === 'h2') {
  16396. writeH2(client, client[kHTTP2Session], request)
  16397. return
  16398. }
  16399. const { body, method, path, host, upgrade, headers, blocking, reset } = request
  16400. // https://tools.ietf.org/html/rfc7231#section-4.3.1
  16401. // https://tools.ietf.org/html/rfc7231#section-4.3.2
  16402. // https://tools.ietf.org/html/rfc7231#section-4.3.5
  16403. // Sending a payload body on a request that does not
  16404. // expect it can cause undefined behavior on some
  16405. // servers and corrupt connection state. Do not
  16406. // re-use the connection for further requests.
  16407. const expectsPayload = (
  16408. method === 'PUT' ||
  16409. method === 'POST' ||
  16410. method === 'PATCH'
  16411. )
  16412. if (body && typeof body.read === 'function') {
  16413. // Try to read EOF in order to get length.
  16414. body.read(0)
  16415. }
  16416. const bodyLength = util.bodyLength(body)
  16417. let contentLength = bodyLength
  16418. if (contentLength === null) {
  16419. contentLength = request.contentLength
  16420. }
  16421. if (contentLength === 0 && !expectsPayload) {
  16422. // https://tools.ietf.org/html/rfc7230#section-3.3.2
  16423. // A user agent SHOULD NOT send a Content-Length header field when
  16424. // the request message does not contain a payload body and the method
  16425. // semantics do not anticipate such a body.
  16426. contentLength = null
  16427. }
  16428. // https://github.com/nodejs/undici/issues/2046
  16429. // A user agent may send a Content-Length header with 0 value, this should be allowed.
  16430. if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength !== null && request.contentLength !== contentLength) {
  16431. if (client[kStrictContentLength]) {
  16432. errorRequest(client, request, new RequestContentLengthMismatchError())
  16433. return false
  16434. }
  16435. process.emitWarning(new RequestContentLengthMismatchError())
  16436. }
  16437. const socket = client[kSocket]
  16438. try {
  16439. request.onConnect((err) => {
  16440. if (request.aborted || request.completed) {
  16441. return
  16442. }
  16443. errorRequest(client, request, err || new RequestAbortedError())
  16444. util.destroy(socket, new InformationalError('aborted'))
  16445. })
  16446. } catch (err) {
  16447. errorRequest(client, request, err)
  16448. }
  16449. if (request.aborted) {
  16450. return false
  16451. }
  16452. if (method === 'HEAD') {
  16453. // https://github.com/mcollina/undici/issues/258
  16454. // Close after a HEAD request to interop with misbehaving servers
  16455. // that may send a body in the response.
  16456. socket[kReset] = true
  16457. }
  16458. if (upgrade || method === 'CONNECT') {
  16459. // On CONNECT or upgrade, block pipeline from dispatching further
  16460. // requests on this connection.
  16461. socket[kReset] = true
  16462. }
  16463. if (reset != null) {
  16464. socket[kReset] = reset
  16465. }
  16466. if (client[kMaxRequests] && socket[kCounter]++ >= client[kMaxRequests]) {
  16467. socket[kReset] = true
  16468. }
  16469. if (blocking) {
  16470. socket[kBlocking] = true
  16471. }
  16472. let header = `${method} ${path} HTTP/1.1\r\n`
  16473. if (typeof host === 'string') {
  16474. header += `host: ${host}\r\n`
  16475. } else {
  16476. header += client[kHostHeader]
  16477. }
  16478. if (upgrade) {
  16479. header += `connection: upgrade\r\nupgrade: ${upgrade}\r\n`
  16480. } else if (client[kPipelining] && !socket[kReset]) {
  16481. header += 'connection: keep-alive\r\n'
  16482. } else {
  16483. header += 'connection: close\r\n'
  16484. }
  16485. if (headers) {
  16486. header += headers
  16487. }
  16488. if (channels.sendHeaders.hasSubscribers) {
  16489. channels.sendHeaders.publish({ request, headers: header, socket })
  16490. }
  16491. /* istanbul ignore else: assertion */
  16492. if (!body || bodyLength === 0) {
  16493. if (contentLength === 0) {
  16494. socket.write(`${header}content-length: 0\r\n\r\n`, 'latin1')
  16495. } else {
  16496. assert(contentLength === null, 'no body must not have content length')
  16497. socket.write(`${header}\r\n`, 'latin1')
  16498. }
  16499. request.onRequestSent()
  16500. } else if (util.isBuffer(body)) {
  16501. assert(contentLength === body.byteLength, 'buffer body must have content length')
  16502. socket.cork()
  16503. socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1')
  16504. socket.write(body)
  16505. socket.uncork()
  16506. request.onBodySent(body)
  16507. request.onRequestSent()
  16508. if (!expectsPayload) {
  16509. socket[kReset] = true
  16510. }
  16511. } else if (util.isBlobLike(body)) {
  16512. if (typeof body.stream === 'function') {
  16513. writeIterable({ body: body.stream(), client, request, socket, contentLength, header, expectsPayload })
  16514. } else {
  16515. writeBlob({ body, client, request, socket, contentLength, header, expectsPayload })
  16516. }
  16517. } else if (util.isStream(body)) {
  16518. writeStream({ body, client, request, socket, contentLength, header, expectsPayload })
  16519. } else if (util.isIterable(body)) {
  16520. writeIterable({ body, client, request, socket, contentLength, header, expectsPayload })
  16521. } else {
  16522. assert(false)
  16523. }
  16524. return true
  16525. }
  16526. function writeH2 (client, session, request) {
  16527. const { body, method, path, host, upgrade, expectContinue, signal, headers: reqHeaders } = request
  16528. let headers
  16529. if (typeof reqHeaders === 'string') headers = Request[kHTTP2CopyHeaders](reqHeaders.trim())
  16530. else headers = reqHeaders
  16531. if (upgrade) {
  16532. errorRequest(client, request, new Error('Upgrade not supported for H2'))
  16533. return false
  16534. }
  16535. try {
  16536. // TODO(HTTP/2): Should we call onConnect immediately or on stream ready event?
  16537. request.onConnect((err) => {
  16538. if (request.aborted || request.completed) {
  16539. return
  16540. }
  16541. errorRequest(client, request, err || new RequestAbortedError())
  16542. })
  16543. } catch (err) {
  16544. errorRequest(client, request, err)
  16545. }
  16546. if (request.aborted) {
  16547. return false
  16548. }
  16549. /** @type {import('node:http2').ClientHttp2Stream} */
  16550. let stream
  16551. const h2State = client[kHTTP2SessionState]
  16552. headers[HTTP2_HEADER_AUTHORITY] = host || client[kHost]
  16553. headers[HTTP2_HEADER_METHOD] = method
  16554. if (method === 'CONNECT') {
  16555. session.ref()
  16556. // we are already connected, streams are pending, first request
  16557. // will create a new stream. We trigger a request to create the stream and wait until
  16558. // `ready` event is triggered
  16559. // We disabled endStream to allow the user to write to the stream
  16560. stream = session.request(headers, { endStream: false, signal })
  16561. if (stream.id && !stream.pending) {
  16562. request.onUpgrade(null, null, stream)
  16563. ++h2State.openStreams
  16564. } else {
  16565. stream.once('ready', () => {
  16566. request.onUpgrade(null, null, stream)
  16567. ++h2State.openStreams
  16568. })
  16569. }
  16570. stream.once('close', () => {
  16571. h2State.openStreams -= 1
  16572. // TODO(HTTP/2): unref only if current streams count is 0
  16573. if (h2State.openStreams === 0) session.unref()
  16574. })
  16575. return true
  16576. }
  16577. // https://tools.ietf.org/html/rfc7540#section-8.3
  16578. // :path and :scheme headers must be omited when sending CONNECT
  16579. headers[HTTP2_HEADER_PATH] = path
  16580. headers[HTTP2_HEADER_SCHEME] = 'https'
  16581. // https://tools.ietf.org/html/rfc7231#section-4.3.1
  16582. // https://tools.ietf.org/html/rfc7231#section-4.3.2
  16583. // https://tools.ietf.org/html/rfc7231#section-4.3.5
  16584. // Sending a payload body on a request that does not
  16585. // expect it can cause undefined behavior on some
  16586. // servers and corrupt connection state. Do not
  16587. // re-use the connection for further requests.
  16588. const expectsPayload = (
  16589. method === 'PUT' ||
  16590. method === 'POST' ||
  16591. method === 'PATCH'
  16592. )
  16593. if (body && typeof body.read === 'function') {
  16594. // Try to read EOF in order to get length.
  16595. body.read(0)
  16596. }
  16597. let contentLength = util.bodyLength(body)
  16598. if (contentLength == null) {
  16599. contentLength = request.contentLength
  16600. }
  16601. if (contentLength === 0 || !expectsPayload) {
  16602. // https://tools.ietf.org/html/rfc7230#section-3.3.2
  16603. // A user agent SHOULD NOT send a Content-Length header field when
  16604. // the request message does not contain a payload body and the method
  16605. // semantics do not anticipate such a body.
  16606. contentLength = null
  16607. }
  16608. // https://github.com/nodejs/undici/issues/2046
  16609. // A user agent may send a Content-Length header with 0 value, this should be allowed.
  16610. if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength != null && request.contentLength !== contentLength) {
  16611. if (client[kStrictContentLength]) {
  16612. errorRequest(client, request, new RequestContentLengthMismatchError())
  16613. return false
  16614. }
  16615. process.emitWarning(new RequestContentLengthMismatchError())
  16616. }
  16617. if (contentLength != null) {
  16618. assert(body, 'no body must not have content length')
  16619. headers[HTTP2_HEADER_CONTENT_LENGTH] = `${contentLength}`
  16620. }
  16621. session.ref()
  16622. const shouldEndStream = method === 'GET' || method === 'HEAD'
  16623. if (expectContinue) {
  16624. headers[HTTP2_HEADER_EXPECT] = '100-continue'
  16625. stream = session.request(headers, { endStream: shouldEndStream, signal })
  16626. stream.once('continue', writeBodyH2)
  16627. } else {
  16628. stream = session.request(headers, {
  16629. endStream: shouldEndStream,
  16630. signal
  16631. })
  16632. writeBodyH2()
  16633. }
  16634. // Increment counter as we have new several streams open
  16635. ++h2State.openStreams
  16636. stream.once('response', headers => {
  16637. const { [HTTP2_HEADER_STATUS]: statusCode, ...realHeaders } = headers
  16638. if (request.onHeaders(Number(statusCode), realHeaders, stream.resume.bind(stream), '') === false) {
  16639. stream.pause()
  16640. }
  16641. })
  16642. stream.once('end', () => {
  16643. request.onComplete([])
  16644. })
  16645. stream.on('data', (chunk) => {
  16646. if (request.onData(chunk) === false) {
  16647. stream.pause()
  16648. }
  16649. })
  16650. stream.once('close', () => {
  16651. h2State.openStreams -= 1
  16652. // TODO(HTTP/2): unref only if current streams count is 0
  16653. if (h2State.openStreams === 0) {
  16654. session.unref()
  16655. }
  16656. })
  16657. stream.once('error', function (err) {
  16658. if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) {
  16659. h2State.streams -= 1
  16660. util.destroy(stream, err)
  16661. }
  16662. })
  16663. stream.once('frameError', (type, code) => {
  16664. const err = new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`)
  16665. errorRequest(client, request, err)
  16666. if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) {
  16667. h2State.streams -= 1
  16668. util.destroy(stream, err)
  16669. }
  16670. })
  16671. // stream.on('aborted', () => {
  16672. // // TODO(HTTP/2): Support aborted
  16673. // })
  16674. // stream.on('timeout', () => {
  16675. // // TODO(HTTP/2): Support timeout
  16676. // })
  16677. // stream.on('push', headers => {
  16678. // // TODO(HTTP/2): Suppor push
  16679. // })
  16680. // stream.on('trailers', headers => {
  16681. // // TODO(HTTP/2): Support trailers
  16682. // })
  16683. return true
  16684. function writeBodyH2 () {
  16685. /* istanbul ignore else: assertion */
  16686. if (!body) {
  16687. request.onRequestSent()
  16688. } else if (util.isBuffer(body)) {
  16689. assert(contentLength === body.byteLength, 'buffer body must have content length')
  16690. stream.cork()
  16691. stream.write(body)
  16692. stream.uncork()
  16693. stream.end()
  16694. request.onBodySent(body)
  16695. request.onRequestSent()
  16696. } else if (util.isBlobLike(body)) {
  16697. if (typeof body.stream === 'function') {
  16698. writeIterable({
  16699. client,
  16700. request,
  16701. contentLength,
  16702. h2stream: stream,
  16703. expectsPayload,
  16704. body: body.stream(),
  16705. socket: client[kSocket],
  16706. header: ''
  16707. })
  16708. } else {
  16709. writeBlob({
  16710. body,
  16711. client,
  16712. request,
  16713. contentLength,
  16714. expectsPayload,
  16715. h2stream: stream,
  16716. header: '',
  16717. socket: client[kSocket]
  16718. })
  16719. }
  16720. } else if (util.isStream(body)) {
  16721. writeStream({
  16722. body,
  16723. client,
  16724. request,
  16725. contentLength,
  16726. expectsPayload,
  16727. socket: client[kSocket],
  16728. h2stream: stream,
  16729. header: ''
  16730. })
  16731. } else if (util.isIterable(body)) {
  16732. writeIterable({
  16733. body,
  16734. client,
  16735. request,
  16736. contentLength,
  16737. expectsPayload,
  16738. header: '',
  16739. h2stream: stream,
  16740. socket: client[kSocket]
  16741. })
  16742. } else {
  16743. assert(false)
  16744. }
  16745. }
  16746. }
  16747. function writeStream ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) {
  16748. assert(contentLength !== 0 || client[kRunning] === 0, 'stream body cannot be pipelined')
  16749. if (client[kHTTPConnVersion] === 'h2') {
  16750. // For HTTP/2, is enough to pipe the stream
  16751. const pipe = pipeline(
  16752. body,
  16753. h2stream,
  16754. (err) => {
  16755. if (err) {
  16756. util.destroy(body, err)
  16757. util.destroy(h2stream, err)
  16758. } else {
  16759. request.onRequestSent()
  16760. }
  16761. }
  16762. )
  16763. pipe.on('data', onPipeData)
  16764. pipe.once('end', () => {
  16765. pipe.removeListener('data', onPipeData)
  16766. util.destroy(pipe)
  16767. })
  16768. function onPipeData (chunk) {
  16769. request.onBodySent(chunk)
  16770. }
  16771. return
  16772. }
  16773. let finished = false
  16774. const writer = new AsyncWriter({ socket, request, contentLength, client, expectsPayload, header })
  16775. const onData = function (chunk) {
  16776. if (finished) {
  16777. return
  16778. }
  16779. try {
  16780. if (!writer.write(chunk) && this.pause) {
  16781. this.pause()
  16782. }
  16783. } catch (err) {
  16784. util.destroy(this, err)
  16785. }
  16786. }
  16787. const onDrain = function () {
  16788. if (finished) {
  16789. return
  16790. }
  16791. if (body.resume) {
  16792. body.resume()
  16793. }
  16794. }
  16795. const onAbort = function () {
  16796. if (finished) {
  16797. return
  16798. }
  16799. const err = new RequestAbortedError()
  16800. queueMicrotask(() => onFinished(err))
  16801. }
  16802. const onFinished = function (err) {
  16803. if (finished) {
  16804. return
  16805. }
  16806. finished = true
  16807. assert(socket.destroyed || (socket[kWriting] && client[kRunning] <= 1))
  16808. socket
  16809. .off('drain', onDrain)
  16810. .off('error', onFinished)
  16811. body
  16812. .removeListener('data', onData)
  16813. .removeListener('end', onFinished)
  16814. .removeListener('error', onFinished)
  16815. .removeListener('close', onAbort)
  16816. if (!err) {
  16817. try {
  16818. writer.end()
  16819. } catch (er) {
  16820. err = er
  16821. }
  16822. }
  16823. writer.destroy(err)
  16824. if (err && (err.code !== 'UND_ERR_INFO' || err.message !== 'reset')) {
  16825. util.destroy(body, err)
  16826. } else {
  16827. util.destroy(body)
  16828. }
  16829. }
  16830. body
  16831. .on('data', onData)
  16832. .on('end', onFinished)
  16833. .on('error', onFinished)
  16834. .on('close', onAbort)
  16835. if (body.resume) {
  16836. body.resume()
  16837. }
  16838. socket
  16839. .on('drain', onDrain)
  16840. .on('error', onFinished)
  16841. }
  16842. async function writeBlob ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) {
  16843. assert(contentLength === body.size, 'blob body must have content length')
  16844. const isH2 = client[kHTTPConnVersion] === 'h2'
  16845. try {
  16846. if (contentLength != null && contentLength !== body.size) {
  16847. throw new RequestContentLengthMismatchError()
  16848. }
  16849. const buffer = Buffer.from(await body.arrayBuffer())
  16850. if (isH2) {
  16851. h2stream.cork()
  16852. h2stream.write(buffer)
  16853. h2stream.uncork()
  16854. } else {
  16855. socket.cork()
  16856. socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1')
  16857. socket.write(buffer)
  16858. socket.uncork()
  16859. }
  16860. request.onBodySent(buffer)
  16861. request.onRequestSent()
  16862. if (!expectsPayload) {
  16863. socket[kReset] = true
  16864. }
  16865. resume(client)
  16866. } catch (err) {
  16867. util.destroy(isH2 ? h2stream : socket, err)
  16868. }
  16869. }
  16870. async function writeIterable ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) {
  16871. assert(contentLength !== 0 || client[kRunning] === 0, 'iterator body cannot be pipelined')
  16872. let callback = null
  16873. function onDrain () {
  16874. if (callback) {
  16875. const cb = callback
  16876. callback = null
  16877. cb()
  16878. }
  16879. }
  16880. const waitForDrain = () => new Promise((resolve, reject) => {
  16881. assert(callback === null)
  16882. if (socket[kError]) {
  16883. reject(socket[kError])
  16884. } else {
  16885. callback = resolve
  16886. }
  16887. })
  16888. if (client[kHTTPConnVersion] === 'h2') {
  16889. h2stream
  16890. .on('close', onDrain)
  16891. .on('drain', onDrain)
  16892. try {
  16893. // It's up to the user to somehow abort the async iterable.
  16894. for await (const chunk of body) {
  16895. if (socket[kError]) {
  16896. throw socket[kError]
  16897. }
  16898. const res = h2stream.write(chunk)
  16899. request.onBodySent(chunk)
  16900. if (!res) {
  16901. await waitForDrain()
  16902. }
  16903. }
  16904. } catch (err) {
  16905. h2stream.destroy(err)
  16906. } finally {
  16907. request.onRequestSent()
  16908. h2stream.end()
  16909. h2stream
  16910. .off('close', onDrain)
  16911. .off('drain', onDrain)
  16912. }
  16913. return
  16914. }
  16915. socket
  16916. .on('close', onDrain)
  16917. .on('drain', onDrain)
  16918. const writer = new AsyncWriter({ socket, request, contentLength, client, expectsPayload, header })
  16919. try {
  16920. // It's up to the user to somehow abort the async iterable.
  16921. for await (const chunk of body) {
  16922. if (socket[kError]) {
  16923. throw socket[kError]
  16924. }
  16925. if (!writer.write(chunk)) {
  16926. await waitForDrain()
  16927. }
  16928. }
  16929. writer.end()
  16930. } catch (err) {
  16931. writer.destroy(err)
  16932. } finally {
  16933. socket
  16934. .off('close', onDrain)
  16935. .off('drain', onDrain)
  16936. }
  16937. }
  16938. class AsyncWriter {
  16939. constructor ({ socket, request, contentLength, client, expectsPayload, header }) {
  16940. this.socket = socket
  16941. this.request = request
  16942. this.contentLength = contentLength
  16943. this.client = client
  16944. this.bytesWritten = 0
  16945. this.expectsPayload = expectsPayload
  16946. this.header = header
  16947. socket[kWriting] = true
  16948. }
  16949. write (chunk) {
  16950. const { socket, request, contentLength, client, bytesWritten, expectsPayload, header } = this
  16951. if (socket[kError]) {
  16952. throw socket[kError]
  16953. }
  16954. if (socket.destroyed) {
  16955. return false
  16956. }
  16957. const len = Buffer.byteLength(chunk)
  16958. if (!len) {
  16959. return true
  16960. }
  16961. // We should defer writing chunks.
  16962. if (contentLength !== null && bytesWritten + len > contentLength) {
  16963. if (client[kStrictContentLength]) {
  16964. throw new RequestContentLengthMismatchError()
  16965. }
  16966. process.emitWarning(new RequestContentLengthMismatchError())
  16967. }
  16968. socket.cork()
  16969. if (bytesWritten === 0) {
  16970. if (!expectsPayload) {
  16971. socket[kReset] = true
  16972. }
  16973. if (contentLength === null) {
  16974. socket.write(`${header}transfer-encoding: chunked\r\n`, 'latin1')
  16975. } else {
  16976. socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1')
  16977. }
  16978. }
  16979. if (contentLength === null) {
  16980. socket.write(`\r\n${len.toString(16)}\r\n`, 'latin1')
  16981. }
  16982. this.bytesWritten += len
  16983. const ret = socket.write(chunk)
  16984. socket.uncork()
  16985. request.onBodySent(chunk)
  16986. if (!ret) {
  16987. if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {
  16988. // istanbul ignore else: only for jest
  16989. if (socket[kParser].timeout.refresh) {
  16990. socket[kParser].timeout.refresh()
  16991. }
  16992. }
  16993. }
  16994. return ret
  16995. }
  16996. end () {
  16997. const { socket, contentLength, client, bytesWritten, expectsPayload, header, request } = this
  16998. request.onRequestSent()
  16999. socket[kWriting] = false
  17000. if (socket[kError]) {
  17001. throw socket[kError]
  17002. }
  17003. if (socket.destroyed) {
  17004. return
  17005. }
  17006. if (bytesWritten === 0) {
  17007. if (expectsPayload) {
  17008. // https://tools.ietf.org/html/rfc7230#section-3.3.2
  17009. // A user agent SHOULD send a Content-Length in a request message when
  17010. // no Transfer-Encoding is sent and the request method defines a meaning
  17011. // for an enclosed payload body.
  17012. socket.write(`${header}content-length: 0\r\n\r\n`, 'latin1')
  17013. } else {
  17014. socket.write(`${header}\r\n`, 'latin1')
  17015. }
  17016. } else if (contentLength === null) {
  17017. socket.write('\r\n0\r\n\r\n', 'latin1')
  17018. }
  17019. if (contentLength !== null && bytesWritten !== contentLength) {
  17020. if (client[kStrictContentLength]) {
  17021. throw new RequestContentLengthMismatchError()
  17022. } else {
  17023. process.emitWarning(new RequestContentLengthMismatchError())
  17024. }
  17025. }
  17026. if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {
  17027. // istanbul ignore else: only for jest
  17028. if (socket[kParser].timeout.refresh) {
  17029. socket[kParser].timeout.refresh()
  17030. }
  17031. }
  17032. resume(client)
  17033. }
  17034. destroy (err) {
  17035. const { socket, client } = this
  17036. socket[kWriting] = false
  17037. if (err) {
  17038. assert(client[kRunning] <= 1, 'pipeline should only contain this request')
  17039. util.destroy(socket, err)
  17040. }
  17041. }
  17042. }
  17043. function errorRequest (client, request, err) {
  17044. try {
  17045. request.onError(err)
  17046. assert(request.aborted)
  17047. } catch (err) {
  17048. client.emit('error', err)
  17049. }
  17050. }
  17051. module.exports = Client
  17052. /***/ }),
  17053. /***/ 6436:
  17054. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  17055. "use strict";
  17056. /* istanbul ignore file: only for Node 12 */
  17057. const { kConnected, kSize } = __nccwpck_require__(2785)
  17058. class CompatWeakRef {
  17059. constructor (value) {
  17060. this.value = value
  17061. }
  17062. deref () {
  17063. return this.value[kConnected] === 0 && this.value[kSize] === 0
  17064. ? undefined
  17065. : this.value
  17066. }
  17067. }
  17068. class CompatFinalizer {
  17069. constructor (finalizer) {
  17070. this.finalizer = finalizer
  17071. }
  17072. register (dispatcher, key) {
  17073. if (dispatcher.on) {
  17074. dispatcher.on('disconnect', () => {
  17075. if (dispatcher[kConnected] === 0 && dispatcher[kSize] === 0) {
  17076. this.finalizer(key)
  17077. }
  17078. })
  17079. }
  17080. }
  17081. }
  17082. module.exports = function () {
  17083. // FIXME: remove workaround when the Node bug is fixed
  17084. // https://github.com/nodejs/node/issues/49344#issuecomment-1741776308
  17085. if (process.env.NODE_V8_COVERAGE) {
  17086. return {
  17087. WeakRef: CompatWeakRef,
  17088. FinalizationRegistry: CompatFinalizer
  17089. }
  17090. }
  17091. return {
  17092. WeakRef: global.WeakRef || CompatWeakRef,
  17093. FinalizationRegistry: global.FinalizationRegistry || CompatFinalizer
  17094. }
  17095. }
  17096. /***/ }),
  17097. /***/ 663:
  17098. /***/ ((module) => {
  17099. "use strict";
  17100. // https://wicg.github.io/cookie-store/#cookie-maximum-attribute-value-size
  17101. const maxAttributeValueSize = 1024
  17102. // https://wicg.github.io/cookie-store/#cookie-maximum-name-value-pair-size
  17103. const maxNameValuePairSize = 4096
  17104. module.exports = {
  17105. maxAttributeValueSize,
  17106. maxNameValuePairSize
  17107. }
  17108. /***/ }),
  17109. /***/ 1724:
  17110. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  17111. "use strict";
  17112. const { parseSetCookie } = __nccwpck_require__(4408)
  17113. const { stringify } = __nccwpck_require__(3121)
  17114. const { webidl } = __nccwpck_require__(1744)
  17115. const { Headers } = __nccwpck_require__(554)
  17116. /**
  17117. * @typedef {Object} Cookie
  17118. * @property {string} name
  17119. * @property {string} value
  17120. * @property {Date|number|undefined} expires
  17121. * @property {number|undefined} maxAge
  17122. * @property {string|undefined} domain
  17123. * @property {string|undefined} path
  17124. * @property {boolean|undefined} secure
  17125. * @property {boolean|undefined} httpOnly
  17126. * @property {'Strict'|'Lax'|'None'} sameSite
  17127. * @property {string[]} unparsed
  17128. */
  17129. /**
  17130. * @param {Headers} headers
  17131. * @returns {Record<string, string>}
  17132. */
  17133. function getCookies (headers) {
  17134. webidl.argumentLengthCheck(arguments, 1, { header: 'getCookies' })
  17135. webidl.brandCheck(headers, Headers, { strict: false })
  17136. const cookie = headers.get('cookie')
  17137. const out = {}
  17138. if (!cookie) {
  17139. return out
  17140. }
  17141. for (const piece of cookie.split(';')) {
  17142. const [name, ...value] = piece.split('=')
  17143. out[name.trim()] = value.join('=')
  17144. }
  17145. return out
  17146. }
  17147. /**
  17148. * @param {Headers} headers
  17149. * @param {string} name
  17150. * @param {{ path?: string, domain?: string }|undefined} attributes
  17151. * @returns {void}
  17152. */
  17153. function deleteCookie (headers, name, attributes) {
  17154. webidl.argumentLengthCheck(arguments, 2, { header: 'deleteCookie' })
  17155. webidl.brandCheck(headers, Headers, { strict: false })
  17156. name = webidl.converters.DOMString(name)
  17157. attributes = webidl.converters.DeleteCookieAttributes(attributes)
  17158. // Matches behavior of
  17159. // https://github.com/denoland/deno_std/blob/63827b16330b82489a04614027c33b7904e08be5/http/cookie.ts#L278
  17160. setCookie(headers, {
  17161. name,
  17162. value: '',
  17163. expires: new Date(0),
  17164. ...attributes
  17165. })
  17166. }
  17167. /**
  17168. * @param {Headers} headers
  17169. * @returns {Cookie[]}
  17170. */
  17171. function getSetCookies (headers) {
  17172. webidl.argumentLengthCheck(arguments, 1, { header: 'getSetCookies' })
  17173. webidl.brandCheck(headers, Headers, { strict: false })
  17174. const cookies = headers.getSetCookie()
  17175. if (!cookies) {
  17176. return []
  17177. }
  17178. return cookies.map((pair) => parseSetCookie(pair))
  17179. }
  17180. /**
  17181. * @param {Headers} headers
  17182. * @param {Cookie} cookie
  17183. * @returns {void}
  17184. */
  17185. function setCookie (headers, cookie) {
  17186. webidl.argumentLengthCheck(arguments, 2, { header: 'setCookie' })
  17187. webidl.brandCheck(headers, Headers, { strict: false })
  17188. cookie = webidl.converters.Cookie(cookie)
  17189. const str = stringify(cookie)
  17190. if (str) {
  17191. headers.append('Set-Cookie', stringify(cookie))
  17192. }
  17193. }
  17194. webidl.converters.DeleteCookieAttributes = webidl.dictionaryConverter([
  17195. {
  17196. converter: webidl.nullableConverter(webidl.converters.DOMString),
  17197. key: 'path',
  17198. defaultValue: null
  17199. },
  17200. {
  17201. converter: webidl.nullableConverter(webidl.converters.DOMString),
  17202. key: 'domain',
  17203. defaultValue: null
  17204. }
  17205. ])
  17206. webidl.converters.Cookie = webidl.dictionaryConverter([
  17207. {
  17208. converter: webidl.converters.DOMString,
  17209. key: 'name'
  17210. },
  17211. {
  17212. converter: webidl.converters.DOMString,
  17213. key: 'value'
  17214. },
  17215. {
  17216. converter: webidl.nullableConverter((value) => {
  17217. if (typeof value === 'number') {
  17218. return webidl.converters['unsigned long long'](value)
  17219. }
  17220. return new Date(value)
  17221. }),
  17222. key: 'expires',
  17223. defaultValue: null
  17224. },
  17225. {
  17226. converter: webidl.nullableConverter(webidl.converters['long long']),
  17227. key: 'maxAge',
  17228. defaultValue: null
  17229. },
  17230. {
  17231. converter: webidl.nullableConverter(webidl.converters.DOMString),
  17232. key: 'domain',
  17233. defaultValue: null
  17234. },
  17235. {
  17236. converter: webidl.nullableConverter(webidl.converters.DOMString),
  17237. key: 'path',
  17238. defaultValue: null
  17239. },
  17240. {
  17241. converter: webidl.nullableConverter(webidl.converters.boolean),
  17242. key: 'secure',
  17243. defaultValue: null
  17244. },
  17245. {
  17246. converter: webidl.nullableConverter(webidl.converters.boolean),
  17247. key: 'httpOnly',
  17248. defaultValue: null
  17249. },
  17250. {
  17251. converter: webidl.converters.USVString,
  17252. key: 'sameSite',
  17253. allowedValues: ['Strict', 'Lax', 'None']
  17254. },
  17255. {
  17256. converter: webidl.sequenceConverter(webidl.converters.DOMString),
  17257. key: 'unparsed',
  17258. defaultValue: []
  17259. }
  17260. ])
  17261. module.exports = {
  17262. getCookies,
  17263. deleteCookie,
  17264. getSetCookies,
  17265. setCookie
  17266. }
  17267. /***/ }),
  17268. /***/ 4408:
  17269. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  17270. "use strict";
  17271. const { maxNameValuePairSize, maxAttributeValueSize } = __nccwpck_require__(663)
  17272. const { isCTLExcludingHtab } = __nccwpck_require__(3121)
  17273. const { collectASequenceOfCodePointsFast } = __nccwpck_require__(685)
  17274. const assert = __nccwpck_require__(9491)
  17275. /**
  17276. * @description Parses the field-value attributes of a set-cookie header string.
  17277. * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4
  17278. * @param {string} header
  17279. * @returns if the header is invalid, null will be returned
  17280. */
  17281. function parseSetCookie (header) {
  17282. // 1. If the set-cookie-string contains a %x00-08 / %x0A-1F / %x7F
  17283. // character (CTL characters excluding HTAB): Abort these steps and
  17284. // ignore the set-cookie-string entirely.
  17285. if (isCTLExcludingHtab(header)) {
  17286. return null
  17287. }
  17288. let nameValuePair = ''
  17289. let unparsedAttributes = ''
  17290. let name = ''
  17291. let value = ''
  17292. // 2. If the set-cookie-string contains a %x3B (";") character:
  17293. if (header.includes(';')) {
  17294. // 1. The name-value-pair string consists of the characters up to,
  17295. // but not including, the first %x3B (";"), and the unparsed-
  17296. // attributes consist of the remainder of the set-cookie-string
  17297. // (including the %x3B (";") in question).
  17298. const position = { position: 0 }
  17299. nameValuePair = collectASequenceOfCodePointsFast(';', header, position)
  17300. unparsedAttributes = header.slice(position.position)
  17301. } else {
  17302. // Otherwise:
  17303. // 1. The name-value-pair string consists of all the characters
  17304. // contained in the set-cookie-string, and the unparsed-
  17305. // attributes is the empty string.
  17306. nameValuePair = header
  17307. }
  17308. // 3. If the name-value-pair string lacks a %x3D ("=") character, then
  17309. // the name string is empty, and the value string is the value of
  17310. // name-value-pair.
  17311. if (!nameValuePair.includes('=')) {
  17312. value = nameValuePair
  17313. } else {
  17314. // Otherwise, the name string consists of the characters up to, but
  17315. // not including, the first %x3D ("=") character, and the (possibly
  17316. // empty) value string consists of the characters after the first
  17317. // %x3D ("=") character.
  17318. const position = { position: 0 }
  17319. name = collectASequenceOfCodePointsFast(
  17320. '=',
  17321. nameValuePair,
  17322. position
  17323. )
  17324. value = nameValuePair.slice(position.position + 1)
  17325. }
  17326. // 4. Remove any leading or trailing WSP characters from the name
  17327. // string and the value string.
  17328. name = name.trim()
  17329. value = value.trim()
  17330. // 5. If the sum of the lengths of the name string and the value string
  17331. // is more than 4096 octets, abort these steps and ignore the set-
  17332. // cookie-string entirely.
  17333. if (name.length + value.length > maxNameValuePairSize) {
  17334. return null
  17335. }
  17336. // 6. The cookie-name is the name string, and the cookie-value is the
  17337. // value string.
  17338. return {
  17339. name, value, ...parseUnparsedAttributes(unparsedAttributes)
  17340. }
  17341. }
  17342. /**
  17343. * Parses the remaining attributes of a set-cookie header
  17344. * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4
  17345. * @param {string} unparsedAttributes
  17346. * @param {[Object.<string, unknown>]={}} cookieAttributeList
  17347. */
  17348. function parseUnparsedAttributes (unparsedAttributes, cookieAttributeList = {}) {
  17349. // 1. If the unparsed-attributes string is empty, skip the rest of
  17350. // these steps.
  17351. if (unparsedAttributes.length === 0) {
  17352. return cookieAttributeList
  17353. }
  17354. // 2. Discard the first character of the unparsed-attributes (which
  17355. // will be a %x3B (";") character).
  17356. assert(unparsedAttributes[0] === ';')
  17357. unparsedAttributes = unparsedAttributes.slice(1)
  17358. let cookieAv = ''
  17359. // 3. If the remaining unparsed-attributes contains a %x3B (";")
  17360. // character:
  17361. if (unparsedAttributes.includes(';')) {
  17362. // 1. Consume the characters of the unparsed-attributes up to, but
  17363. // not including, the first %x3B (";") character.
  17364. cookieAv = collectASequenceOfCodePointsFast(
  17365. ';',
  17366. unparsedAttributes,
  17367. { position: 0 }
  17368. )
  17369. unparsedAttributes = unparsedAttributes.slice(cookieAv.length)
  17370. } else {
  17371. // Otherwise:
  17372. // 1. Consume the remainder of the unparsed-attributes.
  17373. cookieAv = unparsedAttributes
  17374. unparsedAttributes = ''
  17375. }
  17376. // Let the cookie-av string be the characters consumed in this step.
  17377. let attributeName = ''
  17378. let attributeValue = ''
  17379. // 4. If the cookie-av string contains a %x3D ("=") character:
  17380. if (cookieAv.includes('=')) {
  17381. // 1. The (possibly empty) attribute-name string consists of the
  17382. // characters up to, but not including, the first %x3D ("=")
  17383. // character, and the (possibly empty) attribute-value string
  17384. // consists of the characters after the first %x3D ("=")
  17385. // character.
  17386. const position = { position: 0 }
  17387. attributeName = collectASequenceOfCodePointsFast(
  17388. '=',
  17389. cookieAv,
  17390. position
  17391. )
  17392. attributeValue = cookieAv.slice(position.position + 1)
  17393. } else {
  17394. // Otherwise:
  17395. // 1. The attribute-name string consists of the entire cookie-av
  17396. // string, and the attribute-value string is empty.
  17397. attributeName = cookieAv
  17398. }
  17399. // 5. Remove any leading or trailing WSP characters from the attribute-
  17400. // name string and the attribute-value string.
  17401. attributeName = attributeName.trim()
  17402. attributeValue = attributeValue.trim()
  17403. // 6. If the attribute-value is longer than 1024 octets, ignore the
  17404. // cookie-av string and return to Step 1 of this algorithm.
  17405. if (attributeValue.length > maxAttributeValueSize) {
  17406. return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
  17407. }
  17408. // 7. Process the attribute-name and attribute-value according to the
  17409. // requirements in the following subsections. (Notice that
  17410. // attributes with unrecognized attribute-names are ignored.)
  17411. const attributeNameLowercase = attributeName.toLowerCase()
  17412. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.1
  17413. // If the attribute-name case-insensitively matches the string
  17414. // "Expires", the user agent MUST process the cookie-av as follows.
  17415. if (attributeNameLowercase === 'expires') {
  17416. // 1. Let the expiry-time be the result of parsing the attribute-value
  17417. // as cookie-date (see Section 5.1.1).
  17418. const expiryTime = new Date(attributeValue)
  17419. // 2. If the attribute-value failed to parse as a cookie date, ignore
  17420. // the cookie-av.
  17421. cookieAttributeList.expires = expiryTime
  17422. } else if (attributeNameLowercase === 'max-age') {
  17423. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.2
  17424. // If the attribute-name case-insensitively matches the string "Max-
  17425. // Age", the user agent MUST process the cookie-av as follows.
  17426. // 1. If the first character of the attribute-value is not a DIGIT or a
  17427. // "-" character, ignore the cookie-av.
  17428. const charCode = attributeValue.charCodeAt(0)
  17429. if ((charCode < 48 || charCode > 57) && attributeValue[0] !== '-') {
  17430. return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
  17431. }
  17432. // 2. If the remainder of attribute-value contains a non-DIGIT
  17433. // character, ignore the cookie-av.
  17434. if (!/^\d+$/.test(attributeValue)) {
  17435. return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
  17436. }
  17437. // 3. Let delta-seconds be the attribute-value converted to an integer.
  17438. const deltaSeconds = Number(attributeValue)
  17439. // 4. Let cookie-age-limit be the maximum age of the cookie (which
  17440. // SHOULD be 400 days or less, see Section 4.1.2.2).
  17441. // 5. Set delta-seconds to the smaller of its present value and cookie-
  17442. // age-limit.
  17443. // deltaSeconds = Math.min(deltaSeconds * 1000, maxExpiresMs)
  17444. // 6. If delta-seconds is less than or equal to zero (0), let expiry-
  17445. // time be the earliest representable date and time. Otherwise, let
  17446. // the expiry-time be the current date and time plus delta-seconds
  17447. // seconds.
  17448. // const expiryTime = deltaSeconds <= 0 ? Date.now() : Date.now() + deltaSeconds
  17449. // 7. Append an attribute to the cookie-attribute-list with an
  17450. // attribute-name of Max-Age and an attribute-value of expiry-time.
  17451. cookieAttributeList.maxAge = deltaSeconds
  17452. } else if (attributeNameLowercase === 'domain') {
  17453. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.3
  17454. // If the attribute-name case-insensitively matches the string "Domain",
  17455. // the user agent MUST process the cookie-av as follows.
  17456. // 1. Let cookie-domain be the attribute-value.
  17457. let cookieDomain = attributeValue
  17458. // 2. If cookie-domain starts with %x2E ("."), let cookie-domain be
  17459. // cookie-domain without its leading %x2E (".").
  17460. if (cookieDomain[0] === '.') {
  17461. cookieDomain = cookieDomain.slice(1)
  17462. }
  17463. // 3. Convert the cookie-domain to lower case.
  17464. cookieDomain = cookieDomain.toLowerCase()
  17465. // 4. Append an attribute to the cookie-attribute-list with an
  17466. // attribute-name of Domain and an attribute-value of cookie-domain.
  17467. cookieAttributeList.domain = cookieDomain
  17468. } else if (attributeNameLowercase === 'path') {
  17469. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.4
  17470. // If the attribute-name case-insensitively matches the string "Path",
  17471. // the user agent MUST process the cookie-av as follows.
  17472. // 1. If the attribute-value is empty or if the first character of the
  17473. // attribute-value is not %x2F ("/"):
  17474. let cookiePath = ''
  17475. if (attributeValue.length === 0 || attributeValue[0] !== '/') {
  17476. // 1. Let cookie-path be the default-path.
  17477. cookiePath = '/'
  17478. } else {
  17479. // Otherwise:
  17480. // 1. Let cookie-path be the attribute-value.
  17481. cookiePath = attributeValue
  17482. }
  17483. // 2. Append an attribute to the cookie-attribute-list with an
  17484. // attribute-name of Path and an attribute-value of cookie-path.
  17485. cookieAttributeList.path = cookiePath
  17486. } else if (attributeNameLowercase === 'secure') {
  17487. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.5
  17488. // If the attribute-name case-insensitively matches the string "Secure",
  17489. // the user agent MUST append an attribute to the cookie-attribute-list
  17490. // with an attribute-name of Secure and an empty attribute-value.
  17491. cookieAttributeList.secure = true
  17492. } else if (attributeNameLowercase === 'httponly') {
  17493. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.6
  17494. // If the attribute-name case-insensitively matches the string
  17495. // "HttpOnly", the user agent MUST append an attribute to the cookie-
  17496. // attribute-list with an attribute-name of HttpOnly and an empty
  17497. // attribute-value.
  17498. cookieAttributeList.httpOnly = true
  17499. } else if (attributeNameLowercase === 'samesite') {
  17500. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.7
  17501. // If the attribute-name case-insensitively matches the string
  17502. // "SameSite", the user agent MUST process the cookie-av as follows:
  17503. // 1. Let enforcement be "Default".
  17504. let enforcement = 'Default'
  17505. const attributeValueLowercase = attributeValue.toLowerCase()
  17506. // 2. If cookie-av's attribute-value is a case-insensitive match for
  17507. // "None", set enforcement to "None".
  17508. if (attributeValueLowercase.includes('none')) {
  17509. enforcement = 'None'
  17510. }
  17511. // 3. If cookie-av's attribute-value is a case-insensitive match for
  17512. // "Strict", set enforcement to "Strict".
  17513. if (attributeValueLowercase.includes('strict')) {
  17514. enforcement = 'Strict'
  17515. }
  17516. // 4. If cookie-av's attribute-value is a case-insensitive match for
  17517. // "Lax", set enforcement to "Lax".
  17518. if (attributeValueLowercase.includes('lax')) {
  17519. enforcement = 'Lax'
  17520. }
  17521. // 5. Append an attribute to the cookie-attribute-list with an
  17522. // attribute-name of "SameSite" and an attribute-value of
  17523. // enforcement.
  17524. cookieAttributeList.sameSite = enforcement
  17525. } else {
  17526. cookieAttributeList.unparsed ??= []
  17527. cookieAttributeList.unparsed.push(`${attributeName}=${attributeValue}`)
  17528. }
  17529. // 8. Return to Step 1 of this algorithm.
  17530. return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
  17531. }
  17532. module.exports = {
  17533. parseSetCookie,
  17534. parseUnparsedAttributes
  17535. }
  17536. /***/ }),
  17537. /***/ 3121:
  17538. /***/ ((module) => {
  17539. "use strict";
  17540. /**
  17541. * @param {string} value
  17542. * @returns {boolean}
  17543. */
  17544. function isCTLExcludingHtab (value) {
  17545. if (value.length === 0) {
  17546. return false
  17547. }
  17548. for (const char of value) {
  17549. const code = char.charCodeAt(0)
  17550. if (
  17551. (code >= 0x00 || code <= 0x08) ||
  17552. (code >= 0x0A || code <= 0x1F) ||
  17553. code === 0x7F
  17554. ) {
  17555. return false
  17556. }
  17557. }
  17558. }
  17559. /**
  17560. CHAR = <any US-ASCII character (octets 0 - 127)>
  17561. token = 1*<any CHAR except CTLs or separators>
  17562. separators = "(" | ")" | "<" | ">" | "@"
  17563. | "," | ";" | ":" | "\" | <">
  17564. | "/" | "[" | "]" | "?" | "="
  17565. | "{" | "}" | SP | HT
  17566. * @param {string} name
  17567. */
  17568. function validateCookieName (name) {
  17569. for (const char of name) {
  17570. const code = char.charCodeAt(0)
  17571. if (
  17572. (code <= 0x20 || code > 0x7F) ||
  17573. char === '(' ||
  17574. char === ')' ||
  17575. char === '>' ||
  17576. char === '<' ||
  17577. char === '@' ||
  17578. char === ',' ||
  17579. char === ';' ||
  17580. char === ':' ||
  17581. char === '\\' ||
  17582. char === '"' ||
  17583. char === '/' ||
  17584. char === '[' ||
  17585. char === ']' ||
  17586. char === '?' ||
  17587. char === '=' ||
  17588. char === '{' ||
  17589. char === '}'
  17590. ) {
  17591. throw new Error('Invalid cookie name')
  17592. }
  17593. }
  17594. }
  17595. /**
  17596. cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE )
  17597. cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E
  17598. ; US-ASCII characters excluding CTLs,
  17599. ; whitespace DQUOTE, comma, semicolon,
  17600. ; and backslash
  17601. * @param {string} value
  17602. */
  17603. function validateCookieValue (value) {
  17604. for (const char of value) {
  17605. const code = char.charCodeAt(0)
  17606. if (
  17607. code < 0x21 || // exclude CTLs (0-31)
  17608. code === 0x22 ||
  17609. code === 0x2C ||
  17610. code === 0x3B ||
  17611. code === 0x5C ||
  17612. code > 0x7E // non-ascii
  17613. ) {
  17614. throw new Error('Invalid header value')
  17615. }
  17616. }
  17617. }
  17618. /**
  17619. * path-value = <any CHAR except CTLs or ";">
  17620. * @param {string} path
  17621. */
  17622. function validateCookiePath (path) {
  17623. for (const char of path) {
  17624. const code = char.charCodeAt(0)
  17625. if (code < 0x21 || char === ';') {
  17626. throw new Error('Invalid cookie path')
  17627. }
  17628. }
  17629. }
  17630. /**
  17631. * I have no idea why these values aren't allowed to be honest,
  17632. * but Deno tests these. - Khafra
  17633. * @param {string} domain
  17634. */
  17635. function validateCookieDomain (domain) {
  17636. if (
  17637. domain.startsWith('-') ||
  17638. domain.endsWith('.') ||
  17639. domain.endsWith('-')
  17640. ) {
  17641. throw new Error('Invalid cookie domain')
  17642. }
  17643. }
  17644. /**
  17645. * @see https://www.rfc-editor.org/rfc/rfc7231#section-7.1.1.1
  17646. * @param {number|Date} date
  17647. IMF-fixdate = day-name "," SP date1 SP time-of-day SP GMT
  17648. ; fixed length/zone/capitalization subset of the format
  17649. ; see Section 3.3 of [RFC5322]
  17650. day-name = %x4D.6F.6E ; "Mon", case-sensitive
  17651. / %x54.75.65 ; "Tue", case-sensitive
  17652. / %x57.65.64 ; "Wed", case-sensitive
  17653. / %x54.68.75 ; "Thu", case-sensitive
  17654. / %x46.72.69 ; "Fri", case-sensitive
  17655. / %x53.61.74 ; "Sat", case-sensitive
  17656. / %x53.75.6E ; "Sun", case-sensitive
  17657. date1 = day SP month SP year
  17658. ; e.g., 02 Jun 1982
  17659. day = 2DIGIT
  17660. month = %x4A.61.6E ; "Jan", case-sensitive
  17661. / %x46.65.62 ; "Feb", case-sensitive
  17662. / %x4D.61.72 ; "Mar", case-sensitive
  17663. / %x41.70.72 ; "Apr", case-sensitive
  17664. / %x4D.61.79 ; "May", case-sensitive
  17665. / %x4A.75.6E ; "Jun", case-sensitive
  17666. / %x4A.75.6C ; "Jul", case-sensitive
  17667. / %x41.75.67 ; "Aug", case-sensitive
  17668. / %x53.65.70 ; "Sep", case-sensitive
  17669. / %x4F.63.74 ; "Oct", case-sensitive
  17670. / %x4E.6F.76 ; "Nov", case-sensitive
  17671. / %x44.65.63 ; "Dec", case-sensitive
  17672. year = 4DIGIT
  17673. GMT = %x47.4D.54 ; "GMT", case-sensitive
  17674. time-of-day = hour ":" minute ":" second
  17675. ; 00:00:00 - 23:59:60 (leap second)
  17676. hour = 2DIGIT
  17677. minute = 2DIGIT
  17678. second = 2DIGIT
  17679. */
  17680. function toIMFDate (date) {
  17681. if (typeof date === 'number') {
  17682. date = new Date(date)
  17683. }
  17684. const days = [
  17685. 'Sun', 'Mon', 'Tue', 'Wed',
  17686. 'Thu', 'Fri', 'Sat'
  17687. ]
  17688. const months = [
  17689. 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
  17690. 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'
  17691. ]
  17692. const dayName = days[date.getUTCDay()]
  17693. const day = date.getUTCDate().toString().padStart(2, '0')
  17694. const month = months[date.getUTCMonth()]
  17695. const year = date.getUTCFullYear()
  17696. const hour = date.getUTCHours().toString().padStart(2, '0')
  17697. const minute = date.getUTCMinutes().toString().padStart(2, '0')
  17698. const second = date.getUTCSeconds().toString().padStart(2, '0')
  17699. return `${dayName}, ${day} ${month} ${year} ${hour}:${minute}:${second} GMT`
  17700. }
  17701. /**
  17702. max-age-av = "Max-Age=" non-zero-digit *DIGIT
  17703. ; In practice, both expires-av and max-age-av
  17704. ; are limited to dates representable by the
  17705. ; user agent.
  17706. * @param {number} maxAge
  17707. */
  17708. function validateCookieMaxAge (maxAge) {
  17709. if (maxAge < 0) {
  17710. throw new Error('Invalid cookie max-age')
  17711. }
  17712. }
  17713. /**
  17714. * @see https://www.rfc-editor.org/rfc/rfc6265#section-4.1.1
  17715. * @param {import('./index').Cookie} cookie
  17716. */
  17717. function stringify (cookie) {
  17718. if (cookie.name.length === 0) {
  17719. return null
  17720. }
  17721. validateCookieName(cookie.name)
  17722. validateCookieValue(cookie.value)
  17723. const out = [`${cookie.name}=${cookie.value}`]
  17724. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.1
  17725. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.2
  17726. if (cookie.name.startsWith('__Secure-')) {
  17727. cookie.secure = true
  17728. }
  17729. if (cookie.name.startsWith('__Host-')) {
  17730. cookie.secure = true
  17731. cookie.domain = null
  17732. cookie.path = '/'
  17733. }
  17734. if (cookie.secure) {
  17735. out.push('Secure')
  17736. }
  17737. if (cookie.httpOnly) {
  17738. out.push('HttpOnly')
  17739. }
  17740. if (typeof cookie.maxAge === 'number') {
  17741. validateCookieMaxAge(cookie.maxAge)
  17742. out.push(`Max-Age=${cookie.maxAge}`)
  17743. }
  17744. if (cookie.domain) {
  17745. validateCookieDomain(cookie.domain)
  17746. out.push(`Domain=${cookie.domain}`)
  17747. }
  17748. if (cookie.path) {
  17749. validateCookiePath(cookie.path)
  17750. out.push(`Path=${cookie.path}`)
  17751. }
  17752. if (cookie.expires && cookie.expires.toString() !== 'Invalid Date') {
  17753. out.push(`Expires=${toIMFDate(cookie.expires)}`)
  17754. }
  17755. if (cookie.sameSite) {
  17756. out.push(`SameSite=${cookie.sameSite}`)
  17757. }
  17758. for (const part of cookie.unparsed) {
  17759. if (!part.includes('=')) {
  17760. throw new Error('Invalid unparsed')
  17761. }
  17762. const [key, ...value] = part.split('=')
  17763. out.push(`${key.trim()}=${value.join('=')}`)
  17764. }
  17765. return out.join('; ')
  17766. }
  17767. module.exports = {
  17768. isCTLExcludingHtab,
  17769. validateCookieName,
  17770. validateCookiePath,
  17771. validateCookieValue,
  17772. toIMFDate,
  17773. stringify
  17774. }
  17775. /***/ }),
  17776. /***/ 2067:
  17777. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  17778. "use strict";
  17779. const net = __nccwpck_require__(1808)
  17780. const assert = __nccwpck_require__(9491)
  17781. const util = __nccwpck_require__(3983)
  17782. const { InvalidArgumentError, ConnectTimeoutError } = __nccwpck_require__(8045)
  17783. let tls // include tls conditionally since it is not always available
  17784. // TODO: session re-use does not wait for the first
  17785. // connection to resolve the session and might therefore
  17786. // resolve the same servername multiple times even when
  17787. // re-use is enabled.
  17788. let SessionCache
  17789. // FIXME: remove workaround when the Node bug is fixed
  17790. // https://github.com/nodejs/node/issues/49344#issuecomment-1741776308
  17791. if (global.FinalizationRegistry && !process.env.NODE_V8_COVERAGE) {
  17792. SessionCache = class WeakSessionCache {
  17793. constructor (maxCachedSessions) {
  17794. this._maxCachedSessions = maxCachedSessions
  17795. this._sessionCache = new Map()
  17796. this._sessionRegistry = new global.FinalizationRegistry((key) => {
  17797. if (this._sessionCache.size < this._maxCachedSessions) {
  17798. return
  17799. }
  17800. const ref = this._sessionCache.get(key)
  17801. if (ref !== undefined && ref.deref() === undefined) {
  17802. this._sessionCache.delete(key)
  17803. }
  17804. })
  17805. }
  17806. get (sessionKey) {
  17807. const ref = this._sessionCache.get(sessionKey)
  17808. return ref ? ref.deref() : null
  17809. }
  17810. set (sessionKey, session) {
  17811. if (this._maxCachedSessions === 0) {
  17812. return
  17813. }
  17814. this._sessionCache.set(sessionKey, new WeakRef(session))
  17815. this._sessionRegistry.register(session, sessionKey)
  17816. }
  17817. }
  17818. } else {
  17819. SessionCache = class SimpleSessionCache {
  17820. constructor (maxCachedSessions) {
  17821. this._maxCachedSessions = maxCachedSessions
  17822. this._sessionCache = new Map()
  17823. }
  17824. get (sessionKey) {
  17825. return this._sessionCache.get(sessionKey)
  17826. }
  17827. set (sessionKey, session) {
  17828. if (this._maxCachedSessions === 0) {
  17829. return
  17830. }
  17831. if (this._sessionCache.size >= this._maxCachedSessions) {
  17832. // remove the oldest session
  17833. const { value: oldestKey } = this._sessionCache.keys().next()
  17834. this._sessionCache.delete(oldestKey)
  17835. }
  17836. this._sessionCache.set(sessionKey, session)
  17837. }
  17838. }
  17839. }
  17840. function buildConnector ({ allowH2, maxCachedSessions, socketPath, timeout, ...opts }) {
  17841. if (maxCachedSessions != null && (!Number.isInteger(maxCachedSessions) || maxCachedSessions < 0)) {
  17842. throw new InvalidArgumentError('maxCachedSessions must be a positive integer or zero')
  17843. }
  17844. const options = { path: socketPath, ...opts }
  17845. const sessionCache = new SessionCache(maxCachedSessions == null ? 100 : maxCachedSessions)
  17846. timeout = timeout == null ? 10e3 : timeout
  17847. allowH2 = allowH2 != null ? allowH2 : false
  17848. return function connect ({ hostname, host, protocol, port, servername, localAddress, httpSocket }, callback) {
  17849. let socket
  17850. if (protocol === 'https:') {
  17851. if (!tls) {
  17852. tls = __nccwpck_require__(4404)
  17853. }
  17854. servername = servername || options.servername || util.getServerName(host) || null
  17855. const sessionKey = servername || hostname
  17856. const session = sessionCache.get(sessionKey) || null
  17857. assert(sessionKey)
  17858. socket = tls.connect({
  17859. highWaterMark: 16384, // TLS in node can't have bigger HWM anyway...
  17860. ...options,
  17861. servername,
  17862. session,
  17863. localAddress,
  17864. // TODO(HTTP/2): Add support for h2c
  17865. ALPNProtocols: allowH2 ? ['http/1.1', 'h2'] : ['http/1.1'],
  17866. socket: httpSocket, // upgrade socket connection
  17867. port: port || 443,
  17868. host: hostname
  17869. })
  17870. socket
  17871. .on('session', function (session) {
  17872. // TODO (fix): Can a session become invalid once established? Don't think so?
  17873. sessionCache.set(sessionKey, session)
  17874. })
  17875. } else {
  17876. assert(!httpSocket, 'httpSocket can only be sent on TLS update')
  17877. socket = net.connect({
  17878. highWaterMark: 64 * 1024, // Same as nodejs fs streams.
  17879. ...options,
  17880. localAddress,
  17881. port: port || 80,
  17882. host: hostname
  17883. })
  17884. }
  17885. // Set TCP keep alive options on the socket here instead of in connect() for the case of assigning the socket
  17886. if (options.keepAlive == null || options.keepAlive) {
  17887. const keepAliveInitialDelay = options.keepAliveInitialDelay === undefined ? 60e3 : options.keepAliveInitialDelay
  17888. socket.setKeepAlive(true, keepAliveInitialDelay)
  17889. }
  17890. const cancelTimeout = setupTimeout(() => onConnectTimeout(socket), timeout)
  17891. socket
  17892. .setNoDelay(true)
  17893. .once(protocol === 'https:' ? 'secureConnect' : 'connect', function () {
  17894. cancelTimeout()
  17895. if (callback) {
  17896. const cb = callback
  17897. callback = null
  17898. cb(null, this)
  17899. }
  17900. })
  17901. .on('error', function (err) {
  17902. cancelTimeout()
  17903. if (callback) {
  17904. const cb = callback
  17905. callback = null
  17906. cb(err)
  17907. }
  17908. })
  17909. return socket
  17910. }
  17911. }
  17912. function setupTimeout (onConnectTimeout, timeout) {
  17913. if (!timeout) {
  17914. return () => {}
  17915. }
  17916. let s1 = null
  17917. let s2 = null
  17918. const timeoutId = setTimeout(() => {
  17919. // setImmediate is added to make sure that we priotorise socket error events over timeouts
  17920. s1 = setImmediate(() => {
  17921. if (process.platform === 'win32') {
  17922. // Windows needs an extra setImmediate probably due to implementation differences in the socket logic
  17923. s2 = setImmediate(() => onConnectTimeout())
  17924. } else {
  17925. onConnectTimeout()
  17926. }
  17927. })
  17928. }, timeout)
  17929. return () => {
  17930. clearTimeout(timeoutId)
  17931. clearImmediate(s1)
  17932. clearImmediate(s2)
  17933. }
  17934. }
  17935. function onConnectTimeout (socket) {
  17936. util.destroy(socket, new ConnectTimeoutError())
  17937. }
  17938. module.exports = buildConnector
  17939. /***/ }),
  17940. /***/ 4462:
  17941. /***/ ((module) => {
  17942. "use strict";
  17943. /** @type {Record<string, string | undefined>} */
  17944. const headerNameLowerCasedRecord = {}
  17945. // https://developer.mozilla.org/docs/Web/HTTP/Headers
  17946. const wellknownHeaderNames = [
  17947. 'Accept',
  17948. 'Accept-Encoding',
  17949. 'Accept-Language',
  17950. 'Accept-Ranges',
  17951. 'Access-Control-Allow-Credentials',
  17952. 'Access-Control-Allow-Headers',
  17953. 'Access-Control-Allow-Methods',
  17954. 'Access-Control-Allow-Origin',
  17955. 'Access-Control-Expose-Headers',
  17956. 'Access-Control-Max-Age',
  17957. 'Access-Control-Request-Headers',
  17958. 'Access-Control-Request-Method',
  17959. 'Age',
  17960. 'Allow',
  17961. 'Alt-Svc',
  17962. 'Alt-Used',
  17963. 'Authorization',
  17964. 'Cache-Control',
  17965. 'Clear-Site-Data',
  17966. 'Connection',
  17967. 'Content-Disposition',
  17968. 'Content-Encoding',
  17969. 'Content-Language',
  17970. 'Content-Length',
  17971. 'Content-Location',
  17972. 'Content-Range',
  17973. 'Content-Security-Policy',
  17974. 'Content-Security-Policy-Report-Only',
  17975. 'Content-Type',
  17976. 'Cookie',
  17977. 'Cross-Origin-Embedder-Policy',
  17978. 'Cross-Origin-Opener-Policy',
  17979. 'Cross-Origin-Resource-Policy',
  17980. 'Date',
  17981. 'Device-Memory',
  17982. 'Downlink',
  17983. 'ECT',
  17984. 'ETag',
  17985. 'Expect',
  17986. 'Expect-CT',
  17987. 'Expires',
  17988. 'Forwarded',
  17989. 'From',
  17990. 'Host',
  17991. 'If-Match',
  17992. 'If-Modified-Since',
  17993. 'If-None-Match',
  17994. 'If-Range',
  17995. 'If-Unmodified-Since',
  17996. 'Keep-Alive',
  17997. 'Last-Modified',
  17998. 'Link',
  17999. 'Location',
  18000. 'Max-Forwards',
  18001. 'Origin',
  18002. 'Permissions-Policy',
  18003. 'Pragma',
  18004. 'Proxy-Authenticate',
  18005. 'Proxy-Authorization',
  18006. 'RTT',
  18007. 'Range',
  18008. 'Referer',
  18009. 'Referrer-Policy',
  18010. 'Refresh',
  18011. 'Retry-After',
  18012. 'Sec-WebSocket-Accept',
  18013. 'Sec-WebSocket-Extensions',
  18014. 'Sec-WebSocket-Key',
  18015. 'Sec-WebSocket-Protocol',
  18016. 'Sec-WebSocket-Version',
  18017. 'Server',
  18018. 'Server-Timing',
  18019. 'Service-Worker-Allowed',
  18020. 'Service-Worker-Navigation-Preload',
  18021. 'Set-Cookie',
  18022. 'SourceMap',
  18023. 'Strict-Transport-Security',
  18024. 'Supports-Loading-Mode',
  18025. 'TE',
  18026. 'Timing-Allow-Origin',
  18027. 'Trailer',
  18028. 'Transfer-Encoding',
  18029. 'Upgrade',
  18030. 'Upgrade-Insecure-Requests',
  18031. 'User-Agent',
  18032. 'Vary',
  18033. 'Via',
  18034. 'WWW-Authenticate',
  18035. 'X-Content-Type-Options',
  18036. 'X-DNS-Prefetch-Control',
  18037. 'X-Frame-Options',
  18038. 'X-Permitted-Cross-Domain-Policies',
  18039. 'X-Powered-By',
  18040. 'X-Requested-With',
  18041. 'X-XSS-Protection'
  18042. ]
  18043. for (let i = 0; i < wellknownHeaderNames.length; ++i) {
  18044. const key = wellknownHeaderNames[i]
  18045. const lowerCasedKey = key.toLowerCase()
  18046. headerNameLowerCasedRecord[key] = headerNameLowerCasedRecord[lowerCasedKey] =
  18047. lowerCasedKey
  18048. }
  18049. // Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`.
  18050. Object.setPrototypeOf(headerNameLowerCasedRecord, null)
  18051. module.exports = {
  18052. wellknownHeaderNames,
  18053. headerNameLowerCasedRecord
  18054. }
  18055. /***/ }),
  18056. /***/ 8045:
  18057. /***/ ((module) => {
  18058. "use strict";
  18059. class UndiciError extends Error {
  18060. constructor (message) {
  18061. super(message)
  18062. this.name = 'UndiciError'
  18063. this.code = 'UND_ERR'
  18064. }
  18065. }
  18066. class ConnectTimeoutError extends UndiciError {
  18067. constructor (message) {
  18068. super(message)
  18069. Error.captureStackTrace(this, ConnectTimeoutError)
  18070. this.name = 'ConnectTimeoutError'
  18071. this.message = message || 'Connect Timeout Error'
  18072. this.code = 'UND_ERR_CONNECT_TIMEOUT'
  18073. }
  18074. }
  18075. class HeadersTimeoutError extends UndiciError {
  18076. constructor (message) {
  18077. super(message)
  18078. Error.captureStackTrace(this, HeadersTimeoutError)
  18079. this.name = 'HeadersTimeoutError'
  18080. this.message = message || 'Headers Timeout Error'
  18081. this.code = 'UND_ERR_HEADERS_TIMEOUT'
  18082. }
  18083. }
  18084. class HeadersOverflowError extends UndiciError {
  18085. constructor (message) {
  18086. super(message)
  18087. Error.captureStackTrace(this, HeadersOverflowError)
  18088. this.name = 'HeadersOverflowError'
  18089. this.message = message || 'Headers Overflow Error'
  18090. this.code = 'UND_ERR_HEADERS_OVERFLOW'
  18091. }
  18092. }
  18093. class BodyTimeoutError extends UndiciError {
  18094. constructor (message) {
  18095. super(message)
  18096. Error.captureStackTrace(this, BodyTimeoutError)
  18097. this.name = 'BodyTimeoutError'
  18098. this.message = message || 'Body Timeout Error'
  18099. this.code = 'UND_ERR_BODY_TIMEOUT'
  18100. }
  18101. }
  18102. class ResponseStatusCodeError extends UndiciError {
  18103. constructor (message, statusCode, headers, body) {
  18104. super(message)
  18105. Error.captureStackTrace(this, ResponseStatusCodeError)
  18106. this.name = 'ResponseStatusCodeError'
  18107. this.message = message || 'Response Status Code Error'
  18108. this.code = 'UND_ERR_RESPONSE_STATUS_CODE'
  18109. this.body = body
  18110. this.status = statusCode
  18111. this.statusCode = statusCode
  18112. this.headers = headers
  18113. }
  18114. }
  18115. class InvalidArgumentError extends UndiciError {
  18116. constructor (message) {
  18117. super(message)
  18118. Error.captureStackTrace(this, InvalidArgumentError)
  18119. this.name = 'InvalidArgumentError'
  18120. this.message = message || 'Invalid Argument Error'
  18121. this.code = 'UND_ERR_INVALID_ARG'
  18122. }
  18123. }
  18124. class InvalidReturnValueError extends UndiciError {
  18125. constructor (message) {
  18126. super(message)
  18127. Error.captureStackTrace(this, InvalidReturnValueError)
  18128. this.name = 'InvalidReturnValueError'
  18129. this.message = message || 'Invalid Return Value Error'
  18130. this.code = 'UND_ERR_INVALID_RETURN_VALUE'
  18131. }
  18132. }
  18133. class RequestAbortedError extends UndiciError {
  18134. constructor (message) {
  18135. super(message)
  18136. Error.captureStackTrace(this, RequestAbortedError)
  18137. this.name = 'AbortError'
  18138. this.message = message || 'Request aborted'
  18139. this.code = 'UND_ERR_ABORTED'
  18140. }
  18141. }
  18142. class InformationalError extends UndiciError {
  18143. constructor (message) {
  18144. super(message)
  18145. Error.captureStackTrace(this, InformationalError)
  18146. this.name = 'InformationalError'
  18147. this.message = message || 'Request information'
  18148. this.code = 'UND_ERR_INFO'
  18149. }
  18150. }
  18151. class RequestContentLengthMismatchError extends UndiciError {
  18152. constructor (message) {
  18153. super(message)
  18154. Error.captureStackTrace(this, RequestContentLengthMismatchError)
  18155. this.name = 'RequestContentLengthMismatchError'
  18156. this.message = message || 'Request body length does not match content-length header'
  18157. this.code = 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH'
  18158. }
  18159. }
  18160. class ResponseContentLengthMismatchError extends UndiciError {
  18161. constructor (message) {
  18162. super(message)
  18163. Error.captureStackTrace(this, ResponseContentLengthMismatchError)
  18164. this.name = 'ResponseContentLengthMismatchError'
  18165. this.message = message || 'Response body length does not match content-length header'
  18166. this.code = 'UND_ERR_RES_CONTENT_LENGTH_MISMATCH'
  18167. }
  18168. }
  18169. class ClientDestroyedError extends UndiciError {
  18170. constructor (message) {
  18171. super(message)
  18172. Error.captureStackTrace(this, ClientDestroyedError)
  18173. this.name = 'ClientDestroyedError'
  18174. this.message = message || 'The client is destroyed'
  18175. this.code = 'UND_ERR_DESTROYED'
  18176. }
  18177. }
  18178. class ClientClosedError extends UndiciError {
  18179. constructor (message) {
  18180. super(message)
  18181. Error.captureStackTrace(this, ClientClosedError)
  18182. this.name = 'ClientClosedError'
  18183. this.message = message || 'The client is closed'
  18184. this.code = 'UND_ERR_CLOSED'
  18185. }
  18186. }
  18187. class SocketError extends UndiciError {
  18188. constructor (message, socket) {
  18189. super(message)
  18190. Error.captureStackTrace(this, SocketError)
  18191. this.name = 'SocketError'
  18192. this.message = message || 'Socket error'
  18193. this.code = 'UND_ERR_SOCKET'
  18194. this.socket = socket
  18195. }
  18196. }
  18197. class NotSupportedError extends UndiciError {
  18198. constructor (message) {
  18199. super(message)
  18200. Error.captureStackTrace(this, NotSupportedError)
  18201. this.name = 'NotSupportedError'
  18202. this.message = message || 'Not supported error'
  18203. this.code = 'UND_ERR_NOT_SUPPORTED'
  18204. }
  18205. }
  18206. class BalancedPoolMissingUpstreamError extends UndiciError {
  18207. constructor (message) {
  18208. super(message)
  18209. Error.captureStackTrace(this, NotSupportedError)
  18210. this.name = 'MissingUpstreamError'
  18211. this.message = message || 'No upstream has been added to the BalancedPool'
  18212. this.code = 'UND_ERR_BPL_MISSING_UPSTREAM'
  18213. }
  18214. }
  18215. class HTTPParserError extends Error {
  18216. constructor (message, code, data) {
  18217. super(message)
  18218. Error.captureStackTrace(this, HTTPParserError)
  18219. this.name = 'HTTPParserError'
  18220. this.code = code ? `HPE_${code}` : undefined
  18221. this.data = data ? data.toString() : undefined
  18222. }
  18223. }
  18224. class ResponseExceededMaxSizeError extends UndiciError {
  18225. constructor (message) {
  18226. super(message)
  18227. Error.captureStackTrace(this, ResponseExceededMaxSizeError)
  18228. this.name = 'ResponseExceededMaxSizeError'
  18229. this.message = message || 'Response content exceeded max size'
  18230. this.code = 'UND_ERR_RES_EXCEEDED_MAX_SIZE'
  18231. }
  18232. }
  18233. class RequestRetryError extends UndiciError {
  18234. constructor (message, code, { headers, data }) {
  18235. super(message)
  18236. Error.captureStackTrace(this, RequestRetryError)
  18237. this.name = 'RequestRetryError'
  18238. this.message = message || 'Request retry error'
  18239. this.code = 'UND_ERR_REQ_RETRY'
  18240. this.statusCode = code
  18241. this.data = data
  18242. this.headers = headers
  18243. }
  18244. }
  18245. module.exports = {
  18246. HTTPParserError,
  18247. UndiciError,
  18248. HeadersTimeoutError,
  18249. HeadersOverflowError,
  18250. BodyTimeoutError,
  18251. RequestContentLengthMismatchError,
  18252. ConnectTimeoutError,
  18253. ResponseStatusCodeError,
  18254. InvalidArgumentError,
  18255. InvalidReturnValueError,
  18256. RequestAbortedError,
  18257. ClientDestroyedError,
  18258. ClientClosedError,
  18259. InformationalError,
  18260. SocketError,
  18261. NotSupportedError,
  18262. ResponseContentLengthMismatchError,
  18263. BalancedPoolMissingUpstreamError,
  18264. ResponseExceededMaxSizeError,
  18265. RequestRetryError
  18266. }
  18267. /***/ }),
  18268. /***/ 2905:
  18269. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  18270. "use strict";
  18271. const {
  18272. InvalidArgumentError,
  18273. NotSupportedError
  18274. } = __nccwpck_require__(8045)
  18275. const assert = __nccwpck_require__(9491)
  18276. const { kHTTP2BuildRequest, kHTTP2CopyHeaders, kHTTP1BuildRequest } = __nccwpck_require__(2785)
  18277. const util = __nccwpck_require__(3983)
  18278. // tokenRegExp and headerCharRegex have been lifted from
  18279. // https://github.com/nodejs/node/blob/main/lib/_http_common.js
  18280. /**
  18281. * Verifies that the given val is a valid HTTP token
  18282. * per the rules defined in RFC 7230
  18283. * See https://tools.ietf.org/html/rfc7230#section-3.2.6
  18284. */
  18285. const tokenRegExp = /^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/
  18286. /**
  18287. * Matches if val contains an invalid field-vchar
  18288. * field-value = *( field-content / obs-fold )
  18289. * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]
  18290. * field-vchar = VCHAR / obs-text
  18291. */
  18292. const headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/
  18293. // Verifies that a given path is valid does not contain control chars \x00 to \x20
  18294. const invalidPathRegex = /[^\u0021-\u00ff]/
  18295. const kHandler = Symbol('handler')
  18296. const channels = {}
  18297. let extractBody
  18298. try {
  18299. const diagnosticsChannel = __nccwpck_require__(7643)
  18300. channels.create = diagnosticsChannel.channel('undici:request:create')
  18301. channels.bodySent = diagnosticsChannel.channel('undici:request:bodySent')
  18302. channels.headers = diagnosticsChannel.channel('undici:request:headers')
  18303. channels.trailers = diagnosticsChannel.channel('undici:request:trailers')
  18304. channels.error = diagnosticsChannel.channel('undici:request:error')
  18305. } catch {
  18306. channels.create = { hasSubscribers: false }
  18307. channels.bodySent = { hasSubscribers: false }
  18308. channels.headers = { hasSubscribers: false }
  18309. channels.trailers = { hasSubscribers: false }
  18310. channels.error = { hasSubscribers: false }
  18311. }
  18312. class Request {
  18313. constructor (origin, {
  18314. path,
  18315. method,
  18316. body,
  18317. headers,
  18318. query,
  18319. idempotent,
  18320. blocking,
  18321. upgrade,
  18322. headersTimeout,
  18323. bodyTimeout,
  18324. reset,
  18325. throwOnError,
  18326. expectContinue
  18327. }, handler) {
  18328. if (typeof path !== 'string') {
  18329. throw new InvalidArgumentError('path must be a string')
  18330. } else if (
  18331. path[0] !== '/' &&
  18332. !(path.startsWith('http://') || path.startsWith('https://')) &&
  18333. method !== 'CONNECT'
  18334. ) {
  18335. throw new InvalidArgumentError('path must be an absolute URL or start with a slash')
  18336. } else if (invalidPathRegex.exec(path) !== null) {
  18337. throw new InvalidArgumentError('invalid request path')
  18338. }
  18339. if (typeof method !== 'string') {
  18340. throw new InvalidArgumentError('method must be a string')
  18341. } else if (tokenRegExp.exec(method) === null) {
  18342. throw new InvalidArgumentError('invalid request method')
  18343. }
  18344. if (upgrade && typeof upgrade !== 'string') {
  18345. throw new InvalidArgumentError('upgrade must be a string')
  18346. }
  18347. if (headersTimeout != null && (!Number.isFinite(headersTimeout) || headersTimeout < 0)) {
  18348. throw new InvalidArgumentError('invalid headersTimeout')
  18349. }
  18350. if (bodyTimeout != null && (!Number.isFinite(bodyTimeout) || bodyTimeout < 0)) {
  18351. throw new InvalidArgumentError('invalid bodyTimeout')
  18352. }
  18353. if (reset != null && typeof reset !== 'boolean') {
  18354. throw new InvalidArgumentError('invalid reset')
  18355. }
  18356. if (expectContinue != null && typeof expectContinue !== 'boolean') {
  18357. throw new InvalidArgumentError('invalid expectContinue')
  18358. }
  18359. this.headersTimeout = headersTimeout
  18360. this.bodyTimeout = bodyTimeout
  18361. this.throwOnError = throwOnError === true
  18362. this.method = method
  18363. this.abort = null
  18364. if (body == null) {
  18365. this.body = null
  18366. } else if (util.isStream(body)) {
  18367. this.body = body
  18368. const rState = this.body._readableState
  18369. if (!rState || !rState.autoDestroy) {
  18370. this.endHandler = function autoDestroy () {
  18371. util.destroy(this)
  18372. }
  18373. this.body.on('end', this.endHandler)
  18374. }
  18375. this.errorHandler = err => {
  18376. if (this.abort) {
  18377. this.abort(err)
  18378. } else {
  18379. this.error = err
  18380. }
  18381. }
  18382. this.body.on('error', this.errorHandler)
  18383. } else if (util.isBuffer(body)) {
  18384. this.body = body.byteLength ? body : null
  18385. } else if (ArrayBuffer.isView(body)) {
  18386. this.body = body.buffer.byteLength ? Buffer.from(body.buffer, body.byteOffset, body.byteLength) : null
  18387. } else if (body instanceof ArrayBuffer) {
  18388. this.body = body.byteLength ? Buffer.from(body) : null
  18389. } else if (typeof body === 'string') {
  18390. this.body = body.length ? Buffer.from(body) : null
  18391. } else if (util.isFormDataLike(body) || util.isIterable(body) || util.isBlobLike(body)) {
  18392. this.body = body
  18393. } else {
  18394. throw new InvalidArgumentError('body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable')
  18395. }
  18396. this.completed = false
  18397. this.aborted = false
  18398. this.upgrade = upgrade || null
  18399. this.path = query ? util.buildURL(path, query) : path
  18400. this.origin = origin
  18401. this.idempotent = idempotent == null
  18402. ? method === 'HEAD' || method === 'GET'
  18403. : idempotent
  18404. this.blocking = blocking == null ? false : blocking
  18405. this.reset = reset == null ? null : reset
  18406. this.host = null
  18407. this.contentLength = null
  18408. this.contentType = null
  18409. this.headers = ''
  18410. // Only for H2
  18411. this.expectContinue = expectContinue != null ? expectContinue : false
  18412. if (Array.isArray(headers)) {
  18413. if (headers.length % 2 !== 0) {
  18414. throw new InvalidArgumentError('headers array must be even')
  18415. }
  18416. for (let i = 0; i < headers.length; i += 2) {
  18417. processHeader(this, headers[i], headers[i + 1])
  18418. }
  18419. } else if (headers && typeof headers === 'object') {
  18420. const keys = Object.keys(headers)
  18421. for (let i = 0; i < keys.length; i++) {
  18422. const key = keys[i]
  18423. processHeader(this, key, headers[key])
  18424. }
  18425. } else if (headers != null) {
  18426. throw new InvalidArgumentError('headers must be an object or an array')
  18427. }
  18428. if (util.isFormDataLike(this.body)) {
  18429. if (util.nodeMajor < 16 || (util.nodeMajor === 16 && util.nodeMinor < 8)) {
  18430. throw new InvalidArgumentError('Form-Data bodies are only supported in node v16.8 and newer.')
  18431. }
  18432. if (!extractBody) {
  18433. extractBody = (__nccwpck_require__(9990).extractBody)
  18434. }
  18435. const [bodyStream, contentType] = extractBody(body)
  18436. if (this.contentType == null) {
  18437. this.contentType = contentType
  18438. this.headers += `content-type: ${contentType}\r\n`
  18439. }
  18440. this.body = bodyStream.stream
  18441. this.contentLength = bodyStream.length
  18442. } else if (util.isBlobLike(body) && this.contentType == null && body.type) {
  18443. this.contentType = body.type
  18444. this.headers += `content-type: ${body.type}\r\n`
  18445. }
  18446. util.validateHandler(handler, method, upgrade)
  18447. this.servername = util.getServerName(this.host)
  18448. this[kHandler] = handler
  18449. if (channels.create.hasSubscribers) {
  18450. channels.create.publish({ request: this })
  18451. }
  18452. }
  18453. onBodySent (chunk) {
  18454. if (this[kHandler].onBodySent) {
  18455. try {
  18456. return this[kHandler].onBodySent(chunk)
  18457. } catch (err) {
  18458. this.abort(err)
  18459. }
  18460. }
  18461. }
  18462. onRequestSent () {
  18463. if (channels.bodySent.hasSubscribers) {
  18464. channels.bodySent.publish({ request: this })
  18465. }
  18466. if (this[kHandler].onRequestSent) {
  18467. try {
  18468. return this[kHandler].onRequestSent()
  18469. } catch (err) {
  18470. this.abort(err)
  18471. }
  18472. }
  18473. }
  18474. onConnect (abort) {
  18475. assert(!this.aborted)
  18476. assert(!this.completed)
  18477. if (this.error) {
  18478. abort(this.error)
  18479. } else {
  18480. this.abort = abort
  18481. return this[kHandler].onConnect(abort)
  18482. }
  18483. }
  18484. onHeaders (statusCode, headers, resume, statusText) {
  18485. assert(!this.aborted)
  18486. assert(!this.completed)
  18487. if (channels.headers.hasSubscribers) {
  18488. channels.headers.publish({ request: this, response: { statusCode, headers, statusText } })
  18489. }
  18490. try {
  18491. return this[kHandler].onHeaders(statusCode, headers, resume, statusText)
  18492. } catch (err) {
  18493. this.abort(err)
  18494. }
  18495. }
  18496. onData (chunk) {
  18497. assert(!this.aborted)
  18498. assert(!this.completed)
  18499. try {
  18500. return this[kHandler].onData(chunk)
  18501. } catch (err) {
  18502. this.abort(err)
  18503. return false
  18504. }
  18505. }
  18506. onUpgrade (statusCode, headers, socket) {
  18507. assert(!this.aborted)
  18508. assert(!this.completed)
  18509. return this[kHandler].onUpgrade(statusCode, headers, socket)
  18510. }
  18511. onComplete (trailers) {
  18512. this.onFinally()
  18513. assert(!this.aborted)
  18514. this.completed = true
  18515. if (channels.trailers.hasSubscribers) {
  18516. channels.trailers.publish({ request: this, trailers })
  18517. }
  18518. try {
  18519. return this[kHandler].onComplete(trailers)
  18520. } catch (err) {
  18521. // TODO (fix): This might be a bad idea?
  18522. this.onError(err)
  18523. }
  18524. }
  18525. onError (error) {
  18526. this.onFinally()
  18527. if (channels.error.hasSubscribers) {
  18528. channels.error.publish({ request: this, error })
  18529. }
  18530. if (this.aborted) {
  18531. return
  18532. }
  18533. this.aborted = true
  18534. return this[kHandler].onError(error)
  18535. }
  18536. onFinally () {
  18537. if (this.errorHandler) {
  18538. this.body.off('error', this.errorHandler)
  18539. this.errorHandler = null
  18540. }
  18541. if (this.endHandler) {
  18542. this.body.off('end', this.endHandler)
  18543. this.endHandler = null
  18544. }
  18545. }
  18546. // TODO: adjust to support H2
  18547. addHeader (key, value) {
  18548. processHeader(this, key, value)
  18549. return this
  18550. }
  18551. static [kHTTP1BuildRequest] (origin, opts, handler) {
  18552. // TODO: Migrate header parsing here, to make Requests
  18553. // HTTP agnostic
  18554. return new Request(origin, opts, handler)
  18555. }
  18556. static [kHTTP2BuildRequest] (origin, opts, handler) {
  18557. const headers = opts.headers
  18558. opts = { ...opts, headers: null }
  18559. const request = new Request(origin, opts, handler)
  18560. request.headers = {}
  18561. if (Array.isArray(headers)) {
  18562. if (headers.length % 2 !== 0) {
  18563. throw new InvalidArgumentError('headers array must be even')
  18564. }
  18565. for (let i = 0; i < headers.length; i += 2) {
  18566. processHeader(request, headers[i], headers[i + 1], true)
  18567. }
  18568. } else if (headers && typeof headers === 'object') {
  18569. const keys = Object.keys(headers)
  18570. for (let i = 0; i < keys.length; i++) {
  18571. const key = keys[i]
  18572. processHeader(request, key, headers[key], true)
  18573. }
  18574. } else if (headers != null) {
  18575. throw new InvalidArgumentError('headers must be an object or an array')
  18576. }
  18577. return request
  18578. }
  18579. static [kHTTP2CopyHeaders] (raw) {
  18580. const rawHeaders = raw.split('\r\n')
  18581. const headers = {}
  18582. for (const header of rawHeaders) {
  18583. const [key, value] = header.split(': ')
  18584. if (value == null || value.length === 0) continue
  18585. if (headers[key]) headers[key] += `,${value}`
  18586. else headers[key] = value
  18587. }
  18588. return headers
  18589. }
  18590. }
  18591. function processHeaderValue (key, val, skipAppend) {
  18592. if (val && typeof val === 'object') {
  18593. throw new InvalidArgumentError(`invalid ${key} header`)
  18594. }
  18595. val = val != null ? `${val}` : ''
  18596. if (headerCharRegex.exec(val) !== null) {
  18597. throw new InvalidArgumentError(`invalid ${key} header`)
  18598. }
  18599. return skipAppend ? val : `${key}: ${val}\r\n`
  18600. }
  18601. function processHeader (request, key, val, skipAppend = false) {
  18602. if (val && (typeof val === 'object' && !Array.isArray(val))) {
  18603. throw new InvalidArgumentError(`invalid ${key} header`)
  18604. } else if (val === undefined) {
  18605. return
  18606. }
  18607. if (
  18608. request.host === null &&
  18609. key.length === 4 &&
  18610. key.toLowerCase() === 'host'
  18611. ) {
  18612. if (headerCharRegex.exec(val) !== null) {
  18613. throw new InvalidArgumentError(`invalid ${key} header`)
  18614. }
  18615. // Consumed by Client
  18616. request.host = val
  18617. } else if (
  18618. request.contentLength === null &&
  18619. key.length === 14 &&
  18620. key.toLowerCase() === 'content-length'
  18621. ) {
  18622. request.contentLength = parseInt(val, 10)
  18623. if (!Number.isFinite(request.contentLength)) {
  18624. throw new InvalidArgumentError('invalid content-length header')
  18625. }
  18626. } else if (
  18627. request.contentType === null &&
  18628. key.length === 12 &&
  18629. key.toLowerCase() === 'content-type'
  18630. ) {
  18631. request.contentType = val
  18632. if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend)
  18633. else request.headers += processHeaderValue(key, val)
  18634. } else if (
  18635. key.length === 17 &&
  18636. key.toLowerCase() === 'transfer-encoding'
  18637. ) {
  18638. throw new InvalidArgumentError('invalid transfer-encoding header')
  18639. } else if (
  18640. key.length === 10 &&
  18641. key.toLowerCase() === 'connection'
  18642. ) {
  18643. const value = typeof val === 'string' ? val.toLowerCase() : null
  18644. if (value !== 'close' && value !== 'keep-alive') {
  18645. throw new InvalidArgumentError('invalid connection header')
  18646. } else if (value === 'close') {
  18647. request.reset = true
  18648. }
  18649. } else if (
  18650. key.length === 10 &&
  18651. key.toLowerCase() === 'keep-alive'
  18652. ) {
  18653. throw new InvalidArgumentError('invalid keep-alive header')
  18654. } else if (
  18655. key.length === 7 &&
  18656. key.toLowerCase() === 'upgrade'
  18657. ) {
  18658. throw new InvalidArgumentError('invalid upgrade header')
  18659. } else if (
  18660. key.length === 6 &&
  18661. key.toLowerCase() === 'expect'
  18662. ) {
  18663. throw new NotSupportedError('expect header not supported')
  18664. } else if (tokenRegExp.exec(key) === null) {
  18665. throw new InvalidArgumentError('invalid header key')
  18666. } else {
  18667. if (Array.isArray(val)) {
  18668. for (let i = 0; i < val.length; i++) {
  18669. if (skipAppend) {
  18670. if (request.headers[key]) request.headers[key] += `,${processHeaderValue(key, val[i], skipAppend)}`
  18671. else request.headers[key] = processHeaderValue(key, val[i], skipAppend)
  18672. } else {
  18673. request.headers += processHeaderValue(key, val[i])
  18674. }
  18675. }
  18676. } else {
  18677. if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend)
  18678. else request.headers += processHeaderValue(key, val)
  18679. }
  18680. }
  18681. }
  18682. module.exports = Request
  18683. /***/ }),
  18684. /***/ 2785:
  18685. /***/ ((module) => {
  18686. module.exports = {
  18687. kClose: Symbol('close'),
  18688. kDestroy: Symbol('destroy'),
  18689. kDispatch: Symbol('dispatch'),
  18690. kUrl: Symbol('url'),
  18691. kWriting: Symbol('writing'),
  18692. kResuming: Symbol('resuming'),
  18693. kQueue: Symbol('queue'),
  18694. kConnect: Symbol('connect'),
  18695. kConnecting: Symbol('connecting'),
  18696. kHeadersList: Symbol('headers list'),
  18697. kKeepAliveDefaultTimeout: Symbol('default keep alive timeout'),
  18698. kKeepAliveMaxTimeout: Symbol('max keep alive timeout'),
  18699. kKeepAliveTimeoutThreshold: Symbol('keep alive timeout threshold'),
  18700. kKeepAliveTimeoutValue: Symbol('keep alive timeout'),
  18701. kKeepAlive: Symbol('keep alive'),
  18702. kHeadersTimeout: Symbol('headers timeout'),
  18703. kBodyTimeout: Symbol('body timeout'),
  18704. kServerName: Symbol('server name'),
  18705. kLocalAddress: Symbol('local address'),
  18706. kHost: Symbol('host'),
  18707. kNoRef: Symbol('no ref'),
  18708. kBodyUsed: Symbol('used'),
  18709. kRunning: Symbol('running'),
  18710. kBlocking: Symbol('blocking'),
  18711. kPending: Symbol('pending'),
  18712. kSize: Symbol('size'),
  18713. kBusy: Symbol('busy'),
  18714. kQueued: Symbol('queued'),
  18715. kFree: Symbol('free'),
  18716. kConnected: Symbol('connected'),
  18717. kClosed: Symbol('closed'),
  18718. kNeedDrain: Symbol('need drain'),
  18719. kReset: Symbol('reset'),
  18720. kDestroyed: Symbol.for('nodejs.stream.destroyed'),
  18721. kMaxHeadersSize: Symbol('max headers size'),
  18722. kRunningIdx: Symbol('running index'),
  18723. kPendingIdx: Symbol('pending index'),
  18724. kError: Symbol('error'),
  18725. kClients: Symbol('clients'),
  18726. kClient: Symbol('client'),
  18727. kParser: Symbol('parser'),
  18728. kOnDestroyed: Symbol('destroy callbacks'),
  18729. kPipelining: Symbol('pipelining'),
  18730. kSocket: Symbol('socket'),
  18731. kHostHeader: Symbol('host header'),
  18732. kConnector: Symbol('connector'),
  18733. kStrictContentLength: Symbol('strict content length'),
  18734. kMaxRedirections: Symbol('maxRedirections'),
  18735. kMaxRequests: Symbol('maxRequestsPerClient'),
  18736. kProxy: Symbol('proxy agent options'),
  18737. kCounter: Symbol('socket request counter'),
  18738. kInterceptors: Symbol('dispatch interceptors'),
  18739. kMaxResponseSize: Symbol('max response size'),
  18740. kHTTP2Session: Symbol('http2Session'),
  18741. kHTTP2SessionState: Symbol('http2Session state'),
  18742. kHTTP2BuildRequest: Symbol('http2 build request'),
  18743. kHTTP1BuildRequest: Symbol('http1 build request'),
  18744. kHTTP2CopyHeaders: Symbol('http2 copy headers'),
  18745. kHTTPConnVersion: Symbol('http connection version'),
  18746. kRetryHandlerDefaultRetry: Symbol('retry agent default retry'),
  18747. kConstruct: Symbol('constructable')
  18748. }
  18749. /***/ }),
  18750. /***/ 3983:
  18751. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  18752. "use strict";
  18753. const assert = __nccwpck_require__(9491)
  18754. const { kDestroyed, kBodyUsed } = __nccwpck_require__(2785)
  18755. const { IncomingMessage } = __nccwpck_require__(3685)
  18756. const stream = __nccwpck_require__(2781)
  18757. const net = __nccwpck_require__(1808)
  18758. const { InvalidArgumentError } = __nccwpck_require__(8045)
  18759. const { Blob } = __nccwpck_require__(4300)
  18760. const nodeUtil = __nccwpck_require__(3837)
  18761. const { stringify } = __nccwpck_require__(3477)
  18762. const { headerNameLowerCasedRecord } = __nccwpck_require__(4462)
  18763. const [nodeMajor, nodeMinor] = process.versions.node.split('.').map(v => Number(v))
  18764. function nop () {}
  18765. function isStream (obj) {
  18766. return obj && typeof obj === 'object' && typeof obj.pipe === 'function' && typeof obj.on === 'function'
  18767. }
  18768. // based on https://github.com/node-fetch/fetch-blob/blob/8ab587d34080de94140b54f07168451e7d0b655e/index.js#L229-L241 (MIT License)
  18769. function isBlobLike (object) {
  18770. return (Blob && object instanceof Blob) || (
  18771. object &&
  18772. typeof object === 'object' &&
  18773. (typeof object.stream === 'function' ||
  18774. typeof object.arrayBuffer === 'function') &&
  18775. /^(Blob|File)$/.test(object[Symbol.toStringTag])
  18776. )
  18777. }
  18778. function buildURL (url, queryParams) {
  18779. if (url.includes('?') || url.includes('#')) {
  18780. throw new Error('Query params cannot be passed when url already contains "?" or "#".')
  18781. }
  18782. const stringified = stringify(queryParams)
  18783. if (stringified) {
  18784. url += '?' + stringified
  18785. }
  18786. return url
  18787. }
  18788. function parseURL (url) {
  18789. if (typeof url === 'string') {
  18790. url = new URL(url)
  18791. if (!/^https?:/.test(url.origin || url.protocol)) {
  18792. throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')
  18793. }
  18794. return url
  18795. }
  18796. if (!url || typeof url !== 'object') {
  18797. throw new InvalidArgumentError('Invalid URL: The URL argument must be a non-null object.')
  18798. }
  18799. if (!/^https?:/.test(url.origin || url.protocol)) {
  18800. throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')
  18801. }
  18802. if (!(url instanceof URL)) {
  18803. if (url.port != null && url.port !== '' && !Number.isFinite(parseInt(url.port))) {
  18804. throw new InvalidArgumentError('Invalid URL: port must be a valid integer or a string representation of an integer.')
  18805. }
  18806. if (url.path != null && typeof url.path !== 'string') {
  18807. throw new InvalidArgumentError('Invalid URL path: the path must be a string or null/undefined.')
  18808. }
  18809. if (url.pathname != null && typeof url.pathname !== 'string') {
  18810. throw new InvalidArgumentError('Invalid URL pathname: the pathname must be a string or null/undefined.')
  18811. }
  18812. if (url.hostname != null && typeof url.hostname !== 'string') {
  18813. throw new InvalidArgumentError('Invalid URL hostname: the hostname must be a string or null/undefined.')
  18814. }
  18815. if (url.origin != null && typeof url.origin !== 'string') {
  18816. throw new InvalidArgumentError('Invalid URL origin: the origin must be a string or null/undefined.')
  18817. }
  18818. const port = url.port != null
  18819. ? url.port
  18820. : (url.protocol === 'https:' ? 443 : 80)
  18821. let origin = url.origin != null
  18822. ? url.origin
  18823. : `${url.protocol}//${url.hostname}:${port}`
  18824. let path = url.path != null
  18825. ? url.path
  18826. : `${url.pathname || ''}${url.search || ''}`
  18827. if (origin.endsWith('/')) {
  18828. origin = origin.substring(0, origin.length - 1)
  18829. }
  18830. if (path && !path.startsWith('/')) {
  18831. path = `/${path}`
  18832. }
  18833. // new URL(path, origin) is unsafe when `path` contains an absolute URL
  18834. // From https://developer.mozilla.org/en-US/docs/Web/API/URL/URL:
  18835. // If first parameter is a relative URL, second param is required, and will be used as the base URL.
  18836. // If first parameter is an absolute URL, a given second param will be ignored.
  18837. url = new URL(origin + path)
  18838. }
  18839. return url
  18840. }
  18841. function parseOrigin (url) {
  18842. url = parseURL(url)
  18843. if (url.pathname !== '/' || url.search || url.hash) {
  18844. throw new InvalidArgumentError('invalid url')
  18845. }
  18846. return url
  18847. }
  18848. function getHostname (host) {
  18849. if (host[0] === '[') {
  18850. const idx = host.indexOf(']')
  18851. assert(idx !== -1)
  18852. return host.substring(1, idx)
  18853. }
  18854. const idx = host.indexOf(':')
  18855. if (idx === -1) return host
  18856. return host.substring(0, idx)
  18857. }
  18858. // IP addresses are not valid server names per RFC6066
  18859. // > Currently, the only server names supported are DNS hostnames
  18860. function getServerName (host) {
  18861. if (!host) {
  18862. return null
  18863. }
  18864. assert.strictEqual(typeof host, 'string')
  18865. const servername = getHostname(host)
  18866. if (net.isIP(servername)) {
  18867. return ''
  18868. }
  18869. return servername
  18870. }
  18871. function deepClone (obj) {
  18872. return JSON.parse(JSON.stringify(obj))
  18873. }
  18874. function isAsyncIterable (obj) {
  18875. return !!(obj != null && typeof obj[Symbol.asyncIterator] === 'function')
  18876. }
  18877. function isIterable (obj) {
  18878. return !!(obj != null && (typeof obj[Symbol.iterator] === 'function' || typeof obj[Symbol.asyncIterator] === 'function'))
  18879. }
  18880. function bodyLength (body) {
  18881. if (body == null) {
  18882. return 0
  18883. } else if (isStream(body)) {
  18884. const state = body._readableState
  18885. return state && state.objectMode === false && state.ended === true && Number.isFinite(state.length)
  18886. ? state.length
  18887. : null
  18888. } else if (isBlobLike(body)) {
  18889. return body.size != null ? body.size : null
  18890. } else if (isBuffer(body)) {
  18891. return body.byteLength
  18892. }
  18893. return null
  18894. }
  18895. function isDestroyed (stream) {
  18896. return !stream || !!(stream.destroyed || stream[kDestroyed])
  18897. }
  18898. function isReadableAborted (stream) {
  18899. const state = stream && stream._readableState
  18900. return isDestroyed(stream) && state && !state.endEmitted
  18901. }
  18902. function destroy (stream, err) {
  18903. if (stream == null || !isStream(stream) || isDestroyed(stream)) {
  18904. return
  18905. }
  18906. if (typeof stream.destroy === 'function') {
  18907. if (Object.getPrototypeOf(stream).constructor === IncomingMessage) {
  18908. // See: https://github.com/nodejs/node/pull/38505/files
  18909. stream.socket = null
  18910. }
  18911. stream.destroy(err)
  18912. } else if (err) {
  18913. process.nextTick((stream, err) => {
  18914. stream.emit('error', err)
  18915. }, stream, err)
  18916. }
  18917. if (stream.destroyed !== true) {
  18918. stream[kDestroyed] = true
  18919. }
  18920. }
  18921. const KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/
  18922. function parseKeepAliveTimeout (val) {
  18923. const m = val.toString().match(KEEPALIVE_TIMEOUT_EXPR)
  18924. return m ? parseInt(m[1], 10) * 1000 : null
  18925. }
  18926. /**
  18927. * Retrieves a header name and returns its lowercase value.
  18928. * @param {string | Buffer} value Header name
  18929. * @returns {string}
  18930. */
  18931. function headerNameToString (value) {
  18932. return headerNameLowerCasedRecord[value] || value.toLowerCase()
  18933. }
  18934. function parseHeaders (headers, obj = {}) {
  18935. // For H2 support
  18936. if (!Array.isArray(headers)) return headers
  18937. for (let i = 0; i < headers.length; i += 2) {
  18938. const key = headers[i].toString().toLowerCase()
  18939. let val = obj[key]
  18940. if (!val) {
  18941. if (Array.isArray(headers[i + 1])) {
  18942. obj[key] = headers[i + 1].map(x => x.toString('utf8'))
  18943. } else {
  18944. obj[key] = headers[i + 1].toString('utf8')
  18945. }
  18946. } else {
  18947. if (!Array.isArray(val)) {
  18948. val = [val]
  18949. obj[key] = val
  18950. }
  18951. val.push(headers[i + 1].toString('utf8'))
  18952. }
  18953. }
  18954. // See https://github.com/nodejs/node/pull/46528
  18955. if ('content-length' in obj && 'content-disposition' in obj) {
  18956. obj['content-disposition'] = Buffer.from(obj['content-disposition']).toString('latin1')
  18957. }
  18958. return obj
  18959. }
  18960. function parseRawHeaders (headers) {
  18961. const ret = []
  18962. let hasContentLength = false
  18963. let contentDispositionIdx = -1
  18964. for (let n = 0; n < headers.length; n += 2) {
  18965. const key = headers[n + 0].toString()
  18966. const val = headers[n + 1].toString('utf8')
  18967. if (key.length === 14 && (key === 'content-length' || key.toLowerCase() === 'content-length')) {
  18968. ret.push(key, val)
  18969. hasContentLength = true
  18970. } else if (key.length === 19 && (key === 'content-disposition' || key.toLowerCase() === 'content-disposition')) {
  18971. contentDispositionIdx = ret.push(key, val) - 1
  18972. } else {
  18973. ret.push(key, val)
  18974. }
  18975. }
  18976. // See https://github.com/nodejs/node/pull/46528
  18977. if (hasContentLength && contentDispositionIdx !== -1) {
  18978. ret[contentDispositionIdx] = Buffer.from(ret[contentDispositionIdx]).toString('latin1')
  18979. }
  18980. return ret
  18981. }
  18982. function isBuffer (buffer) {
  18983. // See, https://github.com/mcollina/undici/pull/319
  18984. return buffer instanceof Uint8Array || Buffer.isBuffer(buffer)
  18985. }
  18986. function validateHandler (handler, method, upgrade) {
  18987. if (!handler || typeof handler !== 'object') {
  18988. throw new InvalidArgumentError('handler must be an object')
  18989. }
  18990. if (typeof handler.onConnect !== 'function') {
  18991. throw new InvalidArgumentError('invalid onConnect method')
  18992. }
  18993. if (typeof handler.onError !== 'function') {
  18994. throw new InvalidArgumentError('invalid onError method')
  18995. }
  18996. if (typeof handler.onBodySent !== 'function' && handler.onBodySent !== undefined) {
  18997. throw new InvalidArgumentError('invalid onBodySent method')
  18998. }
  18999. if (upgrade || method === 'CONNECT') {
  19000. if (typeof handler.onUpgrade !== 'function') {
  19001. throw new InvalidArgumentError('invalid onUpgrade method')
  19002. }
  19003. } else {
  19004. if (typeof handler.onHeaders !== 'function') {
  19005. throw new InvalidArgumentError('invalid onHeaders method')
  19006. }
  19007. if (typeof handler.onData !== 'function') {
  19008. throw new InvalidArgumentError('invalid onData method')
  19009. }
  19010. if (typeof handler.onComplete !== 'function') {
  19011. throw new InvalidArgumentError('invalid onComplete method')
  19012. }
  19013. }
  19014. }
  19015. // A body is disturbed if it has been read from and it cannot
  19016. // be re-used without losing state or data.
  19017. function isDisturbed (body) {
  19018. return !!(body && (
  19019. stream.isDisturbed
  19020. ? stream.isDisturbed(body) || body[kBodyUsed] // TODO (fix): Why is body[kBodyUsed] needed?
  19021. : body[kBodyUsed] ||
  19022. body.readableDidRead ||
  19023. (body._readableState && body._readableState.dataEmitted) ||
  19024. isReadableAborted(body)
  19025. ))
  19026. }
  19027. function isErrored (body) {
  19028. return !!(body && (
  19029. stream.isErrored
  19030. ? stream.isErrored(body)
  19031. : /state: 'errored'/.test(nodeUtil.inspect(body)
  19032. )))
  19033. }
  19034. function isReadable (body) {
  19035. return !!(body && (
  19036. stream.isReadable
  19037. ? stream.isReadable(body)
  19038. : /state: 'readable'/.test(nodeUtil.inspect(body)
  19039. )))
  19040. }
  19041. function getSocketInfo (socket) {
  19042. return {
  19043. localAddress: socket.localAddress,
  19044. localPort: socket.localPort,
  19045. remoteAddress: socket.remoteAddress,
  19046. remotePort: socket.remotePort,
  19047. remoteFamily: socket.remoteFamily,
  19048. timeout: socket.timeout,
  19049. bytesWritten: socket.bytesWritten,
  19050. bytesRead: socket.bytesRead
  19051. }
  19052. }
  19053. async function * convertIterableToBuffer (iterable) {
  19054. for await (const chunk of iterable) {
  19055. yield Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk)
  19056. }
  19057. }
  19058. let ReadableStream
  19059. function ReadableStreamFrom (iterable) {
  19060. if (!ReadableStream) {
  19061. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  19062. }
  19063. if (ReadableStream.from) {
  19064. return ReadableStream.from(convertIterableToBuffer(iterable))
  19065. }
  19066. let iterator
  19067. return new ReadableStream(
  19068. {
  19069. async start () {
  19070. iterator = iterable[Symbol.asyncIterator]()
  19071. },
  19072. async pull (controller) {
  19073. const { done, value } = await iterator.next()
  19074. if (done) {
  19075. queueMicrotask(() => {
  19076. controller.close()
  19077. })
  19078. } else {
  19079. const buf = Buffer.isBuffer(value) ? value : Buffer.from(value)
  19080. controller.enqueue(new Uint8Array(buf))
  19081. }
  19082. return controller.desiredSize > 0
  19083. },
  19084. async cancel (reason) {
  19085. await iterator.return()
  19086. }
  19087. },
  19088. 0
  19089. )
  19090. }
  19091. // The chunk should be a FormData instance and contains
  19092. // all the required methods.
  19093. function isFormDataLike (object) {
  19094. return (
  19095. object &&
  19096. typeof object === 'object' &&
  19097. typeof object.append === 'function' &&
  19098. typeof object.delete === 'function' &&
  19099. typeof object.get === 'function' &&
  19100. typeof object.getAll === 'function' &&
  19101. typeof object.has === 'function' &&
  19102. typeof object.set === 'function' &&
  19103. object[Symbol.toStringTag] === 'FormData'
  19104. )
  19105. }
  19106. function throwIfAborted (signal) {
  19107. if (!signal) { return }
  19108. if (typeof signal.throwIfAborted === 'function') {
  19109. signal.throwIfAborted()
  19110. } else {
  19111. if (signal.aborted) {
  19112. // DOMException not available < v17.0.0
  19113. const err = new Error('The operation was aborted')
  19114. err.name = 'AbortError'
  19115. throw err
  19116. }
  19117. }
  19118. }
  19119. function addAbortListener (signal, listener) {
  19120. if ('addEventListener' in signal) {
  19121. signal.addEventListener('abort', listener, { once: true })
  19122. return () => signal.removeEventListener('abort', listener)
  19123. }
  19124. signal.addListener('abort', listener)
  19125. return () => signal.removeListener('abort', listener)
  19126. }
  19127. const hasToWellFormed = !!String.prototype.toWellFormed
  19128. /**
  19129. * @param {string} val
  19130. */
  19131. function toUSVString (val) {
  19132. if (hasToWellFormed) {
  19133. return `${val}`.toWellFormed()
  19134. } else if (nodeUtil.toUSVString) {
  19135. return nodeUtil.toUSVString(val)
  19136. }
  19137. return `${val}`
  19138. }
  19139. // Parsed accordingly to RFC 9110
  19140. // https://www.rfc-editor.org/rfc/rfc9110#field.content-range
  19141. function parseRangeHeader (range) {
  19142. if (range == null || range === '') return { start: 0, end: null, size: null }
  19143. const m = range ? range.match(/^bytes (\d+)-(\d+)\/(\d+)?$/) : null
  19144. return m
  19145. ? {
  19146. start: parseInt(m[1]),
  19147. end: m[2] ? parseInt(m[2]) : null,
  19148. size: m[3] ? parseInt(m[3]) : null
  19149. }
  19150. : null
  19151. }
  19152. const kEnumerableProperty = Object.create(null)
  19153. kEnumerableProperty.enumerable = true
  19154. module.exports = {
  19155. kEnumerableProperty,
  19156. nop,
  19157. isDisturbed,
  19158. isErrored,
  19159. isReadable,
  19160. toUSVString,
  19161. isReadableAborted,
  19162. isBlobLike,
  19163. parseOrigin,
  19164. parseURL,
  19165. getServerName,
  19166. isStream,
  19167. isIterable,
  19168. isAsyncIterable,
  19169. isDestroyed,
  19170. headerNameToString,
  19171. parseRawHeaders,
  19172. parseHeaders,
  19173. parseKeepAliveTimeout,
  19174. destroy,
  19175. bodyLength,
  19176. deepClone,
  19177. ReadableStreamFrom,
  19178. isBuffer,
  19179. validateHandler,
  19180. getSocketInfo,
  19181. isFormDataLike,
  19182. buildURL,
  19183. throwIfAborted,
  19184. addAbortListener,
  19185. parseRangeHeader,
  19186. nodeMajor,
  19187. nodeMinor,
  19188. nodeHasAutoSelectFamily: nodeMajor > 18 || (nodeMajor === 18 && nodeMinor >= 13),
  19189. safeHTTPMethods: ['GET', 'HEAD', 'OPTIONS', 'TRACE']
  19190. }
  19191. /***/ }),
  19192. /***/ 4839:
  19193. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  19194. "use strict";
  19195. const Dispatcher = __nccwpck_require__(412)
  19196. const {
  19197. ClientDestroyedError,
  19198. ClientClosedError,
  19199. InvalidArgumentError
  19200. } = __nccwpck_require__(8045)
  19201. const { kDestroy, kClose, kDispatch, kInterceptors } = __nccwpck_require__(2785)
  19202. const kDestroyed = Symbol('destroyed')
  19203. const kClosed = Symbol('closed')
  19204. const kOnDestroyed = Symbol('onDestroyed')
  19205. const kOnClosed = Symbol('onClosed')
  19206. const kInterceptedDispatch = Symbol('Intercepted Dispatch')
  19207. class DispatcherBase extends Dispatcher {
  19208. constructor () {
  19209. super()
  19210. this[kDestroyed] = false
  19211. this[kOnDestroyed] = null
  19212. this[kClosed] = false
  19213. this[kOnClosed] = []
  19214. }
  19215. get destroyed () {
  19216. return this[kDestroyed]
  19217. }
  19218. get closed () {
  19219. return this[kClosed]
  19220. }
  19221. get interceptors () {
  19222. return this[kInterceptors]
  19223. }
  19224. set interceptors (newInterceptors) {
  19225. if (newInterceptors) {
  19226. for (let i = newInterceptors.length - 1; i >= 0; i--) {
  19227. const interceptor = this[kInterceptors][i]
  19228. if (typeof interceptor !== 'function') {
  19229. throw new InvalidArgumentError('interceptor must be an function')
  19230. }
  19231. }
  19232. }
  19233. this[kInterceptors] = newInterceptors
  19234. }
  19235. close (callback) {
  19236. if (callback === undefined) {
  19237. return new Promise((resolve, reject) => {
  19238. this.close((err, data) => {
  19239. return err ? reject(err) : resolve(data)
  19240. })
  19241. })
  19242. }
  19243. if (typeof callback !== 'function') {
  19244. throw new InvalidArgumentError('invalid callback')
  19245. }
  19246. if (this[kDestroyed]) {
  19247. queueMicrotask(() => callback(new ClientDestroyedError(), null))
  19248. return
  19249. }
  19250. if (this[kClosed]) {
  19251. if (this[kOnClosed]) {
  19252. this[kOnClosed].push(callback)
  19253. } else {
  19254. queueMicrotask(() => callback(null, null))
  19255. }
  19256. return
  19257. }
  19258. this[kClosed] = true
  19259. this[kOnClosed].push(callback)
  19260. const onClosed = () => {
  19261. const callbacks = this[kOnClosed]
  19262. this[kOnClosed] = null
  19263. for (let i = 0; i < callbacks.length; i++) {
  19264. callbacks[i](null, null)
  19265. }
  19266. }
  19267. // Should not error.
  19268. this[kClose]()
  19269. .then(() => this.destroy())
  19270. .then(() => {
  19271. queueMicrotask(onClosed)
  19272. })
  19273. }
  19274. destroy (err, callback) {
  19275. if (typeof err === 'function') {
  19276. callback = err
  19277. err = null
  19278. }
  19279. if (callback === undefined) {
  19280. return new Promise((resolve, reject) => {
  19281. this.destroy(err, (err, data) => {
  19282. return err ? /* istanbul ignore next: should never error */ reject(err) : resolve(data)
  19283. })
  19284. })
  19285. }
  19286. if (typeof callback !== 'function') {
  19287. throw new InvalidArgumentError('invalid callback')
  19288. }
  19289. if (this[kDestroyed]) {
  19290. if (this[kOnDestroyed]) {
  19291. this[kOnDestroyed].push(callback)
  19292. } else {
  19293. queueMicrotask(() => callback(null, null))
  19294. }
  19295. return
  19296. }
  19297. if (!err) {
  19298. err = new ClientDestroyedError()
  19299. }
  19300. this[kDestroyed] = true
  19301. this[kOnDestroyed] = this[kOnDestroyed] || []
  19302. this[kOnDestroyed].push(callback)
  19303. const onDestroyed = () => {
  19304. const callbacks = this[kOnDestroyed]
  19305. this[kOnDestroyed] = null
  19306. for (let i = 0; i < callbacks.length; i++) {
  19307. callbacks[i](null, null)
  19308. }
  19309. }
  19310. // Should not error.
  19311. this[kDestroy](err).then(() => {
  19312. queueMicrotask(onDestroyed)
  19313. })
  19314. }
  19315. [kInterceptedDispatch] (opts, handler) {
  19316. if (!this[kInterceptors] || this[kInterceptors].length === 0) {
  19317. this[kInterceptedDispatch] = this[kDispatch]
  19318. return this[kDispatch](opts, handler)
  19319. }
  19320. let dispatch = this[kDispatch].bind(this)
  19321. for (let i = this[kInterceptors].length - 1; i >= 0; i--) {
  19322. dispatch = this[kInterceptors][i](dispatch)
  19323. }
  19324. this[kInterceptedDispatch] = dispatch
  19325. return dispatch(opts, handler)
  19326. }
  19327. dispatch (opts, handler) {
  19328. if (!handler || typeof handler !== 'object') {
  19329. throw new InvalidArgumentError('handler must be an object')
  19330. }
  19331. try {
  19332. if (!opts || typeof opts !== 'object') {
  19333. throw new InvalidArgumentError('opts must be an object.')
  19334. }
  19335. if (this[kDestroyed] || this[kOnDestroyed]) {
  19336. throw new ClientDestroyedError()
  19337. }
  19338. if (this[kClosed]) {
  19339. throw new ClientClosedError()
  19340. }
  19341. return this[kInterceptedDispatch](opts, handler)
  19342. } catch (err) {
  19343. if (typeof handler.onError !== 'function') {
  19344. throw new InvalidArgumentError('invalid onError method')
  19345. }
  19346. handler.onError(err)
  19347. return false
  19348. }
  19349. }
  19350. }
  19351. module.exports = DispatcherBase
  19352. /***/ }),
  19353. /***/ 412:
  19354. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  19355. "use strict";
  19356. const EventEmitter = __nccwpck_require__(2361)
  19357. class Dispatcher extends EventEmitter {
  19358. dispatch () {
  19359. throw new Error('not implemented')
  19360. }
  19361. close () {
  19362. throw new Error('not implemented')
  19363. }
  19364. destroy () {
  19365. throw new Error('not implemented')
  19366. }
  19367. }
  19368. module.exports = Dispatcher
  19369. /***/ }),
  19370. /***/ 9990:
  19371. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  19372. "use strict";
  19373. const Busboy = __nccwpck_require__(727)
  19374. const util = __nccwpck_require__(3983)
  19375. const {
  19376. ReadableStreamFrom,
  19377. isBlobLike,
  19378. isReadableStreamLike,
  19379. readableStreamClose,
  19380. createDeferredPromise,
  19381. fullyReadBody
  19382. } = __nccwpck_require__(2538)
  19383. const { FormData } = __nccwpck_require__(2015)
  19384. const { kState } = __nccwpck_require__(5861)
  19385. const { webidl } = __nccwpck_require__(1744)
  19386. const { DOMException, structuredClone } = __nccwpck_require__(1037)
  19387. const { Blob, File: NativeFile } = __nccwpck_require__(4300)
  19388. const { kBodyUsed } = __nccwpck_require__(2785)
  19389. const assert = __nccwpck_require__(9491)
  19390. const { isErrored } = __nccwpck_require__(3983)
  19391. const { isUint8Array, isArrayBuffer } = __nccwpck_require__(9830)
  19392. const { File: UndiciFile } = __nccwpck_require__(8511)
  19393. const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(685)
  19394. let random
  19395. try {
  19396. const crypto = __nccwpck_require__(6005)
  19397. random = (max) => crypto.randomInt(0, max)
  19398. } catch {
  19399. random = (max) => Math.floor(Math.random(max))
  19400. }
  19401. let ReadableStream = globalThis.ReadableStream
  19402. /** @type {globalThis['File']} */
  19403. const File = NativeFile ?? UndiciFile
  19404. const textEncoder = new TextEncoder()
  19405. const textDecoder = new TextDecoder()
  19406. // https://fetch.spec.whatwg.org/#concept-bodyinit-extract
  19407. function extractBody (object, keepalive = false) {
  19408. if (!ReadableStream) {
  19409. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  19410. }
  19411. // 1. Let stream be null.
  19412. let stream = null
  19413. // 2. If object is a ReadableStream object, then set stream to object.
  19414. if (object instanceof ReadableStream) {
  19415. stream = object
  19416. } else if (isBlobLike(object)) {
  19417. // 3. Otherwise, if object is a Blob object, set stream to the
  19418. // result of running object’s get stream.
  19419. stream = object.stream()
  19420. } else {
  19421. // 4. Otherwise, set stream to a new ReadableStream object, and set
  19422. // up stream.
  19423. stream = new ReadableStream({
  19424. async pull (controller) {
  19425. controller.enqueue(
  19426. typeof source === 'string' ? textEncoder.encode(source) : source
  19427. )
  19428. queueMicrotask(() => readableStreamClose(controller))
  19429. },
  19430. start () {},
  19431. type: undefined
  19432. })
  19433. }
  19434. // 5. Assert: stream is a ReadableStream object.
  19435. assert(isReadableStreamLike(stream))
  19436. // 6. Let action be null.
  19437. let action = null
  19438. // 7. Let source be null.
  19439. let source = null
  19440. // 8. Let length be null.
  19441. let length = null
  19442. // 9. Let type be null.
  19443. let type = null
  19444. // 10. Switch on object:
  19445. if (typeof object === 'string') {
  19446. // Set source to the UTF-8 encoding of object.
  19447. // Note: setting source to a Uint8Array here breaks some mocking assumptions.
  19448. source = object
  19449. // Set type to `text/plain;charset=UTF-8`.
  19450. type = 'text/plain;charset=UTF-8'
  19451. } else if (object instanceof URLSearchParams) {
  19452. // URLSearchParams
  19453. // spec says to run application/x-www-form-urlencoded on body.list
  19454. // this is implemented in Node.js as apart of an URLSearchParams instance toString method
  19455. // See: https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/lib/internal/url.js#L490
  19456. // and https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/lib/internal/url.js#L1100
  19457. // Set source to the result of running the application/x-www-form-urlencoded serializer with object’s list.
  19458. source = object.toString()
  19459. // Set type to `application/x-www-form-urlencoded;charset=UTF-8`.
  19460. type = 'application/x-www-form-urlencoded;charset=UTF-8'
  19461. } else if (isArrayBuffer(object)) {
  19462. // BufferSource/ArrayBuffer
  19463. // Set source to a copy of the bytes held by object.
  19464. source = new Uint8Array(object.slice())
  19465. } else if (ArrayBuffer.isView(object)) {
  19466. // BufferSource/ArrayBufferView
  19467. // Set source to a copy of the bytes held by object.
  19468. source = new Uint8Array(object.buffer.slice(object.byteOffset, object.byteOffset + object.byteLength))
  19469. } else if (util.isFormDataLike(object)) {
  19470. const boundary = `----formdata-undici-0${`${random(1e11)}`.padStart(11, '0')}`
  19471. const prefix = `--${boundary}\r\nContent-Disposition: form-data`
  19472. /*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */
  19473. const escape = (str) =>
  19474. str.replace(/\n/g, '%0A').replace(/\r/g, '%0D').replace(/"/g, '%22')
  19475. const normalizeLinefeeds = (value) => value.replace(/\r?\n|\r/g, '\r\n')
  19476. // Set action to this step: run the multipart/form-data
  19477. // encoding algorithm, with object’s entry list and UTF-8.
  19478. // - This ensures that the body is immutable and can't be changed afterwords
  19479. // - That the content-length is calculated in advance.
  19480. // - And that all parts are pre-encoded and ready to be sent.
  19481. const blobParts = []
  19482. const rn = new Uint8Array([13, 10]) // '\r\n'
  19483. length = 0
  19484. let hasUnknownSizeValue = false
  19485. for (const [name, value] of object) {
  19486. if (typeof value === 'string') {
  19487. const chunk = textEncoder.encode(prefix +
  19488. `; name="${escape(normalizeLinefeeds(name))}"` +
  19489. `\r\n\r\n${normalizeLinefeeds(value)}\r\n`)
  19490. blobParts.push(chunk)
  19491. length += chunk.byteLength
  19492. } else {
  19493. const chunk = textEncoder.encode(`${prefix}; name="${escape(normalizeLinefeeds(name))}"` +
  19494. (value.name ? `; filename="${escape(value.name)}"` : '') + '\r\n' +
  19495. `Content-Type: ${
  19496. value.type || 'application/octet-stream'
  19497. }\r\n\r\n`)
  19498. blobParts.push(chunk, value, rn)
  19499. if (typeof value.size === 'number') {
  19500. length += chunk.byteLength + value.size + rn.byteLength
  19501. } else {
  19502. hasUnknownSizeValue = true
  19503. }
  19504. }
  19505. }
  19506. const chunk = textEncoder.encode(`--${boundary}--`)
  19507. blobParts.push(chunk)
  19508. length += chunk.byteLength
  19509. if (hasUnknownSizeValue) {
  19510. length = null
  19511. }
  19512. // Set source to object.
  19513. source = object
  19514. action = async function * () {
  19515. for (const part of blobParts) {
  19516. if (part.stream) {
  19517. yield * part.stream()
  19518. } else {
  19519. yield part
  19520. }
  19521. }
  19522. }
  19523. // Set type to `multipart/form-data; boundary=`,
  19524. // followed by the multipart/form-data boundary string generated
  19525. // by the multipart/form-data encoding algorithm.
  19526. type = 'multipart/form-data; boundary=' + boundary
  19527. } else if (isBlobLike(object)) {
  19528. // Blob
  19529. // Set source to object.
  19530. source = object
  19531. // Set length to object’s size.
  19532. length = object.size
  19533. // If object’s type attribute is not the empty byte sequence, set
  19534. // type to its value.
  19535. if (object.type) {
  19536. type = object.type
  19537. }
  19538. } else if (typeof object[Symbol.asyncIterator] === 'function') {
  19539. // If keepalive is true, then throw a TypeError.
  19540. if (keepalive) {
  19541. throw new TypeError('keepalive')
  19542. }
  19543. // If object is disturbed or locked, then throw a TypeError.
  19544. if (util.isDisturbed(object) || object.locked) {
  19545. throw new TypeError(
  19546. 'Response body object should not be disturbed or locked'
  19547. )
  19548. }
  19549. stream =
  19550. object instanceof ReadableStream ? object : ReadableStreamFrom(object)
  19551. }
  19552. // 11. If source is a byte sequence, then set action to a
  19553. // step that returns source and length to source’s length.
  19554. if (typeof source === 'string' || util.isBuffer(source)) {
  19555. length = Buffer.byteLength(source)
  19556. }
  19557. // 12. If action is non-null, then run these steps in in parallel:
  19558. if (action != null) {
  19559. // Run action.
  19560. let iterator
  19561. stream = new ReadableStream({
  19562. async start () {
  19563. iterator = action(object)[Symbol.asyncIterator]()
  19564. },
  19565. async pull (controller) {
  19566. const { value, done } = await iterator.next()
  19567. if (done) {
  19568. // When running action is done, close stream.
  19569. queueMicrotask(() => {
  19570. controller.close()
  19571. })
  19572. } else {
  19573. // Whenever one or more bytes are available and stream is not errored,
  19574. // enqueue a Uint8Array wrapping an ArrayBuffer containing the available
  19575. // bytes into stream.
  19576. if (!isErrored(stream)) {
  19577. controller.enqueue(new Uint8Array(value))
  19578. }
  19579. }
  19580. return controller.desiredSize > 0
  19581. },
  19582. async cancel (reason) {
  19583. await iterator.return()
  19584. },
  19585. type: undefined
  19586. })
  19587. }
  19588. // 13. Let body be a body whose stream is stream, source is source,
  19589. // and length is length.
  19590. const body = { stream, source, length }
  19591. // 14. Return (body, type).
  19592. return [body, type]
  19593. }
  19594. // https://fetch.spec.whatwg.org/#bodyinit-safely-extract
  19595. function safelyExtractBody (object, keepalive = false) {
  19596. if (!ReadableStream) {
  19597. // istanbul ignore next
  19598. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  19599. }
  19600. // To safely extract a body and a `Content-Type` value from
  19601. // a byte sequence or BodyInit object object, run these steps:
  19602. // 1. If object is a ReadableStream object, then:
  19603. if (object instanceof ReadableStream) {
  19604. // Assert: object is neither disturbed nor locked.
  19605. // istanbul ignore next
  19606. assert(!util.isDisturbed(object), 'The body has already been consumed.')
  19607. // istanbul ignore next
  19608. assert(!object.locked, 'The stream is locked.')
  19609. }
  19610. // 2. Return the results of extracting object.
  19611. return extractBody(object, keepalive)
  19612. }
  19613. function cloneBody (body) {
  19614. // To clone a body body, run these steps:
  19615. // https://fetch.spec.whatwg.org/#concept-body-clone
  19616. // 1. Let « out1, out2 » be the result of teeing body’s stream.
  19617. const [out1, out2] = body.stream.tee()
  19618. const out2Clone = structuredClone(out2, { transfer: [out2] })
  19619. // This, for whatever reasons, unrefs out2Clone which allows
  19620. // the process to exit by itself.
  19621. const [, finalClone] = out2Clone.tee()
  19622. // 2. Set body’s stream to out1.
  19623. body.stream = out1
  19624. // 3. Return a body whose stream is out2 and other members are copied from body.
  19625. return {
  19626. stream: finalClone,
  19627. length: body.length,
  19628. source: body.source
  19629. }
  19630. }
  19631. async function * consumeBody (body) {
  19632. if (body) {
  19633. if (isUint8Array(body)) {
  19634. yield body
  19635. } else {
  19636. const stream = body.stream
  19637. if (util.isDisturbed(stream)) {
  19638. throw new TypeError('The body has already been consumed.')
  19639. }
  19640. if (stream.locked) {
  19641. throw new TypeError('The stream is locked.')
  19642. }
  19643. // Compat.
  19644. stream[kBodyUsed] = true
  19645. yield * stream
  19646. }
  19647. }
  19648. }
  19649. function throwIfAborted (state) {
  19650. if (state.aborted) {
  19651. throw new DOMException('The operation was aborted.', 'AbortError')
  19652. }
  19653. }
  19654. function bodyMixinMethods (instance) {
  19655. const methods = {
  19656. blob () {
  19657. // The blob() method steps are to return the result of
  19658. // running consume body with this and the following step
  19659. // given a byte sequence bytes: return a Blob whose
  19660. // contents are bytes and whose type attribute is this’s
  19661. // MIME type.
  19662. return specConsumeBody(this, (bytes) => {
  19663. let mimeType = bodyMimeType(this)
  19664. if (mimeType === 'failure') {
  19665. mimeType = ''
  19666. } else if (mimeType) {
  19667. mimeType = serializeAMimeType(mimeType)
  19668. }
  19669. // Return a Blob whose contents are bytes and type attribute
  19670. // is mimeType.
  19671. return new Blob([bytes], { type: mimeType })
  19672. }, instance)
  19673. },
  19674. arrayBuffer () {
  19675. // The arrayBuffer() method steps are to return the result
  19676. // of running consume body with this and the following step
  19677. // given a byte sequence bytes: return a new ArrayBuffer
  19678. // whose contents are bytes.
  19679. return specConsumeBody(this, (bytes) => {
  19680. return new Uint8Array(bytes).buffer
  19681. }, instance)
  19682. },
  19683. text () {
  19684. // The text() method steps are to return the result of running
  19685. // consume body with this and UTF-8 decode.
  19686. return specConsumeBody(this, utf8DecodeBytes, instance)
  19687. },
  19688. json () {
  19689. // The json() method steps are to return the result of running
  19690. // consume body with this and parse JSON from bytes.
  19691. return specConsumeBody(this, parseJSONFromBytes, instance)
  19692. },
  19693. async formData () {
  19694. webidl.brandCheck(this, instance)
  19695. throwIfAborted(this[kState])
  19696. const contentType = this.headers.get('Content-Type')
  19697. // If mimeType’s essence is "multipart/form-data", then:
  19698. if (/multipart\/form-data/.test(contentType)) {
  19699. const headers = {}
  19700. for (const [key, value] of this.headers) headers[key.toLowerCase()] = value
  19701. const responseFormData = new FormData()
  19702. let busboy
  19703. try {
  19704. busboy = new Busboy({
  19705. headers,
  19706. preservePath: true
  19707. })
  19708. } catch (err) {
  19709. throw new DOMException(`${err}`, 'AbortError')
  19710. }
  19711. busboy.on('field', (name, value) => {
  19712. responseFormData.append(name, value)
  19713. })
  19714. busboy.on('file', (name, value, filename, encoding, mimeType) => {
  19715. const chunks = []
  19716. if (encoding === 'base64' || encoding.toLowerCase() === 'base64') {
  19717. let base64chunk = ''
  19718. value.on('data', (chunk) => {
  19719. base64chunk += chunk.toString().replace(/[\r\n]/gm, '')
  19720. const end = base64chunk.length - base64chunk.length % 4
  19721. chunks.push(Buffer.from(base64chunk.slice(0, end), 'base64'))
  19722. base64chunk = base64chunk.slice(end)
  19723. })
  19724. value.on('end', () => {
  19725. chunks.push(Buffer.from(base64chunk, 'base64'))
  19726. responseFormData.append(name, new File(chunks, filename, { type: mimeType }))
  19727. })
  19728. } else {
  19729. value.on('data', (chunk) => {
  19730. chunks.push(chunk)
  19731. })
  19732. value.on('end', () => {
  19733. responseFormData.append(name, new File(chunks, filename, { type: mimeType }))
  19734. })
  19735. }
  19736. })
  19737. const busboyResolve = new Promise((resolve, reject) => {
  19738. busboy.on('finish', resolve)
  19739. busboy.on('error', (err) => reject(new TypeError(err)))
  19740. })
  19741. if (this.body !== null) for await (const chunk of consumeBody(this[kState].body)) busboy.write(chunk)
  19742. busboy.end()
  19743. await busboyResolve
  19744. return responseFormData
  19745. } else if (/application\/x-www-form-urlencoded/.test(contentType)) {
  19746. // Otherwise, if mimeType’s essence is "application/x-www-form-urlencoded", then:
  19747. // 1. Let entries be the result of parsing bytes.
  19748. let entries
  19749. try {
  19750. let text = ''
  19751. // application/x-www-form-urlencoded parser will keep the BOM.
  19752. // https://url.spec.whatwg.org/#concept-urlencoded-parser
  19753. // Note that streaming decoder is stateful and cannot be reused
  19754. const streamingDecoder = new TextDecoder('utf-8', { ignoreBOM: true })
  19755. for await (const chunk of consumeBody(this[kState].body)) {
  19756. if (!isUint8Array(chunk)) {
  19757. throw new TypeError('Expected Uint8Array chunk')
  19758. }
  19759. text += streamingDecoder.decode(chunk, { stream: true })
  19760. }
  19761. text += streamingDecoder.decode()
  19762. entries = new URLSearchParams(text)
  19763. } catch (err) {
  19764. // istanbul ignore next: Unclear when new URLSearchParams can fail on a string.
  19765. // 2. If entries is failure, then throw a TypeError.
  19766. throw Object.assign(new TypeError(), { cause: err })
  19767. }
  19768. // 3. Return a new FormData object whose entries are entries.
  19769. const formData = new FormData()
  19770. for (const [name, value] of entries) {
  19771. formData.append(name, value)
  19772. }
  19773. return formData
  19774. } else {
  19775. // Wait a tick before checking if the request has been aborted.
  19776. // Otherwise, a TypeError can be thrown when an AbortError should.
  19777. await Promise.resolve()
  19778. throwIfAborted(this[kState])
  19779. // Otherwise, throw a TypeError.
  19780. throw webidl.errors.exception({
  19781. header: `${instance.name}.formData`,
  19782. message: 'Could not parse content as FormData.'
  19783. })
  19784. }
  19785. }
  19786. }
  19787. return methods
  19788. }
  19789. function mixinBody (prototype) {
  19790. Object.assign(prototype.prototype, bodyMixinMethods(prototype))
  19791. }
  19792. /**
  19793. * @see https://fetch.spec.whatwg.org/#concept-body-consume-body
  19794. * @param {Response|Request} object
  19795. * @param {(value: unknown) => unknown} convertBytesToJSValue
  19796. * @param {Response|Request} instance
  19797. */
  19798. async function specConsumeBody (object, convertBytesToJSValue, instance) {
  19799. webidl.brandCheck(object, instance)
  19800. throwIfAborted(object[kState])
  19801. // 1. If object is unusable, then return a promise rejected
  19802. // with a TypeError.
  19803. if (bodyUnusable(object[kState].body)) {
  19804. throw new TypeError('Body is unusable')
  19805. }
  19806. // 2. Let promise be a new promise.
  19807. const promise = createDeferredPromise()
  19808. // 3. Let errorSteps given error be to reject promise with error.
  19809. const errorSteps = (error) => promise.reject(error)
  19810. // 4. Let successSteps given a byte sequence data be to resolve
  19811. // promise with the result of running convertBytesToJSValue
  19812. // with data. If that threw an exception, then run errorSteps
  19813. // with that exception.
  19814. const successSteps = (data) => {
  19815. try {
  19816. promise.resolve(convertBytesToJSValue(data))
  19817. } catch (e) {
  19818. errorSteps(e)
  19819. }
  19820. }
  19821. // 5. If object’s body is null, then run successSteps with an
  19822. // empty byte sequence.
  19823. if (object[kState].body == null) {
  19824. successSteps(new Uint8Array())
  19825. return promise.promise
  19826. }
  19827. // 6. Otherwise, fully read object’s body given successSteps,
  19828. // errorSteps, and object’s relevant global object.
  19829. await fullyReadBody(object[kState].body, successSteps, errorSteps)
  19830. // 7. Return promise.
  19831. return promise.promise
  19832. }
  19833. // https://fetch.spec.whatwg.org/#body-unusable
  19834. function bodyUnusable (body) {
  19835. // An object including the Body interface mixin is
  19836. // said to be unusable if its body is non-null and
  19837. // its body’s stream is disturbed or locked.
  19838. return body != null && (body.stream.locked || util.isDisturbed(body.stream))
  19839. }
  19840. /**
  19841. * @see https://encoding.spec.whatwg.org/#utf-8-decode
  19842. * @param {Buffer} buffer
  19843. */
  19844. function utf8DecodeBytes (buffer) {
  19845. if (buffer.length === 0) {
  19846. return ''
  19847. }
  19848. // 1. Let buffer be the result of peeking three bytes from
  19849. // ioQueue, converted to a byte sequence.
  19850. // 2. If buffer is 0xEF 0xBB 0xBF, then read three
  19851. // bytes from ioQueue. (Do nothing with those bytes.)
  19852. if (buffer[0] === 0xEF && buffer[1] === 0xBB && buffer[2] === 0xBF) {
  19853. buffer = buffer.subarray(3)
  19854. }
  19855. // 3. Process a queue with an instance of UTF-8’s
  19856. // decoder, ioQueue, output, and "replacement".
  19857. const output = textDecoder.decode(buffer)
  19858. // 4. Return output.
  19859. return output
  19860. }
  19861. /**
  19862. * @see https://infra.spec.whatwg.org/#parse-json-bytes-to-a-javascript-value
  19863. * @param {Uint8Array} bytes
  19864. */
  19865. function parseJSONFromBytes (bytes) {
  19866. return JSON.parse(utf8DecodeBytes(bytes))
  19867. }
  19868. /**
  19869. * @see https://fetch.spec.whatwg.org/#concept-body-mime-type
  19870. * @param {import('./response').Response|import('./request').Request} object
  19871. */
  19872. function bodyMimeType (object) {
  19873. const { headersList } = object[kState]
  19874. const contentType = headersList.get('content-type')
  19875. if (contentType === null) {
  19876. return 'failure'
  19877. }
  19878. return parseMIMEType(contentType)
  19879. }
  19880. module.exports = {
  19881. extractBody,
  19882. safelyExtractBody,
  19883. cloneBody,
  19884. mixinBody
  19885. }
  19886. /***/ }),
  19887. /***/ 1037:
  19888. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  19889. "use strict";
  19890. const { MessageChannel, receiveMessageOnPort } = __nccwpck_require__(1267)
  19891. const corsSafeListedMethods = ['GET', 'HEAD', 'POST']
  19892. const corsSafeListedMethodsSet = new Set(corsSafeListedMethods)
  19893. const nullBodyStatus = [101, 204, 205, 304]
  19894. const redirectStatus = [301, 302, 303, 307, 308]
  19895. const redirectStatusSet = new Set(redirectStatus)
  19896. // https://fetch.spec.whatwg.org/#block-bad-port
  19897. const badPorts = [
  19898. '1', '7', '9', '11', '13', '15', '17', '19', '20', '21', '22', '23', '25', '37', '42', '43', '53', '69', '77', '79',
  19899. '87', '95', '101', '102', '103', '104', '109', '110', '111', '113', '115', '117', '119', '123', '135', '137',
  19900. '139', '143', '161', '179', '389', '427', '465', '512', '513', '514', '515', '526', '530', '531', '532',
  19901. '540', '548', '554', '556', '563', '587', '601', '636', '989', '990', '993', '995', '1719', '1720', '1723',
  19902. '2049', '3659', '4045', '5060', '5061', '6000', '6566', '6665', '6666', '6667', '6668', '6669', '6697',
  19903. '10080'
  19904. ]
  19905. const badPortsSet = new Set(badPorts)
  19906. // https://w3c.github.io/webappsec-referrer-policy/#referrer-policies
  19907. const referrerPolicy = [
  19908. '',
  19909. 'no-referrer',
  19910. 'no-referrer-when-downgrade',
  19911. 'same-origin',
  19912. 'origin',
  19913. 'strict-origin',
  19914. 'origin-when-cross-origin',
  19915. 'strict-origin-when-cross-origin',
  19916. 'unsafe-url'
  19917. ]
  19918. const referrerPolicySet = new Set(referrerPolicy)
  19919. const requestRedirect = ['follow', 'manual', 'error']
  19920. const safeMethods = ['GET', 'HEAD', 'OPTIONS', 'TRACE']
  19921. const safeMethodsSet = new Set(safeMethods)
  19922. const requestMode = ['navigate', 'same-origin', 'no-cors', 'cors']
  19923. const requestCredentials = ['omit', 'same-origin', 'include']
  19924. const requestCache = [
  19925. 'default',
  19926. 'no-store',
  19927. 'reload',
  19928. 'no-cache',
  19929. 'force-cache',
  19930. 'only-if-cached'
  19931. ]
  19932. // https://fetch.spec.whatwg.org/#request-body-header-name
  19933. const requestBodyHeader = [
  19934. 'content-encoding',
  19935. 'content-language',
  19936. 'content-location',
  19937. 'content-type',
  19938. // See https://github.com/nodejs/undici/issues/2021
  19939. // 'Content-Length' is a forbidden header name, which is typically
  19940. // removed in the Headers implementation. However, undici doesn't
  19941. // filter out headers, so we add it here.
  19942. 'content-length'
  19943. ]
  19944. // https://fetch.spec.whatwg.org/#enumdef-requestduplex
  19945. const requestDuplex = [
  19946. 'half'
  19947. ]
  19948. // http://fetch.spec.whatwg.org/#forbidden-method
  19949. const forbiddenMethods = ['CONNECT', 'TRACE', 'TRACK']
  19950. const forbiddenMethodsSet = new Set(forbiddenMethods)
  19951. const subresource = [
  19952. 'audio',
  19953. 'audioworklet',
  19954. 'font',
  19955. 'image',
  19956. 'manifest',
  19957. 'paintworklet',
  19958. 'script',
  19959. 'style',
  19960. 'track',
  19961. 'video',
  19962. 'xslt',
  19963. ''
  19964. ]
  19965. const subresourceSet = new Set(subresource)
  19966. /** @type {globalThis['DOMException']} */
  19967. const DOMException = globalThis.DOMException ?? (() => {
  19968. // DOMException was only made a global in Node v17.0.0,
  19969. // but fetch supports >= v16.8.
  19970. try {
  19971. atob('~')
  19972. } catch (err) {
  19973. return Object.getPrototypeOf(err).constructor
  19974. }
  19975. })()
  19976. let channel
  19977. /** @type {globalThis['structuredClone']} */
  19978. const structuredClone =
  19979. globalThis.structuredClone ??
  19980. // https://github.com/nodejs/node/blob/b27ae24dcc4251bad726d9d84baf678d1f707fed/lib/internal/structured_clone.js
  19981. // structuredClone was added in v17.0.0, but fetch supports v16.8
  19982. function structuredClone (value, options = undefined) {
  19983. if (arguments.length === 0) {
  19984. throw new TypeError('missing argument')
  19985. }
  19986. if (!channel) {
  19987. channel = new MessageChannel()
  19988. }
  19989. channel.port1.unref()
  19990. channel.port2.unref()
  19991. channel.port1.postMessage(value, options?.transfer)
  19992. return receiveMessageOnPort(channel.port2).message
  19993. }
  19994. module.exports = {
  19995. DOMException,
  19996. structuredClone,
  19997. subresource,
  19998. forbiddenMethods,
  19999. requestBodyHeader,
  20000. referrerPolicy,
  20001. requestRedirect,
  20002. requestMode,
  20003. requestCredentials,
  20004. requestCache,
  20005. redirectStatus,
  20006. corsSafeListedMethods,
  20007. nullBodyStatus,
  20008. safeMethods,
  20009. badPorts,
  20010. requestDuplex,
  20011. subresourceSet,
  20012. badPortsSet,
  20013. redirectStatusSet,
  20014. corsSafeListedMethodsSet,
  20015. safeMethodsSet,
  20016. forbiddenMethodsSet,
  20017. referrerPolicySet
  20018. }
  20019. /***/ }),
  20020. /***/ 685:
  20021. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  20022. const assert = __nccwpck_require__(9491)
  20023. const { atob } = __nccwpck_require__(4300)
  20024. const { isomorphicDecode } = __nccwpck_require__(2538)
  20025. const encoder = new TextEncoder()
  20026. /**
  20027. * @see https://mimesniff.spec.whatwg.org/#http-token-code-point
  20028. */
  20029. const HTTP_TOKEN_CODEPOINTS = /^[!#$%&'*+-.^_|~A-Za-z0-9]+$/
  20030. const HTTP_WHITESPACE_REGEX = /(\u000A|\u000D|\u0009|\u0020)/ // eslint-disable-line
  20031. /**
  20032. * @see https://mimesniff.spec.whatwg.org/#http-quoted-string-token-code-point
  20033. */
  20034. const HTTP_QUOTED_STRING_TOKENS = /[\u0009|\u0020-\u007E|\u0080-\u00FF]/ // eslint-disable-line
  20035. // https://fetch.spec.whatwg.org/#data-url-processor
  20036. /** @param {URL} dataURL */
  20037. function dataURLProcessor (dataURL) {
  20038. // 1. Assert: dataURL’s scheme is "data".
  20039. assert(dataURL.protocol === 'data:')
  20040. // 2. Let input be the result of running the URL
  20041. // serializer on dataURL with exclude fragment
  20042. // set to true.
  20043. let input = URLSerializer(dataURL, true)
  20044. // 3. Remove the leading "data:" string from input.
  20045. input = input.slice(5)
  20046. // 4. Let position point at the start of input.
  20047. const position = { position: 0 }
  20048. // 5. Let mimeType be the result of collecting a
  20049. // sequence of code points that are not equal
  20050. // to U+002C (,), given position.
  20051. let mimeType = collectASequenceOfCodePointsFast(
  20052. ',',
  20053. input,
  20054. position
  20055. )
  20056. // 6. Strip leading and trailing ASCII whitespace
  20057. // from mimeType.
  20058. // Undici implementation note: we need to store the
  20059. // length because if the mimetype has spaces removed,
  20060. // the wrong amount will be sliced from the input in
  20061. // step #9
  20062. const mimeTypeLength = mimeType.length
  20063. mimeType = removeASCIIWhitespace(mimeType, true, true)
  20064. // 7. If position is past the end of input, then
  20065. // return failure
  20066. if (position.position >= input.length) {
  20067. return 'failure'
  20068. }
  20069. // 8. Advance position by 1.
  20070. position.position++
  20071. // 9. Let encodedBody be the remainder of input.
  20072. const encodedBody = input.slice(mimeTypeLength + 1)
  20073. // 10. Let body be the percent-decoding of encodedBody.
  20074. let body = stringPercentDecode(encodedBody)
  20075. // 11. If mimeType ends with U+003B (;), followed by
  20076. // zero or more U+0020 SPACE, followed by an ASCII
  20077. // case-insensitive match for "base64", then:
  20078. if (/;(\u0020){0,}base64$/i.test(mimeType)) {
  20079. // 1. Let stringBody be the isomorphic decode of body.
  20080. const stringBody = isomorphicDecode(body)
  20081. // 2. Set body to the forgiving-base64 decode of
  20082. // stringBody.
  20083. body = forgivingBase64(stringBody)
  20084. // 3. If body is failure, then return failure.
  20085. if (body === 'failure') {
  20086. return 'failure'
  20087. }
  20088. // 4. Remove the last 6 code points from mimeType.
  20089. mimeType = mimeType.slice(0, -6)
  20090. // 5. Remove trailing U+0020 SPACE code points from mimeType,
  20091. // if any.
  20092. mimeType = mimeType.replace(/(\u0020)+$/, '')
  20093. // 6. Remove the last U+003B (;) code point from mimeType.
  20094. mimeType = mimeType.slice(0, -1)
  20095. }
  20096. // 12. If mimeType starts with U+003B (;), then prepend
  20097. // "text/plain" to mimeType.
  20098. if (mimeType.startsWith(';')) {
  20099. mimeType = 'text/plain' + mimeType
  20100. }
  20101. // 13. Let mimeTypeRecord be the result of parsing
  20102. // mimeType.
  20103. let mimeTypeRecord = parseMIMEType(mimeType)
  20104. // 14. If mimeTypeRecord is failure, then set
  20105. // mimeTypeRecord to text/plain;charset=US-ASCII.
  20106. if (mimeTypeRecord === 'failure') {
  20107. mimeTypeRecord = parseMIMEType('text/plain;charset=US-ASCII')
  20108. }
  20109. // 15. Return a new data: URL struct whose MIME
  20110. // type is mimeTypeRecord and body is body.
  20111. // https://fetch.spec.whatwg.org/#data-url-struct
  20112. return { mimeType: mimeTypeRecord, body }
  20113. }
  20114. // https://url.spec.whatwg.org/#concept-url-serializer
  20115. /**
  20116. * @param {URL} url
  20117. * @param {boolean} excludeFragment
  20118. */
  20119. function URLSerializer (url, excludeFragment = false) {
  20120. if (!excludeFragment) {
  20121. return url.href
  20122. }
  20123. const href = url.href
  20124. const hashLength = url.hash.length
  20125. return hashLength === 0 ? href : href.substring(0, href.length - hashLength)
  20126. }
  20127. // https://infra.spec.whatwg.org/#collect-a-sequence-of-code-points
  20128. /**
  20129. * @param {(char: string) => boolean} condition
  20130. * @param {string} input
  20131. * @param {{ position: number }} position
  20132. */
  20133. function collectASequenceOfCodePoints (condition, input, position) {
  20134. // 1. Let result be the empty string.
  20135. let result = ''
  20136. // 2. While position doesn’t point past the end of input and the
  20137. // code point at position within input meets the condition condition:
  20138. while (position.position < input.length && condition(input[position.position])) {
  20139. // 1. Append that code point to the end of result.
  20140. result += input[position.position]
  20141. // 2. Advance position by 1.
  20142. position.position++
  20143. }
  20144. // 3. Return result.
  20145. return result
  20146. }
  20147. /**
  20148. * A faster collectASequenceOfCodePoints that only works when comparing a single character.
  20149. * @param {string} char
  20150. * @param {string} input
  20151. * @param {{ position: number }} position
  20152. */
  20153. function collectASequenceOfCodePointsFast (char, input, position) {
  20154. const idx = input.indexOf(char, position.position)
  20155. const start = position.position
  20156. if (idx === -1) {
  20157. position.position = input.length
  20158. return input.slice(start)
  20159. }
  20160. position.position = idx
  20161. return input.slice(start, position.position)
  20162. }
  20163. // https://url.spec.whatwg.org/#string-percent-decode
  20164. /** @param {string} input */
  20165. function stringPercentDecode (input) {
  20166. // 1. Let bytes be the UTF-8 encoding of input.
  20167. const bytes = encoder.encode(input)
  20168. // 2. Return the percent-decoding of bytes.
  20169. return percentDecode(bytes)
  20170. }
  20171. // https://url.spec.whatwg.org/#percent-decode
  20172. /** @param {Uint8Array} input */
  20173. function percentDecode (input) {
  20174. // 1. Let output be an empty byte sequence.
  20175. /** @type {number[]} */
  20176. const output = []
  20177. // 2. For each byte byte in input:
  20178. for (let i = 0; i < input.length; i++) {
  20179. const byte = input[i]
  20180. // 1. If byte is not 0x25 (%), then append byte to output.
  20181. if (byte !== 0x25) {
  20182. output.push(byte)
  20183. // 2. Otherwise, if byte is 0x25 (%) and the next two bytes
  20184. // after byte in input are not in the ranges
  20185. // 0x30 (0) to 0x39 (9), 0x41 (A) to 0x46 (F),
  20186. // and 0x61 (a) to 0x66 (f), all inclusive, append byte
  20187. // to output.
  20188. } else if (
  20189. byte === 0x25 &&
  20190. !/^[0-9A-Fa-f]{2}$/i.test(String.fromCharCode(input[i + 1], input[i + 2]))
  20191. ) {
  20192. output.push(0x25)
  20193. // 3. Otherwise:
  20194. } else {
  20195. // 1. Let bytePoint be the two bytes after byte in input,
  20196. // decoded, and then interpreted as hexadecimal number.
  20197. const nextTwoBytes = String.fromCharCode(input[i + 1], input[i + 2])
  20198. const bytePoint = Number.parseInt(nextTwoBytes, 16)
  20199. // 2. Append a byte whose value is bytePoint to output.
  20200. output.push(bytePoint)
  20201. // 3. Skip the next two bytes in input.
  20202. i += 2
  20203. }
  20204. }
  20205. // 3. Return output.
  20206. return Uint8Array.from(output)
  20207. }
  20208. // https://mimesniff.spec.whatwg.org/#parse-a-mime-type
  20209. /** @param {string} input */
  20210. function parseMIMEType (input) {
  20211. // 1. Remove any leading and trailing HTTP whitespace
  20212. // from input.
  20213. input = removeHTTPWhitespace(input, true, true)
  20214. // 2. Let position be a position variable for input,
  20215. // initially pointing at the start of input.
  20216. const position = { position: 0 }
  20217. // 3. Let type be the result of collecting a sequence
  20218. // of code points that are not U+002F (/) from
  20219. // input, given position.
  20220. const type = collectASequenceOfCodePointsFast(
  20221. '/',
  20222. input,
  20223. position
  20224. )
  20225. // 4. If type is the empty string or does not solely
  20226. // contain HTTP token code points, then return failure.
  20227. // https://mimesniff.spec.whatwg.org/#http-token-code-point
  20228. if (type.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(type)) {
  20229. return 'failure'
  20230. }
  20231. // 5. If position is past the end of input, then return
  20232. // failure
  20233. if (position.position > input.length) {
  20234. return 'failure'
  20235. }
  20236. // 6. Advance position by 1. (This skips past U+002F (/).)
  20237. position.position++
  20238. // 7. Let subtype be the result of collecting a sequence of
  20239. // code points that are not U+003B (;) from input, given
  20240. // position.
  20241. let subtype = collectASequenceOfCodePointsFast(
  20242. ';',
  20243. input,
  20244. position
  20245. )
  20246. // 8. Remove any trailing HTTP whitespace from subtype.
  20247. subtype = removeHTTPWhitespace(subtype, false, true)
  20248. // 9. If subtype is the empty string or does not solely
  20249. // contain HTTP token code points, then return failure.
  20250. if (subtype.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(subtype)) {
  20251. return 'failure'
  20252. }
  20253. const typeLowercase = type.toLowerCase()
  20254. const subtypeLowercase = subtype.toLowerCase()
  20255. // 10. Let mimeType be a new MIME type record whose type
  20256. // is type, in ASCII lowercase, and subtype is subtype,
  20257. // in ASCII lowercase.
  20258. // https://mimesniff.spec.whatwg.org/#mime-type
  20259. const mimeType = {
  20260. type: typeLowercase,
  20261. subtype: subtypeLowercase,
  20262. /** @type {Map<string, string>} */
  20263. parameters: new Map(),
  20264. // https://mimesniff.spec.whatwg.org/#mime-type-essence
  20265. essence: `${typeLowercase}/${subtypeLowercase}`
  20266. }
  20267. // 11. While position is not past the end of input:
  20268. while (position.position < input.length) {
  20269. // 1. Advance position by 1. (This skips past U+003B (;).)
  20270. position.position++
  20271. // 2. Collect a sequence of code points that are HTTP
  20272. // whitespace from input given position.
  20273. collectASequenceOfCodePoints(
  20274. // https://fetch.spec.whatwg.org/#http-whitespace
  20275. char => HTTP_WHITESPACE_REGEX.test(char),
  20276. input,
  20277. position
  20278. )
  20279. // 3. Let parameterName be the result of collecting a
  20280. // sequence of code points that are not U+003B (;)
  20281. // or U+003D (=) from input, given position.
  20282. let parameterName = collectASequenceOfCodePoints(
  20283. (char) => char !== ';' && char !== '=',
  20284. input,
  20285. position
  20286. )
  20287. // 4. Set parameterName to parameterName, in ASCII
  20288. // lowercase.
  20289. parameterName = parameterName.toLowerCase()
  20290. // 5. If position is not past the end of input, then:
  20291. if (position.position < input.length) {
  20292. // 1. If the code point at position within input is
  20293. // U+003B (;), then continue.
  20294. if (input[position.position] === ';') {
  20295. continue
  20296. }
  20297. // 2. Advance position by 1. (This skips past U+003D (=).)
  20298. position.position++
  20299. }
  20300. // 6. If position is past the end of input, then break.
  20301. if (position.position > input.length) {
  20302. break
  20303. }
  20304. // 7. Let parameterValue be null.
  20305. let parameterValue = null
  20306. // 8. If the code point at position within input is
  20307. // U+0022 ("), then:
  20308. if (input[position.position] === '"') {
  20309. // 1. Set parameterValue to the result of collecting
  20310. // an HTTP quoted string from input, given position
  20311. // and the extract-value flag.
  20312. parameterValue = collectAnHTTPQuotedString(input, position, true)
  20313. // 2. Collect a sequence of code points that are not
  20314. // U+003B (;) from input, given position.
  20315. collectASequenceOfCodePointsFast(
  20316. ';',
  20317. input,
  20318. position
  20319. )
  20320. // 9. Otherwise:
  20321. } else {
  20322. // 1. Set parameterValue to the result of collecting
  20323. // a sequence of code points that are not U+003B (;)
  20324. // from input, given position.
  20325. parameterValue = collectASequenceOfCodePointsFast(
  20326. ';',
  20327. input,
  20328. position
  20329. )
  20330. // 2. Remove any trailing HTTP whitespace from parameterValue.
  20331. parameterValue = removeHTTPWhitespace(parameterValue, false, true)
  20332. // 3. If parameterValue is the empty string, then continue.
  20333. if (parameterValue.length === 0) {
  20334. continue
  20335. }
  20336. }
  20337. // 10. If all of the following are true
  20338. // - parameterName is not the empty string
  20339. // - parameterName solely contains HTTP token code points
  20340. // - parameterValue solely contains HTTP quoted-string token code points
  20341. // - mimeType’s parameters[parameterName] does not exist
  20342. // then set mimeType’s parameters[parameterName] to parameterValue.
  20343. if (
  20344. parameterName.length !== 0 &&
  20345. HTTP_TOKEN_CODEPOINTS.test(parameterName) &&
  20346. (parameterValue.length === 0 || HTTP_QUOTED_STRING_TOKENS.test(parameterValue)) &&
  20347. !mimeType.parameters.has(parameterName)
  20348. ) {
  20349. mimeType.parameters.set(parameterName, parameterValue)
  20350. }
  20351. }
  20352. // 12. Return mimeType.
  20353. return mimeType
  20354. }
  20355. // https://infra.spec.whatwg.org/#forgiving-base64-decode
  20356. /** @param {string} data */
  20357. function forgivingBase64 (data) {
  20358. // 1. Remove all ASCII whitespace from data.
  20359. data = data.replace(/[\u0009\u000A\u000C\u000D\u0020]/g, '') // eslint-disable-line
  20360. // 2. If data’s code point length divides by 4 leaving
  20361. // no remainder, then:
  20362. if (data.length % 4 === 0) {
  20363. // 1. If data ends with one or two U+003D (=) code points,
  20364. // then remove them from data.
  20365. data = data.replace(/=?=$/, '')
  20366. }
  20367. // 3. If data’s code point length divides by 4 leaving
  20368. // a remainder of 1, then return failure.
  20369. if (data.length % 4 === 1) {
  20370. return 'failure'
  20371. }
  20372. // 4. If data contains a code point that is not one of
  20373. // U+002B (+)
  20374. // U+002F (/)
  20375. // ASCII alphanumeric
  20376. // then return failure.
  20377. if (/[^+/0-9A-Za-z]/.test(data)) {
  20378. return 'failure'
  20379. }
  20380. const binary = atob(data)
  20381. const bytes = new Uint8Array(binary.length)
  20382. for (let byte = 0; byte < binary.length; byte++) {
  20383. bytes[byte] = binary.charCodeAt(byte)
  20384. }
  20385. return bytes
  20386. }
  20387. // https://fetch.spec.whatwg.org/#collect-an-http-quoted-string
  20388. // tests: https://fetch.spec.whatwg.org/#example-http-quoted-string
  20389. /**
  20390. * @param {string} input
  20391. * @param {{ position: number }} position
  20392. * @param {boolean?} extractValue
  20393. */
  20394. function collectAnHTTPQuotedString (input, position, extractValue) {
  20395. // 1. Let positionStart be position.
  20396. const positionStart = position.position
  20397. // 2. Let value be the empty string.
  20398. let value = ''
  20399. // 3. Assert: the code point at position within input
  20400. // is U+0022 (").
  20401. assert(input[position.position] === '"')
  20402. // 4. Advance position by 1.
  20403. position.position++
  20404. // 5. While true:
  20405. while (true) {
  20406. // 1. Append the result of collecting a sequence of code points
  20407. // that are not U+0022 (") or U+005C (\) from input, given
  20408. // position, to value.
  20409. value += collectASequenceOfCodePoints(
  20410. (char) => char !== '"' && char !== '\\',
  20411. input,
  20412. position
  20413. )
  20414. // 2. If position is past the end of input, then break.
  20415. if (position.position >= input.length) {
  20416. break
  20417. }
  20418. // 3. Let quoteOrBackslash be the code point at position within
  20419. // input.
  20420. const quoteOrBackslash = input[position.position]
  20421. // 4. Advance position by 1.
  20422. position.position++
  20423. // 5. If quoteOrBackslash is U+005C (\), then:
  20424. if (quoteOrBackslash === '\\') {
  20425. // 1. If position is past the end of input, then append
  20426. // U+005C (\) to value and break.
  20427. if (position.position >= input.length) {
  20428. value += '\\'
  20429. break
  20430. }
  20431. // 2. Append the code point at position within input to value.
  20432. value += input[position.position]
  20433. // 3. Advance position by 1.
  20434. position.position++
  20435. // 6. Otherwise:
  20436. } else {
  20437. // 1. Assert: quoteOrBackslash is U+0022 (").
  20438. assert(quoteOrBackslash === '"')
  20439. // 2. Break.
  20440. break
  20441. }
  20442. }
  20443. // 6. If the extract-value flag is set, then return value.
  20444. if (extractValue) {
  20445. return value
  20446. }
  20447. // 7. Return the code points from positionStart to position,
  20448. // inclusive, within input.
  20449. return input.slice(positionStart, position.position)
  20450. }
  20451. /**
  20452. * @see https://mimesniff.spec.whatwg.org/#serialize-a-mime-type
  20453. */
  20454. function serializeAMimeType (mimeType) {
  20455. assert(mimeType !== 'failure')
  20456. const { parameters, essence } = mimeType
  20457. // 1. Let serialization be the concatenation of mimeType’s
  20458. // type, U+002F (/), and mimeType’s subtype.
  20459. let serialization = essence
  20460. // 2. For each name → value of mimeType’s parameters:
  20461. for (let [name, value] of parameters.entries()) {
  20462. // 1. Append U+003B (;) to serialization.
  20463. serialization += ';'
  20464. // 2. Append name to serialization.
  20465. serialization += name
  20466. // 3. Append U+003D (=) to serialization.
  20467. serialization += '='
  20468. // 4. If value does not solely contain HTTP token code
  20469. // points or value is the empty string, then:
  20470. if (!HTTP_TOKEN_CODEPOINTS.test(value)) {
  20471. // 1. Precede each occurence of U+0022 (") or
  20472. // U+005C (\) in value with U+005C (\).
  20473. value = value.replace(/(\\|")/g, '\\$1')
  20474. // 2. Prepend U+0022 (") to value.
  20475. value = '"' + value
  20476. // 3. Append U+0022 (") to value.
  20477. value += '"'
  20478. }
  20479. // 5. Append value to serialization.
  20480. serialization += value
  20481. }
  20482. // 3. Return serialization.
  20483. return serialization
  20484. }
  20485. /**
  20486. * @see https://fetch.spec.whatwg.org/#http-whitespace
  20487. * @param {string} char
  20488. */
  20489. function isHTTPWhiteSpace (char) {
  20490. return char === '\r' || char === '\n' || char === '\t' || char === ' '
  20491. }
  20492. /**
  20493. * @see https://fetch.spec.whatwg.org/#http-whitespace
  20494. * @param {string} str
  20495. */
  20496. function removeHTTPWhitespace (str, leading = true, trailing = true) {
  20497. let lead = 0
  20498. let trail = str.length - 1
  20499. if (leading) {
  20500. for (; lead < str.length && isHTTPWhiteSpace(str[lead]); lead++);
  20501. }
  20502. if (trailing) {
  20503. for (; trail > 0 && isHTTPWhiteSpace(str[trail]); trail--);
  20504. }
  20505. return str.slice(lead, trail + 1)
  20506. }
  20507. /**
  20508. * @see https://infra.spec.whatwg.org/#ascii-whitespace
  20509. * @param {string} char
  20510. */
  20511. function isASCIIWhitespace (char) {
  20512. return char === '\r' || char === '\n' || char === '\t' || char === '\f' || char === ' '
  20513. }
  20514. /**
  20515. * @see https://infra.spec.whatwg.org/#strip-leading-and-trailing-ascii-whitespace
  20516. */
  20517. function removeASCIIWhitespace (str, leading = true, trailing = true) {
  20518. let lead = 0
  20519. let trail = str.length - 1
  20520. if (leading) {
  20521. for (; lead < str.length && isASCIIWhitespace(str[lead]); lead++);
  20522. }
  20523. if (trailing) {
  20524. for (; trail > 0 && isASCIIWhitespace(str[trail]); trail--);
  20525. }
  20526. return str.slice(lead, trail + 1)
  20527. }
  20528. module.exports = {
  20529. dataURLProcessor,
  20530. URLSerializer,
  20531. collectASequenceOfCodePoints,
  20532. collectASequenceOfCodePointsFast,
  20533. stringPercentDecode,
  20534. parseMIMEType,
  20535. collectAnHTTPQuotedString,
  20536. serializeAMimeType
  20537. }
  20538. /***/ }),
  20539. /***/ 8511:
  20540. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  20541. "use strict";
  20542. const { Blob, File: NativeFile } = __nccwpck_require__(4300)
  20543. const { types } = __nccwpck_require__(3837)
  20544. const { kState } = __nccwpck_require__(5861)
  20545. const { isBlobLike } = __nccwpck_require__(2538)
  20546. const { webidl } = __nccwpck_require__(1744)
  20547. const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(685)
  20548. const { kEnumerableProperty } = __nccwpck_require__(3983)
  20549. const encoder = new TextEncoder()
  20550. class File extends Blob {
  20551. constructor (fileBits, fileName, options = {}) {
  20552. // The File constructor is invoked with two or three parameters, depending
  20553. // on whether the optional dictionary parameter is used. When the File()
  20554. // constructor is invoked, user agents must run the following steps:
  20555. webidl.argumentLengthCheck(arguments, 2, { header: 'File constructor' })
  20556. fileBits = webidl.converters['sequence<BlobPart>'](fileBits)
  20557. fileName = webidl.converters.USVString(fileName)
  20558. options = webidl.converters.FilePropertyBag(options)
  20559. // 1. Let bytes be the result of processing blob parts given fileBits and
  20560. // options.
  20561. // Note: Blob handles this for us
  20562. // 2. Let n be the fileName argument to the constructor.
  20563. const n = fileName
  20564. // 3. Process FilePropertyBag dictionary argument by running the following
  20565. // substeps:
  20566. // 1. If the type member is provided and is not the empty string, let t
  20567. // be set to the type dictionary member. If t contains any characters
  20568. // outside the range U+0020 to U+007E, then set t to the empty string
  20569. // and return from these substeps.
  20570. // 2. Convert every character in t to ASCII lowercase.
  20571. let t = options.type
  20572. let d
  20573. // eslint-disable-next-line no-labels
  20574. substep: {
  20575. if (t) {
  20576. t = parseMIMEType(t)
  20577. if (t === 'failure') {
  20578. t = ''
  20579. // eslint-disable-next-line no-labels
  20580. break substep
  20581. }
  20582. t = serializeAMimeType(t).toLowerCase()
  20583. }
  20584. // 3. If the lastModified member is provided, let d be set to the
  20585. // lastModified dictionary member. If it is not provided, set d to the
  20586. // current date and time represented as the number of milliseconds since
  20587. // the Unix Epoch (which is the equivalent of Date.now() [ECMA-262]).
  20588. d = options.lastModified
  20589. }
  20590. // 4. Return a new File object F such that:
  20591. // F refers to the bytes byte sequence.
  20592. // F.size is set to the number of total bytes in bytes.
  20593. // F.name is set to n.
  20594. // F.type is set to t.
  20595. // F.lastModified is set to d.
  20596. super(processBlobParts(fileBits, options), { type: t })
  20597. this[kState] = {
  20598. name: n,
  20599. lastModified: d,
  20600. type: t
  20601. }
  20602. }
  20603. get name () {
  20604. webidl.brandCheck(this, File)
  20605. return this[kState].name
  20606. }
  20607. get lastModified () {
  20608. webidl.brandCheck(this, File)
  20609. return this[kState].lastModified
  20610. }
  20611. get type () {
  20612. webidl.brandCheck(this, File)
  20613. return this[kState].type
  20614. }
  20615. }
  20616. class FileLike {
  20617. constructor (blobLike, fileName, options = {}) {
  20618. // TODO: argument idl type check
  20619. // The File constructor is invoked with two or three parameters, depending
  20620. // on whether the optional dictionary parameter is used. When the File()
  20621. // constructor is invoked, user agents must run the following steps:
  20622. // 1. Let bytes be the result of processing blob parts given fileBits and
  20623. // options.
  20624. // 2. Let n be the fileName argument to the constructor.
  20625. const n = fileName
  20626. // 3. Process FilePropertyBag dictionary argument by running the following
  20627. // substeps:
  20628. // 1. If the type member is provided and is not the empty string, let t
  20629. // be set to the type dictionary member. If t contains any characters
  20630. // outside the range U+0020 to U+007E, then set t to the empty string
  20631. // and return from these substeps.
  20632. // TODO
  20633. const t = options.type
  20634. // 2. Convert every character in t to ASCII lowercase.
  20635. // TODO
  20636. // 3. If the lastModified member is provided, let d be set to the
  20637. // lastModified dictionary member. If it is not provided, set d to the
  20638. // current date and time represented as the number of milliseconds since
  20639. // the Unix Epoch (which is the equivalent of Date.now() [ECMA-262]).
  20640. const d = options.lastModified ?? Date.now()
  20641. // 4. Return a new File object F such that:
  20642. // F refers to the bytes byte sequence.
  20643. // F.size is set to the number of total bytes in bytes.
  20644. // F.name is set to n.
  20645. // F.type is set to t.
  20646. // F.lastModified is set to d.
  20647. this[kState] = {
  20648. blobLike,
  20649. name: n,
  20650. type: t,
  20651. lastModified: d
  20652. }
  20653. }
  20654. stream (...args) {
  20655. webidl.brandCheck(this, FileLike)
  20656. return this[kState].blobLike.stream(...args)
  20657. }
  20658. arrayBuffer (...args) {
  20659. webidl.brandCheck(this, FileLike)
  20660. return this[kState].blobLike.arrayBuffer(...args)
  20661. }
  20662. slice (...args) {
  20663. webidl.brandCheck(this, FileLike)
  20664. return this[kState].blobLike.slice(...args)
  20665. }
  20666. text (...args) {
  20667. webidl.brandCheck(this, FileLike)
  20668. return this[kState].blobLike.text(...args)
  20669. }
  20670. get size () {
  20671. webidl.brandCheck(this, FileLike)
  20672. return this[kState].blobLike.size
  20673. }
  20674. get type () {
  20675. webidl.brandCheck(this, FileLike)
  20676. return this[kState].blobLike.type
  20677. }
  20678. get name () {
  20679. webidl.brandCheck(this, FileLike)
  20680. return this[kState].name
  20681. }
  20682. get lastModified () {
  20683. webidl.brandCheck(this, FileLike)
  20684. return this[kState].lastModified
  20685. }
  20686. get [Symbol.toStringTag] () {
  20687. return 'File'
  20688. }
  20689. }
  20690. Object.defineProperties(File.prototype, {
  20691. [Symbol.toStringTag]: {
  20692. value: 'File',
  20693. configurable: true
  20694. },
  20695. name: kEnumerableProperty,
  20696. lastModified: kEnumerableProperty
  20697. })
  20698. webidl.converters.Blob = webidl.interfaceConverter(Blob)
  20699. webidl.converters.BlobPart = function (V, opts) {
  20700. if (webidl.util.Type(V) === 'Object') {
  20701. if (isBlobLike(V)) {
  20702. return webidl.converters.Blob(V, { strict: false })
  20703. }
  20704. if (
  20705. ArrayBuffer.isView(V) ||
  20706. types.isAnyArrayBuffer(V)
  20707. ) {
  20708. return webidl.converters.BufferSource(V, opts)
  20709. }
  20710. }
  20711. return webidl.converters.USVString(V, opts)
  20712. }
  20713. webidl.converters['sequence<BlobPart>'] = webidl.sequenceConverter(
  20714. webidl.converters.BlobPart
  20715. )
  20716. // https://www.w3.org/TR/FileAPI/#dfn-FilePropertyBag
  20717. webidl.converters.FilePropertyBag = webidl.dictionaryConverter([
  20718. {
  20719. key: 'lastModified',
  20720. converter: webidl.converters['long long'],
  20721. get defaultValue () {
  20722. return Date.now()
  20723. }
  20724. },
  20725. {
  20726. key: 'type',
  20727. converter: webidl.converters.DOMString,
  20728. defaultValue: ''
  20729. },
  20730. {
  20731. key: 'endings',
  20732. converter: (value) => {
  20733. value = webidl.converters.DOMString(value)
  20734. value = value.toLowerCase()
  20735. if (value !== 'native') {
  20736. value = 'transparent'
  20737. }
  20738. return value
  20739. },
  20740. defaultValue: 'transparent'
  20741. }
  20742. ])
  20743. /**
  20744. * @see https://www.w3.org/TR/FileAPI/#process-blob-parts
  20745. * @param {(NodeJS.TypedArray|Blob|string)[]} parts
  20746. * @param {{ type: string, endings: string }} options
  20747. */
  20748. function processBlobParts (parts, options) {
  20749. // 1. Let bytes be an empty sequence of bytes.
  20750. /** @type {NodeJS.TypedArray[]} */
  20751. const bytes = []
  20752. // 2. For each element in parts:
  20753. for (const element of parts) {
  20754. // 1. If element is a USVString, run the following substeps:
  20755. if (typeof element === 'string') {
  20756. // 1. Let s be element.
  20757. let s = element
  20758. // 2. If the endings member of options is "native", set s
  20759. // to the result of converting line endings to native
  20760. // of element.
  20761. if (options.endings === 'native') {
  20762. s = convertLineEndingsNative(s)
  20763. }
  20764. // 3. Append the result of UTF-8 encoding s to bytes.
  20765. bytes.push(encoder.encode(s))
  20766. } else if (
  20767. types.isAnyArrayBuffer(element) ||
  20768. types.isTypedArray(element)
  20769. ) {
  20770. // 2. If element is a BufferSource, get a copy of the
  20771. // bytes held by the buffer source, and append those
  20772. // bytes to bytes.
  20773. if (!element.buffer) { // ArrayBuffer
  20774. bytes.push(new Uint8Array(element))
  20775. } else {
  20776. bytes.push(
  20777. new Uint8Array(element.buffer, element.byteOffset, element.byteLength)
  20778. )
  20779. }
  20780. } else if (isBlobLike(element)) {
  20781. // 3. If element is a Blob, append the bytes it represents
  20782. // to bytes.
  20783. bytes.push(element)
  20784. }
  20785. }
  20786. // 3. Return bytes.
  20787. return bytes
  20788. }
  20789. /**
  20790. * @see https://www.w3.org/TR/FileAPI/#convert-line-endings-to-native
  20791. * @param {string} s
  20792. */
  20793. function convertLineEndingsNative (s) {
  20794. // 1. Let native line ending be be the code point U+000A LF.
  20795. let nativeLineEnding = '\n'
  20796. // 2. If the underlying platform’s conventions are to
  20797. // represent newlines as a carriage return and line feed
  20798. // sequence, set native line ending to the code point
  20799. // U+000D CR followed by the code point U+000A LF.
  20800. if (process.platform === 'win32') {
  20801. nativeLineEnding = '\r\n'
  20802. }
  20803. return s.replace(/\r?\n/g, nativeLineEnding)
  20804. }
  20805. // If this function is moved to ./util.js, some tools (such as
  20806. // rollup) will warn about circular dependencies. See:
  20807. // https://github.com/nodejs/undici/issues/1629
  20808. function isFileLike (object) {
  20809. return (
  20810. (NativeFile && object instanceof NativeFile) ||
  20811. object instanceof File || (
  20812. object &&
  20813. (typeof object.stream === 'function' ||
  20814. typeof object.arrayBuffer === 'function') &&
  20815. object[Symbol.toStringTag] === 'File'
  20816. )
  20817. )
  20818. }
  20819. module.exports = { File, FileLike, isFileLike }
  20820. /***/ }),
  20821. /***/ 2015:
  20822. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  20823. "use strict";
  20824. const { isBlobLike, toUSVString, makeIterator } = __nccwpck_require__(2538)
  20825. const { kState } = __nccwpck_require__(5861)
  20826. const { File: UndiciFile, FileLike, isFileLike } = __nccwpck_require__(8511)
  20827. const { webidl } = __nccwpck_require__(1744)
  20828. const { Blob, File: NativeFile } = __nccwpck_require__(4300)
  20829. /** @type {globalThis['File']} */
  20830. const File = NativeFile ?? UndiciFile
  20831. // https://xhr.spec.whatwg.org/#formdata
  20832. class FormData {
  20833. constructor (form) {
  20834. if (form !== undefined) {
  20835. throw webidl.errors.conversionFailed({
  20836. prefix: 'FormData constructor',
  20837. argument: 'Argument 1',
  20838. types: ['undefined']
  20839. })
  20840. }
  20841. this[kState] = []
  20842. }
  20843. append (name, value, filename = undefined) {
  20844. webidl.brandCheck(this, FormData)
  20845. webidl.argumentLengthCheck(arguments, 2, { header: 'FormData.append' })
  20846. if (arguments.length === 3 && !isBlobLike(value)) {
  20847. throw new TypeError(
  20848. "Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'"
  20849. )
  20850. }
  20851. // 1. Let value be value if given; otherwise blobValue.
  20852. name = webidl.converters.USVString(name)
  20853. value = isBlobLike(value)
  20854. ? webidl.converters.Blob(value, { strict: false })
  20855. : webidl.converters.USVString(value)
  20856. filename = arguments.length === 3
  20857. ? webidl.converters.USVString(filename)
  20858. : undefined
  20859. // 2. Let entry be the result of creating an entry with
  20860. // name, value, and filename if given.
  20861. const entry = makeEntry(name, value, filename)
  20862. // 3. Append entry to this’s entry list.
  20863. this[kState].push(entry)
  20864. }
  20865. delete (name) {
  20866. webidl.brandCheck(this, FormData)
  20867. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.delete' })
  20868. name = webidl.converters.USVString(name)
  20869. // The delete(name) method steps are to remove all entries whose name
  20870. // is name from this’s entry list.
  20871. this[kState] = this[kState].filter(entry => entry.name !== name)
  20872. }
  20873. get (name) {
  20874. webidl.brandCheck(this, FormData)
  20875. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.get' })
  20876. name = webidl.converters.USVString(name)
  20877. // 1. If there is no entry whose name is name in this’s entry list,
  20878. // then return null.
  20879. const idx = this[kState].findIndex((entry) => entry.name === name)
  20880. if (idx === -1) {
  20881. return null
  20882. }
  20883. // 2. Return the value of the first entry whose name is name from
  20884. // this’s entry list.
  20885. return this[kState][idx].value
  20886. }
  20887. getAll (name) {
  20888. webidl.brandCheck(this, FormData)
  20889. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.getAll' })
  20890. name = webidl.converters.USVString(name)
  20891. // 1. If there is no entry whose name is name in this’s entry list,
  20892. // then return the empty list.
  20893. // 2. Return the values of all entries whose name is name, in order,
  20894. // from this’s entry list.
  20895. return this[kState]
  20896. .filter((entry) => entry.name === name)
  20897. .map((entry) => entry.value)
  20898. }
  20899. has (name) {
  20900. webidl.brandCheck(this, FormData)
  20901. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.has' })
  20902. name = webidl.converters.USVString(name)
  20903. // The has(name) method steps are to return true if there is an entry
  20904. // whose name is name in this’s entry list; otherwise false.
  20905. return this[kState].findIndex((entry) => entry.name === name) !== -1
  20906. }
  20907. set (name, value, filename = undefined) {
  20908. webidl.brandCheck(this, FormData)
  20909. webidl.argumentLengthCheck(arguments, 2, { header: 'FormData.set' })
  20910. if (arguments.length === 3 && !isBlobLike(value)) {
  20911. throw new TypeError(
  20912. "Failed to execute 'set' on 'FormData': parameter 2 is not of type 'Blob'"
  20913. )
  20914. }
  20915. // The set(name, value) and set(name, blobValue, filename) method steps
  20916. // are:
  20917. // 1. Let value be value if given; otherwise blobValue.
  20918. name = webidl.converters.USVString(name)
  20919. value = isBlobLike(value)
  20920. ? webidl.converters.Blob(value, { strict: false })
  20921. : webidl.converters.USVString(value)
  20922. filename = arguments.length === 3
  20923. ? toUSVString(filename)
  20924. : undefined
  20925. // 2. Let entry be the result of creating an entry with name, value, and
  20926. // filename if given.
  20927. const entry = makeEntry(name, value, filename)
  20928. // 3. If there are entries in this’s entry list whose name is name, then
  20929. // replace the first such entry with entry and remove the others.
  20930. const idx = this[kState].findIndex((entry) => entry.name === name)
  20931. if (idx !== -1) {
  20932. this[kState] = [
  20933. ...this[kState].slice(0, idx),
  20934. entry,
  20935. ...this[kState].slice(idx + 1).filter((entry) => entry.name !== name)
  20936. ]
  20937. } else {
  20938. // 4. Otherwise, append entry to this’s entry list.
  20939. this[kState].push(entry)
  20940. }
  20941. }
  20942. entries () {
  20943. webidl.brandCheck(this, FormData)
  20944. return makeIterator(
  20945. () => this[kState].map(pair => [pair.name, pair.value]),
  20946. 'FormData',
  20947. 'key+value'
  20948. )
  20949. }
  20950. keys () {
  20951. webidl.brandCheck(this, FormData)
  20952. return makeIterator(
  20953. () => this[kState].map(pair => [pair.name, pair.value]),
  20954. 'FormData',
  20955. 'key'
  20956. )
  20957. }
  20958. values () {
  20959. webidl.brandCheck(this, FormData)
  20960. return makeIterator(
  20961. () => this[kState].map(pair => [pair.name, pair.value]),
  20962. 'FormData',
  20963. 'value'
  20964. )
  20965. }
  20966. /**
  20967. * @param {(value: string, key: string, self: FormData) => void} callbackFn
  20968. * @param {unknown} thisArg
  20969. */
  20970. forEach (callbackFn, thisArg = globalThis) {
  20971. webidl.brandCheck(this, FormData)
  20972. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.forEach' })
  20973. if (typeof callbackFn !== 'function') {
  20974. throw new TypeError(
  20975. "Failed to execute 'forEach' on 'FormData': parameter 1 is not of type 'Function'."
  20976. )
  20977. }
  20978. for (const [key, value] of this) {
  20979. callbackFn.apply(thisArg, [value, key, this])
  20980. }
  20981. }
  20982. }
  20983. FormData.prototype[Symbol.iterator] = FormData.prototype.entries
  20984. Object.defineProperties(FormData.prototype, {
  20985. [Symbol.toStringTag]: {
  20986. value: 'FormData',
  20987. configurable: true
  20988. }
  20989. })
  20990. /**
  20991. * @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#create-an-entry
  20992. * @param {string} name
  20993. * @param {string|Blob} value
  20994. * @param {?string} filename
  20995. * @returns
  20996. */
  20997. function makeEntry (name, value, filename) {
  20998. // 1. Set name to the result of converting name into a scalar value string.
  20999. // "To convert a string into a scalar value string, replace any surrogates
  21000. // with U+FFFD."
  21001. // see: https://nodejs.org/dist/latest-v18.x/docs/api/buffer.html#buftostringencoding-start-end
  21002. name = Buffer.from(name).toString('utf8')
  21003. // 2. If value is a string, then set value to the result of converting
  21004. // value into a scalar value string.
  21005. if (typeof value === 'string') {
  21006. value = Buffer.from(value).toString('utf8')
  21007. } else {
  21008. // 3. Otherwise:
  21009. // 1. If value is not a File object, then set value to a new File object,
  21010. // representing the same bytes, whose name attribute value is "blob"
  21011. if (!isFileLike(value)) {
  21012. value = value instanceof Blob
  21013. ? new File([value], 'blob', { type: value.type })
  21014. : new FileLike(value, 'blob', { type: value.type })
  21015. }
  21016. // 2. If filename is given, then set value to a new File object,
  21017. // representing the same bytes, whose name attribute is filename.
  21018. if (filename !== undefined) {
  21019. /** @type {FilePropertyBag} */
  21020. const options = {
  21021. type: value.type,
  21022. lastModified: value.lastModified
  21023. }
  21024. value = (NativeFile && value instanceof NativeFile) || value instanceof UndiciFile
  21025. ? new File([value], filename, options)
  21026. : new FileLike(value, filename, options)
  21027. }
  21028. }
  21029. // 4. Return an entry whose name is name and whose value is value.
  21030. return { name, value }
  21031. }
  21032. module.exports = { FormData }
  21033. /***/ }),
  21034. /***/ 1246:
  21035. /***/ ((module) => {
  21036. "use strict";
  21037. // In case of breaking changes, increase the version
  21038. // number to avoid conflicts.
  21039. const globalOrigin = Symbol.for('undici.globalOrigin.1')
  21040. function getGlobalOrigin () {
  21041. return globalThis[globalOrigin]
  21042. }
  21043. function setGlobalOrigin (newOrigin) {
  21044. if (newOrigin === undefined) {
  21045. Object.defineProperty(globalThis, globalOrigin, {
  21046. value: undefined,
  21047. writable: true,
  21048. enumerable: false,
  21049. configurable: false
  21050. })
  21051. return
  21052. }
  21053. const parsedURL = new URL(newOrigin)
  21054. if (parsedURL.protocol !== 'http:' && parsedURL.protocol !== 'https:') {
  21055. throw new TypeError(`Only http & https urls are allowed, received ${parsedURL.protocol}`)
  21056. }
  21057. Object.defineProperty(globalThis, globalOrigin, {
  21058. value: parsedURL,
  21059. writable: true,
  21060. enumerable: false,
  21061. configurable: false
  21062. })
  21063. }
  21064. module.exports = {
  21065. getGlobalOrigin,
  21066. setGlobalOrigin
  21067. }
  21068. /***/ }),
  21069. /***/ 554:
  21070. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  21071. "use strict";
  21072. // https://github.com/Ethan-Arrowood/undici-fetch
  21073. const { kHeadersList, kConstruct } = __nccwpck_require__(2785)
  21074. const { kGuard } = __nccwpck_require__(5861)
  21075. const { kEnumerableProperty } = __nccwpck_require__(3983)
  21076. const {
  21077. makeIterator,
  21078. isValidHeaderName,
  21079. isValidHeaderValue
  21080. } = __nccwpck_require__(2538)
  21081. const util = __nccwpck_require__(3837)
  21082. const { webidl } = __nccwpck_require__(1744)
  21083. const assert = __nccwpck_require__(9491)
  21084. const kHeadersMap = Symbol('headers map')
  21085. const kHeadersSortedMap = Symbol('headers map sorted')
  21086. /**
  21087. * @param {number} code
  21088. */
  21089. function isHTTPWhiteSpaceCharCode (code) {
  21090. return code === 0x00a || code === 0x00d || code === 0x009 || code === 0x020
  21091. }
  21092. /**
  21093. * @see https://fetch.spec.whatwg.org/#concept-header-value-normalize
  21094. * @param {string} potentialValue
  21095. */
  21096. function headerValueNormalize (potentialValue) {
  21097. // To normalize a byte sequence potentialValue, remove
  21098. // any leading and trailing HTTP whitespace bytes from
  21099. // potentialValue.
  21100. let i = 0; let j = potentialValue.length
  21101. while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(j - 1))) --j
  21102. while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(i))) ++i
  21103. return i === 0 && j === potentialValue.length ? potentialValue : potentialValue.substring(i, j)
  21104. }
  21105. function fill (headers, object) {
  21106. // To fill a Headers object headers with a given object object, run these steps:
  21107. // 1. If object is a sequence, then for each header in object:
  21108. // Note: webidl conversion to array has already been done.
  21109. if (Array.isArray(object)) {
  21110. for (let i = 0; i < object.length; ++i) {
  21111. const header = object[i]
  21112. // 1. If header does not contain exactly two items, then throw a TypeError.
  21113. if (header.length !== 2) {
  21114. throw webidl.errors.exception({
  21115. header: 'Headers constructor',
  21116. message: `expected name/value pair to be length 2, found ${header.length}.`
  21117. })
  21118. }
  21119. // 2. Append (header’s first item, header’s second item) to headers.
  21120. appendHeader(headers, header[0], header[1])
  21121. }
  21122. } else if (typeof object === 'object' && object !== null) {
  21123. // Note: null should throw
  21124. // 2. Otherwise, object is a record, then for each key → value in object,
  21125. // append (key, value) to headers
  21126. const keys = Object.keys(object)
  21127. for (let i = 0; i < keys.length; ++i) {
  21128. appendHeader(headers, keys[i], object[keys[i]])
  21129. }
  21130. } else {
  21131. throw webidl.errors.conversionFailed({
  21132. prefix: 'Headers constructor',
  21133. argument: 'Argument 1',
  21134. types: ['sequence<sequence<ByteString>>', 'record<ByteString, ByteString>']
  21135. })
  21136. }
  21137. }
  21138. /**
  21139. * @see https://fetch.spec.whatwg.org/#concept-headers-append
  21140. */
  21141. function appendHeader (headers, name, value) {
  21142. // 1. Normalize value.
  21143. value = headerValueNormalize(value)
  21144. // 2. If name is not a header name or value is not a
  21145. // header value, then throw a TypeError.
  21146. if (!isValidHeaderName(name)) {
  21147. throw webidl.errors.invalidArgument({
  21148. prefix: 'Headers.append',
  21149. value: name,
  21150. type: 'header name'
  21151. })
  21152. } else if (!isValidHeaderValue(value)) {
  21153. throw webidl.errors.invalidArgument({
  21154. prefix: 'Headers.append',
  21155. value,
  21156. type: 'header value'
  21157. })
  21158. }
  21159. // 3. If headers’s guard is "immutable", then throw a TypeError.
  21160. // 4. Otherwise, if headers’s guard is "request" and name is a
  21161. // forbidden header name, return.
  21162. // Note: undici does not implement forbidden header names
  21163. if (headers[kGuard] === 'immutable') {
  21164. throw new TypeError('immutable')
  21165. } else if (headers[kGuard] === 'request-no-cors') {
  21166. // 5. Otherwise, if headers’s guard is "request-no-cors":
  21167. // TODO
  21168. }
  21169. // 6. Otherwise, if headers’s guard is "response" and name is a
  21170. // forbidden response-header name, return.
  21171. // 7. Append (name, value) to headers’s header list.
  21172. return headers[kHeadersList].append(name, value)
  21173. // 8. If headers’s guard is "request-no-cors", then remove
  21174. // privileged no-CORS request headers from headers
  21175. }
  21176. class HeadersList {
  21177. /** @type {[string, string][]|null} */
  21178. cookies = null
  21179. constructor (init) {
  21180. if (init instanceof HeadersList) {
  21181. this[kHeadersMap] = new Map(init[kHeadersMap])
  21182. this[kHeadersSortedMap] = init[kHeadersSortedMap]
  21183. this.cookies = init.cookies === null ? null : [...init.cookies]
  21184. } else {
  21185. this[kHeadersMap] = new Map(init)
  21186. this[kHeadersSortedMap] = null
  21187. }
  21188. }
  21189. // https://fetch.spec.whatwg.org/#header-list-contains
  21190. contains (name) {
  21191. // A header list list contains a header name name if list
  21192. // contains a header whose name is a byte-case-insensitive
  21193. // match for name.
  21194. name = name.toLowerCase()
  21195. return this[kHeadersMap].has(name)
  21196. }
  21197. clear () {
  21198. this[kHeadersMap].clear()
  21199. this[kHeadersSortedMap] = null
  21200. this.cookies = null
  21201. }
  21202. // https://fetch.spec.whatwg.org/#concept-header-list-append
  21203. append (name, value) {
  21204. this[kHeadersSortedMap] = null
  21205. // 1. If list contains name, then set name to the first such
  21206. // header’s name.
  21207. const lowercaseName = name.toLowerCase()
  21208. const exists = this[kHeadersMap].get(lowercaseName)
  21209. // 2. Append (name, value) to list.
  21210. if (exists) {
  21211. const delimiter = lowercaseName === 'cookie' ? '; ' : ', '
  21212. this[kHeadersMap].set(lowercaseName, {
  21213. name: exists.name,
  21214. value: `${exists.value}${delimiter}${value}`
  21215. })
  21216. } else {
  21217. this[kHeadersMap].set(lowercaseName, { name, value })
  21218. }
  21219. if (lowercaseName === 'set-cookie') {
  21220. this.cookies ??= []
  21221. this.cookies.push(value)
  21222. }
  21223. }
  21224. // https://fetch.spec.whatwg.org/#concept-header-list-set
  21225. set (name, value) {
  21226. this[kHeadersSortedMap] = null
  21227. const lowercaseName = name.toLowerCase()
  21228. if (lowercaseName === 'set-cookie') {
  21229. this.cookies = [value]
  21230. }
  21231. // 1. If list contains name, then set the value of
  21232. // the first such header to value and remove the
  21233. // others.
  21234. // 2. Otherwise, append header (name, value) to list.
  21235. this[kHeadersMap].set(lowercaseName, { name, value })
  21236. }
  21237. // https://fetch.spec.whatwg.org/#concept-header-list-delete
  21238. delete (name) {
  21239. this[kHeadersSortedMap] = null
  21240. name = name.toLowerCase()
  21241. if (name === 'set-cookie') {
  21242. this.cookies = null
  21243. }
  21244. this[kHeadersMap].delete(name)
  21245. }
  21246. // https://fetch.spec.whatwg.org/#concept-header-list-get
  21247. get (name) {
  21248. const value = this[kHeadersMap].get(name.toLowerCase())
  21249. // 1. If list does not contain name, then return null.
  21250. // 2. Return the values of all headers in list whose name
  21251. // is a byte-case-insensitive match for name,
  21252. // separated from each other by 0x2C 0x20, in order.
  21253. return value === undefined ? null : value.value
  21254. }
  21255. * [Symbol.iterator] () {
  21256. // use the lowercased name
  21257. for (const [name, { value }] of this[kHeadersMap]) {
  21258. yield [name, value]
  21259. }
  21260. }
  21261. get entries () {
  21262. const headers = {}
  21263. if (this[kHeadersMap].size) {
  21264. for (const { name, value } of this[kHeadersMap].values()) {
  21265. headers[name] = value
  21266. }
  21267. }
  21268. return headers
  21269. }
  21270. }
  21271. // https://fetch.spec.whatwg.org/#headers-class
  21272. class Headers {
  21273. constructor (init = undefined) {
  21274. if (init === kConstruct) {
  21275. return
  21276. }
  21277. this[kHeadersList] = new HeadersList()
  21278. // The new Headers(init) constructor steps are:
  21279. // 1. Set this’s guard to "none".
  21280. this[kGuard] = 'none'
  21281. // 2. If init is given, then fill this with init.
  21282. if (init !== undefined) {
  21283. init = webidl.converters.HeadersInit(init)
  21284. fill(this, init)
  21285. }
  21286. }
  21287. // https://fetch.spec.whatwg.org/#dom-headers-append
  21288. append (name, value) {
  21289. webidl.brandCheck(this, Headers)
  21290. webidl.argumentLengthCheck(arguments, 2, { header: 'Headers.append' })
  21291. name = webidl.converters.ByteString(name)
  21292. value = webidl.converters.ByteString(value)
  21293. return appendHeader(this, name, value)
  21294. }
  21295. // https://fetch.spec.whatwg.org/#dom-headers-delete
  21296. delete (name) {
  21297. webidl.brandCheck(this, Headers)
  21298. webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.delete' })
  21299. name = webidl.converters.ByteString(name)
  21300. // 1. If name is not a header name, then throw a TypeError.
  21301. if (!isValidHeaderName(name)) {
  21302. throw webidl.errors.invalidArgument({
  21303. prefix: 'Headers.delete',
  21304. value: name,
  21305. type: 'header name'
  21306. })
  21307. }
  21308. // 2. If this’s guard is "immutable", then throw a TypeError.
  21309. // 3. Otherwise, if this’s guard is "request" and name is a
  21310. // forbidden header name, return.
  21311. // 4. Otherwise, if this’s guard is "request-no-cors", name
  21312. // is not a no-CORS-safelisted request-header name, and
  21313. // name is not a privileged no-CORS request-header name,
  21314. // return.
  21315. // 5. Otherwise, if this’s guard is "response" and name is
  21316. // a forbidden response-header name, return.
  21317. // Note: undici does not implement forbidden header names
  21318. if (this[kGuard] === 'immutable') {
  21319. throw new TypeError('immutable')
  21320. } else if (this[kGuard] === 'request-no-cors') {
  21321. // TODO
  21322. }
  21323. // 6. If this’s header list does not contain name, then
  21324. // return.
  21325. if (!this[kHeadersList].contains(name)) {
  21326. return
  21327. }
  21328. // 7. Delete name from this’s header list.
  21329. // 8. If this’s guard is "request-no-cors", then remove
  21330. // privileged no-CORS request headers from this.
  21331. this[kHeadersList].delete(name)
  21332. }
  21333. // https://fetch.spec.whatwg.org/#dom-headers-get
  21334. get (name) {
  21335. webidl.brandCheck(this, Headers)
  21336. webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.get' })
  21337. name = webidl.converters.ByteString(name)
  21338. // 1. If name is not a header name, then throw a TypeError.
  21339. if (!isValidHeaderName(name)) {
  21340. throw webidl.errors.invalidArgument({
  21341. prefix: 'Headers.get',
  21342. value: name,
  21343. type: 'header name'
  21344. })
  21345. }
  21346. // 2. Return the result of getting name from this’s header
  21347. // list.
  21348. return this[kHeadersList].get(name)
  21349. }
  21350. // https://fetch.spec.whatwg.org/#dom-headers-has
  21351. has (name) {
  21352. webidl.brandCheck(this, Headers)
  21353. webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.has' })
  21354. name = webidl.converters.ByteString(name)
  21355. // 1. If name is not a header name, then throw a TypeError.
  21356. if (!isValidHeaderName(name)) {
  21357. throw webidl.errors.invalidArgument({
  21358. prefix: 'Headers.has',
  21359. value: name,
  21360. type: 'header name'
  21361. })
  21362. }
  21363. // 2. Return true if this’s header list contains name;
  21364. // otherwise false.
  21365. return this[kHeadersList].contains(name)
  21366. }
  21367. // https://fetch.spec.whatwg.org/#dom-headers-set
  21368. set (name, value) {
  21369. webidl.brandCheck(this, Headers)
  21370. webidl.argumentLengthCheck(arguments, 2, { header: 'Headers.set' })
  21371. name = webidl.converters.ByteString(name)
  21372. value = webidl.converters.ByteString(value)
  21373. // 1. Normalize value.
  21374. value = headerValueNormalize(value)
  21375. // 2. If name is not a header name or value is not a
  21376. // header value, then throw a TypeError.
  21377. if (!isValidHeaderName(name)) {
  21378. throw webidl.errors.invalidArgument({
  21379. prefix: 'Headers.set',
  21380. value: name,
  21381. type: 'header name'
  21382. })
  21383. } else if (!isValidHeaderValue(value)) {
  21384. throw webidl.errors.invalidArgument({
  21385. prefix: 'Headers.set',
  21386. value,
  21387. type: 'header value'
  21388. })
  21389. }
  21390. // 3. If this’s guard is "immutable", then throw a TypeError.
  21391. // 4. Otherwise, if this’s guard is "request" and name is a
  21392. // forbidden header name, return.
  21393. // 5. Otherwise, if this’s guard is "request-no-cors" and
  21394. // name/value is not a no-CORS-safelisted request-header,
  21395. // return.
  21396. // 6. Otherwise, if this’s guard is "response" and name is a
  21397. // forbidden response-header name, return.
  21398. // Note: undici does not implement forbidden header names
  21399. if (this[kGuard] === 'immutable') {
  21400. throw new TypeError('immutable')
  21401. } else if (this[kGuard] === 'request-no-cors') {
  21402. // TODO
  21403. }
  21404. // 7. Set (name, value) in this’s header list.
  21405. // 8. If this’s guard is "request-no-cors", then remove
  21406. // privileged no-CORS request headers from this
  21407. this[kHeadersList].set(name, value)
  21408. }
  21409. // https://fetch.spec.whatwg.org/#dom-headers-getsetcookie
  21410. getSetCookie () {
  21411. webidl.brandCheck(this, Headers)
  21412. // 1. If this’s header list does not contain `Set-Cookie`, then return « ».
  21413. // 2. Return the values of all headers in this’s header list whose name is
  21414. // a byte-case-insensitive match for `Set-Cookie`, in order.
  21415. const list = this[kHeadersList].cookies
  21416. if (list) {
  21417. return [...list]
  21418. }
  21419. return []
  21420. }
  21421. // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine
  21422. get [kHeadersSortedMap] () {
  21423. if (this[kHeadersList][kHeadersSortedMap]) {
  21424. return this[kHeadersList][kHeadersSortedMap]
  21425. }
  21426. // 1. Let headers be an empty list of headers with the key being the name
  21427. // and value the value.
  21428. const headers = []
  21429. // 2. Let names be the result of convert header names to a sorted-lowercase
  21430. // set with all the names of the headers in list.
  21431. const names = [...this[kHeadersList]].sort((a, b) => a[0] < b[0] ? -1 : 1)
  21432. const cookies = this[kHeadersList].cookies
  21433. // 3. For each name of names:
  21434. for (let i = 0; i < names.length; ++i) {
  21435. const [name, value] = names[i]
  21436. // 1. If name is `set-cookie`, then:
  21437. if (name === 'set-cookie') {
  21438. // 1. Let values be a list of all values of headers in list whose name
  21439. // is a byte-case-insensitive match for name, in order.
  21440. // 2. For each value of values:
  21441. // 1. Append (name, value) to headers.
  21442. for (let j = 0; j < cookies.length; ++j) {
  21443. headers.push([name, cookies[j]])
  21444. }
  21445. } else {
  21446. // 2. Otherwise:
  21447. // 1. Let value be the result of getting name from list.
  21448. // 2. Assert: value is non-null.
  21449. assert(value !== null)
  21450. // 3. Append (name, value) to headers.
  21451. headers.push([name, value])
  21452. }
  21453. }
  21454. this[kHeadersList][kHeadersSortedMap] = headers
  21455. // 4. Return headers.
  21456. return headers
  21457. }
  21458. keys () {
  21459. webidl.brandCheck(this, Headers)
  21460. if (this[kGuard] === 'immutable') {
  21461. const value = this[kHeadersSortedMap]
  21462. return makeIterator(() => value, 'Headers',
  21463. 'key')
  21464. }
  21465. return makeIterator(
  21466. () => [...this[kHeadersSortedMap].values()],
  21467. 'Headers',
  21468. 'key'
  21469. )
  21470. }
  21471. values () {
  21472. webidl.brandCheck(this, Headers)
  21473. if (this[kGuard] === 'immutable') {
  21474. const value = this[kHeadersSortedMap]
  21475. return makeIterator(() => value, 'Headers',
  21476. 'value')
  21477. }
  21478. return makeIterator(
  21479. () => [...this[kHeadersSortedMap].values()],
  21480. 'Headers',
  21481. 'value'
  21482. )
  21483. }
  21484. entries () {
  21485. webidl.brandCheck(this, Headers)
  21486. if (this[kGuard] === 'immutable') {
  21487. const value = this[kHeadersSortedMap]
  21488. return makeIterator(() => value, 'Headers',
  21489. 'key+value')
  21490. }
  21491. return makeIterator(
  21492. () => [...this[kHeadersSortedMap].values()],
  21493. 'Headers',
  21494. 'key+value'
  21495. )
  21496. }
  21497. /**
  21498. * @param {(value: string, key: string, self: Headers) => void} callbackFn
  21499. * @param {unknown} thisArg
  21500. */
  21501. forEach (callbackFn, thisArg = globalThis) {
  21502. webidl.brandCheck(this, Headers)
  21503. webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.forEach' })
  21504. if (typeof callbackFn !== 'function') {
  21505. throw new TypeError(
  21506. "Failed to execute 'forEach' on 'Headers': parameter 1 is not of type 'Function'."
  21507. )
  21508. }
  21509. for (const [key, value] of this) {
  21510. callbackFn.apply(thisArg, [value, key, this])
  21511. }
  21512. }
  21513. [Symbol.for('nodejs.util.inspect.custom')] () {
  21514. webidl.brandCheck(this, Headers)
  21515. return this[kHeadersList]
  21516. }
  21517. }
  21518. Headers.prototype[Symbol.iterator] = Headers.prototype.entries
  21519. Object.defineProperties(Headers.prototype, {
  21520. append: kEnumerableProperty,
  21521. delete: kEnumerableProperty,
  21522. get: kEnumerableProperty,
  21523. has: kEnumerableProperty,
  21524. set: kEnumerableProperty,
  21525. getSetCookie: kEnumerableProperty,
  21526. keys: kEnumerableProperty,
  21527. values: kEnumerableProperty,
  21528. entries: kEnumerableProperty,
  21529. forEach: kEnumerableProperty,
  21530. [Symbol.iterator]: { enumerable: false },
  21531. [Symbol.toStringTag]: {
  21532. value: 'Headers',
  21533. configurable: true
  21534. },
  21535. [util.inspect.custom]: {
  21536. enumerable: false
  21537. }
  21538. })
  21539. webidl.converters.HeadersInit = function (V) {
  21540. if (webidl.util.Type(V) === 'Object') {
  21541. if (V[Symbol.iterator]) {
  21542. return webidl.converters['sequence<sequence<ByteString>>'](V)
  21543. }
  21544. return webidl.converters['record<ByteString, ByteString>'](V)
  21545. }
  21546. throw webidl.errors.conversionFailed({
  21547. prefix: 'Headers constructor',
  21548. argument: 'Argument 1',
  21549. types: ['sequence<sequence<ByteString>>', 'record<ByteString, ByteString>']
  21550. })
  21551. }
  21552. module.exports = {
  21553. fill,
  21554. Headers,
  21555. HeadersList
  21556. }
  21557. /***/ }),
  21558. /***/ 4881:
  21559. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  21560. "use strict";
  21561. // https://github.com/Ethan-Arrowood/undici-fetch
  21562. const {
  21563. Response,
  21564. makeNetworkError,
  21565. makeAppropriateNetworkError,
  21566. filterResponse,
  21567. makeResponse
  21568. } = __nccwpck_require__(7823)
  21569. const { Headers } = __nccwpck_require__(554)
  21570. const { Request, makeRequest } = __nccwpck_require__(8359)
  21571. const zlib = __nccwpck_require__(9796)
  21572. const {
  21573. bytesMatch,
  21574. makePolicyContainer,
  21575. clonePolicyContainer,
  21576. requestBadPort,
  21577. TAOCheck,
  21578. appendRequestOriginHeader,
  21579. responseLocationURL,
  21580. requestCurrentURL,
  21581. setRequestReferrerPolicyOnRedirect,
  21582. tryUpgradeRequestToAPotentiallyTrustworthyURL,
  21583. createOpaqueTimingInfo,
  21584. appendFetchMetadata,
  21585. corsCheck,
  21586. crossOriginResourcePolicyCheck,
  21587. determineRequestsReferrer,
  21588. coarsenedSharedCurrentTime,
  21589. createDeferredPromise,
  21590. isBlobLike,
  21591. sameOrigin,
  21592. isCancelled,
  21593. isAborted,
  21594. isErrorLike,
  21595. fullyReadBody,
  21596. readableStreamClose,
  21597. isomorphicEncode,
  21598. urlIsLocal,
  21599. urlIsHttpHttpsScheme,
  21600. urlHasHttpsScheme
  21601. } = __nccwpck_require__(2538)
  21602. const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(5861)
  21603. const assert = __nccwpck_require__(9491)
  21604. const { safelyExtractBody } = __nccwpck_require__(9990)
  21605. const {
  21606. redirectStatusSet,
  21607. nullBodyStatus,
  21608. safeMethodsSet,
  21609. requestBodyHeader,
  21610. subresourceSet,
  21611. DOMException
  21612. } = __nccwpck_require__(1037)
  21613. const { kHeadersList } = __nccwpck_require__(2785)
  21614. const EE = __nccwpck_require__(2361)
  21615. const { Readable, pipeline } = __nccwpck_require__(2781)
  21616. const { addAbortListener, isErrored, isReadable, nodeMajor, nodeMinor } = __nccwpck_require__(3983)
  21617. const { dataURLProcessor, serializeAMimeType } = __nccwpck_require__(685)
  21618. const { TransformStream } = __nccwpck_require__(5356)
  21619. const { getGlobalDispatcher } = __nccwpck_require__(1892)
  21620. const { webidl } = __nccwpck_require__(1744)
  21621. const { STATUS_CODES } = __nccwpck_require__(3685)
  21622. const GET_OR_HEAD = ['GET', 'HEAD']
  21623. /** @type {import('buffer').resolveObjectURL} */
  21624. let resolveObjectURL
  21625. let ReadableStream = globalThis.ReadableStream
  21626. class Fetch extends EE {
  21627. constructor (dispatcher) {
  21628. super()
  21629. this.dispatcher = dispatcher
  21630. this.connection = null
  21631. this.dump = false
  21632. this.state = 'ongoing'
  21633. // 2 terminated listeners get added per request,
  21634. // but only 1 gets removed. If there are 20 redirects,
  21635. // 21 listeners will be added.
  21636. // See https://github.com/nodejs/undici/issues/1711
  21637. // TODO (fix): Find and fix root cause for leaked listener.
  21638. this.setMaxListeners(21)
  21639. }
  21640. terminate (reason) {
  21641. if (this.state !== 'ongoing') {
  21642. return
  21643. }
  21644. this.state = 'terminated'
  21645. this.connection?.destroy(reason)
  21646. this.emit('terminated', reason)
  21647. }
  21648. // https://fetch.spec.whatwg.org/#fetch-controller-abort
  21649. abort (error) {
  21650. if (this.state !== 'ongoing') {
  21651. return
  21652. }
  21653. // 1. Set controller’s state to "aborted".
  21654. this.state = 'aborted'
  21655. // 2. Let fallbackError be an "AbortError" DOMException.
  21656. // 3. Set error to fallbackError if it is not given.
  21657. if (!error) {
  21658. error = new DOMException('The operation was aborted.', 'AbortError')
  21659. }
  21660. // 4. Let serializedError be StructuredSerialize(error).
  21661. // If that threw an exception, catch it, and let
  21662. // serializedError be StructuredSerialize(fallbackError).
  21663. // 5. Set controller’s serialized abort reason to serializedError.
  21664. this.serializedAbortReason = error
  21665. this.connection?.destroy(error)
  21666. this.emit('terminated', error)
  21667. }
  21668. }
  21669. // https://fetch.spec.whatwg.org/#fetch-method
  21670. function fetch (input, init = {}) {
  21671. webidl.argumentLengthCheck(arguments, 1, { header: 'globalThis.fetch' })
  21672. // 1. Let p be a new promise.
  21673. const p = createDeferredPromise()
  21674. // 2. Let requestObject be the result of invoking the initial value of
  21675. // Request as constructor with input and init as arguments. If this throws
  21676. // an exception, reject p with it and return p.
  21677. let requestObject
  21678. try {
  21679. requestObject = new Request(input, init)
  21680. } catch (e) {
  21681. p.reject(e)
  21682. return p.promise
  21683. }
  21684. // 3. Let request be requestObject’s request.
  21685. const request = requestObject[kState]
  21686. // 4. If requestObject’s signal’s aborted flag is set, then:
  21687. if (requestObject.signal.aborted) {
  21688. // 1. Abort the fetch() call with p, request, null, and
  21689. // requestObject’s signal’s abort reason.
  21690. abortFetch(p, request, null, requestObject.signal.reason)
  21691. // 2. Return p.
  21692. return p.promise
  21693. }
  21694. // 5. Let globalObject be request’s client’s global object.
  21695. const globalObject = request.client.globalObject
  21696. // 6. If globalObject is a ServiceWorkerGlobalScope object, then set
  21697. // request’s service-workers mode to "none".
  21698. if (globalObject?.constructor?.name === 'ServiceWorkerGlobalScope') {
  21699. request.serviceWorkers = 'none'
  21700. }
  21701. // 7. Let responseObject be null.
  21702. let responseObject = null
  21703. // 8. Let relevantRealm be this’s relevant Realm.
  21704. const relevantRealm = null
  21705. // 9. Let locallyAborted be false.
  21706. let locallyAborted = false
  21707. // 10. Let controller be null.
  21708. let controller = null
  21709. // 11. Add the following abort steps to requestObject’s signal:
  21710. addAbortListener(
  21711. requestObject.signal,
  21712. () => {
  21713. // 1. Set locallyAborted to true.
  21714. locallyAborted = true
  21715. // 2. Assert: controller is non-null.
  21716. assert(controller != null)
  21717. // 3. Abort controller with requestObject’s signal’s abort reason.
  21718. controller.abort(requestObject.signal.reason)
  21719. // 4. Abort the fetch() call with p, request, responseObject,
  21720. // and requestObject’s signal’s abort reason.
  21721. abortFetch(p, request, responseObject, requestObject.signal.reason)
  21722. }
  21723. )
  21724. // 12. Let handleFetchDone given response response be to finalize and
  21725. // report timing with response, globalObject, and "fetch".
  21726. const handleFetchDone = (response) =>
  21727. finalizeAndReportTiming(response, 'fetch')
  21728. // 13. Set controller to the result of calling fetch given request,
  21729. // with processResponseEndOfBody set to handleFetchDone, and processResponse
  21730. // given response being these substeps:
  21731. const processResponse = (response) => {
  21732. // 1. If locallyAborted is true, terminate these substeps.
  21733. if (locallyAborted) {
  21734. return Promise.resolve()
  21735. }
  21736. // 2. If response’s aborted flag is set, then:
  21737. if (response.aborted) {
  21738. // 1. Let deserializedError be the result of deserialize a serialized
  21739. // abort reason given controller’s serialized abort reason and
  21740. // relevantRealm.
  21741. // 2. Abort the fetch() call with p, request, responseObject, and
  21742. // deserializedError.
  21743. abortFetch(p, request, responseObject, controller.serializedAbortReason)
  21744. return Promise.resolve()
  21745. }
  21746. // 3. If response is a network error, then reject p with a TypeError
  21747. // and terminate these substeps.
  21748. if (response.type === 'error') {
  21749. p.reject(
  21750. Object.assign(new TypeError('fetch failed'), { cause: response.error })
  21751. )
  21752. return Promise.resolve()
  21753. }
  21754. // 4. Set responseObject to the result of creating a Response object,
  21755. // given response, "immutable", and relevantRealm.
  21756. responseObject = new Response()
  21757. responseObject[kState] = response
  21758. responseObject[kRealm] = relevantRealm
  21759. responseObject[kHeaders][kHeadersList] = response.headersList
  21760. responseObject[kHeaders][kGuard] = 'immutable'
  21761. responseObject[kHeaders][kRealm] = relevantRealm
  21762. // 5. Resolve p with responseObject.
  21763. p.resolve(responseObject)
  21764. }
  21765. controller = fetching({
  21766. request,
  21767. processResponseEndOfBody: handleFetchDone,
  21768. processResponse,
  21769. dispatcher: init.dispatcher ?? getGlobalDispatcher() // undici
  21770. })
  21771. // 14. Return p.
  21772. return p.promise
  21773. }
  21774. // https://fetch.spec.whatwg.org/#finalize-and-report-timing
  21775. function finalizeAndReportTiming (response, initiatorType = 'other') {
  21776. // 1. If response is an aborted network error, then return.
  21777. if (response.type === 'error' && response.aborted) {
  21778. return
  21779. }
  21780. // 2. If response’s URL list is null or empty, then return.
  21781. if (!response.urlList?.length) {
  21782. return
  21783. }
  21784. // 3. Let originalURL be response’s URL list[0].
  21785. const originalURL = response.urlList[0]
  21786. // 4. Let timingInfo be response’s timing info.
  21787. let timingInfo = response.timingInfo
  21788. // 5. Let cacheState be response’s cache state.
  21789. let cacheState = response.cacheState
  21790. // 6. If originalURL’s scheme is not an HTTP(S) scheme, then return.
  21791. if (!urlIsHttpHttpsScheme(originalURL)) {
  21792. return
  21793. }
  21794. // 7. If timingInfo is null, then return.
  21795. if (timingInfo === null) {
  21796. return
  21797. }
  21798. // 8. If response’s timing allow passed flag is not set, then:
  21799. if (!response.timingAllowPassed) {
  21800. // 1. Set timingInfo to a the result of creating an opaque timing info for timingInfo.
  21801. timingInfo = createOpaqueTimingInfo({
  21802. startTime: timingInfo.startTime
  21803. })
  21804. // 2. Set cacheState to the empty string.
  21805. cacheState = ''
  21806. }
  21807. // 9. Set timingInfo’s end time to the coarsened shared current time
  21808. // given global’s relevant settings object’s cross-origin isolated
  21809. // capability.
  21810. // TODO: given global’s relevant settings object’s cross-origin isolated
  21811. // capability?
  21812. timingInfo.endTime = coarsenedSharedCurrentTime()
  21813. // 10. Set response’s timing info to timingInfo.
  21814. response.timingInfo = timingInfo
  21815. // 11. Mark resource timing for timingInfo, originalURL, initiatorType,
  21816. // global, and cacheState.
  21817. markResourceTiming(
  21818. timingInfo,
  21819. originalURL,
  21820. initiatorType,
  21821. globalThis,
  21822. cacheState
  21823. )
  21824. }
  21825. // https://w3c.github.io/resource-timing/#dfn-mark-resource-timing
  21826. function markResourceTiming (timingInfo, originalURL, initiatorType, globalThis, cacheState) {
  21827. if (nodeMajor > 18 || (nodeMajor === 18 && nodeMinor >= 2)) {
  21828. performance.markResourceTiming(timingInfo, originalURL.href, initiatorType, globalThis, cacheState)
  21829. }
  21830. }
  21831. // https://fetch.spec.whatwg.org/#abort-fetch
  21832. function abortFetch (p, request, responseObject, error) {
  21833. // Note: AbortSignal.reason was added in node v17.2.0
  21834. // which would give us an undefined error to reject with.
  21835. // Remove this once node v16 is no longer supported.
  21836. if (!error) {
  21837. error = new DOMException('The operation was aborted.', 'AbortError')
  21838. }
  21839. // 1. Reject promise with error.
  21840. p.reject(error)
  21841. // 2. If request’s body is not null and is readable, then cancel request’s
  21842. // body with error.
  21843. if (request.body != null && isReadable(request.body?.stream)) {
  21844. request.body.stream.cancel(error).catch((err) => {
  21845. if (err.code === 'ERR_INVALID_STATE') {
  21846. // Node bug?
  21847. return
  21848. }
  21849. throw err
  21850. })
  21851. }
  21852. // 3. If responseObject is null, then return.
  21853. if (responseObject == null) {
  21854. return
  21855. }
  21856. // 4. Let response be responseObject’s response.
  21857. const response = responseObject[kState]
  21858. // 5. If response’s body is not null and is readable, then error response’s
  21859. // body with error.
  21860. if (response.body != null && isReadable(response.body?.stream)) {
  21861. response.body.stream.cancel(error).catch((err) => {
  21862. if (err.code === 'ERR_INVALID_STATE') {
  21863. // Node bug?
  21864. return
  21865. }
  21866. throw err
  21867. })
  21868. }
  21869. }
  21870. // https://fetch.spec.whatwg.org/#fetching
  21871. function fetching ({
  21872. request,
  21873. processRequestBodyChunkLength,
  21874. processRequestEndOfBody,
  21875. processResponse,
  21876. processResponseEndOfBody,
  21877. processResponseConsumeBody,
  21878. useParallelQueue = false,
  21879. dispatcher // undici
  21880. }) {
  21881. // 1. Let taskDestination be null.
  21882. let taskDestination = null
  21883. // 2. Let crossOriginIsolatedCapability be false.
  21884. let crossOriginIsolatedCapability = false
  21885. // 3. If request’s client is non-null, then:
  21886. if (request.client != null) {
  21887. // 1. Set taskDestination to request’s client’s global object.
  21888. taskDestination = request.client.globalObject
  21889. // 2. Set crossOriginIsolatedCapability to request’s client’s cross-origin
  21890. // isolated capability.
  21891. crossOriginIsolatedCapability =
  21892. request.client.crossOriginIsolatedCapability
  21893. }
  21894. // 4. If useParallelQueue is true, then set taskDestination to the result of
  21895. // starting a new parallel queue.
  21896. // TODO
  21897. // 5. Let timingInfo be a new fetch timing info whose start time and
  21898. // post-redirect start time are the coarsened shared current time given
  21899. // crossOriginIsolatedCapability.
  21900. const currenTime = coarsenedSharedCurrentTime(crossOriginIsolatedCapability)
  21901. const timingInfo = createOpaqueTimingInfo({
  21902. startTime: currenTime
  21903. })
  21904. // 6. Let fetchParams be a new fetch params whose
  21905. // request is request,
  21906. // timing info is timingInfo,
  21907. // process request body chunk length is processRequestBodyChunkLength,
  21908. // process request end-of-body is processRequestEndOfBody,
  21909. // process response is processResponse,
  21910. // process response consume body is processResponseConsumeBody,
  21911. // process response end-of-body is processResponseEndOfBody,
  21912. // task destination is taskDestination,
  21913. // and cross-origin isolated capability is crossOriginIsolatedCapability.
  21914. const fetchParams = {
  21915. controller: new Fetch(dispatcher),
  21916. request,
  21917. timingInfo,
  21918. processRequestBodyChunkLength,
  21919. processRequestEndOfBody,
  21920. processResponse,
  21921. processResponseConsumeBody,
  21922. processResponseEndOfBody,
  21923. taskDestination,
  21924. crossOriginIsolatedCapability
  21925. }
  21926. // 7. If request’s body is a byte sequence, then set request’s body to
  21927. // request’s body as a body.
  21928. // NOTE: Since fetching is only called from fetch, body should already be
  21929. // extracted.
  21930. assert(!request.body || request.body.stream)
  21931. // 8. If request’s window is "client", then set request’s window to request’s
  21932. // client, if request’s client’s global object is a Window object; otherwise
  21933. // "no-window".
  21934. if (request.window === 'client') {
  21935. // TODO: What if request.client is null?
  21936. request.window =
  21937. request.client?.globalObject?.constructor?.name === 'Window'
  21938. ? request.client
  21939. : 'no-window'
  21940. }
  21941. // 9. If request’s origin is "client", then set request’s origin to request’s
  21942. // client’s origin.
  21943. if (request.origin === 'client') {
  21944. // TODO: What if request.client is null?
  21945. request.origin = request.client?.origin
  21946. }
  21947. // 10. If all of the following conditions are true:
  21948. // TODO
  21949. // 11. If request’s policy container is "client", then:
  21950. if (request.policyContainer === 'client') {
  21951. // 1. If request’s client is non-null, then set request’s policy
  21952. // container to a clone of request’s client’s policy container. [HTML]
  21953. if (request.client != null) {
  21954. request.policyContainer = clonePolicyContainer(
  21955. request.client.policyContainer
  21956. )
  21957. } else {
  21958. // 2. Otherwise, set request’s policy container to a new policy
  21959. // container.
  21960. request.policyContainer = makePolicyContainer()
  21961. }
  21962. }
  21963. // 12. If request’s header list does not contain `Accept`, then:
  21964. if (!request.headersList.contains('accept')) {
  21965. // 1. Let value be `*/*`.
  21966. const value = '*/*'
  21967. // 2. A user agent should set value to the first matching statement, if
  21968. // any, switching on request’s destination:
  21969. // "document"
  21970. // "frame"
  21971. // "iframe"
  21972. // `text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8`
  21973. // "image"
  21974. // `image/png,image/svg+xml,image/*;q=0.8,*/*;q=0.5`
  21975. // "style"
  21976. // `text/css,*/*;q=0.1`
  21977. // TODO
  21978. // 3. Append `Accept`/value to request’s header list.
  21979. request.headersList.append('accept', value)
  21980. }
  21981. // 13. If request’s header list does not contain `Accept-Language`, then
  21982. // user agents should append `Accept-Language`/an appropriate value to
  21983. // request’s header list.
  21984. if (!request.headersList.contains('accept-language')) {
  21985. request.headersList.append('accept-language', '*')
  21986. }
  21987. // 14. If request’s priority is null, then use request’s initiator and
  21988. // destination appropriately in setting request’s priority to a
  21989. // user-agent-defined object.
  21990. if (request.priority === null) {
  21991. // TODO
  21992. }
  21993. // 15. If request is a subresource request, then:
  21994. if (subresourceSet.has(request.destination)) {
  21995. // TODO
  21996. }
  21997. // 16. Run main fetch given fetchParams.
  21998. mainFetch(fetchParams)
  21999. .catch(err => {
  22000. fetchParams.controller.terminate(err)
  22001. })
  22002. // 17. Return fetchParam's controller
  22003. return fetchParams.controller
  22004. }
  22005. // https://fetch.spec.whatwg.org/#concept-main-fetch
  22006. async function mainFetch (fetchParams, recursive = false) {
  22007. // 1. Let request be fetchParams’s request.
  22008. const request = fetchParams.request
  22009. // 2. Let response be null.
  22010. let response = null
  22011. // 3. If request’s local-URLs-only flag is set and request’s current URL is
  22012. // not local, then set response to a network error.
  22013. if (request.localURLsOnly && !urlIsLocal(requestCurrentURL(request))) {
  22014. response = makeNetworkError('local URLs only')
  22015. }
  22016. // 4. Run report Content Security Policy violations for request.
  22017. // TODO
  22018. // 5. Upgrade request to a potentially trustworthy URL, if appropriate.
  22019. tryUpgradeRequestToAPotentiallyTrustworthyURL(request)
  22020. // 6. If should request be blocked due to a bad port, should fetching request
  22021. // be blocked as mixed content, or should request be blocked by Content
  22022. // Security Policy returns blocked, then set response to a network error.
  22023. if (requestBadPort(request) === 'blocked') {
  22024. response = makeNetworkError('bad port')
  22025. }
  22026. // TODO: should fetching request be blocked as mixed content?
  22027. // TODO: should request be blocked by Content Security Policy?
  22028. // 7. If request’s referrer policy is the empty string, then set request’s
  22029. // referrer policy to request’s policy container’s referrer policy.
  22030. if (request.referrerPolicy === '') {
  22031. request.referrerPolicy = request.policyContainer.referrerPolicy
  22032. }
  22033. // 8. If request’s referrer is not "no-referrer", then set request’s
  22034. // referrer to the result of invoking determine request’s referrer.
  22035. if (request.referrer !== 'no-referrer') {
  22036. request.referrer = determineRequestsReferrer(request)
  22037. }
  22038. // 9. Set request’s current URL’s scheme to "https" if all of the following
  22039. // conditions are true:
  22040. // - request’s current URL’s scheme is "http"
  22041. // - request’s current URL’s host is a domain
  22042. // - Matching request’s current URL’s host per Known HSTS Host Domain Name
  22043. // Matching results in either a superdomain match with an asserted
  22044. // includeSubDomains directive or a congruent match (with or without an
  22045. // asserted includeSubDomains directive). [HSTS]
  22046. // TODO
  22047. // 10. If recursive is false, then run the remaining steps in parallel.
  22048. // TODO
  22049. // 11. If response is null, then set response to the result of running
  22050. // the steps corresponding to the first matching statement:
  22051. if (response === null) {
  22052. response = await (async () => {
  22053. const currentURL = requestCurrentURL(request)
  22054. if (
  22055. // - request’s current URL’s origin is same origin with request’s origin,
  22056. // and request’s response tainting is "basic"
  22057. (sameOrigin(currentURL, request.url) && request.responseTainting === 'basic') ||
  22058. // request’s current URL’s scheme is "data"
  22059. (currentURL.protocol === 'data:') ||
  22060. // - request’s mode is "navigate" or "websocket"
  22061. (request.mode === 'navigate' || request.mode === 'websocket')
  22062. ) {
  22063. // 1. Set request’s response tainting to "basic".
  22064. request.responseTainting = 'basic'
  22065. // 2. Return the result of running scheme fetch given fetchParams.
  22066. return await schemeFetch(fetchParams)
  22067. }
  22068. // request’s mode is "same-origin"
  22069. if (request.mode === 'same-origin') {
  22070. // 1. Return a network error.
  22071. return makeNetworkError('request mode cannot be "same-origin"')
  22072. }
  22073. // request’s mode is "no-cors"
  22074. if (request.mode === 'no-cors') {
  22075. // 1. If request’s redirect mode is not "follow", then return a network
  22076. // error.
  22077. if (request.redirect !== 'follow') {
  22078. return makeNetworkError(
  22079. 'redirect mode cannot be "follow" for "no-cors" request'
  22080. )
  22081. }
  22082. // 2. Set request’s response tainting to "opaque".
  22083. request.responseTainting = 'opaque'
  22084. // 3. Return the result of running scheme fetch given fetchParams.
  22085. return await schemeFetch(fetchParams)
  22086. }
  22087. // request’s current URL’s scheme is not an HTTP(S) scheme
  22088. if (!urlIsHttpHttpsScheme(requestCurrentURL(request))) {
  22089. // Return a network error.
  22090. return makeNetworkError('URL scheme must be a HTTP(S) scheme')
  22091. }
  22092. // - request’s use-CORS-preflight flag is set
  22093. // - request’s unsafe-request flag is set and either request’s method is
  22094. // not a CORS-safelisted method or CORS-unsafe request-header names with
  22095. // request’s header list is not empty
  22096. // 1. Set request’s response tainting to "cors".
  22097. // 2. Let corsWithPreflightResponse be the result of running HTTP fetch
  22098. // given fetchParams and true.
  22099. // 3. If corsWithPreflightResponse is a network error, then clear cache
  22100. // entries using request.
  22101. // 4. Return corsWithPreflightResponse.
  22102. // TODO
  22103. // Otherwise
  22104. // 1. Set request’s response tainting to "cors".
  22105. request.responseTainting = 'cors'
  22106. // 2. Return the result of running HTTP fetch given fetchParams.
  22107. return await httpFetch(fetchParams)
  22108. })()
  22109. }
  22110. // 12. If recursive is true, then return response.
  22111. if (recursive) {
  22112. return response
  22113. }
  22114. // 13. If response is not a network error and response is not a filtered
  22115. // response, then:
  22116. if (response.status !== 0 && !response.internalResponse) {
  22117. // If request’s response tainting is "cors", then:
  22118. if (request.responseTainting === 'cors') {
  22119. // 1. Let headerNames be the result of extracting header list values
  22120. // given `Access-Control-Expose-Headers` and response’s header list.
  22121. // TODO
  22122. // 2. If request’s credentials mode is not "include" and headerNames
  22123. // contains `*`, then set response’s CORS-exposed header-name list to
  22124. // all unique header names in response’s header list.
  22125. // TODO
  22126. // 3. Otherwise, if headerNames is not null or failure, then set
  22127. // response’s CORS-exposed header-name list to headerNames.
  22128. // TODO
  22129. }
  22130. // Set response to the following filtered response with response as its
  22131. // internal response, depending on request’s response tainting:
  22132. if (request.responseTainting === 'basic') {
  22133. response = filterResponse(response, 'basic')
  22134. } else if (request.responseTainting === 'cors') {
  22135. response = filterResponse(response, 'cors')
  22136. } else if (request.responseTainting === 'opaque') {
  22137. response = filterResponse(response, 'opaque')
  22138. } else {
  22139. assert(false)
  22140. }
  22141. }
  22142. // 14. Let internalResponse be response, if response is a network error,
  22143. // and response’s internal response otherwise.
  22144. let internalResponse =
  22145. response.status === 0 ? response : response.internalResponse
  22146. // 15. If internalResponse’s URL list is empty, then set it to a clone of
  22147. // request’s URL list.
  22148. if (internalResponse.urlList.length === 0) {
  22149. internalResponse.urlList.push(...request.urlList)
  22150. }
  22151. // 16. If request’s timing allow failed flag is unset, then set
  22152. // internalResponse’s timing allow passed flag.
  22153. if (!request.timingAllowFailed) {
  22154. response.timingAllowPassed = true
  22155. }
  22156. // 17. If response is not a network error and any of the following returns
  22157. // blocked
  22158. // - should internalResponse to request be blocked as mixed content
  22159. // - should internalResponse to request be blocked by Content Security Policy
  22160. // - should internalResponse to request be blocked due to its MIME type
  22161. // - should internalResponse to request be blocked due to nosniff
  22162. // TODO
  22163. // 18. If response’s type is "opaque", internalResponse’s status is 206,
  22164. // internalResponse’s range-requested flag is set, and request’s header
  22165. // list does not contain `Range`, then set response and internalResponse
  22166. // to a network error.
  22167. if (
  22168. response.type === 'opaque' &&
  22169. internalResponse.status === 206 &&
  22170. internalResponse.rangeRequested &&
  22171. !request.headers.contains('range')
  22172. ) {
  22173. response = internalResponse = makeNetworkError()
  22174. }
  22175. // 19. If response is not a network error and either request’s method is
  22176. // `HEAD` or `CONNECT`, or internalResponse’s status is a null body status,
  22177. // set internalResponse’s body to null and disregard any enqueuing toward
  22178. // it (if any).
  22179. if (
  22180. response.status !== 0 &&
  22181. (request.method === 'HEAD' ||
  22182. request.method === 'CONNECT' ||
  22183. nullBodyStatus.includes(internalResponse.status))
  22184. ) {
  22185. internalResponse.body = null
  22186. fetchParams.controller.dump = true
  22187. }
  22188. // 20. If request’s integrity metadata is not the empty string, then:
  22189. if (request.integrity) {
  22190. // 1. Let processBodyError be this step: run fetch finale given fetchParams
  22191. // and a network error.
  22192. const processBodyError = (reason) =>
  22193. fetchFinale(fetchParams, makeNetworkError(reason))
  22194. // 2. If request’s response tainting is "opaque", or response’s body is null,
  22195. // then run processBodyError and abort these steps.
  22196. if (request.responseTainting === 'opaque' || response.body == null) {
  22197. processBodyError(response.error)
  22198. return
  22199. }
  22200. // 3. Let processBody given bytes be these steps:
  22201. const processBody = (bytes) => {
  22202. // 1. If bytes do not match request’s integrity metadata,
  22203. // then run processBodyError and abort these steps. [SRI]
  22204. if (!bytesMatch(bytes, request.integrity)) {
  22205. processBodyError('integrity mismatch')
  22206. return
  22207. }
  22208. // 2. Set response’s body to bytes as a body.
  22209. response.body = safelyExtractBody(bytes)[0]
  22210. // 3. Run fetch finale given fetchParams and response.
  22211. fetchFinale(fetchParams, response)
  22212. }
  22213. // 4. Fully read response’s body given processBody and processBodyError.
  22214. await fullyReadBody(response.body, processBody, processBodyError)
  22215. } else {
  22216. // 21. Otherwise, run fetch finale given fetchParams and response.
  22217. fetchFinale(fetchParams, response)
  22218. }
  22219. }
  22220. // https://fetch.spec.whatwg.org/#concept-scheme-fetch
  22221. // given a fetch params fetchParams
  22222. function schemeFetch (fetchParams) {
  22223. // Note: since the connection is destroyed on redirect, which sets fetchParams to a
  22224. // cancelled state, we do not want this condition to trigger *unless* there have been
  22225. // no redirects. See https://github.com/nodejs/undici/issues/1776
  22226. // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams.
  22227. if (isCancelled(fetchParams) && fetchParams.request.redirectCount === 0) {
  22228. return Promise.resolve(makeAppropriateNetworkError(fetchParams))
  22229. }
  22230. // 2. Let request be fetchParams’s request.
  22231. const { request } = fetchParams
  22232. const { protocol: scheme } = requestCurrentURL(request)
  22233. // 3. Switch on request’s current URL’s scheme and run the associated steps:
  22234. switch (scheme) {
  22235. case 'about:': {
  22236. // If request’s current URL’s path is the string "blank", then return a new response
  22237. // whose status message is `OK`, header list is « (`Content-Type`, `text/html;charset=utf-8`) »,
  22238. // and body is the empty byte sequence as a body.
  22239. // Otherwise, return a network error.
  22240. return Promise.resolve(makeNetworkError('about scheme is not supported'))
  22241. }
  22242. case 'blob:': {
  22243. if (!resolveObjectURL) {
  22244. resolveObjectURL = (__nccwpck_require__(4300).resolveObjectURL)
  22245. }
  22246. // 1. Let blobURLEntry be request’s current URL’s blob URL entry.
  22247. const blobURLEntry = requestCurrentURL(request)
  22248. // https://github.com/web-platform-tests/wpt/blob/7b0ebaccc62b566a1965396e5be7bb2bc06f841f/FileAPI/url/resources/fetch-tests.js#L52-L56
  22249. // Buffer.resolveObjectURL does not ignore URL queries.
  22250. if (blobURLEntry.search.length !== 0) {
  22251. return Promise.resolve(makeNetworkError('NetworkError when attempting to fetch resource.'))
  22252. }
  22253. const blobURLEntryObject = resolveObjectURL(blobURLEntry.toString())
  22254. // 2. If request’s method is not `GET`, blobURLEntry is null, or blobURLEntry’s
  22255. // object is not a Blob object, then return a network error.
  22256. if (request.method !== 'GET' || !isBlobLike(blobURLEntryObject)) {
  22257. return Promise.resolve(makeNetworkError('invalid method'))
  22258. }
  22259. // 3. Let bodyWithType be the result of safely extracting blobURLEntry’s object.
  22260. const bodyWithType = safelyExtractBody(blobURLEntryObject)
  22261. // 4. Let body be bodyWithType’s body.
  22262. const body = bodyWithType[0]
  22263. // 5. Let length be body’s length, serialized and isomorphic encoded.
  22264. const length = isomorphicEncode(`${body.length}`)
  22265. // 6. Let type be bodyWithType’s type if it is non-null; otherwise the empty byte sequence.
  22266. const type = bodyWithType[1] ?? ''
  22267. // 7. Return a new response whose status message is `OK`, header list is
  22268. // « (`Content-Length`, length), (`Content-Type`, type) », and body is body.
  22269. const response = makeResponse({
  22270. statusText: 'OK',
  22271. headersList: [
  22272. ['content-length', { name: 'Content-Length', value: length }],
  22273. ['content-type', { name: 'Content-Type', value: type }]
  22274. ]
  22275. })
  22276. response.body = body
  22277. return Promise.resolve(response)
  22278. }
  22279. case 'data:': {
  22280. // 1. Let dataURLStruct be the result of running the
  22281. // data: URL processor on request’s current URL.
  22282. const currentURL = requestCurrentURL(request)
  22283. const dataURLStruct = dataURLProcessor(currentURL)
  22284. // 2. If dataURLStruct is failure, then return a
  22285. // network error.
  22286. if (dataURLStruct === 'failure') {
  22287. return Promise.resolve(makeNetworkError('failed to fetch the data URL'))
  22288. }
  22289. // 3. Let mimeType be dataURLStruct’s MIME type, serialized.
  22290. const mimeType = serializeAMimeType(dataURLStruct.mimeType)
  22291. // 4. Return a response whose status message is `OK`,
  22292. // header list is « (`Content-Type`, mimeType) »,
  22293. // and body is dataURLStruct’s body as a body.
  22294. return Promise.resolve(makeResponse({
  22295. statusText: 'OK',
  22296. headersList: [
  22297. ['content-type', { name: 'Content-Type', value: mimeType }]
  22298. ],
  22299. body: safelyExtractBody(dataURLStruct.body)[0]
  22300. }))
  22301. }
  22302. case 'file:': {
  22303. // For now, unfortunate as it is, file URLs are left as an exercise for the reader.
  22304. // When in doubt, return a network error.
  22305. return Promise.resolve(makeNetworkError('not implemented... yet...'))
  22306. }
  22307. case 'http:':
  22308. case 'https:': {
  22309. // Return the result of running HTTP fetch given fetchParams.
  22310. return httpFetch(fetchParams)
  22311. .catch((err) => makeNetworkError(err))
  22312. }
  22313. default: {
  22314. return Promise.resolve(makeNetworkError('unknown scheme'))
  22315. }
  22316. }
  22317. }
  22318. // https://fetch.spec.whatwg.org/#finalize-response
  22319. function finalizeResponse (fetchParams, response) {
  22320. // 1. Set fetchParams’s request’s done flag.
  22321. fetchParams.request.done = true
  22322. // 2, If fetchParams’s process response done is not null, then queue a fetch
  22323. // task to run fetchParams’s process response done given response, with
  22324. // fetchParams’s task destination.
  22325. if (fetchParams.processResponseDone != null) {
  22326. queueMicrotask(() => fetchParams.processResponseDone(response))
  22327. }
  22328. }
  22329. // https://fetch.spec.whatwg.org/#fetch-finale
  22330. function fetchFinale (fetchParams, response) {
  22331. // 1. If response is a network error, then:
  22332. if (response.type === 'error') {
  22333. // 1. Set response’s URL list to « fetchParams’s request’s URL list[0] ».
  22334. response.urlList = [fetchParams.request.urlList[0]]
  22335. // 2. Set response’s timing info to the result of creating an opaque timing
  22336. // info for fetchParams’s timing info.
  22337. response.timingInfo = createOpaqueTimingInfo({
  22338. startTime: fetchParams.timingInfo.startTime
  22339. })
  22340. }
  22341. // 2. Let processResponseEndOfBody be the following steps:
  22342. const processResponseEndOfBody = () => {
  22343. // 1. Set fetchParams’s request’s done flag.
  22344. fetchParams.request.done = true
  22345. // If fetchParams’s process response end-of-body is not null,
  22346. // then queue a fetch task to run fetchParams’s process response
  22347. // end-of-body given response with fetchParams’s task destination.
  22348. if (fetchParams.processResponseEndOfBody != null) {
  22349. queueMicrotask(() => fetchParams.processResponseEndOfBody(response))
  22350. }
  22351. }
  22352. // 3. If fetchParams’s process response is non-null, then queue a fetch task
  22353. // to run fetchParams’s process response given response, with fetchParams’s
  22354. // task destination.
  22355. if (fetchParams.processResponse != null) {
  22356. queueMicrotask(() => fetchParams.processResponse(response))
  22357. }
  22358. // 4. If response’s body is null, then run processResponseEndOfBody.
  22359. if (response.body == null) {
  22360. processResponseEndOfBody()
  22361. } else {
  22362. // 5. Otherwise:
  22363. // 1. Let transformStream be a new a TransformStream.
  22364. // 2. Let identityTransformAlgorithm be an algorithm which, given chunk,
  22365. // enqueues chunk in transformStream.
  22366. const identityTransformAlgorithm = (chunk, controller) => {
  22367. controller.enqueue(chunk)
  22368. }
  22369. // 3. Set up transformStream with transformAlgorithm set to identityTransformAlgorithm
  22370. // and flushAlgorithm set to processResponseEndOfBody.
  22371. const transformStream = new TransformStream({
  22372. start () {},
  22373. transform: identityTransformAlgorithm,
  22374. flush: processResponseEndOfBody
  22375. }, {
  22376. size () {
  22377. return 1
  22378. }
  22379. }, {
  22380. size () {
  22381. return 1
  22382. }
  22383. })
  22384. // 4. Set response’s body to the result of piping response’s body through transformStream.
  22385. response.body = { stream: response.body.stream.pipeThrough(transformStream) }
  22386. }
  22387. // 6. If fetchParams’s process response consume body is non-null, then:
  22388. if (fetchParams.processResponseConsumeBody != null) {
  22389. // 1. Let processBody given nullOrBytes be this step: run fetchParams’s
  22390. // process response consume body given response and nullOrBytes.
  22391. const processBody = (nullOrBytes) => fetchParams.processResponseConsumeBody(response, nullOrBytes)
  22392. // 2. Let processBodyError be this step: run fetchParams’s process
  22393. // response consume body given response and failure.
  22394. const processBodyError = (failure) => fetchParams.processResponseConsumeBody(response, failure)
  22395. // 3. If response’s body is null, then queue a fetch task to run processBody
  22396. // given null, with fetchParams’s task destination.
  22397. if (response.body == null) {
  22398. queueMicrotask(() => processBody(null))
  22399. } else {
  22400. // 4. Otherwise, fully read response’s body given processBody, processBodyError,
  22401. // and fetchParams’s task destination.
  22402. return fullyReadBody(response.body, processBody, processBodyError)
  22403. }
  22404. return Promise.resolve()
  22405. }
  22406. }
  22407. // https://fetch.spec.whatwg.org/#http-fetch
  22408. async function httpFetch (fetchParams) {
  22409. // 1. Let request be fetchParams’s request.
  22410. const request = fetchParams.request
  22411. // 2. Let response be null.
  22412. let response = null
  22413. // 3. Let actualResponse be null.
  22414. let actualResponse = null
  22415. // 4. Let timingInfo be fetchParams’s timing info.
  22416. const timingInfo = fetchParams.timingInfo
  22417. // 5. If request’s service-workers mode is "all", then:
  22418. if (request.serviceWorkers === 'all') {
  22419. // TODO
  22420. }
  22421. // 6. If response is null, then:
  22422. if (response === null) {
  22423. // 1. If makeCORSPreflight is true and one of these conditions is true:
  22424. // TODO
  22425. // 2. If request’s redirect mode is "follow", then set request’s
  22426. // service-workers mode to "none".
  22427. if (request.redirect === 'follow') {
  22428. request.serviceWorkers = 'none'
  22429. }
  22430. // 3. Set response and actualResponse to the result of running
  22431. // HTTP-network-or-cache fetch given fetchParams.
  22432. actualResponse = response = await httpNetworkOrCacheFetch(fetchParams)
  22433. // 4. If request’s response tainting is "cors" and a CORS check
  22434. // for request and response returns failure, then return a network error.
  22435. if (
  22436. request.responseTainting === 'cors' &&
  22437. corsCheck(request, response) === 'failure'
  22438. ) {
  22439. return makeNetworkError('cors failure')
  22440. }
  22441. // 5. If the TAO check for request and response returns failure, then set
  22442. // request’s timing allow failed flag.
  22443. if (TAOCheck(request, response) === 'failure') {
  22444. request.timingAllowFailed = true
  22445. }
  22446. }
  22447. // 7. If either request’s response tainting or response’s type
  22448. // is "opaque", and the cross-origin resource policy check with
  22449. // request’s origin, request’s client, request’s destination,
  22450. // and actualResponse returns blocked, then return a network error.
  22451. if (
  22452. (request.responseTainting === 'opaque' || response.type === 'opaque') &&
  22453. crossOriginResourcePolicyCheck(
  22454. request.origin,
  22455. request.client,
  22456. request.destination,
  22457. actualResponse
  22458. ) === 'blocked'
  22459. ) {
  22460. return makeNetworkError('blocked')
  22461. }
  22462. // 8. If actualResponse’s status is a redirect status, then:
  22463. if (redirectStatusSet.has(actualResponse.status)) {
  22464. // 1. If actualResponse’s status is not 303, request’s body is not null,
  22465. // and the connection uses HTTP/2, then user agents may, and are even
  22466. // encouraged to, transmit an RST_STREAM frame.
  22467. // See, https://github.com/whatwg/fetch/issues/1288
  22468. if (request.redirect !== 'manual') {
  22469. fetchParams.controller.connection.destroy()
  22470. }
  22471. // 2. Switch on request’s redirect mode:
  22472. if (request.redirect === 'error') {
  22473. // Set response to a network error.
  22474. response = makeNetworkError('unexpected redirect')
  22475. } else if (request.redirect === 'manual') {
  22476. // Set response to an opaque-redirect filtered response whose internal
  22477. // response is actualResponse.
  22478. // NOTE(spec): On the web this would return an `opaqueredirect` response,
  22479. // but that doesn't make sense server side.
  22480. // See https://github.com/nodejs/undici/issues/1193.
  22481. response = actualResponse
  22482. } else if (request.redirect === 'follow') {
  22483. // Set response to the result of running HTTP-redirect fetch given
  22484. // fetchParams and response.
  22485. response = await httpRedirectFetch(fetchParams, response)
  22486. } else {
  22487. assert(false)
  22488. }
  22489. }
  22490. // 9. Set response’s timing info to timingInfo.
  22491. response.timingInfo = timingInfo
  22492. // 10. Return response.
  22493. return response
  22494. }
  22495. // https://fetch.spec.whatwg.org/#http-redirect-fetch
  22496. function httpRedirectFetch (fetchParams, response) {
  22497. // 1. Let request be fetchParams’s request.
  22498. const request = fetchParams.request
  22499. // 2. Let actualResponse be response, if response is not a filtered response,
  22500. // and response’s internal response otherwise.
  22501. const actualResponse = response.internalResponse
  22502. ? response.internalResponse
  22503. : response
  22504. // 3. Let locationURL be actualResponse’s location URL given request’s current
  22505. // URL’s fragment.
  22506. let locationURL
  22507. try {
  22508. locationURL = responseLocationURL(
  22509. actualResponse,
  22510. requestCurrentURL(request).hash
  22511. )
  22512. // 4. If locationURL is null, then return response.
  22513. if (locationURL == null) {
  22514. return response
  22515. }
  22516. } catch (err) {
  22517. // 5. If locationURL is failure, then return a network error.
  22518. return Promise.resolve(makeNetworkError(err))
  22519. }
  22520. // 6. If locationURL’s scheme is not an HTTP(S) scheme, then return a network
  22521. // error.
  22522. if (!urlIsHttpHttpsScheme(locationURL)) {
  22523. return Promise.resolve(makeNetworkError('URL scheme must be a HTTP(S) scheme'))
  22524. }
  22525. // 7. If request’s redirect count is 20, then return a network error.
  22526. if (request.redirectCount === 20) {
  22527. return Promise.resolve(makeNetworkError('redirect count exceeded'))
  22528. }
  22529. // 8. Increase request’s redirect count by 1.
  22530. request.redirectCount += 1
  22531. // 9. If request’s mode is "cors", locationURL includes credentials, and
  22532. // request’s origin is not same origin with locationURL’s origin, then return
  22533. // a network error.
  22534. if (
  22535. request.mode === 'cors' &&
  22536. (locationURL.username || locationURL.password) &&
  22537. !sameOrigin(request, locationURL)
  22538. ) {
  22539. return Promise.resolve(makeNetworkError('cross origin not allowed for request mode "cors"'))
  22540. }
  22541. // 10. If request’s response tainting is "cors" and locationURL includes
  22542. // credentials, then return a network error.
  22543. if (
  22544. request.responseTainting === 'cors' &&
  22545. (locationURL.username || locationURL.password)
  22546. ) {
  22547. return Promise.resolve(makeNetworkError(
  22548. 'URL cannot contain credentials for request mode "cors"'
  22549. ))
  22550. }
  22551. // 11. If actualResponse’s status is not 303, request’s body is non-null,
  22552. // and request’s body’s source is null, then return a network error.
  22553. if (
  22554. actualResponse.status !== 303 &&
  22555. request.body != null &&
  22556. request.body.source == null
  22557. ) {
  22558. return Promise.resolve(makeNetworkError())
  22559. }
  22560. // 12. If one of the following is true
  22561. // - actualResponse’s status is 301 or 302 and request’s method is `POST`
  22562. // - actualResponse’s status is 303 and request’s method is not `GET` or `HEAD`
  22563. if (
  22564. ([301, 302].includes(actualResponse.status) && request.method === 'POST') ||
  22565. (actualResponse.status === 303 &&
  22566. !GET_OR_HEAD.includes(request.method))
  22567. ) {
  22568. // then:
  22569. // 1. Set request’s method to `GET` and request’s body to null.
  22570. request.method = 'GET'
  22571. request.body = null
  22572. // 2. For each headerName of request-body-header name, delete headerName from
  22573. // request’s header list.
  22574. for (const headerName of requestBodyHeader) {
  22575. request.headersList.delete(headerName)
  22576. }
  22577. }
  22578. // 13. If request’s current URL’s origin is not same origin with locationURL’s
  22579. // origin, then for each headerName of CORS non-wildcard request-header name,
  22580. // delete headerName from request’s header list.
  22581. if (!sameOrigin(requestCurrentURL(request), locationURL)) {
  22582. // https://fetch.spec.whatwg.org/#cors-non-wildcard-request-header-name
  22583. request.headersList.delete('authorization')
  22584. // https://fetch.spec.whatwg.org/#authentication-entries
  22585. request.headersList.delete('proxy-authorization', true)
  22586. // "Cookie" and "Host" are forbidden request-headers, which undici doesn't implement.
  22587. request.headersList.delete('cookie')
  22588. request.headersList.delete('host')
  22589. }
  22590. // 14. If request’s body is non-null, then set request’s body to the first return
  22591. // value of safely extracting request’s body’s source.
  22592. if (request.body != null) {
  22593. assert(request.body.source != null)
  22594. request.body = safelyExtractBody(request.body.source)[0]
  22595. }
  22596. // 15. Let timingInfo be fetchParams’s timing info.
  22597. const timingInfo = fetchParams.timingInfo
  22598. // 16. Set timingInfo’s redirect end time and post-redirect start time to the
  22599. // coarsened shared current time given fetchParams’s cross-origin isolated
  22600. // capability.
  22601. timingInfo.redirectEndTime = timingInfo.postRedirectStartTime =
  22602. coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability)
  22603. // 17. If timingInfo’s redirect start time is 0, then set timingInfo’s
  22604. // redirect start time to timingInfo’s start time.
  22605. if (timingInfo.redirectStartTime === 0) {
  22606. timingInfo.redirectStartTime = timingInfo.startTime
  22607. }
  22608. // 18. Append locationURL to request’s URL list.
  22609. request.urlList.push(locationURL)
  22610. // 19. Invoke set request’s referrer policy on redirect on request and
  22611. // actualResponse.
  22612. setRequestReferrerPolicyOnRedirect(request, actualResponse)
  22613. // 20. Return the result of running main fetch given fetchParams and true.
  22614. return mainFetch(fetchParams, true)
  22615. }
  22616. // https://fetch.spec.whatwg.org/#http-network-or-cache-fetch
  22617. async function httpNetworkOrCacheFetch (
  22618. fetchParams,
  22619. isAuthenticationFetch = false,
  22620. isNewConnectionFetch = false
  22621. ) {
  22622. // 1. Let request be fetchParams’s request.
  22623. const request = fetchParams.request
  22624. // 2. Let httpFetchParams be null.
  22625. let httpFetchParams = null
  22626. // 3. Let httpRequest be null.
  22627. let httpRequest = null
  22628. // 4. Let response be null.
  22629. let response = null
  22630. // 5. Let storedResponse be null.
  22631. // TODO: cache
  22632. // 6. Let httpCache be null.
  22633. const httpCache = null
  22634. // 7. Let the revalidatingFlag be unset.
  22635. const revalidatingFlag = false
  22636. // 8. Run these steps, but abort when the ongoing fetch is terminated:
  22637. // 1. If request’s window is "no-window" and request’s redirect mode is
  22638. // "error", then set httpFetchParams to fetchParams and httpRequest to
  22639. // request.
  22640. if (request.window === 'no-window' && request.redirect === 'error') {
  22641. httpFetchParams = fetchParams
  22642. httpRequest = request
  22643. } else {
  22644. // Otherwise:
  22645. // 1. Set httpRequest to a clone of request.
  22646. httpRequest = makeRequest(request)
  22647. // 2. Set httpFetchParams to a copy of fetchParams.
  22648. httpFetchParams = { ...fetchParams }
  22649. // 3. Set httpFetchParams’s request to httpRequest.
  22650. httpFetchParams.request = httpRequest
  22651. }
  22652. // 3. Let includeCredentials be true if one of
  22653. const includeCredentials =
  22654. request.credentials === 'include' ||
  22655. (request.credentials === 'same-origin' &&
  22656. request.responseTainting === 'basic')
  22657. // 4. Let contentLength be httpRequest’s body’s length, if httpRequest’s
  22658. // body is non-null; otherwise null.
  22659. const contentLength = httpRequest.body ? httpRequest.body.length : null
  22660. // 5. Let contentLengthHeaderValue be null.
  22661. let contentLengthHeaderValue = null
  22662. // 6. If httpRequest’s body is null and httpRequest’s method is `POST` or
  22663. // `PUT`, then set contentLengthHeaderValue to `0`.
  22664. if (
  22665. httpRequest.body == null &&
  22666. ['POST', 'PUT'].includes(httpRequest.method)
  22667. ) {
  22668. contentLengthHeaderValue = '0'
  22669. }
  22670. // 7. If contentLength is non-null, then set contentLengthHeaderValue to
  22671. // contentLength, serialized and isomorphic encoded.
  22672. if (contentLength != null) {
  22673. contentLengthHeaderValue = isomorphicEncode(`${contentLength}`)
  22674. }
  22675. // 8. If contentLengthHeaderValue is non-null, then append
  22676. // `Content-Length`/contentLengthHeaderValue to httpRequest’s header
  22677. // list.
  22678. if (contentLengthHeaderValue != null) {
  22679. httpRequest.headersList.append('content-length', contentLengthHeaderValue)
  22680. }
  22681. // 9. If contentLengthHeaderValue is non-null, then append (`Content-Length`,
  22682. // contentLengthHeaderValue) to httpRequest’s header list.
  22683. // 10. If contentLength is non-null and httpRequest’s keepalive is true,
  22684. // then:
  22685. if (contentLength != null && httpRequest.keepalive) {
  22686. // NOTE: keepalive is a noop outside of browser context.
  22687. }
  22688. // 11. If httpRequest’s referrer is a URL, then append
  22689. // `Referer`/httpRequest’s referrer, serialized and isomorphic encoded,
  22690. // to httpRequest’s header list.
  22691. if (httpRequest.referrer instanceof URL) {
  22692. httpRequest.headersList.append('referer', isomorphicEncode(httpRequest.referrer.href))
  22693. }
  22694. // 12. Append a request `Origin` header for httpRequest.
  22695. appendRequestOriginHeader(httpRequest)
  22696. // 13. Append the Fetch metadata headers for httpRequest. [FETCH-METADATA]
  22697. appendFetchMetadata(httpRequest)
  22698. // 14. If httpRequest’s header list does not contain `User-Agent`, then
  22699. // user agents should append `User-Agent`/default `User-Agent` value to
  22700. // httpRequest’s header list.
  22701. if (!httpRequest.headersList.contains('user-agent')) {
  22702. httpRequest.headersList.append('user-agent', typeof esbuildDetection === 'undefined' ? 'undici' : 'node')
  22703. }
  22704. // 15. If httpRequest’s cache mode is "default" and httpRequest’s header
  22705. // list contains `If-Modified-Since`, `If-None-Match`,
  22706. // `If-Unmodified-Since`, `If-Match`, or `If-Range`, then set
  22707. // httpRequest’s cache mode to "no-store".
  22708. if (
  22709. httpRequest.cache === 'default' &&
  22710. (httpRequest.headersList.contains('if-modified-since') ||
  22711. httpRequest.headersList.contains('if-none-match') ||
  22712. httpRequest.headersList.contains('if-unmodified-since') ||
  22713. httpRequest.headersList.contains('if-match') ||
  22714. httpRequest.headersList.contains('if-range'))
  22715. ) {
  22716. httpRequest.cache = 'no-store'
  22717. }
  22718. // 16. If httpRequest’s cache mode is "no-cache", httpRequest’s prevent
  22719. // no-cache cache-control header modification flag is unset, and
  22720. // httpRequest’s header list does not contain `Cache-Control`, then append
  22721. // `Cache-Control`/`max-age=0` to httpRequest’s header list.
  22722. if (
  22723. httpRequest.cache === 'no-cache' &&
  22724. !httpRequest.preventNoCacheCacheControlHeaderModification &&
  22725. !httpRequest.headersList.contains('cache-control')
  22726. ) {
  22727. httpRequest.headersList.append('cache-control', 'max-age=0')
  22728. }
  22729. // 17. If httpRequest’s cache mode is "no-store" or "reload", then:
  22730. if (httpRequest.cache === 'no-store' || httpRequest.cache === 'reload') {
  22731. // 1. If httpRequest’s header list does not contain `Pragma`, then append
  22732. // `Pragma`/`no-cache` to httpRequest’s header list.
  22733. if (!httpRequest.headersList.contains('pragma')) {
  22734. httpRequest.headersList.append('pragma', 'no-cache')
  22735. }
  22736. // 2. If httpRequest’s header list does not contain `Cache-Control`,
  22737. // then append `Cache-Control`/`no-cache` to httpRequest’s header list.
  22738. if (!httpRequest.headersList.contains('cache-control')) {
  22739. httpRequest.headersList.append('cache-control', 'no-cache')
  22740. }
  22741. }
  22742. // 18. If httpRequest’s header list contains `Range`, then append
  22743. // `Accept-Encoding`/`identity` to httpRequest’s header list.
  22744. if (httpRequest.headersList.contains('range')) {
  22745. httpRequest.headersList.append('accept-encoding', 'identity')
  22746. }
  22747. // 19. Modify httpRequest’s header list per HTTP. Do not append a given
  22748. // header if httpRequest’s header list contains that header’s name.
  22749. // TODO: https://github.com/whatwg/fetch/issues/1285#issuecomment-896560129
  22750. if (!httpRequest.headersList.contains('accept-encoding')) {
  22751. if (urlHasHttpsScheme(requestCurrentURL(httpRequest))) {
  22752. httpRequest.headersList.append('accept-encoding', 'br, gzip, deflate')
  22753. } else {
  22754. httpRequest.headersList.append('accept-encoding', 'gzip, deflate')
  22755. }
  22756. }
  22757. httpRequest.headersList.delete('host')
  22758. // 20. If includeCredentials is true, then:
  22759. if (includeCredentials) {
  22760. // 1. If the user agent is not configured to block cookies for httpRequest
  22761. // (see section 7 of [COOKIES]), then:
  22762. // TODO: credentials
  22763. // 2. If httpRequest’s header list does not contain `Authorization`, then:
  22764. // TODO: credentials
  22765. }
  22766. // 21. If there’s a proxy-authentication entry, use it as appropriate.
  22767. // TODO: proxy-authentication
  22768. // 22. Set httpCache to the result of determining the HTTP cache
  22769. // partition, given httpRequest.
  22770. // TODO: cache
  22771. // 23. If httpCache is null, then set httpRequest’s cache mode to
  22772. // "no-store".
  22773. if (httpCache == null) {
  22774. httpRequest.cache = 'no-store'
  22775. }
  22776. // 24. If httpRequest’s cache mode is neither "no-store" nor "reload",
  22777. // then:
  22778. if (httpRequest.mode !== 'no-store' && httpRequest.mode !== 'reload') {
  22779. // TODO: cache
  22780. }
  22781. // 9. If aborted, then return the appropriate network error for fetchParams.
  22782. // TODO
  22783. // 10. If response is null, then:
  22784. if (response == null) {
  22785. // 1. If httpRequest’s cache mode is "only-if-cached", then return a
  22786. // network error.
  22787. if (httpRequest.mode === 'only-if-cached') {
  22788. return makeNetworkError('only if cached')
  22789. }
  22790. // 2. Let forwardResponse be the result of running HTTP-network fetch
  22791. // given httpFetchParams, includeCredentials, and isNewConnectionFetch.
  22792. const forwardResponse = await httpNetworkFetch(
  22793. httpFetchParams,
  22794. includeCredentials,
  22795. isNewConnectionFetch
  22796. )
  22797. // 3. If httpRequest’s method is unsafe and forwardResponse’s status is
  22798. // in the range 200 to 399, inclusive, invalidate appropriate stored
  22799. // responses in httpCache, as per the "Invalidation" chapter of HTTP
  22800. // Caching, and set storedResponse to null. [HTTP-CACHING]
  22801. if (
  22802. !safeMethodsSet.has(httpRequest.method) &&
  22803. forwardResponse.status >= 200 &&
  22804. forwardResponse.status <= 399
  22805. ) {
  22806. // TODO: cache
  22807. }
  22808. // 4. If the revalidatingFlag is set and forwardResponse’s status is 304,
  22809. // then:
  22810. if (revalidatingFlag && forwardResponse.status === 304) {
  22811. // TODO: cache
  22812. }
  22813. // 5. If response is null, then:
  22814. if (response == null) {
  22815. // 1. Set response to forwardResponse.
  22816. response = forwardResponse
  22817. // 2. Store httpRequest and forwardResponse in httpCache, as per the
  22818. // "Storing Responses in Caches" chapter of HTTP Caching. [HTTP-CACHING]
  22819. // TODO: cache
  22820. }
  22821. }
  22822. // 11. Set response’s URL list to a clone of httpRequest’s URL list.
  22823. response.urlList = [...httpRequest.urlList]
  22824. // 12. If httpRequest’s header list contains `Range`, then set response’s
  22825. // range-requested flag.
  22826. if (httpRequest.headersList.contains('range')) {
  22827. response.rangeRequested = true
  22828. }
  22829. // 13. Set response’s request-includes-credentials to includeCredentials.
  22830. response.requestIncludesCredentials = includeCredentials
  22831. // 14. If response’s status is 401, httpRequest’s response tainting is not
  22832. // "cors", includeCredentials is true, and request’s window is an environment
  22833. // settings object, then:
  22834. // TODO
  22835. // 15. If response’s status is 407, then:
  22836. if (response.status === 407) {
  22837. // 1. If request’s window is "no-window", then return a network error.
  22838. if (request.window === 'no-window') {
  22839. return makeNetworkError()
  22840. }
  22841. // 2. ???
  22842. // 3. If fetchParams is canceled, then return the appropriate network error for fetchParams.
  22843. if (isCancelled(fetchParams)) {
  22844. return makeAppropriateNetworkError(fetchParams)
  22845. }
  22846. // 4. Prompt the end user as appropriate in request’s window and store
  22847. // the result as a proxy-authentication entry. [HTTP-AUTH]
  22848. // TODO: Invoke some kind of callback?
  22849. // 5. Set response to the result of running HTTP-network-or-cache fetch given
  22850. // fetchParams.
  22851. // TODO
  22852. return makeNetworkError('proxy authentication required')
  22853. }
  22854. // 16. If all of the following are true
  22855. if (
  22856. // response’s status is 421
  22857. response.status === 421 &&
  22858. // isNewConnectionFetch is false
  22859. !isNewConnectionFetch &&
  22860. // request’s body is null, or request’s body is non-null and request’s body’s source is non-null
  22861. (request.body == null || request.body.source != null)
  22862. ) {
  22863. // then:
  22864. // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams.
  22865. if (isCancelled(fetchParams)) {
  22866. return makeAppropriateNetworkError(fetchParams)
  22867. }
  22868. // 2. Set response to the result of running HTTP-network-or-cache
  22869. // fetch given fetchParams, isAuthenticationFetch, and true.
  22870. // TODO (spec): The spec doesn't specify this but we need to cancel
  22871. // the active response before we can start a new one.
  22872. // https://github.com/whatwg/fetch/issues/1293
  22873. fetchParams.controller.connection.destroy()
  22874. response = await httpNetworkOrCacheFetch(
  22875. fetchParams,
  22876. isAuthenticationFetch,
  22877. true
  22878. )
  22879. }
  22880. // 17. If isAuthenticationFetch is true, then create an authentication entry
  22881. if (isAuthenticationFetch) {
  22882. // TODO
  22883. }
  22884. // 18. Return response.
  22885. return response
  22886. }
  22887. // https://fetch.spec.whatwg.org/#http-network-fetch
  22888. async function httpNetworkFetch (
  22889. fetchParams,
  22890. includeCredentials = false,
  22891. forceNewConnection = false
  22892. ) {
  22893. assert(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed)
  22894. fetchParams.controller.connection = {
  22895. abort: null,
  22896. destroyed: false,
  22897. destroy (err) {
  22898. if (!this.destroyed) {
  22899. this.destroyed = true
  22900. this.abort?.(err ?? new DOMException('The operation was aborted.', 'AbortError'))
  22901. }
  22902. }
  22903. }
  22904. // 1. Let request be fetchParams’s request.
  22905. const request = fetchParams.request
  22906. // 2. Let response be null.
  22907. let response = null
  22908. // 3. Let timingInfo be fetchParams’s timing info.
  22909. const timingInfo = fetchParams.timingInfo
  22910. // 4. Let httpCache be the result of determining the HTTP cache partition,
  22911. // given request.
  22912. // TODO: cache
  22913. const httpCache = null
  22914. // 5. If httpCache is null, then set request’s cache mode to "no-store".
  22915. if (httpCache == null) {
  22916. request.cache = 'no-store'
  22917. }
  22918. // 6. Let networkPartitionKey be the result of determining the network
  22919. // partition key given request.
  22920. // TODO
  22921. // 7. Let newConnection be "yes" if forceNewConnection is true; otherwise
  22922. // "no".
  22923. const newConnection = forceNewConnection ? 'yes' : 'no' // eslint-disable-line no-unused-vars
  22924. // 8. Switch on request’s mode:
  22925. if (request.mode === 'websocket') {
  22926. // Let connection be the result of obtaining a WebSocket connection,
  22927. // given request’s current URL.
  22928. // TODO
  22929. } else {
  22930. // Let connection be the result of obtaining a connection, given
  22931. // networkPartitionKey, request’s current URL’s origin,
  22932. // includeCredentials, and forceNewConnection.
  22933. // TODO
  22934. }
  22935. // 9. Run these steps, but abort when the ongoing fetch is terminated:
  22936. // 1. If connection is failure, then return a network error.
  22937. // 2. Set timingInfo’s final connection timing info to the result of
  22938. // calling clamp and coarsen connection timing info with connection’s
  22939. // timing info, timingInfo’s post-redirect start time, and fetchParams’s
  22940. // cross-origin isolated capability.
  22941. // 3. If connection is not an HTTP/2 connection, request’s body is non-null,
  22942. // and request’s body’s source is null, then append (`Transfer-Encoding`,
  22943. // `chunked`) to request’s header list.
  22944. // 4. Set timingInfo’s final network-request start time to the coarsened
  22945. // shared current time given fetchParams’s cross-origin isolated
  22946. // capability.
  22947. // 5. Set response to the result of making an HTTP request over connection
  22948. // using request with the following caveats:
  22949. // - Follow the relevant requirements from HTTP. [HTTP] [HTTP-SEMANTICS]
  22950. // [HTTP-COND] [HTTP-CACHING] [HTTP-AUTH]
  22951. // - If request’s body is non-null, and request’s body’s source is null,
  22952. // then the user agent may have a buffer of up to 64 kibibytes and store
  22953. // a part of request’s body in that buffer. If the user agent reads from
  22954. // request’s body beyond that buffer’s size and the user agent needs to
  22955. // resend request, then instead return a network error.
  22956. // - Set timingInfo’s final network-response start time to the coarsened
  22957. // shared current time given fetchParams’s cross-origin isolated capability,
  22958. // immediately after the user agent’s HTTP parser receives the first byte
  22959. // of the response (e.g., frame header bytes for HTTP/2 or response status
  22960. // line for HTTP/1.x).
  22961. // - Wait until all the headers are transmitted.
  22962. // - Any responses whose status is in the range 100 to 199, inclusive,
  22963. // and is not 101, are to be ignored, except for the purposes of setting
  22964. // timingInfo’s final network-response start time above.
  22965. // - If request’s header list contains `Transfer-Encoding`/`chunked` and
  22966. // response is transferred via HTTP/1.0 or older, then return a network
  22967. // error.
  22968. // - If the HTTP request results in a TLS client certificate dialog, then:
  22969. // 1. If request’s window is an environment settings object, make the
  22970. // dialog available in request’s window.
  22971. // 2. Otherwise, return a network error.
  22972. // To transmit request’s body body, run these steps:
  22973. let requestBody = null
  22974. // 1. If body is null and fetchParams’s process request end-of-body is
  22975. // non-null, then queue a fetch task given fetchParams’s process request
  22976. // end-of-body and fetchParams’s task destination.
  22977. if (request.body == null && fetchParams.processRequestEndOfBody) {
  22978. queueMicrotask(() => fetchParams.processRequestEndOfBody())
  22979. } else if (request.body != null) {
  22980. // 2. Otherwise, if body is non-null:
  22981. // 1. Let processBodyChunk given bytes be these steps:
  22982. const processBodyChunk = async function * (bytes) {
  22983. // 1. If the ongoing fetch is terminated, then abort these steps.
  22984. if (isCancelled(fetchParams)) {
  22985. return
  22986. }
  22987. // 2. Run this step in parallel: transmit bytes.
  22988. yield bytes
  22989. // 3. If fetchParams’s process request body is non-null, then run
  22990. // fetchParams’s process request body given bytes’s length.
  22991. fetchParams.processRequestBodyChunkLength?.(bytes.byteLength)
  22992. }
  22993. // 2. Let processEndOfBody be these steps:
  22994. const processEndOfBody = () => {
  22995. // 1. If fetchParams is canceled, then abort these steps.
  22996. if (isCancelled(fetchParams)) {
  22997. return
  22998. }
  22999. // 2. If fetchParams’s process request end-of-body is non-null,
  23000. // then run fetchParams’s process request end-of-body.
  23001. if (fetchParams.processRequestEndOfBody) {
  23002. fetchParams.processRequestEndOfBody()
  23003. }
  23004. }
  23005. // 3. Let processBodyError given e be these steps:
  23006. const processBodyError = (e) => {
  23007. // 1. If fetchParams is canceled, then abort these steps.
  23008. if (isCancelled(fetchParams)) {
  23009. return
  23010. }
  23011. // 2. If e is an "AbortError" DOMException, then abort fetchParams’s controller.
  23012. if (e.name === 'AbortError') {
  23013. fetchParams.controller.abort()
  23014. } else {
  23015. fetchParams.controller.terminate(e)
  23016. }
  23017. }
  23018. // 4. Incrementally read request’s body given processBodyChunk, processEndOfBody,
  23019. // processBodyError, and fetchParams’s task destination.
  23020. requestBody = (async function * () {
  23021. try {
  23022. for await (const bytes of request.body.stream) {
  23023. yield * processBodyChunk(bytes)
  23024. }
  23025. processEndOfBody()
  23026. } catch (err) {
  23027. processBodyError(err)
  23028. }
  23029. })()
  23030. }
  23031. try {
  23032. // socket is only provided for websockets
  23033. const { body, status, statusText, headersList, socket } = await dispatch({ body: requestBody })
  23034. if (socket) {
  23035. response = makeResponse({ status, statusText, headersList, socket })
  23036. } else {
  23037. const iterator = body[Symbol.asyncIterator]()
  23038. fetchParams.controller.next = () => iterator.next()
  23039. response = makeResponse({ status, statusText, headersList })
  23040. }
  23041. } catch (err) {
  23042. // 10. If aborted, then:
  23043. if (err.name === 'AbortError') {
  23044. // 1. If connection uses HTTP/2, then transmit an RST_STREAM frame.
  23045. fetchParams.controller.connection.destroy()
  23046. // 2. Return the appropriate network error for fetchParams.
  23047. return makeAppropriateNetworkError(fetchParams, err)
  23048. }
  23049. return makeNetworkError(err)
  23050. }
  23051. // 11. Let pullAlgorithm be an action that resumes the ongoing fetch
  23052. // if it is suspended.
  23053. const pullAlgorithm = () => {
  23054. fetchParams.controller.resume()
  23055. }
  23056. // 12. Let cancelAlgorithm be an algorithm that aborts fetchParams’s
  23057. // controller with reason, given reason.
  23058. const cancelAlgorithm = (reason) => {
  23059. fetchParams.controller.abort(reason)
  23060. }
  23061. // 13. Let highWaterMark be a non-negative, non-NaN number, chosen by
  23062. // the user agent.
  23063. // TODO
  23064. // 14. Let sizeAlgorithm be an algorithm that accepts a chunk object
  23065. // and returns a non-negative, non-NaN, non-infinite number, chosen by the user agent.
  23066. // TODO
  23067. // 15. Let stream be a new ReadableStream.
  23068. // 16. Set up stream with pullAlgorithm set to pullAlgorithm,
  23069. // cancelAlgorithm set to cancelAlgorithm, highWaterMark set to
  23070. // highWaterMark, and sizeAlgorithm set to sizeAlgorithm.
  23071. if (!ReadableStream) {
  23072. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  23073. }
  23074. const stream = new ReadableStream(
  23075. {
  23076. async start (controller) {
  23077. fetchParams.controller.controller = controller
  23078. },
  23079. async pull (controller) {
  23080. await pullAlgorithm(controller)
  23081. },
  23082. async cancel (reason) {
  23083. await cancelAlgorithm(reason)
  23084. }
  23085. },
  23086. {
  23087. highWaterMark: 0,
  23088. size () {
  23089. return 1
  23090. }
  23091. }
  23092. )
  23093. // 17. Run these steps, but abort when the ongoing fetch is terminated:
  23094. // 1. Set response’s body to a new body whose stream is stream.
  23095. response.body = { stream }
  23096. // 2. If response is not a network error and request’s cache mode is
  23097. // not "no-store", then update response in httpCache for request.
  23098. // TODO
  23099. // 3. If includeCredentials is true and the user agent is not configured
  23100. // to block cookies for request (see section 7 of [COOKIES]), then run the
  23101. // "set-cookie-string" parsing algorithm (see section 5.2 of [COOKIES]) on
  23102. // the value of each header whose name is a byte-case-insensitive match for
  23103. // `Set-Cookie` in response’s header list, if any, and request’s current URL.
  23104. // TODO
  23105. // 18. If aborted, then:
  23106. // TODO
  23107. // 19. Run these steps in parallel:
  23108. // 1. Run these steps, but abort when fetchParams is canceled:
  23109. fetchParams.controller.on('terminated', onAborted)
  23110. fetchParams.controller.resume = async () => {
  23111. // 1. While true
  23112. while (true) {
  23113. // 1-3. See onData...
  23114. // 4. Set bytes to the result of handling content codings given
  23115. // codings and bytes.
  23116. let bytes
  23117. let isFailure
  23118. try {
  23119. const { done, value } = await fetchParams.controller.next()
  23120. if (isAborted(fetchParams)) {
  23121. break
  23122. }
  23123. bytes = done ? undefined : value
  23124. } catch (err) {
  23125. if (fetchParams.controller.ended && !timingInfo.encodedBodySize) {
  23126. // zlib doesn't like empty streams.
  23127. bytes = undefined
  23128. } else {
  23129. bytes = err
  23130. // err may be propagated from the result of calling readablestream.cancel,
  23131. // which might not be an error. https://github.com/nodejs/undici/issues/2009
  23132. isFailure = true
  23133. }
  23134. }
  23135. if (bytes === undefined) {
  23136. // 2. Otherwise, if the bytes transmission for response’s message
  23137. // body is done normally and stream is readable, then close
  23138. // stream, finalize response for fetchParams and response, and
  23139. // abort these in-parallel steps.
  23140. readableStreamClose(fetchParams.controller.controller)
  23141. finalizeResponse(fetchParams, response)
  23142. return
  23143. }
  23144. // 5. Increase timingInfo’s decoded body size by bytes’s length.
  23145. timingInfo.decodedBodySize += bytes?.byteLength ?? 0
  23146. // 6. If bytes is failure, then terminate fetchParams’s controller.
  23147. if (isFailure) {
  23148. fetchParams.controller.terminate(bytes)
  23149. return
  23150. }
  23151. // 7. Enqueue a Uint8Array wrapping an ArrayBuffer containing bytes
  23152. // into stream.
  23153. fetchParams.controller.controller.enqueue(new Uint8Array(bytes))
  23154. // 8. If stream is errored, then terminate the ongoing fetch.
  23155. if (isErrored(stream)) {
  23156. fetchParams.controller.terminate()
  23157. return
  23158. }
  23159. // 9. If stream doesn’t need more data ask the user agent to suspend
  23160. // the ongoing fetch.
  23161. if (!fetchParams.controller.controller.desiredSize) {
  23162. return
  23163. }
  23164. }
  23165. }
  23166. // 2. If aborted, then:
  23167. function onAborted (reason) {
  23168. // 2. If fetchParams is aborted, then:
  23169. if (isAborted(fetchParams)) {
  23170. // 1. Set response’s aborted flag.
  23171. response.aborted = true
  23172. // 2. If stream is readable, then error stream with the result of
  23173. // deserialize a serialized abort reason given fetchParams’s
  23174. // controller’s serialized abort reason and an
  23175. // implementation-defined realm.
  23176. if (isReadable(stream)) {
  23177. fetchParams.controller.controller.error(
  23178. fetchParams.controller.serializedAbortReason
  23179. )
  23180. }
  23181. } else {
  23182. // 3. Otherwise, if stream is readable, error stream with a TypeError.
  23183. if (isReadable(stream)) {
  23184. fetchParams.controller.controller.error(new TypeError('terminated', {
  23185. cause: isErrorLike(reason) ? reason : undefined
  23186. }))
  23187. }
  23188. }
  23189. // 4. If connection uses HTTP/2, then transmit an RST_STREAM frame.
  23190. // 5. Otherwise, the user agent should close connection unless it would be bad for performance to do so.
  23191. fetchParams.controller.connection.destroy()
  23192. }
  23193. // 20. Return response.
  23194. return response
  23195. async function dispatch ({ body }) {
  23196. const url = requestCurrentURL(request)
  23197. /** @type {import('../..').Agent} */
  23198. const agent = fetchParams.controller.dispatcher
  23199. return new Promise((resolve, reject) => agent.dispatch(
  23200. {
  23201. path: url.pathname + url.search,
  23202. origin: url.origin,
  23203. method: request.method,
  23204. body: fetchParams.controller.dispatcher.isMockActive ? request.body && (request.body.source || request.body.stream) : body,
  23205. headers: request.headersList.entries,
  23206. maxRedirections: 0,
  23207. upgrade: request.mode === 'websocket' ? 'websocket' : undefined
  23208. },
  23209. {
  23210. body: null,
  23211. abort: null,
  23212. onConnect (abort) {
  23213. // TODO (fix): Do we need connection here?
  23214. const { connection } = fetchParams.controller
  23215. if (connection.destroyed) {
  23216. abort(new DOMException('The operation was aborted.', 'AbortError'))
  23217. } else {
  23218. fetchParams.controller.on('terminated', abort)
  23219. this.abort = connection.abort = abort
  23220. }
  23221. },
  23222. onHeaders (status, headersList, resume, statusText) {
  23223. if (status < 200) {
  23224. return
  23225. }
  23226. let codings = []
  23227. let location = ''
  23228. const headers = new Headers()
  23229. // For H2, the headers are a plain JS object
  23230. // We distinguish between them and iterate accordingly
  23231. if (Array.isArray(headersList)) {
  23232. for (let n = 0; n < headersList.length; n += 2) {
  23233. const key = headersList[n + 0].toString('latin1')
  23234. const val = headersList[n + 1].toString('latin1')
  23235. if (key.toLowerCase() === 'content-encoding') {
  23236. // https://www.rfc-editor.org/rfc/rfc7231#section-3.1.2.1
  23237. // "All content-coding values are case-insensitive..."
  23238. codings = val.toLowerCase().split(',').map((x) => x.trim())
  23239. } else if (key.toLowerCase() === 'location') {
  23240. location = val
  23241. }
  23242. headers[kHeadersList].append(key, val)
  23243. }
  23244. } else {
  23245. const keys = Object.keys(headersList)
  23246. for (const key of keys) {
  23247. const val = headersList[key]
  23248. if (key.toLowerCase() === 'content-encoding') {
  23249. // https://www.rfc-editor.org/rfc/rfc7231#section-3.1.2.1
  23250. // "All content-coding values are case-insensitive..."
  23251. codings = val.toLowerCase().split(',').map((x) => x.trim()).reverse()
  23252. } else if (key.toLowerCase() === 'location') {
  23253. location = val
  23254. }
  23255. headers[kHeadersList].append(key, val)
  23256. }
  23257. }
  23258. this.body = new Readable({ read: resume })
  23259. const decoders = []
  23260. const willFollow = request.redirect === 'follow' &&
  23261. location &&
  23262. redirectStatusSet.has(status)
  23263. // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding
  23264. if (request.method !== 'HEAD' && request.method !== 'CONNECT' && !nullBodyStatus.includes(status) && !willFollow) {
  23265. for (const coding of codings) {
  23266. // https://www.rfc-editor.org/rfc/rfc9112.html#section-7.2
  23267. if (coding === 'x-gzip' || coding === 'gzip') {
  23268. decoders.push(zlib.createGunzip({
  23269. // Be less strict when decoding compressed responses, since sometimes
  23270. // servers send slightly invalid responses that are still accepted
  23271. // by common browsers.
  23272. // Always using Z_SYNC_FLUSH is what cURL does.
  23273. flush: zlib.constants.Z_SYNC_FLUSH,
  23274. finishFlush: zlib.constants.Z_SYNC_FLUSH
  23275. }))
  23276. } else if (coding === 'deflate') {
  23277. decoders.push(zlib.createInflate())
  23278. } else if (coding === 'br') {
  23279. decoders.push(zlib.createBrotliDecompress())
  23280. } else {
  23281. decoders.length = 0
  23282. break
  23283. }
  23284. }
  23285. }
  23286. resolve({
  23287. status,
  23288. statusText,
  23289. headersList: headers[kHeadersList],
  23290. body: decoders.length
  23291. ? pipeline(this.body, ...decoders, () => { })
  23292. : this.body.on('error', () => {})
  23293. })
  23294. return true
  23295. },
  23296. onData (chunk) {
  23297. if (fetchParams.controller.dump) {
  23298. return
  23299. }
  23300. // 1. If one or more bytes have been transmitted from response’s
  23301. // message body, then:
  23302. // 1. Let bytes be the transmitted bytes.
  23303. const bytes = chunk
  23304. // 2. Let codings be the result of extracting header list values
  23305. // given `Content-Encoding` and response’s header list.
  23306. // See pullAlgorithm.
  23307. // 3. Increase timingInfo’s encoded body size by bytes’s length.
  23308. timingInfo.encodedBodySize += bytes.byteLength
  23309. // 4. See pullAlgorithm...
  23310. return this.body.push(bytes)
  23311. },
  23312. onComplete () {
  23313. if (this.abort) {
  23314. fetchParams.controller.off('terminated', this.abort)
  23315. }
  23316. fetchParams.controller.ended = true
  23317. this.body.push(null)
  23318. },
  23319. onError (error) {
  23320. if (this.abort) {
  23321. fetchParams.controller.off('terminated', this.abort)
  23322. }
  23323. this.body?.destroy(error)
  23324. fetchParams.controller.terminate(error)
  23325. reject(error)
  23326. },
  23327. onUpgrade (status, headersList, socket) {
  23328. if (status !== 101) {
  23329. return
  23330. }
  23331. const headers = new Headers()
  23332. for (let n = 0; n < headersList.length; n += 2) {
  23333. const key = headersList[n + 0].toString('latin1')
  23334. const val = headersList[n + 1].toString('latin1')
  23335. headers[kHeadersList].append(key, val)
  23336. }
  23337. resolve({
  23338. status,
  23339. statusText: STATUS_CODES[status],
  23340. headersList: headers[kHeadersList],
  23341. socket
  23342. })
  23343. return true
  23344. }
  23345. }
  23346. ))
  23347. }
  23348. }
  23349. module.exports = {
  23350. fetch,
  23351. Fetch,
  23352. fetching,
  23353. finalizeAndReportTiming
  23354. }
  23355. /***/ }),
  23356. /***/ 8359:
  23357. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  23358. "use strict";
  23359. /* globals AbortController */
  23360. const { extractBody, mixinBody, cloneBody } = __nccwpck_require__(9990)
  23361. const { Headers, fill: fillHeaders, HeadersList } = __nccwpck_require__(554)
  23362. const { FinalizationRegistry } = __nccwpck_require__(6436)()
  23363. const util = __nccwpck_require__(3983)
  23364. const {
  23365. isValidHTTPToken,
  23366. sameOrigin,
  23367. normalizeMethod,
  23368. makePolicyContainer,
  23369. normalizeMethodRecord
  23370. } = __nccwpck_require__(2538)
  23371. const {
  23372. forbiddenMethodsSet,
  23373. corsSafeListedMethodsSet,
  23374. referrerPolicy,
  23375. requestRedirect,
  23376. requestMode,
  23377. requestCredentials,
  23378. requestCache,
  23379. requestDuplex
  23380. } = __nccwpck_require__(1037)
  23381. const { kEnumerableProperty } = util
  23382. const { kHeaders, kSignal, kState, kGuard, kRealm } = __nccwpck_require__(5861)
  23383. const { webidl } = __nccwpck_require__(1744)
  23384. const { getGlobalOrigin } = __nccwpck_require__(1246)
  23385. const { URLSerializer } = __nccwpck_require__(685)
  23386. const { kHeadersList, kConstruct } = __nccwpck_require__(2785)
  23387. const assert = __nccwpck_require__(9491)
  23388. const { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = __nccwpck_require__(2361)
  23389. let TransformStream = globalThis.TransformStream
  23390. const kAbortController = Symbol('abortController')
  23391. const requestFinalizer = new FinalizationRegistry(({ signal, abort }) => {
  23392. signal.removeEventListener('abort', abort)
  23393. })
  23394. // https://fetch.spec.whatwg.org/#request-class
  23395. class Request {
  23396. // https://fetch.spec.whatwg.org/#dom-request
  23397. constructor (input, init = {}) {
  23398. if (input === kConstruct) {
  23399. return
  23400. }
  23401. webidl.argumentLengthCheck(arguments, 1, { header: 'Request constructor' })
  23402. input = webidl.converters.RequestInfo(input)
  23403. init = webidl.converters.RequestInit(init)
  23404. // https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object
  23405. this[kRealm] = {
  23406. settingsObject: {
  23407. baseUrl: getGlobalOrigin(),
  23408. get origin () {
  23409. return this.baseUrl?.origin
  23410. },
  23411. policyContainer: makePolicyContainer()
  23412. }
  23413. }
  23414. // 1. Let request be null.
  23415. let request = null
  23416. // 2. Let fallbackMode be null.
  23417. let fallbackMode = null
  23418. // 3. Let baseURL be this’s relevant settings object’s API base URL.
  23419. const baseUrl = this[kRealm].settingsObject.baseUrl
  23420. // 4. Let signal be null.
  23421. let signal = null
  23422. // 5. If input is a string, then:
  23423. if (typeof input === 'string') {
  23424. // 1. Let parsedURL be the result of parsing input with baseURL.
  23425. // 2. If parsedURL is failure, then throw a TypeError.
  23426. let parsedURL
  23427. try {
  23428. parsedURL = new URL(input, baseUrl)
  23429. } catch (err) {
  23430. throw new TypeError('Failed to parse URL from ' + input, { cause: err })
  23431. }
  23432. // 3. If parsedURL includes credentials, then throw a TypeError.
  23433. if (parsedURL.username || parsedURL.password) {
  23434. throw new TypeError(
  23435. 'Request cannot be constructed from a URL that includes credentials: ' +
  23436. input
  23437. )
  23438. }
  23439. // 4. Set request to a new request whose URL is parsedURL.
  23440. request = makeRequest({ urlList: [parsedURL] })
  23441. // 5. Set fallbackMode to "cors".
  23442. fallbackMode = 'cors'
  23443. } else {
  23444. // 6. Otherwise:
  23445. // 7. Assert: input is a Request object.
  23446. assert(input instanceof Request)
  23447. // 8. Set request to input’s request.
  23448. request = input[kState]
  23449. // 9. Set signal to input’s signal.
  23450. signal = input[kSignal]
  23451. }
  23452. // 7. Let origin be this’s relevant settings object’s origin.
  23453. const origin = this[kRealm].settingsObject.origin
  23454. // 8. Let window be "client".
  23455. let window = 'client'
  23456. // 9. If request’s window is an environment settings object and its origin
  23457. // is same origin with origin, then set window to request’s window.
  23458. if (
  23459. request.window?.constructor?.name === 'EnvironmentSettingsObject' &&
  23460. sameOrigin(request.window, origin)
  23461. ) {
  23462. window = request.window
  23463. }
  23464. // 10. If init["window"] exists and is non-null, then throw a TypeError.
  23465. if (init.window != null) {
  23466. throw new TypeError(`'window' option '${window}' must be null`)
  23467. }
  23468. // 11. If init["window"] exists, then set window to "no-window".
  23469. if ('window' in init) {
  23470. window = 'no-window'
  23471. }
  23472. // 12. Set request to a new request with the following properties:
  23473. request = makeRequest({
  23474. // URL request’s URL.
  23475. // undici implementation note: this is set as the first item in request's urlList in makeRequest
  23476. // method request’s method.
  23477. method: request.method,
  23478. // header list A copy of request’s header list.
  23479. // undici implementation note: headersList is cloned in makeRequest
  23480. headersList: request.headersList,
  23481. // unsafe-request flag Set.
  23482. unsafeRequest: request.unsafeRequest,
  23483. // client This’s relevant settings object.
  23484. client: this[kRealm].settingsObject,
  23485. // window window.
  23486. window,
  23487. // priority request’s priority.
  23488. priority: request.priority,
  23489. // origin request’s origin. The propagation of the origin is only significant for navigation requests
  23490. // being handled by a service worker. In this scenario a request can have an origin that is different
  23491. // from the current client.
  23492. origin: request.origin,
  23493. // referrer request’s referrer.
  23494. referrer: request.referrer,
  23495. // referrer policy request’s referrer policy.
  23496. referrerPolicy: request.referrerPolicy,
  23497. // mode request’s mode.
  23498. mode: request.mode,
  23499. // credentials mode request’s credentials mode.
  23500. credentials: request.credentials,
  23501. // cache mode request’s cache mode.
  23502. cache: request.cache,
  23503. // redirect mode request’s redirect mode.
  23504. redirect: request.redirect,
  23505. // integrity metadata request’s integrity metadata.
  23506. integrity: request.integrity,
  23507. // keepalive request’s keepalive.
  23508. keepalive: request.keepalive,
  23509. // reload-navigation flag request’s reload-navigation flag.
  23510. reloadNavigation: request.reloadNavigation,
  23511. // history-navigation flag request’s history-navigation flag.
  23512. historyNavigation: request.historyNavigation,
  23513. // URL list A clone of request’s URL list.
  23514. urlList: [...request.urlList]
  23515. })
  23516. const initHasKey = Object.keys(init).length !== 0
  23517. // 13. If init is not empty, then:
  23518. if (initHasKey) {
  23519. // 1. If request’s mode is "navigate", then set it to "same-origin".
  23520. if (request.mode === 'navigate') {
  23521. request.mode = 'same-origin'
  23522. }
  23523. // 2. Unset request’s reload-navigation flag.
  23524. request.reloadNavigation = false
  23525. // 3. Unset request’s history-navigation flag.
  23526. request.historyNavigation = false
  23527. // 4. Set request’s origin to "client".
  23528. request.origin = 'client'
  23529. // 5. Set request’s referrer to "client"
  23530. request.referrer = 'client'
  23531. // 6. Set request’s referrer policy to the empty string.
  23532. request.referrerPolicy = ''
  23533. // 7. Set request’s URL to request’s current URL.
  23534. request.url = request.urlList[request.urlList.length - 1]
  23535. // 8. Set request’s URL list to « request’s URL ».
  23536. request.urlList = [request.url]
  23537. }
  23538. // 14. If init["referrer"] exists, then:
  23539. if (init.referrer !== undefined) {
  23540. // 1. Let referrer be init["referrer"].
  23541. const referrer = init.referrer
  23542. // 2. If referrer is the empty string, then set request’s referrer to "no-referrer".
  23543. if (referrer === '') {
  23544. request.referrer = 'no-referrer'
  23545. } else {
  23546. // 1. Let parsedReferrer be the result of parsing referrer with
  23547. // baseURL.
  23548. // 2. If parsedReferrer is failure, then throw a TypeError.
  23549. let parsedReferrer
  23550. try {
  23551. parsedReferrer = new URL(referrer, baseUrl)
  23552. } catch (err) {
  23553. throw new TypeError(`Referrer "${referrer}" is not a valid URL.`, { cause: err })
  23554. }
  23555. // 3. If one of the following is true
  23556. // - parsedReferrer’s scheme is "about" and path is the string "client"
  23557. // - parsedReferrer’s origin is not same origin with origin
  23558. // then set request’s referrer to "client".
  23559. if (
  23560. (parsedReferrer.protocol === 'about:' && parsedReferrer.hostname === 'client') ||
  23561. (origin && !sameOrigin(parsedReferrer, this[kRealm].settingsObject.baseUrl))
  23562. ) {
  23563. request.referrer = 'client'
  23564. } else {
  23565. // 4. Otherwise, set request’s referrer to parsedReferrer.
  23566. request.referrer = parsedReferrer
  23567. }
  23568. }
  23569. }
  23570. // 15. If init["referrerPolicy"] exists, then set request’s referrer policy
  23571. // to it.
  23572. if (init.referrerPolicy !== undefined) {
  23573. request.referrerPolicy = init.referrerPolicy
  23574. }
  23575. // 16. Let mode be init["mode"] if it exists, and fallbackMode otherwise.
  23576. let mode
  23577. if (init.mode !== undefined) {
  23578. mode = init.mode
  23579. } else {
  23580. mode = fallbackMode
  23581. }
  23582. // 17. If mode is "navigate", then throw a TypeError.
  23583. if (mode === 'navigate') {
  23584. throw webidl.errors.exception({
  23585. header: 'Request constructor',
  23586. message: 'invalid request mode navigate.'
  23587. })
  23588. }
  23589. // 18. If mode is non-null, set request’s mode to mode.
  23590. if (mode != null) {
  23591. request.mode = mode
  23592. }
  23593. // 19. If init["credentials"] exists, then set request’s credentials mode
  23594. // to it.
  23595. if (init.credentials !== undefined) {
  23596. request.credentials = init.credentials
  23597. }
  23598. // 18. If init["cache"] exists, then set request’s cache mode to it.
  23599. if (init.cache !== undefined) {
  23600. request.cache = init.cache
  23601. }
  23602. // 21. If request’s cache mode is "only-if-cached" and request’s mode is
  23603. // not "same-origin", then throw a TypeError.
  23604. if (request.cache === 'only-if-cached' && request.mode !== 'same-origin') {
  23605. throw new TypeError(
  23606. "'only-if-cached' can be set only with 'same-origin' mode"
  23607. )
  23608. }
  23609. // 22. If init["redirect"] exists, then set request’s redirect mode to it.
  23610. if (init.redirect !== undefined) {
  23611. request.redirect = init.redirect
  23612. }
  23613. // 23. If init["integrity"] exists, then set request’s integrity metadata to it.
  23614. if (init.integrity != null) {
  23615. request.integrity = String(init.integrity)
  23616. }
  23617. // 24. If init["keepalive"] exists, then set request’s keepalive to it.
  23618. if (init.keepalive !== undefined) {
  23619. request.keepalive = Boolean(init.keepalive)
  23620. }
  23621. // 25. If init["method"] exists, then:
  23622. if (init.method !== undefined) {
  23623. // 1. Let method be init["method"].
  23624. let method = init.method
  23625. // 2. If method is not a method or method is a forbidden method, then
  23626. // throw a TypeError.
  23627. if (!isValidHTTPToken(method)) {
  23628. throw new TypeError(`'${method}' is not a valid HTTP method.`)
  23629. }
  23630. if (forbiddenMethodsSet.has(method.toUpperCase())) {
  23631. throw new TypeError(`'${method}' HTTP method is unsupported.`)
  23632. }
  23633. // 3. Normalize method.
  23634. method = normalizeMethodRecord[method] ?? normalizeMethod(method)
  23635. // 4. Set request’s method to method.
  23636. request.method = method
  23637. }
  23638. // 26. If init["signal"] exists, then set signal to it.
  23639. if (init.signal !== undefined) {
  23640. signal = init.signal
  23641. }
  23642. // 27. Set this’s request to request.
  23643. this[kState] = request
  23644. // 28. Set this’s signal to a new AbortSignal object with this’s relevant
  23645. // Realm.
  23646. // TODO: could this be simplified with AbortSignal.any
  23647. // (https://dom.spec.whatwg.org/#dom-abortsignal-any)
  23648. const ac = new AbortController()
  23649. this[kSignal] = ac.signal
  23650. this[kSignal][kRealm] = this[kRealm]
  23651. // 29. If signal is not null, then make this’s signal follow signal.
  23652. if (signal != null) {
  23653. if (
  23654. !signal ||
  23655. typeof signal.aborted !== 'boolean' ||
  23656. typeof signal.addEventListener !== 'function'
  23657. ) {
  23658. throw new TypeError(
  23659. "Failed to construct 'Request': member signal is not of type AbortSignal."
  23660. )
  23661. }
  23662. if (signal.aborted) {
  23663. ac.abort(signal.reason)
  23664. } else {
  23665. // Keep a strong ref to ac while request object
  23666. // is alive. This is needed to prevent AbortController
  23667. // from being prematurely garbage collected.
  23668. // See, https://github.com/nodejs/undici/issues/1926.
  23669. this[kAbortController] = ac
  23670. const acRef = new WeakRef(ac)
  23671. const abort = function () {
  23672. const ac = acRef.deref()
  23673. if (ac !== undefined) {
  23674. ac.abort(this.reason)
  23675. }
  23676. }
  23677. // Third-party AbortControllers may not work with these.
  23678. // See, https://github.com/nodejs/undici/pull/1910#issuecomment-1464495619.
  23679. try {
  23680. // If the max amount of listeners is equal to the default, increase it
  23681. // This is only available in node >= v19.9.0
  23682. if (typeof getMaxListeners === 'function' && getMaxListeners(signal) === defaultMaxListeners) {
  23683. setMaxListeners(100, signal)
  23684. } else if (getEventListeners(signal, 'abort').length >= defaultMaxListeners) {
  23685. setMaxListeners(100, signal)
  23686. }
  23687. } catch {}
  23688. util.addAbortListener(signal, abort)
  23689. requestFinalizer.register(ac, { signal, abort })
  23690. }
  23691. }
  23692. // 30. Set this’s headers to a new Headers object with this’s relevant
  23693. // Realm, whose header list is request’s header list and guard is
  23694. // "request".
  23695. this[kHeaders] = new Headers(kConstruct)
  23696. this[kHeaders][kHeadersList] = request.headersList
  23697. this[kHeaders][kGuard] = 'request'
  23698. this[kHeaders][kRealm] = this[kRealm]
  23699. // 31. If this’s request’s mode is "no-cors", then:
  23700. if (mode === 'no-cors') {
  23701. // 1. If this’s request’s method is not a CORS-safelisted method,
  23702. // then throw a TypeError.
  23703. if (!corsSafeListedMethodsSet.has(request.method)) {
  23704. throw new TypeError(
  23705. `'${request.method} is unsupported in no-cors mode.`
  23706. )
  23707. }
  23708. // 2. Set this’s headers’s guard to "request-no-cors".
  23709. this[kHeaders][kGuard] = 'request-no-cors'
  23710. }
  23711. // 32. If init is not empty, then:
  23712. if (initHasKey) {
  23713. /** @type {HeadersList} */
  23714. const headersList = this[kHeaders][kHeadersList]
  23715. // 1. Let headers be a copy of this’s headers and its associated header
  23716. // list.
  23717. // 2. If init["headers"] exists, then set headers to init["headers"].
  23718. const headers = init.headers !== undefined ? init.headers : new HeadersList(headersList)
  23719. // 3. Empty this’s headers’s header list.
  23720. headersList.clear()
  23721. // 4. If headers is a Headers object, then for each header in its header
  23722. // list, append header’s name/header’s value to this’s headers.
  23723. if (headers instanceof HeadersList) {
  23724. for (const [key, val] of headers) {
  23725. headersList.append(key, val)
  23726. }
  23727. // Note: Copy the `set-cookie` meta-data.
  23728. headersList.cookies = headers.cookies
  23729. } else {
  23730. // 5. Otherwise, fill this’s headers with headers.
  23731. fillHeaders(this[kHeaders], headers)
  23732. }
  23733. }
  23734. // 33. Let inputBody be input’s request’s body if input is a Request
  23735. // object; otherwise null.
  23736. const inputBody = input instanceof Request ? input[kState].body : null
  23737. // 34. If either init["body"] exists and is non-null or inputBody is
  23738. // non-null, and request’s method is `GET` or `HEAD`, then throw a
  23739. // TypeError.
  23740. if (
  23741. (init.body != null || inputBody != null) &&
  23742. (request.method === 'GET' || request.method === 'HEAD')
  23743. ) {
  23744. throw new TypeError('Request with GET/HEAD method cannot have body.')
  23745. }
  23746. // 35. Let initBody be null.
  23747. let initBody = null
  23748. // 36. If init["body"] exists and is non-null, then:
  23749. if (init.body != null) {
  23750. // 1. Let Content-Type be null.
  23751. // 2. Set initBody and Content-Type to the result of extracting
  23752. // init["body"], with keepalive set to request’s keepalive.
  23753. const [extractedBody, contentType] = extractBody(
  23754. init.body,
  23755. request.keepalive
  23756. )
  23757. initBody = extractedBody
  23758. // 3, If Content-Type is non-null and this’s headers’s header list does
  23759. // not contain `Content-Type`, then append `Content-Type`/Content-Type to
  23760. // this’s headers.
  23761. if (contentType && !this[kHeaders][kHeadersList].contains('content-type')) {
  23762. this[kHeaders].append('content-type', contentType)
  23763. }
  23764. }
  23765. // 37. Let inputOrInitBody be initBody if it is non-null; otherwise
  23766. // inputBody.
  23767. const inputOrInitBody = initBody ?? inputBody
  23768. // 38. If inputOrInitBody is non-null and inputOrInitBody’s source is
  23769. // null, then:
  23770. if (inputOrInitBody != null && inputOrInitBody.source == null) {
  23771. // 1. If initBody is non-null and init["duplex"] does not exist,
  23772. // then throw a TypeError.
  23773. if (initBody != null && init.duplex == null) {
  23774. throw new TypeError('RequestInit: duplex option is required when sending a body.')
  23775. }
  23776. // 2. If this’s request’s mode is neither "same-origin" nor "cors",
  23777. // then throw a TypeError.
  23778. if (request.mode !== 'same-origin' && request.mode !== 'cors') {
  23779. throw new TypeError(
  23780. 'If request is made from ReadableStream, mode should be "same-origin" or "cors"'
  23781. )
  23782. }
  23783. // 3. Set this’s request’s use-CORS-preflight flag.
  23784. request.useCORSPreflightFlag = true
  23785. }
  23786. // 39. Let finalBody be inputOrInitBody.
  23787. let finalBody = inputOrInitBody
  23788. // 40. If initBody is null and inputBody is non-null, then:
  23789. if (initBody == null && inputBody != null) {
  23790. // 1. If input is unusable, then throw a TypeError.
  23791. if (util.isDisturbed(inputBody.stream) || inputBody.stream.locked) {
  23792. throw new TypeError(
  23793. 'Cannot construct a Request with a Request object that has already been used.'
  23794. )
  23795. }
  23796. // 2. Set finalBody to the result of creating a proxy for inputBody.
  23797. if (!TransformStream) {
  23798. TransformStream = (__nccwpck_require__(5356).TransformStream)
  23799. }
  23800. // https://streams.spec.whatwg.org/#readablestream-create-a-proxy
  23801. const identityTransform = new TransformStream()
  23802. inputBody.stream.pipeThrough(identityTransform)
  23803. finalBody = {
  23804. source: inputBody.source,
  23805. length: inputBody.length,
  23806. stream: identityTransform.readable
  23807. }
  23808. }
  23809. // 41. Set this’s request’s body to finalBody.
  23810. this[kState].body = finalBody
  23811. }
  23812. // Returns request’s HTTP method, which is "GET" by default.
  23813. get method () {
  23814. webidl.brandCheck(this, Request)
  23815. // The method getter steps are to return this’s request’s method.
  23816. return this[kState].method
  23817. }
  23818. // Returns the URL of request as a string.
  23819. get url () {
  23820. webidl.brandCheck(this, Request)
  23821. // The url getter steps are to return this’s request’s URL, serialized.
  23822. return URLSerializer(this[kState].url)
  23823. }
  23824. // Returns a Headers object consisting of the headers associated with request.
  23825. // Note that headers added in the network layer by the user agent will not
  23826. // be accounted for in this object, e.g., the "Host" header.
  23827. get headers () {
  23828. webidl.brandCheck(this, Request)
  23829. // The headers getter steps are to return this’s headers.
  23830. return this[kHeaders]
  23831. }
  23832. // Returns the kind of resource requested by request, e.g., "document"
  23833. // or "script".
  23834. get destination () {
  23835. webidl.brandCheck(this, Request)
  23836. // The destination getter are to return this’s request’s destination.
  23837. return this[kState].destination
  23838. }
  23839. // Returns the referrer of request. Its value can be a same-origin URL if
  23840. // explicitly set in init, the empty string to indicate no referrer, and
  23841. // "about:client" when defaulting to the global’s default. This is used
  23842. // during fetching to determine the value of the `Referer` header of the
  23843. // request being made.
  23844. get referrer () {
  23845. webidl.brandCheck(this, Request)
  23846. // 1. If this’s request’s referrer is "no-referrer", then return the
  23847. // empty string.
  23848. if (this[kState].referrer === 'no-referrer') {
  23849. return ''
  23850. }
  23851. // 2. If this’s request’s referrer is "client", then return
  23852. // "about:client".
  23853. if (this[kState].referrer === 'client') {
  23854. return 'about:client'
  23855. }
  23856. // Return this’s request’s referrer, serialized.
  23857. return this[kState].referrer.toString()
  23858. }
  23859. // Returns the referrer policy associated with request.
  23860. // This is used during fetching to compute the value of the request’s
  23861. // referrer.
  23862. get referrerPolicy () {
  23863. webidl.brandCheck(this, Request)
  23864. // The referrerPolicy getter steps are to return this’s request’s referrer policy.
  23865. return this[kState].referrerPolicy
  23866. }
  23867. // Returns the mode associated with request, which is a string indicating
  23868. // whether the request will use CORS, or will be restricted to same-origin
  23869. // URLs.
  23870. get mode () {
  23871. webidl.brandCheck(this, Request)
  23872. // The mode getter steps are to return this’s request’s mode.
  23873. return this[kState].mode
  23874. }
  23875. // Returns the credentials mode associated with request,
  23876. // which is a string indicating whether credentials will be sent with the
  23877. // request always, never, or only when sent to a same-origin URL.
  23878. get credentials () {
  23879. // The credentials getter steps are to return this’s request’s credentials mode.
  23880. return this[kState].credentials
  23881. }
  23882. // Returns the cache mode associated with request,
  23883. // which is a string indicating how the request will
  23884. // interact with the browser’s cache when fetching.
  23885. get cache () {
  23886. webidl.brandCheck(this, Request)
  23887. // The cache getter steps are to return this’s request’s cache mode.
  23888. return this[kState].cache
  23889. }
  23890. // Returns the redirect mode associated with request,
  23891. // which is a string indicating how redirects for the
  23892. // request will be handled during fetching. A request
  23893. // will follow redirects by default.
  23894. get redirect () {
  23895. webidl.brandCheck(this, Request)
  23896. // The redirect getter steps are to return this’s request’s redirect mode.
  23897. return this[kState].redirect
  23898. }
  23899. // Returns request’s subresource integrity metadata, which is a
  23900. // cryptographic hash of the resource being fetched. Its value
  23901. // consists of multiple hashes separated by whitespace. [SRI]
  23902. get integrity () {
  23903. webidl.brandCheck(this, Request)
  23904. // The integrity getter steps are to return this’s request’s integrity
  23905. // metadata.
  23906. return this[kState].integrity
  23907. }
  23908. // Returns a boolean indicating whether or not request can outlive the
  23909. // global in which it was created.
  23910. get keepalive () {
  23911. webidl.brandCheck(this, Request)
  23912. // The keepalive getter steps are to return this’s request’s keepalive.
  23913. return this[kState].keepalive
  23914. }
  23915. // Returns a boolean indicating whether or not request is for a reload
  23916. // navigation.
  23917. get isReloadNavigation () {
  23918. webidl.brandCheck(this, Request)
  23919. // The isReloadNavigation getter steps are to return true if this’s
  23920. // request’s reload-navigation flag is set; otherwise false.
  23921. return this[kState].reloadNavigation
  23922. }
  23923. // Returns a boolean indicating whether or not request is for a history
  23924. // navigation (a.k.a. back-foward navigation).
  23925. get isHistoryNavigation () {
  23926. webidl.brandCheck(this, Request)
  23927. // The isHistoryNavigation getter steps are to return true if this’s request’s
  23928. // history-navigation flag is set; otherwise false.
  23929. return this[kState].historyNavigation
  23930. }
  23931. // Returns the signal associated with request, which is an AbortSignal
  23932. // object indicating whether or not request has been aborted, and its
  23933. // abort event handler.
  23934. get signal () {
  23935. webidl.brandCheck(this, Request)
  23936. // The signal getter steps are to return this’s signal.
  23937. return this[kSignal]
  23938. }
  23939. get body () {
  23940. webidl.brandCheck(this, Request)
  23941. return this[kState].body ? this[kState].body.stream : null
  23942. }
  23943. get bodyUsed () {
  23944. webidl.brandCheck(this, Request)
  23945. return !!this[kState].body && util.isDisturbed(this[kState].body.stream)
  23946. }
  23947. get duplex () {
  23948. webidl.brandCheck(this, Request)
  23949. return 'half'
  23950. }
  23951. // Returns a clone of request.
  23952. clone () {
  23953. webidl.brandCheck(this, Request)
  23954. // 1. If this is unusable, then throw a TypeError.
  23955. if (this.bodyUsed || this.body?.locked) {
  23956. throw new TypeError('unusable')
  23957. }
  23958. // 2. Let clonedRequest be the result of cloning this’s request.
  23959. const clonedRequest = cloneRequest(this[kState])
  23960. // 3. Let clonedRequestObject be the result of creating a Request object,
  23961. // given clonedRequest, this’s headers’s guard, and this’s relevant Realm.
  23962. const clonedRequestObject = new Request(kConstruct)
  23963. clonedRequestObject[kState] = clonedRequest
  23964. clonedRequestObject[kRealm] = this[kRealm]
  23965. clonedRequestObject[kHeaders] = new Headers(kConstruct)
  23966. clonedRequestObject[kHeaders][kHeadersList] = clonedRequest.headersList
  23967. clonedRequestObject[kHeaders][kGuard] = this[kHeaders][kGuard]
  23968. clonedRequestObject[kHeaders][kRealm] = this[kHeaders][kRealm]
  23969. // 4. Make clonedRequestObject’s signal follow this’s signal.
  23970. const ac = new AbortController()
  23971. if (this.signal.aborted) {
  23972. ac.abort(this.signal.reason)
  23973. } else {
  23974. util.addAbortListener(
  23975. this.signal,
  23976. () => {
  23977. ac.abort(this.signal.reason)
  23978. }
  23979. )
  23980. }
  23981. clonedRequestObject[kSignal] = ac.signal
  23982. // 4. Return clonedRequestObject.
  23983. return clonedRequestObject
  23984. }
  23985. }
  23986. mixinBody(Request)
  23987. function makeRequest (init) {
  23988. // https://fetch.spec.whatwg.org/#requests
  23989. const request = {
  23990. method: 'GET',
  23991. localURLsOnly: false,
  23992. unsafeRequest: false,
  23993. body: null,
  23994. client: null,
  23995. reservedClient: null,
  23996. replacesClientId: '',
  23997. window: 'client',
  23998. keepalive: false,
  23999. serviceWorkers: 'all',
  24000. initiator: '',
  24001. destination: '',
  24002. priority: null,
  24003. origin: 'client',
  24004. policyContainer: 'client',
  24005. referrer: 'client',
  24006. referrerPolicy: '',
  24007. mode: 'no-cors',
  24008. useCORSPreflightFlag: false,
  24009. credentials: 'same-origin',
  24010. useCredentials: false,
  24011. cache: 'default',
  24012. redirect: 'follow',
  24013. integrity: '',
  24014. cryptoGraphicsNonceMetadata: '',
  24015. parserMetadata: '',
  24016. reloadNavigation: false,
  24017. historyNavigation: false,
  24018. userActivation: false,
  24019. taintedOrigin: false,
  24020. redirectCount: 0,
  24021. responseTainting: 'basic',
  24022. preventNoCacheCacheControlHeaderModification: false,
  24023. done: false,
  24024. timingAllowFailed: false,
  24025. ...init,
  24026. headersList: init.headersList
  24027. ? new HeadersList(init.headersList)
  24028. : new HeadersList()
  24029. }
  24030. request.url = request.urlList[0]
  24031. return request
  24032. }
  24033. // https://fetch.spec.whatwg.org/#concept-request-clone
  24034. function cloneRequest (request) {
  24035. // To clone a request request, run these steps:
  24036. // 1. Let newRequest be a copy of request, except for its body.
  24037. const newRequest = makeRequest({ ...request, body: null })
  24038. // 2. If request’s body is non-null, set newRequest’s body to the
  24039. // result of cloning request’s body.
  24040. if (request.body != null) {
  24041. newRequest.body = cloneBody(request.body)
  24042. }
  24043. // 3. Return newRequest.
  24044. return newRequest
  24045. }
  24046. Object.defineProperties(Request.prototype, {
  24047. method: kEnumerableProperty,
  24048. url: kEnumerableProperty,
  24049. headers: kEnumerableProperty,
  24050. redirect: kEnumerableProperty,
  24051. clone: kEnumerableProperty,
  24052. signal: kEnumerableProperty,
  24053. duplex: kEnumerableProperty,
  24054. destination: kEnumerableProperty,
  24055. body: kEnumerableProperty,
  24056. bodyUsed: kEnumerableProperty,
  24057. isHistoryNavigation: kEnumerableProperty,
  24058. isReloadNavigation: kEnumerableProperty,
  24059. keepalive: kEnumerableProperty,
  24060. integrity: kEnumerableProperty,
  24061. cache: kEnumerableProperty,
  24062. credentials: kEnumerableProperty,
  24063. attribute: kEnumerableProperty,
  24064. referrerPolicy: kEnumerableProperty,
  24065. referrer: kEnumerableProperty,
  24066. mode: kEnumerableProperty,
  24067. [Symbol.toStringTag]: {
  24068. value: 'Request',
  24069. configurable: true
  24070. }
  24071. })
  24072. webidl.converters.Request = webidl.interfaceConverter(
  24073. Request
  24074. )
  24075. // https://fetch.spec.whatwg.org/#requestinfo
  24076. webidl.converters.RequestInfo = function (V) {
  24077. if (typeof V === 'string') {
  24078. return webidl.converters.USVString(V)
  24079. }
  24080. if (V instanceof Request) {
  24081. return webidl.converters.Request(V)
  24082. }
  24083. return webidl.converters.USVString(V)
  24084. }
  24085. webidl.converters.AbortSignal = webidl.interfaceConverter(
  24086. AbortSignal
  24087. )
  24088. // https://fetch.spec.whatwg.org/#requestinit
  24089. webidl.converters.RequestInit = webidl.dictionaryConverter([
  24090. {
  24091. key: 'method',
  24092. converter: webidl.converters.ByteString
  24093. },
  24094. {
  24095. key: 'headers',
  24096. converter: webidl.converters.HeadersInit
  24097. },
  24098. {
  24099. key: 'body',
  24100. converter: webidl.nullableConverter(
  24101. webidl.converters.BodyInit
  24102. )
  24103. },
  24104. {
  24105. key: 'referrer',
  24106. converter: webidl.converters.USVString
  24107. },
  24108. {
  24109. key: 'referrerPolicy',
  24110. converter: webidl.converters.DOMString,
  24111. // https://w3c.github.io/webappsec-referrer-policy/#referrer-policy
  24112. allowedValues: referrerPolicy
  24113. },
  24114. {
  24115. key: 'mode',
  24116. converter: webidl.converters.DOMString,
  24117. // https://fetch.spec.whatwg.org/#concept-request-mode
  24118. allowedValues: requestMode
  24119. },
  24120. {
  24121. key: 'credentials',
  24122. converter: webidl.converters.DOMString,
  24123. // https://fetch.spec.whatwg.org/#requestcredentials
  24124. allowedValues: requestCredentials
  24125. },
  24126. {
  24127. key: 'cache',
  24128. converter: webidl.converters.DOMString,
  24129. // https://fetch.spec.whatwg.org/#requestcache
  24130. allowedValues: requestCache
  24131. },
  24132. {
  24133. key: 'redirect',
  24134. converter: webidl.converters.DOMString,
  24135. // https://fetch.spec.whatwg.org/#requestredirect
  24136. allowedValues: requestRedirect
  24137. },
  24138. {
  24139. key: 'integrity',
  24140. converter: webidl.converters.DOMString
  24141. },
  24142. {
  24143. key: 'keepalive',
  24144. converter: webidl.converters.boolean
  24145. },
  24146. {
  24147. key: 'signal',
  24148. converter: webidl.nullableConverter(
  24149. (signal) => webidl.converters.AbortSignal(
  24150. signal,
  24151. { strict: false }
  24152. )
  24153. )
  24154. },
  24155. {
  24156. key: 'window',
  24157. converter: webidl.converters.any
  24158. },
  24159. {
  24160. key: 'duplex',
  24161. converter: webidl.converters.DOMString,
  24162. allowedValues: requestDuplex
  24163. }
  24164. ])
  24165. module.exports = { Request, makeRequest }
  24166. /***/ }),
  24167. /***/ 7823:
  24168. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  24169. "use strict";
  24170. const { Headers, HeadersList, fill } = __nccwpck_require__(554)
  24171. const { extractBody, cloneBody, mixinBody } = __nccwpck_require__(9990)
  24172. const util = __nccwpck_require__(3983)
  24173. const { kEnumerableProperty } = util
  24174. const {
  24175. isValidReasonPhrase,
  24176. isCancelled,
  24177. isAborted,
  24178. isBlobLike,
  24179. serializeJavascriptValueToJSONString,
  24180. isErrorLike,
  24181. isomorphicEncode
  24182. } = __nccwpck_require__(2538)
  24183. const {
  24184. redirectStatusSet,
  24185. nullBodyStatus,
  24186. DOMException
  24187. } = __nccwpck_require__(1037)
  24188. const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(5861)
  24189. const { webidl } = __nccwpck_require__(1744)
  24190. const { FormData } = __nccwpck_require__(2015)
  24191. const { getGlobalOrigin } = __nccwpck_require__(1246)
  24192. const { URLSerializer } = __nccwpck_require__(685)
  24193. const { kHeadersList, kConstruct } = __nccwpck_require__(2785)
  24194. const assert = __nccwpck_require__(9491)
  24195. const { types } = __nccwpck_require__(3837)
  24196. const ReadableStream = globalThis.ReadableStream || (__nccwpck_require__(5356).ReadableStream)
  24197. const textEncoder = new TextEncoder('utf-8')
  24198. // https://fetch.spec.whatwg.org/#response-class
  24199. class Response {
  24200. // Creates network error Response.
  24201. static error () {
  24202. // TODO
  24203. const relevantRealm = { settingsObject: {} }
  24204. // The static error() method steps are to return the result of creating a
  24205. // Response object, given a new network error, "immutable", and this’s
  24206. // relevant Realm.
  24207. const responseObject = new Response()
  24208. responseObject[kState] = makeNetworkError()
  24209. responseObject[kRealm] = relevantRealm
  24210. responseObject[kHeaders][kHeadersList] = responseObject[kState].headersList
  24211. responseObject[kHeaders][kGuard] = 'immutable'
  24212. responseObject[kHeaders][kRealm] = relevantRealm
  24213. return responseObject
  24214. }
  24215. // https://fetch.spec.whatwg.org/#dom-response-json
  24216. static json (data, init = {}) {
  24217. webidl.argumentLengthCheck(arguments, 1, { header: 'Response.json' })
  24218. if (init !== null) {
  24219. init = webidl.converters.ResponseInit(init)
  24220. }
  24221. // 1. Let bytes the result of running serialize a JavaScript value to JSON bytes on data.
  24222. const bytes = textEncoder.encode(
  24223. serializeJavascriptValueToJSONString(data)
  24224. )
  24225. // 2. Let body be the result of extracting bytes.
  24226. const body = extractBody(bytes)
  24227. // 3. Let responseObject be the result of creating a Response object, given a new response,
  24228. // "response", and this’s relevant Realm.
  24229. const relevantRealm = { settingsObject: {} }
  24230. const responseObject = new Response()
  24231. responseObject[kRealm] = relevantRealm
  24232. responseObject[kHeaders][kGuard] = 'response'
  24233. responseObject[kHeaders][kRealm] = relevantRealm
  24234. // 4. Perform initialize a response given responseObject, init, and (body, "application/json").
  24235. initializeResponse(responseObject, init, { body: body[0], type: 'application/json' })
  24236. // 5. Return responseObject.
  24237. return responseObject
  24238. }
  24239. // Creates a redirect Response that redirects to url with status status.
  24240. static redirect (url, status = 302) {
  24241. const relevantRealm = { settingsObject: {} }
  24242. webidl.argumentLengthCheck(arguments, 1, { header: 'Response.redirect' })
  24243. url = webidl.converters.USVString(url)
  24244. status = webidl.converters['unsigned short'](status)
  24245. // 1. Let parsedURL be the result of parsing url with current settings
  24246. // object’s API base URL.
  24247. // 2. If parsedURL is failure, then throw a TypeError.
  24248. // TODO: base-URL?
  24249. let parsedURL
  24250. try {
  24251. parsedURL = new URL(url, getGlobalOrigin())
  24252. } catch (err) {
  24253. throw Object.assign(new TypeError('Failed to parse URL from ' + url), {
  24254. cause: err
  24255. })
  24256. }
  24257. // 3. If status is not a redirect status, then throw a RangeError.
  24258. if (!redirectStatusSet.has(status)) {
  24259. throw new RangeError('Invalid status code ' + status)
  24260. }
  24261. // 4. Let responseObject be the result of creating a Response object,
  24262. // given a new response, "immutable", and this’s relevant Realm.
  24263. const responseObject = new Response()
  24264. responseObject[kRealm] = relevantRealm
  24265. responseObject[kHeaders][kGuard] = 'immutable'
  24266. responseObject[kHeaders][kRealm] = relevantRealm
  24267. // 5. Set responseObject’s response’s status to status.
  24268. responseObject[kState].status = status
  24269. // 6. Let value be parsedURL, serialized and isomorphic encoded.
  24270. const value = isomorphicEncode(URLSerializer(parsedURL))
  24271. // 7. Append `Location`/value to responseObject’s response’s header list.
  24272. responseObject[kState].headersList.append('location', value)
  24273. // 8. Return responseObject.
  24274. return responseObject
  24275. }
  24276. // https://fetch.spec.whatwg.org/#dom-response
  24277. constructor (body = null, init = {}) {
  24278. if (body !== null) {
  24279. body = webidl.converters.BodyInit(body)
  24280. }
  24281. init = webidl.converters.ResponseInit(init)
  24282. // TODO
  24283. this[kRealm] = { settingsObject: {} }
  24284. // 1. Set this’s response to a new response.
  24285. this[kState] = makeResponse({})
  24286. // 2. Set this’s headers to a new Headers object with this’s relevant
  24287. // Realm, whose header list is this’s response’s header list and guard
  24288. // is "response".
  24289. this[kHeaders] = new Headers(kConstruct)
  24290. this[kHeaders][kGuard] = 'response'
  24291. this[kHeaders][kHeadersList] = this[kState].headersList
  24292. this[kHeaders][kRealm] = this[kRealm]
  24293. // 3. Let bodyWithType be null.
  24294. let bodyWithType = null
  24295. // 4. If body is non-null, then set bodyWithType to the result of extracting body.
  24296. if (body != null) {
  24297. const [extractedBody, type] = extractBody(body)
  24298. bodyWithType = { body: extractedBody, type }
  24299. }
  24300. // 5. Perform initialize a response given this, init, and bodyWithType.
  24301. initializeResponse(this, init, bodyWithType)
  24302. }
  24303. // Returns response’s type, e.g., "cors".
  24304. get type () {
  24305. webidl.brandCheck(this, Response)
  24306. // The type getter steps are to return this’s response’s type.
  24307. return this[kState].type
  24308. }
  24309. // Returns response’s URL, if it has one; otherwise the empty string.
  24310. get url () {
  24311. webidl.brandCheck(this, Response)
  24312. const urlList = this[kState].urlList
  24313. // The url getter steps are to return the empty string if this’s
  24314. // response’s URL is null; otherwise this’s response’s URL,
  24315. // serialized with exclude fragment set to true.
  24316. const url = urlList[urlList.length - 1] ?? null
  24317. if (url === null) {
  24318. return ''
  24319. }
  24320. return URLSerializer(url, true)
  24321. }
  24322. // Returns whether response was obtained through a redirect.
  24323. get redirected () {
  24324. webidl.brandCheck(this, Response)
  24325. // The redirected getter steps are to return true if this’s response’s URL
  24326. // list has more than one item; otherwise false.
  24327. return this[kState].urlList.length > 1
  24328. }
  24329. // Returns response’s status.
  24330. get status () {
  24331. webidl.brandCheck(this, Response)
  24332. // The status getter steps are to return this’s response’s status.
  24333. return this[kState].status
  24334. }
  24335. // Returns whether response’s status is an ok status.
  24336. get ok () {
  24337. webidl.brandCheck(this, Response)
  24338. // The ok getter steps are to return true if this’s response’s status is an
  24339. // ok status; otherwise false.
  24340. return this[kState].status >= 200 && this[kState].status <= 299
  24341. }
  24342. // Returns response’s status message.
  24343. get statusText () {
  24344. webidl.brandCheck(this, Response)
  24345. // The statusText getter steps are to return this’s response’s status
  24346. // message.
  24347. return this[kState].statusText
  24348. }
  24349. // Returns response’s headers as Headers.
  24350. get headers () {
  24351. webidl.brandCheck(this, Response)
  24352. // The headers getter steps are to return this’s headers.
  24353. return this[kHeaders]
  24354. }
  24355. get body () {
  24356. webidl.brandCheck(this, Response)
  24357. return this[kState].body ? this[kState].body.stream : null
  24358. }
  24359. get bodyUsed () {
  24360. webidl.brandCheck(this, Response)
  24361. return !!this[kState].body && util.isDisturbed(this[kState].body.stream)
  24362. }
  24363. // Returns a clone of response.
  24364. clone () {
  24365. webidl.brandCheck(this, Response)
  24366. // 1. If this is unusable, then throw a TypeError.
  24367. if (this.bodyUsed || (this.body && this.body.locked)) {
  24368. throw webidl.errors.exception({
  24369. header: 'Response.clone',
  24370. message: 'Body has already been consumed.'
  24371. })
  24372. }
  24373. // 2. Let clonedResponse be the result of cloning this’s response.
  24374. const clonedResponse = cloneResponse(this[kState])
  24375. // 3. Return the result of creating a Response object, given
  24376. // clonedResponse, this’s headers’s guard, and this’s relevant Realm.
  24377. const clonedResponseObject = new Response()
  24378. clonedResponseObject[kState] = clonedResponse
  24379. clonedResponseObject[kRealm] = this[kRealm]
  24380. clonedResponseObject[kHeaders][kHeadersList] = clonedResponse.headersList
  24381. clonedResponseObject[kHeaders][kGuard] = this[kHeaders][kGuard]
  24382. clonedResponseObject[kHeaders][kRealm] = this[kHeaders][kRealm]
  24383. return clonedResponseObject
  24384. }
  24385. }
  24386. mixinBody(Response)
  24387. Object.defineProperties(Response.prototype, {
  24388. type: kEnumerableProperty,
  24389. url: kEnumerableProperty,
  24390. status: kEnumerableProperty,
  24391. ok: kEnumerableProperty,
  24392. redirected: kEnumerableProperty,
  24393. statusText: kEnumerableProperty,
  24394. headers: kEnumerableProperty,
  24395. clone: kEnumerableProperty,
  24396. body: kEnumerableProperty,
  24397. bodyUsed: kEnumerableProperty,
  24398. [Symbol.toStringTag]: {
  24399. value: 'Response',
  24400. configurable: true
  24401. }
  24402. })
  24403. Object.defineProperties(Response, {
  24404. json: kEnumerableProperty,
  24405. redirect: kEnumerableProperty,
  24406. error: kEnumerableProperty
  24407. })
  24408. // https://fetch.spec.whatwg.org/#concept-response-clone
  24409. function cloneResponse (response) {
  24410. // To clone a response response, run these steps:
  24411. // 1. If response is a filtered response, then return a new identical
  24412. // filtered response whose internal response is a clone of response’s
  24413. // internal response.
  24414. if (response.internalResponse) {
  24415. return filterResponse(
  24416. cloneResponse(response.internalResponse),
  24417. response.type
  24418. )
  24419. }
  24420. // 2. Let newResponse be a copy of response, except for its body.
  24421. const newResponse = makeResponse({ ...response, body: null })
  24422. // 3. If response’s body is non-null, then set newResponse’s body to the
  24423. // result of cloning response’s body.
  24424. if (response.body != null) {
  24425. newResponse.body = cloneBody(response.body)
  24426. }
  24427. // 4. Return newResponse.
  24428. return newResponse
  24429. }
  24430. function makeResponse (init) {
  24431. return {
  24432. aborted: false,
  24433. rangeRequested: false,
  24434. timingAllowPassed: false,
  24435. requestIncludesCredentials: false,
  24436. type: 'default',
  24437. status: 200,
  24438. timingInfo: null,
  24439. cacheState: '',
  24440. statusText: '',
  24441. ...init,
  24442. headersList: init.headersList
  24443. ? new HeadersList(init.headersList)
  24444. : new HeadersList(),
  24445. urlList: init.urlList ? [...init.urlList] : []
  24446. }
  24447. }
  24448. function makeNetworkError (reason) {
  24449. const isError = isErrorLike(reason)
  24450. return makeResponse({
  24451. type: 'error',
  24452. status: 0,
  24453. error: isError
  24454. ? reason
  24455. : new Error(reason ? String(reason) : reason),
  24456. aborted: reason && reason.name === 'AbortError'
  24457. })
  24458. }
  24459. function makeFilteredResponse (response, state) {
  24460. state = {
  24461. internalResponse: response,
  24462. ...state
  24463. }
  24464. return new Proxy(response, {
  24465. get (target, p) {
  24466. return p in state ? state[p] : target[p]
  24467. },
  24468. set (target, p, value) {
  24469. assert(!(p in state))
  24470. target[p] = value
  24471. return true
  24472. }
  24473. })
  24474. }
  24475. // https://fetch.spec.whatwg.org/#concept-filtered-response
  24476. function filterResponse (response, type) {
  24477. // Set response to the following filtered response with response as its
  24478. // internal response, depending on request’s response tainting:
  24479. if (type === 'basic') {
  24480. // A basic filtered response is a filtered response whose type is "basic"
  24481. // and header list excludes any headers in internal response’s header list
  24482. // whose name is a forbidden response-header name.
  24483. // Note: undici does not implement forbidden response-header names
  24484. return makeFilteredResponse(response, {
  24485. type: 'basic',
  24486. headersList: response.headersList
  24487. })
  24488. } else if (type === 'cors') {
  24489. // A CORS filtered response is a filtered response whose type is "cors"
  24490. // and header list excludes any headers in internal response’s header
  24491. // list whose name is not a CORS-safelisted response-header name, given
  24492. // internal response’s CORS-exposed header-name list.
  24493. // Note: undici does not implement CORS-safelisted response-header names
  24494. return makeFilteredResponse(response, {
  24495. type: 'cors',
  24496. headersList: response.headersList
  24497. })
  24498. } else if (type === 'opaque') {
  24499. // An opaque filtered response is a filtered response whose type is
  24500. // "opaque", URL list is the empty list, status is 0, status message
  24501. // is the empty byte sequence, header list is empty, and body is null.
  24502. return makeFilteredResponse(response, {
  24503. type: 'opaque',
  24504. urlList: Object.freeze([]),
  24505. status: 0,
  24506. statusText: '',
  24507. body: null
  24508. })
  24509. } else if (type === 'opaqueredirect') {
  24510. // An opaque-redirect filtered response is a filtered response whose type
  24511. // is "opaqueredirect", status is 0, status message is the empty byte
  24512. // sequence, header list is empty, and body is null.
  24513. return makeFilteredResponse(response, {
  24514. type: 'opaqueredirect',
  24515. status: 0,
  24516. statusText: '',
  24517. headersList: [],
  24518. body: null
  24519. })
  24520. } else {
  24521. assert(false)
  24522. }
  24523. }
  24524. // https://fetch.spec.whatwg.org/#appropriate-network-error
  24525. function makeAppropriateNetworkError (fetchParams, err = null) {
  24526. // 1. Assert: fetchParams is canceled.
  24527. assert(isCancelled(fetchParams))
  24528. // 2. Return an aborted network error if fetchParams is aborted;
  24529. // otherwise return a network error.
  24530. return isAborted(fetchParams)
  24531. ? makeNetworkError(Object.assign(new DOMException('The operation was aborted.', 'AbortError'), { cause: err }))
  24532. : makeNetworkError(Object.assign(new DOMException('Request was cancelled.'), { cause: err }))
  24533. }
  24534. // https://whatpr.org/fetch/1392.html#initialize-a-response
  24535. function initializeResponse (response, init, body) {
  24536. // 1. If init["status"] is not in the range 200 to 599, inclusive, then
  24537. // throw a RangeError.
  24538. if (init.status !== null && (init.status < 200 || init.status > 599)) {
  24539. throw new RangeError('init["status"] must be in the range of 200 to 599, inclusive.')
  24540. }
  24541. // 2. If init["statusText"] does not match the reason-phrase token production,
  24542. // then throw a TypeError.
  24543. if ('statusText' in init && init.statusText != null) {
  24544. // See, https://datatracker.ietf.org/doc/html/rfc7230#section-3.1.2:
  24545. // reason-phrase = *( HTAB / SP / VCHAR / obs-text )
  24546. if (!isValidReasonPhrase(String(init.statusText))) {
  24547. throw new TypeError('Invalid statusText')
  24548. }
  24549. }
  24550. // 3. Set response’s response’s status to init["status"].
  24551. if ('status' in init && init.status != null) {
  24552. response[kState].status = init.status
  24553. }
  24554. // 4. Set response’s response’s status message to init["statusText"].
  24555. if ('statusText' in init && init.statusText != null) {
  24556. response[kState].statusText = init.statusText
  24557. }
  24558. // 5. If init["headers"] exists, then fill response’s headers with init["headers"].
  24559. if ('headers' in init && init.headers != null) {
  24560. fill(response[kHeaders], init.headers)
  24561. }
  24562. // 6. If body was given, then:
  24563. if (body) {
  24564. // 1. If response's status is a null body status, then throw a TypeError.
  24565. if (nullBodyStatus.includes(response.status)) {
  24566. throw webidl.errors.exception({
  24567. header: 'Response constructor',
  24568. message: 'Invalid response status code ' + response.status
  24569. })
  24570. }
  24571. // 2. Set response's body to body's body.
  24572. response[kState].body = body.body
  24573. // 3. If body's type is non-null and response's header list does not contain
  24574. // `Content-Type`, then append (`Content-Type`, body's type) to response's header list.
  24575. if (body.type != null && !response[kState].headersList.contains('Content-Type')) {
  24576. response[kState].headersList.append('content-type', body.type)
  24577. }
  24578. }
  24579. }
  24580. webidl.converters.ReadableStream = webidl.interfaceConverter(
  24581. ReadableStream
  24582. )
  24583. webidl.converters.FormData = webidl.interfaceConverter(
  24584. FormData
  24585. )
  24586. webidl.converters.URLSearchParams = webidl.interfaceConverter(
  24587. URLSearchParams
  24588. )
  24589. // https://fetch.spec.whatwg.org/#typedefdef-xmlhttprequestbodyinit
  24590. webidl.converters.XMLHttpRequestBodyInit = function (V) {
  24591. if (typeof V === 'string') {
  24592. return webidl.converters.USVString(V)
  24593. }
  24594. if (isBlobLike(V)) {
  24595. return webidl.converters.Blob(V, { strict: false })
  24596. }
  24597. if (types.isArrayBuffer(V) || types.isTypedArray(V) || types.isDataView(V)) {
  24598. return webidl.converters.BufferSource(V)
  24599. }
  24600. if (util.isFormDataLike(V)) {
  24601. return webidl.converters.FormData(V, { strict: false })
  24602. }
  24603. if (V instanceof URLSearchParams) {
  24604. return webidl.converters.URLSearchParams(V)
  24605. }
  24606. return webidl.converters.DOMString(V)
  24607. }
  24608. // https://fetch.spec.whatwg.org/#bodyinit
  24609. webidl.converters.BodyInit = function (V) {
  24610. if (V instanceof ReadableStream) {
  24611. return webidl.converters.ReadableStream(V)
  24612. }
  24613. // Note: the spec doesn't include async iterables,
  24614. // this is an undici extension.
  24615. if (V?.[Symbol.asyncIterator]) {
  24616. return V
  24617. }
  24618. return webidl.converters.XMLHttpRequestBodyInit(V)
  24619. }
  24620. webidl.converters.ResponseInit = webidl.dictionaryConverter([
  24621. {
  24622. key: 'status',
  24623. converter: webidl.converters['unsigned short'],
  24624. defaultValue: 200
  24625. },
  24626. {
  24627. key: 'statusText',
  24628. converter: webidl.converters.ByteString,
  24629. defaultValue: ''
  24630. },
  24631. {
  24632. key: 'headers',
  24633. converter: webidl.converters.HeadersInit
  24634. }
  24635. ])
  24636. module.exports = {
  24637. makeNetworkError,
  24638. makeResponse,
  24639. makeAppropriateNetworkError,
  24640. filterResponse,
  24641. Response,
  24642. cloneResponse
  24643. }
  24644. /***/ }),
  24645. /***/ 5861:
  24646. /***/ ((module) => {
  24647. "use strict";
  24648. module.exports = {
  24649. kUrl: Symbol('url'),
  24650. kHeaders: Symbol('headers'),
  24651. kSignal: Symbol('signal'),
  24652. kState: Symbol('state'),
  24653. kGuard: Symbol('guard'),
  24654. kRealm: Symbol('realm')
  24655. }
  24656. /***/ }),
  24657. /***/ 2538:
  24658. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  24659. "use strict";
  24660. const { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = __nccwpck_require__(1037)
  24661. const { getGlobalOrigin } = __nccwpck_require__(1246)
  24662. const { performance } = __nccwpck_require__(4074)
  24663. const { isBlobLike, toUSVString, ReadableStreamFrom } = __nccwpck_require__(3983)
  24664. const assert = __nccwpck_require__(9491)
  24665. const { isUint8Array } = __nccwpck_require__(9830)
  24666. let supportedHashes = []
  24667. // https://nodejs.org/api/crypto.html#determining-if-crypto-support-is-unavailable
  24668. /** @type {import('crypto')|undefined} */
  24669. let crypto
  24670. try {
  24671. crypto = __nccwpck_require__(6113)
  24672. const possibleRelevantHashes = ['sha256', 'sha384', 'sha512']
  24673. supportedHashes = crypto.getHashes().filter((hash) => possibleRelevantHashes.includes(hash))
  24674. /* c8 ignore next 3 */
  24675. } catch {
  24676. }
  24677. function responseURL (response) {
  24678. // https://fetch.spec.whatwg.org/#responses
  24679. // A response has an associated URL. It is a pointer to the last URL
  24680. // in response’s URL list and null if response’s URL list is empty.
  24681. const urlList = response.urlList
  24682. const length = urlList.length
  24683. return length === 0 ? null : urlList[length - 1].toString()
  24684. }
  24685. // https://fetch.spec.whatwg.org/#concept-response-location-url
  24686. function responseLocationURL (response, requestFragment) {
  24687. // 1. If response’s status is not a redirect status, then return null.
  24688. if (!redirectStatusSet.has(response.status)) {
  24689. return null
  24690. }
  24691. // 2. Let location be the result of extracting header list values given
  24692. // `Location` and response’s header list.
  24693. let location = response.headersList.get('location')
  24694. // 3. If location is a header value, then set location to the result of
  24695. // parsing location with response’s URL.
  24696. if (location !== null && isValidHeaderValue(location)) {
  24697. location = new URL(location, responseURL(response))
  24698. }
  24699. // 4. If location is a URL whose fragment is null, then set location’s
  24700. // fragment to requestFragment.
  24701. if (location && !location.hash) {
  24702. location.hash = requestFragment
  24703. }
  24704. // 5. Return location.
  24705. return location
  24706. }
  24707. /** @returns {URL} */
  24708. function requestCurrentURL (request) {
  24709. return request.urlList[request.urlList.length - 1]
  24710. }
  24711. function requestBadPort (request) {
  24712. // 1. Let url be request’s current URL.
  24713. const url = requestCurrentURL(request)
  24714. // 2. If url’s scheme is an HTTP(S) scheme and url’s port is a bad port,
  24715. // then return blocked.
  24716. if (urlIsHttpHttpsScheme(url) && badPortsSet.has(url.port)) {
  24717. return 'blocked'
  24718. }
  24719. // 3. Return allowed.
  24720. return 'allowed'
  24721. }
  24722. function isErrorLike (object) {
  24723. return object instanceof Error || (
  24724. object?.constructor?.name === 'Error' ||
  24725. object?.constructor?.name === 'DOMException'
  24726. )
  24727. }
  24728. // Check whether |statusText| is a ByteString and
  24729. // matches the Reason-Phrase token production.
  24730. // RFC 2616: https://tools.ietf.org/html/rfc2616
  24731. // RFC 7230: https://tools.ietf.org/html/rfc7230
  24732. // "reason-phrase = *( HTAB / SP / VCHAR / obs-text )"
  24733. // https://github.com/chromium/chromium/blob/94.0.4604.1/third_party/blink/renderer/core/fetch/response.cc#L116
  24734. function isValidReasonPhrase (statusText) {
  24735. for (let i = 0; i < statusText.length; ++i) {
  24736. const c = statusText.charCodeAt(i)
  24737. if (
  24738. !(
  24739. (
  24740. c === 0x09 || // HTAB
  24741. (c >= 0x20 && c <= 0x7e) || // SP / VCHAR
  24742. (c >= 0x80 && c <= 0xff)
  24743. ) // obs-text
  24744. )
  24745. ) {
  24746. return false
  24747. }
  24748. }
  24749. return true
  24750. }
  24751. /**
  24752. * @see https://tools.ietf.org/html/rfc7230#section-3.2.6
  24753. * @param {number} c
  24754. */
  24755. function isTokenCharCode (c) {
  24756. switch (c) {
  24757. case 0x22:
  24758. case 0x28:
  24759. case 0x29:
  24760. case 0x2c:
  24761. case 0x2f:
  24762. case 0x3a:
  24763. case 0x3b:
  24764. case 0x3c:
  24765. case 0x3d:
  24766. case 0x3e:
  24767. case 0x3f:
  24768. case 0x40:
  24769. case 0x5b:
  24770. case 0x5c:
  24771. case 0x5d:
  24772. case 0x7b:
  24773. case 0x7d:
  24774. // DQUOTE and "(),/:;<=>?@[\]{}"
  24775. return false
  24776. default:
  24777. // VCHAR %x21-7E
  24778. return c >= 0x21 && c <= 0x7e
  24779. }
  24780. }
  24781. /**
  24782. * @param {string} characters
  24783. */
  24784. function isValidHTTPToken (characters) {
  24785. if (characters.length === 0) {
  24786. return false
  24787. }
  24788. for (let i = 0; i < characters.length; ++i) {
  24789. if (!isTokenCharCode(characters.charCodeAt(i))) {
  24790. return false
  24791. }
  24792. }
  24793. return true
  24794. }
  24795. /**
  24796. * @see https://fetch.spec.whatwg.org/#header-name
  24797. * @param {string} potentialValue
  24798. */
  24799. function isValidHeaderName (potentialValue) {
  24800. return isValidHTTPToken(potentialValue)
  24801. }
  24802. /**
  24803. * @see https://fetch.spec.whatwg.org/#header-value
  24804. * @param {string} potentialValue
  24805. */
  24806. function isValidHeaderValue (potentialValue) {
  24807. // - Has no leading or trailing HTTP tab or space bytes.
  24808. // - Contains no 0x00 (NUL) or HTTP newline bytes.
  24809. if (
  24810. potentialValue.startsWith('\t') ||
  24811. potentialValue.startsWith(' ') ||
  24812. potentialValue.endsWith('\t') ||
  24813. potentialValue.endsWith(' ')
  24814. ) {
  24815. return false
  24816. }
  24817. if (
  24818. potentialValue.includes('\0') ||
  24819. potentialValue.includes('\r') ||
  24820. potentialValue.includes('\n')
  24821. ) {
  24822. return false
  24823. }
  24824. return true
  24825. }
  24826. // https://w3c.github.io/webappsec-referrer-policy/#set-requests-referrer-policy-on-redirect
  24827. function setRequestReferrerPolicyOnRedirect (request, actualResponse) {
  24828. // Given a request request and a response actualResponse, this algorithm
  24829. // updates request’s referrer policy according to the Referrer-Policy
  24830. // header (if any) in actualResponse.
  24831. // 1. Let policy be the result of executing § 8.1 Parse a referrer policy
  24832. // from a Referrer-Policy header on actualResponse.
  24833. // 8.1 Parse a referrer policy from a Referrer-Policy header
  24834. // 1. Let policy-tokens be the result of extracting header list values given `Referrer-Policy` and response’s header list.
  24835. const { headersList } = actualResponse
  24836. // 2. Let policy be the empty string.
  24837. // 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.
  24838. // 4. Return policy.
  24839. const policyHeader = (headersList.get('referrer-policy') ?? '').split(',')
  24840. // Note: As the referrer-policy can contain multiple policies
  24841. // separated by comma, we need to loop through all of them
  24842. // and pick the first valid one.
  24843. // Ref: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy#specify_a_fallback_policy
  24844. let policy = ''
  24845. if (policyHeader.length > 0) {
  24846. // The right-most policy takes precedence.
  24847. // The left-most policy is the fallback.
  24848. for (let i = policyHeader.length; i !== 0; i--) {
  24849. const token = policyHeader[i - 1].trim()
  24850. if (referrerPolicyTokens.has(token)) {
  24851. policy = token
  24852. break
  24853. }
  24854. }
  24855. }
  24856. // 2. If policy is not the empty string, then set request’s referrer policy to policy.
  24857. if (policy !== '') {
  24858. request.referrerPolicy = policy
  24859. }
  24860. }
  24861. // https://fetch.spec.whatwg.org/#cross-origin-resource-policy-check
  24862. function crossOriginResourcePolicyCheck () {
  24863. // TODO
  24864. return 'allowed'
  24865. }
  24866. // https://fetch.spec.whatwg.org/#concept-cors-check
  24867. function corsCheck () {
  24868. // TODO
  24869. return 'success'
  24870. }
  24871. // https://fetch.spec.whatwg.org/#concept-tao-check
  24872. function TAOCheck () {
  24873. // TODO
  24874. return 'success'
  24875. }
  24876. function appendFetchMetadata (httpRequest) {
  24877. // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-dest-header
  24878. // TODO
  24879. // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-mode-header
  24880. // 1. Assert: r’s url is a potentially trustworthy URL.
  24881. // TODO
  24882. // 2. Let header be a Structured Header whose value is a token.
  24883. let header = null
  24884. // 3. Set header’s value to r’s mode.
  24885. header = httpRequest.mode
  24886. // 4. Set a structured field value `Sec-Fetch-Mode`/header in r’s header list.
  24887. httpRequest.headersList.set('sec-fetch-mode', header)
  24888. // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-site-header
  24889. // TODO
  24890. // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-user-header
  24891. // TODO
  24892. }
  24893. // https://fetch.spec.whatwg.org/#append-a-request-origin-header
  24894. function appendRequestOriginHeader (request) {
  24895. // 1. Let serializedOrigin be the result of byte-serializing a request origin with request.
  24896. let serializedOrigin = request.origin
  24897. // 2. If request’s response tainting is "cors" or request’s mode is "websocket", then append (`Origin`, serializedOrigin) to request’s header list.
  24898. if (request.responseTainting === 'cors' || request.mode === 'websocket') {
  24899. if (serializedOrigin) {
  24900. request.headersList.append('origin', serializedOrigin)
  24901. }
  24902. // 3. Otherwise, if request’s method is neither `GET` nor `HEAD`, then:
  24903. } else if (request.method !== 'GET' && request.method !== 'HEAD') {
  24904. // 1. Switch on request’s referrer policy:
  24905. switch (request.referrerPolicy) {
  24906. case 'no-referrer':
  24907. // Set serializedOrigin to `null`.
  24908. serializedOrigin = null
  24909. break
  24910. case 'no-referrer-when-downgrade':
  24911. case 'strict-origin':
  24912. case 'strict-origin-when-cross-origin':
  24913. // 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`.
  24914. if (request.origin && urlHasHttpsScheme(request.origin) && !urlHasHttpsScheme(requestCurrentURL(request))) {
  24915. serializedOrigin = null
  24916. }
  24917. break
  24918. case 'same-origin':
  24919. // If request’s origin is not same origin with request’s current URL’s origin, then set serializedOrigin to `null`.
  24920. if (!sameOrigin(request, requestCurrentURL(request))) {
  24921. serializedOrigin = null
  24922. }
  24923. break
  24924. default:
  24925. // Do nothing.
  24926. }
  24927. if (serializedOrigin) {
  24928. // 2. Append (`Origin`, serializedOrigin) to request’s header list.
  24929. request.headersList.append('origin', serializedOrigin)
  24930. }
  24931. }
  24932. }
  24933. function coarsenedSharedCurrentTime (crossOriginIsolatedCapability) {
  24934. // TODO
  24935. return performance.now()
  24936. }
  24937. // https://fetch.spec.whatwg.org/#create-an-opaque-timing-info
  24938. function createOpaqueTimingInfo (timingInfo) {
  24939. return {
  24940. startTime: timingInfo.startTime ?? 0,
  24941. redirectStartTime: 0,
  24942. redirectEndTime: 0,
  24943. postRedirectStartTime: timingInfo.startTime ?? 0,
  24944. finalServiceWorkerStartTime: 0,
  24945. finalNetworkResponseStartTime: 0,
  24946. finalNetworkRequestStartTime: 0,
  24947. endTime: 0,
  24948. encodedBodySize: 0,
  24949. decodedBodySize: 0,
  24950. finalConnectionTimingInfo: null
  24951. }
  24952. }
  24953. // https://html.spec.whatwg.org/multipage/origin.html#policy-container
  24954. function makePolicyContainer () {
  24955. // Note: the fetch spec doesn't make use of embedder policy or CSP list
  24956. return {
  24957. referrerPolicy: 'strict-origin-when-cross-origin'
  24958. }
  24959. }
  24960. // https://html.spec.whatwg.org/multipage/origin.html#clone-a-policy-container
  24961. function clonePolicyContainer (policyContainer) {
  24962. return {
  24963. referrerPolicy: policyContainer.referrerPolicy
  24964. }
  24965. }
  24966. // https://w3c.github.io/webappsec-referrer-policy/#determine-requests-referrer
  24967. function determineRequestsReferrer (request) {
  24968. // 1. Let policy be request's referrer policy.
  24969. const policy = request.referrerPolicy
  24970. // Note: policy cannot (shouldn't) be null or an empty string.
  24971. assert(policy)
  24972. // 2. Let environment be request’s client.
  24973. let referrerSource = null
  24974. // 3. Switch on request’s referrer:
  24975. if (request.referrer === 'client') {
  24976. // Note: node isn't a browser and doesn't implement document/iframes,
  24977. // so we bypass this step and replace it with our own.
  24978. const globalOrigin = getGlobalOrigin()
  24979. if (!globalOrigin || globalOrigin.origin === 'null') {
  24980. return 'no-referrer'
  24981. }
  24982. // note: we need to clone it as it's mutated
  24983. referrerSource = new URL(globalOrigin)
  24984. } else if (request.referrer instanceof URL) {
  24985. // Let referrerSource be request’s referrer.
  24986. referrerSource = request.referrer
  24987. }
  24988. // 4. Let request’s referrerURL be the result of stripping referrerSource for
  24989. // use as a referrer.
  24990. let referrerURL = stripURLForReferrer(referrerSource)
  24991. // 5. Let referrerOrigin be the result of stripping referrerSource for use as
  24992. // a referrer, with the origin-only flag set to true.
  24993. const referrerOrigin = stripURLForReferrer(referrerSource, true)
  24994. // 6. If the result of serializing referrerURL is a string whose length is
  24995. // greater than 4096, set referrerURL to referrerOrigin.
  24996. if (referrerURL.toString().length > 4096) {
  24997. referrerURL = referrerOrigin
  24998. }
  24999. const areSameOrigin = sameOrigin(request, referrerURL)
  25000. const isNonPotentiallyTrustWorthy = isURLPotentiallyTrustworthy(referrerURL) &&
  25001. !isURLPotentiallyTrustworthy(request.url)
  25002. // 8. Execute the switch statements corresponding to the value of policy:
  25003. switch (policy) {
  25004. case 'origin': return referrerOrigin != null ? referrerOrigin : stripURLForReferrer(referrerSource, true)
  25005. case 'unsafe-url': return referrerURL
  25006. case 'same-origin':
  25007. return areSameOrigin ? referrerOrigin : 'no-referrer'
  25008. case 'origin-when-cross-origin':
  25009. return areSameOrigin ? referrerURL : referrerOrigin
  25010. case 'strict-origin-when-cross-origin': {
  25011. const currentURL = requestCurrentURL(request)
  25012. // 1. If the origin of referrerURL and the origin of request’s current
  25013. // URL are the same, then return referrerURL.
  25014. if (sameOrigin(referrerURL, currentURL)) {
  25015. return referrerURL
  25016. }
  25017. // 2. If referrerURL is a potentially trustworthy URL and request’s
  25018. // current URL is not a potentially trustworthy URL, then return no
  25019. // referrer.
  25020. if (isURLPotentiallyTrustworthy(referrerURL) && !isURLPotentiallyTrustworthy(currentURL)) {
  25021. return 'no-referrer'
  25022. }
  25023. // 3. Return referrerOrigin.
  25024. return referrerOrigin
  25025. }
  25026. case 'strict-origin': // eslint-disable-line
  25027. /**
  25028. * 1. If referrerURL is a potentially trustworthy URL and
  25029. * request’s current URL is not a potentially trustworthy URL,
  25030. * then return no referrer.
  25031. * 2. Return referrerOrigin
  25032. */
  25033. case 'no-referrer-when-downgrade': // eslint-disable-line
  25034. /**
  25035. * 1. If referrerURL is a potentially trustworthy URL and
  25036. * request’s current URL is not a potentially trustworthy URL,
  25037. * then return no referrer.
  25038. * 2. Return referrerOrigin
  25039. */
  25040. default: // eslint-disable-line
  25041. return isNonPotentiallyTrustWorthy ? 'no-referrer' : referrerOrigin
  25042. }
  25043. }
  25044. /**
  25045. * @see https://w3c.github.io/webappsec-referrer-policy/#strip-url
  25046. * @param {URL} url
  25047. * @param {boolean|undefined} originOnly
  25048. */
  25049. function stripURLForReferrer (url, originOnly) {
  25050. // 1. Assert: url is a URL.
  25051. assert(url instanceof URL)
  25052. // 2. If url’s scheme is a local scheme, then return no referrer.
  25053. if (url.protocol === 'file:' || url.protocol === 'about:' || url.protocol === 'blank:') {
  25054. return 'no-referrer'
  25055. }
  25056. // 3. Set url’s username to the empty string.
  25057. url.username = ''
  25058. // 4. Set url’s password to the empty string.
  25059. url.password = ''
  25060. // 5. Set url’s fragment to null.
  25061. url.hash = ''
  25062. // 6. If the origin-only flag is true, then:
  25063. if (originOnly) {
  25064. // 1. Set url’s path to « the empty string ».
  25065. url.pathname = ''
  25066. // 2. Set url’s query to null.
  25067. url.search = ''
  25068. }
  25069. // 7. Return url.
  25070. return url
  25071. }
  25072. function isURLPotentiallyTrustworthy (url) {
  25073. if (!(url instanceof URL)) {
  25074. return false
  25075. }
  25076. // If child of about, return true
  25077. if (url.href === 'about:blank' || url.href === 'about:srcdoc') {
  25078. return true
  25079. }
  25080. // If scheme is data, return true
  25081. if (url.protocol === 'data:') return true
  25082. // If file, return true
  25083. if (url.protocol === 'file:') return true
  25084. return isOriginPotentiallyTrustworthy(url.origin)
  25085. function isOriginPotentiallyTrustworthy (origin) {
  25086. // If origin is explicitly null, return false
  25087. if (origin == null || origin === 'null') return false
  25088. const originAsURL = new URL(origin)
  25089. // If secure, return true
  25090. if (originAsURL.protocol === 'https:' || originAsURL.protocol === 'wss:') {
  25091. return true
  25092. }
  25093. // If localhost or variants, return true
  25094. if (/^127(?:\.[0-9]+){0,2}\.[0-9]+$|^\[(?:0*:)*?:?0*1\]$/.test(originAsURL.hostname) ||
  25095. (originAsURL.hostname === 'localhost' || originAsURL.hostname.includes('localhost.')) ||
  25096. (originAsURL.hostname.endsWith('.localhost'))) {
  25097. return true
  25098. }
  25099. // If any other, return false
  25100. return false
  25101. }
  25102. }
  25103. /**
  25104. * @see https://w3c.github.io/webappsec-subresource-integrity/#does-response-match-metadatalist
  25105. * @param {Uint8Array} bytes
  25106. * @param {string} metadataList
  25107. */
  25108. function bytesMatch (bytes, metadataList) {
  25109. // If node is not built with OpenSSL support, we cannot check
  25110. // a request's integrity, so allow it by default (the spec will
  25111. // allow requests if an invalid hash is given, as precedence).
  25112. /* istanbul ignore if: only if node is built with --without-ssl */
  25113. if (crypto === undefined) {
  25114. return true
  25115. }
  25116. // 1. Let parsedMetadata be the result of parsing metadataList.
  25117. const parsedMetadata = parseMetadata(metadataList)
  25118. // 2. If parsedMetadata is no metadata, return true.
  25119. if (parsedMetadata === 'no metadata') {
  25120. return true
  25121. }
  25122. // 3. If response is not eligible for integrity validation, return false.
  25123. // TODO
  25124. // 4. If parsedMetadata is the empty set, return true.
  25125. if (parsedMetadata.length === 0) {
  25126. return true
  25127. }
  25128. // 5. Let metadata be the result of getting the strongest
  25129. // metadata from parsedMetadata.
  25130. const strongest = getStrongestMetadata(parsedMetadata)
  25131. const metadata = filterMetadataListByAlgorithm(parsedMetadata, strongest)
  25132. // 6. For each item in metadata:
  25133. for (const item of metadata) {
  25134. // 1. Let algorithm be the alg component of item.
  25135. const algorithm = item.algo
  25136. // 2. Let expectedValue be the val component of item.
  25137. const expectedValue = item.hash
  25138. // See https://github.com/web-platform-tests/wpt/commit/e4c5cc7a5e48093220528dfdd1c4012dc3837a0e
  25139. // "be liberal with padding". This is annoying, and it's not even in the spec.
  25140. // 3. Let actualValue be the result of applying algorithm to bytes.
  25141. let actualValue = crypto.createHash(algorithm).update(bytes).digest('base64')
  25142. if (actualValue[actualValue.length - 1] === '=') {
  25143. if (actualValue[actualValue.length - 2] === '=') {
  25144. actualValue = actualValue.slice(0, -2)
  25145. } else {
  25146. actualValue = actualValue.slice(0, -1)
  25147. }
  25148. }
  25149. // 4. If actualValue is a case-sensitive match for expectedValue,
  25150. // return true.
  25151. if (compareBase64Mixed(actualValue, expectedValue)) {
  25152. return true
  25153. }
  25154. }
  25155. // 7. Return false.
  25156. return false
  25157. }
  25158. // https://w3c.github.io/webappsec-subresource-integrity/#grammardef-hash-with-options
  25159. // https://www.w3.org/TR/CSP2/#source-list-syntax
  25160. // https://www.rfc-editor.org/rfc/rfc5234#appendix-B.1
  25161. const parseHashWithOptions = /(?<algo>sha256|sha384|sha512)-((?<hash>[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\s|$)( +[!-~]*)?)?/i
  25162. /**
  25163. * @see https://w3c.github.io/webappsec-subresource-integrity/#parse-metadata
  25164. * @param {string} metadata
  25165. */
  25166. function parseMetadata (metadata) {
  25167. // 1. Let result be the empty set.
  25168. /** @type {{ algo: string, hash: string }[]} */
  25169. const result = []
  25170. // 2. Let empty be equal to true.
  25171. let empty = true
  25172. // 3. For each token returned by splitting metadata on spaces:
  25173. for (const token of metadata.split(' ')) {
  25174. // 1. Set empty to false.
  25175. empty = false
  25176. // 2. Parse token as a hash-with-options.
  25177. const parsedToken = parseHashWithOptions.exec(token)
  25178. // 3. If token does not parse, continue to the next token.
  25179. if (
  25180. parsedToken === null ||
  25181. parsedToken.groups === undefined ||
  25182. parsedToken.groups.algo === undefined
  25183. ) {
  25184. // Note: Chromium blocks the request at this point, but Firefox
  25185. // gives a warning that an invalid integrity was given. The
  25186. // correct behavior is to ignore these, and subsequently not
  25187. // check the integrity of the resource.
  25188. continue
  25189. }
  25190. // 4. Let algorithm be the hash-algo component of token.
  25191. const algorithm = parsedToken.groups.algo.toLowerCase()
  25192. // 5. If algorithm is a hash function recognized by the user
  25193. // agent, add the parsed token to result.
  25194. if (supportedHashes.includes(algorithm)) {
  25195. result.push(parsedToken.groups)
  25196. }
  25197. }
  25198. // 4. Return no metadata if empty is true, otherwise return result.
  25199. if (empty === true) {
  25200. return 'no metadata'
  25201. }
  25202. return result
  25203. }
  25204. /**
  25205. * @param {{ algo: 'sha256' | 'sha384' | 'sha512' }[]} metadataList
  25206. */
  25207. function getStrongestMetadata (metadataList) {
  25208. // Let algorithm be the algo component of the first item in metadataList.
  25209. // Can be sha256
  25210. let algorithm = metadataList[0].algo
  25211. // If the algorithm is sha512, then it is the strongest
  25212. // and we can return immediately
  25213. if (algorithm[3] === '5') {
  25214. return algorithm
  25215. }
  25216. for (let i = 1; i < metadataList.length; ++i) {
  25217. const metadata = metadataList[i]
  25218. // If the algorithm is sha512, then it is the strongest
  25219. // and we can break the loop immediately
  25220. if (metadata.algo[3] === '5') {
  25221. algorithm = 'sha512'
  25222. break
  25223. // If the algorithm is sha384, then a potential sha256 or sha384 is ignored
  25224. } else if (algorithm[3] === '3') {
  25225. continue
  25226. // algorithm is sha256, check if algorithm is sha384 and if so, set it as
  25227. // the strongest
  25228. } else if (metadata.algo[3] === '3') {
  25229. algorithm = 'sha384'
  25230. }
  25231. }
  25232. return algorithm
  25233. }
  25234. function filterMetadataListByAlgorithm (metadataList, algorithm) {
  25235. if (metadataList.length === 1) {
  25236. return metadataList
  25237. }
  25238. let pos = 0
  25239. for (let i = 0; i < metadataList.length; ++i) {
  25240. if (metadataList[i].algo === algorithm) {
  25241. metadataList[pos++] = metadataList[i]
  25242. }
  25243. }
  25244. metadataList.length = pos
  25245. return metadataList
  25246. }
  25247. /**
  25248. * Compares two base64 strings, allowing for base64url
  25249. * in the second string.
  25250. *
  25251. * @param {string} actualValue always base64
  25252. * @param {string} expectedValue base64 or base64url
  25253. * @returns {boolean}
  25254. */
  25255. function compareBase64Mixed (actualValue, expectedValue) {
  25256. if (actualValue.length !== expectedValue.length) {
  25257. return false
  25258. }
  25259. for (let i = 0; i < actualValue.length; ++i) {
  25260. if (actualValue[i] !== expectedValue[i]) {
  25261. if (
  25262. (actualValue[i] === '+' && expectedValue[i] === '-') ||
  25263. (actualValue[i] === '/' && expectedValue[i] === '_')
  25264. ) {
  25265. continue
  25266. }
  25267. return false
  25268. }
  25269. }
  25270. return true
  25271. }
  25272. // https://w3c.github.io/webappsec-upgrade-insecure-requests/#upgrade-request
  25273. function tryUpgradeRequestToAPotentiallyTrustworthyURL (request) {
  25274. // TODO
  25275. }
  25276. /**
  25277. * @link {https://html.spec.whatwg.org/multipage/origin.html#same-origin}
  25278. * @param {URL} A
  25279. * @param {URL} B
  25280. */
  25281. function sameOrigin (A, B) {
  25282. // 1. If A and B are the same opaque origin, then return true.
  25283. if (A.origin === B.origin && A.origin === 'null') {
  25284. return true
  25285. }
  25286. // 2. If A and B are both tuple origins and their schemes,
  25287. // hosts, and port are identical, then return true.
  25288. if (A.protocol === B.protocol && A.hostname === B.hostname && A.port === B.port) {
  25289. return true
  25290. }
  25291. // 3. Return false.
  25292. return false
  25293. }
  25294. function createDeferredPromise () {
  25295. let res
  25296. let rej
  25297. const promise = new Promise((resolve, reject) => {
  25298. res = resolve
  25299. rej = reject
  25300. })
  25301. return { promise, resolve: res, reject: rej }
  25302. }
  25303. function isAborted (fetchParams) {
  25304. return fetchParams.controller.state === 'aborted'
  25305. }
  25306. function isCancelled (fetchParams) {
  25307. return fetchParams.controller.state === 'aborted' ||
  25308. fetchParams.controller.state === 'terminated'
  25309. }
  25310. const normalizeMethodRecord = {
  25311. delete: 'DELETE',
  25312. DELETE: 'DELETE',
  25313. get: 'GET',
  25314. GET: 'GET',
  25315. head: 'HEAD',
  25316. HEAD: 'HEAD',
  25317. options: 'OPTIONS',
  25318. OPTIONS: 'OPTIONS',
  25319. post: 'POST',
  25320. POST: 'POST',
  25321. put: 'PUT',
  25322. PUT: 'PUT'
  25323. }
  25324. // Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`.
  25325. Object.setPrototypeOf(normalizeMethodRecord, null)
  25326. /**
  25327. * @see https://fetch.spec.whatwg.org/#concept-method-normalize
  25328. * @param {string} method
  25329. */
  25330. function normalizeMethod (method) {
  25331. return normalizeMethodRecord[method.toLowerCase()] ?? method
  25332. }
  25333. // https://infra.spec.whatwg.org/#serialize-a-javascript-value-to-a-json-string
  25334. function serializeJavascriptValueToJSONString (value) {
  25335. // 1. Let result be ? Call(%JSON.stringify%, undefined, « value »).
  25336. const result = JSON.stringify(value)
  25337. // 2. If result is undefined, then throw a TypeError.
  25338. if (result === undefined) {
  25339. throw new TypeError('Value is not JSON serializable')
  25340. }
  25341. // 3. Assert: result is a string.
  25342. assert(typeof result === 'string')
  25343. // 4. Return result.
  25344. return result
  25345. }
  25346. // https://tc39.es/ecma262/#sec-%25iteratorprototype%25-object
  25347. const esIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))
  25348. /**
  25349. * @see https://webidl.spec.whatwg.org/#dfn-iterator-prototype-object
  25350. * @param {() => unknown[]} iterator
  25351. * @param {string} name name of the instance
  25352. * @param {'key'|'value'|'key+value'} kind
  25353. */
  25354. function makeIterator (iterator, name, kind) {
  25355. const object = {
  25356. index: 0,
  25357. kind,
  25358. target: iterator
  25359. }
  25360. const i = {
  25361. next () {
  25362. // 1. Let interface be the interface for which the iterator prototype object exists.
  25363. // 2. Let thisValue be the this value.
  25364. // 3. Let object be ? ToObject(thisValue).
  25365. // 4. If object is a platform object, then perform a security
  25366. // check, passing:
  25367. // 5. If object is not a default iterator object for interface,
  25368. // then throw a TypeError.
  25369. if (Object.getPrototypeOf(this) !== i) {
  25370. throw new TypeError(
  25371. `'next' called on an object that does not implement interface ${name} Iterator.`
  25372. )
  25373. }
  25374. // 6. Let index be object’s index.
  25375. // 7. Let kind be object’s kind.
  25376. // 8. Let values be object’s target's value pairs to iterate over.
  25377. const { index, kind, target } = object
  25378. const values = target()
  25379. // 9. Let len be the length of values.
  25380. const len = values.length
  25381. // 10. If index is greater than or equal to len, then return
  25382. // CreateIterResultObject(undefined, true).
  25383. if (index >= len) {
  25384. return { value: undefined, done: true }
  25385. }
  25386. // 11. Let pair be the entry in values at index index.
  25387. const pair = values[index]
  25388. // 12. Set object’s index to index + 1.
  25389. object.index = index + 1
  25390. // 13. Return the iterator result for pair and kind.
  25391. return iteratorResult(pair, kind)
  25392. },
  25393. // The class string of an iterator prototype object for a given interface is the
  25394. // result of concatenating the identifier of the interface and the string " Iterator".
  25395. [Symbol.toStringTag]: `${name} Iterator`
  25396. }
  25397. // The [[Prototype]] internal slot of an iterator prototype object must be %IteratorPrototype%.
  25398. Object.setPrototypeOf(i, esIteratorPrototype)
  25399. // esIteratorPrototype needs to be the prototype of i
  25400. // which is the prototype of an empty object. Yes, it's confusing.
  25401. return Object.setPrototypeOf({}, i)
  25402. }
  25403. // https://webidl.spec.whatwg.org/#iterator-result
  25404. function iteratorResult (pair, kind) {
  25405. let result
  25406. // 1. Let result be a value determined by the value of kind:
  25407. switch (kind) {
  25408. case 'key': {
  25409. // 1. Let idlKey be pair’s key.
  25410. // 2. Let key be the result of converting idlKey to an
  25411. // ECMAScript value.
  25412. // 3. result is key.
  25413. result = pair[0]
  25414. break
  25415. }
  25416. case 'value': {
  25417. // 1. Let idlValue be pair’s value.
  25418. // 2. Let value be the result of converting idlValue to
  25419. // an ECMAScript value.
  25420. // 3. result is value.
  25421. result = pair[1]
  25422. break
  25423. }
  25424. case 'key+value': {
  25425. // 1. Let idlKey be pair’s key.
  25426. // 2. Let idlValue be pair’s value.
  25427. // 3. Let key be the result of converting idlKey to an
  25428. // ECMAScript value.
  25429. // 4. Let value be the result of converting idlValue to
  25430. // an ECMAScript value.
  25431. // 5. Let array be ! ArrayCreate(2).
  25432. // 6. Call ! CreateDataProperty(array, "0", key).
  25433. // 7. Call ! CreateDataProperty(array, "1", value).
  25434. // 8. result is array.
  25435. result = pair
  25436. break
  25437. }
  25438. }
  25439. // 2. Return CreateIterResultObject(result, false).
  25440. return { value: result, done: false }
  25441. }
  25442. /**
  25443. * @see https://fetch.spec.whatwg.org/#body-fully-read
  25444. */
  25445. async function fullyReadBody (body, processBody, processBodyError) {
  25446. // 1. If taskDestination is null, then set taskDestination to
  25447. // the result of starting a new parallel queue.
  25448. // 2. Let successSteps given a byte sequence bytes be to queue a
  25449. // fetch task to run processBody given bytes, with taskDestination.
  25450. const successSteps = processBody
  25451. // 3. Let errorSteps be to queue a fetch task to run processBodyError,
  25452. // with taskDestination.
  25453. const errorSteps = processBodyError
  25454. // 4. Let reader be the result of getting a reader for body’s stream.
  25455. // If that threw an exception, then run errorSteps with that
  25456. // exception and return.
  25457. let reader
  25458. try {
  25459. reader = body.stream.getReader()
  25460. } catch (e) {
  25461. errorSteps(e)
  25462. return
  25463. }
  25464. // 5. Read all bytes from reader, given successSteps and errorSteps.
  25465. try {
  25466. const result = await readAllBytes(reader)
  25467. successSteps(result)
  25468. } catch (e) {
  25469. errorSteps(e)
  25470. }
  25471. }
  25472. /** @type {ReadableStream} */
  25473. let ReadableStream = globalThis.ReadableStream
  25474. function isReadableStreamLike (stream) {
  25475. if (!ReadableStream) {
  25476. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  25477. }
  25478. return stream instanceof ReadableStream || (
  25479. stream[Symbol.toStringTag] === 'ReadableStream' &&
  25480. typeof stream.tee === 'function'
  25481. )
  25482. }
  25483. const MAXIMUM_ARGUMENT_LENGTH = 65535
  25484. /**
  25485. * @see https://infra.spec.whatwg.org/#isomorphic-decode
  25486. * @param {number[]|Uint8Array} input
  25487. */
  25488. function isomorphicDecode (input) {
  25489. // 1. To isomorphic decode a byte sequence input, return a string whose code point
  25490. // length is equal to input’s length and whose code points have the same values
  25491. // as the values of input’s bytes, in the same order.
  25492. if (input.length < MAXIMUM_ARGUMENT_LENGTH) {
  25493. return String.fromCharCode(...input)
  25494. }
  25495. return input.reduce((previous, current) => previous + String.fromCharCode(current), '')
  25496. }
  25497. /**
  25498. * @param {ReadableStreamController<Uint8Array>} controller
  25499. */
  25500. function readableStreamClose (controller) {
  25501. try {
  25502. controller.close()
  25503. } catch (err) {
  25504. // TODO: add comment explaining why this error occurs.
  25505. if (!err.message.includes('Controller is already closed')) {
  25506. throw err
  25507. }
  25508. }
  25509. }
  25510. /**
  25511. * @see https://infra.spec.whatwg.org/#isomorphic-encode
  25512. * @param {string} input
  25513. */
  25514. function isomorphicEncode (input) {
  25515. // 1. Assert: input contains no code points greater than U+00FF.
  25516. for (let i = 0; i < input.length; i++) {
  25517. assert(input.charCodeAt(i) <= 0xFF)
  25518. }
  25519. // 2. Return a byte sequence whose length is equal to input’s code
  25520. // point length and whose bytes have the same values as the
  25521. // values of input’s code points, in the same order
  25522. return input
  25523. }
  25524. /**
  25525. * @see https://streams.spec.whatwg.org/#readablestreamdefaultreader-read-all-bytes
  25526. * @see https://streams.spec.whatwg.org/#read-loop
  25527. * @param {ReadableStreamDefaultReader} reader
  25528. */
  25529. async function readAllBytes (reader) {
  25530. const bytes = []
  25531. let byteLength = 0
  25532. while (true) {
  25533. const { done, value: chunk } = await reader.read()
  25534. if (done) {
  25535. // 1. Call successSteps with bytes.
  25536. return Buffer.concat(bytes, byteLength)
  25537. }
  25538. // 1. If chunk is not a Uint8Array object, call failureSteps
  25539. // with a TypeError and abort these steps.
  25540. if (!isUint8Array(chunk)) {
  25541. throw new TypeError('Received non-Uint8Array chunk')
  25542. }
  25543. // 2. Append the bytes represented by chunk to bytes.
  25544. bytes.push(chunk)
  25545. byteLength += chunk.length
  25546. // 3. Read-loop given reader, bytes, successSteps, and failureSteps.
  25547. }
  25548. }
  25549. /**
  25550. * @see https://fetch.spec.whatwg.org/#is-local
  25551. * @param {URL} url
  25552. */
  25553. function urlIsLocal (url) {
  25554. assert('protocol' in url) // ensure it's a url object
  25555. const protocol = url.protocol
  25556. return protocol === 'about:' || protocol === 'blob:' || protocol === 'data:'
  25557. }
  25558. /**
  25559. * @param {string|URL} url
  25560. */
  25561. function urlHasHttpsScheme (url) {
  25562. if (typeof url === 'string') {
  25563. return url.startsWith('https:')
  25564. }
  25565. return url.protocol === 'https:'
  25566. }
  25567. /**
  25568. * @see https://fetch.spec.whatwg.org/#http-scheme
  25569. * @param {URL} url
  25570. */
  25571. function urlIsHttpHttpsScheme (url) {
  25572. assert('protocol' in url) // ensure it's a url object
  25573. const protocol = url.protocol
  25574. return protocol === 'http:' || protocol === 'https:'
  25575. }
  25576. /**
  25577. * Fetch supports node >= 16.8.0, but Object.hasOwn was added in v16.9.0.
  25578. */
  25579. const hasOwn = Object.hasOwn || ((dict, key) => Object.prototype.hasOwnProperty.call(dict, key))
  25580. module.exports = {
  25581. isAborted,
  25582. isCancelled,
  25583. createDeferredPromise,
  25584. ReadableStreamFrom,
  25585. toUSVString,
  25586. tryUpgradeRequestToAPotentiallyTrustworthyURL,
  25587. coarsenedSharedCurrentTime,
  25588. determineRequestsReferrer,
  25589. makePolicyContainer,
  25590. clonePolicyContainer,
  25591. appendFetchMetadata,
  25592. appendRequestOriginHeader,
  25593. TAOCheck,
  25594. corsCheck,
  25595. crossOriginResourcePolicyCheck,
  25596. createOpaqueTimingInfo,
  25597. setRequestReferrerPolicyOnRedirect,
  25598. isValidHTTPToken,
  25599. requestBadPort,
  25600. requestCurrentURL,
  25601. responseURL,
  25602. responseLocationURL,
  25603. isBlobLike,
  25604. isURLPotentiallyTrustworthy,
  25605. isValidReasonPhrase,
  25606. sameOrigin,
  25607. normalizeMethod,
  25608. serializeJavascriptValueToJSONString,
  25609. makeIterator,
  25610. isValidHeaderName,
  25611. isValidHeaderValue,
  25612. hasOwn,
  25613. isErrorLike,
  25614. fullyReadBody,
  25615. bytesMatch,
  25616. isReadableStreamLike,
  25617. readableStreamClose,
  25618. isomorphicEncode,
  25619. isomorphicDecode,
  25620. urlIsLocal,
  25621. urlHasHttpsScheme,
  25622. urlIsHttpHttpsScheme,
  25623. readAllBytes,
  25624. normalizeMethodRecord,
  25625. parseMetadata
  25626. }
  25627. /***/ }),
  25628. /***/ 1744:
  25629. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  25630. "use strict";
  25631. const { types } = __nccwpck_require__(3837)
  25632. const { hasOwn, toUSVString } = __nccwpck_require__(2538)
  25633. /** @type {import('../../types/webidl').Webidl} */
  25634. const webidl = {}
  25635. webidl.converters = {}
  25636. webidl.util = {}
  25637. webidl.errors = {}
  25638. webidl.errors.exception = function (message) {
  25639. return new TypeError(`${message.header}: ${message.message}`)
  25640. }
  25641. webidl.errors.conversionFailed = function (context) {
  25642. const plural = context.types.length === 1 ? '' : ' one of'
  25643. const message =
  25644. `${context.argument} could not be converted to` +
  25645. `${plural}: ${context.types.join(', ')}.`
  25646. return webidl.errors.exception({
  25647. header: context.prefix,
  25648. message
  25649. })
  25650. }
  25651. webidl.errors.invalidArgument = function (context) {
  25652. return webidl.errors.exception({
  25653. header: context.prefix,
  25654. message: `"${context.value}" is an invalid ${context.type}.`
  25655. })
  25656. }
  25657. // https://webidl.spec.whatwg.org/#implements
  25658. webidl.brandCheck = function (V, I, opts = undefined) {
  25659. if (opts?.strict !== false && !(V instanceof I)) {
  25660. throw new TypeError('Illegal invocation')
  25661. } else {
  25662. return V?.[Symbol.toStringTag] === I.prototype[Symbol.toStringTag]
  25663. }
  25664. }
  25665. webidl.argumentLengthCheck = function ({ length }, min, ctx) {
  25666. if (length < min) {
  25667. throw webidl.errors.exception({
  25668. message: `${min} argument${min !== 1 ? 's' : ''} required, ` +
  25669. `but${length ? ' only' : ''} ${length} found.`,
  25670. ...ctx
  25671. })
  25672. }
  25673. }
  25674. webidl.illegalConstructor = function () {
  25675. throw webidl.errors.exception({
  25676. header: 'TypeError',
  25677. message: 'Illegal constructor'
  25678. })
  25679. }
  25680. // https://tc39.es/ecma262/#sec-ecmascript-data-types-and-values
  25681. webidl.util.Type = function (V) {
  25682. switch (typeof V) {
  25683. case 'undefined': return 'Undefined'
  25684. case 'boolean': return 'Boolean'
  25685. case 'string': return 'String'
  25686. case 'symbol': return 'Symbol'
  25687. case 'number': return 'Number'
  25688. case 'bigint': return 'BigInt'
  25689. case 'function':
  25690. case 'object': {
  25691. if (V === null) {
  25692. return 'Null'
  25693. }
  25694. return 'Object'
  25695. }
  25696. }
  25697. }
  25698. // https://webidl.spec.whatwg.org/#abstract-opdef-converttoint
  25699. webidl.util.ConvertToInt = function (V, bitLength, signedness, opts = {}) {
  25700. let upperBound
  25701. let lowerBound
  25702. // 1. If bitLength is 64, then:
  25703. if (bitLength === 64) {
  25704. // 1. Let upperBound be 2^53 − 1.
  25705. upperBound = Math.pow(2, 53) - 1
  25706. // 2. If signedness is "unsigned", then let lowerBound be 0.
  25707. if (signedness === 'unsigned') {
  25708. lowerBound = 0
  25709. } else {
  25710. // 3. Otherwise let lowerBound be −2^53 + 1.
  25711. lowerBound = Math.pow(-2, 53) + 1
  25712. }
  25713. } else if (signedness === 'unsigned') {
  25714. // 2. Otherwise, if signedness is "unsigned", then:
  25715. // 1. Let lowerBound be 0.
  25716. lowerBound = 0
  25717. // 2. Let upperBound be 2^bitLength − 1.
  25718. upperBound = Math.pow(2, bitLength) - 1
  25719. } else {
  25720. // 3. Otherwise:
  25721. // 1. Let lowerBound be -2^bitLength − 1.
  25722. lowerBound = Math.pow(-2, bitLength) - 1
  25723. // 2. Let upperBound be 2^bitLength − 1 − 1.
  25724. upperBound = Math.pow(2, bitLength - 1) - 1
  25725. }
  25726. // 4. Let x be ? ToNumber(V).
  25727. let x = Number(V)
  25728. // 5. If x is −0, then set x to +0.
  25729. if (x === 0) {
  25730. x = 0
  25731. }
  25732. // 6. If the conversion is to an IDL type associated
  25733. // with the [EnforceRange] extended attribute, then:
  25734. if (opts.enforceRange === true) {
  25735. // 1. If x is NaN, +∞, or −∞, then throw a TypeError.
  25736. if (
  25737. Number.isNaN(x) ||
  25738. x === Number.POSITIVE_INFINITY ||
  25739. x === Number.NEGATIVE_INFINITY
  25740. ) {
  25741. throw webidl.errors.exception({
  25742. header: 'Integer conversion',
  25743. message: `Could not convert ${V} to an integer.`
  25744. })
  25745. }
  25746. // 2. Set x to IntegerPart(x).
  25747. x = webidl.util.IntegerPart(x)
  25748. // 3. If x < lowerBound or x > upperBound, then
  25749. // throw a TypeError.
  25750. if (x < lowerBound || x > upperBound) {
  25751. throw webidl.errors.exception({
  25752. header: 'Integer conversion',
  25753. message: `Value must be between ${lowerBound}-${upperBound}, got ${x}.`
  25754. })
  25755. }
  25756. // 4. Return x.
  25757. return x
  25758. }
  25759. // 7. If x is not NaN and the conversion is to an IDL
  25760. // type associated with the [Clamp] extended
  25761. // attribute, then:
  25762. if (!Number.isNaN(x) && opts.clamp === true) {
  25763. // 1. Set x to min(max(x, lowerBound), upperBound).
  25764. x = Math.min(Math.max(x, lowerBound), upperBound)
  25765. // 2. Round x to the nearest integer, choosing the
  25766. // even integer if it lies halfway between two,
  25767. // and choosing +0 rather than −0.
  25768. if (Math.floor(x) % 2 === 0) {
  25769. x = Math.floor(x)
  25770. } else {
  25771. x = Math.ceil(x)
  25772. }
  25773. // 3. Return x.
  25774. return x
  25775. }
  25776. // 8. If x is NaN, +0, +∞, or −∞, then return +0.
  25777. if (
  25778. Number.isNaN(x) ||
  25779. (x === 0 && Object.is(0, x)) ||
  25780. x === Number.POSITIVE_INFINITY ||
  25781. x === Number.NEGATIVE_INFINITY
  25782. ) {
  25783. return 0
  25784. }
  25785. // 9. Set x to IntegerPart(x).
  25786. x = webidl.util.IntegerPart(x)
  25787. // 10. Set x to x modulo 2^bitLength.
  25788. x = x % Math.pow(2, bitLength)
  25789. // 11. If signedness is "signed" and x ≥ 2^bitLength − 1,
  25790. // then return x − 2^bitLength.
  25791. if (signedness === 'signed' && x >= Math.pow(2, bitLength) - 1) {
  25792. return x - Math.pow(2, bitLength)
  25793. }
  25794. // 12. Otherwise, return x.
  25795. return x
  25796. }
  25797. // https://webidl.spec.whatwg.org/#abstract-opdef-integerpart
  25798. webidl.util.IntegerPart = function (n) {
  25799. // 1. Let r be floor(abs(n)).
  25800. const r = Math.floor(Math.abs(n))
  25801. // 2. If n < 0, then return -1 × r.
  25802. if (n < 0) {
  25803. return -1 * r
  25804. }
  25805. // 3. Otherwise, return r.
  25806. return r
  25807. }
  25808. // https://webidl.spec.whatwg.org/#es-sequence
  25809. webidl.sequenceConverter = function (converter) {
  25810. return (V) => {
  25811. // 1. If Type(V) is not Object, throw a TypeError.
  25812. if (webidl.util.Type(V) !== 'Object') {
  25813. throw webidl.errors.exception({
  25814. header: 'Sequence',
  25815. message: `Value of type ${webidl.util.Type(V)} is not an Object.`
  25816. })
  25817. }
  25818. // 2. Let method be ? GetMethod(V, @@iterator).
  25819. /** @type {Generator} */
  25820. const method = V?.[Symbol.iterator]?.()
  25821. const seq = []
  25822. // 3. If method is undefined, throw a TypeError.
  25823. if (
  25824. method === undefined ||
  25825. typeof method.next !== 'function'
  25826. ) {
  25827. throw webidl.errors.exception({
  25828. header: 'Sequence',
  25829. message: 'Object is not an iterator.'
  25830. })
  25831. }
  25832. // https://webidl.spec.whatwg.org/#create-sequence-from-iterable
  25833. while (true) {
  25834. const { done, value } = method.next()
  25835. if (done) {
  25836. break
  25837. }
  25838. seq.push(converter(value))
  25839. }
  25840. return seq
  25841. }
  25842. }
  25843. // https://webidl.spec.whatwg.org/#es-to-record
  25844. webidl.recordConverter = function (keyConverter, valueConverter) {
  25845. return (O) => {
  25846. // 1. If Type(O) is not Object, throw a TypeError.
  25847. if (webidl.util.Type(O) !== 'Object') {
  25848. throw webidl.errors.exception({
  25849. header: 'Record',
  25850. message: `Value of type ${webidl.util.Type(O)} is not an Object.`
  25851. })
  25852. }
  25853. // 2. Let result be a new empty instance of record<K, V>.
  25854. const result = {}
  25855. if (!types.isProxy(O)) {
  25856. // Object.keys only returns enumerable properties
  25857. const keys = Object.keys(O)
  25858. for (const key of keys) {
  25859. // 1. Let typedKey be key converted to an IDL value of type K.
  25860. const typedKey = keyConverter(key)
  25861. // 2. Let value be ? Get(O, key).
  25862. // 3. Let typedValue be value converted to an IDL value of type V.
  25863. const typedValue = valueConverter(O[key])
  25864. // 4. Set result[typedKey] to typedValue.
  25865. result[typedKey] = typedValue
  25866. }
  25867. // 5. Return result.
  25868. return result
  25869. }
  25870. // 3. Let keys be ? O.[[OwnPropertyKeys]]().
  25871. const keys = Reflect.ownKeys(O)
  25872. // 4. For each key of keys.
  25873. for (const key of keys) {
  25874. // 1. Let desc be ? O.[[GetOwnProperty]](key).
  25875. const desc = Reflect.getOwnPropertyDescriptor(O, key)
  25876. // 2. If desc is not undefined and desc.[[Enumerable]] is true:
  25877. if (desc?.enumerable) {
  25878. // 1. Let typedKey be key converted to an IDL value of type K.
  25879. const typedKey = keyConverter(key)
  25880. // 2. Let value be ? Get(O, key).
  25881. // 3. Let typedValue be value converted to an IDL value of type V.
  25882. const typedValue = valueConverter(O[key])
  25883. // 4. Set result[typedKey] to typedValue.
  25884. result[typedKey] = typedValue
  25885. }
  25886. }
  25887. // 5. Return result.
  25888. return result
  25889. }
  25890. }
  25891. webidl.interfaceConverter = function (i) {
  25892. return (V, opts = {}) => {
  25893. if (opts.strict !== false && !(V instanceof i)) {
  25894. throw webidl.errors.exception({
  25895. header: i.name,
  25896. message: `Expected ${V} to be an instance of ${i.name}.`
  25897. })
  25898. }
  25899. return V
  25900. }
  25901. }
  25902. webidl.dictionaryConverter = function (converters) {
  25903. return (dictionary) => {
  25904. const type = webidl.util.Type(dictionary)
  25905. const dict = {}
  25906. if (type === 'Null' || type === 'Undefined') {
  25907. return dict
  25908. } else if (type !== 'Object') {
  25909. throw webidl.errors.exception({
  25910. header: 'Dictionary',
  25911. message: `Expected ${dictionary} to be one of: Null, Undefined, Object.`
  25912. })
  25913. }
  25914. for (const options of converters) {
  25915. const { key, defaultValue, required, converter } = options
  25916. if (required === true) {
  25917. if (!hasOwn(dictionary, key)) {
  25918. throw webidl.errors.exception({
  25919. header: 'Dictionary',
  25920. message: `Missing required key "${key}".`
  25921. })
  25922. }
  25923. }
  25924. let value = dictionary[key]
  25925. const hasDefault = hasOwn(options, 'defaultValue')
  25926. // Only use defaultValue if value is undefined and
  25927. // a defaultValue options was provided.
  25928. if (hasDefault && value !== null) {
  25929. value = value ?? defaultValue
  25930. }
  25931. // A key can be optional and have no default value.
  25932. // When this happens, do not perform a conversion,
  25933. // and do not assign the key a value.
  25934. if (required || hasDefault || value !== undefined) {
  25935. value = converter(value)
  25936. if (
  25937. options.allowedValues &&
  25938. !options.allowedValues.includes(value)
  25939. ) {
  25940. throw webidl.errors.exception({
  25941. header: 'Dictionary',
  25942. message: `${value} is not an accepted type. Expected one of ${options.allowedValues.join(', ')}.`
  25943. })
  25944. }
  25945. dict[key] = value
  25946. }
  25947. }
  25948. return dict
  25949. }
  25950. }
  25951. webidl.nullableConverter = function (converter) {
  25952. return (V) => {
  25953. if (V === null) {
  25954. return V
  25955. }
  25956. return converter(V)
  25957. }
  25958. }
  25959. // https://webidl.spec.whatwg.org/#es-DOMString
  25960. webidl.converters.DOMString = function (V, opts = {}) {
  25961. // 1. If V is null and the conversion is to an IDL type
  25962. // associated with the [LegacyNullToEmptyString]
  25963. // extended attribute, then return the DOMString value
  25964. // that represents the empty string.
  25965. if (V === null && opts.legacyNullToEmptyString) {
  25966. return ''
  25967. }
  25968. // 2. Let x be ? ToString(V).
  25969. if (typeof V === 'symbol') {
  25970. throw new TypeError('Could not convert argument of type symbol to string.')
  25971. }
  25972. // 3. Return the IDL DOMString value that represents the
  25973. // same sequence of code units as the one the
  25974. // ECMAScript String value x represents.
  25975. return String(V)
  25976. }
  25977. // https://webidl.spec.whatwg.org/#es-ByteString
  25978. webidl.converters.ByteString = function (V) {
  25979. // 1. Let x be ? ToString(V).
  25980. // Note: DOMString converter perform ? ToString(V)
  25981. const x = webidl.converters.DOMString(V)
  25982. // 2. If the value of any element of x is greater than
  25983. // 255, then throw a TypeError.
  25984. for (let index = 0; index < x.length; index++) {
  25985. if (x.charCodeAt(index) > 255) {
  25986. throw new TypeError(
  25987. 'Cannot convert argument to a ByteString because the character at ' +
  25988. `index ${index} has a value of ${x.charCodeAt(index)} which is greater than 255.`
  25989. )
  25990. }
  25991. }
  25992. // 3. Return an IDL ByteString value whose length is the
  25993. // length of x, and where the value of each element is
  25994. // the value of the corresponding element of x.
  25995. return x
  25996. }
  25997. // https://webidl.spec.whatwg.org/#es-USVString
  25998. webidl.converters.USVString = toUSVString
  25999. // https://webidl.spec.whatwg.org/#es-boolean
  26000. webidl.converters.boolean = function (V) {
  26001. // 1. Let x be the result of computing ToBoolean(V).
  26002. const x = Boolean(V)
  26003. // 2. Return the IDL boolean value that is the one that represents
  26004. // the same truth value as the ECMAScript Boolean value x.
  26005. return x
  26006. }
  26007. // https://webidl.spec.whatwg.org/#es-any
  26008. webidl.converters.any = function (V) {
  26009. return V
  26010. }
  26011. // https://webidl.spec.whatwg.org/#es-long-long
  26012. webidl.converters['long long'] = function (V) {
  26013. // 1. Let x be ? ConvertToInt(V, 64, "signed").
  26014. const x = webidl.util.ConvertToInt(V, 64, 'signed')
  26015. // 2. Return the IDL long long value that represents
  26016. // the same numeric value as x.
  26017. return x
  26018. }
  26019. // https://webidl.spec.whatwg.org/#es-unsigned-long-long
  26020. webidl.converters['unsigned long long'] = function (V) {
  26021. // 1. Let x be ? ConvertToInt(V, 64, "unsigned").
  26022. const x = webidl.util.ConvertToInt(V, 64, 'unsigned')
  26023. // 2. Return the IDL unsigned long long value that
  26024. // represents the same numeric value as x.
  26025. return x
  26026. }
  26027. // https://webidl.spec.whatwg.org/#es-unsigned-long
  26028. webidl.converters['unsigned long'] = function (V) {
  26029. // 1. Let x be ? ConvertToInt(V, 32, "unsigned").
  26030. const x = webidl.util.ConvertToInt(V, 32, 'unsigned')
  26031. // 2. Return the IDL unsigned long value that
  26032. // represents the same numeric value as x.
  26033. return x
  26034. }
  26035. // https://webidl.spec.whatwg.org/#es-unsigned-short
  26036. webidl.converters['unsigned short'] = function (V, opts) {
  26037. // 1. Let x be ? ConvertToInt(V, 16, "unsigned").
  26038. const x = webidl.util.ConvertToInt(V, 16, 'unsigned', opts)
  26039. // 2. Return the IDL unsigned short value that represents
  26040. // the same numeric value as x.
  26041. return x
  26042. }
  26043. // https://webidl.spec.whatwg.org/#idl-ArrayBuffer
  26044. webidl.converters.ArrayBuffer = function (V, opts = {}) {
  26045. // 1. If Type(V) is not Object, or V does not have an
  26046. // [[ArrayBufferData]] internal slot, then throw a
  26047. // TypeError.
  26048. // see: https://tc39.es/ecma262/#sec-properties-of-the-arraybuffer-instances
  26049. // see: https://tc39.es/ecma262/#sec-properties-of-the-sharedarraybuffer-instances
  26050. if (
  26051. webidl.util.Type(V) !== 'Object' ||
  26052. !types.isAnyArrayBuffer(V)
  26053. ) {
  26054. throw webidl.errors.conversionFailed({
  26055. prefix: `${V}`,
  26056. argument: `${V}`,
  26057. types: ['ArrayBuffer']
  26058. })
  26059. }
  26060. // 2. If the conversion is not to an IDL type associated
  26061. // with the [AllowShared] extended attribute, and
  26062. // IsSharedArrayBuffer(V) is true, then throw a
  26063. // TypeError.
  26064. if (opts.allowShared === false && types.isSharedArrayBuffer(V)) {
  26065. throw webidl.errors.exception({
  26066. header: 'ArrayBuffer',
  26067. message: 'SharedArrayBuffer is not allowed.'
  26068. })
  26069. }
  26070. // 3. If the conversion is not to an IDL type associated
  26071. // with the [AllowResizable] extended attribute, and
  26072. // IsResizableArrayBuffer(V) is true, then throw a
  26073. // TypeError.
  26074. // Note: resizable ArrayBuffers are currently a proposal.
  26075. // 4. Return the IDL ArrayBuffer value that is a
  26076. // reference to the same object as V.
  26077. return V
  26078. }
  26079. webidl.converters.TypedArray = function (V, T, opts = {}) {
  26080. // 1. Let T be the IDL type V is being converted to.
  26081. // 2. If Type(V) is not Object, or V does not have a
  26082. // [[TypedArrayName]] internal slot with a value
  26083. // equal to T’s name, then throw a TypeError.
  26084. if (
  26085. webidl.util.Type(V) !== 'Object' ||
  26086. !types.isTypedArray(V) ||
  26087. V.constructor.name !== T.name
  26088. ) {
  26089. throw webidl.errors.conversionFailed({
  26090. prefix: `${T.name}`,
  26091. argument: `${V}`,
  26092. types: [T.name]
  26093. })
  26094. }
  26095. // 3. If the conversion is not to an IDL type associated
  26096. // with the [AllowShared] extended attribute, and
  26097. // IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is
  26098. // true, then throw a TypeError.
  26099. if (opts.allowShared === false && types.isSharedArrayBuffer(V.buffer)) {
  26100. throw webidl.errors.exception({
  26101. header: 'ArrayBuffer',
  26102. message: 'SharedArrayBuffer is not allowed.'
  26103. })
  26104. }
  26105. // 4. If the conversion is not to an IDL type associated
  26106. // with the [AllowResizable] extended attribute, and
  26107. // IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is
  26108. // true, then throw a TypeError.
  26109. // Note: resizable array buffers are currently a proposal
  26110. // 5. Return the IDL value of type T that is a reference
  26111. // to the same object as V.
  26112. return V
  26113. }
  26114. webidl.converters.DataView = function (V, opts = {}) {
  26115. // 1. If Type(V) is not Object, or V does not have a
  26116. // [[DataView]] internal slot, then throw a TypeError.
  26117. if (webidl.util.Type(V) !== 'Object' || !types.isDataView(V)) {
  26118. throw webidl.errors.exception({
  26119. header: 'DataView',
  26120. message: 'Object is not a DataView.'
  26121. })
  26122. }
  26123. // 2. If the conversion is not to an IDL type associated
  26124. // with the [AllowShared] extended attribute, and
  26125. // IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is true,
  26126. // then throw a TypeError.
  26127. if (opts.allowShared === false && types.isSharedArrayBuffer(V.buffer)) {
  26128. throw webidl.errors.exception({
  26129. header: 'ArrayBuffer',
  26130. message: 'SharedArrayBuffer is not allowed.'
  26131. })
  26132. }
  26133. // 3. If the conversion is not to an IDL type associated
  26134. // with the [AllowResizable] extended attribute, and
  26135. // IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is
  26136. // true, then throw a TypeError.
  26137. // Note: resizable ArrayBuffers are currently a proposal
  26138. // 4. Return the IDL DataView value that is a reference
  26139. // to the same object as V.
  26140. return V
  26141. }
  26142. // https://webidl.spec.whatwg.org/#BufferSource
  26143. webidl.converters.BufferSource = function (V, opts = {}) {
  26144. if (types.isAnyArrayBuffer(V)) {
  26145. return webidl.converters.ArrayBuffer(V, opts)
  26146. }
  26147. if (types.isTypedArray(V)) {
  26148. return webidl.converters.TypedArray(V, V.constructor)
  26149. }
  26150. if (types.isDataView(V)) {
  26151. return webidl.converters.DataView(V, opts)
  26152. }
  26153. throw new TypeError(`Could not convert ${V} to a BufferSource.`)
  26154. }
  26155. webidl.converters['sequence<ByteString>'] = webidl.sequenceConverter(
  26156. webidl.converters.ByteString
  26157. )
  26158. webidl.converters['sequence<sequence<ByteString>>'] = webidl.sequenceConverter(
  26159. webidl.converters['sequence<ByteString>']
  26160. )
  26161. webidl.converters['record<ByteString, ByteString>'] = webidl.recordConverter(
  26162. webidl.converters.ByteString,
  26163. webidl.converters.ByteString
  26164. )
  26165. module.exports = {
  26166. webidl
  26167. }
  26168. /***/ }),
  26169. /***/ 4854:
  26170. /***/ ((module) => {
  26171. "use strict";
  26172. /**
  26173. * @see https://encoding.spec.whatwg.org/#concept-encoding-get
  26174. * @param {string|undefined} label
  26175. */
  26176. function getEncoding (label) {
  26177. if (!label) {
  26178. return 'failure'
  26179. }
  26180. // 1. Remove any leading and trailing ASCII whitespace from label.
  26181. // 2. If label is an ASCII case-insensitive match for any of the
  26182. // labels listed in the table below, then return the
  26183. // corresponding encoding; otherwise return failure.
  26184. switch (label.trim().toLowerCase()) {
  26185. case 'unicode-1-1-utf-8':
  26186. case 'unicode11utf8':
  26187. case 'unicode20utf8':
  26188. case 'utf-8':
  26189. case 'utf8':
  26190. case 'x-unicode20utf8':
  26191. return 'UTF-8'
  26192. case '866':
  26193. case 'cp866':
  26194. case 'csibm866':
  26195. case 'ibm866':
  26196. return 'IBM866'
  26197. case 'csisolatin2':
  26198. case 'iso-8859-2':
  26199. case 'iso-ir-101':
  26200. case 'iso8859-2':
  26201. case 'iso88592':
  26202. case 'iso_8859-2':
  26203. case 'iso_8859-2:1987':
  26204. case 'l2':
  26205. case 'latin2':
  26206. return 'ISO-8859-2'
  26207. case 'csisolatin3':
  26208. case 'iso-8859-3':
  26209. case 'iso-ir-109':
  26210. case 'iso8859-3':
  26211. case 'iso88593':
  26212. case 'iso_8859-3':
  26213. case 'iso_8859-3:1988':
  26214. case 'l3':
  26215. case 'latin3':
  26216. return 'ISO-8859-3'
  26217. case 'csisolatin4':
  26218. case 'iso-8859-4':
  26219. case 'iso-ir-110':
  26220. case 'iso8859-4':
  26221. case 'iso88594':
  26222. case 'iso_8859-4':
  26223. case 'iso_8859-4:1988':
  26224. case 'l4':
  26225. case 'latin4':
  26226. return 'ISO-8859-4'
  26227. case 'csisolatincyrillic':
  26228. case 'cyrillic':
  26229. case 'iso-8859-5':
  26230. case 'iso-ir-144':
  26231. case 'iso8859-5':
  26232. case 'iso88595':
  26233. case 'iso_8859-5':
  26234. case 'iso_8859-5:1988':
  26235. return 'ISO-8859-5'
  26236. case 'arabic':
  26237. case 'asmo-708':
  26238. case 'csiso88596e':
  26239. case 'csiso88596i':
  26240. case 'csisolatinarabic':
  26241. case 'ecma-114':
  26242. case 'iso-8859-6':
  26243. case 'iso-8859-6-e':
  26244. case 'iso-8859-6-i':
  26245. case 'iso-ir-127':
  26246. case 'iso8859-6':
  26247. case 'iso88596':
  26248. case 'iso_8859-6':
  26249. case 'iso_8859-6:1987':
  26250. return 'ISO-8859-6'
  26251. case 'csisolatingreek':
  26252. case 'ecma-118':
  26253. case 'elot_928':
  26254. case 'greek':
  26255. case 'greek8':
  26256. case 'iso-8859-7':
  26257. case 'iso-ir-126':
  26258. case 'iso8859-7':
  26259. case 'iso88597':
  26260. case 'iso_8859-7':
  26261. case 'iso_8859-7:1987':
  26262. case 'sun_eu_greek':
  26263. return 'ISO-8859-7'
  26264. case 'csiso88598e':
  26265. case 'csisolatinhebrew':
  26266. case 'hebrew':
  26267. case 'iso-8859-8':
  26268. case 'iso-8859-8-e':
  26269. case 'iso-ir-138':
  26270. case 'iso8859-8':
  26271. case 'iso88598':
  26272. case 'iso_8859-8':
  26273. case 'iso_8859-8:1988':
  26274. case 'visual':
  26275. return 'ISO-8859-8'
  26276. case 'csiso88598i':
  26277. case 'iso-8859-8-i':
  26278. case 'logical':
  26279. return 'ISO-8859-8-I'
  26280. case 'csisolatin6':
  26281. case 'iso-8859-10':
  26282. case 'iso-ir-157':
  26283. case 'iso8859-10':
  26284. case 'iso885910':
  26285. case 'l6':
  26286. case 'latin6':
  26287. return 'ISO-8859-10'
  26288. case 'iso-8859-13':
  26289. case 'iso8859-13':
  26290. case 'iso885913':
  26291. return 'ISO-8859-13'
  26292. case 'iso-8859-14':
  26293. case 'iso8859-14':
  26294. case 'iso885914':
  26295. return 'ISO-8859-14'
  26296. case 'csisolatin9':
  26297. case 'iso-8859-15':
  26298. case 'iso8859-15':
  26299. case 'iso885915':
  26300. case 'iso_8859-15':
  26301. case 'l9':
  26302. return 'ISO-8859-15'
  26303. case 'iso-8859-16':
  26304. return 'ISO-8859-16'
  26305. case 'cskoi8r':
  26306. case 'koi':
  26307. case 'koi8':
  26308. case 'koi8-r':
  26309. case 'koi8_r':
  26310. return 'KOI8-R'
  26311. case 'koi8-ru':
  26312. case 'koi8-u':
  26313. return 'KOI8-U'
  26314. case 'csmacintosh':
  26315. case 'mac':
  26316. case 'macintosh':
  26317. case 'x-mac-roman':
  26318. return 'macintosh'
  26319. case 'iso-8859-11':
  26320. case 'iso8859-11':
  26321. case 'iso885911':
  26322. case 'tis-620':
  26323. case 'windows-874':
  26324. return 'windows-874'
  26325. case 'cp1250':
  26326. case 'windows-1250':
  26327. case 'x-cp1250':
  26328. return 'windows-1250'
  26329. case 'cp1251':
  26330. case 'windows-1251':
  26331. case 'x-cp1251':
  26332. return 'windows-1251'
  26333. case 'ansi_x3.4-1968':
  26334. case 'ascii':
  26335. case 'cp1252':
  26336. case 'cp819':
  26337. case 'csisolatin1':
  26338. case 'ibm819':
  26339. case 'iso-8859-1':
  26340. case 'iso-ir-100':
  26341. case 'iso8859-1':
  26342. case 'iso88591':
  26343. case 'iso_8859-1':
  26344. case 'iso_8859-1:1987':
  26345. case 'l1':
  26346. case 'latin1':
  26347. case 'us-ascii':
  26348. case 'windows-1252':
  26349. case 'x-cp1252':
  26350. return 'windows-1252'
  26351. case 'cp1253':
  26352. case 'windows-1253':
  26353. case 'x-cp1253':
  26354. return 'windows-1253'
  26355. case 'cp1254':
  26356. case 'csisolatin5':
  26357. case 'iso-8859-9':
  26358. case 'iso-ir-148':
  26359. case 'iso8859-9':
  26360. case 'iso88599':
  26361. case 'iso_8859-9':
  26362. case 'iso_8859-9:1989':
  26363. case 'l5':
  26364. case 'latin5':
  26365. case 'windows-1254':
  26366. case 'x-cp1254':
  26367. return 'windows-1254'
  26368. case 'cp1255':
  26369. case 'windows-1255':
  26370. case 'x-cp1255':
  26371. return 'windows-1255'
  26372. case 'cp1256':
  26373. case 'windows-1256':
  26374. case 'x-cp1256':
  26375. return 'windows-1256'
  26376. case 'cp1257':
  26377. case 'windows-1257':
  26378. case 'x-cp1257':
  26379. return 'windows-1257'
  26380. case 'cp1258':
  26381. case 'windows-1258':
  26382. case 'x-cp1258':
  26383. return 'windows-1258'
  26384. case 'x-mac-cyrillic':
  26385. case 'x-mac-ukrainian':
  26386. return 'x-mac-cyrillic'
  26387. case 'chinese':
  26388. case 'csgb2312':
  26389. case 'csiso58gb231280':
  26390. case 'gb2312':
  26391. case 'gb_2312':
  26392. case 'gb_2312-80':
  26393. case 'gbk':
  26394. case 'iso-ir-58':
  26395. case 'x-gbk':
  26396. return 'GBK'
  26397. case 'gb18030':
  26398. return 'gb18030'
  26399. case 'big5':
  26400. case 'big5-hkscs':
  26401. case 'cn-big5':
  26402. case 'csbig5':
  26403. case 'x-x-big5':
  26404. return 'Big5'
  26405. case 'cseucpkdfmtjapanese':
  26406. case 'euc-jp':
  26407. case 'x-euc-jp':
  26408. return 'EUC-JP'
  26409. case 'csiso2022jp':
  26410. case 'iso-2022-jp':
  26411. return 'ISO-2022-JP'
  26412. case 'csshiftjis':
  26413. case 'ms932':
  26414. case 'ms_kanji':
  26415. case 'shift-jis':
  26416. case 'shift_jis':
  26417. case 'sjis':
  26418. case 'windows-31j':
  26419. case 'x-sjis':
  26420. return 'Shift_JIS'
  26421. case 'cseuckr':
  26422. case 'csksc56011987':
  26423. case 'euc-kr':
  26424. case 'iso-ir-149':
  26425. case 'korean':
  26426. case 'ks_c_5601-1987':
  26427. case 'ks_c_5601-1989':
  26428. case 'ksc5601':
  26429. case 'ksc_5601':
  26430. case 'windows-949':
  26431. return 'EUC-KR'
  26432. case 'csiso2022kr':
  26433. case 'hz-gb-2312':
  26434. case 'iso-2022-cn':
  26435. case 'iso-2022-cn-ext':
  26436. case 'iso-2022-kr':
  26437. case 'replacement':
  26438. return 'replacement'
  26439. case 'unicodefffe':
  26440. case 'utf-16be':
  26441. return 'UTF-16BE'
  26442. case 'csunicode':
  26443. case 'iso-10646-ucs-2':
  26444. case 'ucs-2':
  26445. case 'unicode':
  26446. case 'unicodefeff':
  26447. case 'utf-16':
  26448. case 'utf-16le':
  26449. return 'UTF-16LE'
  26450. case 'x-user-defined':
  26451. return 'x-user-defined'
  26452. default: return 'failure'
  26453. }
  26454. }
  26455. module.exports = {
  26456. getEncoding
  26457. }
  26458. /***/ }),
  26459. /***/ 1446:
  26460. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  26461. "use strict";
  26462. const {
  26463. staticPropertyDescriptors,
  26464. readOperation,
  26465. fireAProgressEvent
  26466. } = __nccwpck_require__(7530)
  26467. const {
  26468. kState,
  26469. kError,
  26470. kResult,
  26471. kEvents,
  26472. kAborted
  26473. } = __nccwpck_require__(9054)
  26474. const { webidl } = __nccwpck_require__(1744)
  26475. const { kEnumerableProperty } = __nccwpck_require__(3983)
  26476. class FileReader extends EventTarget {
  26477. constructor () {
  26478. super()
  26479. this[kState] = 'empty'
  26480. this[kResult] = null
  26481. this[kError] = null
  26482. this[kEvents] = {
  26483. loadend: null,
  26484. error: null,
  26485. abort: null,
  26486. load: null,
  26487. progress: null,
  26488. loadstart: null
  26489. }
  26490. }
  26491. /**
  26492. * @see https://w3c.github.io/FileAPI/#dfn-readAsArrayBuffer
  26493. * @param {import('buffer').Blob} blob
  26494. */
  26495. readAsArrayBuffer (blob) {
  26496. webidl.brandCheck(this, FileReader)
  26497. webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsArrayBuffer' })
  26498. blob = webidl.converters.Blob(blob, { strict: false })
  26499. // The readAsArrayBuffer(blob) method, when invoked,
  26500. // must initiate a read operation for blob with ArrayBuffer.
  26501. readOperation(this, blob, 'ArrayBuffer')
  26502. }
  26503. /**
  26504. * @see https://w3c.github.io/FileAPI/#readAsBinaryString
  26505. * @param {import('buffer').Blob} blob
  26506. */
  26507. readAsBinaryString (blob) {
  26508. webidl.brandCheck(this, FileReader)
  26509. webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsBinaryString' })
  26510. blob = webidl.converters.Blob(blob, { strict: false })
  26511. // The readAsBinaryString(blob) method, when invoked,
  26512. // must initiate a read operation for blob with BinaryString.
  26513. readOperation(this, blob, 'BinaryString')
  26514. }
  26515. /**
  26516. * @see https://w3c.github.io/FileAPI/#readAsDataText
  26517. * @param {import('buffer').Blob} blob
  26518. * @param {string?} encoding
  26519. */
  26520. readAsText (blob, encoding = undefined) {
  26521. webidl.brandCheck(this, FileReader)
  26522. webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsText' })
  26523. blob = webidl.converters.Blob(blob, { strict: false })
  26524. if (encoding !== undefined) {
  26525. encoding = webidl.converters.DOMString(encoding)
  26526. }
  26527. // The readAsText(blob, encoding) method, when invoked,
  26528. // must initiate a read operation for blob with Text and encoding.
  26529. readOperation(this, blob, 'Text', encoding)
  26530. }
  26531. /**
  26532. * @see https://w3c.github.io/FileAPI/#dfn-readAsDataURL
  26533. * @param {import('buffer').Blob} blob
  26534. */
  26535. readAsDataURL (blob) {
  26536. webidl.brandCheck(this, FileReader)
  26537. webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsDataURL' })
  26538. blob = webidl.converters.Blob(blob, { strict: false })
  26539. // The readAsDataURL(blob) method, when invoked, must
  26540. // initiate a read operation for blob with DataURL.
  26541. readOperation(this, blob, 'DataURL')
  26542. }
  26543. /**
  26544. * @see https://w3c.github.io/FileAPI/#dfn-abort
  26545. */
  26546. abort () {
  26547. // 1. If this's state is "empty" or if this's state is
  26548. // "done" set this's result to null and terminate
  26549. // this algorithm.
  26550. if (this[kState] === 'empty' || this[kState] === 'done') {
  26551. this[kResult] = null
  26552. return
  26553. }
  26554. // 2. If this's state is "loading" set this's state to
  26555. // "done" and set this's result to null.
  26556. if (this[kState] === 'loading') {
  26557. this[kState] = 'done'
  26558. this[kResult] = null
  26559. }
  26560. // 3. If there are any tasks from this on the file reading
  26561. // task source in an affiliated task queue, then remove
  26562. // those tasks from that task queue.
  26563. this[kAborted] = true
  26564. // 4. Terminate the algorithm for the read method being processed.
  26565. // TODO
  26566. // 5. Fire a progress event called abort at this.
  26567. fireAProgressEvent('abort', this)
  26568. // 6. If this's state is not "loading", fire a progress
  26569. // event called loadend at this.
  26570. if (this[kState] !== 'loading') {
  26571. fireAProgressEvent('loadend', this)
  26572. }
  26573. }
  26574. /**
  26575. * @see https://w3c.github.io/FileAPI/#dom-filereader-readystate
  26576. */
  26577. get readyState () {
  26578. webidl.brandCheck(this, FileReader)
  26579. switch (this[kState]) {
  26580. case 'empty': return this.EMPTY
  26581. case 'loading': return this.LOADING
  26582. case 'done': return this.DONE
  26583. }
  26584. }
  26585. /**
  26586. * @see https://w3c.github.io/FileAPI/#dom-filereader-result
  26587. */
  26588. get result () {
  26589. webidl.brandCheck(this, FileReader)
  26590. // The result attribute’s getter, when invoked, must return
  26591. // this's result.
  26592. return this[kResult]
  26593. }
  26594. /**
  26595. * @see https://w3c.github.io/FileAPI/#dom-filereader-error
  26596. */
  26597. get error () {
  26598. webidl.brandCheck(this, FileReader)
  26599. // The error attribute’s getter, when invoked, must return
  26600. // this's error.
  26601. return this[kError]
  26602. }
  26603. get onloadend () {
  26604. webidl.brandCheck(this, FileReader)
  26605. return this[kEvents].loadend
  26606. }
  26607. set onloadend (fn) {
  26608. webidl.brandCheck(this, FileReader)
  26609. if (this[kEvents].loadend) {
  26610. this.removeEventListener('loadend', this[kEvents].loadend)
  26611. }
  26612. if (typeof fn === 'function') {
  26613. this[kEvents].loadend = fn
  26614. this.addEventListener('loadend', fn)
  26615. } else {
  26616. this[kEvents].loadend = null
  26617. }
  26618. }
  26619. get onerror () {
  26620. webidl.brandCheck(this, FileReader)
  26621. return this[kEvents].error
  26622. }
  26623. set onerror (fn) {
  26624. webidl.brandCheck(this, FileReader)
  26625. if (this[kEvents].error) {
  26626. this.removeEventListener('error', this[kEvents].error)
  26627. }
  26628. if (typeof fn === 'function') {
  26629. this[kEvents].error = fn
  26630. this.addEventListener('error', fn)
  26631. } else {
  26632. this[kEvents].error = null
  26633. }
  26634. }
  26635. get onloadstart () {
  26636. webidl.brandCheck(this, FileReader)
  26637. return this[kEvents].loadstart
  26638. }
  26639. set onloadstart (fn) {
  26640. webidl.brandCheck(this, FileReader)
  26641. if (this[kEvents].loadstart) {
  26642. this.removeEventListener('loadstart', this[kEvents].loadstart)
  26643. }
  26644. if (typeof fn === 'function') {
  26645. this[kEvents].loadstart = fn
  26646. this.addEventListener('loadstart', fn)
  26647. } else {
  26648. this[kEvents].loadstart = null
  26649. }
  26650. }
  26651. get onprogress () {
  26652. webidl.brandCheck(this, FileReader)
  26653. return this[kEvents].progress
  26654. }
  26655. set onprogress (fn) {
  26656. webidl.brandCheck(this, FileReader)
  26657. if (this[kEvents].progress) {
  26658. this.removeEventListener('progress', this[kEvents].progress)
  26659. }
  26660. if (typeof fn === 'function') {
  26661. this[kEvents].progress = fn
  26662. this.addEventListener('progress', fn)
  26663. } else {
  26664. this[kEvents].progress = null
  26665. }
  26666. }
  26667. get onload () {
  26668. webidl.brandCheck(this, FileReader)
  26669. return this[kEvents].load
  26670. }
  26671. set onload (fn) {
  26672. webidl.brandCheck(this, FileReader)
  26673. if (this[kEvents].load) {
  26674. this.removeEventListener('load', this[kEvents].load)
  26675. }
  26676. if (typeof fn === 'function') {
  26677. this[kEvents].load = fn
  26678. this.addEventListener('load', fn)
  26679. } else {
  26680. this[kEvents].load = null
  26681. }
  26682. }
  26683. get onabort () {
  26684. webidl.brandCheck(this, FileReader)
  26685. return this[kEvents].abort
  26686. }
  26687. set onabort (fn) {
  26688. webidl.brandCheck(this, FileReader)
  26689. if (this[kEvents].abort) {
  26690. this.removeEventListener('abort', this[kEvents].abort)
  26691. }
  26692. if (typeof fn === 'function') {
  26693. this[kEvents].abort = fn
  26694. this.addEventListener('abort', fn)
  26695. } else {
  26696. this[kEvents].abort = null
  26697. }
  26698. }
  26699. }
  26700. // https://w3c.github.io/FileAPI/#dom-filereader-empty
  26701. FileReader.EMPTY = FileReader.prototype.EMPTY = 0
  26702. // https://w3c.github.io/FileAPI/#dom-filereader-loading
  26703. FileReader.LOADING = FileReader.prototype.LOADING = 1
  26704. // https://w3c.github.io/FileAPI/#dom-filereader-done
  26705. FileReader.DONE = FileReader.prototype.DONE = 2
  26706. Object.defineProperties(FileReader.prototype, {
  26707. EMPTY: staticPropertyDescriptors,
  26708. LOADING: staticPropertyDescriptors,
  26709. DONE: staticPropertyDescriptors,
  26710. readAsArrayBuffer: kEnumerableProperty,
  26711. readAsBinaryString: kEnumerableProperty,
  26712. readAsText: kEnumerableProperty,
  26713. readAsDataURL: kEnumerableProperty,
  26714. abort: kEnumerableProperty,
  26715. readyState: kEnumerableProperty,
  26716. result: kEnumerableProperty,
  26717. error: kEnumerableProperty,
  26718. onloadstart: kEnumerableProperty,
  26719. onprogress: kEnumerableProperty,
  26720. onload: kEnumerableProperty,
  26721. onabort: kEnumerableProperty,
  26722. onerror: kEnumerableProperty,
  26723. onloadend: kEnumerableProperty,
  26724. [Symbol.toStringTag]: {
  26725. value: 'FileReader',
  26726. writable: false,
  26727. enumerable: false,
  26728. configurable: true
  26729. }
  26730. })
  26731. Object.defineProperties(FileReader, {
  26732. EMPTY: staticPropertyDescriptors,
  26733. LOADING: staticPropertyDescriptors,
  26734. DONE: staticPropertyDescriptors
  26735. })
  26736. module.exports = {
  26737. FileReader
  26738. }
  26739. /***/ }),
  26740. /***/ 5504:
  26741. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  26742. "use strict";
  26743. const { webidl } = __nccwpck_require__(1744)
  26744. const kState = Symbol('ProgressEvent state')
  26745. /**
  26746. * @see https://xhr.spec.whatwg.org/#progressevent
  26747. */
  26748. class ProgressEvent extends Event {
  26749. constructor (type, eventInitDict = {}) {
  26750. type = webidl.converters.DOMString(type)
  26751. eventInitDict = webidl.converters.ProgressEventInit(eventInitDict ?? {})
  26752. super(type, eventInitDict)
  26753. this[kState] = {
  26754. lengthComputable: eventInitDict.lengthComputable,
  26755. loaded: eventInitDict.loaded,
  26756. total: eventInitDict.total
  26757. }
  26758. }
  26759. get lengthComputable () {
  26760. webidl.brandCheck(this, ProgressEvent)
  26761. return this[kState].lengthComputable
  26762. }
  26763. get loaded () {
  26764. webidl.brandCheck(this, ProgressEvent)
  26765. return this[kState].loaded
  26766. }
  26767. get total () {
  26768. webidl.brandCheck(this, ProgressEvent)
  26769. return this[kState].total
  26770. }
  26771. }
  26772. webidl.converters.ProgressEventInit = webidl.dictionaryConverter([
  26773. {
  26774. key: 'lengthComputable',
  26775. converter: webidl.converters.boolean,
  26776. defaultValue: false
  26777. },
  26778. {
  26779. key: 'loaded',
  26780. converter: webidl.converters['unsigned long long'],
  26781. defaultValue: 0
  26782. },
  26783. {
  26784. key: 'total',
  26785. converter: webidl.converters['unsigned long long'],
  26786. defaultValue: 0
  26787. },
  26788. {
  26789. key: 'bubbles',
  26790. converter: webidl.converters.boolean,
  26791. defaultValue: false
  26792. },
  26793. {
  26794. key: 'cancelable',
  26795. converter: webidl.converters.boolean,
  26796. defaultValue: false
  26797. },
  26798. {
  26799. key: 'composed',
  26800. converter: webidl.converters.boolean,
  26801. defaultValue: false
  26802. }
  26803. ])
  26804. module.exports = {
  26805. ProgressEvent
  26806. }
  26807. /***/ }),
  26808. /***/ 9054:
  26809. /***/ ((module) => {
  26810. "use strict";
  26811. module.exports = {
  26812. kState: Symbol('FileReader state'),
  26813. kResult: Symbol('FileReader result'),
  26814. kError: Symbol('FileReader error'),
  26815. kLastProgressEventFired: Symbol('FileReader last progress event fired timestamp'),
  26816. kEvents: Symbol('FileReader events'),
  26817. kAborted: Symbol('FileReader aborted')
  26818. }
  26819. /***/ }),
  26820. /***/ 7530:
  26821. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  26822. "use strict";
  26823. const {
  26824. kState,
  26825. kError,
  26826. kResult,
  26827. kAborted,
  26828. kLastProgressEventFired
  26829. } = __nccwpck_require__(9054)
  26830. const { ProgressEvent } = __nccwpck_require__(5504)
  26831. const { getEncoding } = __nccwpck_require__(4854)
  26832. const { DOMException } = __nccwpck_require__(1037)
  26833. const { serializeAMimeType, parseMIMEType } = __nccwpck_require__(685)
  26834. const { types } = __nccwpck_require__(3837)
  26835. const { StringDecoder } = __nccwpck_require__(1576)
  26836. const { btoa } = __nccwpck_require__(4300)
  26837. /** @type {PropertyDescriptor} */
  26838. const staticPropertyDescriptors = {
  26839. enumerable: true,
  26840. writable: false,
  26841. configurable: false
  26842. }
  26843. /**
  26844. * @see https://w3c.github.io/FileAPI/#readOperation
  26845. * @param {import('./filereader').FileReader} fr
  26846. * @param {import('buffer').Blob} blob
  26847. * @param {string} type
  26848. * @param {string?} encodingName
  26849. */
  26850. function readOperation (fr, blob, type, encodingName) {
  26851. // 1. If fr’s state is "loading", throw an InvalidStateError
  26852. // DOMException.
  26853. if (fr[kState] === 'loading') {
  26854. throw new DOMException('Invalid state', 'InvalidStateError')
  26855. }
  26856. // 2. Set fr’s state to "loading".
  26857. fr[kState] = 'loading'
  26858. // 3. Set fr’s result to null.
  26859. fr[kResult] = null
  26860. // 4. Set fr’s error to null.
  26861. fr[kError] = null
  26862. // 5. Let stream be the result of calling get stream on blob.
  26863. /** @type {import('stream/web').ReadableStream} */
  26864. const stream = blob.stream()
  26865. // 6. Let reader be the result of getting a reader from stream.
  26866. const reader = stream.getReader()
  26867. // 7. Let bytes be an empty byte sequence.
  26868. /** @type {Uint8Array[]} */
  26869. const bytes = []
  26870. // 8. Let chunkPromise be the result of reading a chunk from
  26871. // stream with reader.
  26872. let chunkPromise = reader.read()
  26873. // 9. Let isFirstChunk be true.
  26874. let isFirstChunk = true
  26875. // 10. In parallel, while true:
  26876. // Note: "In parallel" just means non-blocking
  26877. // Note 2: readOperation itself cannot be async as double
  26878. // reading the body would then reject the promise, instead
  26879. // of throwing an error.
  26880. ;(async () => {
  26881. while (!fr[kAborted]) {
  26882. // 1. Wait for chunkPromise to be fulfilled or rejected.
  26883. try {
  26884. const { done, value } = await chunkPromise
  26885. // 2. If chunkPromise is fulfilled, and isFirstChunk is
  26886. // true, queue a task to fire a progress event called
  26887. // loadstart at fr.
  26888. if (isFirstChunk && !fr[kAborted]) {
  26889. queueMicrotask(() => {
  26890. fireAProgressEvent('loadstart', fr)
  26891. })
  26892. }
  26893. // 3. Set isFirstChunk to false.
  26894. isFirstChunk = false
  26895. // 4. If chunkPromise is fulfilled with an object whose
  26896. // done property is false and whose value property is
  26897. // a Uint8Array object, run these steps:
  26898. if (!done && types.isUint8Array(value)) {
  26899. // 1. Let bs be the byte sequence represented by the
  26900. // Uint8Array object.
  26901. // 2. Append bs to bytes.
  26902. bytes.push(value)
  26903. // 3. If roughly 50ms have passed since these steps
  26904. // were last invoked, queue a task to fire a
  26905. // progress event called progress at fr.
  26906. if (
  26907. (
  26908. fr[kLastProgressEventFired] === undefined ||
  26909. Date.now() - fr[kLastProgressEventFired] >= 50
  26910. ) &&
  26911. !fr[kAborted]
  26912. ) {
  26913. fr[kLastProgressEventFired] = Date.now()
  26914. queueMicrotask(() => {
  26915. fireAProgressEvent('progress', fr)
  26916. })
  26917. }
  26918. // 4. Set chunkPromise to the result of reading a
  26919. // chunk from stream with reader.
  26920. chunkPromise = reader.read()
  26921. } else if (done) {
  26922. // 5. Otherwise, if chunkPromise is fulfilled with an
  26923. // object whose done property is true, queue a task
  26924. // to run the following steps and abort this algorithm:
  26925. queueMicrotask(() => {
  26926. // 1. Set fr’s state to "done".
  26927. fr[kState] = 'done'
  26928. // 2. Let result be the result of package data given
  26929. // bytes, type, blob’s type, and encodingName.
  26930. try {
  26931. const result = packageData(bytes, type, blob.type, encodingName)
  26932. // 4. Else:
  26933. if (fr[kAborted]) {
  26934. return
  26935. }
  26936. // 1. Set fr’s result to result.
  26937. fr[kResult] = result
  26938. // 2. Fire a progress event called load at the fr.
  26939. fireAProgressEvent('load', fr)
  26940. } catch (error) {
  26941. // 3. If package data threw an exception error:
  26942. // 1. Set fr’s error to error.
  26943. fr[kError] = error
  26944. // 2. Fire a progress event called error at fr.
  26945. fireAProgressEvent('error', fr)
  26946. }
  26947. // 5. If fr’s state is not "loading", fire a progress
  26948. // event called loadend at the fr.
  26949. if (fr[kState] !== 'loading') {
  26950. fireAProgressEvent('loadend', fr)
  26951. }
  26952. })
  26953. break
  26954. }
  26955. } catch (error) {
  26956. if (fr[kAborted]) {
  26957. return
  26958. }
  26959. // 6. Otherwise, if chunkPromise is rejected with an
  26960. // error error, queue a task to run the following
  26961. // steps and abort this algorithm:
  26962. queueMicrotask(() => {
  26963. // 1. Set fr’s state to "done".
  26964. fr[kState] = 'done'
  26965. // 2. Set fr’s error to error.
  26966. fr[kError] = error
  26967. // 3. Fire a progress event called error at fr.
  26968. fireAProgressEvent('error', fr)
  26969. // 4. If fr’s state is not "loading", fire a progress
  26970. // event called loadend at fr.
  26971. if (fr[kState] !== 'loading') {
  26972. fireAProgressEvent('loadend', fr)
  26973. }
  26974. })
  26975. break
  26976. }
  26977. }
  26978. })()
  26979. }
  26980. /**
  26981. * @see https://w3c.github.io/FileAPI/#fire-a-progress-event
  26982. * @see https://dom.spec.whatwg.org/#concept-event-fire
  26983. * @param {string} e The name of the event
  26984. * @param {import('./filereader').FileReader} reader
  26985. */
  26986. function fireAProgressEvent (e, reader) {
  26987. // The progress event e does not bubble. e.bubbles must be false
  26988. // The progress event e is NOT cancelable. e.cancelable must be false
  26989. const event = new ProgressEvent(e, {
  26990. bubbles: false,
  26991. cancelable: false
  26992. })
  26993. reader.dispatchEvent(event)
  26994. }
  26995. /**
  26996. * @see https://w3c.github.io/FileAPI/#blob-package-data
  26997. * @param {Uint8Array[]} bytes
  26998. * @param {string} type
  26999. * @param {string?} mimeType
  27000. * @param {string?} encodingName
  27001. */
  27002. function packageData (bytes, type, mimeType, encodingName) {
  27003. // 1. A Blob has an associated package data algorithm, given
  27004. // bytes, a type, a optional mimeType, and a optional
  27005. // encodingName, which switches on type and runs the
  27006. // associated steps:
  27007. switch (type) {
  27008. case 'DataURL': {
  27009. // 1. Return bytes as a DataURL [RFC2397] subject to
  27010. // the considerations below:
  27011. // * Use mimeType as part of the Data URL if it is
  27012. // available in keeping with the Data URL
  27013. // specification [RFC2397].
  27014. // * If mimeType is not available return a Data URL
  27015. // without a media-type. [RFC2397].
  27016. // https://datatracker.ietf.org/doc/html/rfc2397#section-3
  27017. // dataurl := "data:" [ mediatype ] [ ";base64" ] "," data
  27018. // mediatype := [ type "/" subtype ] *( ";" parameter )
  27019. // data := *urlchar
  27020. // parameter := attribute "=" value
  27021. let dataURL = 'data:'
  27022. const parsed = parseMIMEType(mimeType || 'application/octet-stream')
  27023. if (parsed !== 'failure') {
  27024. dataURL += serializeAMimeType(parsed)
  27025. }
  27026. dataURL += ';base64,'
  27027. const decoder = new StringDecoder('latin1')
  27028. for (const chunk of bytes) {
  27029. dataURL += btoa(decoder.write(chunk))
  27030. }
  27031. dataURL += btoa(decoder.end())
  27032. return dataURL
  27033. }
  27034. case 'Text': {
  27035. // 1. Let encoding be failure
  27036. let encoding = 'failure'
  27037. // 2. If the encodingName is present, set encoding to the
  27038. // result of getting an encoding from encodingName.
  27039. if (encodingName) {
  27040. encoding = getEncoding(encodingName)
  27041. }
  27042. // 3. If encoding is failure, and mimeType is present:
  27043. if (encoding === 'failure' && mimeType) {
  27044. // 1. Let type be the result of parse a MIME type
  27045. // given mimeType.
  27046. const type = parseMIMEType(mimeType)
  27047. // 2. If type is not failure, set encoding to the result
  27048. // of getting an encoding from type’s parameters["charset"].
  27049. if (type !== 'failure') {
  27050. encoding = getEncoding(type.parameters.get('charset'))
  27051. }
  27052. }
  27053. // 4. If encoding is failure, then set encoding to UTF-8.
  27054. if (encoding === 'failure') {
  27055. encoding = 'UTF-8'
  27056. }
  27057. // 5. Decode bytes using fallback encoding encoding, and
  27058. // return the result.
  27059. return decode(bytes, encoding)
  27060. }
  27061. case 'ArrayBuffer': {
  27062. // Return a new ArrayBuffer whose contents are bytes.
  27063. const sequence = combineByteSequences(bytes)
  27064. return sequence.buffer
  27065. }
  27066. case 'BinaryString': {
  27067. // Return bytes as a binary string, in which every byte
  27068. // is represented by a code unit of equal value [0..255].
  27069. let binaryString = ''
  27070. const decoder = new StringDecoder('latin1')
  27071. for (const chunk of bytes) {
  27072. binaryString += decoder.write(chunk)
  27073. }
  27074. binaryString += decoder.end()
  27075. return binaryString
  27076. }
  27077. }
  27078. }
  27079. /**
  27080. * @see https://encoding.spec.whatwg.org/#decode
  27081. * @param {Uint8Array[]} ioQueue
  27082. * @param {string} encoding
  27083. */
  27084. function decode (ioQueue, encoding) {
  27085. const bytes = combineByteSequences(ioQueue)
  27086. // 1. Let BOMEncoding be the result of BOM sniffing ioQueue.
  27087. const BOMEncoding = BOMSniffing(bytes)
  27088. let slice = 0
  27089. // 2. If BOMEncoding is non-null:
  27090. if (BOMEncoding !== null) {
  27091. // 1. Set encoding to BOMEncoding.
  27092. encoding = BOMEncoding
  27093. // 2. Read three bytes from ioQueue, if BOMEncoding is
  27094. // UTF-8; otherwise read two bytes.
  27095. // (Do nothing with those bytes.)
  27096. slice = BOMEncoding === 'UTF-8' ? 3 : 2
  27097. }
  27098. // 3. Process a queue with an instance of encoding’s
  27099. // decoder, ioQueue, output, and "replacement".
  27100. // 4. Return output.
  27101. const sliced = bytes.slice(slice)
  27102. return new TextDecoder(encoding).decode(sliced)
  27103. }
  27104. /**
  27105. * @see https://encoding.spec.whatwg.org/#bom-sniff
  27106. * @param {Uint8Array} ioQueue
  27107. */
  27108. function BOMSniffing (ioQueue) {
  27109. // 1. Let BOM be the result of peeking 3 bytes from ioQueue,
  27110. // converted to a byte sequence.
  27111. const [a, b, c] = ioQueue
  27112. // 2. For each of the rows in the table below, starting with
  27113. // the first one and going down, if BOM starts with the
  27114. // bytes given in the first column, then return the
  27115. // encoding given in the cell in the second column of that
  27116. // row. Otherwise, return null.
  27117. if (a === 0xEF && b === 0xBB && c === 0xBF) {
  27118. return 'UTF-8'
  27119. } else if (a === 0xFE && b === 0xFF) {
  27120. return 'UTF-16BE'
  27121. } else if (a === 0xFF && b === 0xFE) {
  27122. return 'UTF-16LE'
  27123. }
  27124. return null
  27125. }
  27126. /**
  27127. * @param {Uint8Array[]} sequences
  27128. */
  27129. function combineByteSequences (sequences) {
  27130. const size = sequences.reduce((a, b) => {
  27131. return a + b.byteLength
  27132. }, 0)
  27133. let offset = 0
  27134. return sequences.reduce((a, b) => {
  27135. a.set(b, offset)
  27136. offset += b.byteLength
  27137. return a
  27138. }, new Uint8Array(size))
  27139. }
  27140. module.exports = {
  27141. staticPropertyDescriptors,
  27142. readOperation,
  27143. fireAProgressEvent
  27144. }
  27145. /***/ }),
  27146. /***/ 1892:
  27147. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27148. "use strict";
  27149. // We include a version number for the Dispatcher API. In case of breaking changes,
  27150. // this version number must be increased to avoid conflicts.
  27151. const globalDispatcher = Symbol.for('undici.globalDispatcher.1')
  27152. const { InvalidArgumentError } = __nccwpck_require__(8045)
  27153. const Agent = __nccwpck_require__(7890)
  27154. if (getGlobalDispatcher() === undefined) {
  27155. setGlobalDispatcher(new Agent())
  27156. }
  27157. function setGlobalDispatcher (agent) {
  27158. if (!agent || typeof agent.dispatch !== 'function') {
  27159. throw new InvalidArgumentError('Argument agent must implement Agent')
  27160. }
  27161. Object.defineProperty(globalThis, globalDispatcher, {
  27162. value: agent,
  27163. writable: true,
  27164. enumerable: false,
  27165. configurable: false
  27166. })
  27167. }
  27168. function getGlobalDispatcher () {
  27169. return globalThis[globalDispatcher]
  27170. }
  27171. module.exports = {
  27172. setGlobalDispatcher,
  27173. getGlobalDispatcher
  27174. }
  27175. /***/ }),
  27176. /***/ 6930:
  27177. /***/ ((module) => {
  27178. "use strict";
  27179. module.exports = class DecoratorHandler {
  27180. constructor (handler) {
  27181. this.handler = handler
  27182. }
  27183. onConnect (...args) {
  27184. return this.handler.onConnect(...args)
  27185. }
  27186. onError (...args) {
  27187. return this.handler.onError(...args)
  27188. }
  27189. onUpgrade (...args) {
  27190. return this.handler.onUpgrade(...args)
  27191. }
  27192. onHeaders (...args) {
  27193. return this.handler.onHeaders(...args)
  27194. }
  27195. onData (...args) {
  27196. return this.handler.onData(...args)
  27197. }
  27198. onComplete (...args) {
  27199. return this.handler.onComplete(...args)
  27200. }
  27201. onBodySent (...args) {
  27202. return this.handler.onBodySent(...args)
  27203. }
  27204. }
  27205. /***/ }),
  27206. /***/ 2860:
  27207. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27208. "use strict";
  27209. const util = __nccwpck_require__(3983)
  27210. const { kBodyUsed } = __nccwpck_require__(2785)
  27211. const assert = __nccwpck_require__(9491)
  27212. const { InvalidArgumentError } = __nccwpck_require__(8045)
  27213. const EE = __nccwpck_require__(2361)
  27214. const redirectableStatusCodes = [300, 301, 302, 303, 307, 308]
  27215. const kBody = Symbol('body')
  27216. class BodyAsyncIterable {
  27217. constructor (body) {
  27218. this[kBody] = body
  27219. this[kBodyUsed] = false
  27220. }
  27221. async * [Symbol.asyncIterator] () {
  27222. assert(!this[kBodyUsed], 'disturbed')
  27223. this[kBodyUsed] = true
  27224. yield * this[kBody]
  27225. }
  27226. }
  27227. class RedirectHandler {
  27228. constructor (dispatch, maxRedirections, opts, handler) {
  27229. if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) {
  27230. throw new InvalidArgumentError('maxRedirections must be a positive number')
  27231. }
  27232. util.validateHandler(handler, opts.method, opts.upgrade)
  27233. this.dispatch = dispatch
  27234. this.location = null
  27235. this.abort = null
  27236. this.opts = { ...opts, maxRedirections: 0 } // opts must be a copy
  27237. this.maxRedirections = maxRedirections
  27238. this.handler = handler
  27239. this.history = []
  27240. if (util.isStream(this.opts.body)) {
  27241. // TODO (fix): Provide some way for the user to cache the file to e.g. /tmp
  27242. // so that it can be dispatched again?
  27243. // TODO (fix): Do we need 100-expect support to provide a way to do this properly?
  27244. if (util.bodyLength(this.opts.body) === 0) {
  27245. this.opts.body
  27246. .on('data', function () {
  27247. assert(false)
  27248. })
  27249. }
  27250. if (typeof this.opts.body.readableDidRead !== 'boolean') {
  27251. this.opts.body[kBodyUsed] = false
  27252. EE.prototype.on.call(this.opts.body, 'data', function () {
  27253. this[kBodyUsed] = true
  27254. })
  27255. }
  27256. } else if (this.opts.body && typeof this.opts.body.pipeTo === 'function') {
  27257. // TODO (fix): We can't access ReadableStream internal state
  27258. // to determine whether or not it has been disturbed. This is just
  27259. // a workaround.
  27260. this.opts.body = new BodyAsyncIterable(this.opts.body)
  27261. } else if (
  27262. this.opts.body &&
  27263. typeof this.opts.body !== 'string' &&
  27264. !ArrayBuffer.isView(this.opts.body) &&
  27265. util.isIterable(this.opts.body)
  27266. ) {
  27267. // TODO: Should we allow re-using iterable if !this.opts.idempotent
  27268. // or through some other flag?
  27269. this.opts.body = new BodyAsyncIterable(this.opts.body)
  27270. }
  27271. }
  27272. onConnect (abort) {
  27273. this.abort = abort
  27274. this.handler.onConnect(abort, { history: this.history })
  27275. }
  27276. onUpgrade (statusCode, headers, socket) {
  27277. this.handler.onUpgrade(statusCode, headers, socket)
  27278. }
  27279. onError (error) {
  27280. this.handler.onError(error)
  27281. }
  27282. onHeaders (statusCode, headers, resume, statusText) {
  27283. this.location = this.history.length >= this.maxRedirections || util.isDisturbed(this.opts.body)
  27284. ? null
  27285. : parseLocation(statusCode, headers)
  27286. if (this.opts.origin) {
  27287. this.history.push(new URL(this.opts.path, this.opts.origin))
  27288. }
  27289. if (!this.location) {
  27290. return this.handler.onHeaders(statusCode, headers, resume, statusText)
  27291. }
  27292. const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)))
  27293. const path = search ? `${pathname}${search}` : pathname
  27294. // Remove headers referring to the original URL.
  27295. // By default it is Host only, unless it's a 303 (see below), which removes also all Content-* headers.
  27296. // https://tools.ietf.org/html/rfc7231#section-6.4
  27297. this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin)
  27298. this.opts.path = path
  27299. this.opts.origin = origin
  27300. this.opts.maxRedirections = 0
  27301. this.opts.query = null
  27302. // https://tools.ietf.org/html/rfc7231#section-6.4.4
  27303. // In case of HTTP 303, always replace method to be either HEAD or GET
  27304. if (statusCode === 303 && this.opts.method !== 'HEAD') {
  27305. this.opts.method = 'GET'
  27306. this.opts.body = null
  27307. }
  27308. }
  27309. onData (chunk) {
  27310. if (this.location) {
  27311. /*
  27312. https://tools.ietf.org/html/rfc7231#section-6.4
  27313. TLDR: undici always ignores 3xx response bodies.
  27314. Redirection is used to serve the requested resource from another URL, so it is assumes that
  27315. no body is generated (and thus can be ignored). Even though generating a body is not prohibited.
  27316. For status 301, 302, 303, 307 and 308 (the latter from RFC 7238), the specs mention that the body usually
  27317. (which means it's optional and not mandated) contain just an hyperlink to the value of
  27318. the Location response header, so the body can be ignored safely.
  27319. For status 300, which is "Multiple Choices", the spec mentions both generating a Location
  27320. response header AND a response body with the other possible location to follow.
  27321. Since the spec explicitily chooses not to specify a format for such body and leave it to
  27322. servers and browsers implementors, we ignore the body as there is no specified way to eventually parse it.
  27323. */
  27324. } else {
  27325. return this.handler.onData(chunk)
  27326. }
  27327. }
  27328. onComplete (trailers) {
  27329. if (this.location) {
  27330. /*
  27331. https://tools.ietf.org/html/rfc7231#section-6.4
  27332. TLDR: undici always ignores 3xx response trailers as they are not expected in case of redirections
  27333. and neither are useful if present.
  27334. See comment on onData method above for more detailed informations.
  27335. */
  27336. this.location = null
  27337. this.abort = null
  27338. this.dispatch(this.opts, this)
  27339. } else {
  27340. this.handler.onComplete(trailers)
  27341. }
  27342. }
  27343. onBodySent (chunk) {
  27344. if (this.handler.onBodySent) {
  27345. this.handler.onBodySent(chunk)
  27346. }
  27347. }
  27348. }
  27349. function parseLocation (statusCode, headers) {
  27350. if (redirectableStatusCodes.indexOf(statusCode) === -1) {
  27351. return null
  27352. }
  27353. for (let i = 0; i < headers.length; i += 2) {
  27354. if (headers[i].toString().toLowerCase() === 'location') {
  27355. return headers[i + 1]
  27356. }
  27357. }
  27358. }
  27359. // https://tools.ietf.org/html/rfc7231#section-6.4.4
  27360. function shouldRemoveHeader (header, removeContent, unknownOrigin) {
  27361. if (header.length === 4) {
  27362. return util.headerNameToString(header) === 'host'
  27363. }
  27364. if (removeContent && util.headerNameToString(header).startsWith('content-')) {
  27365. return true
  27366. }
  27367. if (unknownOrigin && (header.length === 13 || header.length === 6 || header.length === 19)) {
  27368. const name = util.headerNameToString(header)
  27369. return name === 'authorization' || name === 'cookie' || name === 'proxy-authorization'
  27370. }
  27371. return false
  27372. }
  27373. // https://tools.ietf.org/html/rfc7231#section-6.4
  27374. function cleanRequestHeaders (headers, removeContent, unknownOrigin) {
  27375. const ret = []
  27376. if (Array.isArray(headers)) {
  27377. for (let i = 0; i < headers.length; i += 2) {
  27378. if (!shouldRemoveHeader(headers[i], removeContent, unknownOrigin)) {
  27379. ret.push(headers[i], headers[i + 1])
  27380. }
  27381. }
  27382. } else if (headers && typeof headers === 'object') {
  27383. for (const key of Object.keys(headers)) {
  27384. if (!shouldRemoveHeader(key, removeContent, unknownOrigin)) {
  27385. ret.push(key, headers[key])
  27386. }
  27387. }
  27388. } else {
  27389. assert(headers == null, 'headers must be an object or an array')
  27390. }
  27391. return ret
  27392. }
  27393. module.exports = RedirectHandler
  27394. /***/ }),
  27395. /***/ 2286:
  27396. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27397. const assert = __nccwpck_require__(9491)
  27398. const { kRetryHandlerDefaultRetry } = __nccwpck_require__(2785)
  27399. const { RequestRetryError } = __nccwpck_require__(8045)
  27400. const { isDisturbed, parseHeaders, parseRangeHeader } = __nccwpck_require__(3983)
  27401. function calculateRetryAfterHeader (retryAfter) {
  27402. const current = Date.now()
  27403. const diff = new Date(retryAfter).getTime() - current
  27404. return diff
  27405. }
  27406. class RetryHandler {
  27407. constructor (opts, handlers) {
  27408. const { retryOptions, ...dispatchOpts } = opts
  27409. const {
  27410. // Retry scoped
  27411. retry: retryFn,
  27412. maxRetries,
  27413. maxTimeout,
  27414. minTimeout,
  27415. timeoutFactor,
  27416. // Response scoped
  27417. methods,
  27418. errorCodes,
  27419. retryAfter,
  27420. statusCodes
  27421. } = retryOptions ?? {}
  27422. this.dispatch = handlers.dispatch
  27423. this.handler = handlers.handler
  27424. this.opts = dispatchOpts
  27425. this.abort = null
  27426. this.aborted = false
  27427. this.retryOpts = {
  27428. retry: retryFn ?? RetryHandler[kRetryHandlerDefaultRetry],
  27429. retryAfter: retryAfter ?? true,
  27430. maxTimeout: maxTimeout ?? 30 * 1000, // 30s,
  27431. timeout: minTimeout ?? 500, // .5s
  27432. timeoutFactor: timeoutFactor ?? 2,
  27433. maxRetries: maxRetries ?? 5,
  27434. // What errors we should retry
  27435. methods: methods ?? ['GET', 'HEAD', 'OPTIONS', 'PUT', 'DELETE', 'TRACE'],
  27436. // Indicates which errors to retry
  27437. statusCodes: statusCodes ?? [500, 502, 503, 504, 429],
  27438. // List of errors to retry
  27439. errorCodes: errorCodes ?? [
  27440. 'ECONNRESET',
  27441. 'ECONNREFUSED',
  27442. 'ENOTFOUND',
  27443. 'ENETDOWN',
  27444. 'ENETUNREACH',
  27445. 'EHOSTDOWN',
  27446. 'EHOSTUNREACH',
  27447. 'EPIPE'
  27448. ]
  27449. }
  27450. this.retryCount = 0
  27451. this.start = 0
  27452. this.end = null
  27453. this.etag = null
  27454. this.resume = null
  27455. // Handle possible onConnect duplication
  27456. this.handler.onConnect(reason => {
  27457. this.aborted = true
  27458. if (this.abort) {
  27459. this.abort(reason)
  27460. } else {
  27461. this.reason = reason
  27462. }
  27463. })
  27464. }
  27465. onRequestSent () {
  27466. if (this.handler.onRequestSent) {
  27467. this.handler.onRequestSent()
  27468. }
  27469. }
  27470. onUpgrade (statusCode, headers, socket) {
  27471. if (this.handler.onUpgrade) {
  27472. this.handler.onUpgrade(statusCode, headers, socket)
  27473. }
  27474. }
  27475. onConnect (abort) {
  27476. if (this.aborted) {
  27477. abort(this.reason)
  27478. } else {
  27479. this.abort = abort
  27480. }
  27481. }
  27482. onBodySent (chunk) {
  27483. if (this.handler.onBodySent) return this.handler.onBodySent(chunk)
  27484. }
  27485. static [kRetryHandlerDefaultRetry] (err, { state, opts }, cb) {
  27486. const { statusCode, code, headers } = err
  27487. const { method, retryOptions } = opts
  27488. const {
  27489. maxRetries,
  27490. timeout,
  27491. maxTimeout,
  27492. timeoutFactor,
  27493. statusCodes,
  27494. errorCodes,
  27495. methods
  27496. } = retryOptions
  27497. let { counter, currentTimeout } = state
  27498. currentTimeout =
  27499. currentTimeout != null && currentTimeout > 0 ? currentTimeout : timeout
  27500. // Any code that is not a Undici's originated and allowed to retry
  27501. if (
  27502. code &&
  27503. code !== 'UND_ERR_REQ_RETRY' &&
  27504. code !== 'UND_ERR_SOCKET' &&
  27505. !errorCodes.includes(code)
  27506. ) {
  27507. cb(err)
  27508. return
  27509. }
  27510. // If a set of method are provided and the current method is not in the list
  27511. if (Array.isArray(methods) && !methods.includes(method)) {
  27512. cb(err)
  27513. return
  27514. }
  27515. // If a set of status code are provided and the current status code is not in the list
  27516. if (
  27517. statusCode != null &&
  27518. Array.isArray(statusCodes) &&
  27519. !statusCodes.includes(statusCode)
  27520. ) {
  27521. cb(err)
  27522. return
  27523. }
  27524. // If we reached the max number of retries
  27525. if (counter > maxRetries) {
  27526. cb(err)
  27527. return
  27528. }
  27529. let retryAfterHeader = headers != null && headers['retry-after']
  27530. if (retryAfterHeader) {
  27531. retryAfterHeader = Number(retryAfterHeader)
  27532. retryAfterHeader = isNaN(retryAfterHeader)
  27533. ? calculateRetryAfterHeader(retryAfterHeader)
  27534. : retryAfterHeader * 1e3 // Retry-After is in seconds
  27535. }
  27536. const retryTimeout =
  27537. retryAfterHeader > 0
  27538. ? Math.min(retryAfterHeader, maxTimeout)
  27539. : Math.min(currentTimeout * timeoutFactor ** counter, maxTimeout)
  27540. state.currentTimeout = retryTimeout
  27541. setTimeout(() => cb(null), retryTimeout)
  27542. }
  27543. onHeaders (statusCode, rawHeaders, resume, statusMessage) {
  27544. const headers = parseHeaders(rawHeaders)
  27545. this.retryCount += 1
  27546. if (statusCode >= 300) {
  27547. this.abort(
  27548. new RequestRetryError('Request failed', statusCode, {
  27549. headers,
  27550. count: this.retryCount
  27551. })
  27552. )
  27553. return false
  27554. }
  27555. // Checkpoint for resume from where we left it
  27556. if (this.resume != null) {
  27557. this.resume = null
  27558. if (statusCode !== 206) {
  27559. return true
  27560. }
  27561. const contentRange = parseRangeHeader(headers['content-range'])
  27562. // If no content range
  27563. if (!contentRange) {
  27564. this.abort(
  27565. new RequestRetryError('Content-Range mismatch', statusCode, {
  27566. headers,
  27567. count: this.retryCount
  27568. })
  27569. )
  27570. return false
  27571. }
  27572. // Let's start with a weak etag check
  27573. if (this.etag != null && this.etag !== headers.etag) {
  27574. this.abort(
  27575. new RequestRetryError('ETag mismatch', statusCode, {
  27576. headers,
  27577. count: this.retryCount
  27578. })
  27579. )
  27580. return false
  27581. }
  27582. const { start, size, end = size } = contentRange
  27583. assert(this.start === start, 'content-range mismatch')
  27584. assert(this.end == null || this.end === end, 'content-range mismatch')
  27585. this.resume = resume
  27586. return true
  27587. }
  27588. if (this.end == null) {
  27589. if (statusCode === 206) {
  27590. // First time we receive 206
  27591. const range = parseRangeHeader(headers['content-range'])
  27592. if (range == null) {
  27593. return this.handler.onHeaders(
  27594. statusCode,
  27595. rawHeaders,
  27596. resume,
  27597. statusMessage
  27598. )
  27599. }
  27600. const { start, size, end = size } = range
  27601. assert(
  27602. start != null && Number.isFinite(start) && this.start !== start,
  27603. 'content-range mismatch'
  27604. )
  27605. assert(Number.isFinite(start))
  27606. assert(
  27607. end != null && Number.isFinite(end) && this.end !== end,
  27608. 'invalid content-length'
  27609. )
  27610. this.start = start
  27611. this.end = end
  27612. }
  27613. // We make our best to checkpoint the body for further range headers
  27614. if (this.end == null) {
  27615. const contentLength = headers['content-length']
  27616. this.end = contentLength != null ? Number(contentLength) : null
  27617. }
  27618. assert(Number.isFinite(this.start))
  27619. assert(
  27620. this.end == null || Number.isFinite(this.end),
  27621. 'invalid content-length'
  27622. )
  27623. this.resume = resume
  27624. this.etag = headers.etag != null ? headers.etag : null
  27625. return this.handler.onHeaders(
  27626. statusCode,
  27627. rawHeaders,
  27628. resume,
  27629. statusMessage
  27630. )
  27631. }
  27632. const err = new RequestRetryError('Request failed', statusCode, {
  27633. headers,
  27634. count: this.retryCount
  27635. })
  27636. this.abort(err)
  27637. return false
  27638. }
  27639. onData (chunk) {
  27640. this.start += chunk.length
  27641. return this.handler.onData(chunk)
  27642. }
  27643. onComplete (rawTrailers) {
  27644. this.retryCount = 0
  27645. return this.handler.onComplete(rawTrailers)
  27646. }
  27647. onError (err) {
  27648. if (this.aborted || isDisturbed(this.opts.body)) {
  27649. return this.handler.onError(err)
  27650. }
  27651. this.retryOpts.retry(
  27652. err,
  27653. {
  27654. state: { counter: this.retryCount++, currentTimeout: this.retryAfter },
  27655. opts: { retryOptions: this.retryOpts, ...this.opts }
  27656. },
  27657. onRetry.bind(this)
  27658. )
  27659. function onRetry (err) {
  27660. if (err != null || this.aborted || isDisturbed(this.opts.body)) {
  27661. return this.handler.onError(err)
  27662. }
  27663. if (this.start !== 0) {
  27664. this.opts = {
  27665. ...this.opts,
  27666. headers: {
  27667. ...this.opts.headers,
  27668. range: `bytes=${this.start}-${this.end ?? ''}`
  27669. }
  27670. }
  27671. }
  27672. try {
  27673. this.dispatch(this.opts, this)
  27674. } catch (err) {
  27675. this.handler.onError(err)
  27676. }
  27677. }
  27678. }
  27679. }
  27680. module.exports = RetryHandler
  27681. /***/ }),
  27682. /***/ 8861:
  27683. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27684. "use strict";
  27685. const RedirectHandler = __nccwpck_require__(2860)
  27686. function createRedirectInterceptor ({ maxRedirections: defaultMaxRedirections }) {
  27687. return (dispatch) => {
  27688. return function Intercept (opts, handler) {
  27689. const { maxRedirections = defaultMaxRedirections } = opts
  27690. if (!maxRedirections) {
  27691. return dispatch(opts, handler)
  27692. }
  27693. const redirectHandler = new RedirectHandler(dispatch, maxRedirections, opts, handler)
  27694. opts = { ...opts, maxRedirections: 0 } // Stop sub dispatcher from also redirecting.
  27695. return dispatch(opts, redirectHandler)
  27696. }
  27697. }
  27698. }
  27699. module.exports = createRedirectInterceptor
  27700. /***/ }),
  27701. /***/ 953:
  27702. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  27703. "use strict";
  27704. Object.defineProperty(exports, "__esModule", ({ value: true }));
  27705. 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;
  27706. const utils_1 = __nccwpck_require__(1891);
  27707. // C headers
  27708. var ERROR;
  27709. (function (ERROR) {
  27710. ERROR[ERROR["OK"] = 0] = "OK";
  27711. ERROR[ERROR["INTERNAL"] = 1] = "INTERNAL";
  27712. ERROR[ERROR["STRICT"] = 2] = "STRICT";
  27713. ERROR[ERROR["LF_EXPECTED"] = 3] = "LF_EXPECTED";
  27714. ERROR[ERROR["UNEXPECTED_CONTENT_LENGTH"] = 4] = "UNEXPECTED_CONTENT_LENGTH";
  27715. ERROR[ERROR["CLOSED_CONNECTION"] = 5] = "CLOSED_CONNECTION";
  27716. ERROR[ERROR["INVALID_METHOD"] = 6] = "INVALID_METHOD";
  27717. ERROR[ERROR["INVALID_URL"] = 7] = "INVALID_URL";
  27718. ERROR[ERROR["INVALID_CONSTANT"] = 8] = "INVALID_CONSTANT";
  27719. ERROR[ERROR["INVALID_VERSION"] = 9] = "INVALID_VERSION";
  27720. ERROR[ERROR["INVALID_HEADER_TOKEN"] = 10] = "INVALID_HEADER_TOKEN";
  27721. ERROR[ERROR["INVALID_CONTENT_LENGTH"] = 11] = "INVALID_CONTENT_LENGTH";
  27722. ERROR[ERROR["INVALID_CHUNK_SIZE"] = 12] = "INVALID_CHUNK_SIZE";
  27723. ERROR[ERROR["INVALID_STATUS"] = 13] = "INVALID_STATUS";
  27724. ERROR[ERROR["INVALID_EOF_STATE"] = 14] = "INVALID_EOF_STATE";
  27725. ERROR[ERROR["INVALID_TRANSFER_ENCODING"] = 15] = "INVALID_TRANSFER_ENCODING";
  27726. ERROR[ERROR["CB_MESSAGE_BEGIN"] = 16] = "CB_MESSAGE_BEGIN";
  27727. ERROR[ERROR["CB_HEADERS_COMPLETE"] = 17] = "CB_HEADERS_COMPLETE";
  27728. ERROR[ERROR["CB_MESSAGE_COMPLETE"] = 18] = "CB_MESSAGE_COMPLETE";
  27729. ERROR[ERROR["CB_CHUNK_HEADER"] = 19] = "CB_CHUNK_HEADER";
  27730. ERROR[ERROR["CB_CHUNK_COMPLETE"] = 20] = "CB_CHUNK_COMPLETE";
  27731. ERROR[ERROR["PAUSED"] = 21] = "PAUSED";
  27732. ERROR[ERROR["PAUSED_UPGRADE"] = 22] = "PAUSED_UPGRADE";
  27733. ERROR[ERROR["PAUSED_H2_UPGRADE"] = 23] = "PAUSED_H2_UPGRADE";
  27734. ERROR[ERROR["USER"] = 24] = "USER";
  27735. })(ERROR = exports.ERROR || (exports.ERROR = {}));
  27736. var TYPE;
  27737. (function (TYPE) {
  27738. TYPE[TYPE["BOTH"] = 0] = "BOTH";
  27739. TYPE[TYPE["REQUEST"] = 1] = "REQUEST";
  27740. TYPE[TYPE["RESPONSE"] = 2] = "RESPONSE";
  27741. })(TYPE = exports.TYPE || (exports.TYPE = {}));
  27742. var FLAGS;
  27743. (function (FLAGS) {
  27744. FLAGS[FLAGS["CONNECTION_KEEP_ALIVE"] = 1] = "CONNECTION_KEEP_ALIVE";
  27745. FLAGS[FLAGS["CONNECTION_CLOSE"] = 2] = "CONNECTION_CLOSE";
  27746. FLAGS[FLAGS["CONNECTION_UPGRADE"] = 4] = "CONNECTION_UPGRADE";
  27747. FLAGS[FLAGS["CHUNKED"] = 8] = "CHUNKED";
  27748. FLAGS[FLAGS["UPGRADE"] = 16] = "UPGRADE";
  27749. FLAGS[FLAGS["CONTENT_LENGTH"] = 32] = "CONTENT_LENGTH";
  27750. FLAGS[FLAGS["SKIPBODY"] = 64] = "SKIPBODY";
  27751. FLAGS[FLAGS["TRAILING"] = 128] = "TRAILING";
  27752. // 1 << 8 is unused
  27753. FLAGS[FLAGS["TRANSFER_ENCODING"] = 512] = "TRANSFER_ENCODING";
  27754. })(FLAGS = exports.FLAGS || (exports.FLAGS = {}));
  27755. var LENIENT_FLAGS;
  27756. (function (LENIENT_FLAGS) {
  27757. LENIENT_FLAGS[LENIENT_FLAGS["HEADERS"] = 1] = "HEADERS";
  27758. LENIENT_FLAGS[LENIENT_FLAGS["CHUNKED_LENGTH"] = 2] = "CHUNKED_LENGTH";
  27759. LENIENT_FLAGS[LENIENT_FLAGS["KEEP_ALIVE"] = 4] = "KEEP_ALIVE";
  27760. })(LENIENT_FLAGS = exports.LENIENT_FLAGS || (exports.LENIENT_FLAGS = {}));
  27761. var METHODS;
  27762. (function (METHODS) {
  27763. METHODS[METHODS["DELETE"] = 0] = "DELETE";
  27764. METHODS[METHODS["GET"] = 1] = "GET";
  27765. METHODS[METHODS["HEAD"] = 2] = "HEAD";
  27766. METHODS[METHODS["POST"] = 3] = "POST";
  27767. METHODS[METHODS["PUT"] = 4] = "PUT";
  27768. /* pathological */
  27769. METHODS[METHODS["CONNECT"] = 5] = "CONNECT";
  27770. METHODS[METHODS["OPTIONS"] = 6] = "OPTIONS";
  27771. METHODS[METHODS["TRACE"] = 7] = "TRACE";
  27772. /* WebDAV */
  27773. METHODS[METHODS["COPY"] = 8] = "COPY";
  27774. METHODS[METHODS["LOCK"] = 9] = "LOCK";
  27775. METHODS[METHODS["MKCOL"] = 10] = "MKCOL";
  27776. METHODS[METHODS["MOVE"] = 11] = "MOVE";
  27777. METHODS[METHODS["PROPFIND"] = 12] = "PROPFIND";
  27778. METHODS[METHODS["PROPPATCH"] = 13] = "PROPPATCH";
  27779. METHODS[METHODS["SEARCH"] = 14] = "SEARCH";
  27780. METHODS[METHODS["UNLOCK"] = 15] = "UNLOCK";
  27781. METHODS[METHODS["BIND"] = 16] = "BIND";
  27782. METHODS[METHODS["REBIND"] = 17] = "REBIND";
  27783. METHODS[METHODS["UNBIND"] = 18] = "UNBIND";
  27784. METHODS[METHODS["ACL"] = 19] = "ACL";
  27785. /* subversion */
  27786. METHODS[METHODS["REPORT"] = 20] = "REPORT";
  27787. METHODS[METHODS["MKACTIVITY"] = 21] = "MKACTIVITY";
  27788. METHODS[METHODS["CHECKOUT"] = 22] = "CHECKOUT";
  27789. METHODS[METHODS["MERGE"] = 23] = "MERGE";
  27790. /* upnp */
  27791. METHODS[METHODS["M-SEARCH"] = 24] = "M-SEARCH";
  27792. METHODS[METHODS["NOTIFY"] = 25] = "NOTIFY";
  27793. METHODS[METHODS["SUBSCRIBE"] = 26] = "SUBSCRIBE";
  27794. METHODS[METHODS["UNSUBSCRIBE"] = 27] = "UNSUBSCRIBE";
  27795. /* RFC-5789 */
  27796. METHODS[METHODS["PATCH"] = 28] = "PATCH";
  27797. METHODS[METHODS["PURGE"] = 29] = "PURGE";
  27798. /* CalDAV */
  27799. METHODS[METHODS["MKCALENDAR"] = 30] = "MKCALENDAR";
  27800. /* RFC-2068, section 19.6.1.2 */
  27801. METHODS[METHODS["LINK"] = 31] = "LINK";
  27802. METHODS[METHODS["UNLINK"] = 32] = "UNLINK";
  27803. /* icecast */
  27804. METHODS[METHODS["SOURCE"] = 33] = "SOURCE";
  27805. /* RFC-7540, section 11.6 */
  27806. METHODS[METHODS["PRI"] = 34] = "PRI";
  27807. /* RFC-2326 RTSP */
  27808. METHODS[METHODS["DESCRIBE"] = 35] = "DESCRIBE";
  27809. METHODS[METHODS["ANNOUNCE"] = 36] = "ANNOUNCE";
  27810. METHODS[METHODS["SETUP"] = 37] = "SETUP";
  27811. METHODS[METHODS["PLAY"] = 38] = "PLAY";
  27812. METHODS[METHODS["PAUSE"] = 39] = "PAUSE";
  27813. METHODS[METHODS["TEARDOWN"] = 40] = "TEARDOWN";
  27814. METHODS[METHODS["GET_PARAMETER"] = 41] = "GET_PARAMETER";
  27815. METHODS[METHODS["SET_PARAMETER"] = 42] = "SET_PARAMETER";
  27816. METHODS[METHODS["REDIRECT"] = 43] = "REDIRECT";
  27817. METHODS[METHODS["RECORD"] = 44] = "RECORD";
  27818. /* RAOP */
  27819. METHODS[METHODS["FLUSH"] = 45] = "FLUSH";
  27820. })(METHODS = exports.METHODS || (exports.METHODS = {}));
  27821. exports.METHODS_HTTP = [
  27822. METHODS.DELETE,
  27823. METHODS.GET,
  27824. METHODS.HEAD,
  27825. METHODS.POST,
  27826. METHODS.PUT,
  27827. METHODS.CONNECT,
  27828. METHODS.OPTIONS,
  27829. METHODS.TRACE,
  27830. METHODS.COPY,
  27831. METHODS.LOCK,
  27832. METHODS.MKCOL,
  27833. METHODS.MOVE,
  27834. METHODS.PROPFIND,
  27835. METHODS.PROPPATCH,
  27836. METHODS.SEARCH,
  27837. METHODS.UNLOCK,
  27838. METHODS.BIND,
  27839. METHODS.REBIND,
  27840. METHODS.UNBIND,
  27841. METHODS.ACL,
  27842. METHODS.REPORT,
  27843. METHODS.MKACTIVITY,
  27844. METHODS.CHECKOUT,
  27845. METHODS.MERGE,
  27846. METHODS['M-SEARCH'],
  27847. METHODS.NOTIFY,
  27848. METHODS.SUBSCRIBE,
  27849. METHODS.UNSUBSCRIBE,
  27850. METHODS.PATCH,
  27851. METHODS.PURGE,
  27852. METHODS.MKCALENDAR,
  27853. METHODS.LINK,
  27854. METHODS.UNLINK,
  27855. METHODS.PRI,
  27856. // TODO(indutny): should we allow it with HTTP?
  27857. METHODS.SOURCE,
  27858. ];
  27859. exports.METHODS_ICE = [
  27860. METHODS.SOURCE,
  27861. ];
  27862. exports.METHODS_RTSP = [
  27863. METHODS.OPTIONS,
  27864. METHODS.DESCRIBE,
  27865. METHODS.ANNOUNCE,
  27866. METHODS.SETUP,
  27867. METHODS.PLAY,
  27868. METHODS.PAUSE,
  27869. METHODS.TEARDOWN,
  27870. METHODS.GET_PARAMETER,
  27871. METHODS.SET_PARAMETER,
  27872. METHODS.REDIRECT,
  27873. METHODS.RECORD,
  27874. METHODS.FLUSH,
  27875. // For AirPlay
  27876. METHODS.GET,
  27877. METHODS.POST,
  27878. ];
  27879. exports.METHOD_MAP = utils_1.enumToMap(METHODS);
  27880. exports.H_METHOD_MAP = {};
  27881. Object.keys(exports.METHOD_MAP).forEach((key) => {
  27882. if (/^H/.test(key)) {
  27883. exports.H_METHOD_MAP[key] = exports.METHOD_MAP[key];
  27884. }
  27885. });
  27886. var FINISH;
  27887. (function (FINISH) {
  27888. FINISH[FINISH["SAFE"] = 0] = "SAFE";
  27889. FINISH[FINISH["SAFE_WITH_CB"] = 1] = "SAFE_WITH_CB";
  27890. FINISH[FINISH["UNSAFE"] = 2] = "UNSAFE";
  27891. })(FINISH = exports.FINISH || (exports.FINISH = {}));
  27892. exports.ALPHA = [];
  27893. for (let i = 'A'.charCodeAt(0); i <= 'Z'.charCodeAt(0); i++) {
  27894. // Upper case
  27895. exports.ALPHA.push(String.fromCharCode(i));
  27896. // Lower case
  27897. exports.ALPHA.push(String.fromCharCode(i + 0x20));
  27898. }
  27899. exports.NUM_MAP = {
  27900. 0: 0, 1: 1, 2: 2, 3: 3, 4: 4,
  27901. 5: 5, 6: 6, 7: 7, 8: 8, 9: 9,
  27902. };
  27903. exports.HEX_MAP = {
  27904. 0: 0, 1: 1, 2: 2, 3: 3, 4: 4,
  27905. 5: 5, 6: 6, 7: 7, 8: 8, 9: 9,
  27906. A: 0XA, B: 0XB, C: 0XC, D: 0XD, E: 0XE, F: 0XF,
  27907. a: 0xa, b: 0xb, c: 0xc, d: 0xd, e: 0xe, f: 0xf,
  27908. };
  27909. exports.NUM = [
  27910. '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
  27911. ];
  27912. exports.ALPHANUM = exports.ALPHA.concat(exports.NUM);
  27913. exports.MARK = ['-', '_', '.', '!', '~', '*', '\'', '(', ')'];
  27914. exports.USERINFO_CHARS = exports.ALPHANUM
  27915. .concat(exports.MARK)
  27916. .concat(['%', ';', ':', '&', '=', '+', '$', ',']);
  27917. // TODO(indutny): use RFC
  27918. exports.STRICT_URL_CHAR = [
  27919. '!', '"', '$', '%', '&', '\'',
  27920. '(', ')', '*', '+', ',', '-', '.', '/',
  27921. ':', ';', '<', '=', '>',
  27922. '@', '[', '\\', ']', '^', '_',
  27923. '`',
  27924. '{', '|', '}', '~',
  27925. ].concat(exports.ALPHANUM);
  27926. exports.URL_CHAR = exports.STRICT_URL_CHAR
  27927. .concat(['\t', '\f']);
  27928. // All characters with 0x80 bit set to 1
  27929. for (let i = 0x80; i <= 0xff; i++) {
  27930. exports.URL_CHAR.push(i);
  27931. }
  27932. exports.HEX = exports.NUM.concat(['a', 'b', 'c', 'd', 'e', 'f', 'A', 'B', 'C', 'D', 'E', 'F']);
  27933. /* Tokens as defined by rfc 2616. Also lowercases them.
  27934. * token = 1*<any CHAR except CTLs or separators>
  27935. * separators = "(" | ")" | "<" | ">" | "@"
  27936. * | "," | ";" | ":" | "\" | <">
  27937. * | "/" | "[" | "]" | "?" | "="
  27938. * | "{" | "}" | SP | HT
  27939. */
  27940. exports.STRICT_TOKEN = [
  27941. '!', '#', '$', '%', '&', '\'',
  27942. '*', '+', '-', '.',
  27943. '^', '_', '`',
  27944. '|', '~',
  27945. ].concat(exports.ALPHANUM);
  27946. exports.TOKEN = exports.STRICT_TOKEN.concat([' ']);
  27947. /*
  27948. * Verify that a char is a valid visible (printable) US-ASCII
  27949. * character or %x80-FF
  27950. */
  27951. exports.HEADER_CHARS = ['\t'];
  27952. for (let i = 32; i <= 255; i++) {
  27953. if (i !== 127) {
  27954. exports.HEADER_CHARS.push(i);
  27955. }
  27956. }
  27957. // ',' = \x44
  27958. exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS.filter((c) => c !== 44);
  27959. exports.MAJOR = exports.NUM_MAP;
  27960. exports.MINOR = exports.MAJOR;
  27961. var HEADER_STATE;
  27962. (function (HEADER_STATE) {
  27963. HEADER_STATE[HEADER_STATE["GENERAL"] = 0] = "GENERAL";
  27964. HEADER_STATE[HEADER_STATE["CONNECTION"] = 1] = "CONNECTION";
  27965. HEADER_STATE[HEADER_STATE["CONTENT_LENGTH"] = 2] = "CONTENT_LENGTH";
  27966. HEADER_STATE[HEADER_STATE["TRANSFER_ENCODING"] = 3] = "TRANSFER_ENCODING";
  27967. HEADER_STATE[HEADER_STATE["UPGRADE"] = 4] = "UPGRADE";
  27968. HEADER_STATE[HEADER_STATE["CONNECTION_KEEP_ALIVE"] = 5] = "CONNECTION_KEEP_ALIVE";
  27969. HEADER_STATE[HEADER_STATE["CONNECTION_CLOSE"] = 6] = "CONNECTION_CLOSE";
  27970. HEADER_STATE[HEADER_STATE["CONNECTION_UPGRADE"] = 7] = "CONNECTION_UPGRADE";
  27971. HEADER_STATE[HEADER_STATE["TRANSFER_ENCODING_CHUNKED"] = 8] = "TRANSFER_ENCODING_CHUNKED";
  27972. })(HEADER_STATE = exports.HEADER_STATE || (exports.HEADER_STATE = {}));
  27973. exports.SPECIAL_HEADERS = {
  27974. 'connection': HEADER_STATE.CONNECTION,
  27975. 'content-length': HEADER_STATE.CONTENT_LENGTH,
  27976. 'proxy-connection': HEADER_STATE.CONNECTION,
  27977. 'transfer-encoding': HEADER_STATE.TRANSFER_ENCODING,
  27978. 'upgrade': HEADER_STATE.UPGRADE,
  27979. };
  27980. //# sourceMappingURL=constants.js.map
  27981. /***/ }),
  27982. /***/ 1145:
  27983. /***/ ((module) => {
  27984. module.exports = 'AGFzbQEAAAABMAhgAX8Bf2ADf39/AX9gBH9/f38Bf2AAAGADf39/AGABfwBgAn9/AGAGf39/f39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQACA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAA0ZFAwMEAAAFAAAAAAAABQEFAAUFBQAABgAAAAAGBgYGAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAAABAQcAAAUFAwABBAUBcAESEgUDAQACBggBfwFBgNQECwfRBSIGbWVtb3J5AgALX2luaXRpYWxpemUACRlfX2luZGlyZWN0X2Z1bmN0aW9uX3RhYmxlAQALbGxodHRwX2luaXQAChhsbGh0dHBfc2hvdWxkX2tlZXBfYWxpdmUAQQxsbGh0dHBfYWxsb2MADAZtYWxsb2MARgtsbGh0dHBfZnJlZQANBGZyZWUASA9sbGh0dHBfZ2V0X3R5cGUADhVsbGh0dHBfZ2V0X2h0dHBfbWFqb3IADxVsbGh0dHBfZ2V0X2h0dHBfbWlub3IAEBFsbGh0dHBfZ2V0X21ldGhvZAARFmxsaHR0cF9nZXRfc3RhdHVzX2NvZGUAEhJsbGh0dHBfZ2V0X3VwZ3JhZGUAEwxsbGh0dH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QEhEAwFC0G+ASEQDAQLQb8BIRAMAwtBwAEhEAwCC0HCASEQDAELQcEBIRALA0ACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAA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AAIBAgARCngICAACIQDQAgASEBDEILIABB0gA2AhwgACABNgIUIAAgEDYCDEEAIRAMpwELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEILIABB0wA2AhwgACABNgIUIAAgEDYCDEEAIRAMpgELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEYLIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMpQELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDD8LIABB0gA2AhwgACAUNgIUIAAgATYCDEEAIRAMpAELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDD8LIABB0wA2AhwgACAUNgIUIAAgATYCDEEAIRAMowELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDEMLIABB5QA2AhwgACAUNgIUIAAgATYCDEEAIRAMogELIABBADYCHCAAIBQ2AhQgAEHDj4CAADYCECAAQQc2AgxBACEQDKEBCyAAQQA2AhwgACABNgIUIABBw4+AgAA2AhAgAEEHNgIMQQAhEAygAQtBACEQIABBADYCHCAAIBQ2AhQgAEGMnICAADYCECAAQQc2AgwMnwELIABBADYCHCAAIBQ2AhQgAEGMnICAADYCECAAQQc2AgxBACEQDJ4BCyAAQQA2AhwgACAUNgIUIABB/pGAgAA2AhAgAEEHNgIMQQAhEAydAQsgAEEANgIcIAAgATYCFCAAQY6bgIAANgIQIABBBjYCDEEAIRAMnAELIBBBFUYNVyAAQQA2AhwgACABNgIUIABBzI6AgAA2AhAgAEEgNgIMQQAhEAybAQsgAEEANgIAIBBBAWohAUEkIRALIAAgEDoAKSAAKAIEIRAgAEEANgIEIAAgECABEKuAgIAAIhANVCABIQEMPgsgAEEANgIAC0EAIRAgAEEANgIcIAAgBDYCFCAAQfGbgIAANgIQIABBBjYCDAyXAQsgAUEVRg1QIABBADYCHCAAIAU2AhQgAEHwjICAADYCECAAQRs2AgxBACEQDJYBCyAAKAI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ACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIBAOxwEAAQIDBAUGBwgJCgsMDQ4PEBESExQVFhcYGRobHB4fICEjJSg/QEFERUZHSElKS0xNT1BRUlPeA1dZW1xdYGJlZmdoaWprbG1vcHFyc3R1dnd4eXp7fH1+gAGCAYUBhgGHAYkBiwGMAY0BjgGPAZABkQGUAZUBlgGXAZgBmQGaAZsBnAGdAZ4BnwGgAaEBogGjAaQBpQGmAacBqAGpAaoBqwGsAa0Br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AIEIQQgAEEANgIEAkAgACAEIAEQrYCAgAAiBA0AIAEhAQytAQsgAEHZADYCHCAAIAE2AhQgACAENgIMQQAhEAy9AQsgACgCBCEEIABBADYCBAJAIAAgBCABEK2AgIAAIgQNACABIQEMqwELIABB2gA2AhwgACABNgIUIAAgBDYCDEEAIRAMvAELIAAoAgQhBCAAQQA2AgQCQCAAIAQgARCtgICAACIEDQAgASEBDKkBCyAAQdwANgIcIAAgATYCFCAAIAQ2AgxBACEQDLsBCwJAIAEtAABBUGoiEEH/AXFBCk8NACAAIBA6ACogAUEBaiEBQc8AIRAMogELIAAoAgQhBCAAQQA2AgQCQCAAIAQgARCtgICAACIEDQAgASEBDKcBCyAAQd4ANgIcIAAgATYCFCAAIAQ2AgxBACEQDLoBCyAAQQA2AgAgF0EBaiEBAkAgAC0AKUEjTw0AIAEhAQxZCyAAQQA2AhwgACABNgIUIABB04mAgAA2AhAgAEEINgIMQQAhEAy5AQsgAEEANgIAC0EAIRAgAEEANgIcIAAgATYCFCAAQZCzgIAANgIQIABBCDYCDAy3AQsgAEEANgIAIBdBAWohAQJAIAAtAClBIUcNACABIQEMVgsgAEEANgIcIAAgATYCFCAAQZuKgIAANgIQIABBCDYCDEEAIRAMtgELIABBADYCACAXQQFqIQECQCAALQApIhBBXWpBC08NACABIQEMVQsCQCAQQQZLDQBBASAQdEHKAHFFDQAgASEBDFULQQAhECAAQQA2AhwgACABNgIUIABB94mAgAA2AhAgAEEINgIMDLUBCyAQQRVGDXEgAEEANgIcIAAgATYCFCAAQbmNgIAANgIQIABBGjYCDEEAIRAMtAELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDFQLIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMswELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDE0LIABB0gA2AhwgACABNgIUIAAgEDYCDEEAIRAMsgELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDE0L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MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE5PVU5DRUVDS09VVE5FQ1RFVEVDUklCRUxVU0hFVEVBRFNFQVJDSFJHRUNUSVZJVFlMRU5EQVJWRU9USUZZUFRJT05TQ0hTRUFZU1RBVENIR0VPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFSFRUUC9BRFRQLw=='
  27989. /***/ }),
  27990. /***/ 1891:
  27991. /***/ ((__unused_webpack_module, exports) => {
  27992. "use strict";
  27993. Object.defineProperty(exports, "__esModule", ({ value: true }));
  27994. exports.enumToMap = void 0;
  27995. function enumToMap(obj) {
  27996. const res = {};
  27997. Object.keys(obj).forEach((key) => {
  27998. const value = obj[key];
  27999. if (typeof value === 'number') {
  28000. res[key] = value;
  28001. }
  28002. });
  28003. return res;
  28004. }
  28005. exports.enumToMap = enumToMap;
  28006. //# sourceMappingURL=utils.js.map
  28007. /***/ }),
  28008. /***/ 6771:
  28009. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28010. "use strict";
  28011. const { kClients } = __nccwpck_require__(2785)
  28012. const Agent = __nccwpck_require__(7890)
  28013. const {
  28014. kAgent,
  28015. kMockAgentSet,
  28016. kMockAgentGet,
  28017. kDispatches,
  28018. kIsMockActive,
  28019. kNetConnect,
  28020. kGetNetConnect,
  28021. kOptions,
  28022. kFactory
  28023. } = __nccwpck_require__(4347)
  28024. const MockClient = __nccwpck_require__(8687)
  28025. const MockPool = __nccwpck_require__(6193)
  28026. const { matchValue, buildMockOptions } = __nccwpck_require__(9323)
  28027. const { InvalidArgumentError, UndiciError } = __nccwpck_require__(8045)
  28028. const Dispatcher = __nccwpck_require__(412)
  28029. const Pluralizer = __nccwpck_require__(8891)
  28030. const PendingInterceptorsFormatter = __nccwpck_require__(6823)
  28031. class FakeWeakRef {
  28032. constructor (value) {
  28033. this.value = value
  28034. }
  28035. deref () {
  28036. return this.value
  28037. }
  28038. }
  28039. class MockAgent extends Dispatcher {
  28040. constructor (opts) {
  28041. super(opts)
  28042. this[kNetConnect] = true
  28043. this[kIsMockActive] = true
  28044. // Instantiate Agent and encapsulate
  28045. if ((opts && opts.agent && typeof opts.agent.dispatch !== 'function')) {
  28046. throw new InvalidArgumentError('Argument opts.agent must implement Agent')
  28047. }
  28048. const agent = opts && opts.agent ? opts.agent : new Agent(opts)
  28049. this[kAgent] = agent
  28050. this[kClients] = agent[kClients]
  28051. this[kOptions] = buildMockOptions(opts)
  28052. }
  28053. get (origin) {
  28054. let dispatcher = this[kMockAgentGet](origin)
  28055. if (!dispatcher) {
  28056. dispatcher = this[kFactory](origin)
  28057. this[kMockAgentSet](origin, dispatcher)
  28058. }
  28059. return dispatcher
  28060. }
  28061. dispatch (opts, handler) {
  28062. // Call MockAgent.get to perform additional setup before dispatching as normal
  28063. this.get(opts.origin)
  28064. return this[kAgent].dispatch(opts, handler)
  28065. }
  28066. async close () {
  28067. await this[kAgent].close()
  28068. this[kClients].clear()
  28069. }
  28070. deactivate () {
  28071. this[kIsMockActive] = false
  28072. }
  28073. activate () {
  28074. this[kIsMockActive] = true
  28075. }
  28076. enableNetConnect (matcher) {
  28077. if (typeof matcher === 'string' || typeof matcher === 'function' || matcher instanceof RegExp) {
  28078. if (Array.isArray(this[kNetConnect])) {
  28079. this[kNetConnect].push(matcher)
  28080. } else {
  28081. this[kNetConnect] = [matcher]
  28082. }
  28083. } else if (typeof matcher === 'undefined') {
  28084. this[kNetConnect] = true
  28085. } else {
  28086. throw new InvalidArgumentError('Unsupported matcher. Must be one of String|Function|RegExp.')
  28087. }
  28088. }
  28089. disableNetConnect () {
  28090. this[kNetConnect] = false
  28091. }
  28092. // This is required to bypass issues caused by using global symbols - see:
  28093. // https://github.com/nodejs/undici/issues/1447
  28094. get isMockActive () {
  28095. return this[kIsMockActive]
  28096. }
  28097. [kMockAgentSet] (origin, dispatcher) {
  28098. this[kClients].set(origin, new FakeWeakRef(dispatcher))
  28099. }
  28100. [kFactory] (origin) {
  28101. const mockOptions = Object.assign({ agent: this }, this[kOptions])
  28102. return this[kOptions] && this[kOptions].connections === 1
  28103. ? new MockClient(origin, mockOptions)
  28104. : new MockPool(origin, mockOptions)
  28105. }
  28106. [kMockAgentGet] (origin) {
  28107. // First check if we can immediately find it
  28108. const ref = this[kClients].get(origin)
  28109. if (ref) {
  28110. return ref.deref()
  28111. }
  28112. // If the origin is not a string create a dummy parent pool and return to user
  28113. if (typeof origin !== 'string') {
  28114. const dispatcher = this[kFactory]('http://localhost:9999')
  28115. this[kMockAgentSet](origin, dispatcher)
  28116. return dispatcher
  28117. }
  28118. // If we match, create a pool and assign the same dispatches
  28119. for (const [keyMatcher, nonExplicitRef] of Array.from(this[kClients])) {
  28120. const nonExplicitDispatcher = nonExplicitRef.deref()
  28121. if (nonExplicitDispatcher && typeof keyMatcher !== 'string' && matchValue(keyMatcher, origin)) {
  28122. const dispatcher = this[kFactory](origin)
  28123. this[kMockAgentSet](origin, dispatcher)
  28124. dispatcher[kDispatches] = nonExplicitDispatcher[kDispatches]
  28125. return dispatcher
  28126. }
  28127. }
  28128. }
  28129. [kGetNetConnect] () {
  28130. return this[kNetConnect]
  28131. }
  28132. pendingInterceptors () {
  28133. const mockAgentClients = this[kClients]
  28134. return Array.from(mockAgentClients.entries())
  28135. .flatMap(([origin, scope]) => scope.deref()[kDispatches].map(dispatch => ({ ...dispatch, origin })))
  28136. .filter(({ pending }) => pending)
  28137. }
  28138. assertNoPendingInterceptors ({ pendingInterceptorsFormatter = new PendingInterceptorsFormatter() } = {}) {
  28139. const pending = this.pendingInterceptors()
  28140. if (pending.length === 0) {
  28141. return
  28142. }
  28143. const pluralizer = new Pluralizer('interceptor', 'interceptors').pluralize(pending.length)
  28144. throw new UndiciError(`
  28145. ${pluralizer.count} ${pluralizer.noun} ${pluralizer.is} pending:
  28146. ${pendingInterceptorsFormatter.format(pending)}
  28147. `.trim())
  28148. }
  28149. }
  28150. module.exports = MockAgent
  28151. /***/ }),
  28152. /***/ 8687:
  28153. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28154. "use strict";
  28155. const { promisify } = __nccwpck_require__(3837)
  28156. const Client = __nccwpck_require__(3598)
  28157. const { buildMockDispatch } = __nccwpck_require__(9323)
  28158. const {
  28159. kDispatches,
  28160. kMockAgent,
  28161. kClose,
  28162. kOriginalClose,
  28163. kOrigin,
  28164. kOriginalDispatch,
  28165. kConnected
  28166. } = __nccwpck_require__(4347)
  28167. const { MockInterceptor } = __nccwpck_require__(410)
  28168. const Symbols = __nccwpck_require__(2785)
  28169. const { InvalidArgumentError } = __nccwpck_require__(8045)
  28170. /**
  28171. * MockClient provides an API that extends the Client to influence the mockDispatches.
  28172. */
  28173. class MockClient extends Client {
  28174. constructor (origin, opts) {
  28175. super(origin, opts)
  28176. if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') {
  28177. throw new InvalidArgumentError('Argument opts.agent must implement Agent')
  28178. }
  28179. this[kMockAgent] = opts.agent
  28180. this[kOrigin] = origin
  28181. this[kDispatches] = []
  28182. this[kConnected] = 1
  28183. this[kOriginalDispatch] = this.dispatch
  28184. this[kOriginalClose] = this.close.bind(this)
  28185. this.dispatch = buildMockDispatch.call(this)
  28186. this.close = this[kClose]
  28187. }
  28188. get [Symbols.kConnected] () {
  28189. return this[kConnected]
  28190. }
  28191. /**
  28192. * Sets up the base interceptor for mocking replies from undici.
  28193. */
  28194. intercept (opts) {
  28195. return new MockInterceptor(opts, this[kDispatches])
  28196. }
  28197. async [kClose] () {
  28198. await promisify(this[kOriginalClose])()
  28199. this[kConnected] = 0
  28200. this[kMockAgent][Symbols.kClients].delete(this[kOrigin])
  28201. }
  28202. }
  28203. module.exports = MockClient
  28204. /***/ }),
  28205. /***/ 888:
  28206. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28207. "use strict";
  28208. const { UndiciError } = __nccwpck_require__(8045)
  28209. class MockNotMatchedError extends UndiciError {
  28210. constructor (message) {
  28211. super(message)
  28212. Error.captureStackTrace(this, MockNotMatchedError)
  28213. this.name = 'MockNotMatchedError'
  28214. this.message = message || 'The request does not match any registered mock dispatches'
  28215. this.code = 'UND_MOCK_ERR_MOCK_NOT_MATCHED'
  28216. }
  28217. }
  28218. module.exports = {
  28219. MockNotMatchedError
  28220. }
  28221. /***/ }),
  28222. /***/ 410:
  28223. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28224. "use strict";
  28225. const { getResponseData, buildKey, addMockDispatch } = __nccwpck_require__(9323)
  28226. const {
  28227. kDispatches,
  28228. kDispatchKey,
  28229. kDefaultHeaders,
  28230. kDefaultTrailers,
  28231. kContentLength,
  28232. kMockDispatch
  28233. } = __nccwpck_require__(4347)
  28234. const { InvalidArgumentError } = __nccwpck_require__(8045)
  28235. const { buildURL } = __nccwpck_require__(3983)
  28236. /**
  28237. * Defines the scope API for an interceptor reply
  28238. */
  28239. class MockScope {
  28240. constructor (mockDispatch) {
  28241. this[kMockDispatch] = mockDispatch
  28242. }
  28243. /**
  28244. * Delay a reply by a set amount in ms.
  28245. */
  28246. delay (waitInMs) {
  28247. if (typeof waitInMs !== 'number' || !Number.isInteger(waitInMs) || waitInMs <= 0) {
  28248. throw new InvalidArgumentError('waitInMs must be a valid integer > 0')
  28249. }
  28250. this[kMockDispatch].delay = waitInMs
  28251. return this
  28252. }
  28253. /**
  28254. * For a defined reply, never mark as consumed.
  28255. */
  28256. persist () {
  28257. this[kMockDispatch].persist = true
  28258. return this
  28259. }
  28260. /**
  28261. * Allow one to define a reply for a set amount of matching requests.
  28262. */
  28263. times (repeatTimes) {
  28264. if (typeof repeatTimes !== 'number' || !Number.isInteger(repeatTimes) || repeatTimes <= 0) {
  28265. throw new InvalidArgumentError('repeatTimes must be a valid integer > 0')
  28266. }
  28267. this[kMockDispatch].times = repeatTimes
  28268. return this
  28269. }
  28270. }
  28271. /**
  28272. * Defines an interceptor for a Mock
  28273. */
  28274. class MockInterceptor {
  28275. constructor (opts, mockDispatches) {
  28276. if (typeof opts !== 'object') {
  28277. throw new InvalidArgumentError('opts must be an object')
  28278. }
  28279. if (typeof opts.path === 'undefined') {
  28280. throw new InvalidArgumentError('opts.path must be defined')
  28281. }
  28282. if (typeof opts.method === 'undefined') {
  28283. opts.method = 'GET'
  28284. }
  28285. // See https://github.com/nodejs/undici/issues/1245
  28286. // As per RFC 3986, clients are not supposed to send URI
  28287. // fragments to servers when they retrieve a document,
  28288. if (typeof opts.path === 'string') {
  28289. if (opts.query) {
  28290. opts.path = buildURL(opts.path, opts.query)
  28291. } else {
  28292. // Matches https://github.com/nodejs/undici/blob/main/lib/fetch/index.js#L1811
  28293. const parsedURL = new URL(opts.path, 'data://')
  28294. opts.path = parsedURL.pathname + parsedURL.search
  28295. }
  28296. }
  28297. if (typeof opts.method === 'string') {
  28298. opts.method = opts.method.toUpperCase()
  28299. }
  28300. this[kDispatchKey] = buildKey(opts)
  28301. this[kDispatches] = mockDispatches
  28302. this[kDefaultHeaders] = {}
  28303. this[kDefaultTrailers] = {}
  28304. this[kContentLength] = false
  28305. }
  28306. createMockScopeDispatchData (statusCode, data, responseOptions = {}) {
  28307. const responseData = getResponseData(data)
  28308. const contentLength = this[kContentLength] ? { 'content-length': responseData.length } : {}
  28309. const headers = { ...this[kDefaultHeaders], ...contentLength, ...responseOptions.headers }
  28310. const trailers = { ...this[kDefaultTrailers], ...responseOptions.trailers }
  28311. return { statusCode, data, headers, trailers }
  28312. }
  28313. validateReplyParameters (statusCode, data, responseOptions) {
  28314. if (typeof statusCode === 'undefined') {
  28315. throw new InvalidArgumentError('statusCode must be defined')
  28316. }
  28317. if (typeof data === 'undefined') {
  28318. throw new InvalidArgumentError('data must be defined')
  28319. }
  28320. if (typeof responseOptions !== 'object') {
  28321. throw new InvalidArgumentError('responseOptions must be an object')
  28322. }
  28323. }
  28324. /**
  28325. * Mock an undici request with a defined reply.
  28326. */
  28327. reply (replyData) {
  28328. // Values of reply aren't available right now as they
  28329. // can only be available when the reply callback is invoked.
  28330. if (typeof replyData === 'function') {
  28331. // We'll first wrap the provided callback in another function,
  28332. // this function will properly resolve the data from the callback
  28333. // when invoked.
  28334. const wrappedDefaultsCallback = (opts) => {
  28335. // Our reply options callback contains the parameter for statusCode, data and options.
  28336. const resolvedData = replyData(opts)
  28337. // Check if it is in the right format
  28338. if (typeof resolvedData !== 'object') {
  28339. throw new InvalidArgumentError('reply options callback must return an object')
  28340. }
  28341. const { statusCode, data = '', responseOptions = {} } = resolvedData
  28342. this.validateReplyParameters(statusCode, data, responseOptions)
  28343. // Since the values can be obtained immediately we return them
  28344. // from this higher order function that will be resolved later.
  28345. return {
  28346. ...this.createMockScopeDispatchData(statusCode, data, responseOptions)
  28347. }
  28348. }
  28349. // Add usual dispatch data, but this time set the data parameter to function that will eventually provide data.
  28350. const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], wrappedDefaultsCallback)
  28351. return new MockScope(newMockDispatch)
  28352. }
  28353. // We can have either one or three parameters, if we get here,
  28354. // we should have 1-3 parameters. So we spread the arguments of
  28355. // this function to obtain the parameters, since replyData will always
  28356. // just be the statusCode.
  28357. const [statusCode, data = '', responseOptions = {}] = [...arguments]
  28358. this.validateReplyParameters(statusCode, data, responseOptions)
  28359. // Send in-already provided data like usual
  28360. const dispatchData = this.createMockScopeDispatchData(statusCode, data, responseOptions)
  28361. const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], dispatchData)
  28362. return new MockScope(newMockDispatch)
  28363. }
  28364. /**
  28365. * Mock an undici request with a defined error.
  28366. */
  28367. replyWithError (error) {
  28368. if (typeof error === 'undefined') {
  28369. throw new InvalidArgumentError('error must be defined')
  28370. }
  28371. const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error })
  28372. return new MockScope(newMockDispatch)
  28373. }
  28374. /**
  28375. * Set default reply headers on the interceptor for subsequent replies
  28376. */
  28377. defaultReplyHeaders (headers) {
  28378. if (typeof headers === 'undefined') {
  28379. throw new InvalidArgumentError('headers must be defined')
  28380. }
  28381. this[kDefaultHeaders] = headers
  28382. return this
  28383. }
  28384. /**
  28385. * Set default reply trailers on the interceptor for subsequent replies
  28386. */
  28387. defaultReplyTrailers (trailers) {
  28388. if (typeof trailers === 'undefined') {
  28389. throw new InvalidArgumentError('trailers must be defined')
  28390. }
  28391. this[kDefaultTrailers] = trailers
  28392. return this
  28393. }
  28394. /**
  28395. * Set reply content length header for replies on the interceptor
  28396. */
  28397. replyContentLength () {
  28398. this[kContentLength] = true
  28399. return this
  28400. }
  28401. }
  28402. module.exports.MockInterceptor = MockInterceptor
  28403. module.exports.MockScope = MockScope
  28404. /***/ }),
  28405. /***/ 6193:
  28406. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28407. "use strict";
  28408. const { promisify } = __nccwpck_require__(3837)
  28409. const Pool = __nccwpck_require__(4634)
  28410. const { buildMockDispatch } = __nccwpck_require__(9323)
  28411. const {
  28412. kDispatches,
  28413. kMockAgent,
  28414. kClose,
  28415. kOriginalClose,
  28416. kOrigin,
  28417. kOriginalDispatch,
  28418. kConnected
  28419. } = __nccwpck_require__(4347)
  28420. const { MockInterceptor } = __nccwpck_require__(410)
  28421. const Symbols = __nccwpck_require__(2785)
  28422. const { InvalidArgumentError } = __nccwpck_require__(8045)
  28423. /**
  28424. * MockPool provides an API that extends the Pool to influence the mockDispatches.
  28425. */
  28426. class MockPool extends Pool {
  28427. constructor (origin, opts) {
  28428. super(origin, opts)
  28429. if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') {
  28430. throw new InvalidArgumentError('Argument opts.agent must implement Agent')
  28431. }
  28432. this[kMockAgent] = opts.agent
  28433. this[kOrigin] = origin
  28434. this[kDispatches] = []
  28435. this[kConnected] = 1
  28436. this[kOriginalDispatch] = this.dispatch
  28437. this[kOriginalClose] = this.close.bind(this)
  28438. this.dispatch = buildMockDispatch.call(this)
  28439. this.close = this[kClose]
  28440. }
  28441. get [Symbols.kConnected] () {
  28442. return this[kConnected]
  28443. }
  28444. /**
  28445. * Sets up the base interceptor for mocking replies from undici.
  28446. */
  28447. intercept (opts) {
  28448. return new MockInterceptor(opts, this[kDispatches])
  28449. }
  28450. async [kClose] () {
  28451. await promisify(this[kOriginalClose])()
  28452. this[kConnected] = 0
  28453. this[kMockAgent][Symbols.kClients].delete(this[kOrigin])
  28454. }
  28455. }
  28456. module.exports = MockPool
  28457. /***/ }),
  28458. /***/ 4347:
  28459. /***/ ((module) => {
  28460. "use strict";
  28461. module.exports = {
  28462. kAgent: Symbol('agent'),
  28463. kOptions: Symbol('options'),
  28464. kFactory: Symbol('factory'),
  28465. kDispatches: Symbol('dispatches'),
  28466. kDispatchKey: Symbol('dispatch key'),
  28467. kDefaultHeaders: Symbol('default headers'),
  28468. kDefaultTrailers: Symbol('default trailers'),
  28469. kContentLength: Symbol('content length'),
  28470. kMockAgent: Symbol('mock agent'),
  28471. kMockAgentSet: Symbol('mock agent set'),
  28472. kMockAgentGet: Symbol('mock agent get'),
  28473. kMockDispatch: Symbol('mock dispatch'),
  28474. kClose: Symbol('close'),
  28475. kOriginalClose: Symbol('original agent close'),
  28476. kOrigin: Symbol('origin'),
  28477. kIsMockActive: Symbol('is mock active'),
  28478. kNetConnect: Symbol('net connect'),
  28479. kGetNetConnect: Symbol('get net connect'),
  28480. kConnected: Symbol('connected')
  28481. }
  28482. /***/ }),
  28483. /***/ 9323:
  28484. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28485. "use strict";
  28486. const { MockNotMatchedError } = __nccwpck_require__(888)
  28487. const {
  28488. kDispatches,
  28489. kMockAgent,
  28490. kOriginalDispatch,
  28491. kOrigin,
  28492. kGetNetConnect
  28493. } = __nccwpck_require__(4347)
  28494. const { buildURL, nop } = __nccwpck_require__(3983)
  28495. const { STATUS_CODES } = __nccwpck_require__(3685)
  28496. const {
  28497. types: {
  28498. isPromise
  28499. }
  28500. } = __nccwpck_require__(3837)
  28501. function matchValue (match, value) {
  28502. if (typeof match === 'string') {
  28503. return match === value
  28504. }
  28505. if (match instanceof RegExp) {
  28506. return match.test(value)
  28507. }
  28508. if (typeof match === 'function') {
  28509. return match(value) === true
  28510. }
  28511. return false
  28512. }
  28513. function lowerCaseEntries (headers) {
  28514. return Object.fromEntries(
  28515. Object.entries(headers).map(([headerName, headerValue]) => {
  28516. return [headerName.toLocaleLowerCase(), headerValue]
  28517. })
  28518. )
  28519. }
  28520. /**
  28521. * @param {import('../../index').Headers|string[]|Record<string, string>} headers
  28522. * @param {string} key
  28523. */
  28524. function getHeaderByName (headers, key) {
  28525. if (Array.isArray(headers)) {
  28526. for (let i = 0; i < headers.length; i += 2) {
  28527. if (headers[i].toLocaleLowerCase() === key.toLocaleLowerCase()) {
  28528. return headers[i + 1]
  28529. }
  28530. }
  28531. return undefined
  28532. } else if (typeof headers.get === 'function') {
  28533. return headers.get(key)
  28534. } else {
  28535. return lowerCaseEntries(headers)[key.toLocaleLowerCase()]
  28536. }
  28537. }
  28538. /** @param {string[]} headers */
  28539. function buildHeadersFromArray (headers) { // fetch HeadersList
  28540. const clone = headers.slice()
  28541. const entries = []
  28542. for (let index = 0; index < clone.length; index += 2) {
  28543. entries.push([clone[index], clone[index + 1]])
  28544. }
  28545. return Object.fromEntries(entries)
  28546. }
  28547. function matchHeaders (mockDispatch, headers) {
  28548. if (typeof mockDispatch.headers === 'function') {
  28549. if (Array.isArray(headers)) { // fetch HeadersList
  28550. headers = buildHeadersFromArray(headers)
  28551. }
  28552. return mockDispatch.headers(headers ? lowerCaseEntries(headers) : {})
  28553. }
  28554. if (typeof mockDispatch.headers === 'undefined') {
  28555. return true
  28556. }
  28557. if (typeof headers !== 'object' || typeof mockDispatch.headers !== 'object') {
  28558. return false
  28559. }
  28560. for (const [matchHeaderName, matchHeaderValue] of Object.entries(mockDispatch.headers)) {
  28561. const headerValue = getHeaderByName(headers, matchHeaderName)
  28562. if (!matchValue(matchHeaderValue, headerValue)) {
  28563. return false
  28564. }
  28565. }
  28566. return true
  28567. }
  28568. function safeUrl (path) {
  28569. if (typeof path !== 'string') {
  28570. return path
  28571. }
  28572. const pathSegments = path.split('?')
  28573. if (pathSegments.length !== 2) {
  28574. return path
  28575. }
  28576. const qp = new URLSearchParams(pathSegments.pop())
  28577. qp.sort()
  28578. return [...pathSegments, qp.toString()].join('?')
  28579. }
  28580. function matchKey (mockDispatch, { path, method, body, headers }) {
  28581. const pathMatch = matchValue(mockDispatch.path, path)
  28582. const methodMatch = matchValue(mockDispatch.method, method)
  28583. const bodyMatch = typeof mockDispatch.body !== 'undefined' ? matchValue(mockDispatch.body, body) : true
  28584. const headersMatch = matchHeaders(mockDispatch, headers)
  28585. return pathMatch && methodMatch && bodyMatch && headersMatch
  28586. }
  28587. function getResponseData (data) {
  28588. if (Buffer.isBuffer(data)) {
  28589. return data
  28590. } else if (typeof data === 'object') {
  28591. return JSON.stringify(data)
  28592. } else {
  28593. return data.toString()
  28594. }
  28595. }
  28596. function getMockDispatch (mockDispatches, key) {
  28597. const basePath = key.query ? buildURL(key.path, key.query) : key.path
  28598. const resolvedPath = typeof basePath === 'string' ? safeUrl(basePath) : basePath
  28599. // Match path
  28600. let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path }) => matchValue(safeUrl(path), resolvedPath))
  28601. if (matchedMockDispatches.length === 0) {
  28602. throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`)
  28603. }
  28604. // Match method
  28605. matchedMockDispatches = matchedMockDispatches.filter(({ method }) => matchValue(method, key.method))
  28606. if (matchedMockDispatches.length === 0) {
  28607. throw new MockNotMatchedError(`Mock dispatch not matched for method '${key.method}'`)
  28608. }
  28609. // Match body
  28610. matchedMockDispatches = matchedMockDispatches.filter(({ body }) => typeof body !== 'undefined' ? matchValue(body, key.body) : true)
  28611. if (matchedMockDispatches.length === 0) {
  28612. throw new MockNotMatchedError(`Mock dispatch not matched for body '${key.body}'`)
  28613. }
  28614. // Match headers
  28615. matchedMockDispatches = matchedMockDispatches.filter((mockDispatch) => matchHeaders(mockDispatch, key.headers))
  28616. if (matchedMockDispatches.length === 0) {
  28617. throw new MockNotMatchedError(`Mock dispatch not matched for headers '${typeof key.headers === 'object' ? JSON.stringify(key.headers) : key.headers}'`)
  28618. }
  28619. return matchedMockDispatches[0]
  28620. }
  28621. function addMockDispatch (mockDispatches, key, data) {
  28622. const baseData = { timesInvoked: 0, times: 1, persist: false, consumed: false }
  28623. const replyData = typeof data === 'function' ? { callback: data } : { ...data }
  28624. const newMockDispatch = { ...baseData, ...key, pending: true, data: { error: null, ...replyData } }
  28625. mockDispatches.push(newMockDispatch)
  28626. return newMockDispatch
  28627. }
  28628. function deleteMockDispatch (mockDispatches, key) {
  28629. const index = mockDispatches.findIndex(dispatch => {
  28630. if (!dispatch.consumed) {
  28631. return false
  28632. }
  28633. return matchKey(dispatch, key)
  28634. })
  28635. if (index !== -1) {
  28636. mockDispatches.splice(index, 1)
  28637. }
  28638. }
  28639. function buildKey (opts) {
  28640. const { path, method, body, headers, query } = opts
  28641. return {
  28642. path,
  28643. method,
  28644. body,
  28645. headers,
  28646. query
  28647. }
  28648. }
  28649. function generateKeyValues (data) {
  28650. return Object.entries(data).reduce((keyValuePairs, [key, value]) => [
  28651. ...keyValuePairs,
  28652. Buffer.from(`${key}`),
  28653. Array.isArray(value) ? value.map(x => Buffer.from(`${x}`)) : Buffer.from(`${value}`)
  28654. ], [])
  28655. }
  28656. /**
  28657. * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
  28658. * @param {number} statusCode
  28659. */
  28660. function getStatusText (statusCode) {
  28661. return STATUS_CODES[statusCode] || 'unknown'
  28662. }
  28663. async function getResponse (body) {
  28664. const buffers = []
  28665. for await (const data of body) {
  28666. buffers.push(data)
  28667. }
  28668. return Buffer.concat(buffers).toString('utf8')
  28669. }
  28670. /**
  28671. * Mock dispatch function used to simulate undici dispatches
  28672. */
  28673. function mockDispatch (opts, handler) {
  28674. // Get mock dispatch from built key
  28675. const key = buildKey(opts)
  28676. const mockDispatch = getMockDispatch(this[kDispatches], key)
  28677. mockDispatch.timesInvoked++
  28678. // Here's where we resolve a callback if a callback is present for the dispatch data.
  28679. if (mockDispatch.data.callback) {
  28680. mockDispatch.data = { ...mockDispatch.data, ...mockDispatch.data.callback(opts) }
  28681. }
  28682. // Parse mockDispatch data
  28683. const { data: { statusCode, data, headers, trailers, error }, delay, persist } = mockDispatch
  28684. const { timesInvoked, times } = mockDispatch
  28685. // If it's used up and not persistent, mark as consumed
  28686. mockDispatch.consumed = !persist && timesInvoked >= times
  28687. mockDispatch.pending = timesInvoked < times
  28688. // If specified, trigger dispatch error
  28689. if (error !== null) {
  28690. deleteMockDispatch(this[kDispatches], key)
  28691. handler.onError(error)
  28692. return true
  28693. }
  28694. // Handle the request with a delay if necessary
  28695. if (typeof delay === 'number' && delay > 0) {
  28696. setTimeout(() => {
  28697. handleReply(this[kDispatches])
  28698. }, delay)
  28699. } else {
  28700. handleReply(this[kDispatches])
  28701. }
  28702. function handleReply (mockDispatches, _data = data) {
  28703. // fetch's HeadersList is a 1D string array
  28704. const optsHeaders = Array.isArray(opts.headers)
  28705. ? buildHeadersFromArray(opts.headers)
  28706. : opts.headers
  28707. const body = typeof _data === 'function'
  28708. ? _data({ ...opts, headers: optsHeaders })
  28709. : _data
  28710. // util.types.isPromise is likely needed for jest.
  28711. if (isPromise(body)) {
  28712. // If handleReply is asynchronous, throwing an error
  28713. // in the callback will reject the promise, rather than
  28714. // synchronously throw the error, which breaks some tests.
  28715. // Rather, we wait for the callback to resolve if it is a
  28716. // promise, and then re-run handleReply with the new body.
  28717. body.then((newData) => handleReply(mockDispatches, newData))
  28718. return
  28719. }
  28720. const responseData = getResponseData(body)
  28721. const responseHeaders = generateKeyValues(headers)
  28722. const responseTrailers = generateKeyValues(trailers)
  28723. handler.abort = nop
  28724. handler.onHeaders(statusCode, responseHeaders, resume, getStatusText(statusCode))
  28725. handler.onData(Buffer.from(responseData))
  28726. handler.onComplete(responseTrailers)
  28727. deleteMockDispatch(mockDispatches, key)
  28728. }
  28729. function resume () {}
  28730. return true
  28731. }
  28732. function buildMockDispatch () {
  28733. const agent = this[kMockAgent]
  28734. const origin = this[kOrigin]
  28735. const originalDispatch = this[kOriginalDispatch]
  28736. return function dispatch (opts, handler) {
  28737. if (agent.isMockActive) {
  28738. try {
  28739. mockDispatch.call(this, opts, handler)
  28740. } catch (error) {
  28741. if (error instanceof MockNotMatchedError) {
  28742. const netConnect = agent[kGetNetConnect]()
  28743. if (netConnect === false) {
  28744. throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`)
  28745. }
  28746. if (checkNetConnect(netConnect, origin)) {
  28747. originalDispatch.call(this, opts, handler)
  28748. } else {
  28749. throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`)
  28750. }
  28751. } else {
  28752. throw error
  28753. }
  28754. }
  28755. } else {
  28756. originalDispatch.call(this, opts, handler)
  28757. }
  28758. }
  28759. }
  28760. function checkNetConnect (netConnect, origin) {
  28761. const url = new URL(origin)
  28762. if (netConnect === true) {
  28763. return true
  28764. } else if (Array.isArray(netConnect) && netConnect.some((matcher) => matchValue(matcher, url.host))) {
  28765. return true
  28766. }
  28767. return false
  28768. }
  28769. function buildMockOptions (opts) {
  28770. if (opts) {
  28771. const { agent, ...mockOptions } = opts
  28772. return mockOptions
  28773. }
  28774. }
  28775. module.exports = {
  28776. getResponseData,
  28777. getMockDispatch,
  28778. addMockDispatch,
  28779. deleteMockDispatch,
  28780. buildKey,
  28781. generateKeyValues,
  28782. matchValue,
  28783. getResponse,
  28784. getStatusText,
  28785. mockDispatch,
  28786. buildMockDispatch,
  28787. checkNetConnect,
  28788. buildMockOptions,
  28789. getHeaderByName
  28790. }
  28791. /***/ }),
  28792. /***/ 6823:
  28793. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28794. "use strict";
  28795. const { Transform } = __nccwpck_require__(2781)
  28796. const { Console } = __nccwpck_require__(6206)
  28797. /**
  28798. * Gets the output of `console.table(…)` as a string.
  28799. */
  28800. module.exports = class PendingInterceptorsFormatter {
  28801. constructor ({ disableColors } = {}) {
  28802. this.transform = new Transform({
  28803. transform (chunk, _enc, cb) {
  28804. cb(null, chunk)
  28805. }
  28806. })
  28807. this.logger = new Console({
  28808. stdout: this.transform,
  28809. inspectOptions: {
  28810. colors: !disableColors && !process.env.CI
  28811. }
  28812. })
  28813. }
  28814. format (pendingInterceptors) {
  28815. const withPrettyHeaders = pendingInterceptors.map(
  28816. ({ method, path, data: { statusCode }, persist, times, timesInvoked, origin }) => ({
  28817. Method: method,
  28818. Origin: origin,
  28819. Path: path,
  28820. 'Status code': statusCode,
  28821. Persistent: persist ? '✅' : '❌',
  28822. Invocations: timesInvoked,
  28823. Remaining: persist ? Infinity : times - timesInvoked
  28824. }))
  28825. this.logger.table(withPrettyHeaders)
  28826. return this.transform.read().toString()
  28827. }
  28828. }
  28829. /***/ }),
  28830. /***/ 8891:
  28831. /***/ ((module) => {
  28832. "use strict";
  28833. const singulars = {
  28834. pronoun: 'it',
  28835. is: 'is',
  28836. was: 'was',
  28837. this: 'this'
  28838. }
  28839. const plurals = {
  28840. pronoun: 'they',
  28841. is: 'are',
  28842. was: 'were',
  28843. this: 'these'
  28844. }
  28845. module.exports = class Pluralizer {
  28846. constructor (singular, plural) {
  28847. this.singular = singular
  28848. this.plural = plural
  28849. }
  28850. pluralize (count) {
  28851. const one = count === 1
  28852. const keys = one ? singulars : plurals
  28853. const noun = one ? this.singular : this.plural
  28854. return { ...keys, count, noun }
  28855. }
  28856. }
  28857. /***/ }),
  28858. /***/ 8266:
  28859. /***/ ((module) => {
  28860. "use strict";
  28861. /* eslint-disable */
  28862. // Extracted from node/lib/internal/fixed_queue.js
  28863. // Currently optimal queue size, tested on V8 6.0 - 6.6. Must be power of two.
  28864. const kSize = 2048;
  28865. const kMask = kSize - 1;
  28866. // The FixedQueue is implemented as a singly-linked list of fixed-size
  28867. // circular buffers. It looks something like this:
  28868. //
  28869. // head tail
  28870. // | |
  28871. // v v
  28872. // +-----------+ <-----\ +-----------+ <------\ +-----------+
  28873. // | [null] | \----- | next | \------- | next |
  28874. // +-----------+ +-----------+ +-----------+
  28875. // | item | <-- bottom | item | <-- bottom | [empty] |
  28876. // | item | | item | | [empty] |
  28877. // | item | | item | | [empty] |
  28878. // | item | | item | | [empty] |
  28879. // | item | | item | bottom --> | item |
  28880. // | item | | item | | item |
  28881. // | ... | | ... | | ... |
  28882. // | item | | item | | item |
  28883. // | item | | item | | item |
  28884. // | [empty] | <-- top | item | | item |
  28885. // | [empty] | | item | | item |
  28886. // | [empty] | | [empty] | <-- top top --> | [empty] |
  28887. // +-----------+ +-----------+ +-----------+
  28888. //
  28889. // Or, if there is only one circular buffer, it looks something
  28890. // like either of these:
  28891. //
  28892. // head tail head tail
  28893. // | | | |
  28894. // v v v v
  28895. // +-----------+ +-----------+
  28896. // | [null] | | [null] |
  28897. // +-----------+ +-----------+
  28898. // | [empty] | | item |
  28899. // | [empty] | | item |
  28900. // | item | <-- bottom top --> | [empty] |
  28901. // | item | | [empty] |
  28902. // | [empty] | <-- top bottom --> | item |
  28903. // | [empty] | | item |
  28904. // +-----------+ +-----------+
  28905. //
  28906. // Adding a value means moving `top` forward by one, removing means
  28907. // moving `bottom` forward by one. After reaching the end, the queue
  28908. // wraps around.
  28909. //
  28910. // When `top === bottom` the current queue is empty and when
  28911. // `top + 1 === bottom` it's full. This wastes a single space of storage
  28912. // but allows much quicker checks.
  28913. class FixedCircularBuffer {
  28914. constructor() {
  28915. this.bottom = 0;
  28916. this.top = 0;
  28917. this.list = new Array(kSize);
  28918. this.next = null;
  28919. }
  28920. isEmpty() {
  28921. return this.top === this.bottom;
  28922. }
  28923. isFull() {
  28924. return ((this.top + 1) & kMask) === this.bottom;
  28925. }
  28926. push(data) {
  28927. this.list[this.top] = data;
  28928. this.top = (this.top + 1) & kMask;
  28929. }
  28930. shift() {
  28931. const nextItem = this.list[this.bottom];
  28932. if (nextItem === undefined)
  28933. return null;
  28934. this.list[this.bottom] = undefined;
  28935. this.bottom = (this.bottom + 1) & kMask;
  28936. return nextItem;
  28937. }
  28938. }
  28939. module.exports = class FixedQueue {
  28940. constructor() {
  28941. this.head = this.tail = new FixedCircularBuffer();
  28942. }
  28943. isEmpty() {
  28944. return this.head.isEmpty();
  28945. }
  28946. push(data) {
  28947. if (this.head.isFull()) {
  28948. // Head is full: Creates a new queue, sets the old queue's `.next` to it,
  28949. // and sets it as the new main queue.
  28950. this.head = this.head.next = new FixedCircularBuffer();
  28951. }
  28952. this.head.push(data);
  28953. }
  28954. shift() {
  28955. const tail = this.tail;
  28956. const next = tail.shift();
  28957. if (tail.isEmpty() && tail.next !== null) {
  28958. // If there is another queue, it forms the new tail.
  28959. this.tail = tail.next;
  28960. }
  28961. return next;
  28962. }
  28963. };
  28964. /***/ }),
  28965. /***/ 3198:
  28966. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28967. "use strict";
  28968. const DispatcherBase = __nccwpck_require__(4839)
  28969. const FixedQueue = __nccwpck_require__(8266)
  28970. const { kConnected, kSize, kRunning, kPending, kQueued, kBusy, kFree, kUrl, kClose, kDestroy, kDispatch } = __nccwpck_require__(2785)
  28971. const PoolStats = __nccwpck_require__(9689)
  28972. const kClients = Symbol('clients')
  28973. const kNeedDrain = Symbol('needDrain')
  28974. const kQueue = Symbol('queue')
  28975. const kClosedResolve = Symbol('closed resolve')
  28976. const kOnDrain = Symbol('onDrain')
  28977. const kOnConnect = Symbol('onConnect')
  28978. const kOnDisconnect = Symbol('onDisconnect')
  28979. const kOnConnectionError = Symbol('onConnectionError')
  28980. const kGetDispatcher = Symbol('get dispatcher')
  28981. const kAddClient = Symbol('add client')
  28982. const kRemoveClient = Symbol('remove client')
  28983. const kStats = Symbol('stats')
  28984. class PoolBase extends DispatcherBase {
  28985. constructor () {
  28986. super()
  28987. this[kQueue] = new FixedQueue()
  28988. this[kClients] = []
  28989. this[kQueued] = 0
  28990. const pool = this
  28991. this[kOnDrain] = function onDrain (origin, targets) {
  28992. const queue = pool[kQueue]
  28993. let needDrain = false
  28994. while (!needDrain) {
  28995. const item = queue.shift()
  28996. if (!item) {
  28997. break
  28998. }
  28999. pool[kQueued]--
  29000. needDrain = !this.dispatch(item.opts, item.handler)
  29001. }
  29002. this[kNeedDrain] = needDrain
  29003. if (!this[kNeedDrain] && pool[kNeedDrain]) {
  29004. pool[kNeedDrain] = false
  29005. pool.emit('drain', origin, [pool, ...targets])
  29006. }
  29007. if (pool[kClosedResolve] && queue.isEmpty()) {
  29008. Promise
  29009. .all(pool[kClients].map(c => c.close()))
  29010. .then(pool[kClosedResolve])
  29011. }
  29012. }
  29013. this[kOnConnect] = (origin, targets) => {
  29014. pool.emit('connect', origin, [pool, ...targets])
  29015. }
  29016. this[kOnDisconnect] = (origin, targets, err) => {
  29017. pool.emit('disconnect', origin, [pool, ...targets], err)
  29018. }
  29019. this[kOnConnectionError] = (origin, targets, err) => {
  29020. pool.emit('connectionError', origin, [pool, ...targets], err)
  29021. }
  29022. this[kStats] = new PoolStats(this)
  29023. }
  29024. get [kBusy] () {
  29025. return this[kNeedDrain]
  29026. }
  29027. get [kConnected] () {
  29028. return this[kClients].filter(client => client[kConnected]).length
  29029. }
  29030. get [kFree] () {
  29031. return this[kClients].filter(client => client[kConnected] && !client[kNeedDrain]).length
  29032. }
  29033. get [kPending] () {
  29034. let ret = this[kQueued]
  29035. for (const { [kPending]: pending } of this[kClients]) {
  29036. ret += pending
  29037. }
  29038. return ret
  29039. }
  29040. get [kRunning] () {
  29041. let ret = 0
  29042. for (const { [kRunning]: running } of this[kClients]) {
  29043. ret += running
  29044. }
  29045. return ret
  29046. }
  29047. get [kSize] () {
  29048. let ret = this[kQueued]
  29049. for (const { [kSize]: size } of this[kClients]) {
  29050. ret += size
  29051. }
  29052. return ret
  29053. }
  29054. get stats () {
  29055. return this[kStats]
  29056. }
  29057. async [kClose] () {
  29058. if (this[kQueue].isEmpty()) {
  29059. return Promise.all(this[kClients].map(c => c.close()))
  29060. } else {
  29061. return new Promise((resolve) => {
  29062. this[kClosedResolve] = resolve
  29063. })
  29064. }
  29065. }
  29066. async [kDestroy] (err) {
  29067. while (true) {
  29068. const item = this[kQueue].shift()
  29069. if (!item) {
  29070. break
  29071. }
  29072. item.handler.onError(err)
  29073. }
  29074. return Promise.all(this[kClients].map(c => c.destroy(err)))
  29075. }
  29076. [kDispatch] (opts, handler) {
  29077. const dispatcher = this[kGetDispatcher]()
  29078. if (!dispatcher) {
  29079. this[kNeedDrain] = true
  29080. this[kQueue].push({ opts, handler })
  29081. this[kQueued]++
  29082. } else if (!dispatcher.dispatch(opts, handler)) {
  29083. dispatcher[kNeedDrain] = true
  29084. this[kNeedDrain] = !this[kGetDispatcher]()
  29085. }
  29086. return !this[kNeedDrain]
  29087. }
  29088. [kAddClient] (client) {
  29089. client
  29090. .on('drain', this[kOnDrain])
  29091. .on('connect', this[kOnConnect])
  29092. .on('disconnect', this[kOnDisconnect])
  29093. .on('connectionError', this[kOnConnectionError])
  29094. this[kClients].push(client)
  29095. if (this[kNeedDrain]) {
  29096. process.nextTick(() => {
  29097. if (this[kNeedDrain]) {
  29098. this[kOnDrain](client[kUrl], [this, client])
  29099. }
  29100. })
  29101. }
  29102. return this
  29103. }
  29104. [kRemoveClient] (client) {
  29105. client.close(() => {
  29106. const idx = this[kClients].indexOf(client)
  29107. if (idx !== -1) {
  29108. this[kClients].splice(idx, 1)
  29109. }
  29110. })
  29111. this[kNeedDrain] = this[kClients].some(dispatcher => (
  29112. !dispatcher[kNeedDrain] &&
  29113. dispatcher.closed !== true &&
  29114. dispatcher.destroyed !== true
  29115. ))
  29116. }
  29117. }
  29118. module.exports = {
  29119. PoolBase,
  29120. kClients,
  29121. kNeedDrain,
  29122. kAddClient,
  29123. kRemoveClient,
  29124. kGetDispatcher
  29125. }
  29126. /***/ }),
  29127. /***/ 9689:
  29128. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  29129. const { kFree, kConnected, kPending, kQueued, kRunning, kSize } = __nccwpck_require__(2785)
  29130. const kPool = Symbol('pool')
  29131. class PoolStats {
  29132. constructor (pool) {
  29133. this[kPool] = pool
  29134. }
  29135. get connected () {
  29136. return this[kPool][kConnected]
  29137. }
  29138. get free () {
  29139. return this[kPool][kFree]
  29140. }
  29141. get pending () {
  29142. return this[kPool][kPending]
  29143. }
  29144. get queued () {
  29145. return this[kPool][kQueued]
  29146. }
  29147. get running () {
  29148. return this[kPool][kRunning]
  29149. }
  29150. get size () {
  29151. return this[kPool][kSize]
  29152. }
  29153. }
  29154. module.exports = PoolStats
  29155. /***/ }),
  29156. /***/ 4634:
  29157. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  29158. "use strict";
  29159. const {
  29160. PoolBase,
  29161. kClients,
  29162. kNeedDrain,
  29163. kAddClient,
  29164. kGetDispatcher
  29165. } = __nccwpck_require__(3198)
  29166. const Client = __nccwpck_require__(3598)
  29167. const {
  29168. InvalidArgumentError
  29169. } = __nccwpck_require__(8045)
  29170. const util = __nccwpck_require__(3983)
  29171. const { kUrl, kInterceptors } = __nccwpck_require__(2785)
  29172. const buildConnector = __nccwpck_require__(2067)
  29173. const kOptions = Symbol('options')
  29174. const kConnections = Symbol('connections')
  29175. const kFactory = Symbol('factory')
  29176. function defaultFactory (origin, opts) {
  29177. return new Client(origin, opts)
  29178. }
  29179. class Pool extends PoolBase {
  29180. constructor (origin, {
  29181. connections,
  29182. factory = defaultFactory,
  29183. connect,
  29184. connectTimeout,
  29185. tls,
  29186. maxCachedSessions,
  29187. socketPath,
  29188. autoSelectFamily,
  29189. autoSelectFamilyAttemptTimeout,
  29190. allowH2,
  29191. ...options
  29192. } = {}) {
  29193. super()
  29194. if (connections != null && (!Number.isFinite(connections) || connections < 0)) {
  29195. throw new InvalidArgumentError('invalid connections')
  29196. }
  29197. if (typeof factory !== 'function') {
  29198. throw new InvalidArgumentError('factory must be a function.')
  29199. }
  29200. if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {
  29201. throw new InvalidArgumentError('connect must be a function or an object')
  29202. }
  29203. if (typeof connect !== 'function') {
  29204. connect = buildConnector({
  29205. ...tls,
  29206. maxCachedSessions,
  29207. allowH2,
  29208. socketPath,
  29209. timeout: connectTimeout,
  29210. ...(util.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined),
  29211. ...connect
  29212. })
  29213. }
  29214. this[kInterceptors] = options.interceptors && options.interceptors.Pool && Array.isArray(options.interceptors.Pool)
  29215. ? options.interceptors.Pool
  29216. : []
  29217. this[kConnections] = connections || null
  29218. this[kUrl] = util.parseOrigin(origin)
  29219. this[kOptions] = { ...util.deepClone(options), connect, allowH2 }
  29220. this[kOptions].interceptors = options.interceptors
  29221. ? { ...options.interceptors }
  29222. : undefined
  29223. this[kFactory] = factory
  29224. this.on('connectionError', (origin, targets, error) => {
  29225. // If a connection error occurs, we remove the client from the pool,
  29226. // and emit a connectionError event. They will not be re-used.
  29227. // Fixes https://github.com/nodejs/undici/issues/3895
  29228. for (const target of targets) {
  29229. // Do not use kRemoveClient here, as it will close the client,
  29230. // but the client cannot be closed in this state.
  29231. const idx = this[kClients].indexOf(target)
  29232. if (idx !== -1) {
  29233. this[kClients].splice(idx, 1)
  29234. }
  29235. }
  29236. })
  29237. }
  29238. [kGetDispatcher] () {
  29239. let dispatcher = this[kClients].find(dispatcher => !dispatcher[kNeedDrain])
  29240. if (dispatcher) {
  29241. return dispatcher
  29242. }
  29243. if (!this[kConnections] || this[kClients].length < this[kConnections]) {
  29244. dispatcher = this[kFactory](this[kUrl], this[kOptions])
  29245. this[kAddClient](dispatcher)
  29246. }
  29247. return dispatcher
  29248. }
  29249. }
  29250. module.exports = Pool
  29251. /***/ }),
  29252. /***/ 7858:
  29253. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  29254. "use strict";
  29255. const { kProxy, kClose, kDestroy, kInterceptors } = __nccwpck_require__(2785)
  29256. const { URL } = __nccwpck_require__(7310)
  29257. const Agent = __nccwpck_require__(7890)
  29258. const Pool = __nccwpck_require__(4634)
  29259. const DispatcherBase = __nccwpck_require__(4839)
  29260. const { InvalidArgumentError, RequestAbortedError } = __nccwpck_require__(8045)
  29261. const buildConnector = __nccwpck_require__(2067)
  29262. const kAgent = Symbol('proxy agent')
  29263. const kClient = Symbol('proxy client')
  29264. const kProxyHeaders = Symbol('proxy headers')
  29265. const kRequestTls = Symbol('request tls settings')
  29266. const kProxyTls = Symbol('proxy tls settings')
  29267. const kConnectEndpoint = Symbol('connect endpoint function')
  29268. function defaultProtocolPort (protocol) {
  29269. return protocol === 'https:' ? 443 : 80
  29270. }
  29271. function buildProxyOptions (opts) {
  29272. if (typeof opts === 'string') {
  29273. opts = { uri: opts }
  29274. }
  29275. if (!opts || !opts.uri) {
  29276. throw new InvalidArgumentError('Proxy opts.uri is mandatory')
  29277. }
  29278. return {
  29279. uri: opts.uri,
  29280. protocol: opts.protocol || 'https'
  29281. }
  29282. }
  29283. function defaultFactory (origin, opts) {
  29284. return new Pool(origin, opts)
  29285. }
  29286. class ProxyAgent extends DispatcherBase {
  29287. constructor (opts) {
  29288. super(opts)
  29289. this[kProxy] = buildProxyOptions(opts)
  29290. this[kAgent] = new Agent(opts)
  29291. this[kInterceptors] = opts.interceptors && opts.interceptors.ProxyAgent && Array.isArray(opts.interceptors.ProxyAgent)
  29292. ? opts.interceptors.ProxyAgent
  29293. : []
  29294. if (typeof opts === 'string') {
  29295. opts = { uri: opts }
  29296. }
  29297. if (!opts || !opts.uri) {
  29298. throw new InvalidArgumentError('Proxy opts.uri is mandatory')
  29299. }
  29300. const { clientFactory = defaultFactory } = opts
  29301. if (typeof clientFactory !== 'function') {
  29302. throw new InvalidArgumentError('Proxy opts.clientFactory must be a function.')
  29303. }
  29304. this[kRequestTls] = opts.requestTls
  29305. this[kProxyTls] = opts.proxyTls
  29306. this[kProxyHeaders] = opts.headers || {}
  29307. const resolvedUrl = new URL(opts.uri)
  29308. const { origin, port, host, username, password } = resolvedUrl
  29309. if (opts.auth && opts.token) {
  29310. throw new InvalidArgumentError('opts.auth cannot be used in combination with opts.token')
  29311. } else if (opts.auth) {
  29312. /* @deprecated in favour of opts.token */
  29313. this[kProxyHeaders]['proxy-authorization'] = `Basic ${opts.auth}`
  29314. } else if (opts.token) {
  29315. this[kProxyHeaders]['proxy-authorization'] = opts.token
  29316. } else if (username && password) {
  29317. this[kProxyHeaders]['proxy-authorization'] = `Basic ${Buffer.from(`${decodeURIComponent(username)}:${decodeURIComponent(password)}`).toString('base64')}`
  29318. }
  29319. const connect = buildConnector({ ...opts.proxyTls })
  29320. this[kConnectEndpoint] = buildConnector({ ...opts.requestTls })
  29321. this[kClient] = clientFactory(resolvedUrl, { connect })
  29322. this[kAgent] = new Agent({
  29323. ...opts,
  29324. connect: async (opts, callback) => {
  29325. let requestedHost = opts.host
  29326. if (!opts.port) {
  29327. requestedHost += `:${defaultProtocolPort(opts.protocol)}`
  29328. }
  29329. try {
  29330. const { socket, statusCode } = await this[kClient].connect({
  29331. origin,
  29332. port,
  29333. path: requestedHost,
  29334. signal: opts.signal,
  29335. headers: {
  29336. ...this[kProxyHeaders],
  29337. host
  29338. }
  29339. })
  29340. if (statusCode !== 200) {
  29341. socket.on('error', () => {}).destroy()
  29342. callback(new RequestAbortedError(`Proxy response (${statusCode}) !== 200 when HTTP Tunneling`))
  29343. }
  29344. if (opts.protocol !== 'https:') {
  29345. callback(null, socket)
  29346. return
  29347. }
  29348. let servername
  29349. if (this[kRequestTls]) {
  29350. servername = this[kRequestTls].servername
  29351. } else {
  29352. servername = opts.servername
  29353. }
  29354. this[kConnectEndpoint]({ ...opts, servername, httpSocket: socket }, callback)
  29355. } catch (err) {
  29356. callback(err)
  29357. }
  29358. }
  29359. })
  29360. }
  29361. dispatch (opts, handler) {
  29362. const { host } = new URL(opts.origin)
  29363. const headers = buildHeaders(opts.headers)
  29364. throwIfProxyAuthIsSent(headers)
  29365. return this[kAgent].dispatch(
  29366. {
  29367. ...opts,
  29368. headers: {
  29369. ...headers,
  29370. host
  29371. }
  29372. },
  29373. handler
  29374. )
  29375. }
  29376. async [kClose] () {
  29377. await this[kAgent].close()
  29378. await this[kClient].close()
  29379. }
  29380. async [kDestroy] () {
  29381. await this[kAgent].destroy()
  29382. await this[kClient].destroy()
  29383. }
  29384. }
  29385. /**
  29386. * @param {string[] | Record<string, string>} headers
  29387. * @returns {Record<string, string>}
  29388. */
  29389. function buildHeaders (headers) {
  29390. // When using undici.fetch, the headers list is stored
  29391. // as an array.
  29392. if (Array.isArray(headers)) {
  29393. /** @type {Record<string, string>} */
  29394. const headersPair = {}
  29395. for (let i = 0; i < headers.length; i += 2) {
  29396. headersPair[headers[i]] = headers[i + 1]
  29397. }
  29398. return headersPair
  29399. }
  29400. return headers
  29401. }
  29402. /**
  29403. * @param {Record<string, string>} headers
  29404. *
  29405. * Previous versions of ProxyAgent suggests the Proxy-Authorization in request headers
  29406. * Nevertheless, it was changed and to avoid a security vulnerability by end users
  29407. * this check was created.
  29408. * It should be removed in the next major version for performance reasons
  29409. */
  29410. function throwIfProxyAuthIsSent (headers) {
  29411. const existProxyAuth = headers && Object.keys(headers)
  29412. .find((key) => key.toLowerCase() === 'proxy-authorization')
  29413. if (existProxyAuth) {
  29414. throw new InvalidArgumentError('Proxy-Authorization should be sent in ProxyAgent constructor')
  29415. }
  29416. }
  29417. module.exports = ProxyAgent
  29418. /***/ }),
  29419. /***/ 9459:
  29420. /***/ ((module) => {
  29421. "use strict";
  29422. let fastNow = Date.now()
  29423. let fastNowTimeout
  29424. const fastTimers = []
  29425. function onTimeout () {
  29426. fastNow = Date.now()
  29427. let len = fastTimers.length
  29428. let idx = 0
  29429. while (idx < len) {
  29430. const timer = fastTimers[idx]
  29431. if (timer.state === 0) {
  29432. timer.state = fastNow + timer.delay
  29433. } else if (timer.state > 0 && fastNow >= timer.state) {
  29434. timer.state = -1
  29435. timer.callback(timer.opaque)
  29436. }
  29437. if (timer.state === -1) {
  29438. timer.state = -2
  29439. if (idx !== len - 1) {
  29440. fastTimers[idx] = fastTimers.pop()
  29441. } else {
  29442. fastTimers.pop()
  29443. }
  29444. len -= 1
  29445. } else {
  29446. idx += 1
  29447. }
  29448. }
  29449. if (fastTimers.length > 0) {
  29450. refreshTimeout()
  29451. }
  29452. }
  29453. function refreshTimeout () {
  29454. if (fastNowTimeout && fastNowTimeout.refresh) {
  29455. fastNowTimeout.refresh()
  29456. } else {
  29457. clearTimeout(fastNowTimeout)
  29458. fastNowTimeout = setTimeout(onTimeout, 1e3)
  29459. if (fastNowTimeout.unref) {
  29460. fastNowTimeout.unref()
  29461. }
  29462. }
  29463. }
  29464. class Timeout {
  29465. constructor (callback, delay, opaque) {
  29466. this.callback = callback
  29467. this.delay = delay
  29468. this.opaque = opaque
  29469. // -2 not in timer list
  29470. // -1 in timer list but inactive
  29471. // 0 in timer list waiting for time
  29472. // > 0 in timer list waiting for time to expire
  29473. this.state = -2
  29474. this.refresh()
  29475. }
  29476. refresh () {
  29477. if (this.state === -2) {
  29478. fastTimers.push(this)
  29479. if (!fastNowTimeout || fastTimers.length === 1) {
  29480. refreshTimeout()
  29481. }
  29482. }
  29483. this.state = 0
  29484. }
  29485. clear () {
  29486. this.state = -1
  29487. }
  29488. }
  29489. module.exports = {
  29490. setTimeout (callback, delay, opaque) {
  29491. return delay < 1e3
  29492. ? setTimeout(callback, delay, opaque)
  29493. : new Timeout(callback, delay, opaque)
  29494. },
  29495. clearTimeout (timeout) {
  29496. if (timeout instanceof Timeout) {
  29497. timeout.clear()
  29498. } else {
  29499. clearTimeout(timeout)
  29500. }
  29501. }
  29502. }
  29503. /***/ }),
  29504. /***/ 5354:
  29505. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  29506. "use strict";
  29507. const diagnosticsChannel = __nccwpck_require__(7643)
  29508. const { uid, states } = __nccwpck_require__(9188)
  29509. const {
  29510. kReadyState,
  29511. kSentClose,
  29512. kByteParser,
  29513. kReceivedClose
  29514. } = __nccwpck_require__(7578)
  29515. const { fireEvent, failWebsocketConnection } = __nccwpck_require__(5515)
  29516. const { CloseEvent } = __nccwpck_require__(2611)
  29517. const { makeRequest } = __nccwpck_require__(8359)
  29518. const { fetching } = __nccwpck_require__(4881)
  29519. const { Headers } = __nccwpck_require__(554)
  29520. const { getGlobalDispatcher } = __nccwpck_require__(1892)
  29521. const { kHeadersList } = __nccwpck_require__(2785)
  29522. const channels = {}
  29523. channels.open = diagnosticsChannel.channel('undici:websocket:open')
  29524. channels.close = diagnosticsChannel.channel('undici:websocket:close')
  29525. channels.socketError = diagnosticsChannel.channel('undici:websocket:socket_error')
  29526. /** @type {import('crypto')} */
  29527. let crypto
  29528. try {
  29529. crypto = __nccwpck_require__(6113)
  29530. } catch {
  29531. }
  29532. /**
  29533. * @see https://websockets.spec.whatwg.org/#concept-websocket-establish
  29534. * @param {URL} url
  29535. * @param {string|string[]} protocols
  29536. * @param {import('./websocket').WebSocket} ws
  29537. * @param {(response: any) => void} onEstablish
  29538. * @param {Partial<import('../../types/websocket').WebSocketInit>} options
  29539. */
  29540. function establishWebSocketConnection (url, protocols, ws, onEstablish, options) {
  29541. // 1. Let requestURL be a copy of url, with its scheme set to "http", if url’s
  29542. // scheme is "ws", and to "https" otherwise.
  29543. const requestURL = url
  29544. requestURL.protocol = url.protocol === 'ws:' ? 'http:' : 'https:'
  29545. // 2. Let request be a new request, whose URL is requestURL, client is client,
  29546. // service-workers mode is "none", referrer is "no-referrer", mode is
  29547. // "websocket", credentials mode is "include", cache mode is "no-store" ,
  29548. // and redirect mode is "error".
  29549. const request = makeRequest({
  29550. urlList: [requestURL],
  29551. serviceWorkers: 'none',
  29552. referrer: 'no-referrer',
  29553. mode: 'websocket',
  29554. credentials: 'include',
  29555. cache: 'no-store',
  29556. redirect: 'error'
  29557. })
  29558. // Note: undici extension, allow setting custom headers.
  29559. if (options.headers) {
  29560. const headersList = new Headers(options.headers)[kHeadersList]
  29561. request.headersList = headersList
  29562. }
  29563. // 3. Append (`Upgrade`, `websocket`) to request’s header list.
  29564. // 4. Append (`Connection`, `Upgrade`) to request’s header list.
  29565. // Note: both of these are handled by undici currently.
  29566. // https://github.com/nodejs/undici/blob/68c269c4144c446f3f1220951338daef4a6b5ec4/lib/client.js#L1397
  29567. // 5. Let keyValue be a nonce consisting of a randomly selected
  29568. // 16-byte value that has been forgiving-base64-encoded and
  29569. // isomorphic encoded.
  29570. const keyValue = crypto.randomBytes(16).toString('base64')
  29571. // 6. Append (`Sec-WebSocket-Key`, keyValue) to request’s
  29572. // header list.
  29573. request.headersList.append('sec-websocket-key', keyValue)
  29574. // 7. Append (`Sec-WebSocket-Version`, `13`) to request’s
  29575. // header list.
  29576. request.headersList.append('sec-websocket-version', '13')
  29577. // 8. For each protocol in protocols, combine
  29578. // (`Sec-WebSocket-Protocol`, protocol) in request’s header
  29579. // list.
  29580. for (const protocol of protocols) {
  29581. request.headersList.append('sec-websocket-protocol', protocol)
  29582. }
  29583. // 9. Let permessageDeflate be a user-agent defined
  29584. // "permessage-deflate" extension header value.
  29585. // https://github.com/mozilla/gecko-dev/blob/ce78234f5e653a5d3916813ff990f053510227bc/netwerk/protocol/websocket/WebSocketChannel.cpp#L2673
  29586. // TODO: enable once permessage-deflate is supported
  29587. const permessageDeflate = '' // 'permessage-deflate; 15'
  29588. // 10. Append (`Sec-WebSocket-Extensions`, permessageDeflate) to
  29589. // request’s header list.
  29590. // request.headersList.append('sec-websocket-extensions', permessageDeflate)
  29591. // 11. Fetch request with useParallelQueue set to true, and
  29592. // processResponse given response being these steps:
  29593. const controller = fetching({
  29594. request,
  29595. useParallelQueue: true,
  29596. dispatcher: options.dispatcher ?? getGlobalDispatcher(),
  29597. processResponse (response) {
  29598. // 1. If response is a network error or its status is not 101,
  29599. // fail the WebSocket connection.
  29600. if (response.type === 'error' || response.status !== 101) {
  29601. failWebsocketConnection(ws, 'Received network error or non-101 status code.')
  29602. return
  29603. }
  29604. // 2. If protocols is not the empty list and extracting header
  29605. // list values given `Sec-WebSocket-Protocol` and response’s
  29606. // header list results in null, failure, or the empty byte
  29607. // sequence, then fail the WebSocket connection.
  29608. if (protocols.length !== 0 && !response.headersList.get('Sec-WebSocket-Protocol')) {
  29609. failWebsocketConnection(ws, 'Server did not respond with sent protocols.')
  29610. return
  29611. }
  29612. // 3. Follow the requirements stated step 2 to step 6, inclusive,
  29613. // of the last set of steps in section 4.1 of The WebSocket
  29614. // Protocol to validate response. This either results in fail
  29615. // the WebSocket connection or the WebSocket connection is
  29616. // established.
  29617. // 2. If the response lacks an |Upgrade| header field or the |Upgrade|
  29618. // header field contains a value that is not an ASCII case-
  29619. // insensitive match for the value "websocket", the client MUST
  29620. // _Fail the WebSocket Connection_.
  29621. if (response.headersList.get('Upgrade')?.toLowerCase() !== 'websocket') {
  29622. failWebsocketConnection(ws, 'Server did not set Upgrade header to "websocket".')
  29623. return
  29624. }
  29625. // 3. If the response lacks a |Connection| header field or the
  29626. // |Connection| header field doesn't contain a token that is an
  29627. // ASCII case-insensitive match for the value "Upgrade", the client
  29628. // MUST _Fail the WebSocket Connection_.
  29629. if (response.headersList.get('Connection')?.toLowerCase() !== 'upgrade') {
  29630. failWebsocketConnection(ws, 'Server did not set Connection header to "upgrade".')
  29631. return
  29632. }
  29633. // 4. If the response lacks a |Sec-WebSocket-Accept| header field or
  29634. // the |Sec-WebSocket-Accept| contains a value other than the
  29635. // base64-encoded SHA-1 of the concatenation of the |Sec-WebSocket-
  29636. // Key| (as a string, not base64-decoded) with the string "258EAFA5-
  29637. // E914-47DA-95CA-C5AB0DC85B11" but ignoring any leading and
  29638. // trailing whitespace, the client MUST _Fail the WebSocket
  29639. // Connection_.
  29640. const secWSAccept = response.headersList.get('Sec-WebSocket-Accept')
  29641. const digest = crypto.createHash('sha1').update(keyValue + uid).digest('base64')
  29642. if (secWSAccept !== digest) {
  29643. failWebsocketConnection(ws, 'Incorrect hash received in Sec-WebSocket-Accept header.')
  29644. return
  29645. }
  29646. // 5. If the response includes a |Sec-WebSocket-Extensions| header
  29647. // field and this header field indicates the use of an extension
  29648. // that was not present in the client's handshake (the server has
  29649. // indicated an extension not requested by the client), the client
  29650. // MUST _Fail the WebSocket Connection_. (The parsing of this
  29651. // header field to determine which extensions are requested is
  29652. // discussed in Section 9.1.)
  29653. const secExtension = response.headersList.get('Sec-WebSocket-Extensions')
  29654. if (secExtension !== null && secExtension !== permessageDeflate) {
  29655. failWebsocketConnection(ws, 'Received different permessage-deflate than the one set.')
  29656. return
  29657. }
  29658. // 6. If the response includes a |Sec-WebSocket-Protocol| header field
  29659. // and this header field indicates the use of a subprotocol that was
  29660. // not present in the client's handshake (the server has indicated a
  29661. // subprotocol not requested by the client), the client MUST _Fail
  29662. // the WebSocket Connection_.
  29663. const secProtocol = response.headersList.get('Sec-WebSocket-Protocol')
  29664. if (secProtocol !== null && secProtocol !== request.headersList.get('Sec-WebSocket-Protocol')) {
  29665. failWebsocketConnection(ws, 'Protocol was not set in the opening handshake.')
  29666. return
  29667. }
  29668. response.socket.on('data', onSocketData)
  29669. response.socket.on('close', onSocketClose)
  29670. response.socket.on('error', onSocketError)
  29671. if (channels.open.hasSubscribers) {
  29672. channels.open.publish({
  29673. address: response.socket.address(),
  29674. protocol: secProtocol,
  29675. extensions: secExtension
  29676. })
  29677. }
  29678. onEstablish(response)
  29679. }
  29680. })
  29681. return controller
  29682. }
  29683. /**
  29684. * @param {Buffer} chunk
  29685. */
  29686. function onSocketData (chunk) {
  29687. if (!this.ws[kByteParser].write(chunk)) {
  29688. this.pause()
  29689. }
  29690. }
  29691. /**
  29692. * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol
  29693. * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.4
  29694. */
  29695. function onSocketClose () {
  29696. const { ws } = this
  29697. // If the TCP connection was closed after the
  29698. // WebSocket closing handshake was completed, the WebSocket connection
  29699. // is said to have been closed _cleanly_.
  29700. const wasClean = ws[kSentClose] && ws[kReceivedClose]
  29701. let code = 1005
  29702. let reason = ''
  29703. const result = ws[kByteParser].closingInfo
  29704. if (result) {
  29705. code = result.code ?? 1005
  29706. reason = result.reason
  29707. } else if (!ws[kSentClose]) {
  29708. // If _The WebSocket
  29709. // Connection is Closed_ and no Close control frame was received by the
  29710. // endpoint (such as could occur if the underlying transport connection
  29711. // is lost), _The WebSocket Connection Close Code_ is considered to be
  29712. // 1006.
  29713. code = 1006
  29714. }
  29715. // 1. Change the ready state to CLOSED (3).
  29716. ws[kReadyState] = states.CLOSED
  29717. // 2. If the user agent was required to fail the WebSocket
  29718. // connection, or if the WebSocket connection was closed
  29719. // after being flagged as full, fire an event named error
  29720. // at the WebSocket object.
  29721. // TODO
  29722. // 3. Fire an event named close at the WebSocket object,
  29723. // using CloseEvent, with the wasClean attribute
  29724. // initialized to true if the connection closed cleanly
  29725. // and false otherwise, the code attribute initialized to
  29726. // the WebSocket connection close code, and the reason
  29727. // attribute initialized to the result of applying UTF-8
  29728. // decode without BOM to the WebSocket connection close
  29729. // reason.
  29730. fireEvent('close', ws, CloseEvent, {
  29731. wasClean, code, reason
  29732. })
  29733. if (channels.close.hasSubscribers) {
  29734. channels.close.publish({
  29735. websocket: ws,
  29736. code,
  29737. reason
  29738. })
  29739. }
  29740. }
  29741. function onSocketError (error) {
  29742. const { ws } = this
  29743. ws[kReadyState] = states.CLOSING
  29744. if (channels.socketError.hasSubscribers) {
  29745. channels.socketError.publish(error)
  29746. }
  29747. this.destroy()
  29748. }
  29749. module.exports = {
  29750. establishWebSocketConnection
  29751. }
  29752. /***/ }),
  29753. /***/ 9188:
  29754. /***/ ((module) => {
  29755. "use strict";
  29756. // This is a Globally Unique Identifier unique used
  29757. // to validate that the endpoint accepts websocket
  29758. // connections.
  29759. // See https://www.rfc-editor.org/rfc/rfc6455.html#section-1.3
  29760. const uid = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'
  29761. /** @type {PropertyDescriptor} */
  29762. const staticPropertyDescriptors = {
  29763. enumerable: true,
  29764. writable: false,
  29765. configurable: false
  29766. }
  29767. const states = {
  29768. CONNECTING: 0,
  29769. OPEN: 1,
  29770. CLOSING: 2,
  29771. CLOSED: 3
  29772. }
  29773. const opcodes = {
  29774. CONTINUATION: 0x0,
  29775. TEXT: 0x1,
  29776. BINARY: 0x2,
  29777. CLOSE: 0x8,
  29778. PING: 0x9,
  29779. PONG: 0xA
  29780. }
  29781. const maxUnsigned16Bit = 2 ** 16 - 1 // 65535
  29782. const parserStates = {
  29783. INFO: 0,
  29784. PAYLOADLENGTH_16: 2,
  29785. PAYLOADLENGTH_64: 3,
  29786. READ_DATA: 4
  29787. }
  29788. const emptyBuffer = Buffer.allocUnsafe(0)
  29789. module.exports = {
  29790. uid,
  29791. staticPropertyDescriptors,
  29792. states,
  29793. opcodes,
  29794. maxUnsigned16Bit,
  29795. parserStates,
  29796. emptyBuffer
  29797. }
  29798. /***/ }),
  29799. /***/ 2611:
  29800. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  29801. "use strict";
  29802. const { webidl } = __nccwpck_require__(1744)
  29803. const { kEnumerableProperty } = __nccwpck_require__(3983)
  29804. const { MessagePort } = __nccwpck_require__(1267)
  29805. /**
  29806. * @see https://html.spec.whatwg.org/multipage/comms.html#messageevent
  29807. */
  29808. class MessageEvent extends Event {
  29809. #eventInit
  29810. constructor (type, eventInitDict = {}) {
  29811. webidl.argumentLengthCheck(arguments, 1, { header: 'MessageEvent constructor' })
  29812. type = webidl.converters.DOMString(type)
  29813. eventInitDict = webidl.converters.MessageEventInit(eventInitDict)
  29814. super(type, eventInitDict)
  29815. this.#eventInit = eventInitDict
  29816. }
  29817. get data () {
  29818. webidl.brandCheck(this, MessageEvent)
  29819. return this.#eventInit.data
  29820. }
  29821. get origin () {
  29822. webidl.brandCheck(this, MessageEvent)
  29823. return this.#eventInit.origin
  29824. }
  29825. get lastEventId () {
  29826. webidl.brandCheck(this, MessageEvent)
  29827. return this.#eventInit.lastEventId
  29828. }
  29829. get source () {
  29830. webidl.brandCheck(this, MessageEvent)
  29831. return this.#eventInit.source
  29832. }
  29833. get ports () {
  29834. webidl.brandCheck(this, MessageEvent)
  29835. if (!Object.isFrozen(this.#eventInit.ports)) {
  29836. Object.freeze(this.#eventInit.ports)
  29837. }
  29838. return this.#eventInit.ports
  29839. }
  29840. initMessageEvent (
  29841. type,
  29842. bubbles = false,
  29843. cancelable = false,
  29844. data = null,
  29845. origin = '',
  29846. lastEventId = '',
  29847. source = null,
  29848. ports = []
  29849. ) {
  29850. webidl.brandCheck(this, MessageEvent)
  29851. webidl.argumentLengthCheck(arguments, 1, { header: 'MessageEvent.initMessageEvent' })
  29852. return new MessageEvent(type, {
  29853. bubbles, cancelable, data, origin, lastEventId, source, ports
  29854. })
  29855. }
  29856. }
  29857. /**
  29858. * @see https://websockets.spec.whatwg.org/#the-closeevent-interface
  29859. */
  29860. class CloseEvent extends Event {
  29861. #eventInit
  29862. constructor (type, eventInitDict = {}) {
  29863. webidl.argumentLengthCheck(arguments, 1, { header: 'CloseEvent constructor' })
  29864. type = webidl.converters.DOMString(type)
  29865. eventInitDict = webidl.converters.CloseEventInit(eventInitDict)
  29866. super(type, eventInitDict)
  29867. this.#eventInit = eventInitDict
  29868. }
  29869. get wasClean () {
  29870. webidl.brandCheck(this, CloseEvent)
  29871. return this.#eventInit.wasClean
  29872. }
  29873. get code () {
  29874. webidl.brandCheck(this, CloseEvent)
  29875. return this.#eventInit.code
  29876. }
  29877. get reason () {
  29878. webidl.brandCheck(this, CloseEvent)
  29879. return this.#eventInit.reason
  29880. }
  29881. }
  29882. // https://html.spec.whatwg.org/multipage/webappapis.html#the-errorevent-interface
  29883. class ErrorEvent extends Event {
  29884. #eventInit
  29885. constructor (type, eventInitDict) {
  29886. webidl.argumentLengthCheck(arguments, 1, { header: 'ErrorEvent constructor' })
  29887. super(type, eventInitDict)
  29888. type = webidl.converters.DOMString(type)
  29889. eventInitDict = webidl.converters.ErrorEventInit(eventInitDict ?? {})
  29890. this.#eventInit = eventInitDict
  29891. }
  29892. get message () {
  29893. webidl.brandCheck(this, ErrorEvent)
  29894. return this.#eventInit.message
  29895. }
  29896. get filename () {
  29897. webidl.brandCheck(this, ErrorEvent)
  29898. return this.#eventInit.filename
  29899. }
  29900. get lineno () {
  29901. webidl.brandCheck(this, ErrorEvent)
  29902. return this.#eventInit.lineno
  29903. }
  29904. get colno () {
  29905. webidl.brandCheck(this, ErrorEvent)
  29906. return this.#eventInit.colno
  29907. }
  29908. get error () {
  29909. webidl.brandCheck(this, ErrorEvent)
  29910. return this.#eventInit.error
  29911. }
  29912. }
  29913. Object.defineProperties(MessageEvent.prototype, {
  29914. [Symbol.toStringTag]: {
  29915. value: 'MessageEvent',
  29916. configurable: true
  29917. },
  29918. data: kEnumerableProperty,
  29919. origin: kEnumerableProperty,
  29920. lastEventId: kEnumerableProperty,
  29921. source: kEnumerableProperty,
  29922. ports: kEnumerableProperty,
  29923. initMessageEvent: kEnumerableProperty
  29924. })
  29925. Object.defineProperties(CloseEvent.prototype, {
  29926. [Symbol.toStringTag]: {
  29927. value: 'CloseEvent',
  29928. configurable: true
  29929. },
  29930. reason: kEnumerableProperty,
  29931. code: kEnumerableProperty,
  29932. wasClean: kEnumerableProperty
  29933. })
  29934. Object.defineProperties(ErrorEvent.prototype, {
  29935. [Symbol.toStringTag]: {
  29936. value: 'ErrorEvent',
  29937. configurable: true
  29938. },
  29939. message: kEnumerableProperty,
  29940. filename: kEnumerableProperty,
  29941. lineno: kEnumerableProperty,
  29942. colno: kEnumerableProperty,
  29943. error: kEnumerableProperty
  29944. })
  29945. webidl.converters.MessagePort = webidl.interfaceConverter(MessagePort)
  29946. webidl.converters['sequence<MessagePort>'] = webidl.sequenceConverter(
  29947. webidl.converters.MessagePort
  29948. )
  29949. const eventInit = [
  29950. {
  29951. key: 'bubbles',
  29952. converter: webidl.converters.boolean,
  29953. defaultValue: false
  29954. },
  29955. {
  29956. key: 'cancelable',
  29957. converter: webidl.converters.boolean,
  29958. defaultValue: false
  29959. },
  29960. {
  29961. key: 'composed',
  29962. converter: webidl.converters.boolean,
  29963. defaultValue: false
  29964. }
  29965. ]
  29966. webidl.converters.MessageEventInit = webidl.dictionaryConverter([
  29967. ...eventInit,
  29968. {
  29969. key: 'data',
  29970. converter: webidl.converters.any,
  29971. defaultValue: null
  29972. },
  29973. {
  29974. key: 'origin',
  29975. converter: webidl.converters.USVString,
  29976. defaultValue: ''
  29977. },
  29978. {
  29979. key: 'lastEventId',
  29980. converter: webidl.converters.DOMString,
  29981. defaultValue: ''
  29982. },
  29983. {
  29984. key: 'source',
  29985. // Node doesn't implement WindowProxy or ServiceWorker, so the only
  29986. // valid value for source is a MessagePort.
  29987. converter: webidl.nullableConverter(webidl.converters.MessagePort),
  29988. defaultValue: null
  29989. },
  29990. {
  29991. key: 'ports',
  29992. converter: webidl.converters['sequence<MessagePort>'],
  29993. get defaultValue () {
  29994. return []
  29995. }
  29996. }
  29997. ])
  29998. webidl.converters.CloseEventInit = webidl.dictionaryConverter([
  29999. ...eventInit,
  30000. {
  30001. key: 'wasClean',
  30002. converter: webidl.converters.boolean,
  30003. defaultValue: false
  30004. },
  30005. {
  30006. key: 'code',
  30007. converter: webidl.converters['unsigned short'],
  30008. defaultValue: 0
  30009. },
  30010. {
  30011. key: 'reason',
  30012. converter: webidl.converters.USVString,
  30013. defaultValue: ''
  30014. }
  30015. ])
  30016. webidl.converters.ErrorEventInit = webidl.dictionaryConverter([
  30017. ...eventInit,
  30018. {
  30019. key: 'message',
  30020. converter: webidl.converters.DOMString,
  30021. defaultValue: ''
  30022. },
  30023. {
  30024. key: 'filename',
  30025. converter: webidl.converters.USVString,
  30026. defaultValue: ''
  30027. },
  30028. {
  30029. key: 'lineno',
  30030. converter: webidl.converters['unsigned long'],
  30031. defaultValue: 0
  30032. },
  30033. {
  30034. key: 'colno',
  30035. converter: webidl.converters['unsigned long'],
  30036. defaultValue: 0
  30037. },
  30038. {
  30039. key: 'error',
  30040. converter: webidl.converters.any
  30041. }
  30042. ])
  30043. module.exports = {
  30044. MessageEvent,
  30045. CloseEvent,
  30046. ErrorEvent
  30047. }
  30048. /***/ }),
  30049. /***/ 5444:
  30050. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  30051. "use strict";
  30052. const { maxUnsigned16Bit } = __nccwpck_require__(9188)
  30053. /** @type {import('crypto')} */
  30054. let crypto
  30055. try {
  30056. crypto = __nccwpck_require__(6113)
  30057. } catch {
  30058. }
  30059. class WebsocketFrameSend {
  30060. /**
  30061. * @param {Buffer|undefined} data
  30062. */
  30063. constructor (data) {
  30064. this.frameData = data
  30065. this.maskKey = crypto.randomBytes(4)
  30066. }
  30067. createFrame (opcode) {
  30068. const bodyLength = this.frameData?.byteLength ?? 0
  30069. /** @type {number} */
  30070. let payloadLength = bodyLength // 0-125
  30071. let offset = 6
  30072. if (bodyLength > maxUnsigned16Bit) {
  30073. offset += 8 // payload length is next 8 bytes
  30074. payloadLength = 127
  30075. } else if (bodyLength > 125) {
  30076. offset += 2 // payload length is next 2 bytes
  30077. payloadLength = 126
  30078. }
  30079. const buffer = Buffer.allocUnsafe(bodyLength + offset)
  30080. // Clear first 2 bytes, everything else is overwritten
  30081. buffer[0] = buffer[1] = 0
  30082. buffer[0] |= 0x80 // FIN
  30083. buffer[0] = (buffer[0] & 0xF0) + opcode // opcode
  30084. /*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> */
  30085. buffer[offset - 4] = this.maskKey[0]
  30086. buffer[offset - 3] = this.maskKey[1]
  30087. buffer[offset - 2] = this.maskKey[2]
  30088. buffer[offset - 1] = this.maskKey[3]
  30089. buffer[1] = payloadLength
  30090. if (payloadLength === 126) {
  30091. buffer.writeUInt16BE(bodyLength, 2)
  30092. } else if (payloadLength === 127) {
  30093. // Clear extended payload length
  30094. buffer[2] = buffer[3] = 0
  30095. buffer.writeUIntBE(bodyLength, 4, 6)
  30096. }
  30097. buffer[1] |= 0x80 // MASK
  30098. // mask body
  30099. for (let i = 0; i < bodyLength; i++) {
  30100. buffer[offset + i] = this.frameData[i] ^ this.maskKey[i % 4]
  30101. }
  30102. return buffer
  30103. }
  30104. }
  30105. module.exports = {
  30106. WebsocketFrameSend
  30107. }
  30108. /***/ }),
  30109. /***/ 1688:
  30110. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  30111. "use strict";
  30112. const { Writable } = __nccwpck_require__(2781)
  30113. const diagnosticsChannel = __nccwpck_require__(7643)
  30114. const { parserStates, opcodes, states, emptyBuffer } = __nccwpck_require__(9188)
  30115. const { kReadyState, kSentClose, kResponse, kReceivedClose } = __nccwpck_require__(7578)
  30116. const { isValidStatusCode, failWebsocketConnection, websocketMessageReceived } = __nccwpck_require__(5515)
  30117. const { WebsocketFrameSend } = __nccwpck_require__(5444)
  30118. // This code was influenced by ws released under the MIT license.
  30119. // Copyright (c) 2011 Einar Otto Stangvik <einaros@gmail.com>
  30120. // Copyright (c) 2013 Arnout Kazemier and contributors
  30121. // Copyright (c) 2016 Luigi Pinca and contributors
  30122. const channels = {}
  30123. channels.ping = diagnosticsChannel.channel('undici:websocket:ping')
  30124. channels.pong = diagnosticsChannel.channel('undici:websocket:pong')
  30125. class ByteParser extends Writable {
  30126. #buffers = []
  30127. #byteOffset = 0
  30128. #state = parserStates.INFO
  30129. #info = {}
  30130. #fragments = []
  30131. constructor (ws) {
  30132. super()
  30133. this.ws = ws
  30134. }
  30135. /**
  30136. * @param {Buffer} chunk
  30137. * @param {() => void} callback
  30138. */
  30139. _write (chunk, _, callback) {
  30140. this.#buffers.push(chunk)
  30141. this.#byteOffset += chunk.length
  30142. this.run(callback)
  30143. }
  30144. /**
  30145. * Runs whenever a new chunk is received.
  30146. * Callback is called whenever there are no more chunks buffering,
  30147. * or not enough bytes are buffered to parse.
  30148. */
  30149. run (callback) {
  30150. while (true) {
  30151. if (this.#state === parserStates.INFO) {
  30152. // If there aren't enough bytes to parse the payload length, etc.
  30153. if (this.#byteOffset < 2) {
  30154. return callback()
  30155. }
  30156. const buffer = this.consume(2)
  30157. this.#info.fin = (buffer[0] & 0x80) !== 0
  30158. this.#info.opcode = buffer[0] & 0x0F
  30159. // If we receive a fragmented message, we use the type of the first
  30160. // frame to parse the full message as binary/text, when it's terminated
  30161. this.#info.originalOpcode ??= this.#info.opcode
  30162. this.#info.fragmented = !this.#info.fin && this.#info.opcode !== opcodes.CONTINUATION
  30163. if (this.#info.fragmented && this.#info.opcode !== opcodes.BINARY && this.#info.opcode !== opcodes.TEXT) {
  30164. // Only text and binary frames can be fragmented
  30165. failWebsocketConnection(this.ws, 'Invalid frame type was fragmented.')
  30166. return
  30167. }
  30168. const payloadLength = buffer[1] & 0x7F
  30169. if (payloadLength <= 125) {
  30170. this.#info.payloadLength = payloadLength
  30171. this.#state = parserStates.READ_DATA
  30172. } else if (payloadLength === 126) {
  30173. this.#state = parserStates.PAYLOADLENGTH_16
  30174. } else if (payloadLength === 127) {
  30175. this.#state = parserStates.PAYLOADLENGTH_64
  30176. }
  30177. if (this.#info.fragmented && payloadLength > 125) {
  30178. // A fragmented frame can't be fragmented itself
  30179. failWebsocketConnection(this.ws, 'Fragmented frame exceeded 125 bytes.')
  30180. return
  30181. } else if (
  30182. (this.#info.opcode === opcodes.PING ||
  30183. this.#info.opcode === opcodes.PONG ||
  30184. this.#info.opcode === opcodes.CLOSE) &&
  30185. payloadLength > 125
  30186. ) {
  30187. // Control frames can have a payload length of 125 bytes MAX
  30188. failWebsocketConnection(this.ws, 'Payload length for control frame exceeded 125 bytes.')
  30189. return
  30190. } else if (this.#info.opcode === opcodes.CLOSE) {
  30191. if (payloadLength === 1) {
  30192. failWebsocketConnection(this.ws, 'Received close frame with a 1-byte body.')
  30193. return
  30194. }
  30195. const body = this.consume(payloadLength)
  30196. this.#info.closeInfo = this.parseCloseBody(false, body)
  30197. if (!this.ws[kSentClose]) {
  30198. // If an endpoint receives a Close frame and did not previously send a
  30199. // Close frame, the endpoint MUST send a Close frame in response. (When
  30200. // sending a Close frame in response, the endpoint typically echos the
  30201. // status code it received.)
  30202. const body = Buffer.allocUnsafe(2)
  30203. body.writeUInt16BE(this.#info.closeInfo.code, 0)
  30204. const closeFrame = new WebsocketFrameSend(body)
  30205. this.ws[kResponse].socket.write(
  30206. closeFrame.createFrame(opcodes.CLOSE),
  30207. (err) => {
  30208. if (!err) {
  30209. this.ws[kSentClose] = true
  30210. }
  30211. }
  30212. )
  30213. }
  30214. // Upon either sending or receiving a Close control frame, it is said
  30215. // that _The WebSocket Closing Handshake is Started_ and that the
  30216. // WebSocket connection is in the CLOSING state.
  30217. this.ws[kReadyState] = states.CLOSING
  30218. this.ws[kReceivedClose] = true
  30219. this.end()
  30220. return
  30221. } else if (this.#info.opcode === opcodes.PING) {
  30222. // Upon receipt of a Ping frame, an endpoint MUST send a Pong frame in
  30223. // response, unless it already received a Close frame.
  30224. // A Pong frame sent in response to a Ping frame must have identical
  30225. // "Application data"
  30226. const body = this.consume(payloadLength)
  30227. if (!this.ws[kReceivedClose]) {
  30228. const frame = new WebsocketFrameSend(body)
  30229. this.ws[kResponse].socket.write(frame.createFrame(opcodes.PONG))
  30230. if (channels.ping.hasSubscribers) {
  30231. channels.ping.publish({
  30232. payload: body
  30233. })
  30234. }
  30235. }
  30236. this.#state = parserStates.INFO
  30237. if (this.#byteOffset > 0) {
  30238. continue
  30239. } else {
  30240. callback()
  30241. return
  30242. }
  30243. } else if (this.#info.opcode === opcodes.PONG) {
  30244. // A Pong frame MAY be sent unsolicited. This serves as a
  30245. // unidirectional heartbeat. A response to an unsolicited Pong frame is
  30246. // not expected.
  30247. const body = this.consume(payloadLength)
  30248. if (channels.pong.hasSubscribers) {
  30249. channels.pong.publish({
  30250. payload: body
  30251. })
  30252. }
  30253. if (this.#byteOffset > 0) {
  30254. continue
  30255. } else {
  30256. callback()
  30257. return
  30258. }
  30259. }
  30260. } else if (this.#state === parserStates.PAYLOADLENGTH_16) {
  30261. if (this.#byteOffset < 2) {
  30262. return callback()
  30263. }
  30264. const buffer = this.consume(2)
  30265. this.#info.payloadLength = buffer.readUInt16BE(0)
  30266. this.#state = parserStates.READ_DATA
  30267. } else if (this.#state === parserStates.PAYLOADLENGTH_64) {
  30268. if (this.#byteOffset < 8) {
  30269. return callback()
  30270. }
  30271. const buffer = this.consume(8)
  30272. const upper = buffer.readUInt32BE(0)
  30273. // 2^31 is the maxinimum bytes an arraybuffer can contain
  30274. // on 32-bit systems. Although, on 64-bit systems, this is
  30275. // 2^53-1 bytes.
  30276. // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Invalid_array_length
  30277. // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/common/globals.h;drc=1946212ac0100668f14eb9e2843bdd846e510a1e;bpv=1;bpt=1;l=1275
  30278. // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/objects/js-array-buffer.h;l=34;drc=1946212ac0100668f14eb9e2843bdd846e510a1e
  30279. if (upper > 2 ** 31 - 1) {
  30280. failWebsocketConnection(this.ws, 'Received payload length > 2^31 bytes.')
  30281. return
  30282. }
  30283. const lower = buffer.readUInt32BE(4)
  30284. this.#info.payloadLength = (upper << 8) + lower
  30285. this.#state = parserStates.READ_DATA
  30286. } else if (this.#state === parserStates.READ_DATA) {
  30287. if (this.#byteOffset < this.#info.payloadLength) {
  30288. // If there is still more data in this chunk that needs to be read
  30289. return callback()
  30290. } else if (this.#byteOffset >= this.#info.payloadLength) {
  30291. // If the server sent multiple frames in a single chunk
  30292. const body = this.consume(this.#info.payloadLength)
  30293. this.#fragments.push(body)
  30294. // If the frame is unfragmented, or a fragmented frame was terminated,
  30295. // a message was received
  30296. if (!this.#info.fragmented || (this.#info.fin && this.#info.opcode === opcodes.CONTINUATION)) {
  30297. const fullMessage = Buffer.concat(this.#fragments)
  30298. websocketMessageReceived(this.ws, this.#info.originalOpcode, fullMessage)
  30299. this.#info = {}
  30300. this.#fragments.length = 0
  30301. }
  30302. this.#state = parserStates.INFO
  30303. }
  30304. }
  30305. if (this.#byteOffset > 0) {
  30306. continue
  30307. } else {
  30308. callback()
  30309. break
  30310. }
  30311. }
  30312. }
  30313. /**
  30314. * Take n bytes from the buffered Buffers
  30315. * @param {number} n
  30316. * @returns {Buffer|null}
  30317. */
  30318. consume (n) {
  30319. if (n > this.#byteOffset) {
  30320. return null
  30321. } else if (n === 0) {
  30322. return emptyBuffer
  30323. }
  30324. if (this.#buffers[0].length === n) {
  30325. this.#byteOffset -= this.#buffers[0].length
  30326. return this.#buffers.shift()
  30327. }
  30328. const buffer = Buffer.allocUnsafe(n)
  30329. let offset = 0
  30330. while (offset !== n) {
  30331. const next = this.#buffers[0]
  30332. const { length } = next
  30333. if (length + offset === n) {
  30334. buffer.set(this.#buffers.shift(), offset)
  30335. break
  30336. } else if (length + offset > n) {
  30337. buffer.set(next.subarray(0, n - offset), offset)
  30338. this.#buffers[0] = next.subarray(n - offset)
  30339. break
  30340. } else {
  30341. buffer.set(this.#buffers.shift(), offset)
  30342. offset += next.length
  30343. }
  30344. }
  30345. this.#byteOffset -= n
  30346. return buffer
  30347. }
  30348. parseCloseBody (onlyCode, data) {
  30349. // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.5
  30350. /** @type {number|undefined} */
  30351. let code
  30352. if (data.length >= 2) {
  30353. // _The WebSocket Connection Close Code_ is
  30354. // defined as the status code (Section 7.4) contained in the first Close
  30355. // control frame received by the application
  30356. code = data.readUInt16BE(0)
  30357. }
  30358. if (onlyCode) {
  30359. if (!isValidStatusCode(code)) {
  30360. return null
  30361. }
  30362. return { code }
  30363. }
  30364. // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.6
  30365. /** @type {Buffer} */
  30366. let reason = data.subarray(2)
  30367. // Remove BOM
  30368. if (reason[0] === 0xEF && reason[1] === 0xBB && reason[2] === 0xBF) {
  30369. reason = reason.subarray(3)
  30370. }
  30371. if (code !== undefined && !isValidStatusCode(code)) {
  30372. return null
  30373. }
  30374. try {
  30375. // TODO: optimize this
  30376. reason = new TextDecoder('utf-8', { fatal: true }).decode(reason)
  30377. } catch {
  30378. return null
  30379. }
  30380. return { code, reason }
  30381. }
  30382. get closingInfo () {
  30383. return this.#info.closeInfo
  30384. }
  30385. }
  30386. module.exports = {
  30387. ByteParser
  30388. }
  30389. /***/ }),
  30390. /***/ 7578:
  30391. /***/ ((module) => {
  30392. "use strict";
  30393. module.exports = {
  30394. kWebSocketURL: Symbol('url'),
  30395. kReadyState: Symbol('ready state'),
  30396. kController: Symbol('controller'),
  30397. kResponse: Symbol('response'),
  30398. kBinaryType: Symbol('binary type'),
  30399. kSentClose: Symbol('sent close'),
  30400. kReceivedClose: Symbol('received close'),
  30401. kByteParser: Symbol('byte parser')
  30402. }
  30403. /***/ }),
  30404. /***/ 5515:
  30405. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  30406. "use strict";
  30407. const { kReadyState, kController, kResponse, kBinaryType, kWebSocketURL } = __nccwpck_require__(7578)
  30408. const { states, opcodes } = __nccwpck_require__(9188)
  30409. const { MessageEvent, ErrorEvent } = __nccwpck_require__(2611)
  30410. /* globals Blob */
  30411. /**
  30412. * @param {import('./websocket').WebSocket} ws
  30413. */
  30414. function isEstablished (ws) {
  30415. // If the server's response is validated as provided for above, it is
  30416. // said that _The WebSocket Connection is Established_ and that the
  30417. // WebSocket Connection is in the OPEN state.
  30418. return ws[kReadyState] === states.OPEN
  30419. }
  30420. /**
  30421. * @param {import('./websocket').WebSocket} ws
  30422. */
  30423. function isClosing (ws) {
  30424. // Upon either sending or receiving a Close control frame, it is said
  30425. // that _The WebSocket Closing Handshake is Started_ and that the
  30426. // WebSocket connection is in the CLOSING state.
  30427. return ws[kReadyState] === states.CLOSING
  30428. }
  30429. /**
  30430. * @param {import('./websocket').WebSocket} ws
  30431. */
  30432. function isClosed (ws) {
  30433. return ws[kReadyState] === states.CLOSED
  30434. }
  30435. /**
  30436. * @see https://dom.spec.whatwg.org/#concept-event-fire
  30437. * @param {string} e
  30438. * @param {EventTarget} target
  30439. * @param {EventInit | undefined} eventInitDict
  30440. */
  30441. function fireEvent (e, target, eventConstructor = Event, eventInitDict) {
  30442. // 1. If eventConstructor is not given, then let eventConstructor be Event.
  30443. // 2. Let event be the result of creating an event given eventConstructor,
  30444. // in the relevant realm of target.
  30445. // 3. Initialize event’s type attribute to e.
  30446. const event = new eventConstructor(e, eventInitDict) // eslint-disable-line new-cap
  30447. // 4. Initialize any other IDL attributes of event as described in the
  30448. // invocation of this algorithm.
  30449. // 5. Return the result of dispatching event at target, with legacy target
  30450. // override flag set if set.
  30451. target.dispatchEvent(event)
  30452. }
  30453. /**
  30454. * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol
  30455. * @param {import('./websocket').WebSocket} ws
  30456. * @param {number} type Opcode
  30457. * @param {Buffer} data application data
  30458. */
  30459. function websocketMessageReceived (ws, type, data) {
  30460. // 1. If ready state is not OPEN (1), then return.
  30461. if (ws[kReadyState] !== states.OPEN) {
  30462. return
  30463. }
  30464. // 2. Let dataForEvent be determined by switching on type and binary type:
  30465. let dataForEvent
  30466. if (type === opcodes.TEXT) {
  30467. // -> type indicates that the data is Text
  30468. // a new DOMString containing data
  30469. try {
  30470. dataForEvent = new TextDecoder('utf-8', { fatal: true }).decode(data)
  30471. } catch {
  30472. failWebsocketConnection(ws, 'Received invalid UTF-8 in text frame.')
  30473. return
  30474. }
  30475. } else if (type === opcodes.BINARY) {
  30476. if (ws[kBinaryType] === 'blob') {
  30477. // -> type indicates that the data is Binary and binary type is "blob"
  30478. // a new Blob object, created in the relevant Realm of the WebSocket
  30479. // object, that represents data as its raw data
  30480. dataForEvent = new Blob([data])
  30481. } else {
  30482. // -> type indicates that the data is Binary and binary type is "arraybuffer"
  30483. // a new ArrayBuffer object, created in the relevant Realm of the
  30484. // WebSocket object, whose contents are data
  30485. dataForEvent = new Uint8Array(data).buffer
  30486. }
  30487. }
  30488. // 3. Fire an event named message at the WebSocket object, using MessageEvent,
  30489. // with the origin attribute initialized to the serialization of the WebSocket
  30490. // object’s url's origin, and the data attribute initialized to dataForEvent.
  30491. fireEvent('message', ws, MessageEvent, {
  30492. origin: ws[kWebSocketURL].origin,
  30493. data: dataForEvent
  30494. })
  30495. }
  30496. /**
  30497. * @see https://datatracker.ietf.org/doc/html/rfc6455
  30498. * @see https://datatracker.ietf.org/doc/html/rfc2616
  30499. * @see https://bugs.chromium.org/p/chromium/issues/detail?id=398407
  30500. * @param {string} protocol
  30501. */
  30502. function isValidSubprotocol (protocol) {
  30503. // If present, this value indicates one
  30504. // or more comma-separated subprotocol the client wishes to speak,
  30505. // ordered by preference. The elements that comprise this value
  30506. // MUST be non-empty strings with characters in the range U+0021 to
  30507. // U+007E not including separator characters as defined in
  30508. // [RFC2616] and MUST all be unique strings.
  30509. if (protocol.length === 0) {
  30510. return false
  30511. }
  30512. for (const char of protocol) {
  30513. const code = char.charCodeAt(0)
  30514. if (
  30515. code < 0x21 ||
  30516. code > 0x7E ||
  30517. char === '(' ||
  30518. char === ')' ||
  30519. char === '<' ||
  30520. char === '>' ||
  30521. char === '@' ||
  30522. char === ',' ||
  30523. char === ';' ||
  30524. char === ':' ||
  30525. char === '\\' ||
  30526. char === '"' ||
  30527. char === '/' ||
  30528. char === '[' ||
  30529. char === ']' ||
  30530. char === '?' ||
  30531. char === '=' ||
  30532. char === '{' ||
  30533. char === '}' ||
  30534. code === 32 || // SP
  30535. code === 9 // HT
  30536. ) {
  30537. return false
  30538. }
  30539. }
  30540. return true
  30541. }
  30542. /**
  30543. * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7-4
  30544. * @param {number} code
  30545. */
  30546. function isValidStatusCode (code) {
  30547. if (code >= 1000 && code < 1015) {
  30548. return (
  30549. code !== 1004 && // reserved
  30550. code !== 1005 && // "MUST NOT be set as a status code"
  30551. code !== 1006 // "MUST NOT be set as a status code"
  30552. )
  30553. }
  30554. return code >= 3000 && code <= 4999
  30555. }
  30556. /**
  30557. * @param {import('./websocket').WebSocket} ws
  30558. * @param {string|undefined} reason
  30559. */
  30560. function failWebsocketConnection (ws, reason) {
  30561. const { [kController]: controller, [kResponse]: response } = ws
  30562. controller.abort()
  30563. if (response?.socket && !response.socket.destroyed) {
  30564. response.socket.destroy()
  30565. }
  30566. if (reason) {
  30567. fireEvent('error', ws, ErrorEvent, {
  30568. error: new Error(reason)
  30569. })
  30570. }
  30571. }
  30572. module.exports = {
  30573. isEstablished,
  30574. isClosing,
  30575. isClosed,
  30576. fireEvent,
  30577. isValidSubprotocol,
  30578. isValidStatusCode,
  30579. failWebsocketConnection,
  30580. websocketMessageReceived
  30581. }
  30582. /***/ }),
  30583. /***/ 4284:
  30584. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  30585. "use strict";
  30586. const { webidl } = __nccwpck_require__(1744)
  30587. const { DOMException } = __nccwpck_require__(1037)
  30588. const { URLSerializer } = __nccwpck_require__(685)
  30589. const { getGlobalOrigin } = __nccwpck_require__(1246)
  30590. const { staticPropertyDescriptors, states, opcodes, emptyBuffer } = __nccwpck_require__(9188)
  30591. const {
  30592. kWebSocketURL,
  30593. kReadyState,
  30594. kController,
  30595. kBinaryType,
  30596. kResponse,
  30597. kSentClose,
  30598. kByteParser
  30599. } = __nccwpck_require__(7578)
  30600. const { isEstablished, isClosing, isValidSubprotocol, failWebsocketConnection, fireEvent } = __nccwpck_require__(5515)
  30601. const { establishWebSocketConnection } = __nccwpck_require__(5354)
  30602. const { WebsocketFrameSend } = __nccwpck_require__(5444)
  30603. const { ByteParser } = __nccwpck_require__(1688)
  30604. const { kEnumerableProperty, isBlobLike } = __nccwpck_require__(3983)
  30605. const { getGlobalDispatcher } = __nccwpck_require__(1892)
  30606. const { types } = __nccwpck_require__(3837)
  30607. let experimentalWarned = false
  30608. // https://websockets.spec.whatwg.org/#interface-definition
  30609. class WebSocket extends EventTarget {
  30610. #events = {
  30611. open: null,
  30612. error: null,
  30613. close: null,
  30614. message: null
  30615. }
  30616. #bufferedAmount = 0
  30617. #protocol = ''
  30618. #extensions = ''
  30619. /**
  30620. * @param {string} url
  30621. * @param {string|string[]} protocols
  30622. */
  30623. constructor (url, protocols = []) {
  30624. super()
  30625. webidl.argumentLengthCheck(arguments, 1, { header: 'WebSocket constructor' })
  30626. if (!experimentalWarned) {
  30627. experimentalWarned = true
  30628. process.emitWarning('WebSockets are experimental, expect them to change at any time.', {
  30629. code: 'UNDICI-WS'
  30630. })
  30631. }
  30632. const options = webidl.converters['DOMString or sequence<DOMString> or WebSocketInit'](protocols)
  30633. url = webidl.converters.USVString(url)
  30634. protocols = options.protocols
  30635. // 1. Let baseURL be this's relevant settings object's API base URL.
  30636. const baseURL = getGlobalOrigin()
  30637. // 1. Let urlRecord be the result of applying the URL parser to url with baseURL.
  30638. let urlRecord
  30639. try {
  30640. urlRecord = new URL(url, baseURL)
  30641. } catch (e) {
  30642. // 3. If urlRecord is failure, then throw a "SyntaxError" DOMException.
  30643. throw new DOMException(e, 'SyntaxError')
  30644. }
  30645. // 4. If urlRecord’s scheme is "http", then set urlRecord’s scheme to "ws".
  30646. if (urlRecord.protocol === 'http:') {
  30647. urlRecord.protocol = 'ws:'
  30648. } else if (urlRecord.protocol === 'https:') {
  30649. // 5. Otherwise, if urlRecord’s scheme is "https", set urlRecord’s scheme to "wss".
  30650. urlRecord.protocol = 'wss:'
  30651. }
  30652. // 6. If urlRecord’s scheme is not "ws" or "wss", then throw a "SyntaxError" DOMException.
  30653. if (urlRecord.protocol !== 'ws:' && urlRecord.protocol !== 'wss:') {
  30654. throw new DOMException(
  30655. `Expected a ws: or wss: protocol, got ${urlRecord.protocol}`,
  30656. 'SyntaxError'
  30657. )
  30658. }
  30659. // 7. If urlRecord’s fragment is non-null, then throw a "SyntaxError"
  30660. // DOMException.
  30661. if (urlRecord.hash || urlRecord.href.endsWith('#')) {
  30662. throw new DOMException('Got fragment', 'SyntaxError')
  30663. }
  30664. // 8. If protocols is a string, set protocols to a sequence consisting
  30665. // of just that string.
  30666. if (typeof protocols === 'string') {
  30667. protocols = [protocols]
  30668. }
  30669. // 9. If any of the values in protocols occur more than once or otherwise
  30670. // fail to match the requirements for elements that comprise the value
  30671. // of `Sec-WebSocket-Protocol` fields as defined by The WebSocket
  30672. // protocol, then throw a "SyntaxError" DOMException.
  30673. if (protocols.length !== new Set(protocols.map(p => p.toLowerCase())).size) {
  30674. throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError')
  30675. }
  30676. if (protocols.length > 0 && !protocols.every(p => isValidSubprotocol(p))) {
  30677. throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError')
  30678. }
  30679. // 10. Set this's url to urlRecord.
  30680. this[kWebSocketURL] = new URL(urlRecord.href)
  30681. // 11. Let client be this's relevant settings object.
  30682. // 12. Run this step in parallel:
  30683. // 1. Establish a WebSocket connection given urlRecord, protocols,
  30684. // and client.
  30685. this[kController] = establishWebSocketConnection(
  30686. urlRecord,
  30687. protocols,
  30688. this,
  30689. (response) => this.#onConnectionEstablished(response),
  30690. options
  30691. )
  30692. // Each WebSocket object has an associated ready state, which is a
  30693. // number representing the state of the connection. Initially it must
  30694. // be CONNECTING (0).
  30695. this[kReadyState] = WebSocket.CONNECTING
  30696. // The extensions attribute must initially return the empty string.
  30697. // The protocol attribute must initially return the empty string.
  30698. // Each WebSocket object has an associated binary type, which is a
  30699. // BinaryType. Initially it must be "blob".
  30700. this[kBinaryType] = 'blob'
  30701. }
  30702. /**
  30703. * @see https://websockets.spec.whatwg.org/#dom-websocket-close
  30704. * @param {number|undefined} code
  30705. * @param {string|undefined} reason
  30706. */
  30707. close (code = undefined, reason = undefined) {
  30708. webidl.brandCheck(this, WebSocket)
  30709. if (code !== undefined) {
  30710. code = webidl.converters['unsigned short'](code, { clamp: true })
  30711. }
  30712. if (reason !== undefined) {
  30713. reason = webidl.converters.USVString(reason)
  30714. }
  30715. // 1. If code is present, but is neither an integer equal to 1000 nor an
  30716. // integer in the range 3000 to 4999, inclusive, throw an
  30717. // "InvalidAccessError" DOMException.
  30718. if (code !== undefined) {
  30719. if (code !== 1000 && (code < 3000 || code > 4999)) {
  30720. throw new DOMException('invalid code', 'InvalidAccessError')
  30721. }
  30722. }
  30723. let reasonByteLength = 0
  30724. // 2. If reason is present, then run these substeps:
  30725. if (reason !== undefined) {
  30726. // 1. Let reasonBytes be the result of encoding reason.
  30727. // 2. If reasonBytes is longer than 123 bytes, then throw a
  30728. // "SyntaxError" DOMException.
  30729. reasonByteLength = Buffer.byteLength(reason)
  30730. if (reasonByteLength > 123) {
  30731. throw new DOMException(
  30732. `Reason must be less than 123 bytes; received ${reasonByteLength}`,
  30733. 'SyntaxError'
  30734. )
  30735. }
  30736. }
  30737. // 3. Run the first matching steps from the following list:
  30738. if (this[kReadyState] === WebSocket.CLOSING || this[kReadyState] === WebSocket.CLOSED) {
  30739. // If this's ready state is CLOSING (2) or CLOSED (3)
  30740. // Do nothing.
  30741. } else if (!isEstablished(this)) {
  30742. // If the WebSocket connection is not yet established
  30743. // Fail the WebSocket connection and set this's ready state
  30744. // to CLOSING (2).
  30745. failWebsocketConnection(this, 'Connection was closed before it was established.')
  30746. this[kReadyState] = WebSocket.CLOSING
  30747. } else if (!isClosing(this)) {
  30748. // If the WebSocket closing handshake has not yet been started
  30749. // Start the WebSocket closing handshake and set this's ready
  30750. // state to CLOSING (2).
  30751. // - If neither code nor reason is present, the WebSocket Close
  30752. // message must not have a body.
  30753. // - If code is present, then the status code to use in the
  30754. // WebSocket Close message must be the integer given by code.
  30755. // - If reason is also present, then reasonBytes must be
  30756. // provided in the Close message after the status code.
  30757. const frame = new WebsocketFrameSend()
  30758. // If neither code nor reason is present, the WebSocket Close
  30759. // message must not have a body.
  30760. // If code is present, then the status code to use in the
  30761. // WebSocket Close message must be the integer given by code.
  30762. if (code !== undefined && reason === undefined) {
  30763. frame.frameData = Buffer.allocUnsafe(2)
  30764. frame.frameData.writeUInt16BE(code, 0)
  30765. } else if (code !== undefined && reason !== undefined) {
  30766. // If reason is also present, then reasonBytes must be
  30767. // provided in the Close message after the status code.
  30768. frame.frameData = Buffer.allocUnsafe(2 + reasonByteLength)
  30769. frame.frameData.writeUInt16BE(code, 0)
  30770. // the body MAY contain UTF-8-encoded data with value /reason/
  30771. frame.frameData.write(reason, 2, 'utf-8')
  30772. } else {
  30773. frame.frameData = emptyBuffer
  30774. }
  30775. /** @type {import('stream').Duplex} */
  30776. const socket = this[kResponse].socket
  30777. socket.write(frame.createFrame(opcodes.CLOSE), (err) => {
  30778. if (!err) {
  30779. this[kSentClose] = true
  30780. }
  30781. })
  30782. // Upon either sending or receiving a Close control frame, it is said
  30783. // that _The WebSocket Closing Handshake is Started_ and that the
  30784. // WebSocket connection is in the CLOSING state.
  30785. this[kReadyState] = states.CLOSING
  30786. } else {
  30787. // Otherwise
  30788. // Set this's ready state to CLOSING (2).
  30789. this[kReadyState] = WebSocket.CLOSING
  30790. }
  30791. }
  30792. /**
  30793. * @see https://websockets.spec.whatwg.org/#dom-websocket-send
  30794. * @param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data
  30795. */
  30796. send (data) {
  30797. webidl.brandCheck(this, WebSocket)
  30798. webidl.argumentLengthCheck(arguments, 1, { header: 'WebSocket.send' })
  30799. data = webidl.converters.WebSocketSendData(data)
  30800. // 1. If this's ready state is CONNECTING, then throw an
  30801. // "InvalidStateError" DOMException.
  30802. if (this[kReadyState] === WebSocket.CONNECTING) {
  30803. throw new DOMException('Sent before connected.', 'InvalidStateError')
  30804. }
  30805. // 2. Run the appropriate set of steps from the following list:
  30806. // https://datatracker.ietf.org/doc/html/rfc6455#section-6.1
  30807. // https://datatracker.ietf.org/doc/html/rfc6455#section-5.2
  30808. if (!isEstablished(this) || isClosing(this)) {
  30809. return
  30810. }
  30811. /** @type {import('stream').Duplex} */
  30812. const socket = this[kResponse].socket
  30813. // If data is a string
  30814. if (typeof data === 'string') {
  30815. // If the WebSocket connection is established and the WebSocket
  30816. // closing handshake has not yet started, then the user agent
  30817. // must send a WebSocket Message comprised of the data argument
  30818. // using a text frame opcode; if the data cannot be sent, e.g.
  30819. // because it would need to be buffered but the buffer is full,
  30820. // the user agent must flag the WebSocket as full and then close
  30821. // the WebSocket connection. Any invocation of this method with a
  30822. // string argument that does not throw an exception must increase
  30823. // the bufferedAmount attribute by the number of bytes needed to
  30824. // express the argument as UTF-8.
  30825. const value = Buffer.from(data)
  30826. const frame = new WebsocketFrameSend(value)
  30827. const buffer = frame.createFrame(opcodes.TEXT)
  30828. this.#bufferedAmount += value.byteLength
  30829. socket.write(buffer, () => {
  30830. this.#bufferedAmount -= value.byteLength
  30831. })
  30832. } else if (types.isArrayBuffer(data)) {
  30833. // If the WebSocket connection is established, and the WebSocket
  30834. // closing handshake has not yet started, then the user agent must
  30835. // send a WebSocket Message comprised of data using a binary frame
  30836. // opcode; if the data cannot be sent, e.g. because it would need
  30837. // to be buffered but the buffer is full, the user agent must flag
  30838. // the WebSocket as full and then close the WebSocket connection.
  30839. // The data to be sent is the data stored in the buffer described
  30840. // by the ArrayBuffer object. Any invocation of this method with an
  30841. // ArrayBuffer argument that does not throw an exception must
  30842. // increase the bufferedAmount attribute by the length of the
  30843. // ArrayBuffer in bytes.
  30844. const value = Buffer.from(data)
  30845. const frame = new WebsocketFrameSend(value)
  30846. const buffer = frame.createFrame(opcodes.BINARY)
  30847. this.#bufferedAmount += value.byteLength
  30848. socket.write(buffer, () => {
  30849. this.#bufferedAmount -= value.byteLength
  30850. })
  30851. } else if (ArrayBuffer.isView(data)) {
  30852. // If the WebSocket connection is established, and the WebSocket
  30853. // closing handshake has not yet started, then the user agent must
  30854. // send a WebSocket Message comprised of data using a binary frame
  30855. // opcode; if the data cannot be sent, e.g. because it would need to
  30856. // be buffered but the buffer is full, the user agent must flag the
  30857. // WebSocket as full and then close the WebSocket connection. The
  30858. // data to be sent is the data stored in the section of the buffer
  30859. // described by the ArrayBuffer object that data references. Any
  30860. // invocation of this method with this kind of argument that does
  30861. // not throw an exception must increase the bufferedAmount attribute
  30862. // by the length of data’s buffer in bytes.
  30863. const ab = Buffer.from(data, data.byteOffset, data.byteLength)
  30864. const frame = new WebsocketFrameSend(ab)
  30865. const buffer = frame.createFrame(opcodes.BINARY)
  30866. this.#bufferedAmount += ab.byteLength
  30867. socket.write(buffer, () => {
  30868. this.#bufferedAmount -= ab.byteLength
  30869. })
  30870. } else if (isBlobLike(data)) {
  30871. // If the WebSocket connection is established, and the WebSocket
  30872. // closing handshake has not yet started, then the user agent must
  30873. // send a WebSocket Message comprised of data using a binary frame
  30874. // opcode; if the data cannot be sent, e.g. because it would need to
  30875. // be buffered but the buffer is full, the user agent must flag the
  30876. // WebSocket as full and then close the WebSocket connection. The data
  30877. // to be sent is the raw data represented by the Blob object. Any
  30878. // invocation of this method with a Blob argument that does not throw
  30879. // an exception must increase the bufferedAmount attribute by the size
  30880. // of the Blob object’s raw data, in bytes.
  30881. const frame = new WebsocketFrameSend()
  30882. data.arrayBuffer().then((ab) => {
  30883. const value = Buffer.from(ab)
  30884. frame.frameData = value
  30885. const buffer = frame.createFrame(opcodes.BINARY)
  30886. this.#bufferedAmount += value.byteLength
  30887. socket.write(buffer, () => {
  30888. this.#bufferedAmount -= value.byteLength
  30889. })
  30890. })
  30891. }
  30892. }
  30893. get readyState () {
  30894. webidl.brandCheck(this, WebSocket)
  30895. // The readyState getter steps are to return this's ready state.
  30896. return this[kReadyState]
  30897. }
  30898. get bufferedAmount () {
  30899. webidl.brandCheck(this, WebSocket)
  30900. return this.#bufferedAmount
  30901. }
  30902. get url () {
  30903. webidl.brandCheck(this, WebSocket)
  30904. // The url getter steps are to return this's url, serialized.
  30905. return URLSerializer(this[kWebSocketURL])
  30906. }
  30907. get extensions () {
  30908. webidl.brandCheck(this, WebSocket)
  30909. return this.#extensions
  30910. }
  30911. get protocol () {
  30912. webidl.brandCheck(this, WebSocket)
  30913. return this.#protocol
  30914. }
  30915. get onopen () {
  30916. webidl.brandCheck(this, WebSocket)
  30917. return this.#events.open
  30918. }
  30919. set onopen (fn) {
  30920. webidl.brandCheck(this, WebSocket)
  30921. if (this.#events.open) {
  30922. this.removeEventListener('open', this.#events.open)
  30923. }
  30924. if (typeof fn === 'function') {
  30925. this.#events.open = fn
  30926. this.addEventListener('open', fn)
  30927. } else {
  30928. this.#events.open = null
  30929. }
  30930. }
  30931. get onerror () {
  30932. webidl.brandCheck(this, WebSocket)
  30933. return this.#events.error
  30934. }
  30935. set onerror (fn) {
  30936. webidl.brandCheck(this, WebSocket)
  30937. if (this.#events.error) {
  30938. this.removeEventListener('error', this.#events.error)
  30939. }
  30940. if (typeof fn === 'function') {
  30941. this.#events.error = fn
  30942. this.addEventListener('error', fn)
  30943. } else {
  30944. this.#events.error = null
  30945. }
  30946. }
  30947. get onclose () {
  30948. webidl.brandCheck(this, WebSocket)
  30949. return this.#events.close
  30950. }
  30951. set onclose (fn) {
  30952. webidl.brandCheck(this, WebSocket)
  30953. if (this.#events.close) {
  30954. this.removeEventListener('close', this.#events.close)
  30955. }
  30956. if (typeof fn === 'function') {
  30957. this.#events.close = fn
  30958. this.addEventListener('close', fn)
  30959. } else {
  30960. this.#events.close = null
  30961. }
  30962. }
  30963. get onmessage () {
  30964. webidl.brandCheck(this, WebSocket)
  30965. return this.#events.message
  30966. }
  30967. set onmessage (fn) {
  30968. webidl.brandCheck(this, WebSocket)
  30969. if (this.#events.message) {
  30970. this.removeEventListener('message', this.#events.message)
  30971. }
  30972. if (typeof fn === 'function') {
  30973. this.#events.message = fn
  30974. this.addEventListener('message', fn)
  30975. } else {
  30976. this.#events.message = null
  30977. }
  30978. }
  30979. get binaryType () {
  30980. webidl.brandCheck(this, WebSocket)
  30981. return this[kBinaryType]
  30982. }
  30983. set binaryType (type) {
  30984. webidl.brandCheck(this, WebSocket)
  30985. if (type !== 'blob' && type !== 'arraybuffer') {
  30986. this[kBinaryType] = 'blob'
  30987. } else {
  30988. this[kBinaryType] = type
  30989. }
  30990. }
  30991. /**
  30992. * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol
  30993. */
  30994. #onConnectionEstablished (response) {
  30995. // processResponse is called when the "response’s header list has been received and initialized."
  30996. // once this happens, the connection is open
  30997. this[kResponse] = response
  30998. const parser = new ByteParser(this)
  30999. parser.on('drain', function onParserDrain () {
  31000. this.ws[kResponse].socket.resume()
  31001. })
  31002. response.socket.ws = this
  31003. this[kByteParser] = parser
  31004. // 1. Change the ready state to OPEN (1).
  31005. this[kReadyState] = states.OPEN
  31006. // 2. Change the extensions attribute’s value to the extensions in use, if
  31007. // it is not the null value.
  31008. // https://datatracker.ietf.org/doc/html/rfc6455#section-9.1
  31009. const extensions = response.headersList.get('sec-websocket-extensions')
  31010. if (extensions !== null) {
  31011. this.#extensions = extensions
  31012. }
  31013. // 3. Change the protocol attribute’s value to the subprotocol in use, if
  31014. // it is not the null value.
  31015. // https://datatracker.ietf.org/doc/html/rfc6455#section-1.9
  31016. const protocol = response.headersList.get('sec-websocket-protocol')
  31017. if (protocol !== null) {
  31018. this.#protocol = protocol
  31019. }
  31020. // 4. Fire an event named open at the WebSocket object.
  31021. fireEvent('open', this)
  31022. }
  31023. }
  31024. // https://websockets.spec.whatwg.org/#dom-websocket-connecting
  31025. WebSocket.CONNECTING = WebSocket.prototype.CONNECTING = states.CONNECTING
  31026. // https://websockets.spec.whatwg.org/#dom-websocket-open
  31027. WebSocket.OPEN = WebSocket.prototype.OPEN = states.OPEN
  31028. // https://websockets.spec.whatwg.org/#dom-websocket-closing
  31029. WebSocket.CLOSING = WebSocket.prototype.CLOSING = states.CLOSING
  31030. // https://websockets.spec.whatwg.org/#dom-websocket-closed
  31031. WebSocket.CLOSED = WebSocket.prototype.CLOSED = states.CLOSED
  31032. Object.defineProperties(WebSocket.prototype, {
  31033. CONNECTING: staticPropertyDescriptors,
  31034. OPEN: staticPropertyDescriptors,
  31035. CLOSING: staticPropertyDescriptors,
  31036. CLOSED: staticPropertyDescriptors,
  31037. url: kEnumerableProperty,
  31038. readyState: kEnumerableProperty,
  31039. bufferedAmount: kEnumerableProperty,
  31040. onopen: kEnumerableProperty,
  31041. onerror: kEnumerableProperty,
  31042. onclose: kEnumerableProperty,
  31043. close: kEnumerableProperty,
  31044. onmessage: kEnumerableProperty,
  31045. binaryType: kEnumerableProperty,
  31046. send: kEnumerableProperty,
  31047. extensions: kEnumerableProperty,
  31048. protocol: kEnumerableProperty,
  31049. [Symbol.toStringTag]: {
  31050. value: 'WebSocket',
  31051. writable: false,
  31052. enumerable: false,
  31053. configurable: true
  31054. }
  31055. })
  31056. Object.defineProperties(WebSocket, {
  31057. CONNECTING: staticPropertyDescriptors,
  31058. OPEN: staticPropertyDescriptors,
  31059. CLOSING: staticPropertyDescriptors,
  31060. CLOSED: staticPropertyDescriptors
  31061. })
  31062. webidl.converters['sequence<DOMString>'] = webidl.sequenceConverter(
  31063. webidl.converters.DOMString
  31064. )
  31065. webidl.converters['DOMString or sequence<DOMString>'] = function (V) {
  31066. if (webidl.util.Type(V) === 'Object' && Symbol.iterator in V) {
  31067. return webidl.converters['sequence<DOMString>'](V)
  31068. }
  31069. return webidl.converters.DOMString(V)
  31070. }
  31071. // This implements the propsal made in https://github.com/whatwg/websockets/issues/42
  31072. webidl.converters.WebSocketInit = webidl.dictionaryConverter([
  31073. {
  31074. key: 'protocols',
  31075. converter: webidl.converters['DOMString or sequence<DOMString>'],
  31076. get defaultValue () {
  31077. return []
  31078. }
  31079. },
  31080. {
  31081. key: 'dispatcher',
  31082. converter: (V) => V,
  31083. get defaultValue () {
  31084. return getGlobalDispatcher()
  31085. }
  31086. },
  31087. {
  31088. key: 'headers',
  31089. converter: webidl.nullableConverter(webidl.converters.HeadersInit)
  31090. }
  31091. ])
  31092. webidl.converters['DOMString or sequence<DOMString> or WebSocketInit'] = function (V) {
  31093. if (webidl.util.Type(V) === 'Object' && !(Symbol.iterator in V)) {
  31094. return webidl.converters.WebSocketInit(V)
  31095. }
  31096. return { protocols: webidl.converters['DOMString or sequence<DOMString>'](V) }
  31097. }
  31098. webidl.converters.WebSocketSendData = function (V) {
  31099. if (webidl.util.Type(V) === 'Object') {
  31100. if (isBlobLike(V)) {
  31101. return webidl.converters.Blob(V, { strict: false })
  31102. }
  31103. if (ArrayBuffer.isView(V) || types.isAnyArrayBuffer(V)) {
  31104. return webidl.converters.BufferSource(V)
  31105. }
  31106. }
  31107. return webidl.converters.USVString(V)
  31108. }
  31109. module.exports = {
  31110. WebSocket
  31111. }
  31112. /***/ }),
  31113. /***/ 5030:
  31114. /***/ ((__unused_webpack_module, exports) => {
  31115. "use strict";
  31116. Object.defineProperty(exports, "__esModule", ({ value: true }));
  31117. function getUserAgent() {
  31118. if (typeof navigator === "object" && "userAgent" in navigator) {
  31119. return navigator.userAgent;
  31120. }
  31121. if (typeof process === "object" && process.version !== undefined) {
  31122. return `Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`;
  31123. }
  31124. return "<environment undetectable>";
  31125. }
  31126. exports.getUserAgent = getUserAgent;
  31127. //# sourceMappingURL=index.js.map
  31128. /***/ }),
  31129. /***/ 5840:
  31130. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31131. "use strict";
  31132. Object.defineProperty(exports, "__esModule", ({
  31133. value: true
  31134. }));
  31135. Object.defineProperty(exports, "NIL", ({
  31136. enumerable: true,
  31137. get: function () {
  31138. return _nil.default;
  31139. }
  31140. }));
  31141. Object.defineProperty(exports, "parse", ({
  31142. enumerable: true,
  31143. get: function () {
  31144. return _parse.default;
  31145. }
  31146. }));
  31147. Object.defineProperty(exports, "stringify", ({
  31148. enumerable: true,
  31149. get: function () {
  31150. return _stringify.default;
  31151. }
  31152. }));
  31153. Object.defineProperty(exports, "v1", ({
  31154. enumerable: true,
  31155. get: function () {
  31156. return _v.default;
  31157. }
  31158. }));
  31159. Object.defineProperty(exports, "v3", ({
  31160. enumerable: true,
  31161. get: function () {
  31162. return _v2.default;
  31163. }
  31164. }));
  31165. Object.defineProperty(exports, "v4", ({
  31166. enumerable: true,
  31167. get: function () {
  31168. return _v3.default;
  31169. }
  31170. }));
  31171. Object.defineProperty(exports, "v5", ({
  31172. enumerable: true,
  31173. get: function () {
  31174. return _v4.default;
  31175. }
  31176. }));
  31177. Object.defineProperty(exports, "validate", ({
  31178. enumerable: true,
  31179. get: function () {
  31180. return _validate.default;
  31181. }
  31182. }));
  31183. Object.defineProperty(exports, "version", ({
  31184. enumerable: true,
  31185. get: function () {
  31186. return _version.default;
  31187. }
  31188. }));
  31189. var _v = _interopRequireDefault(__nccwpck_require__(8628));
  31190. var _v2 = _interopRequireDefault(__nccwpck_require__(6409));
  31191. var _v3 = _interopRequireDefault(__nccwpck_require__(5122));
  31192. var _v4 = _interopRequireDefault(__nccwpck_require__(9120));
  31193. var _nil = _interopRequireDefault(__nccwpck_require__(5332));
  31194. var _version = _interopRequireDefault(__nccwpck_require__(2414));
  31195. var _validate = _interopRequireDefault(__nccwpck_require__(6900));
  31196. var _stringify = _interopRequireDefault(__nccwpck_require__(8950));
  31197. var _parse = _interopRequireDefault(__nccwpck_require__(2746));
  31198. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31199. /***/ }),
  31200. /***/ 4569:
  31201. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31202. "use strict";
  31203. Object.defineProperty(exports, "__esModule", ({
  31204. value: true
  31205. }));
  31206. exports["default"] = void 0;
  31207. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  31208. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31209. function md5(bytes) {
  31210. if (Array.isArray(bytes)) {
  31211. bytes = Buffer.from(bytes);
  31212. } else if (typeof bytes === 'string') {
  31213. bytes = Buffer.from(bytes, 'utf8');
  31214. }
  31215. return _crypto.default.createHash('md5').update(bytes).digest();
  31216. }
  31217. var _default = md5;
  31218. exports["default"] = _default;
  31219. /***/ }),
  31220. /***/ 2054:
  31221. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31222. "use strict";
  31223. Object.defineProperty(exports, "__esModule", ({
  31224. value: true
  31225. }));
  31226. exports["default"] = void 0;
  31227. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  31228. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31229. var _default = {
  31230. randomUUID: _crypto.default.randomUUID
  31231. };
  31232. exports["default"] = _default;
  31233. /***/ }),
  31234. /***/ 5332:
  31235. /***/ ((__unused_webpack_module, exports) => {
  31236. "use strict";
  31237. Object.defineProperty(exports, "__esModule", ({
  31238. value: true
  31239. }));
  31240. exports["default"] = void 0;
  31241. var _default = '00000000-0000-0000-0000-000000000000';
  31242. exports["default"] = _default;
  31243. /***/ }),
  31244. /***/ 2746:
  31245. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31246. "use strict";
  31247. Object.defineProperty(exports, "__esModule", ({
  31248. value: true
  31249. }));
  31250. exports["default"] = void 0;
  31251. var _validate = _interopRequireDefault(__nccwpck_require__(6900));
  31252. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31253. function parse(uuid) {
  31254. if (!(0, _validate.default)(uuid)) {
  31255. throw TypeError('Invalid UUID');
  31256. }
  31257. let v;
  31258. const arr = new Uint8Array(16); // Parse ########-....-....-....-............
  31259. arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;
  31260. arr[1] = v >>> 16 & 0xff;
  31261. arr[2] = v >>> 8 & 0xff;
  31262. arr[3] = v & 0xff; // Parse ........-####-....-....-............
  31263. arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;
  31264. arr[5] = v & 0xff; // Parse ........-....-####-....-............
  31265. arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;
  31266. arr[7] = v & 0xff; // Parse ........-....-....-####-............
  31267. arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;
  31268. arr[9] = v & 0xff; // Parse ........-....-....-....-############
  31269. // (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes)
  31270. arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;
  31271. arr[11] = v / 0x100000000 & 0xff;
  31272. arr[12] = v >>> 24 & 0xff;
  31273. arr[13] = v >>> 16 & 0xff;
  31274. arr[14] = v >>> 8 & 0xff;
  31275. arr[15] = v & 0xff;
  31276. return arr;
  31277. }
  31278. var _default = parse;
  31279. exports["default"] = _default;
  31280. /***/ }),
  31281. /***/ 814:
  31282. /***/ ((__unused_webpack_module, exports) => {
  31283. "use strict";
  31284. Object.defineProperty(exports, "__esModule", ({
  31285. value: true
  31286. }));
  31287. exports["default"] = void 0;
  31288. 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;
  31289. exports["default"] = _default;
  31290. /***/ }),
  31291. /***/ 807:
  31292. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31293. "use strict";
  31294. Object.defineProperty(exports, "__esModule", ({
  31295. value: true
  31296. }));
  31297. exports["default"] = rng;
  31298. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  31299. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31300. const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate
  31301. let poolPtr = rnds8Pool.length;
  31302. function rng() {
  31303. if (poolPtr > rnds8Pool.length - 16) {
  31304. _crypto.default.randomFillSync(rnds8Pool);
  31305. poolPtr = 0;
  31306. }
  31307. return rnds8Pool.slice(poolPtr, poolPtr += 16);
  31308. }
  31309. /***/ }),
  31310. /***/ 5274:
  31311. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31312. "use strict";
  31313. Object.defineProperty(exports, "__esModule", ({
  31314. value: true
  31315. }));
  31316. exports["default"] = void 0;
  31317. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  31318. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31319. function sha1(bytes) {
  31320. if (Array.isArray(bytes)) {
  31321. bytes = Buffer.from(bytes);
  31322. } else if (typeof bytes === 'string') {
  31323. bytes = Buffer.from(bytes, 'utf8');
  31324. }
  31325. return _crypto.default.createHash('sha1').update(bytes).digest();
  31326. }
  31327. var _default = sha1;
  31328. exports["default"] = _default;
  31329. /***/ }),
  31330. /***/ 8950:
  31331. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31332. "use strict";
  31333. Object.defineProperty(exports, "__esModule", ({
  31334. value: true
  31335. }));
  31336. exports["default"] = void 0;
  31337. exports.unsafeStringify = unsafeStringify;
  31338. var _validate = _interopRequireDefault(__nccwpck_require__(6900));
  31339. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31340. /**
  31341. * Convert array of 16 byte values to UUID string format of the form:
  31342. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  31343. */
  31344. const byteToHex = [];
  31345. for (let i = 0; i < 256; ++i) {
  31346. byteToHex.push((i + 0x100).toString(16).slice(1));
  31347. }
  31348. function unsafeStringify(arr, offset = 0) {
  31349. // Note: Be careful editing this code! It's been tuned for performance
  31350. // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
  31351. 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]];
  31352. }
  31353. function stringify(arr, offset = 0) {
  31354. const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one
  31355. // of the following:
  31356. // - One or more input array values don't map to a hex octet (leading to
  31357. // "undefined" in the uuid)
  31358. // - Invalid input values for the RFC `version` or `variant` fields
  31359. if (!(0, _validate.default)(uuid)) {
  31360. throw TypeError('Stringified UUID is invalid');
  31361. }
  31362. return uuid;
  31363. }
  31364. var _default = stringify;
  31365. exports["default"] = _default;
  31366. /***/ }),
  31367. /***/ 8628:
  31368. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31369. "use strict";
  31370. Object.defineProperty(exports, "__esModule", ({
  31371. value: true
  31372. }));
  31373. exports["default"] = void 0;
  31374. var _rng = _interopRequireDefault(__nccwpck_require__(807));
  31375. var _stringify = __nccwpck_require__(8950);
  31376. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31377. // **`v1()` - Generate time-based UUID**
  31378. //
  31379. // Inspired by https://github.com/LiosK/UUID.js
  31380. // and http://docs.python.org/library/uuid.html
  31381. let _nodeId;
  31382. let _clockseq; // Previous uuid creation time
  31383. let _lastMSecs = 0;
  31384. let _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details
  31385. function v1(options, buf, offset) {
  31386. let i = buf && offset || 0;
  31387. const b = buf || new Array(16);
  31388. options = options || {};
  31389. let node = options.node || _nodeId;
  31390. let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not
  31391. // specified. We do this lazily to minimize issues related to insufficient
  31392. // system entropy. See #189
  31393. if (node == null || clockseq == null) {
  31394. const seedBytes = options.random || (options.rng || _rng.default)();
  31395. if (node == null) {
  31396. // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
  31397. node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];
  31398. }
  31399. if (clockseq == null) {
  31400. // Per 4.2.2, randomize (14 bit) clockseq
  31401. clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
  31402. }
  31403. } // UUID timestamps are 100 nano-second units since the Gregorian epoch,
  31404. // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
  31405. // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
  31406. // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
  31407. let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock
  31408. // cycle to simulate higher resolution clock
  31409. let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)
  31410. const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression
  31411. if (dt < 0 && options.clockseq === undefined) {
  31412. clockseq = clockseq + 1 & 0x3fff;
  31413. } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
  31414. // time interval
  31415. if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
  31416. nsecs = 0;
  31417. } // Per 4.2.1.2 Throw error if too many uuids are requested
  31418. if (nsecs >= 10000) {
  31419. throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");
  31420. }
  31421. _lastMSecs = msecs;
  31422. _lastNSecs = nsecs;
  31423. _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
  31424. msecs += 12219292800000; // `time_low`
  31425. const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
  31426. b[i++] = tl >>> 24 & 0xff;
  31427. b[i++] = tl >>> 16 & 0xff;
  31428. b[i++] = tl >>> 8 & 0xff;
  31429. b[i++] = tl & 0xff; // `time_mid`
  31430. const tmh = msecs / 0x100000000 * 10000 & 0xfffffff;
  31431. b[i++] = tmh >>> 8 & 0xff;
  31432. b[i++] = tmh & 0xff; // `time_high_and_version`
  31433. b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
  31434. b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
  31435. b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`
  31436. b[i++] = clockseq & 0xff; // `node`
  31437. for (let n = 0; n < 6; ++n) {
  31438. b[i + n] = node[n];
  31439. }
  31440. return buf || (0, _stringify.unsafeStringify)(b);
  31441. }
  31442. var _default = v1;
  31443. exports["default"] = _default;
  31444. /***/ }),
  31445. /***/ 6409:
  31446. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31447. "use strict";
  31448. Object.defineProperty(exports, "__esModule", ({
  31449. value: true
  31450. }));
  31451. exports["default"] = void 0;
  31452. var _v = _interopRequireDefault(__nccwpck_require__(5998));
  31453. var _md = _interopRequireDefault(__nccwpck_require__(4569));
  31454. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31455. const v3 = (0, _v.default)('v3', 0x30, _md.default);
  31456. var _default = v3;
  31457. exports["default"] = _default;
  31458. /***/ }),
  31459. /***/ 5998:
  31460. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31461. "use strict";
  31462. Object.defineProperty(exports, "__esModule", ({
  31463. value: true
  31464. }));
  31465. exports.URL = exports.DNS = void 0;
  31466. exports["default"] = v35;
  31467. var _stringify = __nccwpck_require__(8950);
  31468. var _parse = _interopRequireDefault(__nccwpck_require__(2746));
  31469. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31470. function stringToBytes(str) {
  31471. str = unescape(encodeURIComponent(str)); // UTF8 escape
  31472. const bytes = [];
  31473. for (let i = 0; i < str.length; ++i) {
  31474. bytes.push(str.charCodeAt(i));
  31475. }
  31476. return bytes;
  31477. }
  31478. const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
  31479. exports.DNS = DNS;
  31480. const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';
  31481. exports.URL = URL;
  31482. function v35(name, version, hashfunc) {
  31483. function generateUUID(value, namespace, buf, offset) {
  31484. var _namespace;
  31485. if (typeof value === 'string') {
  31486. value = stringToBytes(value);
  31487. }
  31488. if (typeof namespace === 'string') {
  31489. namespace = (0, _parse.default)(namespace);
  31490. }
  31491. if (((_namespace = namespace) === null || _namespace === void 0 ? void 0 : _namespace.length) !== 16) {
  31492. throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');
  31493. } // Compute hash of namespace and value, Per 4.3
  31494. // Future: Use spread syntax when supported on all platforms, e.g. `bytes =
  31495. // hashfunc([...namespace, ... value])`
  31496. let bytes = new Uint8Array(16 + value.length);
  31497. bytes.set(namespace);
  31498. bytes.set(value, namespace.length);
  31499. bytes = hashfunc(bytes);
  31500. bytes[6] = bytes[6] & 0x0f | version;
  31501. bytes[8] = bytes[8] & 0x3f | 0x80;
  31502. if (buf) {
  31503. offset = offset || 0;
  31504. for (let i = 0; i < 16; ++i) {
  31505. buf[offset + i] = bytes[i];
  31506. }
  31507. return buf;
  31508. }
  31509. return (0, _stringify.unsafeStringify)(bytes);
  31510. } // Function#name is not settable on some platforms (#270)
  31511. try {
  31512. generateUUID.name = name; // eslint-disable-next-line no-empty
  31513. } catch (err) {} // For CommonJS default export support
  31514. generateUUID.DNS = DNS;
  31515. generateUUID.URL = URL;
  31516. return generateUUID;
  31517. }
  31518. /***/ }),
  31519. /***/ 5122:
  31520. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31521. "use strict";
  31522. Object.defineProperty(exports, "__esModule", ({
  31523. value: true
  31524. }));
  31525. exports["default"] = void 0;
  31526. var _native = _interopRequireDefault(__nccwpck_require__(2054));
  31527. var _rng = _interopRequireDefault(__nccwpck_require__(807));
  31528. var _stringify = __nccwpck_require__(8950);
  31529. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31530. function v4(options, buf, offset) {
  31531. if (_native.default.randomUUID && !buf && !options) {
  31532. return _native.default.randomUUID();
  31533. }
  31534. options = options || {};
  31535. const rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  31536. rnds[6] = rnds[6] & 0x0f | 0x40;
  31537. rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
  31538. if (buf) {
  31539. offset = offset || 0;
  31540. for (let i = 0; i < 16; ++i) {
  31541. buf[offset + i] = rnds[i];
  31542. }
  31543. return buf;
  31544. }
  31545. return (0, _stringify.unsafeStringify)(rnds);
  31546. }
  31547. var _default = v4;
  31548. exports["default"] = _default;
  31549. /***/ }),
  31550. /***/ 9120:
  31551. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31552. "use strict";
  31553. Object.defineProperty(exports, "__esModule", ({
  31554. value: true
  31555. }));
  31556. exports["default"] = void 0;
  31557. var _v = _interopRequireDefault(__nccwpck_require__(5998));
  31558. var _sha = _interopRequireDefault(__nccwpck_require__(5274));
  31559. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31560. const v5 = (0, _v.default)('v5', 0x50, _sha.default);
  31561. var _default = v5;
  31562. exports["default"] = _default;
  31563. /***/ }),
  31564. /***/ 6900:
  31565. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31566. "use strict";
  31567. Object.defineProperty(exports, "__esModule", ({
  31568. value: true
  31569. }));
  31570. exports["default"] = void 0;
  31571. var _regex = _interopRequireDefault(__nccwpck_require__(814));
  31572. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31573. function validate(uuid) {
  31574. return typeof uuid === 'string' && _regex.default.test(uuid);
  31575. }
  31576. var _default = validate;
  31577. exports["default"] = _default;
  31578. /***/ }),
  31579. /***/ 2414:
  31580. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31581. "use strict";
  31582. Object.defineProperty(exports, "__esModule", ({
  31583. value: true
  31584. }));
  31585. exports["default"] = void 0;
  31586. var _validate = _interopRequireDefault(__nccwpck_require__(6900));
  31587. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31588. function version(uuid) {
  31589. if (!(0, _validate.default)(uuid)) {
  31590. throw TypeError('Invalid UUID');
  31591. }
  31592. return parseInt(uuid.slice(14, 15), 16);
  31593. }
  31594. var _default = version;
  31595. exports["default"] = _default;
  31596. /***/ }),
  31597. /***/ 2940:
  31598. /***/ ((module) => {
  31599. // Returns a wrapper function that returns a wrapped callback
  31600. // The wrapper function should do some stuff, and return a
  31601. // presumably different callback function.
  31602. // This makes sure that own properties are retained, so that
  31603. // decorations and such are not lost along the way.
  31604. module.exports = wrappy
  31605. function wrappy (fn, cb) {
  31606. if (fn && cb) return wrappy(fn)(cb)
  31607. if (typeof fn !== 'function')
  31608. throw new TypeError('need wrapper function')
  31609. Object.keys(fn).forEach(function (k) {
  31610. wrapper[k] = fn[k]
  31611. })
  31612. return wrapper
  31613. function wrapper() {
  31614. var args = new Array(arguments.length)
  31615. for (var i = 0; i < args.length; i++) {
  31616. args[i] = arguments[i]
  31617. }
  31618. var ret = fn.apply(this, args)
  31619. var cb = args[args.length-1]
  31620. if (typeof ret === 'function' && ret !== cb) {
  31621. Object.keys(cb).forEach(function (k) {
  31622. ret[k] = cb[k]
  31623. })
  31624. }
  31625. return ret
  31626. }
  31627. }
  31628. /***/ }),
  31629. /***/ 9491:
  31630. /***/ ((module) => {
  31631. "use strict";
  31632. module.exports = require("assert");
  31633. /***/ }),
  31634. /***/ 852:
  31635. /***/ ((module) => {
  31636. "use strict";
  31637. module.exports = require("async_hooks");
  31638. /***/ }),
  31639. /***/ 4300:
  31640. /***/ ((module) => {
  31641. "use strict";
  31642. module.exports = require("buffer");
  31643. /***/ }),
  31644. /***/ 2081:
  31645. /***/ ((module) => {
  31646. "use strict";
  31647. module.exports = require("child_process");
  31648. /***/ }),
  31649. /***/ 6206:
  31650. /***/ ((module) => {
  31651. "use strict";
  31652. module.exports = require("console");
  31653. /***/ }),
  31654. /***/ 6113:
  31655. /***/ ((module) => {
  31656. "use strict";
  31657. module.exports = require("crypto");
  31658. /***/ }),
  31659. /***/ 7643:
  31660. /***/ ((module) => {
  31661. "use strict";
  31662. module.exports = require("diagnostics_channel");
  31663. /***/ }),
  31664. /***/ 2361:
  31665. /***/ ((module) => {
  31666. "use strict";
  31667. module.exports = require("events");
  31668. /***/ }),
  31669. /***/ 7147:
  31670. /***/ ((module) => {
  31671. "use strict";
  31672. module.exports = require("fs");
  31673. /***/ }),
  31674. /***/ 3685:
  31675. /***/ ((module) => {
  31676. "use strict";
  31677. module.exports = require("http");
  31678. /***/ }),
  31679. /***/ 5158:
  31680. /***/ ((module) => {
  31681. "use strict";
  31682. module.exports = require("http2");
  31683. /***/ }),
  31684. /***/ 5687:
  31685. /***/ ((module) => {
  31686. "use strict";
  31687. module.exports = require("https");
  31688. /***/ }),
  31689. /***/ 1808:
  31690. /***/ ((module) => {
  31691. "use strict";
  31692. module.exports = require("net");
  31693. /***/ }),
  31694. /***/ 6005:
  31695. /***/ ((module) => {
  31696. "use strict";
  31697. module.exports = require("node:crypto");
  31698. /***/ }),
  31699. /***/ 5673:
  31700. /***/ ((module) => {
  31701. "use strict";
  31702. module.exports = require("node:events");
  31703. /***/ }),
  31704. /***/ 4492:
  31705. /***/ ((module) => {
  31706. "use strict";
  31707. module.exports = require("node:stream");
  31708. /***/ }),
  31709. /***/ 7261:
  31710. /***/ ((module) => {
  31711. "use strict";
  31712. module.exports = require("node:util");
  31713. /***/ }),
  31714. /***/ 2037:
  31715. /***/ ((module) => {
  31716. "use strict";
  31717. module.exports = require("os");
  31718. /***/ }),
  31719. /***/ 1017:
  31720. /***/ ((module) => {
  31721. "use strict";
  31722. module.exports = require("path");
  31723. /***/ }),
  31724. /***/ 4074:
  31725. /***/ ((module) => {
  31726. "use strict";
  31727. module.exports = require("perf_hooks");
  31728. /***/ }),
  31729. /***/ 3477:
  31730. /***/ ((module) => {
  31731. "use strict";
  31732. module.exports = require("querystring");
  31733. /***/ }),
  31734. /***/ 2781:
  31735. /***/ ((module) => {
  31736. "use strict";
  31737. module.exports = require("stream");
  31738. /***/ }),
  31739. /***/ 5356:
  31740. /***/ ((module) => {
  31741. "use strict";
  31742. module.exports = require("stream/web");
  31743. /***/ }),
  31744. /***/ 1576:
  31745. /***/ ((module) => {
  31746. "use strict";
  31747. module.exports = require("string_decoder");
  31748. /***/ }),
  31749. /***/ 9512:
  31750. /***/ ((module) => {
  31751. "use strict";
  31752. module.exports = require("timers");
  31753. /***/ }),
  31754. /***/ 4404:
  31755. /***/ ((module) => {
  31756. "use strict";
  31757. module.exports = require("tls");
  31758. /***/ }),
  31759. /***/ 7310:
  31760. /***/ ((module) => {
  31761. "use strict";
  31762. module.exports = require("url");
  31763. /***/ }),
  31764. /***/ 3837:
  31765. /***/ ((module) => {
  31766. "use strict";
  31767. module.exports = require("util");
  31768. /***/ }),
  31769. /***/ 9830:
  31770. /***/ ((module) => {
  31771. "use strict";
  31772. module.exports = require("util/types");
  31773. /***/ }),
  31774. /***/ 1267:
  31775. /***/ ((module) => {
  31776. "use strict";
  31777. module.exports = require("worker_threads");
  31778. /***/ }),
  31779. /***/ 9796:
  31780. /***/ ((module) => {
  31781. "use strict";
  31782. module.exports = require("zlib");
  31783. /***/ }),
  31784. /***/ 2960:
  31785. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  31786. "use strict";
  31787. const WritableStream = (__nccwpck_require__(4492).Writable)
  31788. const inherits = (__nccwpck_require__(7261).inherits)
  31789. const StreamSearch = __nccwpck_require__(1142)
  31790. const PartStream = __nccwpck_require__(1620)
  31791. const HeaderParser = __nccwpck_require__(2032)
  31792. const DASH = 45
  31793. const B_ONEDASH = Buffer.from('-')
  31794. const B_CRLF = Buffer.from('\r\n')
  31795. const EMPTY_FN = function () {}
  31796. function Dicer (cfg) {
  31797. if (!(this instanceof Dicer)) { return new Dicer(cfg) }
  31798. WritableStream.call(this, cfg)
  31799. if (!cfg || (!cfg.headerFirst && typeof cfg.boundary !== 'string')) { throw new TypeError('Boundary required') }
  31800. if (typeof cfg.boundary === 'string') { this.setBoundary(cfg.boundary) } else { this._bparser = undefined }
  31801. this._headerFirst = cfg.headerFirst
  31802. this._dashes = 0
  31803. this._parts = 0
  31804. this._finished = false
  31805. this._realFinish = false
  31806. this._isPreamble = true
  31807. this._justMatched = false
  31808. this._firstWrite = true
  31809. this._inHeader = true
  31810. this._part = undefined
  31811. this._cb = undefined
  31812. this._ignoreData = false
  31813. this._partOpts = { highWaterMark: cfg.partHwm }
  31814. this._pause = false
  31815. const self = this
  31816. this._hparser = new HeaderParser(cfg)
  31817. this._hparser.on('header', function (header) {
  31818. self._inHeader = false
  31819. self._part.emit('header', header)
  31820. })
  31821. }
  31822. inherits(Dicer, WritableStream)
  31823. Dicer.prototype.emit = function (ev) {
  31824. if (ev === 'finish' && !this._realFinish) {
  31825. if (!this._finished) {
  31826. const self = this
  31827. process.nextTick(function () {
  31828. self.emit('error', new Error('Unexpected end of multipart data'))
  31829. if (self._part && !self._ignoreData) {
  31830. const type = (self._isPreamble ? 'Preamble' : 'Part')
  31831. self._part.emit('error', new Error(type + ' terminated early due to unexpected end of multipart data'))
  31832. self._part.push(null)
  31833. process.nextTick(function () {
  31834. self._realFinish = true
  31835. self.emit('finish')
  31836. self._realFinish = false
  31837. })
  31838. return
  31839. }
  31840. self._realFinish = true
  31841. self.emit('finish')
  31842. self._realFinish = false
  31843. })
  31844. }
  31845. } else { WritableStream.prototype.emit.apply(this, arguments) }
  31846. }
  31847. Dicer.prototype._write = function (data, encoding, cb) {
  31848. // ignore unexpected data (e.g. extra trailer data after finished)
  31849. if (!this._hparser && !this._bparser) { return cb() }
  31850. if (this._headerFirst && this._isPreamble) {
  31851. if (!this._part) {
  31852. this._part = new PartStream(this._partOpts)
  31853. if (this.listenerCount('preamble') !== 0) { this.emit('preamble', this._part) } else { this._ignore() }
  31854. }
  31855. const r = this._hparser.push(data)
  31856. if (!this._inHeader && r !== undefined && r < data.length) { data = data.slice(r) } else { return cb() }
  31857. }
  31858. // allows for "easier" testing
  31859. if (this._firstWrite) {
  31860. this._bparser.push(B_CRLF)
  31861. this._firstWrite = false
  31862. }
  31863. this._bparser.push(data)
  31864. if (this._pause) { this._cb = cb } else { cb() }
  31865. }
  31866. Dicer.prototype.reset = function () {
  31867. this._part = undefined
  31868. this._bparser = undefined
  31869. this._hparser = undefined
  31870. }
  31871. Dicer.prototype.setBoundary = function (boundary) {
  31872. const self = this
  31873. this._bparser = new StreamSearch('\r\n--' + boundary)
  31874. this._bparser.on('info', function (isMatch, data, start, end) {
  31875. self._oninfo(isMatch, data, start, end)
  31876. })
  31877. }
  31878. Dicer.prototype._ignore = function () {
  31879. if (this._part && !this._ignoreData) {
  31880. this._ignoreData = true
  31881. this._part.on('error', EMPTY_FN)
  31882. // we must perform some kind of read on the stream even though we are
  31883. // ignoring the data, otherwise node's Readable stream will not emit 'end'
  31884. // after pushing null to the stream
  31885. this._part.resume()
  31886. }
  31887. }
  31888. Dicer.prototype._oninfo = function (isMatch, data, start, end) {
  31889. let buf; const self = this; let i = 0; let r; let shouldWriteMore = true
  31890. if (!this._part && this._justMatched && data) {
  31891. while (this._dashes < 2 && (start + i) < end) {
  31892. if (data[start + i] === DASH) {
  31893. ++i
  31894. ++this._dashes
  31895. } else {
  31896. if (this._dashes) { buf = B_ONEDASH }
  31897. this._dashes = 0
  31898. break
  31899. }
  31900. }
  31901. if (this._dashes === 2) {
  31902. if ((start + i) < end && this.listenerCount('trailer') !== 0) { this.emit('trailer', data.slice(start + i, end)) }
  31903. this.reset()
  31904. this._finished = true
  31905. // no more parts will be added
  31906. if (self._parts === 0) {
  31907. self._realFinish = true
  31908. self.emit('finish')
  31909. self._realFinish = false
  31910. }
  31911. }
  31912. if (this._dashes) { return }
  31913. }
  31914. if (this._justMatched) { this._justMatched = false }
  31915. if (!this._part) {
  31916. this._part = new PartStream(this._partOpts)
  31917. this._part._read = function (n) {
  31918. self._unpause()
  31919. }
  31920. if (this._isPreamble && this.listenerCount('preamble') !== 0) {
  31921. this.emit('preamble', this._part)
  31922. } else if (this._isPreamble !== true && this.listenerCount('part') !== 0) {
  31923. this.emit('part', this._part)
  31924. } else {
  31925. this._ignore()
  31926. }
  31927. if (!this._isPreamble) { this._inHeader = true }
  31928. }
  31929. if (data && start < end && !this._ignoreData) {
  31930. if (this._isPreamble || !this._inHeader) {
  31931. if (buf) { shouldWriteMore = this._part.push(buf) }
  31932. shouldWriteMore = this._part.push(data.slice(start, end))
  31933. if (!shouldWriteMore) { this._pause = true }
  31934. } else if (!this._isPreamble && this._inHeader) {
  31935. if (buf) { this._hparser.push(buf) }
  31936. r = this._hparser.push(data.slice(start, end))
  31937. if (!this._inHeader && r !== undefined && r < end) { this._oninfo(false, data, start + r, end) }
  31938. }
  31939. }
  31940. if (isMatch) {
  31941. this._hparser.reset()
  31942. if (this._isPreamble) { this._isPreamble = false } else {
  31943. if (start !== end) {
  31944. ++this._parts
  31945. this._part.on('end', function () {
  31946. if (--self._parts === 0) {
  31947. if (self._finished) {
  31948. self._realFinish = true
  31949. self.emit('finish')
  31950. self._realFinish = false
  31951. } else {
  31952. self._unpause()
  31953. }
  31954. }
  31955. })
  31956. }
  31957. }
  31958. this._part.push(null)
  31959. this._part = undefined
  31960. this._ignoreData = false
  31961. this._justMatched = true
  31962. this._dashes = 0
  31963. }
  31964. }
  31965. Dicer.prototype._unpause = function () {
  31966. if (!this._pause) { return }
  31967. this._pause = false
  31968. if (this._cb) {
  31969. const cb = this._cb
  31970. this._cb = undefined
  31971. cb()
  31972. }
  31973. }
  31974. module.exports = Dicer
  31975. /***/ }),
  31976. /***/ 2032:
  31977. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  31978. "use strict";
  31979. const EventEmitter = (__nccwpck_require__(5673).EventEmitter)
  31980. const inherits = (__nccwpck_require__(7261).inherits)
  31981. const getLimit = __nccwpck_require__(1467)
  31982. const StreamSearch = __nccwpck_require__(1142)
  31983. const B_DCRLF = Buffer.from('\r\n\r\n')
  31984. const RE_CRLF = /\r\n/g
  31985. const RE_HDR = /^([^:]+):[ \t]?([\x00-\xFF]+)?$/ // eslint-disable-line no-control-regex
  31986. function HeaderParser (cfg) {
  31987. EventEmitter.call(this)
  31988. cfg = cfg || {}
  31989. const self = this
  31990. this.nread = 0
  31991. this.maxed = false
  31992. this.npairs = 0
  31993. this.maxHeaderPairs = getLimit(cfg, 'maxHeaderPairs', 2000)
  31994. this.maxHeaderSize = getLimit(cfg, 'maxHeaderSize', 80 * 1024)
  31995. this.buffer = ''
  31996. this.header = {}
  31997. this.finished = false
  31998. this.ss = new StreamSearch(B_DCRLF)
  31999. this.ss.on('info', function (isMatch, data, start, end) {
  32000. if (data && !self.maxed) {
  32001. if (self.nread + end - start >= self.maxHeaderSize) {
  32002. end = self.maxHeaderSize - self.nread + start
  32003. self.nread = self.maxHeaderSize
  32004. self.maxed = true
  32005. } else { self.nread += (end - start) }
  32006. self.buffer += data.toString('binary', start, end)
  32007. }
  32008. if (isMatch) { self._finish() }
  32009. })
  32010. }
  32011. inherits(HeaderParser, EventEmitter)
  32012. HeaderParser.prototype.push = function (data) {
  32013. const r = this.ss.push(data)
  32014. if (this.finished) { return r }
  32015. }
  32016. HeaderParser.prototype.reset = function () {
  32017. this.finished = false
  32018. this.buffer = ''
  32019. this.header = {}
  32020. this.ss.reset()
  32021. }
  32022. HeaderParser.prototype._finish = function () {
  32023. if (this.buffer) { this._parseHeader() }
  32024. this.ss.matches = this.ss.maxMatches
  32025. const header = this.header
  32026. this.header = {}
  32027. this.buffer = ''
  32028. this.finished = true
  32029. this.nread = this.npairs = 0
  32030. this.maxed = false
  32031. this.emit('header', header)
  32032. }
  32033. HeaderParser.prototype._parseHeader = function () {
  32034. if (this.npairs === this.maxHeaderPairs) { return }
  32035. const lines = this.buffer.split(RE_CRLF)
  32036. const len = lines.length
  32037. let m, h
  32038. for (var i = 0; i < len; ++i) { // eslint-disable-line no-var
  32039. if (lines[i].length === 0) { continue }
  32040. if (lines[i][0] === '\t' || lines[i][0] === ' ') {
  32041. // folded header content
  32042. // RFC2822 says to just remove the CRLF and not the whitespace following
  32043. // it, so we follow the RFC and include the leading whitespace ...
  32044. if (h) {
  32045. this.header[h][this.header[h].length - 1] += lines[i]
  32046. continue
  32047. }
  32048. }
  32049. const posColon = lines[i].indexOf(':')
  32050. if (
  32051. posColon === -1 ||
  32052. posColon === 0
  32053. ) {
  32054. return
  32055. }
  32056. m = RE_HDR.exec(lines[i])
  32057. h = m[1].toLowerCase()
  32058. this.header[h] = this.header[h] || []
  32059. this.header[h].push((m[2] || ''))
  32060. if (++this.npairs === this.maxHeaderPairs) { break }
  32061. }
  32062. }
  32063. module.exports = HeaderParser
  32064. /***/ }),
  32065. /***/ 1620:
  32066. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  32067. "use strict";
  32068. const inherits = (__nccwpck_require__(7261).inherits)
  32069. const ReadableStream = (__nccwpck_require__(4492).Readable)
  32070. function PartStream (opts) {
  32071. ReadableStream.call(this, opts)
  32072. }
  32073. inherits(PartStream, ReadableStream)
  32074. PartStream.prototype._read = function (n) {}
  32075. module.exports = PartStream
  32076. /***/ }),
  32077. /***/ 1142:
  32078. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  32079. "use strict";
  32080. /**
  32081. * Copyright Brian White. All rights reserved.
  32082. *
  32083. * @see https://github.com/mscdex/streamsearch
  32084. *
  32085. * Permission is hereby granted, free of charge, to any person obtaining a copy
  32086. * of this software and associated documentation files (the "Software"), to
  32087. * deal in the Software without restriction, including without limitation the
  32088. * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  32089. * sell copies of the Software, and to permit persons to whom the Software is
  32090. * furnished to do so, subject to the following conditions:
  32091. *
  32092. * The above copyright notice and this permission notice shall be included in
  32093. * all copies or substantial portions of the Software.
  32094. *
  32095. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  32096. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  32097. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  32098. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  32099. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  32100. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  32101. * IN THE SOFTWARE.
  32102. *
  32103. * Based heavily on the Streaming Boyer-Moore-Horspool C++ implementation
  32104. * by Hongli Lai at: https://github.com/FooBarWidget/boyer-moore-horspool
  32105. */
  32106. const EventEmitter = (__nccwpck_require__(5673).EventEmitter)
  32107. const inherits = (__nccwpck_require__(7261).inherits)
  32108. function SBMH (needle) {
  32109. if (typeof needle === 'string') {
  32110. needle = Buffer.from(needle)
  32111. }
  32112. if (!Buffer.isBuffer(needle)) {
  32113. throw new TypeError('The needle has to be a String or a Buffer.')
  32114. }
  32115. const needleLength = needle.length
  32116. if (needleLength === 0) {
  32117. throw new Error('The needle cannot be an empty String/Buffer.')
  32118. }
  32119. if (needleLength > 256) {
  32120. throw new Error('The needle cannot have a length bigger than 256.')
  32121. }
  32122. this.maxMatches = Infinity
  32123. this.matches = 0
  32124. this._occ = new Array(256)
  32125. .fill(needleLength) // Initialize occurrence table.
  32126. this._lookbehind_size = 0
  32127. this._needle = needle
  32128. this._bufpos = 0
  32129. this._lookbehind = Buffer.alloc(needleLength)
  32130. // Populate occurrence table with analysis of the needle,
  32131. // ignoring last letter.
  32132. for (var i = 0; i < needleLength - 1; ++i) { // eslint-disable-line no-var
  32133. this._occ[needle[i]] = needleLength - 1 - i
  32134. }
  32135. }
  32136. inherits(SBMH, EventEmitter)
  32137. SBMH.prototype.reset = function () {
  32138. this._lookbehind_size = 0
  32139. this.matches = 0
  32140. this._bufpos = 0
  32141. }
  32142. SBMH.prototype.push = function (chunk, pos) {
  32143. if (!Buffer.isBuffer(chunk)) {
  32144. chunk = Buffer.from(chunk, 'binary')
  32145. }
  32146. const chlen = chunk.length
  32147. this._bufpos = pos || 0
  32148. let r
  32149. while (r !== chlen && this.matches < this.maxMatches) { r = this._sbmh_feed(chunk) }
  32150. return r
  32151. }
  32152. SBMH.prototype._sbmh_feed = function (data) {
  32153. const len = data.length
  32154. const needle = this._needle
  32155. const needleLength = needle.length
  32156. const lastNeedleChar = needle[needleLength - 1]
  32157. // Positive: points to a position in `data`
  32158. // pos == 3 points to data[3]
  32159. // Negative: points to a position in the lookbehind buffer
  32160. // pos == -2 points to lookbehind[lookbehind_size - 2]
  32161. let pos = -this._lookbehind_size
  32162. let ch
  32163. if (pos < 0) {
  32164. // Lookbehind buffer is not empty. Perform Boyer-Moore-Horspool
  32165. // search with character lookup code that considers both the
  32166. // lookbehind buffer and the current round's haystack data.
  32167. //
  32168. // Loop until
  32169. // there is a match.
  32170. // or until
  32171. // we've moved past the position that requires the
  32172. // lookbehind buffer. In this case we switch to the
  32173. // optimized loop.
  32174. // or until
  32175. // the character to look at lies outside the haystack.
  32176. while (pos < 0 && pos <= len - needleLength) {
  32177. ch = this._sbmh_lookup_char(data, pos + needleLength - 1)
  32178. if (
  32179. ch === lastNeedleChar &&
  32180. this._sbmh_memcmp(data, pos, needleLength - 1)
  32181. ) {
  32182. this._lookbehind_size = 0
  32183. ++this.matches
  32184. this.emit('info', true)
  32185. return (this._bufpos = pos + needleLength)
  32186. }
  32187. pos += this._occ[ch]
  32188. }
  32189. // No match.
  32190. if (pos < 0) {
  32191. // There's too few data for Boyer-Moore-Horspool to run,
  32192. // so let's use a different algorithm to skip as much as
  32193. // we can.
  32194. // Forward pos until
  32195. // the trailing part of lookbehind + data
  32196. // looks like the beginning of the needle
  32197. // or until
  32198. // pos == 0
  32199. while (pos < 0 && !this._sbmh_memcmp(data, pos, len - pos)) { ++pos }
  32200. }
  32201. if (pos >= 0) {
  32202. // Discard lookbehind buffer.
  32203. this.emit('info', false, this._lookbehind, 0, this._lookbehind_size)
  32204. this._lookbehind_size = 0
  32205. } else {
  32206. // Cut off part of the lookbehind buffer that has
  32207. // been processed and append the entire haystack
  32208. // into it.
  32209. const bytesToCutOff = this._lookbehind_size + pos
  32210. if (bytesToCutOff > 0) {
  32211. // The cut off data is guaranteed not to contain the needle.
  32212. this.emit('info', false, this._lookbehind, 0, bytesToCutOff)
  32213. }
  32214. this._lookbehind.copy(this._lookbehind, 0, bytesToCutOff,
  32215. this._lookbehind_size - bytesToCutOff)
  32216. this._lookbehind_size -= bytesToCutOff
  32217. data.copy(this._lookbehind, this._lookbehind_size)
  32218. this._lookbehind_size += len
  32219. this._bufpos = len
  32220. return len
  32221. }
  32222. }
  32223. pos += (pos >= 0) * this._bufpos
  32224. // Lookbehind buffer is now empty. We only need to check if the
  32225. // needle is in the haystack.
  32226. if (data.indexOf(needle, pos) !== -1) {
  32227. pos = data.indexOf(needle, pos)
  32228. ++this.matches
  32229. if (pos > 0) { this.emit('info', true, data, this._bufpos, pos) } else { this.emit('info', true) }
  32230. return (this._bufpos = pos + needleLength)
  32231. } else {
  32232. pos = len - needleLength
  32233. }
  32234. // There was no match. If there's trailing haystack data that we cannot
  32235. // match yet using the Boyer-Moore-Horspool algorithm (because the trailing
  32236. // data is less than the needle size) then match using a modified
  32237. // algorithm that starts matching from the beginning instead of the end.
  32238. // Whatever trailing data is left after running this algorithm is added to
  32239. // the lookbehind buffer.
  32240. while (
  32241. pos < len &&
  32242. (
  32243. data[pos] !== needle[0] ||
  32244. (
  32245. (Buffer.compare(
  32246. data.subarray(pos, pos + len - pos),
  32247. needle.subarray(0, len - pos)
  32248. ) !== 0)
  32249. )
  32250. )
  32251. ) {
  32252. ++pos
  32253. }
  32254. if (pos < len) {
  32255. data.copy(this._lookbehind, 0, pos, pos + (len - pos))
  32256. this._lookbehind_size = len - pos
  32257. }
  32258. // Everything until pos is guaranteed not to contain needle data.
  32259. if (pos > 0) { this.emit('info', false, data, this._bufpos, pos < len ? pos : len) }
  32260. this._bufpos = len
  32261. return len
  32262. }
  32263. SBMH.prototype._sbmh_lookup_char = function (data, pos) {
  32264. return (pos < 0)
  32265. ? this._lookbehind[this._lookbehind_size + pos]
  32266. : data[pos]
  32267. }
  32268. SBMH.prototype._sbmh_memcmp = function (data, pos, len) {
  32269. for (var i = 0; i < len; ++i) { // eslint-disable-line no-var
  32270. if (this._sbmh_lookup_char(data, pos + i) !== this._needle[i]) { return false }
  32271. }
  32272. return true
  32273. }
  32274. module.exports = SBMH
  32275. /***/ }),
  32276. /***/ 727:
  32277. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  32278. "use strict";
  32279. const WritableStream = (__nccwpck_require__(4492).Writable)
  32280. const { inherits } = __nccwpck_require__(7261)
  32281. const Dicer = __nccwpck_require__(2960)
  32282. const MultipartParser = __nccwpck_require__(2183)
  32283. const UrlencodedParser = __nccwpck_require__(8306)
  32284. const parseParams = __nccwpck_require__(1854)
  32285. function Busboy (opts) {
  32286. if (!(this instanceof Busboy)) { return new Busboy(opts) }
  32287. if (typeof opts !== 'object') {
  32288. throw new TypeError('Busboy expected an options-Object.')
  32289. }
  32290. if (typeof opts.headers !== 'object') {
  32291. throw new TypeError('Busboy expected an options-Object with headers-attribute.')
  32292. }
  32293. if (typeof opts.headers['content-type'] !== 'string') {
  32294. throw new TypeError('Missing Content-Type-header.')
  32295. }
  32296. const {
  32297. headers,
  32298. ...streamOptions
  32299. } = opts
  32300. this.opts = {
  32301. autoDestroy: false,
  32302. ...streamOptions
  32303. }
  32304. WritableStream.call(this, this.opts)
  32305. this._done = false
  32306. this._parser = this.getParserByHeaders(headers)
  32307. this._finished = false
  32308. }
  32309. inherits(Busboy, WritableStream)
  32310. Busboy.prototype.emit = function (ev) {
  32311. if (ev === 'finish') {
  32312. if (!this._done) {
  32313. this._parser?.end()
  32314. return
  32315. } else if (this._finished) {
  32316. return
  32317. }
  32318. this._finished = true
  32319. }
  32320. WritableStream.prototype.emit.apply(this, arguments)
  32321. }
  32322. Busboy.prototype.getParserByHeaders = function (headers) {
  32323. const parsed = parseParams(headers['content-type'])
  32324. const cfg = {
  32325. defCharset: this.opts.defCharset,
  32326. fileHwm: this.opts.fileHwm,
  32327. headers,
  32328. highWaterMark: this.opts.highWaterMark,
  32329. isPartAFile: this.opts.isPartAFile,
  32330. limits: this.opts.limits,
  32331. parsedConType: parsed,
  32332. preservePath: this.opts.preservePath
  32333. }
  32334. if (MultipartParser.detect.test(parsed[0])) {
  32335. return new MultipartParser(this, cfg)
  32336. }
  32337. if (UrlencodedParser.detect.test(parsed[0])) {
  32338. return new UrlencodedParser(this, cfg)
  32339. }
  32340. throw new Error('Unsupported Content-Type.')
  32341. }
  32342. Busboy.prototype._write = function (chunk, encoding, cb) {
  32343. this._parser.write(chunk, cb)
  32344. }
  32345. module.exports = Busboy
  32346. module.exports["default"] = Busboy
  32347. module.exports.Busboy = Busboy
  32348. module.exports.Dicer = Dicer
  32349. /***/ }),
  32350. /***/ 2183:
  32351. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  32352. "use strict";
  32353. // TODO:
  32354. // * support 1 nested multipart level
  32355. // (see second multipart example here:
  32356. // http://www.w3.org/TR/html401/interact/forms.html#didx-multipartform-data)
  32357. // * support limits.fieldNameSize
  32358. // -- this will require modifications to utils.parseParams
  32359. const { Readable } = __nccwpck_require__(4492)
  32360. const { inherits } = __nccwpck_require__(7261)
  32361. const Dicer = __nccwpck_require__(2960)
  32362. const parseParams = __nccwpck_require__(1854)
  32363. const decodeText = __nccwpck_require__(4619)
  32364. const basename = __nccwpck_require__(8647)
  32365. const getLimit = __nccwpck_require__(1467)
  32366. const RE_BOUNDARY = /^boundary$/i
  32367. const RE_FIELD = /^form-data$/i
  32368. const RE_CHARSET = /^charset$/i
  32369. const RE_FILENAME = /^filename$/i
  32370. const RE_NAME = /^name$/i
  32371. Multipart.detect = /^multipart\/form-data/i
  32372. function Multipart (boy, cfg) {
  32373. let i
  32374. let len
  32375. const self = this
  32376. let boundary
  32377. const limits = cfg.limits
  32378. const isPartAFile = cfg.isPartAFile || ((fieldName, contentType, fileName) => (contentType === 'application/octet-stream' || fileName !== undefined))
  32379. const parsedConType = cfg.parsedConType || []
  32380. const defCharset = cfg.defCharset || 'utf8'
  32381. const preservePath = cfg.preservePath
  32382. const fileOpts = { highWaterMark: cfg.fileHwm }
  32383. for (i = 0, len = parsedConType.length; i < len; ++i) {
  32384. if (Array.isArray(parsedConType[i]) &&
  32385. RE_BOUNDARY.test(parsedConType[i][0])) {
  32386. boundary = parsedConType[i][1]
  32387. break
  32388. }
  32389. }
  32390. function checkFinished () {
  32391. if (nends === 0 && finished && !boy._done) {
  32392. finished = false
  32393. self.end()
  32394. }
  32395. }
  32396. if (typeof boundary !== 'string') { throw new Error('Multipart: Boundary not found') }
  32397. const fieldSizeLimit = getLimit(limits, 'fieldSize', 1 * 1024 * 1024)
  32398. const fileSizeLimit = getLimit(limits, 'fileSize', Infinity)
  32399. const filesLimit = getLimit(limits, 'files', Infinity)
  32400. const fieldsLimit = getLimit(limits, 'fields', Infinity)
  32401. const partsLimit = getLimit(limits, 'parts', Infinity)
  32402. const headerPairsLimit = getLimit(limits, 'headerPairs', 2000)
  32403. const headerSizeLimit = getLimit(limits, 'headerSize', 80 * 1024)
  32404. let nfiles = 0
  32405. let nfields = 0
  32406. let nends = 0
  32407. let curFile
  32408. let curField
  32409. let finished = false
  32410. this._needDrain = false
  32411. this._pause = false
  32412. this._cb = undefined
  32413. this._nparts = 0
  32414. this._boy = boy
  32415. const parserCfg = {
  32416. boundary,
  32417. maxHeaderPairs: headerPairsLimit,
  32418. maxHeaderSize: headerSizeLimit,
  32419. partHwm: fileOpts.highWaterMark,
  32420. highWaterMark: cfg.highWaterMark
  32421. }
  32422. this.parser = new Dicer(parserCfg)
  32423. this.parser.on('drain', function () {
  32424. self._needDrain = false
  32425. if (self._cb && !self._pause) {
  32426. const cb = self._cb
  32427. self._cb = undefined
  32428. cb()
  32429. }
  32430. }).on('part', function onPart (part) {
  32431. if (++self._nparts > partsLimit) {
  32432. self.parser.removeListener('part', onPart)
  32433. self.parser.on('part', skipPart)
  32434. boy.hitPartsLimit = true
  32435. boy.emit('partsLimit')
  32436. return skipPart(part)
  32437. }
  32438. // hack because streams2 _always_ doesn't emit 'end' until nextTick, so let
  32439. // us emit 'end' early since we know the part has ended if we are already
  32440. // seeing the next part
  32441. if (curField) {
  32442. const field = curField
  32443. field.emit('end')
  32444. field.removeAllListeners('end')
  32445. }
  32446. part.on('header', function (header) {
  32447. let contype
  32448. let fieldname
  32449. let parsed
  32450. let charset
  32451. let encoding
  32452. let filename
  32453. let nsize = 0
  32454. if (header['content-type']) {
  32455. parsed = parseParams(header['content-type'][0])
  32456. if (parsed[0]) {
  32457. contype = parsed[0].toLowerCase()
  32458. for (i = 0, len = parsed.length; i < len; ++i) {
  32459. if (RE_CHARSET.test(parsed[i][0])) {
  32460. charset = parsed[i][1].toLowerCase()
  32461. break
  32462. }
  32463. }
  32464. }
  32465. }
  32466. if (contype === undefined) { contype = 'text/plain' }
  32467. if (charset === undefined) { charset = defCharset }
  32468. if (header['content-disposition']) {
  32469. parsed = parseParams(header['content-disposition'][0])
  32470. if (!RE_FIELD.test(parsed[0])) { return skipPart(part) }
  32471. for (i = 0, len = parsed.length; i < len; ++i) {
  32472. if (RE_NAME.test(parsed[i][0])) {
  32473. fieldname = parsed[i][1]
  32474. } else if (RE_FILENAME.test(parsed[i][0])) {
  32475. filename = parsed[i][1]
  32476. if (!preservePath) { filename = basename(filename) }
  32477. }
  32478. }
  32479. } else { return skipPart(part) }
  32480. if (header['content-transfer-encoding']) { encoding = header['content-transfer-encoding'][0].toLowerCase() } else { encoding = '7bit' }
  32481. let onData,
  32482. onEnd
  32483. if (isPartAFile(fieldname, contype, filename)) {
  32484. // file/binary field
  32485. if (nfiles === filesLimit) {
  32486. if (!boy.hitFilesLimit) {
  32487. boy.hitFilesLimit = true
  32488. boy.emit('filesLimit')
  32489. }
  32490. return skipPart(part)
  32491. }
  32492. ++nfiles
  32493. if (boy.listenerCount('file') === 0) {
  32494. self.parser._ignore()
  32495. return
  32496. }
  32497. ++nends
  32498. const file = new FileStream(fileOpts)
  32499. curFile = file
  32500. file.on('end', function () {
  32501. --nends
  32502. self._pause = false
  32503. checkFinished()
  32504. if (self._cb && !self._needDrain) {
  32505. const cb = self._cb
  32506. self._cb = undefined
  32507. cb()
  32508. }
  32509. })
  32510. file._read = function (n) {
  32511. if (!self._pause) { return }
  32512. self._pause = false
  32513. if (self._cb && !self._needDrain) {
  32514. const cb = self._cb
  32515. self._cb = undefined
  32516. cb()
  32517. }
  32518. }
  32519. boy.emit('file', fieldname, file, filename, encoding, contype)
  32520. onData = function (data) {
  32521. if ((nsize += data.length) > fileSizeLimit) {
  32522. const extralen = fileSizeLimit - nsize + data.length
  32523. if (extralen > 0) { file.push(data.slice(0, extralen)) }
  32524. file.truncated = true
  32525. file.bytesRead = fileSizeLimit
  32526. part.removeAllListeners('data')
  32527. file.emit('limit')
  32528. return
  32529. } else if (!file.push(data)) { self._pause = true }
  32530. file.bytesRead = nsize
  32531. }
  32532. onEnd = function () {
  32533. curFile = undefined
  32534. file.push(null)
  32535. }
  32536. } else {
  32537. // non-file field
  32538. if (nfields === fieldsLimit) {
  32539. if (!boy.hitFieldsLimit) {
  32540. boy.hitFieldsLimit = true
  32541. boy.emit('fieldsLimit')
  32542. }
  32543. return skipPart(part)
  32544. }
  32545. ++nfields
  32546. ++nends
  32547. let buffer = ''
  32548. let truncated = false
  32549. curField = part
  32550. onData = function (data) {
  32551. if ((nsize += data.length) > fieldSizeLimit) {
  32552. const extralen = (fieldSizeLimit - (nsize - data.length))
  32553. buffer += data.toString('binary', 0, extralen)
  32554. truncated = true
  32555. part.removeAllListeners('data')
  32556. } else { buffer += data.toString('binary') }
  32557. }
  32558. onEnd = function () {
  32559. curField = undefined
  32560. if (buffer.length) { buffer = decodeText(buffer, 'binary', charset) }
  32561. boy.emit('field', fieldname, buffer, false, truncated, encoding, contype)
  32562. --nends
  32563. checkFinished()
  32564. }
  32565. }
  32566. /* As of node@2efe4ab761666 (v0.10.29+/v0.11.14+), busboy had become
  32567. broken. Streams2/streams3 is a huge black box of confusion, but
  32568. somehow overriding the sync state seems to fix things again (and still
  32569. seems to work for previous node versions).
  32570. */
  32571. part._readableState.sync = false
  32572. part.on('data', onData)
  32573. part.on('end', onEnd)
  32574. }).on('error', function (err) {
  32575. if (curFile) { curFile.emit('error', err) }
  32576. })
  32577. }).on('error', function (err) {
  32578. boy.emit('error', err)
  32579. }).on('finish', function () {
  32580. finished = true
  32581. checkFinished()
  32582. })
  32583. }
  32584. Multipart.prototype.write = function (chunk, cb) {
  32585. const r = this.parser.write(chunk)
  32586. if (r && !this._pause) {
  32587. cb()
  32588. } else {
  32589. this._needDrain = !r
  32590. this._cb = cb
  32591. }
  32592. }
  32593. Multipart.prototype.end = function () {
  32594. const self = this
  32595. if (self.parser.writable) {
  32596. self.parser.end()
  32597. } else if (!self._boy._done) {
  32598. process.nextTick(function () {
  32599. self._boy._done = true
  32600. self._boy.emit('finish')
  32601. })
  32602. }
  32603. }
  32604. function skipPart (part) {
  32605. part.resume()
  32606. }
  32607. function FileStream (opts) {
  32608. Readable.call(this, opts)
  32609. this.bytesRead = 0
  32610. this.truncated = false
  32611. }
  32612. inherits(FileStream, Readable)
  32613. FileStream.prototype._read = function (n) {}
  32614. module.exports = Multipart
  32615. /***/ }),
  32616. /***/ 8306:
  32617. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  32618. "use strict";
  32619. const Decoder = __nccwpck_require__(7100)
  32620. const decodeText = __nccwpck_require__(4619)
  32621. const getLimit = __nccwpck_require__(1467)
  32622. const RE_CHARSET = /^charset$/i
  32623. UrlEncoded.detect = /^application\/x-www-form-urlencoded/i
  32624. function UrlEncoded (boy, cfg) {
  32625. const limits = cfg.limits
  32626. const parsedConType = cfg.parsedConType
  32627. this.boy = boy
  32628. this.fieldSizeLimit = getLimit(limits, 'fieldSize', 1 * 1024 * 1024)
  32629. this.fieldNameSizeLimit = getLimit(limits, 'fieldNameSize', 100)
  32630. this.fieldsLimit = getLimit(limits, 'fields', Infinity)
  32631. let charset
  32632. for (var i = 0, len = parsedConType.length; i < len; ++i) { // eslint-disable-line no-var
  32633. if (Array.isArray(parsedConType[i]) &&
  32634. RE_CHARSET.test(parsedConType[i][0])) {
  32635. charset = parsedConType[i][1].toLowerCase()
  32636. break
  32637. }
  32638. }
  32639. if (charset === undefined) { charset = cfg.defCharset || 'utf8' }
  32640. this.decoder = new Decoder()
  32641. this.charset = charset
  32642. this._fields = 0
  32643. this._state = 'key'
  32644. this._checkingBytes = true
  32645. this._bytesKey = 0
  32646. this._bytesVal = 0
  32647. this._key = ''
  32648. this._val = ''
  32649. this._keyTrunc = false
  32650. this._valTrunc = false
  32651. this._hitLimit = false
  32652. }
  32653. UrlEncoded.prototype.write = function (data, cb) {
  32654. if (this._fields === this.fieldsLimit) {
  32655. if (!this.boy.hitFieldsLimit) {
  32656. this.boy.hitFieldsLimit = true
  32657. this.boy.emit('fieldsLimit')
  32658. }
  32659. return cb()
  32660. }
  32661. let idxeq; let idxamp; let i; let p = 0; const len = data.length
  32662. while (p < len) {
  32663. if (this._state === 'key') {
  32664. idxeq = idxamp = undefined
  32665. for (i = p; i < len; ++i) {
  32666. if (!this._checkingBytes) { ++p }
  32667. if (data[i] === 0x3D/* = */) {
  32668. idxeq = i
  32669. break
  32670. } else if (data[i] === 0x26/* & */) {
  32671. idxamp = i
  32672. break
  32673. }
  32674. if (this._checkingBytes && this._bytesKey === this.fieldNameSizeLimit) {
  32675. this._hitLimit = true
  32676. break
  32677. } else if (this._checkingBytes) { ++this._bytesKey }
  32678. }
  32679. if (idxeq !== undefined) {
  32680. // key with assignment
  32681. if (idxeq > p) { this._key += this.decoder.write(data.toString('binary', p, idxeq)) }
  32682. this._state = 'val'
  32683. this._hitLimit = false
  32684. this._checkingBytes = true
  32685. this._val = ''
  32686. this._bytesVal = 0
  32687. this._valTrunc = false
  32688. this.decoder.reset()
  32689. p = idxeq + 1
  32690. } else if (idxamp !== undefined) {
  32691. // key with no assignment
  32692. ++this._fields
  32693. let key; const keyTrunc = this._keyTrunc
  32694. if (idxamp > p) { key = (this._key += this.decoder.write(data.toString('binary', p, idxamp))) } else { key = this._key }
  32695. this._hitLimit = false
  32696. this._checkingBytes = true
  32697. this._key = ''
  32698. this._bytesKey = 0
  32699. this._keyTrunc = false
  32700. this.decoder.reset()
  32701. if (key.length) {
  32702. this.boy.emit('field', decodeText(key, 'binary', this.charset),
  32703. '',
  32704. keyTrunc,
  32705. false)
  32706. }
  32707. p = idxamp + 1
  32708. if (this._fields === this.fieldsLimit) { return cb() }
  32709. } else if (this._hitLimit) {
  32710. // we may not have hit the actual limit if there are encoded bytes...
  32711. if (i > p) { this._key += this.decoder.write(data.toString('binary', p, i)) }
  32712. p = i
  32713. if ((this._bytesKey = this._key.length) === this.fieldNameSizeLimit) {
  32714. // yep, we actually did hit the limit
  32715. this._checkingBytes = false
  32716. this._keyTrunc = true
  32717. }
  32718. } else {
  32719. if (p < len) { this._key += this.decoder.write(data.toString('binary', p)) }
  32720. p = len
  32721. }
  32722. } else {
  32723. idxamp = undefined
  32724. for (i = p; i < len; ++i) {
  32725. if (!this._checkingBytes) { ++p }
  32726. if (data[i] === 0x26/* & */) {
  32727. idxamp = i
  32728. break
  32729. }
  32730. if (this._checkingBytes && this._bytesVal === this.fieldSizeLimit) {
  32731. this._hitLimit = true
  32732. break
  32733. } else if (this._checkingBytes) { ++this._bytesVal }
  32734. }
  32735. if (idxamp !== undefined) {
  32736. ++this._fields
  32737. if (idxamp > p) { this._val += this.decoder.write(data.toString('binary', p, idxamp)) }
  32738. this.boy.emit('field', decodeText(this._key, 'binary', this.charset),
  32739. decodeText(this._val, 'binary', this.charset),
  32740. this._keyTrunc,
  32741. this._valTrunc)
  32742. this._state = 'key'
  32743. this._hitLimit = false
  32744. this._checkingBytes = true
  32745. this._key = ''
  32746. this._bytesKey = 0
  32747. this._keyTrunc = false
  32748. this.decoder.reset()
  32749. p = idxamp + 1
  32750. if (this._fields === this.fieldsLimit) { return cb() }
  32751. } else if (this._hitLimit) {
  32752. // we may not have hit the actual limit if there are encoded bytes...
  32753. if (i > p) { this._val += this.decoder.write(data.toString('binary', p, i)) }
  32754. p = i
  32755. if ((this._val === '' && this.fieldSizeLimit === 0) ||
  32756. (this._bytesVal = this._val.length) === this.fieldSizeLimit) {
  32757. // yep, we actually did hit the limit
  32758. this._checkingBytes = false
  32759. this._valTrunc = true
  32760. }
  32761. } else {
  32762. if (p < len) { this._val += this.decoder.write(data.toString('binary', p)) }
  32763. p = len
  32764. }
  32765. }
  32766. }
  32767. cb()
  32768. }
  32769. UrlEncoded.prototype.end = function () {
  32770. if (this.boy._done) { return }
  32771. if (this._state === 'key' && this._key.length > 0) {
  32772. this.boy.emit('field', decodeText(this._key, 'binary', this.charset),
  32773. '',
  32774. this._keyTrunc,
  32775. false)
  32776. } else if (this._state === 'val') {
  32777. this.boy.emit('field', decodeText(this._key, 'binary', this.charset),
  32778. decodeText(this._val, 'binary', this.charset),
  32779. this._keyTrunc,
  32780. this._valTrunc)
  32781. }
  32782. this.boy._done = true
  32783. this.boy.emit('finish')
  32784. }
  32785. module.exports = UrlEncoded
  32786. /***/ }),
  32787. /***/ 7100:
  32788. /***/ ((module) => {
  32789. "use strict";
  32790. const RE_PLUS = /\+/g
  32791. const HEX = [
  32792. 0, 0, 0, 0, 0, 0, 0, 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. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32795. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
  32796. 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32797. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32798. 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32799. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
  32800. ]
  32801. function Decoder () {
  32802. this.buffer = undefined
  32803. }
  32804. Decoder.prototype.write = function (str) {
  32805. // Replace '+' with ' ' before decoding
  32806. str = str.replace(RE_PLUS, ' ')
  32807. let res = ''
  32808. let i = 0; let p = 0; const len = str.length
  32809. for (; i < len; ++i) {
  32810. if (this.buffer !== undefined) {
  32811. if (!HEX[str.charCodeAt(i)]) {
  32812. res += '%' + this.buffer
  32813. this.buffer = undefined
  32814. --i // retry character
  32815. } else {
  32816. this.buffer += str[i]
  32817. ++p
  32818. if (this.buffer.length === 2) {
  32819. res += String.fromCharCode(parseInt(this.buffer, 16))
  32820. this.buffer = undefined
  32821. }
  32822. }
  32823. } else if (str[i] === '%') {
  32824. if (i > p) {
  32825. res += str.substring(p, i)
  32826. p = i
  32827. }
  32828. this.buffer = ''
  32829. ++p
  32830. }
  32831. }
  32832. if (p < len && this.buffer === undefined) { res += str.substring(p) }
  32833. return res
  32834. }
  32835. Decoder.prototype.reset = function () {
  32836. this.buffer = undefined
  32837. }
  32838. module.exports = Decoder
  32839. /***/ }),
  32840. /***/ 8647:
  32841. /***/ ((module) => {
  32842. "use strict";
  32843. module.exports = function basename (path) {
  32844. if (typeof path !== 'string') { return '' }
  32845. for (var i = path.length - 1; i >= 0; --i) { // eslint-disable-line no-var
  32846. switch (path.charCodeAt(i)) {
  32847. case 0x2F: // '/'
  32848. case 0x5C: // '\'
  32849. path = path.slice(i + 1)
  32850. return (path === '..' || path === '.' ? '' : path)
  32851. }
  32852. }
  32853. return (path === '..' || path === '.' ? '' : path)
  32854. }
  32855. /***/ }),
  32856. /***/ 4619:
  32857. /***/ (function(module) {
  32858. "use strict";
  32859. // Node has always utf-8
  32860. const utf8Decoder = new TextDecoder('utf-8')
  32861. const textDecoders = new Map([
  32862. ['utf-8', utf8Decoder],
  32863. ['utf8', utf8Decoder]
  32864. ])
  32865. function getDecoder (charset) {
  32866. let lc
  32867. while (true) {
  32868. switch (charset) {
  32869. case 'utf-8':
  32870. case 'utf8':
  32871. return decoders.utf8
  32872. case 'latin1':
  32873. case 'ascii': // TODO: Make these a separate, strict decoder?
  32874. case 'us-ascii':
  32875. case 'iso-8859-1':
  32876. case 'iso8859-1':
  32877. case 'iso88591':
  32878. case 'iso_8859-1':
  32879. case 'windows-1252':
  32880. case 'iso_8859-1:1987':
  32881. case 'cp1252':
  32882. case 'x-cp1252':
  32883. return decoders.latin1
  32884. case 'utf16le':
  32885. case 'utf-16le':
  32886. case 'ucs2':
  32887. case 'ucs-2':
  32888. return decoders.utf16le
  32889. case 'base64':
  32890. return decoders.base64
  32891. default:
  32892. if (lc === undefined) {
  32893. lc = true
  32894. charset = charset.toLowerCase()
  32895. continue
  32896. }
  32897. return decoders.other.bind(charset)
  32898. }
  32899. }
  32900. }
  32901. const decoders = {
  32902. utf8: (data, sourceEncoding) => {
  32903. if (data.length === 0) {
  32904. return ''
  32905. }
  32906. if (typeof data === 'string') {
  32907. data = Buffer.from(data, sourceEncoding)
  32908. }
  32909. return data.utf8Slice(0, data.length)
  32910. },
  32911. latin1: (data, sourceEncoding) => {
  32912. if (data.length === 0) {
  32913. return ''
  32914. }
  32915. if (typeof data === 'string') {
  32916. return data
  32917. }
  32918. return data.latin1Slice(0, data.length)
  32919. },
  32920. utf16le: (data, sourceEncoding) => {
  32921. if (data.length === 0) {
  32922. return ''
  32923. }
  32924. if (typeof data === 'string') {
  32925. data = Buffer.from(data, sourceEncoding)
  32926. }
  32927. return data.ucs2Slice(0, data.length)
  32928. },
  32929. base64: (data, sourceEncoding) => {
  32930. if (data.length === 0) {
  32931. return ''
  32932. }
  32933. if (typeof data === 'string') {
  32934. data = Buffer.from(data, sourceEncoding)
  32935. }
  32936. return data.base64Slice(0, data.length)
  32937. },
  32938. other: (data, sourceEncoding) => {
  32939. if (data.length === 0) {
  32940. return ''
  32941. }
  32942. if (typeof data === 'string') {
  32943. data = Buffer.from(data, sourceEncoding)
  32944. }
  32945. if (textDecoders.has(this.toString())) {
  32946. try {
  32947. return textDecoders.get(this).decode(data)
  32948. } catch {}
  32949. }
  32950. return typeof data === 'string'
  32951. ? data
  32952. : data.toString()
  32953. }
  32954. }
  32955. function decodeText (text, sourceEncoding, destEncoding) {
  32956. if (text) {
  32957. return getDecoder(destEncoding)(text, sourceEncoding)
  32958. }
  32959. return text
  32960. }
  32961. module.exports = decodeText
  32962. /***/ }),
  32963. /***/ 1467:
  32964. /***/ ((module) => {
  32965. "use strict";
  32966. module.exports = function getLimit (limits, name, defaultLimit) {
  32967. if (
  32968. !limits ||
  32969. limits[name] === undefined ||
  32970. limits[name] === null
  32971. ) { return defaultLimit }
  32972. if (
  32973. typeof limits[name] !== 'number' ||
  32974. isNaN(limits[name])
  32975. ) { throw new TypeError('Limit ' + name + ' is not a valid number') }
  32976. return limits[name]
  32977. }
  32978. /***/ }),
  32979. /***/ 1854:
  32980. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  32981. "use strict";
  32982. /* eslint-disable object-property-newline */
  32983. const decodeText = __nccwpck_require__(4619)
  32984. const RE_ENCODED = /%[a-fA-F0-9][a-fA-F0-9]/g
  32985. const EncodedLookup = {
  32986. '%00': '\x00', '%01': '\x01', '%02': '\x02', '%03': '\x03', '%04': '\x04',
  32987. '%05': '\x05', '%06': '\x06', '%07': '\x07', '%08': '\x08', '%09': '\x09',
  32988. '%0a': '\x0a', '%0A': '\x0a', '%0b': '\x0b', '%0B': '\x0b', '%0c': '\x0c',
  32989. '%0C': '\x0c', '%0d': '\x0d', '%0D': '\x0d', '%0e': '\x0e', '%0E': '\x0e',
  32990. '%0f': '\x0f', '%0F': '\x0f', '%10': '\x10', '%11': '\x11', '%12': '\x12',
  32991. '%13': '\x13', '%14': '\x14', '%15': '\x15', '%16': '\x16', '%17': '\x17',
  32992. '%18': '\x18', '%19': '\x19', '%1a': '\x1a', '%1A': '\x1a', '%1b': '\x1b',
  32993. '%1B': '\x1b', '%1c': '\x1c', '%1C': '\x1c', '%1d': '\x1d', '%1D': '\x1d',
  32994. '%1e': '\x1e', '%1E': '\x1e', '%1f': '\x1f', '%1F': '\x1f', '%20': '\x20',
  32995. '%21': '\x21', '%22': '\x22', '%23': '\x23', '%24': '\x24', '%25': '\x25',
  32996. '%26': '\x26', '%27': '\x27', '%28': '\x28', '%29': '\x29', '%2a': '\x2a',
  32997. '%2A': '\x2a', '%2b': '\x2b', '%2B': '\x2b', '%2c': '\x2c', '%2C': '\x2c',
  32998. '%2d': '\x2d', '%2D': '\x2d', '%2e': '\x2e', '%2E': '\x2e', '%2f': '\x2f',
  32999. '%2F': '\x2f', '%30': '\x30', '%31': '\x31', '%32': '\x32', '%33': '\x33',
  33000. '%34': '\x34', '%35': '\x35', '%36': '\x36', '%37': '\x37', '%38': '\x38',
  33001. '%39': '\x39', '%3a': '\x3a', '%3A': '\x3a', '%3b': '\x3b', '%3B': '\x3b',
  33002. '%3c': '\x3c', '%3C': '\x3c', '%3d': '\x3d', '%3D': '\x3d', '%3e': '\x3e',
  33003. '%3E': '\x3e', '%3f': '\x3f', '%3F': '\x3f', '%40': '\x40', '%41': '\x41',
  33004. '%42': '\x42', '%43': '\x43', '%44': '\x44', '%45': '\x45', '%46': '\x46',
  33005. '%47': '\x47', '%48': '\x48', '%49': '\x49', '%4a': '\x4a', '%4A': '\x4a',
  33006. '%4b': '\x4b', '%4B': '\x4b', '%4c': '\x4c', '%4C': '\x4c', '%4d': '\x4d',
  33007. '%4D': '\x4d', '%4e': '\x4e', '%4E': '\x4e', '%4f': '\x4f', '%4F': '\x4f',
  33008. '%50': '\x50', '%51': '\x51', '%52': '\x52', '%53': '\x53', '%54': '\x54',
  33009. '%55': '\x55', '%56': '\x56', '%57': '\x57', '%58': '\x58', '%59': '\x59',
  33010. '%5a': '\x5a', '%5A': '\x5a', '%5b': '\x5b', '%5B': '\x5b', '%5c': '\x5c',
  33011. '%5C': '\x5c', '%5d': '\x5d', '%5D': '\x5d', '%5e': '\x5e', '%5E': '\x5e',
  33012. '%5f': '\x5f', '%5F': '\x5f', '%60': '\x60', '%61': '\x61', '%62': '\x62',
  33013. '%63': '\x63', '%64': '\x64', '%65': '\x65', '%66': '\x66', '%67': '\x67',
  33014. '%68': '\x68', '%69': '\x69', '%6a': '\x6a', '%6A': '\x6a', '%6b': '\x6b',
  33015. '%6B': '\x6b', '%6c': '\x6c', '%6C': '\x6c', '%6d': '\x6d', '%6D': '\x6d',
  33016. '%6e': '\x6e', '%6E': '\x6e', '%6f': '\x6f', '%6F': '\x6f', '%70': '\x70',
  33017. '%71': '\x71', '%72': '\x72', '%73': '\x73', '%74': '\x74', '%75': '\x75',
  33018. '%76': '\x76', '%77': '\x77', '%78': '\x78', '%79': '\x79', '%7a': '\x7a',
  33019. '%7A': '\x7a', '%7b': '\x7b', '%7B': '\x7b', '%7c': '\x7c', '%7C': '\x7c',
  33020. '%7d': '\x7d', '%7D': '\x7d', '%7e': '\x7e', '%7E': '\x7e', '%7f': '\x7f',
  33021. '%7F': '\x7f', '%80': '\x80', '%81': '\x81', '%82': '\x82', '%83': '\x83',
  33022. '%84': '\x84', '%85': '\x85', '%86': '\x86', '%87': '\x87', '%88': '\x88',
  33023. '%89': '\x89', '%8a': '\x8a', '%8A': '\x8a', '%8b': '\x8b', '%8B': '\x8b',
  33024. '%8c': '\x8c', '%8C': '\x8c', '%8d': '\x8d', '%8D': '\x8d', '%8e': '\x8e',
  33025. '%8E': '\x8e', '%8f': '\x8f', '%8F': '\x8f', '%90': '\x90', '%91': '\x91',
  33026. '%92': '\x92', '%93': '\x93', '%94': '\x94', '%95': '\x95', '%96': '\x96',
  33027. '%97': '\x97', '%98': '\x98', '%99': '\x99', '%9a': '\x9a', '%9A': '\x9a',
  33028. '%9b': '\x9b', '%9B': '\x9b', '%9c': '\x9c', '%9C': '\x9c', '%9d': '\x9d',
  33029. '%9D': '\x9d', '%9e': '\x9e', '%9E': '\x9e', '%9f': '\x9f', '%9F': '\x9f',
  33030. '%a0': '\xa0', '%A0': '\xa0', '%a1': '\xa1', '%A1': '\xa1', '%a2': '\xa2',
  33031. '%A2': '\xa2', '%a3': '\xa3', '%A3': '\xa3', '%a4': '\xa4', '%A4': '\xa4',
  33032. '%a5': '\xa5', '%A5': '\xa5', '%a6': '\xa6', '%A6': '\xa6', '%a7': '\xa7',
  33033. '%A7': '\xa7', '%a8': '\xa8', '%A8': '\xa8', '%a9': '\xa9', '%A9': '\xa9',
  33034. '%aa': '\xaa', '%Aa': '\xaa', '%aA': '\xaa', '%AA': '\xaa', '%ab': '\xab',
  33035. '%Ab': '\xab', '%aB': '\xab', '%AB': '\xab', '%ac': '\xac', '%Ac': '\xac',
  33036. '%aC': '\xac', '%AC': '\xac', '%ad': '\xad', '%Ad': '\xad', '%aD': '\xad',
  33037. '%AD': '\xad', '%ae': '\xae', '%Ae': '\xae', '%aE': '\xae', '%AE': '\xae',
  33038. '%af': '\xaf', '%Af': '\xaf', '%aF': '\xaf', '%AF': '\xaf', '%b0': '\xb0',
  33039. '%B0': '\xb0', '%b1': '\xb1', '%B1': '\xb1', '%b2': '\xb2', '%B2': '\xb2',
  33040. '%b3': '\xb3', '%B3': '\xb3', '%b4': '\xb4', '%B4': '\xb4', '%b5': '\xb5',
  33041. '%B5': '\xb5', '%b6': '\xb6', '%B6': '\xb6', '%b7': '\xb7', '%B7': '\xb7',
  33042. '%b8': '\xb8', '%B8': '\xb8', '%b9': '\xb9', '%B9': '\xb9', '%ba': '\xba',
  33043. '%Ba': '\xba', '%bA': '\xba', '%BA': '\xba', '%bb': '\xbb', '%Bb': '\xbb',
  33044. '%bB': '\xbb', '%BB': '\xbb', '%bc': '\xbc', '%Bc': '\xbc', '%bC': '\xbc',
  33045. '%BC': '\xbc', '%bd': '\xbd', '%Bd': '\xbd', '%bD': '\xbd', '%BD': '\xbd',
  33046. '%be': '\xbe', '%Be': '\xbe', '%bE': '\xbe', '%BE': '\xbe', '%bf': '\xbf',
  33047. '%Bf': '\xbf', '%bF': '\xbf', '%BF': '\xbf', '%c0': '\xc0', '%C0': '\xc0',
  33048. '%c1': '\xc1', '%C1': '\xc1', '%c2': '\xc2', '%C2': '\xc2', '%c3': '\xc3',
  33049. '%C3': '\xc3', '%c4': '\xc4', '%C4': '\xc4', '%c5': '\xc5', '%C5': '\xc5',
  33050. '%c6': '\xc6', '%C6': '\xc6', '%c7': '\xc7', '%C7': '\xc7', '%c8': '\xc8',
  33051. '%C8': '\xc8', '%c9': '\xc9', '%C9': '\xc9', '%ca': '\xca', '%Ca': '\xca',
  33052. '%cA': '\xca', '%CA': '\xca', '%cb': '\xcb', '%Cb': '\xcb', '%cB': '\xcb',
  33053. '%CB': '\xcb', '%cc': '\xcc', '%Cc': '\xcc', '%cC': '\xcc', '%CC': '\xcc',
  33054. '%cd': '\xcd', '%Cd': '\xcd', '%cD': '\xcd', '%CD': '\xcd', '%ce': '\xce',
  33055. '%Ce': '\xce', '%cE': '\xce', '%CE': '\xce', '%cf': '\xcf', '%Cf': '\xcf',
  33056. '%cF': '\xcf', '%CF': '\xcf', '%d0': '\xd0', '%D0': '\xd0', '%d1': '\xd1',
  33057. '%D1': '\xd1', '%d2': '\xd2', '%D2': '\xd2', '%d3': '\xd3', '%D3': '\xd3',
  33058. '%d4': '\xd4', '%D4': '\xd4', '%d5': '\xd5', '%D5': '\xd5', '%d6': '\xd6',
  33059. '%D6': '\xd6', '%d7': '\xd7', '%D7': '\xd7', '%d8': '\xd8', '%D8': '\xd8',
  33060. '%d9': '\xd9', '%D9': '\xd9', '%da': '\xda', '%Da': '\xda', '%dA': '\xda',
  33061. '%DA': '\xda', '%db': '\xdb', '%Db': '\xdb', '%dB': '\xdb', '%DB': '\xdb',
  33062. '%dc': '\xdc', '%Dc': '\xdc', '%dC': '\xdc', '%DC': '\xdc', '%dd': '\xdd',
  33063. '%Dd': '\xdd', '%dD': '\xdd', '%DD': '\xdd', '%de': '\xde', '%De': '\xde',
  33064. '%dE': '\xde', '%DE': '\xde', '%df': '\xdf', '%Df': '\xdf', '%dF': '\xdf',
  33065. '%DF': '\xdf', '%e0': '\xe0', '%E0': '\xe0', '%e1': '\xe1', '%E1': '\xe1',
  33066. '%e2': '\xe2', '%E2': '\xe2', '%e3': '\xe3', '%E3': '\xe3', '%e4': '\xe4',
  33067. '%E4': '\xe4', '%e5': '\xe5', '%E5': '\xe5', '%e6': '\xe6', '%E6': '\xe6',
  33068. '%e7': '\xe7', '%E7': '\xe7', '%e8': '\xe8', '%E8': '\xe8', '%e9': '\xe9',
  33069. '%E9': '\xe9', '%ea': '\xea', '%Ea': '\xea', '%eA': '\xea', '%EA': '\xea',
  33070. '%eb': '\xeb', '%Eb': '\xeb', '%eB': '\xeb', '%EB': '\xeb', '%ec': '\xec',
  33071. '%Ec': '\xec', '%eC': '\xec', '%EC': '\xec', '%ed': '\xed', '%Ed': '\xed',
  33072. '%eD': '\xed', '%ED': '\xed', '%ee': '\xee', '%Ee': '\xee', '%eE': '\xee',
  33073. '%EE': '\xee', '%ef': '\xef', '%Ef': '\xef', '%eF': '\xef', '%EF': '\xef',
  33074. '%f0': '\xf0', '%F0': '\xf0', '%f1': '\xf1', '%F1': '\xf1', '%f2': '\xf2',
  33075. '%F2': '\xf2', '%f3': '\xf3', '%F3': '\xf3', '%f4': '\xf4', '%F4': '\xf4',
  33076. '%f5': '\xf5', '%F5': '\xf5', '%f6': '\xf6', '%F6': '\xf6', '%f7': '\xf7',
  33077. '%F7': '\xf7', '%f8': '\xf8', '%F8': '\xf8', '%f9': '\xf9', '%F9': '\xf9',
  33078. '%fa': '\xfa', '%Fa': '\xfa', '%fA': '\xfa', '%FA': '\xfa', '%fb': '\xfb',
  33079. '%Fb': '\xfb', '%fB': '\xfb', '%FB': '\xfb', '%fc': '\xfc', '%Fc': '\xfc',
  33080. '%fC': '\xfc', '%FC': '\xfc', '%fd': '\xfd', '%Fd': '\xfd', '%fD': '\xfd',
  33081. '%FD': '\xfd', '%fe': '\xfe', '%Fe': '\xfe', '%fE': '\xfe', '%FE': '\xfe',
  33082. '%ff': '\xff', '%Ff': '\xff', '%fF': '\xff', '%FF': '\xff'
  33083. }
  33084. function encodedReplacer (match) {
  33085. return EncodedLookup[match]
  33086. }
  33087. const STATE_KEY = 0
  33088. const STATE_VALUE = 1
  33089. const STATE_CHARSET = 2
  33090. const STATE_LANG = 3
  33091. function parseParams (str) {
  33092. const res = []
  33093. let state = STATE_KEY
  33094. let charset = ''
  33095. let inquote = false
  33096. let escaping = false
  33097. let p = 0
  33098. let tmp = ''
  33099. const len = str.length
  33100. for (var i = 0; i < len; ++i) { // eslint-disable-line no-var
  33101. const char = str[i]
  33102. if (char === '\\' && inquote) {
  33103. if (escaping) { escaping = false } else {
  33104. escaping = true
  33105. continue
  33106. }
  33107. } else if (char === '"') {
  33108. if (!escaping) {
  33109. if (inquote) {
  33110. inquote = false
  33111. state = STATE_KEY
  33112. } else { inquote = true }
  33113. continue
  33114. } else { escaping = false }
  33115. } else {
  33116. if (escaping && inquote) { tmp += '\\' }
  33117. escaping = false
  33118. if ((state === STATE_CHARSET || state === STATE_LANG) && char === "'") {
  33119. if (state === STATE_CHARSET) {
  33120. state = STATE_LANG
  33121. charset = tmp.substring(1)
  33122. } else { state = STATE_VALUE }
  33123. tmp = ''
  33124. continue
  33125. } else if (state === STATE_KEY &&
  33126. (char === '*' || char === '=') &&
  33127. res.length) {
  33128. state = char === '*'
  33129. ? STATE_CHARSET
  33130. : STATE_VALUE
  33131. res[p] = [tmp, undefined]
  33132. tmp = ''
  33133. continue
  33134. } else if (!inquote && char === ';') {
  33135. state = STATE_KEY
  33136. if (charset) {
  33137. if (tmp.length) {
  33138. tmp = decodeText(tmp.replace(RE_ENCODED, encodedReplacer),
  33139. 'binary',
  33140. charset)
  33141. }
  33142. charset = ''
  33143. } else if (tmp.length) {
  33144. tmp = decodeText(tmp, 'binary', 'utf8')
  33145. }
  33146. if (res[p] === undefined) { res[p] = tmp } else { res[p][1] = tmp }
  33147. tmp = ''
  33148. ++p
  33149. continue
  33150. } else if (!inquote && (char === ' ' || char === '\t')) { continue }
  33151. }
  33152. tmp += char
  33153. }
  33154. if (charset && tmp.length) {
  33155. tmp = decodeText(tmp.replace(RE_ENCODED, encodedReplacer),
  33156. 'binary',
  33157. charset)
  33158. } else if (tmp) {
  33159. tmp = decodeText(tmp, 'binary', 'utf8')
  33160. }
  33161. if (res[p] === undefined) {
  33162. if (tmp) { res[p] = tmp }
  33163. } else { res[p][1] = tmp }
  33164. return res
  33165. }
  33166. module.exports = parseParams
  33167. /***/ })
  33168. /******/ });
  33169. /************************************************************************/
  33170. /******/ // The module cache
  33171. /******/ var __webpack_module_cache__ = {};
  33172. /******/
  33173. /******/ // The require function
  33174. /******/ function __nccwpck_require__(moduleId) {
  33175. /******/ // Check if module is in cache
  33176. /******/ var cachedModule = __webpack_module_cache__[moduleId];
  33177. /******/ if (cachedModule !== undefined) {
  33178. /******/ return cachedModule.exports;
  33179. /******/ }
  33180. /******/ // Create a new module (and put it into the cache)
  33181. /******/ var module = __webpack_module_cache__[moduleId] = {
  33182. /******/ // no module.id needed
  33183. /******/ // no module.loaded needed
  33184. /******/ exports: {}
  33185. /******/ };
  33186. /******/
  33187. /******/ // Execute the module function
  33188. /******/ var threw = true;
  33189. /******/ try {
  33190. /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __nccwpck_require__);
  33191. /******/ threw = false;
  33192. /******/ } finally {
  33193. /******/ if(threw) delete __webpack_module_cache__[moduleId];
  33194. /******/ }
  33195. /******/
  33196. /******/ // Return the exports of the module
  33197. /******/ return module.exports;
  33198. /******/ }
  33199. /******/
  33200. /************************************************************************/
  33201. /******/ /* webpack/runtime/compat */
  33202. /******/
  33203. /******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/";
  33204. /******/
  33205. /************************************************************************/
  33206. /******/
  33207. /******/ // startup
  33208. /******/ // Load entry module and return exports
  33209. /******/ // This entry module is referenced by other modules so it can't be inlined
  33210. /******/ var __webpack_exports__ = __nccwpck_require__(3109);
  33211. /******/ module.exports = __webpack_exports__;
  33212. /******/
  33213. /******/ })()
  33214. ;