index.js 1.3 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190
  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.git = gitCommandManager;
  158. this.settings = gitSourceSettings || {};
  159. // Token auth header
  160. const serverUrl = urlHelper.getServerUrl(this.settings.githubServerUrl);
  161. this.tokenConfigKey = `http.${serverUrl.origin}/.extraheader`; // "origin" is SCHEME://HOSTNAME[:PORT]
  162. const basicCredential = Buffer.from(`x-access-token:${this.settings.authToken}`, 'utf8').toString('base64');
  163. core.setSecret(basicCredential);
  164. this.tokenPlaceholderConfigValue = `AUTHORIZATION: basic ***`;
  165. this.tokenConfigValue = `AUTHORIZATION: basic ${basicCredential}`;
  166. // Instead of SSH URL
  167. this.insteadOfKey = `url.${serverUrl.origin}/.insteadOf`; // "origin" is SCHEME://HOSTNAME[:PORT]
  168. this.insteadOfValues.push(`git@${serverUrl.hostname}:`);
  169. if (this.settings.workflowOrganizationId) {
  170. this.insteadOfValues.push(`org-${this.settings.workflowOrganizationId}@github.com:`);
  171. }
  172. }
  173. configureAuth() {
  174. return __awaiter(this, void 0, void 0, function* () {
  175. // Remove possible previous values
  176. yield this.removeAuth();
  177. // Configure new values
  178. yield this.configureSsh();
  179. yield this.configureToken();
  180. });
  181. }
  182. configureTempGlobalConfig() {
  183. return __awaiter(this, void 0, void 0, function* () {
  184. var _a;
  185. // Already setup global config
  186. if (((_a = this.temporaryHomePath) === null || _a === void 0 ? void 0 : _a.length) > 0) {
  187. return path.join(this.temporaryHomePath, '.gitconfig');
  188. }
  189. // Create a temp home directory
  190. const runnerTemp = process.env['RUNNER_TEMP'] || '';
  191. assert.ok(runnerTemp, 'RUNNER_TEMP is not defined');
  192. const uniqueId = (0, uuid_1.v4)();
  193. this.temporaryHomePath = path.join(runnerTemp, uniqueId);
  194. yield fs.promises.mkdir(this.temporaryHomePath, { recursive: true });
  195. // Copy the global git config
  196. const gitConfigPath = path.join(process.env['HOME'] || os.homedir(), '.gitconfig');
  197. const newGitConfigPath = path.join(this.temporaryHomePath, '.gitconfig');
  198. let configExists = false;
  199. try {
  200. yield fs.promises.stat(gitConfigPath);
  201. configExists = true;
  202. }
  203. catch (err) {
  204. if ((err === null || err === void 0 ? void 0 : err.code) !== 'ENOENT') {
  205. throw err;
  206. }
  207. }
  208. if (configExists) {
  209. core.info(`Copying '${gitConfigPath}' to '${newGitConfigPath}'`);
  210. yield io.cp(gitConfigPath, newGitConfigPath);
  211. }
  212. else {
  213. yield fs.promises.writeFile(newGitConfigPath, '');
  214. }
  215. // Override HOME
  216. core.info(`Temporarily overriding HOME='${this.temporaryHomePath}' before making global git config changes`);
  217. this.git.setEnvironmentVariable('HOME', this.temporaryHomePath);
  218. return newGitConfigPath;
  219. });
  220. }
  221. configureGlobalAuth() {
  222. return __awaiter(this, void 0, void 0, function* () {
  223. // 'configureTempGlobalConfig' noops if already set, just returns the path
  224. const newGitConfigPath = yield this.configureTempGlobalConfig();
  225. try {
  226. // Configure the token
  227. yield this.configureToken(newGitConfigPath, true);
  228. // Configure HTTPS instead of SSH
  229. yield this.git.tryConfigUnset(this.insteadOfKey, true);
  230. if (!this.settings.sshKey) {
  231. for (const insteadOfValue of this.insteadOfValues) {
  232. yield this.git.config(this.insteadOfKey, insteadOfValue, true, true);
  233. }
  234. }
  235. }
  236. catch (err) {
  237. // Unset in case somehow written to the real global config
  238. core.info('Encountered an error when attempting to configure token. Attempting unconfigure.');
  239. yield this.git.tryConfigUnset(this.tokenConfigKey, true);
  240. throw err;
  241. }
  242. });
  243. }
  244. configureSubmoduleAuth() {
  245. return __awaiter(this, void 0, void 0, function* () {
  246. // Remove possible previous HTTPS instead of SSH
  247. yield this.removeGitConfig(this.insteadOfKey, true);
  248. if (this.settings.persistCredentials) {
  249. // Configure a placeholder value. This approach avoids the credential being captured
  250. // by process creation audit events, which are commonly logged. For more information,
  251. // refer to https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/manage/component-updates/command-line-process-auditing
  252. const output = yield this.git.submoduleForeach(
  253. // wrap the pipeline in quotes to make sure it's handled properly by submoduleForeach, rather than just the first part of the pipeline
  254. `sh -c "git config --local '${this.tokenConfigKey}' '${this.tokenPlaceholderConfigValue}' && git config --local --show-origin --name-only --get-regexp remote.origin.url"`, this.settings.nestedSubmodules);
  255. // Replace the placeholder
  256. const configPaths = output.match(/(?<=(^|\n)file:)[^\t]+(?=\tremote\.origin\.url)/g) || [];
  257. for (const configPath of configPaths) {
  258. core.debug(`Replacing token placeholder in '${configPath}'`);
  259. yield this.replaceTokenPlaceholder(configPath);
  260. }
  261. if (this.settings.sshKey) {
  262. // Configure core.sshCommand
  263. yield this.git.submoduleForeach(`git config --local '${SSH_COMMAND_KEY}' '${this.sshCommand}'`, this.settings.nestedSubmodules);
  264. }
  265. else {
  266. // Configure HTTPS instead of SSH
  267. for (const insteadOfValue of this.insteadOfValues) {
  268. yield this.git.submoduleForeach(`git config --local --add '${this.insteadOfKey}' '${insteadOfValue}'`, this.settings.nestedSubmodules);
  269. }
  270. }
  271. }
  272. });
  273. }
  274. removeAuth() {
  275. return __awaiter(this, void 0, void 0, function* () {
  276. yield this.removeSsh();
  277. yield this.removeToken();
  278. });
  279. }
  280. removeGlobalConfig() {
  281. return __awaiter(this, void 0, void 0, function* () {
  282. var _a;
  283. if (((_a = this.temporaryHomePath) === null || _a === void 0 ? void 0 : _a.length) > 0) {
  284. core.debug(`Unsetting HOME override`);
  285. this.git.removeEnvironmentVariable('HOME');
  286. yield io.rmRF(this.temporaryHomePath);
  287. }
  288. });
  289. }
  290. configureSsh() {
  291. return __awaiter(this, void 0, void 0, function* () {
  292. if (!this.settings.sshKey) {
  293. return;
  294. }
  295. // Write key
  296. const runnerTemp = process.env['RUNNER_TEMP'] || '';
  297. assert.ok(runnerTemp, 'RUNNER_TEMP is not defined');
  298. const uniqueId = (0, uuid_1.v4)();
  299. this.sshKeyPath = path.join(runnerTemp, uniqueId);
  300. stateHelper.setSshKeyPath(this.sshKeyPath);
  301. yield fs.promises.mkdir(runnerTemp, { recursive: true });
  302. yield fs.promises.writeFile(this.sshKeyPath, this.settings.sshKey.trim() + '\n', { mode: 0o600 });
  303. // Remove inherited permissions on Windows
  304. if (IS_WINDOWS) {
  305. const icacls = yield io.which('icacls.exe');
  306. yield exec.exec(`"${icacls}" "${this.sshKeyPath}" /grant:r "${process.env['USERDOMAIN']}\\${process.env['USERNAME']}:F"`);
  307. yield exec.exec(`"${icacls}" "${this.sshKeyPath}" /inheritance:r`);
  308. }
  309. // Write known hosts
  310. const userKnownHostsPath = path.join(os.homedir(), '.ssh', 'known_hosts');
  311. let userKnownHosts = '';
  312. try {
  313. userKnownHosts = (yield fs.promises.readFile(userKnownHostsPath)).toString();
  314. }
  315. catch (err) {
  316. if ((err === null || err === void 0 ? void 0 : err.code) !== 'ENOENT') {
  317. throw err;
  318. }
  319. }
  320. let knownHosts = '';
  321. if (userKnownHosts) {
  322. knownHosts += `# Begin from ${userKnownHostsPath}\n${userKnownHosts}\n# End from ${userKnownHostsPath}\n`;
  323. }
  324. if (this.settings.sshKnownHosts) {
  325. knownHosts += `# Begin from input known hosts\n${this.settings.sshKnownHosts}\n# end from input known hosts\n`;
  326. }
  327. 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`;
  328. this.sshKnownHostsPath = path.join(runnerTemp, `${uniqueId}_known_hosts`);
  329. stateHelper.setSshKnownHostsPath(this.sshKnownHostsPath);
  330. yield fs.promises.writeFile(this.sshKnownHostsPath, knownHosts);
  331. // Configure GIT_SSH_COMMAND
  332. const sshPath = yield io.which('ssh', true);
  333. this.sshCommand = `"${sshPath}" -i "$RUNNER_TEMP/${path.basename(this.sshKeyPath)}"`;
  334. if (this.settings.sshStrict) {
  335. this.sshCommand += ' -o StrictHostKeyChecking=yes -o CheckHostIP=no';
  336. }
  337. this.sshCommand += ` -o "UserKnownHostsFile=$RUNNER_TEMP/${path.basename(this.sshKnownHostsPath)}"`;
  338. core.info(`Temporarily overriding GIT_SSH_COMMAND=${this.sshCommand}`);
  339. this.git.setEnvironmentVariable('GIT_SSH_COMMAND', this.sshCommand);
  340. // Configure core.sshCommand
  341. if (this.settings.persistCredentials) {
  342. yield this.git.config(SSH_COMMAND_KEY, this.sshCommand);
  343. }
  344. });
  345. }
  346. configureToken(configPath, globalConfig) {
  347. return __awaiter(this, void 0, void 0, function* () {
  348. // Validate args
  349. assert.ok((configPath && globalConfig) || (!configPath && !globalConfig), 'Unexpected configureToken parameter combinations');
  350. // Default config path
  351. if (!configPath && !globalConfig) {
  352. configPath = path.join(this.git.getWorkingDirectory(), '.git', 'config');
  353. }
  354. // Configure a placeholder value. This approach avoids the credential being captured
  355. // by process creation audit events, which are commonly logged. For more information,
  356. // refer to https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/manage/component-updates/command-line-process-auditing
  357. yield this.git.config(this.tokenConfigKey, this.tokenPlaceholderConfigValue, globalConfig);
  358. // Replace the placeholder
  359. yield this.replaceTokenPlaceholder(configPath || '');
  360. });
  361. }
  362. replaceTokenPlaceholder(configPath) {
  363. return __awaiter(this, void 0, void 0, function* () {
  364. assert.ok(configPath, 'configPath is not defined');
  365. let content = (yield fs.promises.readFile(configPath)).toString();
  366. const placeholderIndex = content.indexOf(this.tokenPlaceholderConfigValue);
  367. if (placeholderIndex < 0 ||
  368. placeholderIndex != content.lastIndexOf(this.tokenPlaceholderConfigValue)) {
  369. throw new Error(`Unable to replace auth placeholder in ${configPath}`);
  370. }
  371. assert.ok(this.tokenConfigValue, 'tokenConfigValue is not defined');
  372. content = content.replace(this.tokenPlaceholderConfigValue, this.tokenConfigValue);
  373. yield fs.promises.writeFile(configPath, content);
  374. });
  375. }
  376. removeSsh() {
  377. return __awaiter(this, void 0, void 0, function* () {
  378. var _a;
  379. // SSH key
  380. const keyPath = this.sshKeyPath || stateHelper.SshKeyPath;
  381. if (keyPath) {
  382. try {
  383. yield io.rmRF(keyPath);
  384. }
  385. catch (err) {
  386. core.debug(`${(_a = err === null || err === void 0 ? void 0 : err.message) !== null && _a !== void 0 ? _a : err}`);
  387. core.warning(`Failed to remove SSH key '${keyPath}'`);
  388. }
  389. }
  390. // SSH known hosts
  391. const knownHostsPath = this.sshKnownHostsPath || stateHelper.SshKnownHostsPath;
  392. if (knownHostsPath) {
  393. try {
  394. yield io.rmRF(knownHostsPath);
  395. }
  396. catch (_b) {
  397. // Intentionally empty
  398. }
  399. }
  400. // SSH command
  401. yield this.removeGitConfig(SSH_COMMAND_KEY);
  402. });
  403. }
  404. removeToken() {
  405. return __awaiter(this, void 0, void 0, function* () {
  406. // HTTP extra header
  407. yield this.removeGitConfig(this.tokenConfigKey);
  408. });
  409. }
  410. removeGitConfig(configKey_1) {
  411. return __awaiter(this, arguments, void 0, function* (configKey, submoduleOnly = false) {
  412. if (!submoduleOnly) {
  413. if ((yield this.git.configExists(configKey)) &&
  414. !(yield this.git.tryConfigUnset(configKey))) {
  415. // Load the config contents
  416. core.warning(`Failed to remove '${configKey}' from the git config`);
  417. }
  418. }
  419. const pattern = regexpHelper.escape(configKey);
  420. yield this.git.submoduleForeach(
  421. // wrap the pipeline in quotes to make sure it's handled properly by submoduleForeach, rather than just the first part of the pipeline
  422. `sh -c "git config --local --name-only --get-regexp '${pattern}' && git config --local --unset-all '${configKey}' || :"`, true);
  423. });
  424. }
  425. }
  426. /***/ }),
  427. /***/ 738:
  428. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  429. "use strict";
  430. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  431. if (k2 === undefined) k2 = k;
  432. var desc = Object.getOwnPropertyDescriptor(m, k);
  433. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  434. desc = { enumerable: true, get: function() { return m[k]; } };
  435. }
  436. Object.defineProperty(o, k2, desc);
  437. }) : (function(o, m, k, k2) {
  438. if (k2 === undefined) k2 = k;
  439. o[k2] = m[k];
  440. }));
  441. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  442. Object.defineProperty(o, "default", { enumerable: true, value: v });
  443. }) : function(o, v) {
  444. o["default"] = v;
  445. });
  446. var __importStar = (this && this.__importStar) || function (mod) {
  447. if (mod && mod.__esModule) return mod;
  448. var result = {};
  449. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  450. __setModuleDefault(result, mod);
  451. return result;
  452. };
  453. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  454. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  455. return new (P || (P = Promise))(function (resolve, reject) {
  456. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  457. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  458. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  459. step((generator = generator.apply(thisArg, _arguments || [])).next());
  460. });
  461. };
  462. Object.defineProperty(exports, "__esModule", ({ value: true }));
  463. exports.MinimumGitSparseCheckoutVersion = exports.MinimumGitVersion = void 0;
  464. exports.createCommandManager = createCommandManager;
  465. const core = __importStar(__nccwpck_require__(2186));
  466. const exec = __importStar(__nccwpck_require__(1514));
  467. const fs = __importStar(__nccwpck_require__(7147));
  468. const fshelper = __importStar(__nccwpck_require__(7219));
  469. const io = __importStar(__nccwpck_require__(7436));
  470. const path = __importStar(__nccwpck_require__(1017));
  471. const refHelper = __importStar(__nccwpck_require__(8601));
  472. const regexpHelper = __importStar(__nccwpck_require__(3120));
  473. const retryHelper = __importStar(__nccwpck_require__(2155));
  474. const git_version_1 = __nccwpck_require__(3142);
  475. // Auth header not supported before 2.9
  476. // Wire protocol v2 not supported before 2.18
  477. // sparse-checkout not [well-]supported before 2.28 (see https://github.com/actions/checkout/issues/1386)
  478. exports.MinimumGitVersion = new git_version_1.GitVersion('2.18');
  479. exports.MinimumGitSparseCheckoutVersion = new git_version_1.GitVersion('2.28');
  480. function createCommandManager(workingDirectory, lfs, doSparseCheckout) {
  481. return __awaiter(this, void 0, void 0, function* () {
  482. return yield GitCommandManager.createCommandManager(workingDirectory, lfs, doSparseCheckout);
  483. });
  484. }
  485. class GitCommandManager {
  486. // Private constructor; use createCommandManager()
  487. constructor() {
  488. this.gitEnv = {
  489. GIT_TERMINAL_PROMPT: '0', // Disable git prompt
  490. GCM_INTERACTIVE: 'Never' // Disable prompting for git credential manager
  491. };
  492. this.gitPath = '';
  493. this.lfs = false;
  494. this.doSparseCheckout = false;
  495. this.workingDirectory = '';
  496. this.gitVersion = new git_version_1.GitVersion();
  497. }
  498. branchDelete(remote, branch) {
  499. return __awaiter(this, void 0, void 0, function* () {
  500. const args = ['branch', '--delete', '--force'];
  501. if (remote) {
  502. args.push('--remote');
  503. }
  504. args.push(branch);
  505. yield this.execGit(args);
  506. });
  507. }
  508. branchExists(remote, pattern) {
  509. return __awaiter(this, void 0, void 0, function* () {
  510. const args = ['branch', '--list'];
  511. if (remote) {
  512. args.push('--remote');
  513. }
  514. args.push(pattern);
  515. const output = yield this.execGit(args);
  516. return !!output.stdout.trim();
  517. });
  518. }
  519. branchList(remote) {
  520. return __awaiter(this, void 0, void 0, function* () {
  521. const result = [];
  522. // Note, this implementation uses "rev-parse --symbolic-full-name" because the output from
  523. // "branch --list" is more difficult when in a detached HEAD state.
  524. // TODO(https://github.com/actions/checkout/issues/786): this implementation uses
  525. // "rev-parse --symbolic-full-name" because there is a bug
  526. // in Git 2.18 that causes "rev-parse --symbolic" to output symbolic full names. When
  527. // 2.18 is no longer supported, we can switch back to --symbolic.
  528. const args = ['rev-parse', '--symbolic-full-name'];
  529. if (remote) {
  530. args.push('--remotes=origin');
  531. }
  532. else {
  533. args.push('--branches');
  534. }
  535. const stderr = [];
  536. const errline = [];
  537. const stdout = [];
  538. const stdline = [];
  539. const listeners = {
  540. stderr: (data) => {
  541. stderr.push(data.toString());
  542. },
  543. errline: (data) => {
  544. errline.push(data.toString());
  545. },
  546. stdout: (data) => {
  547. stdout.push(data.toString());
  548. },
  549. stdline: (data) => {
  550. stdline.push(data.toString());
  551. }
  552. };
  553. // Suppress the output in order to avoid flooding annotations with innocuous errors.
  554. yield this.execGit(args, false, true, listeners);
  555. core.debug(`stderr callback is: ${stderr}`);
  556. core.debug(`errline callback is: ${errline}`);
  557. core.debug(`stdout callback is: ${stdout}`);
  558. core.debug(`stdline callback is: ${stdline}`);
  559. for (let branch of stdline) {
  560. branch = branch.trim();
  561. if (!branch) {
  562. continue;
  563. }
  564. if (branch.startsWith('refs/heads/')) {
  565. branch = branch.substring('refs/heads/'.length);
  566. }
  567. else if (branch.startsWith('refs/remotes/')) {
  568. branch = branch.substring('refs/remotes/'.length);
  569. }
  570. result.push(branch);
  571. }
  572. return result;
  573. });
  574. }
  575. disableSparseCheckout() {
  576. return __awaiter(this, void 0, void 0, function* () {
  577. yield this.execGit(['sparse-checkout', 'disable']);
  578. // Disabling 'sparse-checkout` leaves behind an undesirable side-effect in config (even in a pristine environment).
  579. yield this.tryConfigUnset('extensions.worktreeConfig', false);
  580. });
  581. }
  582. sparseCheckout(sparseCheckout) {
  583. return __awaiter(this, void 0, void 0, function* () {
  584. yield this.execGit(['sparse-checkout', 'set', ...sparseCheckout]);
  585. });
  586. }
  587. sparseCheckoutNonConeMode(sparseCheckout) {
  588. return __awaiter(this, void 0, void 0, function* () {
  589. yield this.execGit(['config', 'core.sparseCheckout', 'true']);
  590. const output = yield this.execGit([
  591. 'rev-parse',
  592. '--git-path',
  593. 'info/sparse-checkout'
  594. ]);
  595. const sparseCheckoutPath = path.join(this.workingDirectory, output.stdout.trimRight());
  596. yield fs.promises.appendFile(sparseCheckoutPath, `\n${sparseCheckout.join('\n')}\n`);
  597. });
  598. }
  599. checkout(ref, startPoint) {
  600. return __awaiter(this, void 0, void 0, function* () {
  601. const args = ['checkout', '--progress', '--force'];
  602. if (startPoint) {
  603. args.push('-B', ref, startPoint);
  604. }
  605. else {
  606. args.push(ref);
  607. }
  608. yield this.execGit(args);
  609. });
  610. }
  611. checkoutDetach() {
  612. return __awaiter(this, void 0, void 0, function* () {
  613. const args = ['checkout', '--detach'];
  614. yield this.execGit(args);
  615. });
  616. }
  617. config(configKey, configValue, globalConfig, add) {
  618. return __awaiter(this, void 0, void 0, function* () {
  619. const args = ['config', globalConfig ? '--global' : '--local'];
  620. if (add) {
  621. args.push('--add');
  622. }
  623. args.push(...[configKey, configValue]);
  624. yield this.execGit(args);
  625. });
  626. }
  627. configExists(configKey, globalConfig) {
  628. return __awaiter(this, void 0, void 0, function* () {
  629. const pattern = regexpHelper.escape(configKey);
  630. const output = yield this.execGit([
  631. 'config',
  632. globalConfig ? '--global' : '--local',
  633. '--name-only',
  634. '--get-regexp',
  635. pattern
  636. ], true);
  637. return output.exitCode === 0;
  638. });
  639. }
  640. fetch(refSpec, options) {
  641. return __awaiter(this, void 0, void 0, function* () {
  642. const args = ['-c', 'protocol.version=2', 'fetch'];
  643. if (!refSpec.some(x => x === refHelper.tagsRefSpec) && !options.fetchTags) {
  644. args.push('--no-tags');
  645. }
  646. args.push('--prune', '--no-recurse-submodules');
  647. if (options.showProgress) {
  648. args.push('--progress');
  649. }
  650. if (options.filter) {
  651. args.push(`--filter=${options.filter}`);
  652. }
  653. if (options.fetchDepth && options.fetchDepth > 0) {
  654. args.push(`--depth=${options.fetchDepth}`);
  655. }
  656. else if (fshelper.fileExistsSync(path.join(this.workingDirectory, '.git', 'shallow'))) {
  657. args.push('--unshallow');
  658. }
  659. args.push('origin');
  660. for (const arg of refSpec) {
  661. args.push(arg);
  662. }
  663. const that = this;
  664. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  665. yield that.execGit(args);
  666. }));
  667. });
  668. }
  669. getDefaultBranch(repositoryUrl) {
  670. return __awaiter(this, void 0, void 0, function* () {
  671. let output;
  672. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  673. output = yield this.execGit([
  674. 'ls-remote',
  675. '--quiet',
  676. '--exit-code',
  677. '--symref',
  678. repositoryUrl,
  679. 'HEAD'
  680. ]);
  681. }));
  682. if (output) {
  683. // Satisfy compiler, will always be set
  684. for (let line of output.stdout.trim().split('\n')) {
  685. line = line.trim();
  686. if (line.startsWith('ref:') || line.endsWith('HEAD')) {
  687. return line
  688. .substr('ref:'.length, line.length - 'ref:'.length - 'HEAD'.length)
  689. .trim();
  690. }
  691. }
  692. }
  693. throw new Error('Unexpected output when retrieving default branch');
  694. });
  695. }
  696. getWorkingDirectory() {
  697. return this.workingDirectory;
  698. }
  699. init() {
  700. return __awaiter(this, void 0, void 0, function* () {
  701. yield this.execGit(['init', this.workingDirectory]);
  702. });
  703. }
  704. isDetached() {
  705. return __awaiter(this, void 0, void 0, function* () {
  706. // Note, "branch --show-current" would be simpler but isn't available until Git 2.22
  707. const output = yield this.execGit(['rev-parse', '--symbolic-full-name', '--verify', '--quiet', 'HEAD'], true);
  708. return !output.stdout.trim().startsWith('refs/heads/');
  709. });
  710. }
  711. lfsFetch(ref) {
  712. return __awaiter(this, void 0, void 0, function* () {
  713. const args = ['lfs', 'fetch', 'origin', ref];
  714. const that = this;
  715. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  716. yield that.execGit(args);
  717. }));
  718. });
  719. }
  720. lfsInstall() {
  721. return __awaiter(this, void 0, void 0, function* () {
  722. yield this.execGit(['lfs', 'install', '--local']);
  723. });
  724. }
  725. log1(format) {
  726. return __awaiter(this, void 0, void 0, function* () {
  727. const args = format ? ['log', '-1', format] : ['log', '-1'];
  728. const silent = format ? false : true;
  729. const output = yield this.execGit(args, false, silent);
  730. return output.stdout;
  731. });
  732. }
  733. remoteAdd(remoteName, remoteUrl) {
  734. return __awaiter(this, void 0, void 0, function* () {
  735. yield this.execGit(['remote', 'add', remoteName, remoteUrl]);
  736. });
  737. }
  738. removeEnvironmentVariable(name) {
  739. delete this.gitEnv[name];
  740. }
  741. /**
  742. * Resolves a ref to a SHA. For a branch or lightweight tag, the commit SHA is returned.
  743. * For an annotated tag, the tag SHA is returned.
  744. * @param {string} ref For example: 'refs/heads/main' or '/refs/tags/v1'
  745. * @returns {Promise<string>}
  746. */
  747. revParse(ref) {
  748. return __awaiter(this, void 0, void 0, function* () {
  749. const output = yield this.execGit(['rev-parse', ref]);
  750. return output.stdout.trim();
  751. });
  752. }
  753. setEnvironmentVariable(name, value) {
  754. this.gitEnv[name] = value;
  755. }
  756. shaExists(sha) {
  757. return __awaiter(this, void 0, void 0, function* () {
  758. const args = ['rev-parse', '--verify', '--quiet', `${sha}^{object}`];
  759. const output = yield this.execGit(args, true);
  760. return output.exitCode === 0;
  761. });
  762. }
  763. submoduleForeach(command, recursive) {
  764. return __awaiter(this, void 0, void 0, function* () {
  765. const args = ['submodule', 'foreach'];
  766. if (recursive) {
  767. args.push('--recursive');
  768. }
  769. args.push(command);
  770. const output = yield this.execGit(args);
  771. return output.stdout;
  772. });
  773. }
  774. submoduleSync(recursive) {
  775. return __awaiter(this, void 0, void 0, function* () {
  776. const args = ['submodule', 'sync'];
  777. if (recursive) {
  778. args.push('--recursive');
  779. }
  780. yield this.execGit(args);
  781. });
  782. }
  783. submoduleUpdate(fetchDepth, recursive) {
  784. return __awaiter(this, void 0, void 0, function* () {
  785. const args = ['-c', 'protocol.version=2'];
  786. args.push('submodule', 'update', '--init', '--force');
  787. if (fetchDepth > 0) {
  788. args.push(`--depth=${fetchDepth}`);
  789. }
  790. if (recursive) {
  791. args.push('--recursive');
  792. }
  793. yield this.execGit(args);
  794. });
  795. }
  796. submoduleStatus() {
  797. return __awaiter(this, void 0, void 0, function* () {
  798. const output = yield this.execGit(['submodule', 'status'], true);
  799. core.debug(output.stdout);
  800. return output.exitCode === 0;
  801. });
  802. }
  803. tagExists(pattern) {
  804. return __awaiter(this, void 0, void 0, function* () {
  805. const output = yield this.execGit(['tag', '--list', pattern]);
  806. return !!output.stdout.trim();
  807. });
  808. }
  809. tryClean() {
  810. return __awaiter(this, void 0, void 0, function* () {
  811. const output = yield this.execGit(['clean', '-ffdx'], true);
  812. return output.exitCode === 0;
  813. });
  814. }
  815. tryConfigUnset(configKey, globalConfig) {
  816. return __awaiter(this, void 0, void 0, function* () {
  817. const output = yield this.execGit([
  818. 'config',
  819. globalConfig ? '--global' : '--local',
  820. '--unset-all',
  821. configKey
  822. ], true);
  823. return output.exitCode === 0;
  824. });
  825. }
  826. tryDisableAutomaticGarbageCollection() {
  827. return __awaiter(this, void 0, void 0, function* () {
  828. const output = yield this.execGit(['config', '--local', 'gc.auto', '0'], true);
  829. return output.exitCode === 0;
  830. });
  831. }
  832. tryGetFetchUrl() {
  833. return __awaiter(this, void 0, void 0, function* () {
  834. const output = yield this.execGit(['config', '--local', '--get', 'remote.origin.url'], true);
  835. if (output.exitCode !== 0) {
  836. return '';
  837. }
  838. const stdout = output.stdout.trim();
  839. if (stdout.includes('\n')) {
  840. return '';
  841. }
  842. return stdout;
  843. });
  844. }
  845. tryReset() {
  846. return __awaiter(this, void 0, void 0, function* () {
  847. const output = yield this.execGit(['reset', '--hard', 'HEAD'], true);
  848. return output.exitCode === 0;
  849. });
  850. }
  851. version() {
  852. return __awaiter(this, void 0, void 0, function* () {
  853. return this.gitVersion;
  854. });
  855. }
  856. static createCommandManager(workingDirectory, lfs, doSparseCheckout) {
  857. return __awaiter(this, void 0, void 0, function* () {
  858. const result = new GitCommandManager();
  859. yield result.initializeCommandManager(workingDirectory, lfs, doSparseCheckout);
  860. return result;
  861. });
  862. }
  863. execGit(args_1) {
  864. return __awaiter(this, arguments, void 0, function* (args, allowAllExitCodes = false, silent = false, customListeners = {}) {
  865. fshelper.directoryExistsSync(this.workingDirectory, true);
  866. const result = new GitOutput();
  867. const env = {};
  868. for (const key of Object.keys(process.env)) {
  869. env[key] = process.env[key];
  870. }
  871. for (const key of Object.keys(this.gitEnv)) {
  872. env[key] = this.gitEnv[key];
  873. }
  874. const defaultListener = {
  875. stdout: (data) => {
  876. stdout.push(data.toString());
  877. }
  878. };
  879. const mergedListeners = Object.assign(Object.assign({}, defaultListener), customListeners);
  880. const stdout = [];
  881. const options = {
  882. cwd: this.workingDirectory,
  883. env,
  884. silent,
  885. ignoreReturnCode: allowAllExitCodes,
  886. listeners: mergedListeners
  887. };
  888. result.exitCode = yield exec.exec(`"${this.gitPath}"`, args, options);
  889. result.stdout = stdout.join('');
  890. core.debug(result.exitCode.toString());
  891. core.debug(result.stdout);
  892. return result;
  893. });
  894. }
  895. initializeCommandManager(workingDirectory, lfs, doSparseCheckout) {
  896. return __awaiter(this, void 0, void 0, function* () {
  897. this.workingDirectory = workingDirectory;
  898. // Git-lfs will try to pull down assets if any of the local/user/system setting exist.
  899. // If the user didn't enable `LFS` in their pipeline definition, disable LFS fetch/checkout.
  900. this.lfs = lfs;
  901. if (!this.lfs) {
  902. this.gitEnv['GIT_LFS_SKIP_SMUDGE'] = '1';
  903. }
  904. this.gitPath = yield io.which('git', true);
  905. // Git version
  906. core.debug('Getting git version');
  907. this.gitVersion = new git_version_1.GitVersion();
  908. let gitOutput = yield this.execGit(['version']);
  909. let stdout = gitOutput.stdout.trim();
  910. if (!stdout.includes('\n')) {
  911. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  912. if (match) {
  913. this.gitVersion = new git_version_1.GitVersion(match[0]);
  914. }
  915. }
  916. if (!this.gitVersion.isValid()) {
  917. throw new Error('Unable to determine git version');
  918. }
  919. // Minimum git version
  920. if (!this.gitVersion.checkMinimum(exports.MinimumGitVersion)) {
  921. throw new Error(`Minimum required git version is ${exports.MinimumGitVersion}. Your git ('${this.gitPath}') is ${this.gitVersion}`);
  922. }
  923. if (this.lfs) {
  924. // Git-lfs version
  925. core.debug('Getting git-lfs version');
  926. let gitLfsVersion = new git_version_1.GitVersion();
  927. const gitLfsPath = yield io.which('git-lfs', true);
  928. gitOutput = yield this.execGit(['lfs', 'version']);
  929. stdout = gitOutput.stdout.trim();
  930. if (!stdout.includes('\n')) {
  931. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  932. if (match) {
  933. gitLfsVersion = new git_version_1.GitVersion(match[0]);
  934. }
  935. }
  936. if (!gitLfsVersion.isValid()) {
  937. throw new Error('Unable to determine git-lfs version');
  938. }
  939. // Minimum git-lfs version
  940. // Note:
  941. // - Auth header not supported before 2.1
  942. const minimumGitLfsVersion = new git_version_1.GitVersion('2.1');
  943. if (!gitLfsVersion.checkMinimum(minimumGitLfsVersion)) {
  944. throw new Error(`Minimum required git-lfs version is ${minimumGitLfsVersion}. Your git-lfs ('${gitLfsPath}') is ${gitLfsVersion}`);
  945. }
  946. }
  947. this.doSparseCheckout = doSparseCheckout;
  948. if (this.doSparseCheckout) {
  949. if (!this.gitVersion.checkMinimum(exports.MinimumGitSparseCheckoutVersion)) {
  950. throw new Error(`Minimum Git version required for sparse checkout is ${exports.MinimumGitSparseCheckoutVersion}. Your git ('${this.gitPath}') is ${this.gitVersion}`);
  951. }
  952. }
  953. // Set the user agent
  954. const gitHttpUserAgent = `git/${this.gitVersion} (github-actions-checkout)`;
  955. core.debug(`Set git useragent to: ${gitHttpUserAgent}`);
  956. this.gitEnv['GIT_HTTP_USER_AGENT'] = gitHttpUserAgent;
  957. });
  958. }
  959. }
  960. class GitOutput {
  961. constructor() {
  962. this.stdout = '';
  963. this.exitCode = 0;
  964. }
  965. }
  966. /***/ }),
  967. /***/ 8609:
  968. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  969. "use strict";
  970. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  971. if (k2 === undefined) k2 = k;
  972. var desc = Object.getOwnPropertyDescriptor(m, k);
  973. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  974. desc = { enumerable: true, get: function() { return m[k]; } };
  975. }
  976. Object.defineProperty(o, k2, desc);
  977. }) : (function(o, m, k, k2) {
  978. if (k2 === undefined) k2 = k;
  979. o[k2] = m[k];
  980. }));
  981. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  982. Object.defineProperty(o, "default", { enumerable: true, value: v });
  983. }) : function(o, v) {
  984. o["default"] = v;
  985. });
  986. var __importStar = (this && this.__importStar) || function (mod) {
  987. if (mod && mod.__esModule) return mod;
  988. var result = {};
  989. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  990. __setModuleDefault(result, mod);
  991. return result;
  992. };
  993. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  994. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  995. return new (P || (P = Promise))(function (resolve, reject) {
  996. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  997. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  998. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  999. step((generator = generator.apply(thisArg, _arguments || [])).next());
  1000. });
  1001. };
  1002. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1003. exports.prepareExistingDirectory = prepareExistingDirectory;
  1004. const assert = __importStar(__nccwpck_require__(9491));
  1005. const core = __importStar(__nccwpck_require__(2186));
  1006. const fs = __importStar(__nccwpck_require__(7147));
  1007. const fsHelper = __importStar(__nccwpck_require__(7219));
  1008. const io = __importStar(__nccwpck_require__(7436));
  1009. const path = __importStar(__nccwpck_require__(1017));
  1010. function prepareExistingDirectory(git, repositoryPath, repositoryUrl, clean, ref) {
  1011. return __awaiter(this, void 0, void 0, function* () {
  1012. var _a;
  1013. assert.ok(repositoryPath, 'Expected repositoryPath to be defined');
  1014. assert.ok(repositoryUrl, 'Expected repositoryUrl to be defined');
  1015. // Indicates whether to delete the directory contents
  1016. let remove = false;
  1017. // Check whether using git or REST API
  1018. if (!git) {
  1019. remove = true;
  1020. }
  1021. // Fetch URL does not match
  1022. else if (!fsHelper.directoryExistsSync(path.join(repositoryPath, '.git')) ||
  1023. repositoryUrl !== (yield git.tryGetFetchUrl())) {
  1024. remove = true;
  1025. }
  1026. else {
  1027. // Delete any index.lock and shallow.lock left by a previously canceled run or crashed git process
  1028. const lockPaths = [
  1029. path.join(repositoryPath, '.git', 'index.lock'),
  1030. path.join(repositoryPath, '.git', 'shallow.lock')
  1031. ];
  1032. for (const lockPath of lockPaths) {
  1033. try {
  1034. yield io.rmRF(lockPath);
  1035. }
  1036. catch (error) {
  1037. core.debug(`Unable to delete '${lockPath}'. ${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error}`);
  1038. }
  1039. }
  1040. try {
  1041. core.startGroup('Removing previously created refs, to avoid conflicts');
  1042. // Checkout detached HEAD
  1043. if (!(yield git.isDetached())) {
  1044. yield git.checkoutDetach();
  1045. }
  1046. // Remove all refs/heads/*
  1047. let branches = yield git.branchList(false);
  1048. for (const branch of branches) {
  1049. yield git.branchDelete(false, branch);
  1050. }
  1051. // Remove any conflicting refs/remotes/origin/*
  1052. // Example 1: Consider ref is refs/heads/foo and previously fetched refs/remotes/origin/foo/bar
  1053. // Example 2: Consider ref is refs/heads/foo/bar and previously fetched refs/remotes/origin/foo
  1054. if (ref) {
  1055. ref = ref.startsWith('refs/') ? ref : `refs/heads/${ref}`;
  1056. if (ref.startsWith('refs/heads/')) {
  1057. const upperName1 = ref.toUpperCase().substr('REFS/HEADS/'.length);
  1058. const upperName1Slash = `${upperName1}/`;
  1059. branches = yield git.branchList(true);
  1060. for (const branch of branches) {
  1061. const upperName2 = branch.substr('origin/'.length).toUpperCase();
  1062. const upperName2Slash = `${upperName2}/`;
  1063. if (upperName1.startsWith(upperName2Slash) ||
  1064. upperName2.startsWith(upperName1Slash)) {
  1065. yield git.branchDelete(true, branch);
  1066. }
  1067. }
  1068. }
  1069. }
  1070. core.endGroup();
  1071. // Check for submodules and delete any existing files if submodules are present
  1072. if (!(yield git.submoduleStatus())) {
  1073. remove = true;
  1074. core.info('Bad Submodules found, removing existing files');
  1075. }
  1076. // Clean
  1077. if (clean) {
  1078. core.startGroup('Cleaning the repository');
  1079. if (!(yield git.tryClean())) {
  1080. 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}'.`);
  1081. remove = true;
  1082. }
  1083. else if (!(yield git.tryReset())) {
  1084. remove = true;
  1085. }
  1086. core.endGroup();
  1087. if (remove) {
  1088. core.warning(`Unable to clean or reset the repository. The repository will be recreated instead.`);
  1089. }
  1090. }
  1091. }
  1092. catch (error) {
  1093. core.warning(`Unable to prepare the existing repository. The repository will be recreated instead.`);
  1094. remove = true;
  1095. }
  1096. }
  1097. if (remove) {
  1098. // Delete the contents of the directory. Don't delete the directory itself
  1099. // since it might be the current working directory.
  1100. core.info(`Deleting the contents of '${repositoryPath}'`);
  1101. for (const file of yield fs.promises.readdir(repositoryPath)) {
  1102. yield io.rmRF(path.join(repositoryPath, file));
  1103. }
  1104. }
  1105. });
  1106. }
  1107. /***/ }),
  1108. /***/ 9210:
  1109. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  1110. "use strict";
  1111. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  1112. if (k2 === undefined) k2 = k;
  1113. var desc = Object.getOwnPropertyDescriptor(m, k);
  1114. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  1115. desc = { enumerable: true, get: function() { return m[k]; } };
  1116. }
  1117. Object.defineProperty(o, k2, desc);
  1118. }) : (function(o, m, k, k2) {
  1119. if (k2 === undefined) k2 = k;
  1120. o[k2] = m[k];
  1121. }));
  1122. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  1123. Object.defineProperty(o, "default", { enumerable: true, value: v });
  1124. }) : function(o, v) {
  1125. o["default"] = v;
  1126. });
  1127. var __importStar = (this && this.__importStar) || function (mod) {
  1128. if (mod && mod.__esModule) return mod;
  1129. var result = {};
  1130. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  1131. __setModuleDefault(result, mod);
  1132. return result;
  1133. };
  1134. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  1135. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  1136. return new (P || (P = Promise))(function (resolve, reject) {
  1137. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  1138. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  1139. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  1140. step((generator = generator.apply(thisArg, _arguments || [])).next());
  1141. });
  1142. };
  1143. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1144. exports.getSource = getSource;
  1145. exports.cleanup = cleanup;
  1146. const core = __importStar(__nccwpck_require__(2186));
  1147. const fsHelper = __importStar(__nccwpck_require__(7219));
  1148. const gitAuthHelper = __importStar(__nccwpck_require__(2565));
  1149. const gitCommandManager = __importStar(__nccwpck_require__(738));
  1150. const gitDirectoryHelper = __importStar(__nccwpck_require__(8609));
  1151. const githubApiHelper = __importStar(__nccwpck_require__(138));
  1152. const io = __importStar(__nccwpck_require__(7436));
  1153. const path = __importStar(__nccwpck_require__(1017));
  1154. const refHelper = __importStar(__nccwpck_require__(8601));
  1155. const stateHelper = __importStar(__nccwpck_require__(4866));
  1156. const urlHelper = __importStar(__nccwpck_require__(9437));
  1157. const git_command_manager_1 = __nccwpck_require__(738);
  1158. function getSource(settings) {
  1159. return __awaiter(this, void 0, void 0, function* () {
  1160. // Repository URL
  1161. core.info(`Syncing repository: ${settings.repositoryOwner}/${settings.repositoryName}`);
  1162. const repositoryUrl = urlHelper.getFetchUrl(settings);
  1163. // Remove conflicting file path
  1164. if (fsHelper.fileExistsSync(settings.repositoryPath)) {
  1165. yield io.rmRF(settings.repositoryPath);
  1166. }
  1167. // Create directory
  1168. let isExisting = true;
  1169. if (!fsHelper.directoryExistsSync(settings.repositoryPath)) {
  1170. isExisting = false;
  1171. yield io.mkdirP(settings.repositoryPath);
  1172. }
  1173. // Git command manager
  1174. core.startGroup('Getting Git version info');
  1175. const git = yield getGitCommandManager(settings);
  1176. core.endGroup();
  1177. let authHelper = null;
  1178. try {
  1179. if (git) {
  1180. authHelper = gitAuthHelper.createAuthHelper(git, settings);
  1181. if (settings.setSafeDirectory) {
  1182. // 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
  1183. // Otherwise all git commands we run in a container fail
  1184. yield authHelper.configureTempGlobalConfig();
  1185. core.info(`Adding repository directory to the temporary git global config as a safe directory`);
  1186. yield git
  1187. .config('safe.directory', settings.repositoryPath, true, true)
  1188. .catch(error => {
  1189. core.info(`Failed to initialize safe directory with error: ${error}`);
  1190. });
  1191. stateHelper.setSafeDirectory();
  1192. }
  1193. }
  1194. // Prepare existing directory, otherwise recreate
  1195. if (isExisting) {
  1196. yield gitDirectoryHelper.prepareExistingDirectory(git, settings.repositoryPath, repositoryUrl, settings.clean, settings.ref);
  1197. }
  1198. if (!git) {
  1199. // Downloading using REST API
  1200. core.info(`The repository will be downloaded using the GitHub REST API`);
  1201. core.info(`To create a local Git repository instead, add Git ${gitCommandManager.MinimumGitVersion} or higher to the PATH`);
  1202. if (settings.submodules) {
  1203. 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.`);
  1204. }
  1205. else if (settings.sshKey) {
  1206. 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.`);
  1207. }
  1208. yield githubApiHelper.downloadRepository(settings.authToken, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit, settings.repositoryPath, settings.githubServerUrl);
  1209. return;
  1210. }
  1211. // Save state for POST action
  1212. stateHelper.setRepositoryPath(settings.repositoryPath);
  1213. // Initialize the repository
  1214. if (!fsHelper.directoryExistsSync(path.join(settings.repositoryPath, '.git'))) {
  1215. core.startGroup('Initializing the repository');
  1216. yield git.init();
  1217. yield git.remoteAdd('origin', repositoryUrl);
  1218. core.endGroup();
  1219. }
  1220. // Disable automatic garbage collection
  1221. core.startGroup('Disabling automatic garbage collection');
  1222. if (!(yield git.tryDisableAutomaticGarbageCollection())) {
  1223. core.warning(`Unable to turn off git automatic garbage collection. The git fetch operation may trigger garbage collection and cause a delay.`);
  1224. }
  1225. core.endGroup();
  1226. // If we didn't initialize it above, do it now
  1227. if (!authHelper) {
  1228. authHelper = gitAuthHelper.createAuthHelper(git, settings);
  1229. }
  1230. // Configure auth
  1231. core.startGroup('Setting up auth');
  1232. yield authHelper.configureAuth();
  1233. core.endGroup();
  1234. // Determine the default branch
  1235. if (!settings.ref && !settings.commit) {
  1236. core.startGroup('Determining the default branch');
  1237. if (settings.sshKey) {
  1238. settings.ref = yield git.getDefaultBranch(repositoryUrl);
  1239. }
  1240. else {
  1241. settings.ref = yield githubApiHelper.getDefaultBranch(settings.authToken, settings.repositoryOwner, settings.repositoryName, settings.githubServerUrl);
  1242. }
  1243. core.endGroup();
  1244. }
  1245. // LFS install
  1246. if (settings.lfs) {
  1247. yield git.lfsInstall();
  1248. }
  1249. // Fetch
  1250. core.startGroup('Fetching the repository');
  1251. const fetchOptions = {};
  1252. if (settings.filter) {
  1253. fetchOptions.filter = settings.filter;
  1254. }
  1255. else if (settings.sparseCheckout) {
  1256. fetchOptions.filter = 'blob:none';
  1257. }
  1258. if (settings.fetchDepth <= 0) {
  1259. // Fetch all branches and tags
  1260. let refSpec = refHelper.getRefSpecForAllHistory(settings.ref, settings.commit);
  1261. yield git.fetch(refSpec, fetchOptions);
  1262. // When all history is fetched, the ref we're interested in may have moved to a different
  1263. // commit (push or force push). If so, fetch again with a targeted refspec.
  1264. if (!(yield refHelper.testRef(git, settings.ref, settings.commit))) {
  1265. refSpec = refHelper.getRefSpec(settings.ref, settings.commit);
  1266. yield git.fetch(refSpec, fetchOptions);
  1267. }
  1268. }
  1269. else {
  1270. fetchOptions.fetchDepth = settings.fetchDepth;
  1271. fetchOptions.fetchTags = settings.fetchTags;
  1272. const refSpec = refHelper.getRefSpec(settings.ref, settings.commit);
  1273. yield git.fetch(refSpec, fetchOptions);
  1274. }
  1275. core.endGroup();
  1276. // Checkout info
  1277. core.startGroup('Determining the checkout info');
  1278. const checkoutInfo = yield refHelper.getCheckoutInfo(git, settings.ref, settings.commit);
  1279. core.endGroup();
  1280. // LFS fetch
  1281. // Explicit lfs-fetch to avoid slow checkout (fetches one lfs object at a time).
  1282. // Explicit lfs fetch will fetch lfs objects in parallel.
  1283. // For sparse checkouts, let `checkout` fetch the needed objects lazily.
  1284. if (settings.lfs && !settings.sparseCheckout) {
  1285. core.startGroup('Fetching LFS objects');
  1286. yield git.lfsFetch(checkoutInfo.startPoint || checkoutInfo.ref);
  1287. core.endGroup();
  1288. }
  1289. // Sparse checkout
  1290. if (!settings.sparseCheckout) {
  1291. let gitVersion = yield git.version();
  1292. // no need to disable sparse-checkout if the installed git runtime doesn't even support it.
  1293. if (gitVersion.checkMinimum(git_command_manager_1.MinimumGitSparseCheckoutVersion)) {
  1294. yield git.disableSparseCheckout();
  1295. }
  1296. }
  1297. else {
  1298. core.startGroup('Setting up sparse checkout');
  1299. if (settings.sparseCheckoutConeMode) {
  1300. yield git.sparseCheckout(settings.sparseCheckout);
  1301. }
  1302. else {
  1303. yield git.sparseCheckoutNonConeMode(settings.sparseCheckout);
  1304. }
  1305. core.endGroup();
  1306. }
  1307. // Checkout
  1308. core.startGroup('Checking out the ref');
  1309. yield git.checkout(checkoutInfo.ref, checkoutInfo.startPoint);
  1310. core.endGroup();
  1311. // Submodules
  1312. if (settings.submodules) {
  1313. // Temporarily override global config
  1314. core.startGroup('Setting up auth for fetching submodules');
  1315. yield authHelper.configureGlobalAuth();
  1316. core.endGroup();
  1317. // Checkout submodules
  1318. core.startGroup('Fetching submodules');
  1319. yield git.submoduleSync(settings.nestedSubmodules);
  1320. yield git.submoduleUpdate(settings.fetchDepth, settings.nestedSubmodules);
  1321. yield git.submoduleForeach('git config --local gc.auto 0', settings.nestedSubmodules);
  1322. core.endGroup();
  1323. // Persist credentials
  1324. if (settings.persistCredentials) {
  1325. core.startGroup('Persisting credentials for submodules');
  1326. yield authHelper.configureSubmoduleAuth();
  1327. core.endGroup();
  1328. }
  1329. }
  1330. // Get commit information
  1331. const commitInfo = yield git.log1();
  1332. // Log commit sha
  1333. const commitSHA = yield git.log1('--format=%H');
  1334. core.setOutput('commit', commitSHA.trim());
  1335. // Check for incorrect pull request merge commit
  1336. yield refHelper.checkCommitInfo(settings.authToken, commitInfo, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit, settings.githubServerUrl);
  1337. }
  1338. finally {
  1339. // Remove auth
  1340. if (authHelper) {
  1341. if (!settings.persistCredentials) {
  1342. core.startGroup('Removing auth');
  1343. yield authHelper.removeAuth();
  1344. core.endGroup();
  1345. }
  1346. authHelper.removeGlobalConfig();
  1347. }
  1348. }
  1349. });
  1350. }
  1351. function cleanup(repositoryPath) {
  1352. return __awaiter(this, void 0, void 0, function* () {
  1353. // Repo exists?
  1354. if (!repositoryPath ||
  1355. !fsHelper.fileExistsSync(path.join(repositoryPath, '.git', 'config'))) {
  1356. return;
  1357. }
  1358. let git;
  1359. try {
  1360. git = yield gitCommandManager.createCommandManager(repositoryPath, false, false);
  1361. }
  1362. catch (_a) {
  1363. return;
  1364. }
  1365. // Remove auth
  1366. const authHelper = gitAuthHelper.createAuthHelper(git);
  1367. try {
  1368. if (stateHelper.PostSetSafeDirectory) {
  1369. // 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
  1370. // Otherwise all git commands we run in a container fail
  1371. yield authHelper.configureTempGlobalConfig();
  1372. core.info(`Adding repository directory to the temporary git global config as a safe directory`);
  1373. yield git
  1374. .config('safe.directory', repositoryPath, true, true)
  1375. .catch(error => {
  1376. core.info(`Failed to initialize safe directory with error: ${error}`);
  1377. });
  1378. }
  1379. yield authHelper.removeAuth();
  1380. }
  1381. finally {
  1382. yield authHelper.removeGlobalConfig();
  1383. }
  1384. });
  1385. }
  1386. function getGitCommandManager(settings) {
  1387. return __awaiter(this, void 0, void 0, function* () {
  1388. core.info(`Working directory is '${settings.repositoryPath}'`);
  1389. try {
  1390. return yield gitCommandManager.createCommandManager(settings.repositoryPath, settings.lfs, settings.sparseCheckout != null);
  1391. }
  1392. catch (err) {
  1393. // Git is required for LFS
  1394. if (settings.lfs) {
  1395. throw err;
  1396. }
  1397. // Otherwise fallback to REST API
  1398. return undefined;
  1399. }
  1400. });
  1401. }
  1402. /***/ }),
  1403. /***/ 3142:
  1404. /***/ ((__unused_webpack_module, exports) => {
  1405. "use strict";
  1406. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1407. exports.GitVersion = void 0;
  1408. class GitVersion {
  1409. /**
  1410. * Used for comparing the version of git and git-lfs against the minimum required version
  1411. * @param version the version string, e.g. 1.2 or 1.2.3
  1412. */
  1413. constructor(version) {
  1414. this.major = NaN;
  1415. this.minor = NaN;
  1416. this.patch = NaN;
  1417. if (version) {
  1418. const match = version.match(/^(\d+)\.(\d+)(\.(\d+))?$/);
  1419. if (match) {
  1420. this.major = Number(match[1]);
  1421. this.minor = Number(match[2]);
  1422. if (match[4]) {
  1423. this.patch = Number(match[4]);
  1424. }
  1425. }
  1426. }
  1427. }
  1428. /**
  1429. * Compares the instance against a minimum required version
  1430. * @param minimum Minimum version
  1431. */
  1432. checkMinimum(minimum) {
  1433. if (!minimum.isValid()) {
  1434. throw new Error('Arg minimum is not a valid version');
  1435. }
  1436. // Major is insufficient
  1437. if (this.major < minimum.major) {
  1438. return false;
  1439. }
  1440. // Major is equal
  1441. if (this.major === minimum.major) {
  1442. // Minor is insufficient
  1443. if (this.minor < minimum.minor) {
  1444. return false;
  1445. }
  1446. // Minor is equal
  1447. if (this.minor === minimum.minor) {
  1448. // Patch is insufficient
  1449. if (this.patch && this.patch < (minimum.patch || 0)) {
  1450. return false;
  1451. }
  1452. }
  1453. }
  1454. return true;
  1455. }
  1456. /**
  1457. * Indicates whether the instance was constructed from a valid version string
  1458. */
  1459. isValid() {
  1460. return !isNaN(this.major);
  1461. }
  1462. /**
  1463. * Returns the version as a string, e.g. 1.2 or 1.2.3
  1464. */
  1465. toString() {
  1466. let result = '';
  1467. if (this.isValid()) {
  1468. result = `${this.major}.${this.minor}`;
  1469. if (!isNaN(this.patch)) {
  1470. result += `.${this.patch}`;
  1471. }
  1472. }
  1473. return result;
  1474. }
  1475. }
  1476. exports.GitVersion = GitVersion;
  1477. /***/ }),
  1478. /***/ 138:
  1479. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  1480. "use strict";
  1481. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  1482. if (k2 === undefined) k2 = k;
  1483. var desc = Object.getOwnPropertyDescriptor(m, k);
  1484. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  1485. desc = { enumerable: true, get: function() { return m[k]; } };
  1486. }
  1487. Object.defineProperty(o, k2, desc);
  1488. }) : (function(o, m, k, k2) {
  1489. if (k2 === undefined) k2 = k;
  1490. o[k2] = m[k];
  1491. }));
  1492. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  1493. Object.defineProperty(o, "default", { enumerable: true, value: v });
  1494. }) : function(o, v) {
  1495. o["default"] = v;
  1496. });
  1497. var __importStar = (this && this.__importStar) || function (mod) {
  1498. if (mod && mod.__esModule) return mod;
  1499. var result = {};
  1500. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  1501. __setModuleDefault(result, mod);
  1502. return result;
  1503. };
  1504. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  1505. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  1506. return new (P || (P = Promise))(function (resolve, reject) {
  1507. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  1508. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  1509. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  1510. step((generator = generator.apply(thisArg, _arguments || [])).next());
  1511. });
  1512. };
  1513. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1514. exports.downloadRepository = downloadRepository;
  1515. exports.getDefaultBranch = getDefaultBranch;
  1516. const assert = __importStar(__nccwpck_require__(9491));
  1517. const core = __importStar(__nccwpck_require__(2186));
  1518. const fs = __importStar(__nccwpck_require__(7147));
  1519. const github = __importStar(__nccwpck_require__(5438));
  1520. const io = __importStar(__nccwpck_require__(7436));
  1521. const path = __importStar(__nccwpck_require__(1017));
  1522. const retryHelper = __importStar(__nccwpck_require__(2155));
  1523. const toolCache = __importStar(__nccwpck_require__(7784));
  1524. const uuid_1 = __nccwpck_require__(5840);
  1525. const url_helper_1 = __nccwpck_require__(9437);
  1526. const IS_WINDOWS = process.platform === 'win32';
  1527. function downloadRepository(authToken, owner, repo, ref, commit, repositoryPath, baseUrl) {
  1528. return __awaiter(this, void 0, void 0, function* () {
  1529. // Determine the default branch
  1530. if (!ref && !commit) {
  1531. core.info('Determining the default branch');
  1532. ref = yield getDefaultBranch(authToken, owner, repo, baseUrl);
  1533. }
  1534. // Download the archive
  1535. let archiveData = yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  1536. core.info('Downloading the archive');
  1537. return yield downloadArchive(authToken, owner, repo, ref, commit, baseUrl);
  1538. }));
  1539. // Write archive to disk
  1540. core.info('Writing archive to disk');
  1541. const uniqueId = (0, uuid_1.v4)();
  1542. const archivePath = IS_WINDOWS
  1543. ? path.join(repositoryPath, `${uniqueId}.zip`)
  1544. : path.join(repositoryPath, `${uniqueId}.tar.gz`);
  1545. yield fs.promises.writeFile(archivePath, archiveData);
  1546. archiveData = Buffer.from(''); // Free memory
  1547. // Extract archive
  1548. core.info('Extracting the archive');
  1549. const extractPath = path.join(repositoryPath, uniqueId);
  1550. yield io.mkdirP(extractPath);
  1551. if (IS_WINDOWS) {
  1552. yield toolCache.extractZip(archivePath, extractPath);
  1553. }
  1554. else {
  1555. yield toolCache.extractTar(archivePath, extractPath);
  1556. }
  1557. yield io.rmRF(archivePath);
  1558. // Determine the path of the repository content. The archive contains
  1559. // a top-level folder and the repository content is inside.
  1560. const archiveFileNames = yield fs.promises.readdir(extractPath);
  1561. assert.ok(archiveFileNames.length == 1, 'Expected exactly one directory inside archive');
  1562. const archiveVersion = archiveFileNames[0]; // The top-level folder name includes the short SHA
  1563. core.info(`Resolved version ${archiveVersion}`);
  1564. const tempRepositoryPath = path.join(extractPath, archiveVersion);
  1565. // Move the files
  1566. for (const fileName of yield fs.promises.readdir(tempRepositoryPath)) {
  1567. const sourcePath = path.join(tempRepositoryPath, fileName);
  1568. const targetPath = path.join(repositoryPath, fileName);
  1569. if (IS_WINDOWS) {
  1570. yield io.cp(sourcePath, targetPath, { recursive: true }); // Copy on Windows (Windows Defender may have a lock)
  1571. }
  1572. else {
  1573. yield io.mv(sourcePath, targetPath);
  1574. }
  1575. }
  1576. yield io.rmRF(extractPath);
  1577. });
  1578. }
  1579. /**
  1580. * Looks up the default branch name
  1581. */
  1582. function getDefaultBranch(authToken, owner, repo, baseUrl) {
  1583. return __awaiter(this, void 0, void 0, function* () {
  1584. return yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  1585. core.info('Retrieving the default branch name');
  1586. const octokit = github.getOctokit(authToken, {
  1587. baseUrl: (0, url_helper_1.getServerApiUrl)(baseUrl)
  1588. });
  1589. let result;
  1590. try {
  1591. // Get the default branch from the repo info
  1592. const response = yield octokit.rest.repos.get({ owner, repo });
  1593. result = response.data.default_branch;
  1594. assert.ok(result, 'default_branch cannot be empty');
  1595. }
  1596. catch (err) {
  1597. // Handle .wiki repo
  1598. if ((err === null || err === void 0 ? void 0 : err.status) === 404 &&
  1599. repo.toUpperCase().endsWith('.WIKI')) {
  1600. result = 'master';
  1601. }
  1602. // Otherwise error
  1603. else {
  1604. throw err;
  1605. }
  1606. }
  1607. // Print the default branch
  1608. core.info(`Default branch '${result}'`);
  1609. // Prefix with 'refs/heads'
  1610. if (!result.startsWith('refs/')) {
  1611. result = `refs/heads/${result}`;
  1612. }
  1613. return result;
  1614. }));
  1615. });
  1616. }
  1617. function downloadArchive(authToken, owner, repo, ref, commit, baseUrl) {
  1618. return __awaiter(this, void 0, void 0, function* () {
  1619. const octokit = github.getOctokit(authToken, {
  1620. baseUrl: (0, url_helper_1.getServerApiUrl)(baseUrl)
  1621. });
  1622. const download = IS_WINDOWS
  1623. ? octokit.rest.repos.downloadZipballArchive
  1624. : octokit.rest.repos.downloadTarballArchive;
  1625. const response = yield download({
  1626. owner: owner,
  1627. repo: repo,
  1628. ref: commit || ref
  1629. });
  1630. return Buffer.from(response.data); // response.data is ArrayBuffer
  1631. });
  1632. }
  1633. /***/ }),
  1634. /***/ 5480:
  1635. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  1636. "use strict";
  1637. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  1638. if (k2 === undefined) k2 = k;
  1639. var desc = Object.getOwnPropertyDescriptor(m, k);
  1640. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  1641. desc = { enumerable: true, get: function() { return m[k]; } };
  1642. }
  1643. Object.defineProperty(o, k2, desc);
  1644. }) : (function(o, m, k, k2) {
  1645. if (k2 === undefined) k2 = k;
  1646. o[k2] = m[k];
  1647. }));
  1648. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  1649. Object.defineProperty(o, "default", { enumerable: true, value: v });
  1650. }) : function(o, v) {
  1651. o["default"] = v;
  1652. });
  1653. var __importStar = (this && this.__importStar) || function (mod) {
  1654. if (mod && mod.__esModule) return mod;
  1655. var result = {};
  1656. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  1657. __setModuleDefault(result, mod);
  1658. return result;
  1659. };
  1660. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  1661. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  1662. return new (P || (P = Promise))(function (resolve, reject) {
  1663. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  1664. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  1665. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  1666. step((generator = generator.apply(thisArg, _arguments || [])).next());
  1667. });
  1668. };
  1669. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1670. exports.getInputs = getInputs;
  1671. const core = __importStar(__nccwpck_require__(2186));
  1672. const fsHelper = __importStar(__nccwpck_require__(7219));
  1673. const github = __importStar(__nccwpck_require__(5438));
  1674. const path = __importStar(__nccwpck_require__(1017));
  1675. const workflowContextHelper = __importStar(__nccwpck_require__(9568));
  1676. function getInputs() {
  1677. return __awaiter(this, void 0, void 0, function* () {
  1678. const result = {};
  1679. // GitHub workspace
  1680. let githubWorkspacePath = process.env['GITHUB_WORKSPACE'];
  1681. if (!githubWorkspacePath) {
  1682. throw new Error('GITHUB_WORKSPACE not defined');
  1683. }
  1684. githubWorkspacePath = path.resolve(githubWorkspacePath);
  1685. core.debug(`GITHUB_WORKSPACE = '${githubWorkspacePath}'`);
  1686. fsHelper.directoryExistsSync(githubWorkspacePath, true);
  1687. // Qualified repository
  1688. const qualifiedRepository = core.getInput('repository') ||
  1689. `${github.context.repo.owner}/${github.context.repo.repo}`;
  1690. core.debug(`qualified repository = '${qualifiedRepository}'`);
  1691. const splitRepository = qualifiedRepository.split('/');
  1692. if (splitRepository.length !== 2 ||
  1693. !splitRepository[0] ||
  1694. !splitRepository[1]) {
  1695. throw new Error(`Invalid repository '${qualifiedRepository}'. Expected format {owner}/{repo}.`);
  1696. }
  1697. result.repositoryOwner = splitRepository[0];
  1698. result.repositoryName = splitRepository[1];
  1699. // Repository path
  1700. result.repositoryPath = core.getInput('path') || '.';
  1701. result.repositoryPath = path.resolve(githubWorkspacePath, result.repositoryPath);
  1702. if (!(result.repositoryPath + path.sep).startsWith(githubWorkspacePath + path.sep)) {
  1703. throw new Error(`Repository path '${result.repositoryPath}' is not under '${githubWorkspacePath}'`);
  1704. }
  1705. // Workflow repository?
  1706. const isWorkflowRepository = qualifiedRepository.toUpperCase() ===
  1707. `${github.context.repo.owner}/${github.context.repo.repo}`.toUpperCase();
  1708. // Source branch, source version
  1709. result.ref = core.getInput('ref');
  1710. if (!result.ref) {
  1711. if (isWorkflowRepository) {
  1712. result.ref = github.context.ref;
  1713. result.commit = github.context.sha;
  1714. // Some events have an unqualifed ref. For example when a PR is merged (pull_request closed event),
  1715. // the ref is unqualifed like "main" instead of "refs/heads/main".
  1716. if (result.commit && result.ref && !result.ref.startsWith('refs/')) {
  1717. result.ref = `refs/heads/${result.ref}`;
  1718. }
  1719. }
  1720. }
  1721. // SHA?
  1722. else if (result.ref.match(/^[0-9a-fA-F]{40}$/)) {
  1723. result.commit = result.ref;
  1724. result.ref = '';
  1725. }
  1726. core.debug(`ref = '${result.ref}'`);
  1727. core.debug(`commit = '${result.commit}'`);
  1728. // Clean
  1729. result.clean = (core.getInput('clean') || 'true').toUpperCase() === 'TRUE';
  1730. core.debug(`clean = ${result.clean}`);
  1731. // Filter
  1732. const filter = core.getInput('filter');
  1733. if (filter) {
  1734. result.filter = filter;
  1735. }
  1736. core.debug(`filter = ${result.filter}`);
  1737. // Sparse checkout
  1738. const sparseCheckout = core.getMultilineInput('sparse-checkout');
  1739. if (sparseCheckout.length) {
  1740. result.sparseCheckout = sparseCheckout;
  1741. core.debug(`sparse checkout = ${result.sparseCheckout}`);
  1742. }
  1743. result.sparseCheckoutConeMode =
  1744. (core.getInput('sparse-checkout-cone-mode') || 'true').toUpperCase() ===
  1745. 'TRUE';
  1746. // Fetch depth
  1747. result.fetchDepth = Math.floor(Number(core.getInput('fetch-depth') || '1'));
  1748. if (isNaN(result.fetchDepth) || result.fetchDepth < 0) {
  1749. result.fetchDepth = 0;
  1750. }
  1751. core.debug(`fetch depth = ${result.fetchDepth}`);
  1752. // Fetch tags
  1753. result.fetchTags =
  1754. (core.getInput('fetch-tags') || 'false').toUpperCase() === 'TRUE';
  1755. core.debug(`fetch tags = ${result.fetchTags}`);
  1756. // Show fetch progress
  1757. result.showProgress =
  1758. (core.getInput('show-progress') || 'true').toUpperCase() === 'TRUE';
  1759. core.debug(`show progress = ${result.showProgress}`);
  1760. // LFS
  1761. result.lfs = (core.getInput('lfs') || 'false').toUpperCase() === 'TRUE';
  1762. core.debug(`lfs = ${result.lfs}`);
  1763. // Submodules
  1764. result.submodules = false;
  1765. result.nestedSubmodules = false;
  1766. const submodulesString = (core.getInput('submodules') || '').toUpperCase();
  1767. if (submodulesString == 'RECURSIVE') {
  1768. result.submodules = true;
  1769. result.nestedSubmodules = true;
  1770. }
  1771. else if (submodulesString == 'TRUE') {
  1772. result.submodules = true;
  1773. }
  1774. core.debug(`submodules = ${result.submodules}`);
  1775. core.debug(`recursive submodules = ${result.nestedSubmodules}`);
  1776. // Auth token
  1777. result.authToken = core.getInput('token', { required: true });
  1778. // SSH
  1779. result.sshKey = core.getInput('ssh-key');
  1780. result.sshKnownHosts = core.getInput('ssh-known-hosts');
  1781. result.sshStrict =
  1782. (core.getInput('ssh-strict') || 'true').toUpperCase() === 'TRUE';
  1783. result.sshUser = core.getInput('ssh-user');
  1784. // Persist credentials
  1785. result.persistCredentials =
  1786. (core.getInput('persist-credentials') || 'false').toUpperCase() === 'TRUE';
  1787. // Workflow organization ID
  1788. result.workflowOrganizationId =
  1789. yield workflowContextHelper.getOrganizationId();
  1790. // Set safe.directory in git global config.
  1791. result.setSafeDirectory =
  1792. (core.getInput('set-safe-directory') || 'true').toUpperCase() === 'TRUE';
  1793. // Determine the GitHub URL that the repository is being hosted from
  1794. result.githubServerUrl = core.getInput('github-server-url');
  1795. core.debug(`GitHub Host URL = ${result.githubServerUrl}`);
  1796. return result;
  1797. });
  1798. }
  1799. /***/ }),
  1800. /***/ 3109:
  1801. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  1802. "use strict";
  1803. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  1804. if (k2 === undefined) k2 = k;
  1805. var desc = Object.getOwnPropertyDescriptor(m, k);
  1806. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  1807. desc = { enumerable: true, get: function() { return m[k]; } };
  1808. }
  1809. Object.defineProperty(o, k2, desc);
  1810. }) : (function(o, m, k, k2) {
  1811. if (k2 === undefined) k2 = k;
  1812. o[k2] = m[k];
  1813. }));
  1814. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  1815. Object.defineProperty(o, "default", { enumerable: true, value: v });
  1816. }) : function(o, v) {
  1817. o["default"] = v;
  1818. });
  1819. var __importStar = (this && this.__importStar) || function (mod) {
  1820. if (mod && mod.__esModule) return mod;
  1821. var result = {};
  1822. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  1823. __setModuleDefault(result, mod);
  1824. return result;
  1825. };
  1826. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  1827. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  1828. return new (P || (P = Promise))(function (resolve, reject) {
  1829. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  1830. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  1831. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  1832. step((generator = generator.apply(thisArg, _arguments || [])).next());
  1833. });
  1834. };
  1835. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1836. const core = __importStar(__nccwpck_require__(2186));
  1837. const coreCommand = __importStar(__nccwpck_require__(7351));
  1838. const gitSourceProvider = __importStar(__nccwpck_require__(9210));
  1839. const inputHelper = __importStar(__nccwpck_require__(5480));
  1840. const path = __importStar(__nccwpck_require__(1017));
  1841. const stateHelper = __importStar(__nccwpck_require__(4866));
  1842. function run() {
  1843. return __awaiter(this, void 0, void 0, function* () {
  1844. var _a;
  1845. try {
  1846. const sourceSettings = yield inputHelper.getInputs();
  1847. try {
  1848. // Register problem matcher
  1849. coreCommand.issueCommand('add-matcher', {}, path.join(__dirname, 'problem-matcher.json'));
  1850. // Get sources
  1851. yield gitSourceProvider.getSource(sourceSettings);
  1852. core.setOutput('ref', sourceSettings.ref);
  1853. }
  1854. finally {
  1855. // Unregister problem matcher
  1856. coreCommand.issueCommand('remove-matcher', { owner: 'checkout-git' }, '');
  1857. }
  1858. }
  1859. catch (error) {
  1860. core.setFailed(`${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error}`);
  1861. }
  1862. });
  1863. }
  1864. function cleanup() {
  1865. return __awaiter(this, void 0, void 0, function* () {
  1866. var _a;
  1867. try {
  1868. yield gitSourceProvider.cleanup(stateHelper.RepositoryPath);
  1869. }
  1870. catch (error) {
  1871. core.warning(`${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error}`);
  1872. }
  1873. });
  1874. }
  1875. // Main
  1876. if (!stateHelper.IsPost) {
  1877. run();
  1878. }
  1879. // Post
  1880. else {
  1881. cleanup();
  1882. }
  1883. /***/ }),
  1884. /***/ 8601:
  1885. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  1886. "use strict";
  1887. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  1888. if (k2 === undefined) k2 = k;
  1889. var desc = Object.getOwnPropertyDescriptor(m, k);
  1890. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  1891. desc = { enumerable: true, get: function() { return m[k]; } };
  1892. }
  1893. Object.defineProperty(o, k2, desc);
  1894. }) : (function(o, m, k, k2) {
  1895. if (k2 === undefined) k2 = k;
  1896. o[k2] = m[k];
  1897. }));
  1898. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  1899. Object.defineProperty(o, "default", { enumerable: true, value: v });
  1900. }) : function(o, v) {
  1901. o["default"] = v;
  1902. });
  1903. var __importStar = (this && this.__importStar) || function (mod) {
  1904. if (mod && mod.__esModule) return mod;
  1905. var result = {};
  1906. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  1907. __setModuleDefault(result, mod);
  1908. return result;
  1909. };
  1910. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  1911. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  1912. return new (P || (P = Promise))(function (resolve, reject) {
  1913. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  1914. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  1915. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  1916. step((generator = generator.apply(thisArg, _arguments || [])).next());
  1917. });
  1918. };
  1919. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1920. exports.tagsRefSpec = void 0;
  1921. exports.getCheckoutInfo = getCheckoutInfo;
  1922. exports.getRefSpecForAllHistory = getRefSpecForAllHistory;
  1923. exports.getRefSpec = getRefSpec;
  1924. exports.testRef = testRef;
  1925. exports.checkCommitInfo = checkCommitInfo;
  1926. const core = __importStar(__nccwpck_require__(2186));
  1927. const github = __importStar(__nccwpck_require__(5438));
  1928. const url_helper_1 = __nccwpck_require__(9437);
  1929. exports.tagsRefSpec = '+refs/tags/*:refs/tags/*';
  1930. function getCheckoutInfo(git, ref, commit) {
  1931. return __awaiter(this, void 0, void 0, function* () {
  1932. if (!git) {
  1933. throw new Error('Arg git cannot be empty');
  1934. }
  1935. if (!ref && !commit) {
  1936. throw new Error('Args ref and commit cannot both be empty');
  1937. }
  1938. const result = {};
  1939. const upperRef = (ref || '').toUpperCase();
  1940. // SHA only
  1941. if (!ref) {
  1942. result.ref = commit;
  1943. }
  1944. // refs/heads/
  1945. else if (upperRef.startsWith('REFS/HEADS/')) {
  1946. const branch = ref.substring('refs/heads/'.length);
  1947. result.ref = branch;
  1948. result.startPoint = `refs/remotes/origin/${branch}`;
  1949. }
  1950. // refs/pull/
  1951. else if (upperRef.startsWith('REFS/PULL/')) {
  1952. const branch = ref.substring('refs/pull/'.length);
  1953. result.ref = `refs/remotes/pull/${branch}`;
  1954. }
  1955. // refs/tags/
  1956. else if (upperRef.startsWith('REFS/TAGS/')) {
  1957. result.ref = ref;
  1958. }
  1959. // refs/
  1960. else if (upperRef.startsWith('REFS/') && commit) {
  1961. result.ref = commit;
  1962. }
  1963. // Unqualified ref, check for a matching branch or tag
  1964. else {
  1965. if (yield git.branchExists(true, `origin/${ref}`)) {
  1966. result.ref = ref;
  1967. result.startPoint = `refs/remotes/origin/${ref}`;
  1968. }
  1969. else if (yield git.tagExists(`${ref}`)) {
  1970. result.ref = `refs/tags/${ref}`;
  1971. }
  1972. else {
  1973. throw new Error(`A branch or tag with the name '${ref}' could not be found`);
  1974. }
  1975. }
  1976. return result;
  1977. });
  1978. }
  1979. function getRefSpecForAllHistory(ref, commit) {
  1980. const result = ['+refs/heads/*:refs/remotes/origin/*', exports.tagsRefSpec];
  1981. if (ref && ref.toUpperCase().startsWith('REFS/PULL/')) {
  1982. const branch = ref.substring('refs/pull/'.length);
  1983. result.push(`+${commit || ref}:refs/remotes/pull/${branch}`);
  1984. }
  1985. return result;
  1986. }
  1987. function getRefSpec(ref, commit) {
  1988. if (!ref && !commit) {
  1989. throw new Error('Args ref and commit cannot both be empty');
  1990. }
  1991. const upperRef = (ref || '').toUpperCase();
  1992. // SHA
  1993. if (commit) {
  1994. // refs/heads
  1995. if (upperRef.startsWith('REFS/HEADS/')) {
  1996. const branch = ref.substring('refs/heads/'.length);
  1997. return [`+${commit}:refs/remotes/origin/${branch}`];
  1998. }
  1999. // refs/pull/
  2000. else if (upperRef.startsWith('REFS/PULL/')) {
  2001. const branch = ref.substring('refs/pull/'.length);
  2002. return [`+${commit}:refs/remotes/pull/${branch}`];
  2003. }
  2004. // refs/tags/
  2005. else if (upperRef.startsWith('REFS/TAGS/')) {
  2006. return [`+${commit}:${ref}`];
  2007. }
  2008. // Otherwise no destination ref
  2009. else {
  2010. return [commit];
  2011. }
  2012. }
  2013. // Unqualified ref, check for a matching branch or tag
  2014. else if (!upperRef.startsWith('REFS/')) {
  2015. return [
  2016. `+refs/heads/${ref}*:refs/remotes/origin/${ref}*`,
  2017. `+refs/tags/${ref}*:refs/tags/${ref}*`
  2018. ];
  2019. }
  2020. // refs/heads/
  2021. else if (upperRef.startsWith('REFS/HEADS/')) {
  2022. const branch = ref.substring('refs/heads/'.length);
  2023. return [`+${ref}:refs/remotes/origin/${branch}`];
  2024. }
  2025. // refs/pull/
  2026. else if (upperRef.startsWith('REFS/PULL/')) {
  2027. const branch = ref.substring('refs/pull/'.length);
  2028. return [`+${ref}:refs/remotes/pull/${branch}`];
  2029. }
  2030. // refs/tags/
  2031. else {
  2032. return [`+${ref}:${ref}`];
  2033. }
  2034. }
  2035. /**
  2036. * Tests whether the initial fetch created the ref at the expected commit
  2037. */
  2038. function testRef(git, ref, commit) {
  2039. return __awaiter(this, void 0, void 0, function* () {
  2040. if (!git) {
  2041. throw new Error('Arg git cannot be empty');
  2042. }
  2043. if (!ref && !commit) {
  2044. throw new Error('Args ref and commit cannot both be empty');
  2045. }
  2046. // No SHA? Nothing to test
  2047. if (!commit) {
  2048. return true;
  2049. }
  2050. // SHA only?
  2051. else if (!ref) {
  2052. return yield git.shaExists(commit);
  2053. }
  2054. const upperRef = ref.toUpperCase();
  2055. // refs/heads/
  2056. if (upperRef.startsWith('REFS/HEADS/')) {
  2057. const branch = ref.substring('refs/heads/'.length);
  2058. return ((yield git.branchExists(true, `origin/${branch}`)) &&
  2059. commit === (yield git.revParse(`refs/remotes/origin/${branch}`)));
  2060. }
  2061. // refs/pull/
  2062. else if (upperRef.startsWith('REFS/PULL/')) {
  2063. // Assume matches because fetched using the commit
  2064. return true;
  2065. }
  2066. // refs/tags/
  2067. else if (upperRef.startsWith('REFS/TAGS/')) {
  2068. const tagName = ref.substring('refs/tags/'.length);
  2069. return ((yield git.tagExists(tagName)) && commit === (yield git.revParse(ref)));
  2070. }
  2071. // Unexpected
  2072. else {
  2073. core.debug(`Unexpected ref format '${ref}' when testing ref info`);
  2074. return true;
  2075. }
  2076. });
  2077. }
  2078. function checkCommitInfo(token, commitInfo, repositoryOwner, repositoryName, ref, commit, baseUrl) {
  2079. return __awaiter(this, void 0, void 0, function* () {
  2080. var _a;
  2081. try {
  2082. // GHES?
  2083. if ((0, url_helper_1.isGhes)(baseUrl)) {
  2084. return;
  2085. }
  2086. // Auth token?
  2087. if (!token) {
  2088. return;
  2089. }
  2090. // Public PR synchronize, for workflow repo?
  2091. if (fromPayload('repository.private') !== false ||
  2092. github.context.eventName !== 'pull_request' ||
  2093. fromPayload('action') !== 'synchronize' ||
  2094. repositoryOwner !== github.context.repo.owner ||
  2095. repositoryName !== github.context.repo.repo ||
  2096. ref !== github.context.ref ||
  2097. !ref.startsWith('refs/pull/') ||
  2098. commit !== github.context.sha) {
  2099. return;
  2100. }
  2101. // Head SHA
  2102. const expectedHeadSha = fromPayload('after');
  2103. if (!expectedHeadSha) {
  2104. core.debug('Unable to determine head sha');
  2105. return;
  2106. }
  2107. // Base SHA
  2108. const expectedBaseSha = fromPayload('pull_request.base.sha');
  2109. if (!expectedBaseSha) {
  2110. core.debug('Unable to determine base sha');
  2111. return;
  2112. }
  2113. // Expected message?
  2114. const expectedMessage = `Merge ${expectedHeadSha} into ${expectedBaseSha}`;
  2115. if (commitInfo.indexOf(expectedMessage) >= 0) {
  2116. return;
  2117. }
  2118. // Extract details from message
  2119. const match = commitInfo.match(/Merge ([0-9a-f]{40}) into ([0-9a-f]{40})/);
  2120. if (!match) {
  2121. core.debug('Unexpected message format');
  2122. return;
  2123. }
  2124. // Post telemetry
  2125. const actualHeadSha = match[1];
  2126. if (actualHeadSha !== expectedHeadSha) {
  2127. core.debug(`Expected head sha ${expectedHeadSha}; actual head sha ${actualHeadSha}`);
  2128. const octokit = github.getOctokit(token, {
  2129. baseUrl: (0, url_helper_1.getServerApiUrl)(baseUrl),
  2130. 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})`
  2131. });
  2132. yield octokit.rest.repos.get({
  2133. owner: repositoryOwner,
  2134. repo: repositoryName
  2135. });
  2136. }
  2137. }
  2138. catch (err) {
  2139. core.debug(`Error when validating commit info: ${(_a = err === null || err === void 0 ? void 0 : err.stack) !== null && _a !== void 0 ? _a : err}`);
  2140. }
  2141. });
  2142. }
  2143. function fromPayload(path) {
  2144. return select(github.context.payload, path);
  2145. }
  2146. function select(obj, path) {
  2147. if (!obj) {
  2148. return undefined;
  2149. }
  2150. const i = path.indexOf('.');
  2151. if (i < 0) {
  2152. return obj[path];
  2153. }
  2154. const key = path.substr(0, i);
  2155. return select(obj[key], path.substr(i + 1));
  2156. }
  2157. /***/ }),
  2158. /***/ 3120:
  2159. /***/ ((__unused_webpack_module, exports) => {
  2160. "use strict";
  2161. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2162. exports.escape = escape;
  2163. function escape(value) {
  2164. return value.replace(/[^a-zA-Z0-9_]/g, x => {
  2165. return `\\${x}`;
  2166. });
  2167. }
  2168. /***/ }),
  2169. /***/ 2155:
  2170. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2171. "use strict";
  2172. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2173. if (k2 === undefined) k2 = k;
  2174. var desc = Object.getOwnPropertyDescriptor(m, k);
  2175. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2176. desc = { enumerable: true, get: function() { return m[k]; } };
  2177. }
  2178. Object.defineProperty(o, k2, desc);
  2179. }) : (function(o, m, k, k2) {
  2180. if (k2 === undefined) k2 = k;
  2181. o[k2] = m[k];
  2182. }));
  2183. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2184. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2185. }) : function(o, v) {
  2186. o["default"] = v;
  2187. });
  2188. var __importStar = (this && this.__importStar) || function (mod) {
  2189. if (mod && mod.__esModule) return mod;
  2190. var result = {};
  2191. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2192. __setModuleDefault(result, mod);
  2193. return result;
  2194. };
  2195. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2196. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2197. return new (P || (P = Promise))(function (resolve, reject) {
  2198. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2199. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2200. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2201. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2202. });
  2203. };
  2204. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2205. exports.RetryHelper = void 0;
  2206. exports.execute = execute;
  2207. const core = __importStar(__nccwpck_require__(2186));
  2208. const defaultMaxAttempts = 3;
  2209. const defaultMinSeconds = 10;
  2210. const defaultMaxSeconds = 20;
  2211. class RetryHelper {
  2212. constructor(maxAttempts = defaultMaxAttempts, minSeconds = defaultMinSeconds, maxSeconds = defaultMaxSeconds) {
  2213. this.maxAttempts = maxAttempts;
  2214. this.minSeconds = Math.floor(minSeconds);
  2215. this.maxSeconds = Math.floor(maxSeconds);
  2216. if (this.minSeconds > this.maxSeconds) {
  2217. throw new Error('min seconds should be less than or equal to max seconds');
  2218. }
  2219. }
  2220. execute(action) {
  2221. return __awaiter(this, void 0, void 0, function* () {
  2222. let attempt = 1;
  2223. while (attempt < this.maxAttempts) {
  2224. // Try
  2225. try {
  2226. return yield action();
  2227. }
  2228. catch (err) {
  2229. core.info(err === null || err === void 0 ? void 0 : err.message);
  2230. }
  2231. // Sleep
  2232. const seconds = this.getSleepAmount();
  2233. core.info(`Waiting ${seconds} seconds before trying again`);
  2234. yield this.sleep(seconds);
  2235. attempt++;
  2236. }
  2237. // Last attempt
  2238. return yield action();
  2239. });
  2240. }
  2241. getSleepAmount() {
  2242. return (Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) +
  2243. this.minSeconds);
  2244. }
  2245. sleep(seconds) {
  2246. return __awaiter(this, void 0, void 0, function* () {
  2247. return new Promise(resolve => setTimeout(resolve, seconds * 1000));
  2248. });
  2249. }
  2250. }
  2251. exports.RetryHelper = RetryHelper;
  2252. function execute(action) {
  2253. return __awaiter(this, void 0, void 0, function* () {
  2254. const retryHelper = new RetryHelper();
  2255. return yield retryHelper.execute(action);
  2256. });
  2257. }
  2258. /***/ }),
  2259. /***/ 4866:
  2260. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2261. "use strict";
  2262. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2263. if (k2 === undefined) k2 = k;
  2264. var desc = Object.getOwnPropertyDescriptor(m, k);
  2265. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2266. desc = { enumerable: true, get: function() { return m[k]; } };
  2267. }
  2268. Object.defineProperty(o, k2, desc);
  2269. }) : (function(o, m, k, k2) {
  2270. if (k2 === undefined) k2 = k;
  2271. o[k2] = m[k];
  2272. }));
  2273. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2274. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2275. }) : function(o, v) {
  2276. o["default"] = v;
  2277. });
  2278. var __importStar = (this && this.__importStar) || function (mod) {
  2279. if (mod && mod.__esModule) return mod;
  2280. var result = {};
  2281. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2282. __setModuleDefault(result, mod);
  2283. return result;
  2284. };
  2285. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2286. exports.SshKnownHostsPath = exports.SshKeyPath = exports.PostSetSafeDirectory = exports.RepositoryPath = exports.IsPost = void 0;
  2287. exports.setRepositoryPath = setRepositoryPath;
  2288. exports.setSshKeyPath = setSshKeyPath;
  2289. exports.setSshKnownHostsPath = setSshKnownHostsPath;
  2290. exports.setSafeDirectory = setSafeDirectory;
  2291. const core = __importStar(__nccwpck_require__(2186));
  2292. /**
  2293. * Indicates whether the POST action is running
  2294. */
  2295. exports.IsPost = !!core.getState('isPost');
  2296. /**
  2297. * The repository path for the POST action. The value is empty during the MAIN action.
  2298. */
  2299. exports.RepositoryPath = core.getState('repositoryPath');
  2300. /**
  2301. * The set-safe-directory for the POST action. The value is set if input: 'safe-directory' is set during the MAIN action.
  2302. */
  2303. exports.PostSetSafeDirectory = core.getState('setSafeDirectory') === 'true';
  2304. /**
  2305. * The SSH key path for the POST action. The value is empty during the MAIN action.
  2306. */
  2307. exports.SshKeyPath = core.getState('sshKeyPath');
  2308. /**
  2309. * The SSH known hosts path for the POST action. The value is empty during the MAIN action.
  2310. */
  2311. exports.SshKnownHostsPath = core.getState('sshKnownHostsPath');
  2312. /**
  2313. * Save the repository path so the POST action can retrieve the value.
  2314. */
  2315. function setRepositoryPath(repositoryPath) {
  2316. core.saveState('repositoryPath', repositoryPath);
  2317. }
  2318. /**
  2319. * Save the SSH key path so the POST action can retrieve the value.
  2320. */
  2321. function setSshKeyPath(sshKeyPath) {
  2322. core.saveState('sshKeyPath', sshKeyPath);
  2323. }
  2324. /**
  2325. * Save the SSH known hosts path so the POST action can retrieve the value.
  2326. */
  2327. function setSshKnownHostsPath(sshKnownHostsPath) {
  2328. core.saveState('sshKnownHostsPath', sshKnownHostsPath);
  2329. }
  2330. /**
  2331. * Save the set-safe-directory input so the POST action can retrieve the value.
  2332. */
  2333. function setSafeDirectory() {
  2334. core.saveState('setSafeDirectory', 'true');
  2335. }
  2336. // Publish a variable so that when the POST action runs, it can determine it should run the cleanup logic.
  2337. // This is necessary since we don't have a separate entry point.
  2338. if (!exports.IsPost) {
  2339. core.saveState('isPost', 'true');
  2340. }
  2341. /***/ }),
  2342. /***/ 9437:
  2343. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2344. "use strict";
  2345. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2346. if (k2 === undefined) k2 = k;
  2347. var desc = Object.getOwnPropertyDescriptor(m, k);
  2348. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2349. desc = { enumerable: true, get: function() { return m[k]; } };
  2350. }
  2351. Object.defineProperty(o, k2, desc);
  2352. }) : (function(o, m, k, k2) {
  2353. if (k2 === undefined) k2 = k;
  2354. o[k2] = m[k];
  2355. }));
  2356. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2357. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2358. }) : function(o, v) {
  2359. o["default"] = v;
  2360. });
  2361. var __importStar = (this && this.__importStar) || function (mod) {
  2362. if (mod && mod.__esModule) return mod;
  2363. var result = {};
  2364. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2365. __setModuleDefault(result, mod);
  2366. return result;
  2367. };
  2368. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2369. exports.getFetchUrl = getFetchUrl;
  2370. exports.getServerUrl = getServerUrl;
  2371. exports.getServerApiUrl = getServerApiUrl;
  2372. exports.isGhes = isGhes;
  2373. const assert = __importStar(__nccwpck_require__(9491));
  2374. const url_1 = __nccwpck_require__(7310);
  2375. function getFetchUrl(settings) {
  2376. assert.ok(settings.repositoryOwner, 'settings.repositoryOwner must be defined');
  2377. assert.ok(settings.repositoryName, 'settings.repositoryName must be defined');
  2378. const serviceUrl = getServerUrl(settings.githubServerUrl);
  2379. const encodedOwner = encodeURIComponent(settings.repositoryOwner);
  2380. const encodedName = encodeURIComponent(settings.repositoryName);
  2381. if (settings.sshKey) {
  2382. const user = settings.sshUser.length > 0 ? settings.sshUser : 'git';
  2383. return `${user}@${serviceUrl.hostname}:${encodedOwner}/${encodedName}.git`;
  2384. }
  2385. // "origin" is SCHEME://HOSTNAME[:PORT]
  2386. return `${serviceUrl.origin}/${encodedOwner}/${encodedName}`;
  2387. }
  2388. function getServerUrl(url) {
  2389. let urlValue = url && url.trim().length > 0
  2390. ? url
  2391. : process.env['GITHUB_SERVER_URL'] || 'https://github.com';
  2392. return new url_1.URL(urlValue);
  2393. }
  2394. function getServerApiUrl(url) {
  2395. let apiUrl = 'https://api.github.com';
  2396. if (isGhes(url)) {
  2397. const serverUrl = getServerUrl(url);
  2398. apiUrl = new url_1.URL(`${serverUrl.origin}/api/v3`).toString();
  2399. }
  2400. return apiUrl;
  2401. }
  2402. function isGhes(url) {
  2403. const ghUrl = getServerUrl(url);
  2404. return ghUrl.hostname.toUpperCase() !== 'GITHUB.COM';
  2405. }
  2406. /***/ }),
  2407. /***/ 9568:
  2408. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2409. "use strict";
  2410. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2411. if (k2 === undefined) k2 = k;
  2412. var desc = Object.getOwnPropertyDescriptor(m, k);
  2413. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2414. desc = { enumerable: true, get: function() { return m[k]; } };
  2415. }
  2416. Object.defineProperty(o, k2, desc);
  2417. }) : (function(o, m, k, k2) {
  2418. if (k2 === undefined) k2 = k;
  2419. o[k2] = m[k];
  2420. }));
  2421. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2422. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2423. }) : function(o, v) {
  2424. o["default"] = v;
  2425. });
  2426. var __importStar = (this && this.__importStar) || function (mod) {
  2427. if (mod && mod.__esModule) return mod;
  2428. var result = {};
  2429. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2430. __setModuleDefault(result, mod);
  2431. return result;
  2432. };
  2433. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2434. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2435. return new (P || (P = Promise))(function (resolve, reject) {
  2436. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2437. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2438. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2439. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2440. });
  2441. };
  2442. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2443. exports.getOrganizationId = getOrganizationId;
  2444. const core = __importStar(__nccwpck_require__(2186));
  2445. const fs = __importStar(__nccwpck_require__(7147));
  2446. /**
  2447. * Gets the organization ID of the running workflow or undefined if the value cannot be loaded from the GITHUB_EVENT_PATH
  2448. */
  2449. function getOrganizationId() {
  2450. return __awaiter(this, void 0, void 0, function* () {
  2451. var _a, _b;
  2452. try {
  2453. const eventPath = process.env.GITHUB_EVENT_PATH;
  2454. if (!eventPath) {
  2455. core.debug(`GITHUB_EVENT_PATH is not defined`);
  2456. return;
  2457. }
  2458. const content = yield fs.promises.readFile(eventPath, { encoding: 'utf8' });
  2459. const event = JSON.parse(content);
  2460. const id = (_b = (_a = event === null || event === void 0 ? void 0 : event.repository) === null || _a === void 0 ? void 0 : _a.owner) === null || _b === void 0 ? void 0 : _b.id;
  2461. if (typeof id !== 'number') {
  2462. core.debug('Repository owner ID not found within GITHUB event info');
  2463. return;
  2464. }
  2465. return id;
  2466. }
  2467. catch (err) {
  2468. core.debug(`Unable to load organization ID from GITHUB_EVENT_PATH: ${err.message || err}`);
  2469. }
  2470. });
  2471. }
  2472. /***/ }),
  2473. /***/ 7351:
  2474. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2475. "use strict";
  2476. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2477. if (k2 === undefined) k2 = k;
  2478. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  2479. }) : (function(o, m, k, k2) {
  2480. if (k2 === undefined) k2 = k;
  2481. o[k2] = m[k];
  2482. }));
  2483. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2484. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2485. }) : function(o, v) {
  2486. o["default"] = v;
  2487. });
  2488. var __importStar = (this && this.__importStar) || function (mod) {
  2489. if (mod && mod.__esModule) return mod;
  2490. var result = {};
  2491. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2492. __setModuleDefault(result, mod);
  2493. return result;
  2494. };
  2495. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2496. exports.issue = exports.issueCommand = void 0;
  2497. const os = __importStar(__nccwpck_require__(2037));
  2498. const utils_1 = __nccwpck_require__(5278);
  2499. /**
  2500. * Commands
  2501. *
  2502. * Command Format:
  2503. * ::name key=value,key=value::message
  2504. *
  2505. * Examples:
  2506. * ::warning::This is the message
  2507. * ::set-env name=MY_VAR::some value
  2508. */
  2509. function issueCommand(command, properties, message) {
  2510. const cmd = new Command(command, properties, message);
  2511. process.stdout.write(cmd.toString() + os.EOL);
  2512. }
  2513. exports.issueCommand = issueCommand;
  2514. function issue(name, message = '') {
  2515. issueCommand(name, {}, message);
  2516. }
  2517. exports.issue = issue;
  2518. const CMD_STRING = '::';
  2519. class Command {
  2520. constructor(command, properties, message) {
  2521. if (!command) {
  2522. command = 'missing.command';
  2523. }
  2524. this.command = command;
  2525. this.properties = properties;
  2526. this.message = message;
  2527. }
  2528. toString() {
  2529. let cmdStr = CMD_STRING + this.command;
  2530. if (this.properties && Object.keys(this.properties).length > 0) {
  2531. cmdStr += ' ';
  2532. let first = true;
  2533. for (const key in this.properties) {
  2534. if (this.properties.hasOwnProperty(key)) {
  2535. const val = this.properties[key];
  2536. if (val) {
  2537. if (first) {
  2538. first = false;
  2539. }
  2540. else {
  2541. cmdStr += ',';
  2542. }
  2543. cmdStr += `${key}=${escapeProperty(val)}`;
  2544. }
  2545. }
  2546. }
  2547. }
  2548. cmdStr += `${CMD_STRING}${escapeData(this.message)}`;
  2549. return cmdStr;
  2550. }
  2551. }
  2552. function escapeData(s) {
  2553. return utils_1.toCommandValue(s)
  2554. .replace(/%/g, '%25')
  2555. .replace(/\r/g, '%0D')
  2556. .replace(/\n/g, '%0A');
  2557. }
  2558. function escapeProperty(s) {
  2559. return utils_1.toCommandValue(s)
  2560. .replace(/%/g, '%25')
  2561. .replace(/\r/g, '%0D')
  2562. .replace(/\n/g, '%0A')
  2563. .replace(/:/g, '%3A')
  2564. .replace(/,/g, '%2C');
  2565. }
  2566. //# sourceMappingURL=command.js.map
  2567. /***/ }),
  2568. /***/ 2186:
  2569. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2570. "use strict";
  2571. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2572. if (k2 === undefined) k2 = k;
  2573. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  2574. }) : (function(o, m, k, k2) {
  2575. if (k2 === undefined) k2 = k;
  2576. o[k2] = m[k];
  2577. }));
  2578. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2579. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2580. }) : function(o, v) {
  2581. o["default"] = v;
  2582. });
  2583. var __importStar = (this && this.__importStar) || function (mod) {
  2584. if (mod && mod.__esModule) return mod;
  2585. var result = {};
  2586. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2587. __setModuleDefault(result, mod);
  2588. return result;
  2589. };
  2590. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2591. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2592. return new (P || (P = Promise))(function (resolve, reject) {
  2593. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2594. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2595. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2596. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2597. });
  2598. };
  2599. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2600. 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;
  2601. const command_1 = __nccwpck_require__(7351);
  2602. const file_command_1 = __nccwpck_require__(717);
  2603. const utils_1 = __nccwpck_require__(5278);
  2604. const os = __importStar(__nccwpck_require__(2037));
  2605. const path = __importStar(__nccwpck_require__(1017));
  2606. const oidc_utils_1 = __nccwpck_require__(8041);
  2607. /**
  2608. * The code to exit an action
  2609. */
  2610. var ExitCode;
  2611. (function (ExitCode) {
  2612. /**
  2613. * A code indicating that the action was successful
  2614. */
  2615. ExitCode[ExitCode["Success"] = 0] = "Success";
  2616. /**
  2617. * A code indicating that the action was a failure
  2618. */
  2619. ExitCode[ExitCode["Failure"] = 1] = "Failure";
  2620. })(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
  2621. //-----------------------------------------------------------------------
  2622. // Variables
  2623. //-----------------------------------------------------------------------
  2624. /**
  2625. * Sets env variable for this action and future actions in the job
  2626. * @param name the name of the variable to set
  2627. * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify
  2628. */
  2629. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  2630. function exportVariable(name, val) {
  2631. const convertedVal = utils_1.toCommandValue(val);
  2632. process.env[name] = convertedVal;
  2633. const filePath = process.env['GITHUB_ENV'] || '';
  2634. if (filePath) {
  2635. return file_command_1.issueFileCommand('ENV', file_command_1.prepareKeyValueMessage(name, val));
  2636. }
  2637. command_1.issueCommand('set-env', { name }, convertedVal);
  2638. }
  2639. exports.exportVariable = exportVariable;
  2640. /**
  2641. * Registers a secret which will get masked from logs
  2642. * @param secret value of the secret
  2643. */
  2644. function setSecret(secret) {
  2645. command_1.issueCommand('add-mask', {}, secret);
  2646. }
  2647. exports.setSecret = setSecret;
  2648. /**
  2649. * Prepends inputPath to the PATH (for this action and future actions)
  2650. * @param inputPath
  2651. */
  2652. function addPath(inputPath) {
  2653. const filePath = process.env['GITHUB_PATH'] || '';
  2654. if (filePath) {
  2655. file_command_1.issueFileCommand('PATH', inputPath);
  2656. }
  2657. else {
  2658. command_1.issueCommand('add-path', {}, inputPath);
  2659. }
  2660. process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
  2661. }
  2662. exports.addPath = addPath;
  2663. /**
  2664. * Gets the value of an input.
  2665. * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed.
  2666. * Returns an empty string if the value is not defined.
  2667. *
  2668. * @param name name of the input to get
  2669. * @param options optional. See InputOptions.
  2670. * @returns string
  2671. */
  2672. function getInput(name, options) {
  2673. const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';
  2674. if (options && options.required && !val) {
  2675. throw new Error(`Input required and not supplied: ${name}`);
  2676. }
  2677. if (options && options.trimWhitespace === false) {
  2678. return val;
  2679. }
  2680. return val.trim();
  2681. }
  2682. exports.getInput = getInput;
  2683. /**
  2684. * Gets the values of an multiline input. Each value is also trimmed.
  2685. *
  2686. * @param name name of the input to get
  2687. * @param options optional. See InputOptions.
  2688. * @returns string[]
  2689. *
  2690. */
  2691. function getMultilineInput(name, options) {
  2692. const inputs = getInput(name, options)
  2693. .split('\n')
  2694. .filter(x => x !== '');
  2695. if (options && options.trimWhitespace === false) {
  2696. return inputs;
  2697. }
  2698. return inputs.map(input => input.trim());
  2699. }
  2700. exports.getMultilineInput = getMultilineInput;
  2701. /**
  2702. * Gets the input value of the boolean type in the YAML 1.2 "core schema" specification.
  2703. * Support boolean input list: `true | True | TRUE | false | False | FALSE` .
  2704. * The return value is also in boolean type.
  2705. * ref: https://yaml.org/spec/1.2/spec.html#id2804923
  2706. *
  2707. * @param name name of the input to get
  2708. * @param options optional. See InputOptions.
  2709. * @returns boolean
  2710. */
  2711. function getBooleanInput(name, options) {
  2712. const trueValue = ['true', 'True', 'TRUE'];
  2713. const falseValue = ['false', 'False', 'FALSE'];
  2714. const val = getInput(name, options);
  2715. if (trueValue.includes(val))
  2716. return true;
  2717. if (falseValue.includes(val))
  2718. return false;
  2719. throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${name}\n` +
  2720. `Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);
  2721. }
  2722. exports.getBooleanInput = getBooleanInput;
  2723. /**
  2724. * Sets the value of an output.
  2725. *
  2726. * @param name name of the output to set
  2727. * @param value value to store. Non-string values will be converted to a string via JSON.stringify
  2728. */
  2729. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  2730. function setOutput(name, value) {
  2731. const filePath = process.env['GITHUB_OUTPUT'] || '';
  2732. if (filePath) {
  2733. return file_command_1.issueFileCommand('OUTPUT', file_command_1.prepareKeyValueMessage(name, value));
  2734. }
  2735. process.stdout.write(os.EOL);
  2736. command_1.issueCommand('set-output', { name }, utils_1.toCommandValue(value));
  2737. }
  2738. exports.setOutput = setOutput;
  2739. /**
  2740. * Enables or disables the echoing of commands into stdout for the rest of the step.
  2741. * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.
  2742. *
  2743. */
  2744. function setCommandEcho(enabled) {
  2745. command_1.issue('echo', enabled ? 'on' : 'off');
  2746. }
  2747. exports.setCommandEcho = setCommandEcho;
  2748. //-----------------------------------------------------------------------
  2749. // Results
  2750. //-----------------------------------------------------------------------
  2751. /**
  2752. * Sets the action status to failed.
  2753. * When the action exits it will be with an exit code of 1
  2754. * @param message add error issue message
  2755. */
  2756. function setFailed(message) {
  2757. process.exitCode = ExitCode.Failure;
  2758. error(message);
  2759. }
  2760. exports.setFailed = setFailed;
  2761. //-----------------------------------------------------------------------
  2762. // Logging Commands
  2763. //-----------------------------------------------------------------------
  2764. /**
  2765. * Gets whether Actions Step Debug is on or not
  2766. */
  2767. function isDebug() {
  2768. return process.env['RUNNER_DEBUG'] === '1';
  2769. }
  2770. exports.isDebug = isDebug;
  2771. /**
  2772. * Writes debug message to user log
  2773. * @param message debug message
  2774. */
  2775. function debug(message) {
  2776. command_1.issueCommand('debug', {}, message);
  2777. }
  2778. exports.debug = debug;
  2779. /**
  2780. * Adds an error issue
  2781. * @param message error issue message. Errors will be converted to string via toString()
  2782. * @param properties optional properties to add to the annotation.
  2783. */
  2784. function error(message, properties = {}) {
  2785. command_1.issueCommand('error', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
  2786. }
  2787. exports.error = error;
  2788. /**
  2789. * Adds a warning issue
  2790. * @param message warning issue message. Errors will be converted to string via toString()
  2791. * @param properties optional properties to add to the annotation.
  2792. */
  2793. function warning(message, properties = {}) {
  2794. command_1.issueCommand('warning', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
  2795. }
  2796. exports.warning = warning;
  2797. /**
  2798. * Adds a notice issue
  2799. * @param message notice issue message. Errors will be converted to string via toString()
  2800. * @param properties optional properties to add to the annotation.
  2801. */
  2802. function notice(message, properties = {}) {
  2803. command_1.issueCommand('notice', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
  2804. }
  2805. exports.notice = notice;
  2806. /**
  2807. * Writes info to log with console.log.
  2808. * @param message info message
  2809. */
  2810. function info(message) {
  2811. process.stdout.write(message + os.EOL);
  2812. }
  2813. exports.info = info;
  2814. /**
  2815. * Begin an output group.
  2816. *
  2817. * Output until the next `groupEnd` will be foldable in this group
  2818. *
  2819. * @param name The name of the output group
  2820. */
  2821. function startGroup(name) {
  2822. command_1.issue('group', name);
  2823. }
  2824. exports.startGroup = startGroup;
  2825. /**
  2826. * End an output group.
  2827. */
  2828. function endGroup() {
  2829. command_1.issue('endgroup');
  2830. }
  2831. exports.endGroup = endGroup;
  2832. /**
  2833. * Wrap an asynchronous function call in a group.
  2834. *
  2835. * Returns the same type as the function itself.
  2836. *
  2837. * @param name The name of the group
  2838. * @param fn The function to wrap in the group
  2839. */
  2840. function group(name, fn) {
  2841. return __awaiter(this, void 0, void 0, function* () {
  2842. startGroup(name);
  2843. let result;
  2844. try {
  2845. result = yield fn();
  2846. }
  2847. finally {
  2848. endGroup();
  2849. }
  2850. return result;
  2851. });
  2852. }
  2853. exports.group = group;
  2854. //-----------------------------------------------------------------------
  2855. // Wrapper action state
  2856. //-----------------------------------------------------------------------
  2857. /**
  2858. * Saves state for current action, the state can only be retrieved by this action's post job execution.
  2859. *
  2860. * @param name name of the state to store
  2861. * @param value value to store. Non-string values will be converted to a string via JSON.stringify
  2862. */
  2863. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  2864. function saveState(name, value) {
  2865. const filePath = process.env['GITHUB_STATE'] || '';
  2866. if (filePath) {
  2867. return file_command_1.issueFileCommand('STATE', file_command_1.prepareKeyValueMessage(name, value));
  2868. }
  2869. command_1.issueCommand('save-state', { name }, utils_1.toCommandValue(value));
  2870. }
  2871. exports.saveState = saveState;
  2872. /**
  2873. * Gets the value of an state set by this action's main execution.
  2874. *
  2875. * @param name name of the state to get
  2876. * @returns string
  2877. */
  2878. function getState(name) {
  2879. return process.env[`STATE_${name}`] || '';
  2880. }
  2881. exports.getState = getState;
  2882. function getIDToken(aud) {
  2883. return __awaiter(this, void 0, void 0, function* () {
  2884. return yield oidc_utils_1.OidcClient.getIDToken(aud);
  2885. });
  2886. }
  2887. exports.getIDToken = getIDToken;
  2888. /**
  2889. * Summary exports
  2890. */
  2891. var summary_1 = __nccwpck_require__(1327);
  2892. Object.defineProperty(exports, "summary", ({ enumerable: true, get: function () { return summary_1.summary; } }));
  2893. /**
  2894. * @deprecated use core.summary
  2895. */
  2896. var summary_2 = __nccwpck_require__(1327);
  2897. Object.defineProperty(exports, "markdownSummary", ({ enumerable: true, get: function () { return summary_2.markdownSummary; } }));
  2898. /**
  2899. * Path exports
  2900. */
  2901. var path_utils_1 = __nccwpck_require__(2981);
  2902. Object.defineProperty(exports, "toPosixPath", ({ enumerable: true, get: function () { return path_utils_1.toPosixPath; } }));
  2903. Object.defineProperty(exports, "toWin32Path", ({ enumerable: true, get: function () { return path_utils_1.toWin32Path; } }));
  2904. Object.defineProperty(exports, "toPlatformPath", ({ enumerable: true, get: function () { return path_utils_1.toPlatformPath; } }));
  2905. //# sourceMappingURL=core.js.map
  2906. /***/ }),
  2907. /***/ 717:
  2908. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2909. "use strict";
  2910. // For internal use, subject to change.
  2911. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2912. if (k2 === undefined) k2 = k;
  2913. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  2914. }) : (function(o, m, k, k2) {
  2915. if (k2 === undefined) k2 = k;
  2916. o[k2] = m[k];
  2917. }));
  2918. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2919. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2920. }) : function(o, v) {
  2921. o["default"] = v;
  2922. });
  2923. var __importStar = (this && this.__importStar) || function (mod) {
  2924. if (mod && mod.__esModule) return mod;
  2925. var result = {};
  2926. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2927. __setModuleDefault(result, mod);
  2928. return result;
  2929. };
  2930. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2931. exports.prepareKeyValueMessage = exports.issueFileCommand = void 0;
  2932. // We use any as a valid input type
  2933. /* eslint-disable @typescript-eslint/no-explicit-any */
  2934. const fs = __importStar(__nccwpck_require__(7147));
  2935. const os = __importStar(__nccwpck_require__(2037));
  2936. const uuid_1 = __nccwpck_require__(8974);
  2937. const utils_1 = __nccwpck_require__(5278);
  2938. function issueFileCommand(command, message) {
  2939. const filePath = process.env[`GITHUB_${command}`];
  2940. if (!filePath) {
  2941. throw new Error(`Unable to find environment variable for file command ${command}`);
  2942. }
  2943. if (!fs.existsSync(filePath)) {
  2944. throw new Error(`Missing file at path: ${filePath}`);
  2945. }
  2946. fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {
  2947. encoding: 'utf8'
  2948. });
  2949. }
  2950. exports.issueFileCommand = issueFileCommand;
  2951. function prepareKeyValueMessage(key, value) {
  2952. const delimiter = `ghadelimiter_${uuid_1.v4()}`;
  2953. const convertedValue = utils_1.toCommandValue(value);
  2954. // These should realistically never happen, but just in case someone finds a
  2955. // way to exploit uuid generation let's not allow keys or values that contain
  2956. // the delimiter.
  2957. if (key.includes(delimiter)) {
  2958. throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`);
  2959. }
  2960. if (convertedValue.includes(delimiter)) {
  2961. throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`);
  2962. }
  2963. return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`;
  2964. }
  2965. exports.prepareKeyValueMessage = prepareKeyValueMessage;
  2966. //# sourceMappingURL=file-command.js.map
  2967. /***/ }),
  2968. /***/ 8041:
  2969. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2970. "use strict";
  2971. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2972. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2973. return new (P || (P = Promise))(function (resolve, reject) {
  2974. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2975. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2976. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2977. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2978. });
  2979. };
  2980. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2981. exports.OidcClient = void 0;
  2982. const http_client_1 = __nccwpck_require__(6255);
  2983. const auth_1 = __nccwpck_require__(5526);
  2984. const core_1 = __nccwpck_require__(2186);
  2985. class OidcClient {
  2986. static createHttpClient(allowRetry = true, maxRetry = 10) {
  2987. const requestOptions = {
  2988. allowRetries: allowRetry,
  2989. maxRetries: maxRetry
  2990. };
  2991. return new http_client_1.HttpClient('actions/oidc-client', [new auth_1.BearerCredentialHandler(OidcClient.getRequestToken())], requestOptions);
  2992. }
  2993. static getRequestToken() {
  2994. const token = process.env['ACTIONS_ID_TOKEN_REQUEST_TOKEN'];
  2995. if (!token) {
  2996. throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable');
  2997. }
  2998. return token;
  2999. }
  3000. static getIDTokenUrl() {
  3001. const runtimeUrl = process.env['ACTIONS_ID_TOKEN_REQUEST_URL'];
  3002. if (!runtimeUrl) {
  3003. throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable');
  3004. }
  3005. return runtimeUrl;
  3006. }
  3007. static getCall(id_token_url) {
  3008. var _a;
  3009. return __awaiter(this, void 0, void 0, function* () {
  3010. const httpclient = OidcClient.createHttpClient();
  3011. const res = yield httpclient
  3012. .getJson(id_token_url)
  3013. .catch(error => {
  3014. throw new Error(`Failed to get ID Token. \n
  3015. Error Code : ${error.statusCode}\n
  3016. Error Message: ${error.message}`);
  3017. });
  3018. const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value;
  3019. if (!id_token) {
  3020. throw new Error('Response json body do not have ID Token field');
  3021. }
  3022. return id_token;
  3023. });
  3024. }
  3025. static getIDToken(audience) {
  3026. return __awaiter(this, void 0, void 0, function* () {
  3027. try {
  3028. // New ID Token is requested from action service
  3029. let id_token_url = OidcClient.getIDTokenUrl();
  3030. if (audience) {
  3031. const encodedAudience = encodeURIComponent(audience);
  3032. id_token_url = `${id_token_url}&audience=${encodedAudience}`;
  3033. }
  3034. core_1.debug(`ID token url is ${id_token_url}`);
  3035. const id_token = yield OidcClient.getCall(id_token_url);
  3036. core_1.setSecret(id_token);
  3037. return id_token;
  3038. }
  3039. catch (error) {
  3040. throw new Error(`Error message: ${error.message}`);
  3041. }
  3042. });
  3043. }
  3044. }
  3045. exports.OidcClient = OidcClient;
  3046. //# sourceMappingURL=oidc-utils.js.map
  3047. /***/ }),
  3048. /***/ 2981:
  3049. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  3050. "use strict";
  3051. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  3052. if (k2 === undefined) k2 = k;
  3053. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  3054. }) : (function(o, m, k, k2) {
  3055. if (k2 === undefined) k2 = k;
  3056. o[k2] = m[k];
  3057. }));
  3058. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  3059. Object.defineProperty(o, "default", { enumerable: true, value: v });
  3060. }) : function(o, v) {
  3061. o["default"] = v;
  3062. });
  3063. var __importStar = (this && this.__importStar) || function (mod) {
  3064. if (mod && mod.__esModule) return mod;
  3065. var result = {};
  3066. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  3067. __setModuleDefault(result, mod);
  3068. return result;
  3069. };
  3070. Object.defineProperty(exports, "__esModule", ({ value: true }));
  3071. exports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = void 0;
  3072. const path = __importStar(__nccwpck_require__(1017));
  3073. /**
  3074. * toPosixPath converts the given path to the posix form. On Windows, \\ will be
  3075. * replaced with /.
  3076. *
  3077. * @param pth. Path to transform.
  3078. * @return string Posix path.
  3079. */
  3080. function toPosixPath(pth) {
  3081. return pth.replace(/[\\]/g, '/');
  3082. }
  3083. exports.toPosixPath = toPosixPath;
  3084. /**
  3085. * toWin32Path converts the given path to the win32 form. On Linux, / will be
  3086. * replaced with \\.
  3087. *
  3088. * @param pth. Path to transform.
  3089. * @return string Win32 path.
  3090. */
  3091. function toWin32Path(pth) {
  3092. return pth.replace(/[/]/g, '\\');
  3093. }
  3094. exports.toWin32Path = toWin32Path;
  3095. /**
  3096. * toPlatformPath converts the given path to a platform-specific path. It does
  3097. * this by replacing instances of / and \ with the platform-specific path
  3098. * separator.
  3099. *
  3100. * @param pth The path to platformize.
  3101. * @return string The platform-specific path.
  3102. */
  3103. function toPlatformPath(pth) {
  3104. return pth.replace(/[/\\]/g, path.sep);
  3105. }
  3106. exports.toPlatformPath = toPlatformPath;
  3107. //# sourceMappingURL=path-utils.js.map
  3108. /***/ }),
  3109. /***/ 1327:
  3110. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  3111. "use strict";
  3112. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  3113. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  3114. return new (P || (P = Promise))(function (resolve, reject) {
  3115. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  3116. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  3117. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  3118. step((generator = generator.apply(thisArg, _arguments || [])).next());
  3119. });
  3120. };
  3121. Object.defineProperty(exports, "__esModule", ({ value: true }));
  3122. exports.summary = exports.markdownSummary = exports.SUMMARY_DOCS_URL = exports.SUMMARY_ENV_VAR = void 0;
  3123. const os_1 = __nccwpck_require__(2037);
  3124. const fs_1 = __nccwpck_require__(7147);
  3125. const { access, appendFile, writeFile } = fs_1.promises;
  3126. exports.SUMMARY_ENV_VAR = 'GITHUB_STEP_SUMMARY';
  3127. exports.SUMMARY_DOCS_URL = 'https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary';
  3128. class Summary {
  3129. constructor() {
  3130. this._buffer = '';
  3131. }
  3132. /**
  3133. * Finds the summary file path from the environment, rejects if env var is not found or file does not exist
  3134. * Also checks r/w permissions.
  3135. *
  3136. * @returns step summary file path
  3137. */
  3138. filePath() {
  3139. return __awaiter(this, void 0, void 0, function* () {
  3140. if (this._filePath) {
  3141. return this._filePath;
  3142. }
  3143. const pathFromEnv = process.env[exports.SUMMARY_ENV_VAR];
  3144. if (!pathFromEnv) {
  3145. throw new Error(`Unable to find environment variable for $${exports.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);
  3146. }
  3147. try {
  3148. yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK);
  3149. }
  3150. catch (_a) {
  3151. throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`);
  3152. }
  3153. this._filePath = pathFromEnv;
  3154. return this._filePath;
  3155. });
  3156. }
  3157. /**
  3158. * Wraps content in an HTML tag, adding any HTML attributes
  3159. *
  3160. * @param {string} tag HTML tag to wrap
  3161. * @param {string | null} content content within the tag
  3162. * @param {[attribute: string]: string} attrs key-value list of HTML attributes to add
  3163. *
  3164. * @returns {string} content wrapped in HTML element
  3165. */
  3166. wrap(tag, content, attrs = {}) {
  3167. const htmlAttrs = Object.entries(attrs)
  3168. .map(([key, value]) => ` ${key}="${value}"`)
  3169. .join('');
  3170. if (!content) {
  3171. return `<${tag}${htmlAttrs}>`;
  3172. }
  3173. return `<${tag}${htmlAttrs}>${content}</${tag}>`;
  3174. }
  3175. /**
  3176. * Writes text in the buffer to the summary buffer file and empties buffer. Will append by default.
  3177. *
  3178. * @param {SummaryWriteOptions} [options] (optional) options for write operation
  3179. *
  3180. * @returns {Promise<Summary>} summary instance
  3181. */
  3182. write(options) {
  3183. return __awaiter(this, void 0, void 0, function* () {
  3184. const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite);
  3185. const filePath = yield this.filePath();
  3186. const writeFunc = overwrite ? writeFile : appendFile;
  3187. yield writeFunc(filePath, this._buffer, { encoding: 'utf8' });
  3188. return this.emptyBuffer();
  3189. });
  3190. }
  3191. /**
  3192. * Clears the summary buffer and wipes the summary file
  3193. *
  3194. * @returns {Summary} summary instance
  3195. */
  3196. clear() {
  3197. return __awaiter(this, void 0, void 0, function* () {
  3198. return this.emptyBuffer().write({ overwrite: true });
  3199. });
  3200. }
  3201. /**
  3202. * Returns the current summary buffer as a string
  3203. *
  3204. * @returns {string} string of summary buffer
  3205. */
  3206. stringify() {
  3207. return this._buffer;
  3208. }
  3209. /**
  3210. * If the summary buffer is empty
  3211. *
  3212. * @returns {boolen} true if the buffer is empty
  3213. */
  3214. isEmptyBuffer() {
  3215. return this._buffer.length === 0;
  3216. }
  3217. /**
  3218. * Resets the summary buffer without writing to summary file
  3219. *
  3220. * @returns {Summary} summary instance
  3221. */
  3222. emptyBuffer() {
  3223. this._buffer = '';
  3224. return this;
  3225. }
  3226. /**
  3227. * Adds raw text to the summary buffer
  3228. *
  3229. * @param {string} text content to add
  3230. * @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false)
  3231. *
  3232. * @returns {Summary} summary instance
  3233. */
  3234. addRaw(text, addEOL = false) {
  3235. this._buffer += text;
  3236. return addEOL ? this.addEOL() : this;
  3237. }
  3238. /**
  3239. * Adds the operating system-specific end-of-line marker to the buffer
  3240. *
  3241. * @returns {Summary} summary instance
  3242. */
  3243. addEOL() {
  3244. return this.addRaw(os_1.EOL);
  3245. }
  3246. /**
  3247. * Adds an HTML codeblock to the summary buffer
  3248. *
  3249. * @param {string} code content to render within fenced code block
  3250. * @param {string} lang (optional) language to syntax highlight code
  3251. *
  3252. * @returns {Summary} summary instance
  3253. */
  3254. addCodeBlock(code, lang) {
  3255. const attrs = Object.assign({}, (lang && { lang }));
  3256. const element = this.wrap('pre', this.wrap('code', code), attrs);
  3257. return this.addRaw(element).addEOL();
  3258. }
  3259. /**
  3260. * Adds an HTML list to the summary buffer
  3261. *
  3262. * @param {string[]} items list of items to render
  3263. * @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false)
  3264. *
  3265. * @returns {Summary} summary instance
  3266. */
  3267. addList(items, ordered = false) {
  3268. const tag = ordered ? 'ol' : 'ul';
  3269. const listItems = items.map(item => this.wrap('li', item)).join('');
  3270. const element = this.wrap(tag, listItems);
  3271. return this.addRaw(element).addEOL();
  3272. }
  3273. /**
  3274. * Adds an HTML table to the summary buffer
  3275. *
  3276. * @param {SummaryTableCell[]} rows table rows
  3277. *
  3278. * @returns {Summary} summary instance
  3279. */
  3280. addTable(rows) {
  3281. const tableBody = rows
  3282. .map(row => {
  3283. const cells = row
  3284. .map(cell => {
  3285. if (typeof cell === 'string') {
  3286. return this.wrap('td', cell);
  3287. }
  3288. const { header, data, colspan, rowspan } = cell;
  3289. const tag = header ? 'th' : 'td';
  3290. const attrs = Object.assign(Object.assign({}, (colspan && { colspan })), (rowspan && { rowspan }));
  3291. return this.wrap(tag, data, attrs);
  3292. })
  3293. .join('');
  3294. return this.wrap('tr', cells);
  3295. })
  3296. .join('');
  3297. const element = this.wrap('table', tableBody);
  3298. return this.addRaw(element).addEOL();
  3299. }
  3300. /**
  3301. * Adds a collapsable HTML details element to the summary buffer
  3302. *
  3303. * @param {string} label text for the closed state
  3304. * @param {string} content collapsable content
  3305. *
  3306. * @returns {Summary} summary instance
  3307. */
  3308. addDetails(label, content) {
  3309. const element = this.wrap('details', this.wrap('summary', label) + content);
  3310. return this.addRaw(element).addEOL();
  3311. }
  3312. /**
  3313. * Adds an HTML image tag to the summary buffer
  3314. *
  3315. * @param {string} src path to the image you to embed
  3316. * @param {string} alt text description of the image
  3317. * @param {SummaryImageOptions} options (optional) addition image attributes
  3318. *
  3319. * @returns {Summary} summary instance
  3320. */
  3321. addImage(src, alt, options) {
  3322. const { width, height } = options || {};
  3323. const attrs = Object.assign(Object.assign({}, (width && { width })), (height && { height }));
  3324. const element = this.wrap('img', null, Object.assign({ src, alt }, attrs));
  3325. return this.addRaw(element).addEOL();
  3326. }
  3327. /**
  3328. * Adds an HTML section heading element
  3329. *
  3330. * @param {string} text heading text
  3331. * @param {number | string} [level=1] (optional) the heading level, default: 1
  3332. *
  3333. * @returns {Summary} summary instance
  3334. */
  3335. addHeading(text, level) {
  3336. const tag = `h${level}`;
  3337. const allowedTag = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(tag)
  3338. ? tag
  3339. : 'h1';
  3340. const element = this.wrap(allowedTag, text);
  3341. return this.addRaw(element).addEOL();
  3342. }
  3343. /**
  3344. * Adds an HTML thematic break (<hr>) to the summary buffer
  3345. *
  3346. * @returns {Summary} summary instance
  3347. */
  3348. addSeparator() {
  3349. const element = this.wrap('hr', null);
  3350. return this.addRaw(element).addEOL();
  3351. }
  3352. /**
  3353. * Adds an HTML line break (<br>) to the summary buffer
  3354. *
  3355. * @returns {Summary} summary instance
  3356. */
  3357. addBreak() {
  3358. const element = this.wrap('br', null);
  3359. return this.addRaw(element).addEOL();
  3360. }
  3361. /**
  3362. * Adds an HTML blockquote to the summary buffer
  3363. *
  3364. * @param {string} text quote text
  3365. * @param {string} cite (optional) citation url
  3366. *
  3367. * @returns {Summary} summary instance
  3368. */
  3369. addQuote(text, cite) {
  3370. const attrs = Object.assign({}, (cite && { cite }));
  3371. const element = this.wrap('blockquote', text, attrs);
  3372. return this.addRaw(element).addEOL();
  3373. }
  3374. /**
  3375. * Adds an HTML anchor tag to the summary buffer
  3376. *
  3377. * @param {string} text link text/content
  3378. * @param {string} href hyperlink
  3379. *
  3380. * @returns {Summary} summary instance
  3381. */
  3382. addLink(text, href) {
  3383. const element = this.wrap('a', text, { href });
  3384. return this.addRaw(element).addEOL();
  3385. }
  3386. }
  3387. const _summary = new Summary();
  3388. /**
  3389. * @deprecated use `core.summary`
  3390. */
  3391. exports.markdownSummary = _summary;
  3392. exports.summary = _summary;
  3393. //# sourceMappingURL=summary.js.map
  3394. /***/ }),
  3395. /***/ 5278:
  3396. /***/ ((__unused_webpack_module, exports) => {
  3397. "use strict";
  3398. // We use any as a valid input type
  3399. /* eslint-disable @typescript-eslint/no-explicit-any */
  3400. Object.defineProperty(exports, "__esModule", ({ value: true }));
  3401. exports.toCommandProperties = exports.toCommandValue = void 0;
  3402. /**
  3403. * Sanitizes an input into a string so it can be passed into issueCommand safely
  3404. * @param input input to sanitize into a string
  3405. */
  3406. function toCommandValue(input) {
  3407. if (input === null || input === undefined) {
  3408. return '';
  3409. }
  3410. else if (typeof input === 'string' || input instanceof String) {
  3411. return input;
  3412. }
  3413. return JSON.stringify(input);
  3414. }
  3415. exports.toCommandValue = toCommandValue;
  3416. /**
  3417. *
  3418. * @param annotationProperties
  3419. * @returns The command properties to send with the actual annotation command
  3420. * See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646
  3421. */
  3422. function toCommandProperties(annotationProperties) {
  3423. if (!Object.keys(annotationProperties).length) {
  3424. return {};
  3425. }
  3426. return {
  3427. title: annotationProperties.title,
  3428. file: annotationProperties.file,
  3429. line: annotationProperties.startLine,
  3430. endLine: annotationProperties.endLine,
  3431. col: annotationProperties.startColumn,
  3432. endColumn: annotationProperties.endColumn
  3433. };
  3434. }
  3435. exports.toCommandProperties = toCommandProperties;
  3436. //# sourceMappingURL=utils.js.map
  3437. /***/ }),
  3438. /***/ 8974:
  3439. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3440. "use strict";
  3441. Object.defineProperty(exports, "__esModule", ({
  3442. value: true
  3443. }));
  3444. Object.defineProperty(exports, "v1", ({
  3445. enumerable: true,
  3446. get: function () {
  3447. return _v.default;
  3448. }
  3449. }));
  3450. Object.defineProperty(exports, "v3", ({
  3451. enumerable: true,
  3452. get: function () {
  3453. return _v2.default;
  3454. }
  3455. }));
  3456. Object.defineProperty(exports, "v4", ({
  3457. enumerable: true,
  3458. get: function () {
  3459. return _v3.default;
  3460. }
  3461. }));
  3462. Object.defineProperty(exports, "v5", ({
  3463. enumerable: true,
  3464. get: function () {
  3465. return _v4.default;
  3466. }
  3467. }));
  3468. Object.defineProperty(exports, "NIL", ({
  3469. enumerable: true,
  3470. get: function () {
  3471. return _nil.default;
  3472. }
  3473. }));
  3474. Object.defineProperty(exports, "version", ({
  3475. enumerable: true,
  3476. get: function () {
  3477. return _version.default;
  3478. }
  3479. }));
  3480. Object.defineProperty(exports, "validate", ({
  3481. enumerable: true,
  3482. get: function () {
  3483. return _validate.default;
  3484. }
  3485. }));
  3486. Object.defineProperty(exports, "stringify", ({
  3487. enumerable: true,
  3488. get: function () {
  3489. return _stringify.default;
  3490. }
  3491. }));
  3492. Object.defineProperty(exports, "parse", ({
  3493. enumerable: true,
  3494. get: function () {
  3495. return _parse.default;
  3496. }
  3497. }));
  3498. var _v = _interopRequireDefault(__nccwpck_require__(1595));
  3499. var _v2 = _interopRequireDefault(__nccwpck_require__(6993));
  3500. var _v3 = _interopRequireDefault(__nccwpck_require__(1472));
  3501. var _v4 = _interopRequireDefault(__nccwpck_require__(6217));
  3502. var _nil = _interopRequireDefault(__nccwpck_require__(2381));
  3503. var _version = _interopRequireDefault(__nccwpck_require__(427));
  3504. var _validate = _interopRequireDefault(__nccwpck_require__(2609));
  3505. var _stringify = _interopRequireDefault(__nccwpck_require__(1458));
  3506. var _parse = _interopRequireDefault(__nccwpck_require__(6385));
  3507. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3508. /***/ }),
  3509. /***/ 5842:
  3510. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3511. "use strict";
  3512. Object.defineProperty(exports, "__esModule", ({
  3513. value: true
  3514. }));
  3515. exports["default"] = void 0;
  3516. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  3517. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3518. function md5(bytes) {
  3519. if (Array.isArray(bytes)) {
  3520. bytes = Buffer.from(bytes);
  3521. } else if (typeof bytes === 'string') {
  3522. bytes = Buffer.from(bytes, 'utf8');
  3523. }
  3524. return _crypto.default.createHash('md5').update(bytes).digest();
  3525. }
  3526. var _default = md5;
  3527. exports["default"] = _default;
  3528. /***/ }),
  3529. /***/ 2381:
  3530. /***/ ((__unused_webpack_module, exports) => {
  3531. "use strict";
  3532. Object.defineProperty(exports, "__esModule", ({
  3533. value: true
  3534. }));
  3535. exports["default"] = void 0;
  3536. var _default = '00000000-0000-0000-0000-000000000000';
  3537. exports["default"] = _default;
  3538. /***/ }),
  3539. /***/ 6385:
  3540. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3541. "use strict";
  3542. Object.defineProperty(exports, "__esModule", ({
  3543. value: true
  3544. }));
  3545. exports["default"] = void 0;
  3546. var _validate = _interopRequireDefault(__nccwpck_require__(2609));
  3547. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3548. function parse(uuid) {
  3549. if (!(0, _validate.default)(uuid)) {
  3550. throw TypeError('Invalid UUID');
  3551. }
  3552. let v;
  3553. const arr = new Uint8Array(16); // Parse ########-....-....-....-............
  3554. arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;
  3555. arr[1] = v >>> 16 & 0xff;
  3556. arr[2] = v >>> 8 & 0xff;
  3557. arr[3] = v & 0xff; // Parse ........-####-....-....-............
  3558. arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;
  3559. arr[5] = v & 0xff; // Parse ........-....-####-....-............
  3560. arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;
  3561. arr[7] = v & 0xff; // Parse ........-....-....-####-............
  3562. arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;
  3563. arr[9] = v & 0xff; // Parse ........-....-....-....-############
  3564. // (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes)
  3565. arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;
  3566. arr[11] = v / 0x100000000 & 0xff;
  3567. arr[12] = v >>> 24 & 0xff;
  3568. arr[13] = v >>> 16 & 0xff;
  3569. arr[14] = v >>> 8 & 0xff;
  3570. arr[15] = v & 0xff;
  3571. return arr;
  3572. }
  3573. var _default = parse;
  3574. exports["default"] = _default;
  3575. /***/ }),
  3576. /***/ 6230:
  3577. /***/ ((__unused_webpack_module, exports) => {
  3578. "use strict";
  3579. Object.defineProperty(exports, "__esModule", ({
  3580. value: true
  3581. }));
  3582. exports["default"] = void 0;
  3583. 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;
  3584. exports["default"] = _default;
  3585. /***/ }),
  3586. /***/ 9784:
  3587. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3588. "use strict";
  3589. Object.defineProperty(exports, "__esModule", ({
  3590. value: true
  3591. }));
  3592. exports["default"] = rng;
  3593. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  3594. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3595. const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate
  3596. let poolPtr = rnds8Pool.length;
  3597. function rng() {
  3598. if (poolPtr > rnds8Pool.length - 16) {
  3599. _crypto.default.randomFillSync(rnds8Pool);
  3600. poolPtr = 0;
  3601. }
  3602. return rnds8Pool.slice(poolPtr, poolPtr += 16);
  3603. }
  3604. /***/ }),
  3605. /***/ 8844:
  3606. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3607. "use strict";
  3608. Object.defineProperty(exports, "__esModule", ({
  3609. value: true
  3610. }));
  3611. exports["default"] = void 0;
  3612. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  3613. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3614. function sha1(bytes) {
  3615. if (Array.isArray(bytes)) {
  3616. bytes = Buffer.from(bytes);
  3617. } else if (typeof bytes === 'string') {
  3618. bytes = Buffer.from(bytes, 'utf8');
  3619. }
  3620. return _crypto.default.createHash('sha1').update(bytes).digest();
  3621. }
  3622. var _default = sha1;
  3623. exports["default"] = _default;
  3624. /***/ }),
  3625. /***/ 1458:
  3626. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3627. "use strict";
  3628. Object.defineProperty(exports, "__esModule", ({
  3629. value: true
  3630. }));
  3631. exports["default"] = void 0;
  3632. var _validate = _interopRequireDefault(__nccwpck_require__(2609));
  3633. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3634. /**
  3635. * Convert array of 16 byte values to UUID string format of the form:
  3636. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  3637. */
  3638. const byteToHex = [];
  3639. for (let i = 0; i < 256; ++i) {
  3640. byteToHex.push((i + 0x100).toString(16).substr(1));
  3641. }
  3642. function stringify(arr, offset = 0) {
  3643. // Note: Be careful editing this code! It's been tuned for performance
  3644. // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
  3645. 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
  3646. // of the following:
  3647. // - One or more input array values don't map to a hex octet (leading to
  3648. // "undefined" in the uuid)
  3649. // - Invalid input values for the RFC `version` or `variant` fields
  3650. if (!(0, _validate.default)(uuid)) {
  3651. throw TypeError('Stringified UUID is invalid');
  3652. }
  3653. return uuid;
  3654. }
  3655. var _default = stringify;
  3656. exports["default"] = _default;
  3657. /***/ }),
  3658. /***/ 1595:
  3659. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3660. "use strict";
  3661. Object.defineProperty(exports, "__esModule", ({
  3662. value: true
  3663. }));
  3664. exports["default"] = void 0;
  3665. var _rng = _interopRequireDefault(__nccwpck_require__(9784));
  3666. var _stringify = _interopRequireDefault(__nccwpck_require__(1458));
  3667. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3668. // **`v1()` - Generate time-based UUID**
  3669. //
  3670. // Inspired by https://github.com/LiosK/UUID.js
  3671. // and http://docs.python.org/library/uuid.html
  3672. let _nodeId;
  3673. let _clockseq; // Previous uuid creation time
  3674. let _lastMSecs = 0;
  3675. let _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details
  3676. function v1(options, buf, offset) {
  3677. let i = buf && offset || 0;
  3678. const b = buf || new Array(16);
  3679. options = options || {};
  3680. let node = options.node || _nodeId;
  3681. let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not
  3682. // specified. We do this lazily to minimize issues related to insufficient
  3683. // system entropy. See #189
  3684. if (node == null || clockseq == null) {
  3685. const seedBytes = options.random || (options.rng || _rng.default)();
  3686. if (node == null) {
  3687. // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
  3688. node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];
  3689. }
  3690. if (clockseq == null) {
  3691. // Per 4.2.2, randomize (14 bit) clockseq
  3692. clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
  3693. }
  3694. } // UUID timestamps are 100 nano-second units since the Gregorian epoch,
  3695. // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
  3696. // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
  3697. // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
  3698. let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock
  3699. // cycle to simulate higher resolution clock
  3700. let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)
  3701. const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression
  3702. if (dt < 0 && options.clockseq === undefined) {
  3703. clockseq = clockseq + 1 & 0x3fff;
  3704. } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
  3705. // time interval
  3706. if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
  3707. nsecs = 0;
  3708. } // Per 4.2.1.2 Throw error if too many uuids are requested
  3709. if (nsecs >= 10000) {
  3710. throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");
  3711. }
  3712. _lastMSecs = msecs;
  3713. _lastNSecs = nsecs;
  3714. _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
  3715. msecs += 12219292800000; // `time_low`
  3716. const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
  3717. b[i++] = tl >>> 24 & 0xff;
  3718. b[i++] = tl >>> 16 & 0xff;
  3719. b[i++] = tl >>> 8 & 0xff;
  3720. b[i++] = tl & 0xff; // `time_mid`
  3721. const tmh = msecs / 0x100000000 * 10000 & 0xfffffff;
  3722. b[i++] = tmh >>> 8 & 0xff;
  3723. b[i++] = tmh & 0xff; // `time_high_and_version`
  3724. b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
  3725. b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
  3726. b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`
  3727. b[i++] = clockseq & 0xff; // `node`
  3728. for (let n = 0; n < 6; ++n) {
  3729. b[i + n] = node[n];
  3730. }
  3731. return buf || (0, _stringify.default)(b);
  3732. }
  3733. var _default = v1;
  3734. exports["default"] = _default;
  3735. /***/ }),
  3736. /***/ 6993:
  3737. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3738. "use strict";
  3739. Object.defineProperty(exports, "__esModule", ({
  3740. value: true
  3741. }));
  3742. exports["default"] = void 0;
  3743. var _v = _interopRequireDefault(__nccwpck_require__(5920));
  3744. var _md = _interopRequireDefault(__nccwpck_require__(5842));
  3745. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3746. const v3 = (0, _v.default)('v3', 0x30, _md.default);
  3747. var _default = v3;
  3748. exports["default"] = _default;
  3749. /***/ }),
  3750. /***/ 5920:
  3751. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3752. "use strict";
  3753. Object.defineProperty(exports, "__esModule", ({
  3754. value: true
  3755. }));
  3756. exports["default"] = _default;
  3757. exports.URL = exports.DNS = void 0;
  3758. var _stringify = _interopRequireDefault(__nccwpck_require__(1458));
  3759. var _parse = _interopRequireDefault(__nccwpck_require__(6385));
  3760. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3761. function stringToBytes(str) {
  3762. str = unescape(encodeURIComponent(str)); // UTF8 escape
  3763. const bytes = [];
  3764. for (let i = 0; i < str.length; ++i) {
  3765. bytes.push(str.charCodeAt(i));
  3766. }
  3767. return bytes;
  3768. }
  3769. const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
  3770. exports.DNS = DNS;
  3771. const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';
  3772. exports.URL = URL;
  3773. function _default(name, version, hashfunc) {
  3774. function generateUUID(value, namespace, buf, offset) {
  3775. if (typeof value === 'string') {
  3776. value = stringToBytes(value);
  3777. }
  3778. if (typeof namespace === 'string') {
  3779. namespace = (0, _parse.default)(namespace);
  3780. }
  3781. if (namespace.length !== 16) {
  3782. throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');
  3783. } // Compute hash of namespace and value, Per 4.3
  3784. // Future: Use spread syntax when supported on all platforms, e.g. `bytes =
  3785. // hashfunc([...namespace, ... value])`
  3786. let bytes = new Uint8Array(16 + value.length);
  3787. bytes.set(namespace);
  3788. bytes.set(value, namespace.length);
  3789. bytes = hashfunc(bytes);
  3790. bytes[6] = bytes[6] & 0x0f | version;
  3791. bytes[8] = bytes[8] & 0x3f | 0x80;
  3792. if (buf) {
  3793. offset = offset || 0;
  3794. for (let i = 0; i < 16; ++i) {
  3795. buf[offset + i] = bytes[i];
  3796. }
  3797. return buf;
  3798. }
  3799. return (0, _stringify.default)(bytes);
  3800. } // Function#name is not settable on some platforms (#270)
  3801. try {
  3802. generateUUID.name = name; // eslint-disable-next-line no-empty
  3803. } catch (err) {} // For CommonJS default export support
  3804. generateUUID.DNS = DNS;
  3805. generateUUID.URL = URL;
  3806. return generateUUID;
  3807. }
  3808. /***/ }),
  3809. /***/ 1472:
  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 _rng = _interopRequireDefault(__nccwpck_require__(9784));
  3817. var _stringify = _interopRequireDefault(__nccwpck_require__(1458));
  3818. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3819. function v4(options, buf, offset) {
  3820. options = options || {};
  3821. const rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  3822. rnds[6] = rnds[6] & 0x0f | 0x40;
  3823. rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
  3824. if (buf) {
  3825. offset = offset || 0;
  3826. for (let i = 0; i < 16; ++i) {
  3827. buf[offset + i] = rnds[i];
  3828. }
  3829. return buf;
  3830. }
  3831. return (0, _stringify.default)(rnds);
  3832. }
  3833. var _default = v4;
  3834. exports["default"] = _default;
  3835. /***/ }),
  3836. /***/ 6217:
  3837. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3838. "use strict";
  3839. Object.defineProperty(exports, "__esModule", ({
  3840. value: true
  3841. }));
  3842. exports["default"] = void 0;
  3843. var _v = _interopRequireDefault(__nccwpck_require__(5920));
  3844. var _sha = _interopRequireDefault(__nccwpck_require__(8844));
  3845. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3846. const v5 = (0, _v.default)('v5', 0x50, _sha.default);
  3847. var _default = v5;
  3848. exports["default"] = _default;
  3849. /***/ }),
  3850. /***/ 2609:
  3851. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3852. "use strict";
  3853. Object.defineProperty(exports, "__esModule", ({
  3854. value: true
  3855. }));
  3856. exports["default"] = void 0;
  3857. var _regex = _interopRequireDefault(__nccwpck_require__(6230));
  3858. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3859. function validate(uuid) {
  3860. return typeof uuid === 'string' && _regex.default.test(uuid);
  3861. }
  3862. var _default = validate;
  3863. exports["default"] = _default;
  3864. /***/ }),
  3865. /***/ 427:
  3866. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3867. "use strict";
  3868. Object.defineProperty(exports, "__esModule", ({
  3869. value: true
  3870. }));
  3871. exports["default"] = void 0;
  3872. var _validate = _interopRequireDefault(__nccwpck_require__(2609));
  3873. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3874. function version(uuid) {
  3875. if (!(0, _validate.default)(uuid)) {
  3876. throw TypeError('Invalid UUID');
  3877. }
  3878. return parseInt(uuid.substr(14, 1), 16);
  3879. }
  3880. var _default = version;
  3881. exports["default"] = _default;
  3882. /***/ }),
  3883. /***/ 1514:
  3884. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  3885. "use strict";
  3886. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  3887. if (k2 === undefined) k2 = k;
  3888. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  3889. }) : (function(o, m, k, k2) {
  3890. if (k2 === undefined) k2 = k;
  3891. o[k2] = m[k];
  3892. }));
  3893. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  3894. Object.defineProperty(o, "default", { enumerable: true, value: v });
  3895. }) : function(o, v) {
  3896. o["default"] = v;
  3897. });
  3898. var __importStar = (this && this.__importStar) || function (mod) {
  3899. if (mod && mod.__esModule) return mod;
  3900. var result = {};
  3901. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  3902. __setModuleDefault(result, mod);
  3903. return result;
  3904. };
  3905. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  3906. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  3907. return new (P || (P = Promise))(function (resolve, reject) {
  3908. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  3909. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  3910. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  3911. step((generator = generator.apply(thisArg, _arguments || [])).next());
  3912. });
  3913. };
  3914. Object.defineProperty(exports, "__esModule", ({ value: true }));
  3915. exports.getExecOutput = exports.exec = void 0;
  3916. const string_decoder_1 = __nccwpck_require__(1576);
  3917. const tr = __importStar(__nccwpck_require__(8159));
  3918. /**
  3919. * Exec a command.
  3920. * Output will be streamed to the live console.
  3921. * Returns promise with return code
  3922. *
  3923. * @param commandLine command to execute (can include additional args). Must be correctly escaped.
  3924. * @param args optional arguments for tool. Escaping is handled by the lib.
  3925. * @param options optional exec options. See ExecOptions
  3926. * @returns Promise<number> exit code
  3927. */
  3928. function exec(commandLine, args, options) {
  3929. return __awaiter(this, void 0, void 0, function* () {
  3930. const commandArgs = tr.argStringToArray(commandLine);
  3931. if (commandArgs.length === 0) {
  3932. throw new Error(`Parameter 'commandLine' cannot be null or empty.`);
  3933. }
  3934. // Path to tool to execute should be first arg
  3935. const toolPath = commandArgs[0];
  3936. args = commandArgs.slice(1).concat(args || []);
  3937. const runner = new tr.ToolRunner(toolPath, args, options);
  3938. return runner.exec();
  3939. });
  3940. }
  3941. exports.exec = exec;
  3942. /**
  3943. * Exec a command and get the output.
  3944. * Output will be streamed to the live console.
  3945. * Returns promise with the exit code and collected stdout and stderr
  3946. *
  3947. * @param commandLine command to execute (can include additional args). Must be correctly escaped.
  3948. * @param args optional arguments for tool. Escaping is handled by the lib.
  3949. * @param options optional exec options. See ExecOptions
  3950. * @returns Promise<ExecOutput> exit code, stdout, and stderr
  3951. */
  3952. function getExecOutput(commandLine, args, options) {
  3953. var _a, _b;
  3954. return __awaiter(this, void 0, void 0, function* () {
  3955. let stdout = '';
  3956. let stderr = '';
  3957. //Using string decoder covers the case where a mult-byte character is split
  3958. const stdoutDecoder = new string_decoder_1.StringDecoder('utf8');
  3959. const stderrDecoder = new string_decoder_1.StringDecoder('utf8');
  3960. const originalStdoutListener = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.stdout;
  3961. const originalStdErrListener = (_b = options === null || options === void 0 ? void 0 : options.listeners) === null || _b === void 0 ? void 0 : _b.stderr;
  3962. const stdErrListener = (data) => {
  3963. stderr += stderrDecoder.write(data);
  3964. if (originalStdErrListener) {
  3965. originalStdErrListener(data);
  3966. }
  3967. };
  3968. const stdOutListener = (data) => {
  3969. stdout += stdoutDecoder.write(data);
  3970. if (originalStdoutListener) {
  3971. originalStdoutListener(data);
  3972. }
  3973. };
  3974. const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener });
  3975. const exitCode = yield exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners }));
  3976. //flush any remaining characters
  3977. stdout += stdoutDecoder.end();
  3978. stderr += stderrDecoder.end();
  3979. return {
  3980. exitCode,
  3981. stdout,
  3982. stderr
  3983. };
  3984. });
  3985. }
  3986. exports.getExecOutput = getExecOutput;
  3987. //# sourceMappingURL=exec.js.map
  3988. /***/ }),
  3989. /***/ 8159:
  3990. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  3991. "use strict";
  3992. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  3993. if (k2 === undefined) k2 = k;
  3994. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  3995. }) : (function(o, m, k, k2) {
  3996. if (k2 === undefined) k2 = k;
  3997. o[k2] = m[k];
  3998. }));
  3999. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  4000. Object.defineProperty(o, "default", { enumerable: true, value: v });
  4001. }) : function(o, v) {
  4002. o["default"] = v;
  4003. });
  4004. var __importStar = (this && this.__importStar) || function (mod) {
  4005. if (mod && mod.__esModule) return mod;
  4006. var result = {};
  4007. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  4008. __setModuleDefault(result, mod);
  4009. return result;
  4010. };
  4011. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4012. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4013. return new (P || (P = Promise))(function (resolve, reject) {
  4014. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4015. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4016. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4017. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4018. });
  4019. };
  4020. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4021. exports.argStringToArray = exports.ToolRunner = void 0;
  4022. const os = __importStar(__nccwpck_require__(2037));
  4023. const events = __importStar(__nccwpck_require__(2361));
  4024. const child = __importStar(__nccwpck_require__(2081));
  4025. const path = __importStar(__nccwpck_require__(1017));
  4026. const io = __importStar(__nccwpck_require__(7436));
  4027. const ioUtil = __importStar(__nccwpck_require__(1962));
  4028. const timers_1 = __nccwpck_require__(9512);
  4029. /* eslint-disable @typescript-eslint/unbound-method */
  4030. const IS_WINDOWS = process.platform === 'win32';
  4031. /*
  4032. * Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way.
  4033. */
  4034. class ToolRunner extends events.EventEmitter {
  4035. constructor(toolPath, args, options) {
  4036. super();
  4037. if (!toolPath) {
  4038. throw new Error("Parameter 'toolPath' cannot be null or empty.");
  4039. }
  4040. this.toolPath = toolPath;
  4041. this.args = args || [];
  4042. this.options = options || {};
  4043. }
  4044. _debug(message) {
  4045. if (this.options.listeners && this.options.listeners.debug) {
  4046. this.options.listeners.debug(message);
  4047. }
  4048. }
  4049. _getCommandString(options, noPrefix) {
  4050. const toolPath = this._getSpawnFileName();
  4051. const args = this._getSpawnArgs(options);
  4052. let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool
  4053. if (IS_WINDOWS) {
  4054. // Windows + cmd file
  4055. if (this._isCmdFile()) {
  4056. cmd += toolPath;
  4057. for (const a of args) {
  4058. cmd += ` ${a}`;
  4059. }
  4060. }
  4061. // Windows + verbatim
  4062. else if (options.windowsVerbatimArguments) {
  4063. cmd += `"${toolPath}"`;
  4064. for (const a of args) {
  4065. cmd += ` ${a}`;
  4066. }
  4067. }
  4068. // Windows (regular)
  4069. else {
  4070. cmd += this._windowsQuoteCmdArg(toolPath);
  4071. for (const a of args) {
  4072. cmd += ` ${this._windowsQuoteCmdArg(a)}`;
  4073. }
  4074. }
  4075. }
  4076. else {
  4077. // OSX/Linux - this can likely be improved with some form of quoting.
  4078. // creating processes on Unix is fundamentally different than Windows.
  4079. // on Unix, execvp() takes an arg array.
  4080. cmd += toolPath;
  4081. for (const a of args) {
  4082. cmd += ` ${a}`;
  4083. }
  4084. }
  4085. return cmd;
  4086. }
  4087. _processLineBuffer(data, strBuffer, onLine) {
  4088. try {
  4089. let s = strBuffer + data.toString();
  4090. let n = s.indexOf(os.EOL);
  4091. while (n > -1) {
  4092. const line = s.substring(0, n);
  4093. onLine(line);
  4094. // the rest of the string ...
  4095. s = s.substring(n + os.EOL.length);
  4096. n = s.indexOf(os.EOL);
  4097. }
  4098. return s;
  4099. }
  4100. catch (err) {
  4101. // streaming lines to console is best effort. Don't fail a build.
  4102. this._debug(`error processing line. Failed with error ${err}`);
  4103. return '';
  4104. }
  4105. }
  4106. _getSpawnFileName() {
  4107. if (IS_WINDOWS) {
  4108. if (this._isCmdFile()) {
  4109. return process.env['COMSPEC'] || 'cmd.exe';
  4110. }
  4111. }
  4112. return this.toolPath;
  4113. }
  4114. _getSpawnArgs(options) {
  4115. if (IS_WINDOWS) {
  4116. if (this._isCmdFile()) {
  4117. let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`;
  4118. for (const a of this.args) {
  4119. argline += ' ';
  4120. argline += options.windowsVerbatimArguments
  4121. ? a
  4122. : this._windowsQuoteCmdArg(a);
  4123. }
  4124. argline += '"';
  4125. return [argline];
  4126. }
  4127. }
  4128. return this.args;
  4129. }
  4130. _endsWith(str, end) {
  4131. return str.endsWith(end);
  4132. }
  4133. _isCmdFile() {
  4134. const upperToolPath = this.toolPath.toUpperCase();
  4135. return (this._endsWith(upperToolPath, '.CMD') ||
  4136. this._endsWith(upperToolPath, '.BAT'));
  4137. }
  4138. _windowsQuoteCmdArg(arg) {
  4139. // for .exe, apply the normal quoting rules that libuv applies
  4140. if (!this._isCmdFile()) {
  4141. return this._uvQuoteCmdArg(arg);
  4142. }
  4143. // otherwise apply quoting rules specific to the cmd.exe command line parser.
  4144. // the libuv rules are generic and are not designed specifically for cmd.exe
  4145. // command line parser.
  4146. //
  4147. // for a detailed description of the cmd.exe command line parser, refer to
  4148. // http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912
  4149. // need quotes for empty arg
  4150. if (!arg) {
  4151. return '""';
  4152. }
  4153. // determine whether the arg needs to be quoted
  4154. const cmdSpecialChars = [
  4155. ' ',
  4156. '\t',
  4157. '&',
  4158. '(',
  4159. ')',
  4160. '[',
  4161. ']',
  4162. '{',
  4163. '}',
  4164. '^',
  4165. '=',
  4166. ';',
  4167. '!',
  4168. "'",
  4169. '+',
  4170. ',',
  4171. '`',
  4172. '~',
  4173. '|',
  4174. '<',
  4175. '>',
  4176. '"'
  4177. ];
  4178. let needsQuotes = false;
  4179. for (const char of arg) {
  4180. if (cmdSpecialChars.some(x => x === char)) {
  4181. needsQuotes = true;
  4182. break;
  4183. }
  4184. }
  4185. // short-circuit if quotes not needed
  4186. if (!needsQuotes) {
  4187. return arg;
  4188. }
  4189. // the following quoting rules are very similar to the rules that by libuv applies.
  4190. //
  4191. // 1) wrap the string in quotes
  4192. //
  4193. // 2) double-up quotes - i.e. " => ""
  4194. //
  4195. // this is different from the libuv quoting rules. libuv replaces " with \", which unfortunately
  4196. // doesn't work well with a cmd.exe command line.
  4197. //
  4198. // note, replacing " with "" also works well if the arg is passed to a downstream .NET console app.
  4199. // for example, the command line:
  4200. // foo.exe "myarg:""my val"""
  4201. // is parsed by a .NET console app into an arg array:
  4202. // [ "myarg:\"my val\"" ]
  4203. // which is the same end result when applying libuv quoting rules. although the actual
  4204. // command line from libuv quoting rules would look like:
  4205. // foo.exe "myarg:\"my val\""
  4206. //
  4207. // 3) double-up slashes that precede a quote,
  4208. // e.g. hello \world => "hello \world"
  4209. // hello\"world => "hello\\""world"
  4210. // hello\\"world => "hello\\\\""world"
  4211. // hello world\ => "hello world\\"
  4212. //
  4213. // technically this is not required for a cmd.exe command line, or the batch argument parser.
  4214. // the reasons for including this as a .cmd quoting rule are:
  4215. //
  4216. // a) this is optimized for the scenario where the argument is passed from the .cmd file to an
  4217. // external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule.
  4218. //
  4219. // b) it's what we've been doing previously (by deferring to node default behavior) and we
  4220. // haven't heard any complaints about that aspect.
  4221. //
  4222. // note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be
  4223. // escaped when used on the command line directly - even though within a .cmd file % can be escaped
  4224. // by using %%.
  4225. //
  4226. // the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts
  4227. // the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing.
  4228. //
  4229. // one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would
  4230. // often work, since it is unlikely that var^ would exist, and the ^ character is removed when the
  4231. // variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args
  4232. // to an external program.
  4233. //
  4234. // an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file.
  4235. // % can be escaped within a .cmd file.
  4236. let reverse = '"';
  4237. let quoteHit = true;
  4238. for (let i = arg.length; i > 0; i--) {
  4239. // walk the string in reverse
  4240. reverse += arg[i - 1];
  4241. if (quoteHit && arg[i - 1] === '\\') {
  4242. reverse += '\\'; // double the slash
  4243. }
  4244. else if (arg[i - 1] === '"') {
  4245. quoteHit = true;
  4246. reverse += '"'; // double the quote
  4247. }
  4248. else {
  4249. quoteHit = false;
  4250. }
  4251. }
  4252. reverse += '"';
  4253. return reverse
  4254. .split('')
  4255. .reverse()
  4256. .join('');
  4257. }
  4258. _uvQuoteCmdArg(arg) {
  4259. // Tool runner wraps child_process.spawn() and needs to apply the same quoting as
  4260. // Node in certain cases where the undocumented spawn option windowsVerbatimArguments
  4261. // is used.
  4262. //
  4263. // Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV,
  4264. // see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details),
  4265. // pasting copyright notice from Node within this function:
  4266. //
  4267. // Copyright Joyent, Inc. and other Node contributors. All rights reserved.
  4268. //
  4269. // Permission is hereby granted, free of charge, to any person obtaining a copy
  4270. // of this software and associated documentation files (the "Software"), to
  4271. // deal in the Software without restriction, including without limitation the
  4272. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  4273. // sell copies of the Software, and to permit persons to whom the Software is
  4274. // furnished to do so, subject to the following conditions:
  4275. //
  4276. // The above copyright notice and this permission notice shall be included in
  4277. // all copies or substantial portions of the Software.
  4278. //
  4279. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  4280. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  4281. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  4282. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  4283. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  4284. // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  4285. // IN THE SOFTWARE.
  4286. if (!arg) {
  4287. // Need double quotation for empty argument
  4288. return '""';
  4289. }
  4290. if (!arg.includes(' ') && !arg.includes('\t') && !arg.includes('"')) {
  4291. // No quotation needed
  4292. return arg;
  4293. }
  4294. if (!arg.includes('"') && !arg.includes('\\')) {
  4295. // No embedded double quotes or backslashes, so I can just wrap
  4296. // quote marks around the whole thing.
  4297. return `"${arg}"`;
  4298. }
  4299. // Expected input/output:
  4300. // input : hello"world
  4301. // output: "hello\"world"
  4302. // input : hello""world
  4303. // output: "hello\"\"world"
  4304. // input : hello\world
  4305. // output: hello\world
  4306. // input : hello\\world
  4307. // output: hello\\world
  4308. // input : hello\"world
  4309. // output: "hello\\\"world"
  4310. // input : hello\\"world
  4311. // output: "hello\\\\\"world"
  4312. // input : hello world\
  4313. // output: "hello world\\" - note the comment in libuv actually reads "hello world\"
  4314. // but it appears the comment is wrong, it should be "hello world\\"
  4315. let reverse = '"';
  4316. let quoteHit = true;
  4317. for (let i = arg.length; i > 0; i--) {
  4318. // walk the string in reverse
  4319. reverse += arg[i - 1];
  4320. if (quoteHit && arg[i - 1] === '\\') {
  4321. reverse += '\\';
  4322. }
  4323. else if (arg[i - 1] === '"') {
  4324. quoteHit = true;
  4325. reverse += '\\';
  4326. }
  4327. else {
  4328. quoteHit = false;
  4329. }
  4330. }
  4331. reverse += '"';
  4332. return reverse
  4333. .split('')
  4334. .reverse()
  4335. .join('');
  4336. }
  4337. _cloneExecOptions(options) {
  4338. options = options || {};
  4339. const result = {
  4340. cwd: options.cwd || process.cwd(),
  4341. env: options.env || process.env,
  4342. silent: options.silent || false,
  4343. windowsVerbatimArguments: options.windowsVerbatimArguments || false,
  4344. failOnStdErr: options.failOnStdErr || false,
  4345. ignoreReturnCode: options.ignoreReturnCode || false,
  4346. delay: options.delay || 10000
  4347. };
  4348. result.outStream = options.outStream || process.stdout;
  4349. result.errStream = options.errStream || process.stderr;
  4350. return result;
  4351. }
  4352. _getSpawnOptions(options, toolPath) {
  4353. options = options || {};
  4354. const result = {};
  4355. result.cwd = options.cwd;
  4356. result.env = options.env;
  4357. result['windowsVerbatimArguments'] =
  4358. options.windowsVerbatimArguments || this._isCmdFile();
  4359. if (options.windowsVerbatimArguments) {
  4360. result.argv0 = `"${toolPath}"`;
  4361. }
  4362. return result;
  4363. }
  4364. /**
  4365. * Exec a tool.
  4366. * Output will be streamed to the live console.
  4367. * Returns promise with return code
  4368. *
  4369. * @param tool path to tool to exec
  4370. * @param options optional exec options. See ExecOptions
  4371. * @returns number
  4372. */
  4373. exec() {
  4374. return __awaiter(this, void 0, void 0, function* () {
  4375. // root the tool path if it is unrooted and contains relative pathing
  4376. if (!ioUtil.isRooted(this.toolPath) &&
  4377. (this.toolPath.includes('/') ||
  4378. (IS_WINDOWS && this.toolPath.includes('\\')))) {
  4379. // prefer options.cwd if it is specified, however options.cwd may also need to be rooted
  4380. this.toolPath = path.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath);
  4381. }
  4382. // if the tool is only a file name, then resolve it from the PATH
  4383. // otherwise verify it exists (add extension on Windows if necessary)
  4384. this.toolPath = yield io.which(this.toolPath, true);
  4385. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  4386. this._debug(`exec tool: ${this.toolPath}`);
  4387. this._debug('arguments:');
  4388. for (const arg of this.args) {
  4389. this._debug(` ${arg}`);
  4390. }
  4391. const optionsNonNull = this._cloneExecOptions(this.options);
  4392. if (!optionsNonNull.silent && optionsNonNull.outStream) {
  4393. optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL);
  4394. }
  4395. const state = new ExecState(optionsNonNull, this.toolPath);
  4396. state.on('debug', (message) => {
  4397. this._debug(message);
  4398. });
  4399. if (this.options.cwd && !(yield ioUtil.exists(this.options.cwd))) {
  4400. return reject(new Error(`The cwd: ${this.options.cwd} does not exist!`));
  4401. }
  4402. const fileName = this._getSpawnFileName();
  4403. const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName));
  4404. let stdbuffer = '';
  4405. if (cp.stdout) {
  4406. cp.stdout.on('data', (data) => {
  4407. if (this.options.listeners && this.options.listeners.stdout) {
  4408. this.options.listeners.stdout(data);
  4409. }
  4410. if (!optionsNonNull.silent && optionsNonNull.outStream) {
  4411. optionsNonNull.outStream.write(data);
  4412. }
  4413. stdbuffer = this._processLineBuffer(data, stdbuffer, (line) => {
  4414. if (this.options.listeners && this.options.listeners.stdline) {
  4415. this.options.listeners.stdline(line);
  4416. }
  4417. });
  4418. });
  4419. }
  4420. let errbuffer = '';
  4421. if (cp.stderr) {
  4422. cp.stderr.on('data', (data) => {
  4423. state.processStderr = true;
  4424. if (this.options.listeners && this.options.listeners.stderr) {
  4425. this.options.listeners.stderr(data);
  4426. }
  4427. if (!optionsNonNull.silent &&
  4428. optionsNonNull.errStream &&
  4429. optionsNonNull.outStream) {
  4430. const s = optionsNonNull.failOnStdErr
  4431. ? optionsNonNull.errStream
  4432. : optionsNonNull.outStream;
  4433. s.write(data);
  4434. }
  4435. errbuffer = this._processLineBuffer(data, errbuffer, (line) => {
  4436. if (this.options.listeners && this.options.listeners.errline) {
  4437. this.options.listeners.errline(line);
  4438. }
  4439. });
  4440. });
  4441. }
  4442. cp.on('error', (err) => {
  4443. state.processError = err.message;
  4444. state.processExited = true;
  4445. state.processClosed = true;
  4446. state.CheckComplete();
  4447. });
  4448. cp.on('exit', (code) => {
  4449. state.processExitCode = code;
  4450. state.processExited = true;
  4451. this._debug(`Exit code ${code} received from tool '${this.toolPath}'`);
  4452. state.CheckComplete();
  4453. });
  4454. cp.on('close', (code) => {
  4455. state.processExitCode = code;
  4456. state.processExited = true;
  4457. state.processClosed = true;
  4458. this._debug(`STDIO streams have closed for tool '${this.toolPath}'`);
  4459. state.CheckComplete();
  4460. });
  4461. state.on('done', (error, exitCode) => {
  4462. if (stdbuffer.length > 0) {
  4463. this.emit('stdline', stdbuffer);
  4464. }
  4465. if (errbuffer.length > 0) {
  4466. this.emit('errline', errbuffer);
  4467. }
  4468. cp.removeAllListeners();
  4469. if (error) {
  4470. reject(error);
  4471. }
  4472. else {
  4473. resolve(exitCode);
  4474. }
  4475. });
  4476. if (this.options.input) {
  4477. if (!cp.stdin) {
  4478. throw new Error('child process missing stdin');
  4479. }
  4480. cp.stdin.end(this.options.input);
  4481. }
  4482. }));
  4483. });
  4484. }
  4485. }
  4486. exports.ToolRunner = ToolRunner;
  4487. /**
  4488. * Convert an arg string to an array of args. Handles escaping
  4489. *
  4490. * @param argString string of arguments
  4491. * @returns string[] array of arguments
  4492. */
  4493. function argStringToArray(argString) {
  4494. const args = [];
  4495. let inQuotes = false;
  4496. let escaped = false;
  4497. let arg = '';
  4498. function append(c) {
  4499. // we only escape double quotes.
  4500. if (escaped && c !== '"') {
  4501. arg += '\\';
  4502. }
  4503. arg += c;
  4504. escaped = false;
  4505. }
  4506. for (let i = 0; i < argString.length; i++) {
  4507. const c = argString.charAt(i);
  4508. if (c === '"') {
  4509. if (!escaped) {
  4510. inQuotes = !inQuotes;
  4511. }
  4512. else {
  4513. append(c);
  4514. }
  4515. continue;
  4516. }
  4517. if (c === '\\' && escaped) {
  4518. append(c);
  4519. continue;
  4520. }
  4521. if (c === '\\' && inQuotes) {
  4522. escaped = true;
  4523. continue;
  4524. }
  4525. if (c === ' ' && !inQuotes) {
  4526. if (arg.length > 0) {
  4527. args.push(arg);
  4528. arg = '';
  4529. }
  4530. continue;
  4531. }
  4532. append(c);
  4533. }
  4534. if (arg.length > 0) {
  4535. args.push(arg.trim());
  4536. }
  4537. return args;
  4538. }
  4539. exports.argStringToArray = argStringToArray;
  4540. class ExecState extends events.EventEmitter {
  4541. constructor(options, toolPath) {
  4542. super();
  4543. this.processClosed = false; // tracks whether the process has exited and stdio is closed
  4544. this.processError = '';
  4545. this.processExitCode = 0;
  4546. this.processExited = false; // tracks whether the process has exited
  4547. this.processStderr = false; // tracks whether stderr was written to
  4548. this.delay = 10000; // 10 seconds
  4549. this.done = false;
  4550. this.timeout = null;
  4551. if (!toolPath) {
  4552. throw new Error('toolPath must not be empty');
  4553. }
  4554. this.options = options;
  4555. this.toolPath = toolPath;
  4556. if (options.delay) {
  4557. this.delay = options.delay;
  4558. }
  4559. }
  4560. CheckComplete() {
  4561. if (this.done) {
  4562. return;
  4563. }
  4564. if (this.processClosed) {
  4565. this._setResult();
  4566. }
  4567. else if (this.processExited) {
  4568. this.timeout = timers_1.setTimeout(ExecState.HandleTimeout, this.delay, this);
  4569. }
  4570. }
  4571. _debug(message) {
  4572. this.emit('debug', message);
  4573. }
  4574. _setResult() {
  4575. // determine whether there is an error
  4576. let error;
  4577. if (this.processExited) {
  4578. if (this.processError) {
  4579. 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}`);
  4580. }
  4581. else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) {
  4582. error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`);
  4583. }
  4584. else if (this.processStderr && this.options.failOnStdErr) {
  4585. error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`);
  4586. }
  4587. }
  4588. // clear the timeout
  4589. if (this.timeout) {
  4590. clearTimeout(this.timeout);
  4591. this.timeout = null;
  4592. }
  4593. this.done = true;
  4594. this.emit('done', error, this.processExitCode);
  4595. }
  4596. static HandleTimeout(state) {
  4597. if (state.done) {
  4598. return;
  4599. }
  4600. if (!state.processClosed && state.processExited) {
  4601. const message = `The STDIO streams did not close within ${state.delay /
  4602. 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.`;
  4603. state._debug(message);
  4604. }
  4605. state._setResult();
  4606. }
  4607. }
  4608. //# sourceMappingURL=toolrunner.js.map
  4609. /***/ }),
  4610. /***/ 4087:
  4611. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  4612. "use strict";
  4613. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4614. exports.Context = void 0;
  4615. const fs_1 = __nccwpck_require__(7147);
  4616. const os_1 = __nccwpck_require__(2037);
  4617. class Context {
  4618. /**
  4619. * Hydrate the context from the environment
  4620. */
  4621. constructor() {
  4622. var _a, _b, _c;
  4623. this.payload = {};
  4624. if (process.env.GITHUB_EVENT_PATH) {
  4625. if ((0, fs_1.existsSync)(process.env.GITHUB_EVENT_PATH)) {
  4626. this.payload = JSON.parse((0, fs_1.readFileSync)(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' }));
  4627. }
  4628. else {
  4629. const path = process.env.GITHUB_EVENT_PATH;
  4630. process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${os_1.EOL}`);
  4631. }
  4632. }
  4633. this.eventName = process.env.GITHUB_EVENT_NAME;
  4634. this.sha = process.env.GITHUB_SHA;
  4635. this.ref = process.env.GITHUB_REF;
  4636. this.workflow = process.env.GITHUB_WORKFLOW;
  4637. this.action = process.env.GITHUB_ACTION;
  4638. this.actor = process.env.GITHUB_ACTOR;
  4639. this.job = process.env.GITHUB_JOB;
  4640. this.runNumber = parseInt(process.env.GITHUB_RUN_NUMBER, 10);
  4641. this.runId = parseInt(process.env.GITHUB_RUN_ID, 10);
  4642. this.apiUrl = (_a = process.env.GITHUB_API_URL) !== null && _a !== void 0 ? _a : `https://api.github.com`;
  4643. this.serverUrl = (_b = process.env.GITHUB_SERVER_URL) !== null && _b !== void 0 ? _b : `https://github.com`;
  4644. this.graphqlUrl =
  4645. (_c = process.env.GITHUB_GRAPHQL_URL) !== null && _c !== void 0 ? _c : `https://api.github.com/graphql`;
  4646. }
  4647. get issue() {
  4648. const payload = this.payload;
  4649. return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pull_request || payload).number });
  4650. }
  4651. get repo() {
  4652. if (process.env.GITHUB_REPOSITORY) {
  4653. const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');
  4654. return { owner, repo };
  4655. }
  4656. if (this.payload.repository) {
  4657. return {
  4658. owner: this.payload.repository.owner.login,
  4659. repo: this.payload.repository.name
  4660. };
  4661. }
  4662. throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'");
  4663. }
  4664. }
  4665. exports.Context = Context;
  4666. //# sourceMappingURL=context.js.map
  4667. /***/ }),
  4668. /***/ 5438:
  4669. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  4670. "use strict";
  4671. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  4672. if (k2 === undefined) k2 = k;
  4673. var desc = Object.getOwnPropertyDescriptor(m, k);
  4674. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  4675. desc = { enumerable: true, get: function() { return m[k]; } };
  4676. }
  4677. Object.defineProperty(o, k2, desc);
  4678. }) : (function(o, m, k, k2) {
  4679. if (k2 === undefined) k2 = k;
  4680. o[k2] = m[k];
  4681. }));
  4682. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  4683. Object.defineProperty(o, "default", { enumerable: true, value: v });
  4684. }) : function(o, v) {
  4685. o["default"] = v;
  4686. });
  4687. var __importStar = (this && this.__importStar) || function (mod) {
  4688. if (mod && mod.__esModule) return mod;
  4689. var result = {};
  4690. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  4691. __setModuleDefault(result, mod);
  4692. return result;
  4693. };
  4694. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4695. exports.getOctokit = exports.context = void 0;
  4696. const Context = __importStar(__nccwpck_require__(4087));
  4697. const utils_1 = __nccwpck_require__(3030);
  4698. exports.context = new Context.Context();
  4699. /**
  4700. * Returns a hydrated octokit ready to use for GitHub Actions
  4701. *
  4702. * @param token the repo PAT or GITHUB_TOKEN
  4703. * @param options other options to set
  4704. */
  4705. function getOctokit(token, options, ...additionalPlugins) {
  4706. const GitHubWithPlugins = utils_1.GitHub.plugin(...additionalPlugins);
  4707. return new GitHubWithPlugins((0, utils_1.getOctokitOptions)(token, options));
  4708. }
  4709. exports.getOctokit = getOctokit;
  4710. //# sourceMappingURL=github.js.map
  4711. /***/ }),
  4712. /***/ 7914:
  4713. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  4714. "use strict";
  4715. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  4716. if (k2 === undefined) k2 = k;
  4717. var desc = Object.getOwnPropertyDescriptor(m, k);
  4718. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  4719. desc = { enumerable: true, get: function() { return m[k]; } };
  4720. }
  4721. Object.defineProperty(o, k2, desc);
  4722. }) : (function(o, m, k, k2) {
  4723. if (k2 === undefined) k2 = k;
  4724. o[k2] = m[k];
  4725. }));
  4726. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  4727. Object.defineProperty(o, "default", { enumerable: true, value: v });
  4728. }) : function(o, v) {
  4729. o["default"] = v;
  4730. });
  4731. var __importStar = (this && this.__importStar) || function (mod) {
  4732. if (mod && mod.__esModule) return mod;
  4733. var result = {};
  4734. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  4735. __setModuleDefault(result, mod);
  4736. return result;
  4737. };
  4738. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4739. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4740. return new (P || (P = Promise))(function (resolve, reject) {
  4741. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4742. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4743. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4744. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4745. });
  4746. };
  4747. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4748. exports.getApiBaseUrl = exports.getProxyFetch = exports.getProxyAgentDispatcher = exports.getProxyAgent = exports.getAuthString = void 0;
  4749. const httpClient = __importStar(__nccwpck_require__(6255));
  4750. const undici_1 = __nccwpck_require__(1773);
  4751. function getAuthString(token, options) {
  4752. if (!token && !options.auth) {
  4753. throw new Error('Parameter token or opts.auth is required');
  4754. }
  4755. else if (token && options.auth) {
  4756. throw new Error('Parameters token and opts.auth may not both be specified');
  4757. }
  4758. return typeof options.auth === 'string' ? options.auth : `token ${token}`;
  4759. }
  4760. exports.getAuthString = getAuthString;
  4761. function getProxyAgent(destinationUrl) {
  4762. const hc = new httpClient.HttpClient();
  4763. return hc.getAgent(destinationUrl);
  4764. }
  4765. exports.getProxyAgent = getProxyAgent;
  4766. function getProxyAgentDispatcher(destinationUrl) {
  4767. const hc = new httpClient.HttpClient();
  4768. return hc.getAgentDispatcher(destinationUrl);
  4769. }
  4770. exports.getProxyAgentDispatcher = getProxyAgentDispatcher;
  4771. function getProxyFetch(destinationUrl) {
  4772. const httpDispatcher = getProxyAgentDispatcher(destinationUrl);
  4773. const proxyFetch = (url, opts) => __awaiter(this, void 0, void 0, function* () {
  4774. return (0, undici_1.fetch)(url, Object.assign(Object.assign({}, opts), { dispatcher: httpDispatcher }));
  4775. });
  4776. return proxyFetch;
  4777. }
  4778. exports.getProxyFetch = getProxyFetch;
  4779. function getApiBaseUrl() {
  4780. return process.env['GITHUB_API_URL'] || 'https://api.github.com';
  4781. }
  4782. exports.getApiBaseUrl = getApiBaseUrl;
  4783. //# sourceMappingURL=utils.js.map
  4784. /***/ }),
  4785. /***/ 3030:
  4786. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  4787. "use strict";
  4788. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  4789. if (k2 === undefined) k2 = k;
  4790. var desc = Object.getOwnPropertyDescriptor(m, k);
  4791. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  4792. desc = { enumerable: true, get: function() { return m[k]; } };
  4793. }
  4794. Object.defineProperty(o, k2, desc);
  4795. }) : (function(o, m, k, k2) {
  4796. if (k2 === undefined) k2 = k;
  4797. o[k2] = m[k];
  4798. }));
  4799. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  4800. Object.defineProperty(o, "default", { enumerable: true, value: v });
  4801. }) : function(o, v) {
  4802. o["default"] = v;
  4803. });
  4804. var __importStar = (this && this.__importStar) || function (mod) {
  4805. if (mod && mod.__esModule) return mod;
  4806. var result = {};
  4807. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  4808. __setModuleDefault(result, mod);
  4809. return result;
  4810. };
  4811. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4812. exports.getOctokitOptions = exports.GitHub = exports.defaults = exports.context = void 0;
  4813. const Context = __importStar(__nccwpck_require__(4087));
  4814. const Utils = __importStar(__nccwpck_require__(7914));
  4815. // octokit + plugins
  4816. const core_1 = __nccwpck_require__(6762);
  4817. const plugin_rest_endpoint_methods_1 = __nccwpck_require__(3044);
  4818. const plugin_paginate_rest_1 = __nccwpck_require__(4193);
  4819. exports.context = new Context.Context();
  4820. const baseUrl = Utils.getApiBaseUrl();
  4821. exports.defaults = {
  4822. baseUrl,
  4823. request: {
  4824. agent: Utils.getProxyAgent(baseUrl),
  4825. fetch: Utils.getProxyFetch(baseUrl)
  4826. }
  4827. };
  4828. exports.GitHub = core_1.Octokit.plugin(plugin_rest_endpoint_methods_1.restEndpointMethods, plugin_paginate_rest_1.paginateRest).defaults(exports.defaults);
  4829. /**
  4830. * Convience function to correctly format Octokit Options to pass into the constructor.
  4831. *
  4832. * @param token the repo PAT or GITHUB_TOKEN
  4833. * @param options other options to set
  4834. */
  4835. function getOctokitOptions(token, options) {
  4836. const opts = Object.assign({}, options || {}); // Shallow clone - don't mutate the object provided by the caller
  4837. // Auth
  4838. const auth = Utils.getAuthString(token, opts);
  4839. if (auth) {
  4840. opts.auth = auth;
  4841. }
  4842. return opts;
  4843. }
  4844. exports.getOctokitOptions = getOctokitOptions;
  4845. //# sourceMappingURL=utils.js.map
  4846. /***/ }),
  4847. /***/ 5526:
  4848. /***/ (function(__unused_webpack_module, exports) {
  4849. "use strict";
  4850. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4851. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4852. return new (P || (P = Promise))(function (resolve, reject) {
  4853. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4854. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4855. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4856. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4857. });
  4858. };
  4859. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4860. exports.PersonalAccessTokenCredentialHandler = exports.BearerCredentialHandler = exports.BasicCredentialHandler = void 0;
  4861. class BasicCredentialHandler {
  4862. constructor(username, password) {
  4863. this.username = username;
  4864. this.password = password;
  4865. }
  4866. prepareRequest(options) {
  4867. if (!options.headers) {
  4868. throw Error('The request has no headers');
  4869. }
  4870. options.headers['Authorization'] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString('base64')}`;
  4871. }
  4872. // This handler cannot handle 401
  4873. canHandleAuthentication() {
  4874. return false;
  4875. }
  4876. handleAuthentication() {
  4877. return __awaiter(this, void 0, void 0, function* () {
  4878. throw new Error('not implemented');
  4879. });
  4880. }
  4881. }
  4882. exports.BasicCredentialHandler = BasicCredentialHandler;
  4883. class BearerCredentialHandler {
  4884. constructor(token) {
  4885. this.token = token;
  4886. }
  4887. // currently implements pre-authorization
  4888. // TODO: support preAuth = false where it hooks on 401
  4889. prepareRequest(options) {
  4890. if (!options.headers) {
  4891. throw Error('The request has no headers');
  4892. }
  4893. options.headers['Authorization'] = `Bearer ${this.token}`;
  4894. }
  4895. // This handler cannot handle 401
  4896. canHandleAuthentication() {
  4897. return false;
  4898. }
  4899. handleAuthentication() {
  4900. return __awaiter(this, void 0, void 0, function* () {
  4901. throw new Error('not implemented');
  4902. });
  4903. }
  4904. }
  4905. exports.BearerCredentialHandler = BearerCredentialHandler;
  4906. class PersonalAccessTokenCredentialHandler {
  4907. constructor(token) {
  4908. this.token = token;
  4909. }
  4910. // currently implements pre-authorization
  4911. // TODO: support preAuth = false where it hooks on 401
  4912. prepareRequest(options) {
  4913. if (!options.headers) {
  4914. throw Error('The request has no headers');
  4915. }
  4916. options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`;
  4917. }
  4918. // This handler cannot handle 401
  4919. canHandleAuthentication() {
  4920. return false;
  4921. }
  4922. handleAuthentication() {
  4923. return __awaiter(this, void 0, void 0, function* () {
  4924. throw new Error('not implemented');
  4925. });
  4926. }
  4927. }
  4928. exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler;
  4929. //# sourceMappingURL=auth.js.map
  4930. /***/ }),
  4931. /***/ 6255:
  4932. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  4933. "use strict";
  4934. /* eslint-disable @typescript-eslint/no-explicit-any */
  4935. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  4936. if (k2 === undefined) k2 = k;
  4937. var desc = Object.getOwnPropertyDescriptor(m, k);
  4938. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  4939. desc = { enumerable: true, get: function() { return m[k]; } };
  4940. }
  4941. Object.defineProperty(o, k2, desc);
  4942. }) : (function(o, m, k, k2) {
  4943. if (k2 === undefined) k2 = k;
  4944. o[k2] = m[k];
  4945. }));
  4946. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  4947. Object.defineProperty(o, "default", { enumerable: true, value: v });
  4948. }) : function(o, v) {
  4949. o["default"] = v;
  4950. });
  4951. var __importStar = (this && this.__importStar) || function (mod) {
  4952. if (mod && mod.__esModule) return mod;
  4953. var result = {};
  4954. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  4955. __setModuleDefault(result, mod);
  4956. return result;
  4957. };
  4958. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4959. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4960. return new (P || (P = Promise))(function (resolve, reject) {
  4961. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4962. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4963. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4964. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4965. });
  4966. };
  4967. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4968. exports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpClientError = exports.getProxyUrl = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0;
  4969. const http = __importStar(__nccwpck_require__(3685));
  4970. const https = __importStar(__nccwpck_require__(5687));
  4971. const pm = __importStar(__nccwpck_require__(9835));
  4972. const tunnel = __importStar(__nccwpck_require__(4294));
  4973. const undici_1 = __nccwpck_require__(1773);
  4974. var HttpCodes;
  4975. (function (HttpCodes) {
  4976. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  4977. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  4978. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  4979. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  4980. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  4981. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  4982. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  4983. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  4984. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  4985. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  4986. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  4987. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  4988. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  4989. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  4990. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  4991. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  4992. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  4993. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  4994. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  4995. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  4996. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  4997. HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests";
  4998. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  4999. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  5000. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  5001. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  5002. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  5003. })(HttpCodes || (exports.HttpCodes = HttpCodes = {}));
  5004. var Headers;
  5005. (function (Headers) {
  5006. Headers["Accept"] = "accept";
  5007. Headers["ContentType"] = "content-type";
  5008. })(Headers || (exports.Headers = Headers = {}));
  5009. var MediaTypes;
  5010. (function (MediaTypes) {
  5011. MediaTypes["ApplicationJson"] = "application/json";
  5012. })(MediaTypes || (exports.MediaTypes = MediaTypes = {}));
  5013. /**
  5014. * Returns the proxy URL, depending upon the supplied url and proxy environment variables.
  5015. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  5016. */
  5017. function getProxyUrl(serverUrl) {
  5018. const proxyUrl = pm.getProxyUrl(new URL(serverUrl));
  5019. return proxyUrl ? proxyUrl.href : '';
  5020. }
  5021. exports.getProxyUrl = getProxyUrl;
  5022. const HttpRedirectCodes = [
  5023. HttpCodes.MovedPermanently,
  5024. HttpCodes.ResourceMoved,
  5025. HttpCodes.SeeOther,
  5026. HttpCodes.TemporaryRedirect,
  5027. HttpCodes.PermanentRedirect
  5028. ];
  5029. const HttpResponseRetryCodes = [
  5030. HttpCodes.BadGateway,
  5031. HttpCodes.ServiceUnavailable,
  5032. HttpCodes.GatewayTimeout
  5033. ];
  5034. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  5035. const ExponentialBackoffCeiling = 10;
  5036. const ExponentialBackoffTimeSlice = 5;
  5037. class HttpClientError extends Error {
  5038. constructor(message, statusCode) {
  5039. super(message);
  5040. this.name = 'HttpClientError';
  5041. this.statusCode = statusCode;
  5042. Object.setPrototypeOf(this, HttpClientError.prototype);
  5043. }
  5044. }
  5045. exports.HttpClientError = HttpClientError;
  5046. class HttpClientResponse {
  5047. constructor(message) {
  5048. this.message = message;
  5049. }
  5050. readBody() {
  5051. return __awaiter(this, void 0, void 0, function* () {
  5052. return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
  5053. let output = Buffer.alloc(0);
  5054. this.message.on('data', (chunk) => {
  5055. output = Buffer.concat([output, chunk]);
  5056. });
  5057. this.message.on('end', () => {
  5058. resolve(output.toString());
  5059. });
  5060. }));
  5061. });
  5062. }
  5063. readBodyBuffer() {
  5064. return __awaiter(this, void 0, void 0, function* () {
  5065. return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
  5066. const chunks = [];
  5067. this.message.on('data', (chunk) => {
  5068. chunks.push(chunk);
  5069. });
  5070. this.message.on('end', () => {
  5071. resolve(Buffer.concat(chunks));
  5072. });
  5073. }));
  5074. });
  5075. }
  5076. }
  5077. exports.HttpClientResponse = HttpClientResponse;
  5078. function isHttps(requestUrl) {
  5079. const parsedUrl = new URL(requestUrl);
  5080. return parsedUrl.protocol === 'https:';
  5081. }
  5082. exports.isHttps = isHttps;
  5083. class HttpClient {
  5084. constructor(userAgent, handlers, requestOptions) {
  5085. this._ignoreSslError = false;
  5086. this._allowRedirects = true;
  5087. this._allowRedirectDowngrade = false;
  5088. this._maxRedirects = 50;
  5089. this._allowRetries = false;
  5090. this._maxRetries = 1;
  5091. this._keepAlive = false;
  5092. this._disposed = false;
  5093. this.userAgent = userAgent;
  5094. this.handlers = handlers || [];
  5095. this.requestOptions = requestOptions;
  5096. if (requestOptions) {
  5097. if (requestOptions.ignoreSslError != null) {
  5098. this._ignoreSslError = requestOptions.ignoreSslError;
  5099. }
  5100. this._socketTimeout = requestOptions.socketTimeout;
  5101. if (requestOptions.allowRedirects != null) {
  5102. this._allowRedirects = requestOptions.allowRedirects;
  5103. }
  5104. if (requestOptions.allowRedirectDowngrade != null) {
  5105. this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;
  5106. }
  5107. if (requestOptions.maxRedirects != null) {
  5108. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  5109. }
  5110. if (requestOptions.keepAlive != null) {
  5111. this._keepAlive = requestOptions.keepAlive;
  5112. }
  5113. if (requestOptions.allowRetries != null) {
  5114. this._allowRetries = requestOptions.allowRetries;
  5115. }
  5116. if (requestOptions.maxRetries != null) {
  5117. this._maxRetries = requestOptions.maxRetries;
  5118. }
  5119. }
  5120. }
  5121. options(requestUrl, additionalHeaders) {
  5122. return __awaiter(this, void 0, void 0, function* () {
  5123. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  5124. });
  5125. }
  5126. get(requestUrl, additionalHeaders) {
  5127. return __awaiter(this, void 0, void 0, function* () {
  5128. return this.request('GET', requestUrl, null, additionalHeaders || {});
  5129. });
  5130. }
  5131. del(requestUrl, additionalHeaders) {
  5132. return __awaiter(this, void 0, void 0, function* () {
  5133. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  5134. });
  5135. }
  5136. post(requestUrl, data, additionalHeaders) {
  5137. return __awaiter(this, void 0, void 0, function* () {
  5138. return this.request('POST', requestUrl, data, additionalHeaders || {});
  5139. });
  5140. }
  5141. patch(requestUrl, data, additionalHeaders) {
  5142. return __awaiter(this, void 0, void 0, function* () {
  5143. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  5144. });
  5145. }
  5146. put(requestUrl, data, additionalHeaders) {
  5147. return __awaiter(this, void 0, void 0, function* () {
  5148. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  5149. });
  5150. }
  5151. head(requestUrl, additionalHeaders) {
  5152. return __awaiter(this, void 0, void 0, function* () {
  5153. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  5154. });
  5155. }
  5156. sendStream(verb, requestUrl, stream, additionalHeaders) {
  5157. return __awaiter(this, void 0, void 0, function* () {
  5158. return this.request(verb, requestUrl, stream, additionalHeaders);
  5159. });
  5160. }
  5161. /**
  5162. * Gets a typed object from an endpoint
  5163. * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise
  5164. */
  5165. getJson(requestUrl, additionalHeaders = {}) {
  5166. return __awaiter(this, void 0, void 0, function* () {
  5167. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  5168. const res = yield this.get(requestUrl, additionalHeaders);
  5169. return this._processResponse(res, this.requestOptions);
  5170. });
  5171. }
  5172. postJson(requestUrl, obj, additionalHeaders = {}) {
  5173. return __awaiter(this, void 0, void 0, function* () {
  5174. const data = JSON.stringify(obj, null, 2);
  5175. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  5176. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  5177. const res = yield this.post(requestUrl, data, additionalHeaders);
  5178. return this._processResponse(res, this.requestOptions);
  5179. });
  5180. }
  5181. putJson(requestUrl, obj, additionalHeaders = {}) {
  5182. return __awaiter(this, void 0, void 0, function* () {
  5183. const data = JSON.stringify(obj, null, 2);
  5184. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  5185. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  5186. const res = yield this.put(requestUrl, data, additionalHeaders);
  5187. return this._processResponse(res, this.requestOptions);
  5188. });
  5189. }
  5190. patchJson(requestUrl, obj, additionalHeaders = {}) {
  5191. return __awaiter(this, void 0, void 0, function* () {
  5192. const data = JSON.stringify(obj, null, 2);
  5193. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  5194. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  5195. const res = yield this.patch(requestUrl, data, additionalHeaders);
  5196. return this._processResponse(res, this.requestOptions);
  5197. });
  5198. }
  5199. /**
  5200. * Makes a raw http request.
  5201. * All other methods such as get, post, patch, and request ultimately call this.
  5202. * Prefer get, del, post and patch
  5203. */
  5204. request(verb, requestUrl, data, headers) {
  5205. return __awaiter(this, void 0, void 0, function* () {
  5206. if (this._disposed) {
  5207. throw new Error('Client has already been disposed.');
  5208. }
  5209. const parsedUrl = new URL(requestUrl);
  5210. let info = this._prepareRequest(verb, parsedUrl, headers);
  5211. // Only perform retries on reads since writes may not be idempotent.
  5212. const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb)
  5213. ? this._maxRetries + 1
  5214. : 1;
  5215. let numTries = 0;
  5216. let response;
  5217. do {
  5218. response = yield this.requestRaw(info, data);
  5219. // Check if it's an authentication challenge
  5220. if (response &&
  5221. response.message &&
  5222. response.message.statusCode === HttpCodes.Unauthorized) {
  5223. let authenticationHandler;
  5224. for (const handler of this.handlers) {
  5225. if (handler.canHandleAuthentication(response)) {
  5226. authenticationHandler = handler;
  5227. break;
  5228. }
  5229. }
  5230. if (authenticationHandler) {
  5231. return authenticationHandler.handleAuthentication(this, info, data);
  5232. }
  5233. else {
  5234. // We have received an unauthorized response but have no handlers to handle it.
  5235. // Let the response return to the caller.
  5236. return response;
  5237. }
  5238. }
  5239. let redirectsRemaining = this._maxRedirects;
  5240. while (response.message.statusCode &&
  5241. HttpRedirectCodes.includes(response.message.statusCode) &&
  5242. this._allowRedirects &&
  5243. redirectsRemaining > 0) {
  5244. const redirectUrl = response.message.headers['location'];
  5245. if (!redirectUrl) {
  5246. // if there's no location to redirect to, we won't
  5247. break;
  5248. }
  5249. const parsedRedirectUrl = new URL(redirectUrl);
  5250. if (parsedUrl.protocol === 'https:' &&
  5251. parsedUrl.protocol !== parsedRedirectUrl.protocol &&
  5252. !this._allowRedirectDowngrade) {
  5253. 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.');
  5254. }
  5255. // we need to finish reading the response before reassigning response
  5256. // which will leak the open socket.
  5257. yield response.readBody();
  5258. // strip authorization header if redirected to a different hostname
  5259. if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {
  5260. for (const header in headers) {
  5261. // header names are case insensitive
  5262. if (header.toLowerCase() === 'authorization') {
  5263. delete headers[header];
  5264. }
  5265. }
  5266. }
  5267. // let's make the request with the new redirectUrl
  5268. info = this._prepareRequest(verb, parsedRedirectUrl, headers);
  5269. response = yield this.requestRaw(info, data);
  5270. redirectsRemaining--;
  5271. }
  5272. if (!response.message.statusCode ||
  5273. !HttpResponseRetryCodes.includes(response.message.statusCode)) {
  5274. // If not a retry code, return immediately instead of retrying
  5275. return response;
  5276. }
  5277. numTries += 1;
  5278. if (numTries < maxTries) {
  5279. yield response.readBody();
  5280. yield this._performExponentialBackoff(numTries);
  5281. }
  5282. } while (numTries < maxTries);
  5283. return response;
  5284. });
  5285. }
  5286. /**
  5287. * Needs to be called if keepAlive is set to true in request options.
  5288. */
  5289. dispose() {
  5290. if (this._agent) {
  5291. this._agent.destroy();
  5292. }
  5293. this._disposed = true;
  5294. }
  5295. /**
  5296. * Raw request.
  5297. * @param info
  5298. * @param data
  5299. */
  5300. requestRaw(info, data) {
  5301. return __awaiter(this, void 0, void 0, function* () {
  5302. return new Promise((resolve, reject) => {
  5303. function callbackForResult(err, res) {
  5304. if (err) {
  5305. reject(err);
  5306. }
  5307. else if (!res) {
  5308. // If `err` is not passed, then `res` must be passed.
  5309. reject(new Error('Unknown error'));
  5310. }
  5311. else {
  5312. resolve(res);
  5313. }
  5314. }
  5315. this.requestRawWithCallback(info, data, callbackForResult);
  5316. });
  5317. });
  5318. }
  5319. /**
  5320. * Raw request with callback.
  5321. * @param info
  5322. * @param data
  5323. * @param onResult
  5324. */
  5325. requestRawWithCallback(info, data, onResult) {
  5326. if (typeof data === 'string') {
  5327. if (!info.options.headers) {
  5328. info.options.headers = {};
  5329. }
  5330. info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');
  5331. }
  5332. let callbackCalled = false;
  5333. function handleResult(err, res) {
  5334. if (!callbackCalled) {
  5335. callbackCalled = true;
  5336. onResult(err, res);
  5337. }
  5338. }
  5339. const req = info.httpModule.request(info.options, (msg) => {
  5340. const res = new HttpClientResponse(msg);
  5341. handleResult(undefined, res);
  5342. });
  5343. let socket;
  5344. req.on('socket', sock => {
  5345. socket = sock;
  5346. });
  5347. // If we ever get disconnected, we want the socket to timeout eventually
  5348. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  5349. if (socket) {
  5350. socket.end();
  5351. }
  5352. handleResult(new Error(`Request timeout: ${info.options.path}`));
  5353. });
  5354. req.on('error', function (err) {
  5355. // err has statusCode property
  5356. // res should have headers
  5357. handleResult(err);
  5358. });
  5359. if (data && typeof data === 'string') {
  5360. req.write(data, 'utf8');
  5361. }
  5362. if (data && typeof data !== 'string') {
  5363. data.on('close', function () {
  5364. req.end();
  5365. });
  5366. data.pipe(req);
  5367. }
  5368. else {
  5369. req.end();
  5370. }
  5371. }
  5372. /**
  5373. * Gets an http agent. This function is useful when you need an http agent that handles
  5374. * routing through a proxy server - depending upon the url and proxy environment variables.
  5375. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  5376. */
  5377. getAgent(serverUrl) {
  5378. const parsedUrl = new URL(serverUrl);
  5379. return this._getAgent(parsedUrl);
  5380. }
  5381. getAgentDispatcher(serverUrl) {
  5382. const parsedUrl = new URL(serverUrl);
  5383. const proxyUrl = pm.getProxyUrl(parsedUrl);
  5384. const useProxy = proxyUrl && proxyUrl.hostname;
  5385. if (!useProxy) {
  5386. return;
  5387. }
  5388. return this._getProxyAgentDispatcher(parsedUrl, proxyUrl);
  5389. }
  5390. _prepareRequest(method, requestUrl, headers) {
  5391. const info = {};
  5392. info.parsedUrl = requestUrl;
  5393. const usingSsl = info.parsedUrl.protocol === 'https:';
  5394. info.httpModule = usingSsl ? https : http;
  5395. const defaultPort = usingSsl ? 443 : 80;
  5396. info.options = {};
  5397. info.options.host = info.parsedUrl.hostname;
  5398. info.options.port = info.parsedUrl.port
  5399. ? parseInt(info.parsedUrl.port)
  5400. : defaultPort;
  5401. info.options.path =
  5402. (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  5403. info.options.method = method;
  5404. info.options.headers = this._mergeHeaders(headers);
  5405. if (this.userAgent != null) {
  5406. info.options.headers['user-agent'] = this.userAgent;
  5407. }
  5408. info.options.agent = this._getAgent(info.parsedUrl);
  5409. // gives handlers an opportunity to participate
  5410. if (this.handlers) {
  5411. for (const handler of this.handlers) {
  5412. handler.prepareRequest(info.options);
  5413. }
  5414. }
  5415. return info;
  5416. }
  5417. _mergeHeaders(headers) {
  5418. if (this.requestOptions && this.requestOptions.headers) {
  5419. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {}));
  5420. }
  5421. return lowercaseKeys(headers || {});
  5422. }
  5423. _getExistingOrDefaultHeader(additionalHeaders, header, _default) {
  5424. let clientHeader;
  5425. if (this.requestOptions && this.requestOptions.headers) {
  5426. clientHeader = lowercaseKeys(this.requestOptions.headers)[header];
  5427. }
  5428. return additionalHeaders[header] || clientHeader || _default;
  5429. }
  5430. _getAgent(parsedUrl) {
  5431. let agent;
  5432. const proxyUrl = pm.getProxyUrl(parsedUrl);
  5433. const useProxy = proxyUrl && proxyUrl.hostname;
  5434. if (this._keepAlive && useProxy) {
  5435. agent = this._proxyAgent;
  5436. }
  5437. if (!useProxy) {
  5438. agent = this._agent;
  5439. }
  5440. // if agent is already assigned use that agent.
  5441. if (agent) {
  5442. return agent;
  5443. }
  5444. const usingSsl = parsedUrl.protocol === 'https:';
  5445. let maxSockets = 100;
  5446. if (this.requestOptions) {
  5447. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  5448. }
  5449. // This is `useProxy` again, but we need to check `proxyURl` directly for TypeScripts's flow analysis.
  5450. if (proxyUrl && proxyUrl.hostname) {
  5451. const agentOptions = {
  5452. maxSockets,
  5453. keepAlive: this._keepAlive,
  5454. proxy: Object.assign(Object.assign({}, ((proxyUrl.username || proxyUrl.password) && {
  5455. proxyAuth: `${proxyUrl.username}:${proxyUrl.password}`
  5456. })), { host: proxyUrl.hostname, port: proxyUrl.port })
  5457. };
  5458. let tunnelAgent;
  5459. const overHttps = proxyUrl.protocol === 'https:';
  5460. if (usingSsl) {
  5461. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  5462. }
  5463. else {
  5464. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  5465. }
  5466. agent = tunnelAgent(agentOptions);
  5467. this._proxyAgent = agent;
  5468. }
  5469. // if tunneling agent isn't assigned create a new agent
  5470. if (!agent) {
  5471. const options = { keepAlive: this._keepAlive, maxSockets };
  5472. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  5473. this._agent = agent;
  5474. }
  5475. if (usingSsl && this._ignoreSslError) {
  5476. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  5477. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  5478. // we have to cast it to any and change it directly
  5479. agent.options = Object.assign(agent.options || {}, {
  5480. rejectUnauthorized: false
  5481. });
  5482. }
  5483. return agent;
  5484. }
  5485. _getProxyAgentDispatcher(parsedUrl, proxyUrl) {
  5486. let proxyAgent;
  5487. if (this._keepAlive) {
  5488. proxyAgent = this._proxyAgentDispatcher;
  5489. }
  5490. // if agent is already assigned use that agent.
  5491. if (proxyAgent) {
  5492. return proxyAgent;
  5493. }
  5494. const usingSsl = parsedUrl.protocol === 'https:';
  5495. proxyAgent = new undici_1.ProxyAgent(Object.assign({ uri: proxyUrl.href, pipelining: !this._keepAlive ? 0 : 1 }, ((proxyUrl.username || proxyUrl.password) && {
  5496. token: `${proxyUrl.username}:${proxyUrl.password}`
  5497. })));
  5498. this._proxyAgentDispatcher = proxyAgent;
  5499. if (usingSsl && this._ignoreSslError) {
  5500. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  5501. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  5502. // we have to cast it to any and change it directly
  5503. proxyAgent.options = Object.assign(proxyAgent.options.requestTls || {}, {
  5504. rejectUnauthorized: false
  5505. });
  5506. }
  5507. return proxyAgent;
  5508. }
  5509. _performExponentialBackoff(retryNumber) {
  5510. return __awaiter(this, void 0, void 0, function* () {
  5511. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  5512. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  5513. return new Promise(resolve => setTimeout(() => resolve(), ms));
  5514. });
  5515. }
  5516. _processResponse(res, options) {
  5517. return __awaiter(this, void 0, void 0, function* () {
  5518. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  5519. const statusCode = res.message.statusCode || 0;
  5520. const response = {
  5521. statusCode,
  5522. result: null,
  5523. headers: {}
  5524. };
  5525. // not found leads to null obj returned
  5526. if (statusCode === HttpCodes.NotFound) {
  5527. resolve(response);
  5528. }
  5529. // get the result from the body
  5530. function dateTimeDeserializer(key, value) {
  5531. if (typeof value === 'string') {
  5532. const a = new Date(value);
  5533. if (!isNaN(a.valueOf())) {
  5534. return a;
  5535. }
  5536. }
  5537. return value;
  5538. }
  5539. let obj;
  5540. let contents;
  5541. try {
  5542. contents = yield res.readBody();
  5543. if (contents && contents.length > 0) {
  5544. if (options && options.deserializeDates) {
  5545. obj = JSON.parse(contents, dateTimeDeserializer);
  5546. }
  5547. else {
  5548. obj = JSON.parse(contents);
  5549. }
  5550. response.result = obj;
  5551. }
  5552. response.headers = res.message.headers;
  5553. }
  5554. catch (err) {
  5555. // Invalid resource (contents not json); leaving result obj null
  5556. }
  5557. // note that 3xx redirects are handled by the http layer.
  5558. if (statusCode > 299) {
  5559. let msg;
  5560. // if exception/error in body, attempt to get better error
  5561. if (obj && obj.message) {
  5562. msg = obj.message;
  5563. }
  5564. else if (contents && contents.length > 0) {
  5565. // it may be the case that the exception is in the body message as string
  5566. msg = contents;
  5567. }
  5568. else {
  5569. msg = `Failed request: (${statusCode})`;
  5570. }
  5571. const err = new HttpClientError(msg, statusCode);
  5572. err.result = response.result;
  5573. reject(err);
  5574. }
  5575. else {
  5576. resolve(response);
  5577. }
  5578. }));
  5579. });
  5580. }
  5581. }
  5582. exports.HttpClient = HttpClient;
  5583. const lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});
  5584. //# sourceMappingURL=index.js.map
  5585. /***/ }),
  5586. /***/ 9835:
  5587. /***/ ((__unused_webpack_module, exports) => {
  5588. "use strict";
  5589. Object.defineProperty(exports, "__esModule", ({ value: true }));
  5590. exports.checkBypass = exports.getProxyUrl = void 0;
  5591. function getProxyUrl(reqUrl) {
  5592. const usingSsl = reqUrl.protocol === 'https:';
  5593. if (checkBypass(reqUrl)) {
  5594. return undefined;
  5595. }
  5596. const proxyVar = (() => {
  5597. if (usingSsl) {
  5598. return process.env['https_proxy'] || process.env['HTTPS_PROXY'];
  5599. }
  5600. else {
  5601. return process.env['http_proxy'] || process.env['HTTP_PROXY'];
  5602. }
  5603. })();
  5604. if (proxyVar) {
  5605. try {
  5606. return new URL(proxyVar);
  5607. }
  5608. catch (_a) {
  5609. if (!proxyVar.startsWith('http://') && !proxyVar.startsWith('https://'))
  5610. return new URL(`http://${proxyVar}`);
  5611. }
  5612. }
  5613. else {
  5614. return undefined;
  5615. }
  5616. }
  5617. exports.getProxyUrl = getProxyUrl;
  5618. function checkBypass(reqUrl) {
  5619. if (!reqUrl.hostname) {
  5620. return false;
  5621. }
  5622. const reqHost = reqUrl.hostname;
  5623. if (isLoopbackAddress(reqHost)) {
  5624. return true;
  5625. }
  5626. const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';
  5627. if (!noProxy) {
  5628. return false;
  5629. }
  5630. // Determine the request port
  5631. let reqPort;
  5632. if (reqUrl.port) {
  5633. reqPort = Number(reqUrl.port);
  5634. }
  5635. else if (reqUrl.protocol === 'http:') {
  5636. reqPort = 80;
  5637. }
  5638. else if (reqUrl.protocol === 'https:') {
  5639. reqPort = 443;
  5640. }
  5641. // Format the request hostname and hostname with port
  5642. const upperReqHosts = [reqUrl.hostname.toUpperCase()];
  5643. if (typeof reqPort === 'number') {
  5644. upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);
  5645. }
  5646. // Compare request host against noproxy
  5647. for (const upperNoProxyItem of noProxy
  5648. .split(',')
  5649. .map(x => x.trim().toUpperCase())
  5650. .filter(x => x)) {
  5651. if (upperNoProxyItem === '*' ||
  5652. upperReqHosts.some(x => x === upperNoProxyItem ||
  5653. x.endsWith(`.${upperNoProxyItem}`) ||
  5654. (upperNoProxyItem.startsWith('.') &&
  5655. x.endsWith(`${upperNoProxyItem}`)))) {
  5656. return true;
  5657. }
  5658. }
  5659. return false;
  5660. }
  5661. exports.checkBypass = checkBypass;
  5662. function isLoopbackAddress(host) {
  5663. const hostLower = host.toLowerCase();
  5664. return (hostLower === 'localhost' ||
  5665. hostLower.startsWith('127.') ||
  5666. hostLower.startsWith('[::1]') ||
  5667. hostLower.startsWith('[0:0:0:0:0:0:0:1]'));
  5668. }
  5669. //# sourceMappingURL=proxy.js.map
  5670. /***/ }),
  5671. /***/ 1962:
  5672. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  5673. "use strict";
  5674. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  5675. if (k2 === undefined) k2 = k;
  5676. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  5677. }) : (function(o, m, k, k2) {
  5678. if (k2 === undefined) k2 = k;
  5679. o[k2] = m[k];
  5680. }));
  5681. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  5682. Object.defineProperty(o, "default", { enumerable: true, value: v });
  5683. }) : function(o, v) {
  5684. o["default"] = v;
  5685. });
  5686. var __importStar = (this && this.__importStar) || function (mod) {
  5687. if (mod && mod.__esModule) return mod;
  5688. var result = {};
  5689. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  5690. __setModuleDefault(result, mod);
  5691. return result;
  5692. };
  5693. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  5694. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  5695. return new (P || (P = Promise))(function (resolve, reject) {
  5696. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5697. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  5698. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  5699. step((generator = generator.apply(thisArg, _arguments || [])).next());
  5700. });
  5701. };
  5702. var _a;
  5703. Object.defineProperty(exports, "__esModule", ({ value: true }));
  5704. 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;
  5705. const fs = __importStar(__nccwpck_require__(7147));
  5706. const path = __importStar(__nccwpck_require__(1017));
  5707. _a = fs.promises
  5708. // export const {open} = 'fs'
  5709. , 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;
  5710. // export const {open} = 'fs'
  5711. exports.IS_WINDOWS = process.platform === 'win32';
  5712. // See https://github.com/nodejs/node/blob/d0153aee367422d0858105abec186da4dff0a0c5/deps/uv/include/uv/win.h#L691
  5713. exports.UV_FS_O_EXLOCK = 0x10000000;
  5714. exports.READONLY = fs.constants.O_RDONLY;
  5715. function exists(fsPath) {
  5716. return __awaiter(this, void 0, void 0, function* () {
  5717. try {
  5718. yield exports.stat(fsPath);
  5719. }
  5720. catch (err) {
  5721. if (err.code === 'ENOENT') {
  5722. return false;
  5723. }
  5724. throw err;
  5725. }
  5726. return true;
  5727. });
  5728. }
  5729. exports.exists = exists;
  5730. function isDirectory(fsPath, useStat = false) {
  5731. return __awaiter(this, void 0, void 0, function* () {
  5732. const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath);
  5733. return stats.isDirectory();
  5734. });
  5735. }
  5736. exports.isDirectory = isDirectory;
  5737. /**
  5738. * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:
  5739. * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases).
  5740. */
  5741. function isRooted(p) {
  5742. p = normalizeSeparators(p);
  5743. if (!p) {
  5744. throw new Error('isRooted() parameter "p" cannot be empty');
  5745. }
  5746. if (exports.IS_WINDOWS) {
  5747. return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello
  5748. ); // e.g. C: or C:\hello
  5749. }
  5750. return p.startsWith('/');
  5751. }
  5752. exports.isRooted = isRooted;
  5753. /**
  5754. * Best effort attempt to determine whether a file exists and is executable.
  5755. * @param filePath file path to check
  5756. * @param extensions additional file extensions to try
  5757. * @return if file exists and is executable, returns the file path. otherwise empty string.
  5758. */
  5759. function tryGetExecutablePath(filePath, extensions) {
  5760. return __awaiter(this, void 0, void 0, function* () {
  5761. let stats = undefined;
  5762. try {
  5763. // test file exists
  5764. stats = yield exports.stat(filePath);
  5765. }
  5766. catch (err) {
  5767. if (err.code !== 'ENOENT') {
  5768. // eslint-disable-next-line no-console
  5769. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  5770. }
  5771. }
  5772. if (stats && stats.isFile()) {
  5773. if (exports.IS_WINDOWS) {
  5774. // on Windows, test for valid extension
  5775. const upperExt = path.extname(filePath).toUpperCase();
  5776. if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) {
  5777. return filePath;
  5778. }
  5779. }
  5780. else {
  5781. if (isUnixExecutable(stats)) {
  5782. return filePath;
  5783. }
  5784. }
  5785. }
  5786. // try each extension
  5787. const originalFilePath = filePath;
  5788. for (const extension of extensions) {
  5789. filePath = originalFilePath + extension;
  5790. stats = undefined;
  5791. try {
  5792. stats = yield exports.stat(filePath);
  5793. }
  5794. catch (err) {
  5795. if (err.code !== 'ENOENT') {
  5796. // eslint-disable-next-line no-console
  5797. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  5798. }
  5799. }
  5800. if (stats && stats.isFile()) {
  5801. if (exports.IS_WINDOWS) {
  5802. // preserve the case of the actual file (since an extension was appended)
  5803. try {
  5804. const directory = path.dirname(filePath);
  5805. const upperName = path.basename(filePath).toUpperCase();
  5806. for (const actualName of yield exports.readdir(directory)) {
  5807. if (upperName === actualName.toUpperCase()) {
  5808. filePath = path.join(directory, actualName);
  5809. break;
  5810. }
  5811. }
  5812. }
  5813. catch (err) {
  5814. // eslint-disable-next-line no-console
  5815. console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`);
  5816. }
  5817. return filePath;
  5818. }
  5819. else {
  5820. if (isUnixExecutable(stats)) {
  5821. return filePath;
  5822. }
  5823. }
  5824. }
  5825. }
  5826. return '';
  5827. });
  5828. }
  5829. exports.tryGetExecutablePath = tryGetExecutablePath;
  5830. function normalizeSeparators(p) {
  5831. p = p || '';
  5832. if (exports.IS_WINDOWS) {
  5833. // convert slashes on Windows
  5834. p = p.replace(/\//g, '\\');
  5835. // remove redundant slashes
  5836. return p.replace(/\\\\+/g, '\\');
  5837. }
  5838. // remove redundant slashes
  5839. return p.replace(/\/\/+/g, '/');
  5840. }
  5841. // on Mac/Linux, test the execute bit
  5842. // R W X R W X R W X
  5843. // 256 128 64 32 16 8 4 2 1
  5844. function isUnixExecutable(stats) {
  5845. return ((stats.mode & 1) > 0 ||
  5846. ((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||
  5847. ((stats.mode & 64) > 0 && stats.uid === process.getuid()));
  5848. }
  5849. // Get the path of cmd.exe in windows
  5850. function getCmdPath() {
  5851. var _a;
  5852. return (_a = process.env['COMSPEC']) !== null && _a !== void 0 ? _a : `cmd.exe`;
  5853. }
  5854. exports.getCmdPath = getCmdPath;
  5855. //# sourceMappingURL=io-util.js.map
  5856. /***/ }),
  5857. /***/ 7436:
  5858. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  5859. "use strict";
  5860. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  5861. if (k2 === undefined) k2 = k;
  5862. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  5863. }) : (function(o, m, k, k2) {
  5864. if (k2 === undefined) k2 = k;
  5865. o[k2] = m[k];
  5866. }));
  5867. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  5868. Object.defineProperty(o, "default", { enumerable: true, value: v });
  5869. }) : function(o, v) {
  5870. o["default"] = v;
  5871. });
  5872. var __importStar = (this && this.__importStar) || function (mod) {
  5873. if (mod && mod.__esModule) return mod;
  5874. var result = {};
  5875. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  5876. __setModuleDefault(result, mod);
  5877. return result;
  5878. };
  5879. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  5880. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  5881. return new (P || (P = Promise))(function (resolve, reject) {
  5882. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5883. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  5884. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  5885. step((generator = generator.apply(thisArg, _arguments || [])).next());
  5886. });
  5887. };
  5888. Object.defineProperty(exports, "__esModule", ({ value: true }));
  5889. exports.findInPath = exports.which = exports.mkdirP = exports.rmRF = exports.mv = exports.cp = void 0;
  5890. const assert_1 = __nccwpck_require__(9491);
  5891. const path = __importStar(__nccwpck_require__(1017));
  5892. const ioUtil = __importStar(__nccwpck_require__(1962));
  5893. /**
  5894. * Copies a file or folder.
  5895. * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js
  5896. *
  5897. * @param source source path
  5898. * @param dest destination path
  5899. * @param options optional. See CopyOptions.
  5900. */
  5901. function cp(source, dest, options = {}) {
  5902. return __awaiter(this, void 0, void 0, function* () {
  5903. const { force, recursive, copySourceDirectory } = readCopyOptions(options);
  5904. const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null;
  5905. // Dest is an existing file, but not forcing
  5906. if (destStat && destStat.isFile() && !force) {
  5907. return;
  5908. }
  5909. // If dest is an existing directory, should copy inside.
  5910. const newDest = destStat && destStat.isDirectory() && copySourceDirectory
  5911. ? path.join(dest, path.basename(source))
  5912. : dest;
  5913. if (!(yield ioUtil.exists(source))) {
  5914. throw new Error(`no such file or directory: ${source}`);
  5915. }
  5916. const sourceStat = yield ioUtil.stat(source);
  5917. if (sourceStat.isDirectory()) {
  5918. if (!recursive) {
  5919. throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`);
  5920. }
  5921. else {
  5922. yield cpDirRecursive(source, newDest, 0, force);
  5923. }
  5924. }
  5925. else {
  5926. if (path.relative(source, newDest) === '') {
  5927. // a file cannot be copied to itself
  5928. throw new Error(`'${newDest}' and '${source}' are the same file`);
  5929. }
  5930. yield copyFile(source, newDest, force);
  5931. }
  5932. });
  5933. }
  5934. exports.cp = cp;
  5935. /**
  5936. * Moves a path.
  5937. *
  5938. * @param source source path
  5939. * @param dest destination path
  5940. * @param options optional. See MoveOptions.
  5941. */
  5942. function mv(source, dest, options = {}) {
  5943. return __awaiter(this, void 0, void 0, function* () {
  5944. if (yield ioUtil.exists(dest)) {
  5945. let destExists = true;
  5946. if (yield ioUtil.isDirectory(dest)) {
  5947. // If dest is directory copy src into dest
  5948. dest = path.join(dest, path.basename(source));
  5949. destExists = yield ioUtil.exists(dest);
  5950. }
  5951. if (destExists) {
  5952. if (options.force == null || options.force) {
  5953. yield rmRF(dest);
  5954. }
  5955. else {
  5956. throw new Error('Destination already exists');
  5957. }
  5958. }
  5959. }
  5960. yield mkdirP(path.dirname(dest));
  5961. yield ioUtil.rename(source, dest);
  5962. });
  5963. }
  5964. exports.mv = mv;
  5965. /**
  5966. * Remove a path recursively with force
  5967. *
  5968. * @param inputPath path to remove
  5969. */
  5970. function rmRF(inputPath) {
  5971. return __awaiter(this, void 0, void 0, function* () {
  5972. if (ioUtil.IS_WINDOWS) {
  5973. // Check for invalid characters
  5974. // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file
  5975. if (/[*"<>|]/.test(inputPath)) {
  5976. throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows');
  5977. }
  5978. }
  5979. try {
  5980. // note if path does not exist, error is silent
  5981. yield ioUtil.rm(inputPath, {
  5982. force: true,
  5983. maxRetries: 3,
  5984. recursive: true,
  5985. retryDelay: 300
  5986. });
  5987. }
  5988. catch (err) {
  5989. throw new Error(`File was unable to be removed ${err}`);
  5990. }
  5991. });
  5992. }
  5993. exports.rmRF = rmRF;
  5994. /**
  5995. * Make a directory. Creates the full path with folders in between
  5996. * Will throw if it fails
  5997. *
  5998. * @param fsPath path to create
  5999. * @returns Promise<void>
  6000. */
  6001. function mkdirP(fsPath) {
  6002. return __awaiter(this, void 0, void 0, function* () {
  6003. assert_1.ok(fsPath, 'a path argument must be provided');
  6004. yield ioUtil.mkdir(fsPath, { recursive: true });
  6005. });
  6006. }
  6007. exports.mkdirP = mkdirP;
  6008. /**
  6009. * Returns path of a tool had the tool actually been invoked. Resolves via paths.
  6010. * If you check and the tool does not exist, it will throw.
  6011. *
  6012. * @param tool name of the tool
  6013. * @param check whether to check if tool exists
  6014. * @returns Promise<string> path to tool
  6015. */
  6016. function which(tool, check) {
  6017. return __awaiter(this, void 0, void 0, function* () {
  6018. if (!tool) {
  6019. throw new Error("parameter 'tool' is required");
  6020. }
  6021. // recursive when check=true
  6022. if (check) {
  6023. const result = yield which(tool, false);
  6024. if (!result) {
  6025. if (ioUtil.IS_WINDOWS) {
  6026. 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.`);
  6027. }
  6028. else {
  6029. 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.`);
  6030. }
  6031. }
  6032. return result;
  6033. }
  6034. const matches = yield findInPath(tool);
  6035. if (matches && matches.length > 0) {
  6036. return matches[0];
  6037. }
  6038. return '';
  6039. });
  6040. }
  6041. exports.which = which;
  6042. /**
  6043. * Returns a list of all occurrences of the given tool on the system path.
  6044. *
  6045. * @returns Promise<string[]> the paths of the tool
  6046. */
  6047. function findInPath(tool) {
  6048. return __awaiter(this, void 0, void 0, function* () {
  6049. if (!tool) {
  6050. throw new Error("parameter 'tool' is required");
  6051. }
  6052. // build the list of extensions to try
  6053. const extensions = [];
  6054. if (ioUtil.IS_WINDOWS && process.env['PATHEXT']) {
  6055. for (const extension of process.env['PATHEXT'].split(path.delimiter)) {
  6056. if (extension) {
  6057. extensions.push(extension);
  6058. }
  6059. }
  6060. }
  6061. // if it's rooted, return it if exists. otherwise return empty.
  6062. if (ioUtil.isRooted(tool)) {
  6063. const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions);
  6064. if (filePath) {
  6065. return [filePath];
  6066. }
  6067. return [];
  6068. }
  6069. // if any path separators, return empty
  6070. if (tool.includes(path.sep)) {
  6071. return [];
  6072. }
  6073. // build the list of directories
  6074. //
  6075. // Note, technically "where" checks the current directory on Windows. From a toolkit perspective,
  6076. // it feels like we should not do this. Checking the current directory seems like more of a use
  6077. // case of a shell, and the which() function exposed by the toolkit should strive for consistency
  6078. // across platforms.
  6079. const directories = [];
  6080. if (process.env.PATH) {
  6081. for (const p of process.env.PATH.split(path.delimiter)) {
  6082. if (p) {
  6083. directories.push(p);
  6084. }
  6085. }
  6086. }
  6087. // find all matches
  6088. const matches = [];
  6089. for (const directory of directories) {
  6090. const filePath = yield ioUtil.tryGetExecutablePath(path.join(directory, tool), extensions);
  6091. if (filePath) {
  6092. matches.push(filePath);
  6093. }
  6094. }
  6095. return matches;
  6096. });
  6097. }
  6098. exports.findInPath = findInPath;
  6099. function readCopyOptions(options) {
  6100. const force = options.force == null ? true : options.force;
  6101. const recursive = Boolean(options.recursive);
  6102. const copySourceDirectory = options.copySourceDirectory == null
  6103. ? true
  6104. : Boolean(options.copySourceDirectory);
  6105. return { force, recursive, copySourceDirectory };
  6106. }
  6107. function cpDirRecursive(sourceDir, destDir, currentDepth, force) {
  6108. return __awaiter(this, void 0, void 0, function* () {
  6109. // Ensure there is not a run away recursive copy
  6110. if (currentDepth >= 255)
  6111. return;
  6112. currentDepth++;
  6113. yield mkdirP(destDir);
  6114. const files = yield ioUtil.readdir(sourceDir);
  6115. for (const fileName of files) {
  6116. const srcFile = `${sourceDir}/${fileName}`;
  6117. const destFile = `${destDir}/${fileName}`;
  6118. const srcFileStat = yield ioUtil.lstat(srcFile);
  6119. if (srcFileStat.isDirectory()) {
  6120. // Recurse
  6121. yield cpDirRecursive(srcFile, destFile, currentDepth, force);
  6122. }
  6123. else {
  6124. yield copyFile(srcFile, destFile, force);
  6125. }
  6126. }
  6127. // Change the mode for the newly created directory
  6128. yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode);
  6129. });
  6130. }
  6131. // Buffered file copy
  6132. function copyFile(srcFile, destFile, force) {
  6133. return __awaiter(this, void 0, void 0, function* () {
  6134. if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) {
  6135. // unlink/re-link it
  6136. try {
  6137. yield ioUtil.lstat(destFile);
  6138. yield ioUtil.unlink(destFile);
  6139. }
  6140. catch (e) {
  6141. // Try to override file permission
  6142. if (e.code === 'EPERM') {
  6143. yield ioUtil.chmod(destFile, '0666');
  6144. yield ioUtil.unlink(destFile);
  6145. }
  6146. // other errors = it doesn't exist, no work to do
  6147. }
  6148. // Copy over symlink
  6149. const symlinkFull = yield ioUtil.readlink(srcFile);
  6150. yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null);
  6151. }
  6152. else if (!(yield ioUtil.exists(destFile)) || force) {
  6153. yield ioUtil.copyFile(srcFile, destFile);
  6154. }
  6155. });
  6156. }
  6157. //# sourceMappingURL=io.js.map
  6158. /***/ }),
  6159. /***/ 2473:
  6160. /***/ (function(module, exports, __nccwpck_require__) {
  6161. "use strict";
  6162. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  6163. if (k2 === undefined) k2 = k;
  6164. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  6165. }) : (function(o, m, k, k2) {
  6166. if (k2 === undefined) k2 = k;
  6167. o[k2] = m[k];
  6168. }));
  6169. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  6170. Object.defineProperty(o, "default", { enumerable: true, value: v });
  6171. }) : function(o, v) {
  6172. o["default"] = v;
  6173. });
  6174. var __importStar = (this && this.__importStar) || function (mod) {
  6175. if (mod && mod.__esModule) return mod;
  6176. var result = {};
  6177. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  6178. __setModuleDefault(result, mod);
  6179. return result;
  6180. };
  6181. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6182. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6183. return new (P || (P = Promise))(function (resolve, reject) {
  6184. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6185. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6186. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6187. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6188. });
  6189. };
  6190. Object.defineProperty(exports, "__esModule", ({ value: true }));
  6191. exports._readLinuxVersionFile = exports._getOsVersion = exports._findMatch = void 0;
  6192. const semver = __importStar(__nccwpck_require__(5911));
  6193. const core_1 = __nccwpck_require__(2186);
  6194. // needs to be require for core node modules to be mocked
  6195. /* eslint @typescript-eslint/no-require-imports: 0 */
  6196. const os = __nccwpck_require__(2037);
  6197. const cp = __nccwpck_require__(2081);
  6198. const fs = __nccwpck_require__(7147);
  6199. function _findMatch(versionSpec, stable, candidates, archFilter) {
  6200. return __awaiter(this, void 0, void 0, function* () {
  6201. const platFilter = os.platform();
  6202. let result;
  6203. let match;
  6204. let file;
  6205. for (const candidate of candidates) {
  6206. const version = candidate.version;
  6207. core_1.debug(`check ${version} satisfies ${versionSpec}`);
  6208. if (semver.satisfies(version, versionSpec) &&
  6209. (!stable || candidate.stable === stable)) {
  6210. file = candidate.files.find(item => {
  6211. core_1.debug(`${item.arch}===${archFilter} && ${item.platform}===${platFilter}`);
  6212. let chk = item.arch === archFilter && item.platform === platFilter;
  6213. if (chk && item.platform_version) {
  6214. const osVersion = module.exports._getOsVersion();
  6215. if (osVersion === item.platform_version) {
  6216. chk = true;
  6217. }
  6218. else {
  6219. chk = semver.satisfies(osVersion, item.platform_version);
  6220. }
  6221. }
  6222. return chk;
  6223. });
  6224. if (file) {
  6225. core_1.debug(`matched ${candidate.version}`);
  6226. match = candidate;
  6227. break;
  6228. }
  6229. }
  6230. }
  6231. if (match && file) {
  6232. // clone since we're mutating the file list to be only the file that matches
  6233. result = Object.assign({}, match);
  6234. result.files = [file];
  6235. }
  6236. return result;
  6237. });
  6238. }
  6239. exports._findMatch = _findMatch;
  6240. function _getOsVersion() {
  6241. // TODO: add windows and other linux, arm variants
  6242. // right now filtering on version is only an ubuntu and macos scenario for tools we build for hosted (python)
  6243. const plat = os.platform();
  6244. let version = '';
  6245. if (plat === 'darwin') {
  6246. version = cp.execSync('sw_vers -productVersion').toString();
  6247. }
  6248. else if (plat === 'linux') {
  6249. // lsb_release process not in some containers, readfile
  6250. // Run cat /etc/lsb-release
  6251. // DISTRIB_ID=Ubuntu
  6252. // DISTRIB_RELEASE=18.04
  6253. // DISTRIB_CODENAME=bionic
  6254. // DISTRIB_DESCRIPTION="Ubuntu 18.04.4 LTS"
  6255. const lsbContents = module.exports._readLinuxVersionFile();
  6256. if (lsbContents) {
  6257. const lines = lsbContents.split('\n');
  6258. for (const line of lines) {
  6259. const parts = line.split('=');
  6260. if (parts.length === 2 &&
  6261. (parts[0].trim() === 'VERSION_ID' ||
  6262. parts[0].trim() === 'DISTRIB_RELEASE')) {
  6263. version = parts[1]
  6264. .trim()
  6265. .replace(/^"/, '')
  6266. .replace(/"$/, '');
  6267. break;
  6268. }
  6269. }
  6270. }
  6271. }
  6272. return version;
  6273. }
  6274. exports._getOsVersion = _getOsVersion;
  6275. function _readLinuxVersionFile() {
  6276. const lsbReleaseFile = '/etc/lsb-release';
  6277. const osReleaseFile = '/etc/os-release';
  6278. let contents = '';
  6279. if (fs.existsSync(lsbReleaseFile)) {
  6280. contents = fs.readFileSync(lsbReleaseFile).toString();
  6281. }
  6282. else if (fs.existsSync(osReleaseFile)) {
  6283. contents = fs.readFileSync(osReleaseFile).toString();
  6284. }
  6285. return contents;
  6286. }
  6287. exports._readLinuxVersionFile = _readLinuxVersionFile;
  6288. //# sourceMappingURL=manifest.js.map
  6289. /***/ }),
  6290. /***/ 8279:
  6291. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  6292. "use strict";
  6293. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  6294. if (k2 === undefined) k2 = k;
  6295. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  6296. }) : (function(o, m, k, k2) {
  6297. if (k2 === undefined) k2 = k;
  6298. o[k2] = m[k];
  6299. }));
  6300. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  6301. Object.defineProperty(o, "default", { enumerable: true, value: v });
  6302. }) : function(o, v) {
  6303. o["default"] = v;
  6304. });
  6305. var __importStar = (this && this.__importStar) || function (mod) {
  6306. if (mod && mod.__esModule) return mod;
  6307. var result = {};
  6308. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  6309. __setModuleDefault(result, mod);
  6310. return result;
  6311. };
  6312. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6313. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6314. return new (P || (P = Promise))(function (resolve, reject) {
  6315. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6316. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6317. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6318. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6319. });
  6320. };
  6321. Object.defineProperty(exports, "__esModule", ({ value: true }));
  6322. exports.RetryHelper = void 0;
  6323. const core = __importStar(__nccwpck_require__(2186));
  6324. /**
  6325. * Internal class for retries
  6326. */
  6327. class RetryHelper {
  6328. constructor(maxAttempts, minSeconds, maxSeconds) {
  6329. if (maxAttempts < 1) {
  6330. throw new Error('max attempts should be greater than or equal to 1');
  6331. }
  6332. this.maxAttempts = maxAttempts;
  6333. this.minSeconds = Math.floor(minSeconds);
  6334. this.maxSeconds = Math.floor(maxSeconds);
  6335. if (this.minSeconds > this.maxSeconds) {
  6336. throw new Error('min seconds should be less than or equal to max seconds');
  6337. }
  6338. }
  6339. execute(action, isRetryable) {
  6340. return __awaiter(this, void 0, void 0, function* () {
  6341. let attempt = 1;
  6342. while (attempt < this.maxAttempts) {
  6343. // Try
  6344. try {
  6345. return yield action();
  6346. }
  6347. catch (err) {
  6348. if (isRetryable && !isRetryable(err)) {
  6349. throw err;
  6350. }
  6351. core.info(err.message);
  6352. }
  6353. // Sleep
  6354. const seconds = this.getSleepAmount();
  6355. core.info(`Waiting ${seconds} seconds before trying again`);
  6356. yield this.sleep(seconds);
  6357. attempt++;
  6358. }
  6359. // Last attempt
  6360. return yield action();
  6361. });
  6362. }
  6363. getSleepAmount() {
  6364. return (Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) +
  6365. this.minSeconds);
  6366. }
  6367. sleep(seconds) {
  6368. return __awaiter(this, void 0, void 0, function* () {
  6369. return new Promise(resolve => setTimeout(resolve, seconds * 1000));
  6370. });
  6371. }
  6372. }
  6373. exports.RetryHelper = RetryHelper;
  6374. //# sourceMappingURL=retry-helper.js.map
  6375. /***/ }),
  6376. /***/ 7784:
  6377. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  6378. "use strict";
  6379. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  6380. if (k2 === undefined) k2 = k;
  6381. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  6382. }) : (function(o, m, k, k2) {
  6383. if (k2 === undefined) k2 = k;
  6384. o[k2] = m[k];
  6385. }));
  6386. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  6387. Object.defineProperty(o, "default", { enumerable: true, value: v });
  6388. }) : function(o, v) {
  6389. o["default"] = v;
  6390. });
  6391. var __importStar = (this && this.__importStar) || function (mod) {
  6392. if (mod && mod.__esModule) return mod;
  6393. var result = {};
  6394. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  6395. __setModuleDefault(result, mod);
  6396. return result;
  6397. };
  6398. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6399. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6400. return new (P || (P = Promise))(function (resolve, reject) {
  6401. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6402. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6403. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6404. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6405. });
  6406. };
  6407. var __importDefault = (this && this.__importDefault) || function (mod) {
  6408. return (mod && mod.__esModule) ? mod : { "default": mod };
  6409. };
  6410. Object.defineProperty(exports, "__esModule", ({ value: true }));
  6411. 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;
  6412. const core = __importStar(__nccwpck_require__(2186));
  6413. const io = __importStar(__nccwpck_require__(7436));
  6414. const fs = __importStar(__nccwpck_require__(7147));
  6415. const mm = __importStar(__nccwpck_require__(2473));
  6416. const os = __importStar(__nccwpck_require__(2037));
  6417. const path = __importStar(__nccwpck_require__(1017));
  6418. const httpm = __importStar(__nccwpck_require__(6255));
  6419. const semver = __importStar(__nccwpck_require__(5911));
  6420. const stream = __importStar(__nccwpck_require__(2781));
  6421. const util = __importStar(__nccwpck_require__(3837));
  6422. const assert_1 = __nccwpck_require__(9491);
  6423. const v4_1 = __importDefault(__nccwpck_require__(7468));
  6424. const exec_1 = __nccwpck_require__(1514);
  6425. const retry_helper_1 = __nccwpck_require__(8279);
  6426. class HTTPError extends Error {
  6427. constructor(httpStatusCode) {
  6428. super(`Unexpected HTTP response: ${httpStatusCode}`);
  6429. this.httpStatusCode = httpStatusCode;
  6430. Object.setPrototypeOf(this, new.target.prototype);
  6431. }
  6432. }
  6433. exports.HTTPError = HTTPError;
  6434. const IS_WINDOWS = process.platform === 'win32';
  6435. const IS_MAC = process.platform === 'darwin';
  6436. const userAgent = 'actions/tool-cache';
  6437. /**
  6438. * Download a tool from an url and stream it into a file
  6439. *
  6440. * @param url url of tool to download
  6441. * @param dest path to download tool
  6442. * @param auth authorization header
  6443. * @param headers other headers
  6444. * @returns path to downloaded tool
  6445. */
  6446. function downloadTool(url, dest, auth, headers) {
  6447. return __awaiter(this, void 0, void 0, function* () {
  6448. dest = dest || path.join(_getTempDirectory(), v4_1.default());
  6449. yield io.mkdirP(path.dirname(dest));
  6450. core.debug(`Downloading ${url}`);
  6451. core.debug(`Destination ${dest}`);
  6452. const maxAttempts = 3;
  6453. const minSeconds = _getGlobal('TEST_DOWNLOAD_TOOL_RETRY_MIN_SECONDS', 10);
  6454. const maxSeconds = _getGlobal('TEST_DOWNLOAD_TOOL_RETRY_MAX_SECONDS', 20);
  6455. const retryHelper = new retry_helper_1.RetryHelper(maxAttempts, minSeconds, maxSeconds);
  6456. return yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  6457. return yield downloadToolAttempt(url, dest || '', auth, headers);
  6458. }), (err) => {
  6459. if (err instanceof HTTPError && err.httpStatusCode) {
  6460. // Don't retry anything less than 500, except 408 Request Timeout and 429 Too Many Requests
  6461. if (err.httpStatusCode < 500 &&
  6462. err.httpStatusCode !== 408 &&
  6463. err.httpStatusCode !== 429) {
  6464. return false;
  6465. }
  6466. }
  6467. // Otherwise retry
  6468. return true;
  6469. });
  6470. });
  6471. }
  6472. exports.downloadTool = downloadTool;
  6473. function downloadToolAttempt(url, dest, auth, headers) {
  6474. return __awaiter(this, void 0, void 0, function* () {
  6475. if (fs.existsSync(dest)) {
  6476. throw new Error(`Destination file path ${dest} already exists`);
  6477. }
  6478. // Get the response headers
  6479. const http = new httpm.HttpClient(userAgent, [], {
  6480. allowRetries: false
  6481. });
  6482. if (auth) {
  6483. core.debug('set auth');
  6484. if (headers === undefined) {
  6485. headers = {};
  6486. }
  6487. headers.authorization = auth;
  6488. }
  6489. const response = yield http.get(url, headers);
  6490. if (response.message.statusCode !== 200) {
  6491. const err = new HTTPError(response.message.statusCode);
  6492. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  6493. throw err;
  6494. }
  6495. // Download the response body
  6496. const pipeline = util.promisify(stream.pipeline);
  6497. const responseMessageFactory = _getGlobal('TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY', () => response.message);
  6498. const readStream = responseMessageFactory();
  6499. let succeeded = false;
  6500. try {
  6501. yield pipeline(readStream, fs.createWriteStream(dest));
  6502. core.debug('download complete');
  6503. succeeded = true;
  6504. return dest;
  6505. }
  6506. finally {
  6507. // Error, delete dest before retry
  6508. if (!succeeded) {
  6509. core.debug('download failed');
  6510. try {
  6511. yield io.rmRF(dest);
  6512. }
  6513. catch (err) {
  6514. core.debug(`Failed to delete '${dest}'. ${err.message}`);
  6515. }
  6516. }
  6517. }
  6518. });
  6519. }
  6520. /**
  6521. * Extract a .7z file
  6522. *
  6523. * @param file path to the .7z file
  6524. * @param dest destination directory. Optional.
  6525. * @param _7zPath path to 7zr.exe. Optional, for long path support. Most .7z archives do not have this
  6526. * problem. If your .7z archive contains very long paths, you can pass the path to 7zr.exe which will
  6527. * gracefully handle long paths. By default 7zdec.exe is used because it is a very small program and is
  6528. * bundled with the tool lib. However it does not support long paths. 7zr.exe is the reduced command line
  6529. * interface, it is smaller than the full command line interface, and it does support long paths. At the
  6530. * time of this writing, it is freely available from the LZMA SDK that is available on the 7zip website.
  6531. * Be sure to check the current license agreement. If 7zr.exe is bundled with your action, then the path
  6532. * to 7zr.exe can be pass to this function.
  6533. * @returns path to the destination directory
  6534. */
  6535. function extract7z(file, dest, _7zPath) {
  6536. return __awaiter(this, void 0, void 0, function* () {
  6537. assert_1.ok(IS_WINDOWS, 'extract7z() not supported on current OS');
  6538. assert_1.ok(file, 'parameter "file" is required');
  6539. dest = yield _createExtractFolder(dest);
  6540. const originalCwd = process.cwd();
  6541. process.chdir(dest);
  6542. if (_7zPath) {
  6543. try {
  6544. const logLevel = core.isDebug() ? '-bb1' : '-bb0';
  6545. const args = [
  6546. 'x',
  6547. logLevel,
  6548. '-bd',
  6549. '-sccUTF-8',
  6550. file
  6551. ];
  6552. const options = {
  6553. silent: true
  6554. };
  6555. yield exec_1.exec(`"${_7zPath}"`, args, options);
  6556. }
  6557. finally {
  6558. process.chdir(originalCwd);
  6559. }
  6560. }
  6561. else {
  6562. const escapedScript = path
  6563. .join(__dirname, '..', 'scripts', 'Invoke-7zdec.ps1')
  6564. .replace(/'/g, "''")
  6565. .replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  6566. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  6567. const escapedTarget = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  6568. const command = `& '${escapedScript}' -Source '${escapedFile}' -Target '${escapedTarget}'`;
  6569. const args = [
  6570. '-NoLogo',
  6571. '-Sta',
  6572. '-NoProfile',
  6573. '-NonInteractive',
  6574. '-ExecutionPolicy',
  6575. 'Unrestricted',
  6576. '-Command',
  6577. command
  6578. ];
  6579. const options = {
  6580. silent: true
  6581. };
  6582. try {
  6583. const powershellPath = yield io.which('powershell', true);
  6584. yield exec_1.exec(`"${powershellPath}"`, args, options);
  6585. }
  6586. finally {
  6587. process.chdir(originalCwd);
  6588. }
  6589. }
  6590. return dest;
  6591. });
  6592. }
  6593. exports.extract7z = extract7z;
  6594. /**
  6595. * Extract a compressed tar archive
  6596. *
  6597. * @param file path to the tar
  6598. * @param dest destination directory. Optional.
  6599. * @param flags flags for the tar command to use for extraction. Defaults to 'xz' (extracting gzipped tars). Optional.
  6600. * @returns path to the destination directory
  6601. */
  6602. function extractTar(file, dest, flags = 'xz') {
  6603. return __awaiter(this, void 0, void 0, function* () {
  6604. if (!file) {
  6605. throw new Error("parameter 'file' is required");
  6606. }
  6607. // Create dest
  6608. dest = yield _createExtractFolder(dest);
  6609. // Determine whether GNU tar
  6610. core.debug('Checking tar --version');
  6611. let versionOutput = '';
  6612. yield exec_1.exec('tar --version', [], {
  6613. ignoreReturnCode: true,
  6614. silent: true,
  6615. listeners: {
  6616. stdout: (data) => (versionOutput += data.toString()),
  6617. stderr: (data) => (versionOutput += data.toString())
  6618. }
  6619. });
  6620. core.debug(versionOutput.trim());
  6621. const isGnuTar = versionOutput.toUpperCase().includes('GNU TAR');
  6622. // Initialize args
  6623. let args;
  6624. if (flags instanceof Array) {
  6625. args = flags;
  6626. }
  6627. else {
  6628. args = [flags];
  6629. }
  6630. if (core.isDebug() && !flags.includes('v')) {
  6631. args.push('-v');
  6632. }
  6633. let destArg = dest;
  6634. let fileArg = file;
  6635. if (IS_WINDOWS && isGnuTar) {
  6636. args.push('--force-local');
  6637. destArg = dest.replace(/\\/g, '/');
  6638. // Technically only the dest needs to have `/` but for aesthetic consistency
  6639. // convert slashes in the file arg too.
  6640. fileArg = file.replace(/\\/g, '/');
  6641. }
  6642. if (isGnuTar) {
  6643. // Suppress warnings when using GNU tar to extract archives created by BSD tar
  6644. args.push('--warning=no-unknown-keyword');
  6645. args.push('--overwrite');
  6646. }
  6647. args.push('-C', destArg, '-f', fileArg);
  6648. yield exec_1.exec(`tar`, args);
  6649. return dest;
  6650. });
  6651. }
  6652. exports.extractTar = extractTar;
  6653. /**
  6654. * Extract a xar compatible archive
  6655. *
  6656. * @param file path to the archive
  6657. * @param dest destination directory. Optional.
  6658. * @param flags flags for the xar. Optional.
  6659. * @returns path to the destination directory
  6660. */
  6661. function extractXar(file, dest, flags = []) {
  6662. return __awaiter(this, void 0, void 0, function* () {
  6663. assert_1.ok(IS_MAC, 'extractXar() not supported on current OS');
  6664. assert_1.ok(file, 'parameter "file" is required');
  6665. dest = yield _createExtractFolder(dest);
  6666. let args;
  6667. if (flags instanceof Array) {
  6668. args = flags;
  6669. }
  6670. else {
  6671. args = [flags];
  6672. }
  6673. args.push('-x', '-C', dest, '-f', file);
  6674. if (core.isDebug()) {
  6675. args.push('-v');
  6676. }
  6677. const xarPath = yield io.which('xar', true);
  6678. yield exec_1.exec(`"${xarPath}"`, _unique(args));
  6679. return dest;
  6680. });
  6681. }
  6682. exports.extractXar = extractXar;
  6683. /**
  6684. * Extract a zip
  6685. *
  6686. * @param file path to the zip
  6687. * @param dest destination directory. Optional.
  6688. * @returns path to the destination directory
  6689. */
  6690. function extractZip(file, dest) {
  6691. return __awaiter(this, void 0, void 0, function* () {
  6692. if (!file) {
  6693. throw new Error("parameter 'file' is required");
  6694. }
  6695. dest = yield _createExtractFolder(dest);
  6696. if (IS_WINDOWS) {
  6697. yield extractZipWin(file, dest);
  6698. }
  6699. else {
  6700. yield extractZipNix(file, dest);
  6701. }
  6702. return dest;
  6703. });
  6704. }
  6705. exports.extractZip = extractZip;
  6706. function extractZipWin(file, dest) {
  6707. return __awaiter(this, void 0, void 0, function* () {
  6708. // build the powershell command
  6709. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  6710. const escapedDest = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  6711. const pwshPath = yield io.which('pwsh', false);
  6712. //To match the file overwrite behavior on nix systems, we use the overwrite = true flag for ExtractToDirectory
  6713. //and the -Force flag for Expand-Archive as a fallback
  6714. if (pwshPath) {
  6715. //attempt to use pwsh with ExtractToDirectory, if this fails attempt Expand-Archive
  6716. const pwshCommand = [
  6717. `$ErrorActionPreference = 'Stop' ;`,
  6718. `try { Add-Type -AssemblyName System.IO.Compression.ZipFile } catch { } ;`,
  6719. `try { [System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}', $true) }`,
  6720. `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 $_ } } ;`
  6721. ].join(' ');
  6722. const args = [
  6723. '-NoLogo',
  6724. '-NoProfile',
  6725. '-NonInteractive',
  6726. '-ExecutionPolicy',
  6727. 'Unrestricted',
  6728. '-Command',
  6729. pwshCommand
  6730. ];
  6731. core.debug(`Using pwsh at path: ${pwshPath}`);
  6732. yield exec_1.exec(`"${pwshPath}"`, args);
  6733. }
  6734. else {
  6735. const powershellCommand = [
  6736. `$ErrorActionPreference = 'Stop' ;`,
  6737. `try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ;`,
  6738. `if ((Get-Command -Name Expand-Archive -Module Microsoft.PowerShell.Archive -ErrorAction Ignore)) { Expand-Archive -LiteralPath '${escapedFile}' -DestinationPath '${escapedDest}' -Force }`,
  6739. `else {[System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}', $true) }`
  6740. ].join(' ');
  6741. const args = [
  6742. '-NoLogo',
  6743. '-Sta',
  6744. '-NoProfile',
  6745. '-NonInteractive',
  6746. '-ExecutionPolicy',
  6747. 'Unrestricted',
  6748. '-Command',
  6749. powershellCommand
  6750. ];
  6751. const powershellPath = yield io.which('powershell', true);
  6752. core.debug(`Using powershell at path: ${powershellPath}`);
  6753. yield exec_1.exec(`"${powershellPath}"`, args);
  6754. }
  6755. });
  6756. }
  6757. function extractZipNix(file, dest) {
  6758. return __awaiter(this, void 0, void 0, function* () {
  6759. const unzipPath = yield io.which('unzip', true);
  6760. const args = [file];
  6761. if (!core.isDebug()) {
  6762. args.unshift('-q');
  6763. }
  6764. args.unshift('-o'); //overwrite with -o, otherwise a prompt is shown which freezes the run
  6765. yield exec_1.exec(`"${unzipPath}"`, args, { cwd: dest });
  6766. });
  6767. }
  6768. /**
  6769. * Caches a directory and installs it into the tool cacheDir
  6770. *
  6771. * @param sourceDir the directory to cache into tools
  6772. * @param tool tool name
  6773. * @param version version of the tool. semver format
  6774. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  6775. */
  6776. function cacheDir(sourceDir, tool, version, arch) {
  6777. return __awaiter(this, void 0, void 0, function* () {
  6778. version = semver.clean(version) || version;
  6779. arch = arch || os.arch();
  6780. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  6781. core.debug(`source dir: ${sourceDir}`);
  6782. if (!fs.statSync(sourceDir).isDirectory()) {
  6783. throw new Error('sourceDir is not a directory');
  6784. }
  6785. // Create the tool dir
  6786. const destPath = yield _createToolPath(tool, version, arch);
  6787. // copy each child item. do not move. move can fail on Windows
  6788. // due to anti-virus software having an open handle on a file.
  6789. for (const itemName of fs.readdirSync(sourceDir)) {
  6790. const s = path.join(sourceDir, itemName);
  6791. yield io.cp(s, destPath, { recursive: true });
  6792. }
  6793. // write .complete
  6794. _completeToolPath(tool, version, arch);
  6795. return destPath;
  6796. });
  6797. }
  6798. exports.cacheDir = cacheDir;
  6799. /**
  6800. * Caches a downloaded file (GUID) and installs it
  6801. * into the tool cache with a given targetName
  6802. *
  6803. * @param sourceFile the file to cache into tools. Typically a result of downloadTool which is a guid.
  6804. * @param targetFile the name of the file name in the tools directory
  6805. * @param tool tool name
  6806. * @param version version of the tool. semver format
  6807. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  6808. */
  6809. function cacheFile(sourceFile, targetFile, tool, version, arch) {
  6810. return __awaiter(this, void 0, void 0, function* () {
  6811. version = semver.clean(version) || version;
  6812. arch = arch || os.arch();
  6813. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  6814. core.debug(`source file: ${sourceFile}`);
  6815. if (!fs.statSync(sourceFile).isFile()) {
  6816. throw new Error('sourceFile is not a file');
  6817. }
  6818. // create the tool dir
  6819. const destFolder = yield _createToolPath(tool, version, arch);
  6820. // copy instead of move. move can fail on Windows due to
  6821. // anti-virus software having an open handle on a file.
  6822. const destPath = path.join(destFolder, targetFile);
  6823. core.debug(`destination file ${destPath}`);
  6824. yield io.cp(sourceFile, destPath);
  6825. // write .complete
  6826. _completeToolPath(tool, version, arch);
  6827. return destFolder;
  6828. });
  6829. }
  6830. exports.cacheFile = cacheFile;
  6831. /**
  6832. * Finds the path to a tool version in the local installed tool cache
  6833. *
  6834. * @param toolName name of the tool
  6835. * @param versionSpec version of the tool
  6836. * @param arch optional arch. defaults to arch of computer
  6837. */
  6838. function find(toolName, versionSpec, arch) {
  6839. if (!toolName) {
  6840. throw new Error('toolName parameter is required');
  6841. }
  6842. if (!versionSpec) {
  6843. throw new Error('versionSpec parameter is required');
  6844. }
  6845. arch = arch || os.arch();
  6846. // attempt to resolve an explicit version
  6847. if (!isExplicitVersion(versionSpec)) {
  6848. const localVersions = findAllVersions(toolName, arch);
  6849. const match = evaluateVersions(localVersions, versionSpec);
  6850. versionSpec = match;
  6851. }
  6852. // check for the explicit version in the cache
  6853. let toolPath = '';
  6854. if (versionSpec) {
  6855. versionSpec = semver.clean(versionSpec) || '';
  6856. const cachePath = path.join(_getCacheDirectory(), toolName, versionSpec, arch);
  6857. core.debug(`checking cache: ${cachePath}`);
  6858. if (fs.existsSync(cachePath) && fs.existsSync(`${cachePath}.complete`)) {
  6859. core.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`);
  6860. toolPath = cachePath;
  6861. }
  6862. else {
  6863. core.debug('not found');
  6864. }
  6865. }
  6866. return toolPath;
  6867. }
  6868. exports.find = find;
  6869. /**
  6870. * Finds the paths to all versions of a tool that are installed in the local tool cache
  6871. *
  6872. * @param toolName name of the tool
  6873. * @param arch optional arch. defaults to arch of computer
  6874. */
  6875. function findAllVersions(toolName, arch) {
  6876. const versions = [];
  6877. arch = arch || os.arch();
  6878. const toolPath = path.join(_getCacheDirectory(), toolName);
  6879. if (fs.existsSync(toolPath)) {
  6880. const children = fs.readdirSync(toolPath);
  6881. for (const child of children) {
  6882. if (isExplicitVersion(child)) {
  6883. const fullPath = path.join(toolPath, child, arch || '');
  6884. if (fs.existsSync(fullPath) && fs.existsSync(`${fullPath}.complete`)) {
  6885. versions.push(child);
  6886. }
  6887. }
  6888. }
  6889. }
  6890. return versions;
  6891. }
  6892. exports.findAllVersions = findAllVersions;
  6893. function getManifestFromRepo(owner, repo, auth, branch = 'master') {
  6894. return __awaiter(this, void 0, void 0, function* () {
  6895. let releases = [];
  6896. const treeUrl = `https://api.github.com/repos/${owner}/${repo}/git/trees/${branch}`;
  6897. const http = new httpm.HttpClient('tool-cache');
  6898. const headers = {};
  6899. if (auth) {
  6900. core.debug('set auth');
  6901. headers.authorization = auth;
  6902. }
  6903. const response = yield http.getJson(treeUrl, headers);
  6904. if (!response.result) {
  6905. return releases;
  6906. }
  6907. let manifestUrl = '';
  6908. for (const item of response.result.tree) {
  6909. if (item.path === 'versions-manifest.json') {
  6910. manifestUrl = item.url;
  6911. break;
  6912. }
  6913. }
  6914. headers['accept'] = 'application/vnd.github.VERSION.raw';
  6915. let versionsRaw = yield (yield http.get(manifestUrl, headers)).readBody();
  6916. if (versionsRaw) {
  6917. // shouldn't be needed but protects against invalid json saved with BOM
  6918. versionsRaw = versionsRaw.replace(/^\uFEFF/, '');
  6919. try {
  6920. releases = JSON.parse(versionsRaw);
  6921. }
  6922. catch (_a) {
  6923. core.debug('Invalid json');
  6924. }
  6925. }
  6926. return releases;
  6927. });
  6928. }
  6929. exports.getManifestFromRepo = getManifestFromRepo;
  6930. function findFromManifest(versionSpec, stable, manifest, archFilter = os.arch()) {
  6931. return __awaiter(this, void 0, void 0, function* () {
  6932. // wrap the internal impl
  6933. const match = yield mm._findMatch(versionSpec, stable, manifest, archFilter);
  6934. return match;
  6935. });
  6936. }
  6937. exports.findFromManifest = findFromManifest;
  6938. function _createExtractFolder(dest) {
  6939. return __awaiter(this, void 0, void 0, function* () {
  6940. if (!dest) {
  6941. // create a temp dir
  6942. dest = path.join(_getTempDirectory(), v4_1.default());
  6943. }
  6944. yield io.mkdirP(dest);
  6945. return dest;
  6946. });
  6947. }
  6948. function _createToolPath(tool, version, arch) {
  6949. return __awaiter(this, void 0, void 0, function* () {
  6950. const folderPath = path.join(_getCacheDirectory(), tool, semver.clean(version) || version, arch || '');
  6951. core.debug(`destination ${folderPath}`);
  6952. const markerPath = `${folderPath}.complete`;
  6953. yield io.rmRF(folderPath);
  6954. yield io.rmRF(markerPath);
  6955. yield io.mkdirP(folderPath);
  6956. return folderPath;
  6957. });
  6958. }
  6959. function _completeToolPath(tool, version, arch) {
  6960. const folderPath = path.join(_getCacheDirectory(), tool, semver.clean(version) || version, arch || '');
  6961. const markerPath = `${folderPath}.complete`;
  6962. fs.writeFileSync(markerPath, '');
  6963. core.debug('finished caching tool');
  6964. }
  6965. /**
  6966. * Check if version string is explicit
  6967. *
  6968. * @param versionSpec version string to check
  6969. */
  6970. function isExplicitVersion(versionSpec) {
  6971. const c = semver.clean(versionSpec) || '';
  6972. core.debug(`isExplicit: ${c}`);
  6973. const valid = semver.valid(c) != null;
  6974. core.debug(`explicit? ${valid}`);
  6975. return valid;
  6976. }
  6977. exports.isExplicitVersion = isExplicitVersion;
  6978. /**
  6979. * Get the highest satisfiying semantic version in `versions` which satisfies `versionSpec`
  6980. *
  6981. * @param versions array of versions to evaluate
  6982. * @param versionSpec semantic version spec to satisfy
  6983. */
  6984. function evaluateVersions(versions, versionSpec) {
  6985. let version = '';
  6986. core.debug(`evaluating ${versions.length} versions`);
  6987. versions = versions.sort((a, b) => {
  6988. if (semver.gt(a, b)) {
  6989. return 1;
  6990. }
  6991. return -1;
  6992. });
  6993. for (let i = versions.length - 1; i >= 0; i--) {
  6994. const potential = versions[i];
  6995. const satisfied = semver.satisfies(potential, versionSpec);
  6996. if (satisfied) {
  6997. version = potential;
  6998. break;
  6999. }
  7000. }
  7001. if (version) {
  7002. core.debug(`matched: ${version}`);
  7003. }
  7004. else {
  7005. core.debug('match not found');
  7006. }
  7007. return version;
  7008. }
  7009. exports.evaluateVersions = evaluateVersions;
  7010. /**
  7011. * Gets RUNNER_TOOL_CACHE
  7012. */
  7013. function _getCacheDirectory() {
  7014. const cacheDirectory = process.env['RUNNER_TOOL_CACHE'] || '';
  7015. assert_1.ok(cacheDirectory, 'Expected RUNNER_TOOL_CACHE to be defined');
  7016. return cacheDirectory;
  7017. }
  7018. /**
  7019. * Gets RUNNER_TEMP
  7020. */
  7021. function _getTempDirectory() {
  7022. const tempDirectory = process.env['RUNNER_TEMP'] || '';
  7023. assert_1.ok(tempDirectory, 'Expected RUNNER_TEMP to be defined');
  7024. return tempDirectory;
  7025. }
  7026. /**
  7027. * Gets a global variable
  7028. */
  7029. function _getGlobal(key, defaultValue) {
  7030. /* eslint-disable @typescript-eslint/no-explicit-any */
  7031. const value = global[key];
  7032. /* eslint-enable @typescript-eslint/no-explicit-any */
  7033. return value !== undefined ? value : defaultValue;
  7034. }
  7035. /**
  7036. * Returns an array of unique values.
  7037. * @param values Values to make unique.
  7038. */
  7039. function _unique(values) {
  7040. return Array.from(new Set(values));
  7041. }
  7042. //# sourceMappingURL=tool-cache.js.map
  7043. /***/ }),
  7044. /***/ 7701:
  7045. /***/ ((module) => {
  7046. /**
  7047. * Convert array of 16 byte values to UUID string format of the form:
  7048. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  7049. */
  7050. var byteToHex = [];
  7051. for (var i = 0; i < 256; ++i) {
  7052. byteToHex[i] = (i + 0x100).toString(16).substr(1);
  7053. }
  7054. function bytesToUuid(buf, offset) {
  7055. var i = offset || 0;
  7056. var bth = byteToHex;
  7057. // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
  7058. return ([
  7059. bth[buf[i++]], bth[buf[i++]],
  7060. bth[buf[i++]], bth[buf[i++]], '-',
  7061. bth[buf[i++]], bth[buf[i++]], '-',
  7062. bth[buf[i++]], bth[buf[i++]], '-',
  7063. bth[buf[i++]], bth[buf[i++]], '-',
  7064. bth[buf[i++]], bth[buf[i++]],
  7065. bth[buf[i++]], bth[buf[i++]],
  7066. bth[buf[i++]], bth[buf[i++]]
  7067. ]).join('');
  7068. }
  7069. module.exports = bytesToUuid;
  7070. /***/ }),
  7071. /***/ 7269:
  7072. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  7073. // Unique ID creation requires a high quality random # generator. In node.js
  7074. // this is pretty straight-forward - we use the crypto API.
  7075. var crypto = __nccwpck_require__(6113);
  7076. module.exports = function nodeRNG() {
  7077. return crypto.randomBytes(16);
  7078. };
  7079. /***/ }),
  7080. /***/ 7468:
  7081. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  7082. var rng = __nccwpck_require__(7269);
  7083. var bytesToUuid = __nccwpck_require__(7701);
  7084. function v4(options, buf, offset) {
  7085. var i = buf && offset || 0;
  7086. if (typeof(options) == 'string') {
  7087. buf = options === 'binary' ? new Array(16) : null;
  7088. options = null;
  7089. }
  7090. options = options || {};
  7091. var rnds = options.random || (options.rng || rng)();
  7092. // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  7093. rnds[6] = (rnds[6] & 0x0f) | 0x40;
  7094. rnds[8] = (rnds[8] & 0x3f) | 0x80;
  7095. // Copy bytes to buffer, if provided
  7096. if (buf) {
  7097. for (var ii = 0; ii < 16; ++ii) {
  7098. buf[i + ii] = rnds[ii];
  7099. }
  7100. }
  7101. return buf || bytesToUuid(rnds);
  7102. }
  7103. module.exports = v4;
  7104. /***/ }),
  7105. /***/ 334:
  7106. /***/ ((module) => {
  7107. "use strict";
  7108. var __defProp = Object.defineProperty;
  7109. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  7110. var __getOwnPropNames = Object.getOwnPropertyNames;
  7111. var __hasOwnProp = Object.prototype.hasOwnProperty;
  7112. var __export = (target, all) => {
  7113. for (var name in all)
  7114. __defProp(target, name, { get: all[name], enumerable: true });
  7115. };
  7116. var __copyProps = (to, from, except, desc) => {
  7117. if (from && typeof from === "object" || typeof from === "function") {
  7118. for (let key of __getOwnPropNames(from))
  7119. if (!__hasOwnProp.call(to, key) && key !== except)
  7120. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  7121. }
  7122. return to;
  7123. };
  7124. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  7125. // pkg/dist-src/index.js
  7126. var dist_src_exports = {};
  7127. __export(dist_src_exports, {
  7128. createTokenAuth: () => createTokenAuth
  7129. });
  7130. module.exports = __toCommonJS(dist_src_exports);
  7131. // pkg/dist-src/auth.js
  7132. var REGEX_IS_INSTALLATION_LEGACY = /^v1\./;
  7133. var REGEX_IS_INSTALLATION = /^ghs_/;
  7134. var REGEX_IS_USER_TO_SERVER = /^ghu_/;
  7135. async function auth(token) {
  7136. const isApp = token.split(/\./).length === 3;
  7137. const isInstallation = REGEX_IS_INSTALLATION_LEGACY.test(token) || REGEX_IS_INSTALLATION.test(token);
  7138. const isUserToServer = REGEX_IS_USER_TO_SERVER.test(token);
  7139. const tokenType = isApp ? "app" : isInstallation ? "installation" : isUserToServer ? "user-to-server" : "oauth";
  7140. return {
  7141. type: "token",
  7142. token,
  7143. tokenType
  7144. };
  7145. }
  7146. // pkg/dist-src/with-authorization-prefix.js
  7147. function withAuthorizationPrefix(token) {
  7148. if (token.split(/\./).length === 3) {
  7149. return `bearer ${token}`;
  7150. }
  7151. return `token ${token}`;
  7152. }
  7153. // pkg/dist-src/hook.js
  7154. async function hook(token, request, route, parameters) {
  7155. const endpoint = request.endpoint.merge(
  7156. route,
  7157. parameters
  7158. );
  7159. endpoint.headers.authorization = withAuthorizationPrefix(token);
  7160. return request(endpoint);
  7161. }
  7162. // pkg/dist-src/index.js
  7163. var createTokenAuth = function createTokenAuth2(token) {
  7164. if (!token) {
  7165. throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");
  7166. }
  7167. if (typeof token !== "string") {
  7168. throw new Error(
  7169. "[@octokit/auth-token] Token passed to createTokenAuth is not a string"
  7170. );
  7171. }
  7172. token = token.replace(/^(token|bearer) +/i, "");
  7173. return Object.assign(auth.bind(null, token), {
  7174. hook: hook.bind(null, token)
  7175. });
  7176. };
  7177. // Annotate the CommonJS export names for ESM import in node:
  7178. 0 && (0);
  7179. /***/ }),
  7180. /***/ 6762:
  7181. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  7182. "use strict";
  7183. var __defProp = Object.defineProperty;
  7184. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  7185. var __getOwnPropNames = Object.getOwnPropertyNames;
  7186. var __hasOwnProp = Object.prototype.hasOwnProperty;
  7187. var __export = (target, all) => {
  7188. for (var name in all)
  7189. __defProp(target, name, { get: all[name], enumerable: true });
  7190. };
  7191. var __copyProps = (to, from, except, desc) => {
  7192. if (from && typeof from === "object" || typeof from === "function") {
  7193. for (let key of __getOwnPropNames(from))
  7194. if (!__hasOwnProp.call(to, key) && key !== except)
  7195. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  7196. }
  7197. return to;
  7198. };
  7199. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  7200. // pkg/dist-src/index.js
  7201. var dist_src_exports = {};
  7202. __export(dist_src_exports, {
  7203. Octokit: () => Octokit
  7204. });
  7205. module.exports = __toCommonJS(dist_src_exports);
  7206. var import_universal_user_agent = __nccwpck_require__(5030);
  7207. var import_before_after_hook = __nccwpck_require__(3682);
  7208. var import_request = __nccwpck_require__(6234);
  7209. var import_graphql = __nccwpck_require__(8467);
  7210. var import_auth_token = __nccwpck_require__(334);
  7211. // pkg/dist-src/version.js
  7212. var VERSION = "5.2.0";
  7213. // pkg/dist-src/index.js
  7214. var noop = () => {
  7215. };
  7216. var consoleWarn = console.warn.bind(console);
  7217. var consoleError = console.error.bind(console);
  7218. var userAgentTrail = `octokit-core.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`;
  7219. var Octokit = class {
  7220. static {
  7221. this.VERSION = VERSION;
  7222. }
  7223. static defaults(defaults) {
  7224. const OctokitWithDefaults = class extends this {
  7225. constructor(...args) {
  7226. const options = args[0] || {};
  7227. if (typeof defaults === "function") {
  7228. super(defaults(options));
  7229. return;
  7230. }
  7231. super(
  7232. Object.assign(
  7233. {},
  7234. defaults,
  7235. options,
  7236. options.userAgent && defaults.userAgent ? {
  7237. userAgent: `${options.userAgent} ${defaults.userAgent}`
  7238. } : null
  7239. )
  7240. );
  7241. }
  7242. };
  7243. return OctokitWithDefaults;
  7244. }
  7245. static {
  7246. this.plugins = [];
  7247. }
  7248. /**
  7249. * Attach a plugin (or many) to your Octokit instance.
  7250. *
  7251. * @example
  7252. * const API = Octokit.plugin(plugin1, plugin2, plugin3, ...)
  7253. */
  7254. static plugin(...newPlugins) {
  7255. const currentPlugins = this.plugins;
  7256. const NewOctokit = class extends this {
  7257. static {
  7258. this.plugins = currentPlugins.concat(
  7259. newPlugins.filter((plugin) => !currentPlugins.includes(plugin))
  7260. );
  7261. }
  7262. };
  7263. return NewOctokit;
  7264. }
  7265. constructor(options = {}) {
  7266. const hook = new import_before_after_hook.Collection();
  7267. const requestDefaults = {
  7268. baseUrl: import_request.request.endpoint.DEFAULTS.baseUrl,
  7269. headers: {},
  7270. request: Object.assign({}, options.request, {
  7271. // @ts-ignore internal usage only, no need to type
  7272. hook: hook.bind(null, "request")
  7273. }),
  7274. mediaType: {
  7275. previews: [],
  7276. format: ""
  7277. }
  7278. };
  7279. requestDefaults.headers["user-agent"] = options.userAgent ? `${options.userAgent} ${userAgentTrail}` : userAgentTrail;
  7280. if (options.baseUrl) {
  7281. requestDefaults.baseUrl = options.baseUrl;
  7282. }
  7283. if (options.previews) {
  7284. requestDefaults.mediaType.previews = options.previews;
  7285. }
  7286. if (options.timeZone) {
  7287. requestDefaults.headers["time-zone"] = options.timeZone;
  7288. }
  7289. this.request = import_request.request.defaults(requestDefaults);
  7290. this.graphql = (0, import_graphql.withCustomRequest)(this.request).defaults(requestDefaults);
  7291. this.log = Object.assign(
  7292. {
  7293. debug: noop,
  7294. info: noop,
  7295. warn: consoleWarn,
  7296. error: consoleError
  7297. },
  7298. options.log
  7299. );
  7300. this.hook = hook;
  7301. if (!options.authStrategy) {
  7302. if (!options.auth) {
  7303. this.auth = async () => ({
  7304. type: "unauthenticated"
  7305. });
  7306. } else {
  7307. const auth = (0, import_auth_token.createTokenAuth)(options.auth);
  7308. hook.wrap("request", auth.hook);
  7309. this.auth = auth;
  7310. }
  7311. } else {
  7312. const { authStrategy, ...otherOptions } = options;
  7313. const auth = authStrategy(
  7314. Object.assign(
  7315. {
  7316. request: this.request,
  7317. log: this.log,
  7318. // we pass the current octokit instance as well as its constructor options
  7319. // to allow for authentication strategies that return a new octokit instance
  7320. // that shares the same internal state as the current one. The original
  7321. // requirement for this was the "event-octokit" authentication strategy
  7322. // of https://github.com/probot/octokit-auth-probot.
  7323. octokit: this,
  7324. octokitOptions: otherOptions
  7325. },
  7326. options.auth
  7327. )
  7328. );
  7329. hook.wrap("request", auth.hook);
  7330. this.auth = auth;
  7331. }
  7332. const classConstructor = this.constructor;
  7333. for (let i = 0; i < classConstructor.plugins.length; ++i) {
  7334. Object.assign(this, classConstructor.plugins[i](this, options));
  7335. }
  7336. }
  7337. };
  7338. // Annotate the CommonJS export names for ESM import in node:
  7339. 0 && (0);
  7340. /***/ }),
  7341. /***/ 9440:
  7342. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  7343. "use strict";
  7344. var __defProp = Object.defineProperty;
  7345. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  7346. var __getOwnPropNames = Object.getOwnPropertyNames;
  7347. var __hasOwnProp = Object.prototype.hasOwnProperty;
  7348. var __export = (target, all) => {
  7349. for (var name in all)
  7350. __defProp(target, name, { get: all[name], enumerable: true });
  7351. };
  7352. var __copyProps = (to, from, except, desc) => {
  7353. if (from && typeof from === "object" || typeof from === "function") {
  7354. for (let key of __getOwnPropNames(from))
  7355. if (!__hasOwnProp.call(to, key) && key !== except)
  7356. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  7357. }
  7358. return to;
  7359. };
  7360. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  7361. // pkg/dist-src/index.js
  7362. var dist_src_exports = {};
  7363. __export(dist_src_exports, {
  7364. endpoint: () => endpoint
  7365. });
  7366. module.exports = __toCommonJS(dist_src_exports);
  7367. // pkg/dist-src/defaults.js
  7368. var import_universal_user_agent = __nccwpck_require__(5030);
  7369. // pkg/dist-src/version.js
  7370. var VERSION = "9.0.5";
  7371. // pkg/dist-src/defaults.js
  7372. var userAgent = `octokit-endpoint.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`;
  7373. var DEFAULTS = {
  7374. method: "GET",
  7375. baseUrl: "https://api.github.com",
  7376. headers: {
  7377. accept: "application/vnd.github.v3+json",
  7378. "user-agent": userAgent
  7379. },
  7380. mediaType: {
  7381. format: ""
  7382. }
  7383. };
  7384. // pkg/dist-src/util/lowercase-keys.js
  7385. function lowercaseKeys(object) {
  7386. if (!object) {
  7387. return {};
  7388. }
  7389. return Object.keys(object).reduce((newObj, key) => {
  7390. newObj[key.toLowerCase()] = object[key];
  7391. return newObj;
  7392. }, {});
  7393. }
  7394. // pkg/dist-src/util/is-plain-object.js
  7395. function isPlainObject(value) {
  7396. if (typeof value !== "object" || value === null)
  7397. return false;
  7398. if (Object.prototype.toString.call(value) !== "[object Object]")
  7399. return false;
  7400. const proto = Object.getPrototypeOf(value);
  7401. if (proto === null)
  7402. return true;
  7403. const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
  7404. return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
  7405. }
  7406. // pkg/dist-src/util/merge-deep.js
  7407. function mergeDeep(defaults, options) {
  7408. const result = Object.assign({}, defaults);
  7409. Object.keys(options).forEach((key) => {
  7410. if (isPlainObject(options[key])) {
  7411. if (!(key in defaults))
  7412. Object.assign(result, { [key]: options[key] });
  7413. else
  7414. result[key] = mergeDeep(defaults[key], options[key]);
  7415. } else {
  7416. Object.assign(result, { [key]: options[key] });
  7417. }
  7418. });
  7419. return result;
  7420. }
  7421. // pkg/dist-src/util/remove-undefined-properties.js
  7422. function removeUndefinedProperties(obj) {
  7423. for (const key in obj) {
  7424. if (obj[key] === void 0) {
  7425. delete obj[key];
  7426. }
  7427. }
  7428. return obj;
  7429. }
  7430. // pkg/dist-src/merge.js
  7431. function merge(defaults, route, options) {
  7432. if (typeof route === "string") {
  7433. let [method, url] = route.split(" ");
  7434. options = Object.assign(url ? { method, url } : { url: method }, options);
  7435. } else {
  7436. options = Object.assign({}, route);
  7437. }
  7438. options.headers = lowercaseKeys(options.headers);
  7439. removeUndefinedProperties(options);
  7440. removeUndefinedProperties(options.headers);
  7441. const mergedOptions = mergeDeep(defaults || {}, options);
  7442. if (options.url === "/graphql") {
  7443. if (defaults && defaults.mediaType.previews?.length) {
  7444. mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(
  7445. (preview) => !mergedOptions.mediaType.previews.includes(preview)
  7446. ).concat(mergedOptions.mediaType.previews);
  7447. }
  7448. mergedOptions.mediaType.previews = (mergedOptions.mediaType.previews || []).map((preview) => preview.replace(/-preview/, ""));
  7449. }
  7450. return mergedOptions;
  7451. }
  7452. // pkg/dist-src/util/add-query-parameters.js
  7453. function addQueryParameters(url, parameters) {
  7454. const separator = /\?/.test(url) ? "&" : "?";
  7455. const names = Object.keys(parameters);
  7456. if (names.length === 0) {
  7457. return url;
  7458. }
  7459. return url + separator + names.map((name) => {
  7460. if (name === "q") {
  7461. return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+");
  7462. }
  7463. return `${name}=${encodeURIComponent(parameters[name])}`;
  7464. }).join("&");
  7465. }
  7466. // pkg/dist-src/util/extract-url-variable-names.js
  7467. var urlVariableRegex = /\{[^}]+\}/g;
  7468. function removeNonChars(variableName) {
  7469. return variableName.replace(/^\W+|\W+$/g, "").split(/,/);
  7470. }
  7471. function extractUrlVariableNames(url) {
  7472. const matches = url.match(urlVariableRegex);
  7473. if (!matches) {
  7474. return [];
  7475. }
  7476. return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
  7477. }
  7478. // pkg/dist-src/util/omit.js
  7479. function omit(object, keysToOmit) {
  7480. const result = { __proto__: null };
  7481. for (const key of Object.keys(object)) {
  7482. if (keysToOmit.indexOf(key) === -1) {
  7483. result[key] = object[key];
  7484. }
  7485. }
  7486. return result;
  7487. }
  7488. // pkg/dist-src/util/url-template.js
  7489. function encodeReserved(str) {
  7490. return str.split(/(%[0-9A-Fa-f]{2})/g).map(function(part) {
  7491. if (!/%[0-9A-Fa-f]/.test(part)) {
  7492. part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]");
  7493. }
  7494. return part;
  7495. }).join("");
  7496. }
  7497. function encodeUnreserved(str) {
  7498. return encodeURIComponent(str).replace(/[!'()*]/g, function(c) {
  7499. return "%" + c.charCodeAt(0).toString(16).toUpperCase();
  7500. });
  7501. }
  7502. function encodeValue(operator, value, key) {
  7503. value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value);
  7504. if (key) {
  7505. return encodeUnreserved(key) + "=" + value;
  7506. } else {
  7507. return value;
  7508. }
  7509. }
  7510. function isDefined(value) {
  7511. return value !== void 0 && value !== null;
  7512. }
  7513. function isKeyOperator(operator) {
  7514. return operator === ";" || operator === "&" || operator === "?";
  7515. }
  7516. function getValues(context, operator, key, modifier) {
  7517. var value = context[key], result = [];
  7518. if (isDefined(value) && value !== "") {
  7519. if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
  7520. value = value.toString();
  7521. if (modifier && modifier !== "*") {
  7522. value = value.substring(0, parseInt(modifier, 10));
  7523. }
  7524. result.push(
  7525. encodeValue(operator, value, isKeyOperator(operator) ? key : "")
  7526. );
  7527. } else {
  7528. if (modifier === "*") {
  7529. if (Array.isArray(value)) {
  7530. value.filter(isDefined).forEach(function(value2) {
  7531. result.push(
  7532. encodeValue(operator, value2, isKeyOperator(operator) ? key : "")
  7533. );
  7534. });
  7535. } else {
  7536. Object.keys(value).forEach(function(k) {
  7537. if (isDefined(value[k])) {
  7538. result.push(encodeValue(operator, value[k], k));
  7539. }
  7540. });
  7541. }
  7542. } else {
  7543. const tmp = [];
  7544. if (Array.isArray(value)) {
  7545. value.filter(isDefined).forEach(function(value2) {
  7546. tmp.push(encodeValue(operator, value2));
  7547. });
  7548. } else {
  7549. Object.keys(value).forEach(function(k) {
  7550. if (isDefined(value[k])) {
  7551. tmp.push(encodeUnreserved(k));
  7552. tmp.push(encodeValue(operator, value[k].toString()));
  7553. }
  7554. });
  7555. }
  7556. if (isKeyOperator(operator)) {
  7557. result.push(encodeUnreserved(key) + "=" + tmp.join(","));
  7558. } else if (tmp.length !== 0) {
  7559. result.push(tmp.join(","));
  7560. }
  7561. }
  7562. }
  7563. } else {
  7564. if (operator === ";") {
  7565. if (isDefined(value)) {
  7566. result.push(encodeUnreserved(key));
  7567. }
  7568. } else if (value === "" && (operator === "&" || operator === "?")) {
  7569. result.push(encodeUnreserved(key) + "=");
  7570. } else if (value === "") {
  7571. result.push("");
  7572. }
  7573. }
  7574. return result;
  7575. }
  7576. function parseUrl(template) {
  7577. return {
  7578. expand: expand.bind(null, template)
  7579. };
  7580. }
  7581. function expand(template, context) {
  7582. var operators = ["+", "#", ".", "/", ";", "?", "&"];
  7583. template = template.replace(
  7584. /\{([^\{\}]+)\}|([^\{\}]+)/g,
  7585. function(_, expression, literal) {
  7586. if (expression) {
  7587. let operator = "";
  7588. const values = [];
  7589. if (operators.indexOf(expression.charAt(0)) !== -1) {
  7590. operator = expression.charAt(0);
  7591. expression = expression.substr(1);
  7592. }
  7593. expression.split(/,/g).forEach(function(variable) {
  7594. var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
  7595. values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
  7596. });
  7597. if (operator && operator !== "+") {
  7598. var separator = ",";
  7599. if (operator === "?") {
  7600. separator = "&";
  7601. } else if (operator !== "#") {
  7602. separator = operator;
  7603. }
  7604. return (values.length !== 0 ? operator : "") + values.join(separator);
  7605. } else {
  7606. return values.join(",");
  7607. }
  7608. } else {
  7609. return encodeReserved(literal);
  7610. }
  7611. }
  7612. );
  7613. if (template === "/") {
  7614. return template;
  7615. } else {
  7616. return template.replace(/\/$/, "");
  7617. }
  7618. }
  7619. // pkg/dist-src/parse.js
  7620. function parse(options) {
  7621. let method = options.method.toUpperCase();
  7622. let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{$1}");
  7623. let headers = Object.assign({}, options.headers);
  7624. let body;
  7625. let parameters = omit(options, [
  7626. "method",
  7627. "baseUrl",
  7628. "url",
  7629. "headers",
  7630. "request",
  7631. "mediaType"
  7632. ]);
  7633. const urlVariableNames = extractUrlVariableNames(url);
  7634. url = parseUrl(url).expand(parameters);
  7635. if (!/^http/.test(url)) {
  7636. url = options.baseUrl + url;
  7637. }
  7638. const omittedParameters = Object.keys(options).filter((option) => urlVariableNames.includes(option)).concat("baseUrl");
  7639. const remainingParameters = omit(parameters, omittedParameters);
  7640. const isBinaryRequest = /application\/octet-stream/i.test(headers.accept);
  7641. if (!isBinaryRequest) {
  7642. if (options.mediaType.format) {
  7643. headers.accept = headers.accept.split(/,/).map(
  7644. (format) => format.replace(
  7645. /application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,
  7646. `application/vnd$1$2.${options.mediaType.format}`
  7647. )
  7648. ).join(",");
  7649. }
  7650. if (url.endsWith("/graphql")) {
  7651. if (options.mediaType.previews?.length) {
  7652. const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || [];
  7653. headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map((preview) => {
  7654. const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json";
  7655. return `application/vnd.github.${preview}-preview${format}`;
  7656. }).join(",");
  7657. }
  7658. }
  7659. }
  7660. if (["GET", "HEAD"].includes(method)) {
  7661. url = addQueryParameters(url, remainingParameters);
  7662. } else {
  7663. if ("data" in remainingParameters) {
  7664. body = remainingParameters.data;
  7665. } else {
  7666. if (Object.keys(remainingParameters).length) {
  7667. body = remainingParameters;
  7668. }
  7669. }
  7670. }
  7671. if (!headers["content-type"] && typeof body !== "undefined") {
  7672. headers["content-type"] = "application/json; charset=utf-8";
  7673. }
  7674. if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") {
  7675. body = "";
  7676. }
  7677. return Object.assign(
  7678. { method, url, headers },
  7679. typeof body !== "undefined" ? { body } : null,
  7680. options.request ? { request: options.request } : null
  7681. );
  7682. }
  7683. // pkg/dist-src/endpoint-with-defaults.js
  7684. function endpointWithDefaults(defaults, route, options) {
  7685. return parse(merge(defaults, route, options));
  7686. }
  7687. // pkg/dist-src/with-defaults.js
  7688. function withDefaults(oldDefaults, newDefaults) {
  7689. const DEFAULTS2 = merge(oldDefaults, newDefaults);
  7690. const endpoint2 = endpointWithDefaults.bind(null, DEFAULTS2);
  7691. return Object.assign(endpoint2, {
  7692. DEFAULTS: DEFAULTS2,
  7693. defaults: withDefaults.bind(null, DEFAULTS2),
  7694. merge: merge.bind(null, DEFAULTS2),
  7695. parse
  7696. });
  7697. }
  7698. // pkg/dist-src/index.js
  7699. var endpoint = withDefaults(null, DEFAULTS);
  7700. // Annotate the CommonJS export names for ESM import in node:
  7701. 0 && (0);
  7702. /***/ }),
  7703. /***/ 8467:
  7704. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  7705. "use strict";
  7706. var __defProp = Object.defineProperty;
  7707. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  7708. var __getOwnPropNames = Object.getOwnPropertyNames;
  7709. var __hasOwnProp = Object.prototype.hasOwnProperty;
  7710. var __export = (target, all) => {
  7711. for (var name in all)
  7712. __defProp(target, name, { get: all[name], enumerable: true });
  7713. };
  7714. var __copyProps = (to, from, except, desc) => {
  7715. if (from && typeof from === "object" || typeof from === "function") {
  7716. for (let key of __getOwnPropNames(from))
  7717. if (!__hasOwnProp.call(to, key) && key !== except)
  7718. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  7719. }
  7720. return to;
  7721. };
  7722. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  7723. // pkg/dist-src/index.js
  7724. var dist_src_exports = {};
  7725. __export(dist_src_exports, {
  7726. GraphqlResponseError: () => GraphqlResponseError,
  7727. graphql: () => graphql2,
  7728. withCustomRequest: () => withCustomRequest
  7729. });
  7730. module.exports = __toCommonJS(dist_src_exports);
  7731. var import_request3 = __nccwpck_require__(6234);
  7732. var import_universal_user_agent = __nccwpck_require__(5030);
  7733. // pkg/dist-src/version.js
  7734. var VERSION = "7.1.0";
  7735. // pkg/dist-src/with-defaults.js
  7736. var import_request2 = __nccwpck_require__(6234);
  7737. // pkg/dist-src/graphql.js
  7738. var import_request = __nccwpck_require__(6234);
  7739. // pkg/dist-src/error.js
  7740. function _buildMessageForResponseErrors(data) {
  7741. return `Request failed due to following response errors:
  7742. ` + data.errors.map((e) => ` - ${e.message}`).join("\n");
  7743. }
  7744. var GraphqlResponseError = class extends Error {
  7745. constructor(request2, headers, response) {
  7746. super(_buildMessageForResponseErrors(response));
  7747. this.request = request2;
  7748. this.headers = headers;
  7749. this.response = response;
  7750. this.name = "GraphqlResponseError";
  7751. this.errors = response.errors;
  7752. this.data = response.data;
  7753. if (Error.captureStackTrace) {
  7754. Error.captureStackTrace(this, this.constructor);
  7755. }
  7756. }
  7757. };
  7758. // pkg/dist-src/graphql.js
  7759. var NON_VARIABLE_OPTIONS = [
  7760. "method",
  7761. "baseUrl",
  7762. "url",
  7763. "headers",
  7764. "request",
  7765. "query",
  7766. "mediaType"
  7767. ];
  7768. var FORBIDDEN_VARIABLE_OPTIONS = ["query", "method", "url"];
  7769. var GHES_V3_SUFFIX_REGEX = /\/api\/v3\/?$/;
  7770. function graphql(request2, query, options) {
  7771. if (options) {
  7772. if (typeof query === "string" && "query" in options) {
  7773. return Promise.reject(
  7774. new Error(`[@octokit/graphql] "query" cannot be used as variable name`)
  7775. );
  7776. }
  7777. for (const key in options) {
  7778. if (!FORBIDDEN_VARIABLE_OPTIONS.includes(key))
  7779. continue;
  7780. return Promise.reject(
  7781. new Error(
  7782. `[@octokit/graphql] "${key}" cannot be used as variable name`
  7783. )
  7784. );
  7785. }
  7786. }
  7787. const parsedOptions = typeof query === "string" ? Object.assign({ query }, options) : query;
  7788. const requestOptions = Object.keys(
  7789. parsedOptions
  7790. ).reduce((result, key) => {
  7791. if (NON_VARIABLE_OPTIONS.includes(key)) {
  7792. result[key] = parsedOptions[key];
  7793. return result;
  7794. }
  7795. if (!result.variables) {
  7796. result.variables = {};
  7797. }
  7798. result.variables[key] = parsedOptions[key];
  7799. return result;
  7800. }, {});
  7801. const baseUrl = parsedOptions.baseUrl || request2.endpoint.DEFAULTS.baseUrl;
  7802. if (GHES_V3_SUFFIX_REGEX.test(baseUrl)) {
  7803. requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX, "/api/graphql");
  7804. }
  7805. return request2(requestOptions).then((response) => {
  7806. if (response.data.errors) {
  7807. const headers = {};
  7808. for (const key of Object.keys(response.headers)) {
  7809. headers[key] = response.headers[key];
  7810. }
  7811. throw new GraphqlResponseError(
  7812. requestOptions,
  7813. headers,
  7814. response.data
  7815. );
  7816. }
  7817. return response.data.data;
  7818. });
  7819. }
  7820. // pkg/dist-src/with-defaults.js
  7821. function withDefaults(request2, newDefaults) {
  7822. const newRequest = request2.defaults(newDefaults);
  7823. const newApi = (query, options) => {
  7824. return graphql(newRequest, query, options);
  7825. };
  7826. return Object.assign(newApi, {
  7827. defaults: withDefaults.bind(null, newRequest),
  7828. endpoint: newRequest.endpoint
  7829. });
  7830. }
  7831. // pkg/dist-src/index.js
  7832. var graphql2 = withDefaults(import_request3.request, {
  7833. headers: {
  7834. "user-agent": `octokit-graphql.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`
  7835. },
  7836. method: "POST",
  7837. url: "/graphql"
  7838. });
  7839. function withCustomRequest(customRequest) {
  7840. return withDefaults(customRequest, {
  7841. method: "POST",
  7842. url: "/graphql"
  7843. });
  7844. }
  7845. // Annotate the CommonJS export names for ESM import in node:
  7846. 0 && (0);
  7847. /***/ }),
  7848. /***/ 4193:
  7849. /***/ ((module) => {
  7850. "use strict";
  7851. var __defProp = Object.defineProperty;
  7852. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  7853. var __getOwnPropNames = Object.getOwnPropertyNames;
  7854. var __hasOwnProp = Object.prototype.hasOwnProperty;
  7855. var __export = (target, all) => {
  7856. for (var name in all)
  7857. __defProp(target, name, { get: all[name], enumerable: true });
  7858. };
  7859. var __copyProps = (to, from, except, desc) => {
  7860. if (from && typeof from === "object" || typeof from === "function") {
  7861. for (let key of __getOwnPropNames(from))
  7862. if (!__hasOwnProp.call(to, key) && key !== except)
  7863. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  7864. }
  7865. return to;
  7866. };
  7867. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  7868. // pkg/dist-src/index.js
  7869. var dist_src_exports = {};
  7870. __export(dist_src_exports, {
  7871. composePaginateRest: () => composePaginateRest,
  7872. isPaginatingEndpoint: () => isPaginatingEndpoint,
  7873. paginateRest: () => paginateRest,
  7874. paginatingEndpoints: () => paginatingEndpoints
  7875. });
  7876. module.exports = __toCommonJS(dist_src_exports);
  7877. // pkg/dist-src/version.js
  7878. var VERSION = "9.2.1";
  7879. // pkg/dist-src/normalize-paginated-list-response.js
  7880. function normalizePaginatedListResponse(response) {
  7881. if (!response.data) {
  7882. return {
  7883. ...response,
  7884. data: []
  7885. };
  7886. }
  7887. const responseNeedsNormalization = "total_count" in response.data && !("url" in response.data);
  7888. if (!responseNeedsNormalization)
  7889. return response;
  7890. const incompleteResults = response.data.incomplete_results;
  7891. const repositorySelection = response.data.repository_selection;
  7892. const totalCount = response.data.total_count;
  7893. delete response.data.incomplete_results;
  7894. delete response.data.repository_selection;
  7895. delete response.data.total_count;
  7896. const namespaceKey = Object.keys(response.data)[0];
  7897. const data = response.data[namespaceKey];
  7898. response.data = data;
  7899. if (typeof incompleteResults !== "undefined") {
  7900. response.data.incomplete_results = incompleteResults;
  7901. }
  7902. if (typeof repositorySelection !== "undefined") {
  7903. response.data.repository_selection = repositorySelection;
  7904. }
  7905. response.data.total_count = totalCount;
  7906. return response;
  7907. }
  7908. // pkg/dist-src/iterator.js
  7909. function iterator(octokit, route, parameters) {
  7910. const options = typeof route === "function" ? route.endpoint(parameters) : octokit.request.endpoint(route, parameters);
  7911. const requestMethod = typeof route === "function" ? route : octokit.request;
  7912. const method = options.method;
  7913. const headers = options.headers;
  7914. let url = options.url;
  7915. return {
  7916. [Symbol.asyncIterator]: () => ({
  7917. async next() {
  7918. if (!url)
  7919. return { done: true };
  7920. try {
  7921. const response = await requestMethod({ method, url, headers });
  7922. const normalizedResponse = normalizePaginatedListResponse(response);
  7923. url = ((normalizedResponse.headers.link || "").match(
  7924. /<([^>]+)>;\s*rel="next"/
  7925. ) || [])[1];
  7926. return { value: normalizedResponse };
  7927. } catch (error) {
  7928. if (error.status !== 409)
  7929. throw error;
  7930. url = "";
  7931. return {
  7932. value: {
  7933. status: 200,
  7934. headers: {},
  7935. data: []
  7936. }
  7937. };
  7938. }
  7939. }
  7940. })
  7941. };
  7942. }
  7943. // pkg/dist-src/paginate.js
  7944. function paginate(octokit, route, parameters, mapFn) {
  7945. if (typeof parameters === "function") {
  7946. mapFn = parameters;
  7947. parameters = void 0;
  7948. }
  7949. return gather(
  7950. octokit,
  7951. [],
  7952. iterator(octokit, route, parameters)[Symbol.asyncIterator](),
  7953. mapFn
  7954. );
  7955. }
  7956. function gather(octokit, results, iterator2, mapFn) {
  7957. return iterator2.next().then((result) => {
  7958. if (result.done) {
  7959. return results;
  7960. }
  7961. let earlyExit = false;
  7962. function done() {
  7963. earlyExit = true;
  7964. }
  7965. results = results.concat(
  7966. mapFn ? mapFn(result.value, done) : result.value.data
  7967. );
  7968. if (earlyExit) {
  7969. return results;
  7970. }
  7971. return gather(octokit, results, iterator2, mapFn);
  7972. });
  7973. }
  7974. // pkg/dist-src/compose-paginate.js
  7975. var composePaginateRest = Object.assign(paginate, {
  7976. iterator
  7977. });
  7978. // pkg/dist-src/generated/paginating-endpoints.js
  7979. var paginatingEndpoints = [
  7980. "GET /advisories",
  7981. "GET /app/hook/deliveries",
  7982. "GET /app/installation-requests",
  7983. "GET /app/installations",
  7984. "GET /assignments/{assignment_id}/accepted_assignments",
  7985. "GET /classrooms",
  7986. "GET /classrooms/{classroom_id}/assignments",
  7987. "GET /enterprises/{enterprise}/dependabot/alerts",
  7988. "GET /enterprises/{enterprise}/secret-scanning/alerts",
  7989. "GET /events",
  7990. "GET /gists",
  7991. "GET /gists/public",
  7992. "GET /gists/starred",
  7993. "GET /gists/{gist_id}/comments",
  7994. "GET /gists/{gist_id}/commits",
  7995. "GET /gists/{gist_id}/forks",
  7996. "GET /installation/repositories",
  7997. "GET /issues",
  7998. "GET /licenses",
  7999. "GET /marketplace_listing/plans",
  8000. "GET /marketplace_listing/plans/{plan_id}/accounts",
  8001. "GET /marketplace_listing/stubbed/plans",
  8002. "GET /marketplace_listing/stubbed/plans/{plan_id}/accounts",
  8003. "GET /networks/{owner}/{repo}/events",
  8004. "GET /notifications",
  8005. "GET /organizations",
  8006. "GET /orgs/{org}/actions/cache/usage-by-repository",
  8007. "GET /orgs/{org}/actions/permissions/repositories",
  8008. "GET /orgs/{org}/actions/runners",
  8009. "GET /orgs/{org}/actions/secrets",
  8010. "GET /orgs/{org}/actions/secrets/{secret_name}/repositories",
  8011. "GET /orgs/{org}/actions/variables",
  8012. "GET /orgs/{org}/actions/variables/{name}/repositories",
  8013. "GET /orgs/{org}/blocks",
  8014. "GET /orgs/{org}/code-scanning/alerts",
  8015. "GET /orgs/{org}/codespaces",
  8016. "GET /orgs/{org}/codespaces/secrets",
  8017. "GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories",
  8018. "GET /orgs/{org}/copilot/billing/seats",
  8019. "GET /orgs/{org}/dependabot/alerts",
  8020. "GET /orgs/{org}/dependabot/secrets",
  8021. "GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories",
  8022. "GET /orgs/{org}/events",
  8023. "GET /orgs/{org}/failed_invitations",
  8024. "GET /orgs/{org}/hooks",
  8025. "GET /orgs/{org}/hooks/{hook_id}/deliveries",
  8026. "GET /orgs/{org}/installations",
  8027. "GET /orgs/{org}/invitations",
  8028. "GET /orgs/{org}/invitations/{invitation_id}/teams",
  8029. "GET /orgs/{org}/issues",
  8030. "GET /orgs/{org}/members",
  8031. "GET /orgs/{org}/members/{username}/codespaces",
  8032. "GET /orgs/{org}/migrations",
  8033. "GET /orgs/{org}/migrations/{migration_id}/repositories",
  8034. "GET /orgs/{org}/organization-roles/{role_id}/teams",
  8035. "GET /orgs/{org}/organization-roles/{role_id}/users",
  8036. "GET /orgs/{org}/outside_collaborators",
  8037. "GET /orgs/{org}/packages",
  8038. "GET /orgs/{org}/packages/{package_type}/{package_name}/versions",
  8039. "GET /orgs/{org}/personal-access-token-requests",
  8040. "GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories",
  8041. "GET /orgs/{org}/personal-access-tokens",
  8042. "GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories",
  8043. "GET /orgs/{org}/projects",
  8044. "GET /orgs/{org}/properties/values",
  8045. "GET /orgs/{org}/public_members",
  8046. "GET /orgs/{org}/repos",
  8047. "GET /orgs/{org}/rulesets",
  8048. "GET /orgs/{org}/rulesets/rule-suites",
  8049. "GET /orgs/{org}/secret-scanning/alerts",
  8050. "GET /orgs/{org}/security-advisories",
  8051. "GET /orgs/{org}/teams",
  8052. "GET /orgs/{org}/teams/{team_slug}/discussions",
  8053. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments",
  8054. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions",
  8055. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions",
  8056. "GET /orgs/{org}/teams/{team_slug}/invitations",
  8057. "GET /orgs/{org}/teams/{team_slug}/members",
  8058. "GET /orgs/{org}/teams/{team_slug}/projects",
  8059. "GET /orgs/{org}/teams/{team_slug}/repos",
  8060. "GET /orgs/{org}/teams/{team_slug}/teams",
  8061. "GET /projects/columns/{column_id}/cards",
  8062. "GET /projects/{project_id}/collaborators",
  8063. "GET /projects/{project_id}/columns",
  8064. "GET /repos/{owner}/{repo}/actions/artifacts",
  8065. "GET /repos/{owner}/{repo}/actions/caches",
  8066. "GET /repos/{owner}/{repo}/actions/organization-secrets",
  8067. "GET /repos/{owner}/{repo}/actions/organization-variables",
  8068. "GET /repos/{owner}/{repo}/actions/runners",
  8069. "GET /repos/{owner}/{repo}/actions/runs",
  8070. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts",
  8071. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs",
  8072. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs",
  8073. "GET /repos/{owner}/{repo}/actions/secrets",
  8074. "GET /repos/{owner}/{repo}/actions/variables",
  8075. "GET /repos/{owner}/{repo}/actions/workflows",
  8076. "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs",
  8077. "GET /repos/{owner}/{repo}/activity",
  8078. "GET /repos/{owner}/{repo}/assignees",
  8079. "GET /repos/{owner}/{repo}/branches",
  8080. "GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations",
  8081. "GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs",
  8082. "GET /repos/{owner}/{repo}/code-scanning/alerts",
  8083. "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances",
  8084. "GET /repos/{owner}/{repo}/code-scanning/analyses",
  8085. "GET /repos/{owner}/{repo}/codespaces",
  8086. "GET /repos/{owner}/{repo}/codespaces/devcontainers",
  8087. "GET /repos/{owner}/{repo}/codespaces/secrets",
  8088. "GET /repos/{owner}/{repo}/collaborators",
  8089. "GET /repos/{owner}/{repo}/comments",
  8090. "GET /repos/{owner}/{repo}/comments/{comment_id}/reactions",
  8091. "GET /repos/{owner}/{repo}/commits",
  8092. "GET /repos/{owner}/{repo}/commits/{commit_sha}/comments",
  8093. "GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls",
  8094. "GET /repos/{owner}/{repo}/commits/{ref}/check-runs",
  8095. "GET /repos/{owner}/{repo}/commits/{ref}/check-suites",
  8096. "GET /repos/{owner}/{repo}/commits/{ref}/status",
  8097. "GET /repos/{owner}/{repo}/commits/{ref}/statuses",
  8098. "GET /repos/{owner}/{repo}/contributors",
  8099. "GET /repos/{owner}/{repo}/dependabot/alerts",
  8100. "GET /repos/{owner}/{repo}/dependabot/secrets",
  8101. "GET /repos/{owner}/{repo}/deployments",
  8102. "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses",
  8103. "GET /repos/{owner}/{repo}/environments",
  8104. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies",
  8105. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps",
  8106. "GET /repos/{owner}/{repo}/events",
  8107. "GET /repos/{owner}/{repo}/forks",
  8108. "GET /repos/{owner}/{repo}/hooks",
  8109. "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries",
  8110. "GET /repos/{owner}/{repo}/invitations",
  8111. "GET /repos/{owner}/{repo}/issues",
  8112. "GET /repos/{owner}/{repo}/issues/comments",
  8113. "GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions",
  8114. "GET /repos/{owner}/{repo}/issues/events",
  8115. "GET /repos/{owner}/{repo}/issues/{issue_number}/comments",
  8116. "GET /repos/{owner}/{repo}/issues/{issue_number}/events",
  8117. "GET /repos/{owner}/{repo}/issues/{issue_number}/labels",
  8118. "GET /repos/{owner}/{repo}/issues/{issue_number}/reactions",
  8119. "GET /repos/{owner}/{repo}/issues/{issue_number}/timeline",
  8120. "GET /repos/{owner}/{repo}/keys",
  8121. "GET /repos/{owner}/{repo}/labels",
  8122. "GET /repos/{owner}/{repo}/milestones",
  8123. "GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels",
  8124. "GET /repos/{owner}/{repo}/notifications",
  8125. "GET /repos/{owner}/{repo}/pages/builds",
  8126. "GET /repos/{owner}/{repo}/projects",
  8127. "GET /repos/{owner}/{repo}/pulls",
  8128. "GET /repos/{owner}/{repo}/pulls/comments",
  8129. "GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions",
  8130. "GET /repos/{owner}/{repo}/pulls/{pull_number}/comments",
  8131. "GET /repos/{owner}/{repo}/pulls/{pull_number}/commits",
  8132. "GET /repos/{owner}/{repo}/pulls/{pull_number}/files",
  8133. "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews",
  8134. "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments",
  8135. "GET /repos/{owner}/{repo}/releases",
  8136. "GET /repos/{owner}/{repo}/releases/{release_id}/assets",
  8137. "GET /repos/{owner}/{repo}/releases/{release_id}/reactions",
  8138. "GET /repos/{owner}/{repo}/rules/branches/{branch}",
  8139. "GET /repos/{owner}/{repo}/rulesets",
  8140. "GET /repos/{owner}/{repo}/rulesets/rule-suites",
  8141. "GET /repos/{owner}/{repo}/secret-scanning/alerts",
  8142. "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations",
  8143. "GET /repos/{owner}/{repo}/security-advisories",
  8144. "GET /repos/{owner}/{repo}/stargazers",
  8145. "GET /repos/{owner}/{repo}/subscribers",
  8146. "GET /repos/{owner}/{repo}/tags",
  8147. "GET /repos/{owner}/{repo}/teams",
  8148. "GET /repos/{owner}/{repo}/topics",
  8149. "GET /repositories",
  8150. "GET /repositories/{repository_id}/environments/{environment_name}/secrets",
  8151. "GET /repositories/{repository_id}/environments/{environment_name}/variables",
  8152. "GET /search/code",
  8153. "GET /search/commits",
  8154. "GET /search/issues",
  8155. "GET /search/labels",
  8156. "GET /search/repositories",
  8157. "GET /search/topics",
  8158. "GET /search/users",
  8159. "GET /teams/{team_id}/discussions",
  8160. "GET /teams/{team_id}/discussions/{discussion_number}/comments",
  8161. "GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions",
  8162. "GET /teams/{team_id}/discussions/{discussion_number}/reactions",
  8163. "GET /teams/{team_id}/invitations",
  8164. "GET /teams/{team_id}/members",
  8165. "GET /teams/{team_id}/projects",
  8166. "GET /teams/{team_id}/repos",
  8167. "GET /teams/{team_id}/teams",
  8168. "GET /user/blocks",
  8169. "GET /user/codespaces",
  8170. "GET /user/codespaces/secrets",
  8171. "GET /user/emails",
  8172. "GET /user/followers",
  8173. "GET /user/following",
  8174. "GET /user/gpg_keys",
  8175. "GET /user/installations",
  8176. "GET /user/installations/{installation_id}/repositories",
  8177. "GET /user/issues",
  8178. "GET /user/keys",
  8179. "GET /user/marketplace_purchases",
  8180. "GET /user/marketplace_purchases/stubbed",
  8181. "GET /user/memberships/orgs",
  8182. "GET /user/migrations",
  8183. "GET /user/migrations/{migration_id}/repositories",
  8184. "GET /user/orgs",
  8185. "GET /user/packages",
  8186. "GET /user/packages/{package_type}/{package_name}/versions",
  8187. "GET /user/public_emails",
  8188. "GET /user/repos",
  8189. "GET /user/repository_invitations",
  8190. "GET /user/social_accounts",
  8191. "GET /user/ssh_signing_keys",
  8192. "GET /user/starred",
  8193. "GET /user/subscriptions",
  8194. "GET /user/teams",
  8195. "GET /users",
  8196. "GET /users/{username}/events",
  8197. "GET /users/{username}/events/orgs/{org}",
  8198. "GET /users/{username}/events/public",
  8199. "GET /users/{username}/followers",
  8200. "GET /users/{username}/following",
  8201. "GET /users/{username}/gists",
  8202. "GET /users/{username}/gpg_keys",
  8203. "GET /users/{username}/keys",
  8204. "GET /users/{username}/orgs",
  8205. "GET /users/{username}/packages",
  8206. "GET /users/{username}/projects",
  8207. "GET /users/{username}/received_events",
  8208. "GET /users/{username}/received_events/public",
  8209. "GET /users/{username}/repos",
  8210. "GET /users/{username}/social_accounts",
  8211. "GET /users/{username}/ssh_signing_keys",
  8212. "GET /users/{username}/starred",
  8213. "GET /users/{username}/subscriptions"
  8214. ];
  8215. // pkg/dist-src/paginating-endpoints.js
  8216. function isPaginatingEndpoint(arg) {
  8217. if (typeof arg === "string") {
  8218. return paginatingEndpoints.includes(arg);
  8219. } else {
  8220. return false;
  8221. }
  8222. }
  8223. // pkg/dist-src/index.js
  8224. function paginateRest(octokit) {
  8225. return {
  8226. paginate: Object.assign(paginate.bind(null, octokit), {
  8227. iterator: iterator.bind(null, octokit)
  8228. })
  8229. };
  8230. }
  8231. paginateRest.VERSION = VERSION;
  8232. // Annotate the CommonJS export names for ESM import in node:
  8233. 0 && (0);
  8234. /***/ }),
  8235. /***/ 3044:
  8236. /***/ ((module) => {
  8237. "use strict";
  8238. var __defProp = Object.defineProperty;
  8239. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  8240. var __getOwnPropNames = Object.getOwnPropertyNames;
  8241. var __hasOwnProp = Object.prototype.hasOwnProperty;
  8242. var __export = (target, all) => {
  8243. for (var name in all)
  8244. __defProp(target, name, { get: all[name], enumerable: true });
  8245. };
  8246. var __copyProps = (to, from, except, desc) => {
  8247. if (from && typeof from === "object" || typeof from === "function") {
  8248. for (let key of __getOwnPropNames(from))
  8249. if (!__hasOwnProp.call(to, key) && key !== except)
  8250. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  8251. }
  8252. return to;
  8253. };
  8254. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  8255. // pkg/dist-src/index.js
  8256. var dist_src_exports = {};
  8257. __export(dist_src_exports, {
  8258. legacyRestEndpointMethods: () => legacyRestEndpointMethods,
  8259. restEndpointMethods: () => restEndpointMethods
  8260. });
  8261. module.exports = __toCommonJS(dist_src_exports);
  8262. // pkg/dist-src/version.js
  8263. var VERSION = "10.4.1";
  8264. // pkg/dist-src/generated/endpoints.js
  8265. var Endpoints = {
  8266. actions: {
  8267. addCustomLabelsToSelfHostedRunnerForOrg: [
  8268. "POST /orgs/{org}/actions/runners/{runner_id}/labels"
  8269. ],
  8270. addCustomLabelsToSelfHostedRunnerForRepo: [
  8271. "POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
  8272. ],
  8273. addSelectedRepoToOrgSecret: [
  8274. "PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"
  8275. ],
  8276. addSelectedRepoToOrgVariable: [
  8277. "PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"
  8278. ],
  8279. approveWorkflowRun: [
  8280. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve"
  8281. ],
  8282. cancelWorkflowRun: [
  8283. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel"
  8284. ],
  8285. createEnvironmentVariable: [
  8286. "POST /repositories/{repository_id}/environments/{environment_name}/variables"
  8287. ],
  8288. createOrUpdateEnvironmentSecret: [
  8289. "PUT /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"
  8290. ],
  8291. createOrUpdateOrgSecret: ["PUT /orgs/{org}/actions/secrets/{secret_name}"],
  8292. createOrUpdateRepoSecret: [
  8293. "PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}"
  8294. ],
  8295. createOrgVariable: ["POST /orgs/{org}/actions/variables"],
  8296. createRegistrationTokenForOrg: [
  8297. "POST /orgs/{org}/actions/runners/registration-token"
  8298. ],
  8299. createRegistrationTokenForRepo: [
  8300. "POST /repos/{owner}/{repo}/actions/runners/registration-token"
  8301. ],
  8302. createRemoveTokenForOrg: ["POST /orgs/{org}/actions/runners/remove-token"],
  8303. createRemoveTokenForRepo: [
  8304. "POST /repos/{owner}/{repo}/actions/runners/remove-token"
  8305. ],
  8306. createRepoVariable: ["POST /repos/{owner}/{repo}/actions/variables"],
  8307. createWorkflowDispatch: [
  8308. "POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches"
  8309. ],
  8310. deleteActionsCacheById: [
  8311. "DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}"
  8312. ],
  8313. deleteActionsCacheByKey: [
  8314. "DELETE /repos/{owner}/{repo}/actions/caches{?key,ref}"
  8315. ],
  8316. deleteArtifact: [
  8317. "DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"
  8318. ],
  8319. deleteEnvironmentSecret: [
  8320. "DELETE /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"
  8321. ],
  8322. deleteEnvironmentVariable: [
  8323. "DELETE /repositories/{repository_id}/environments/{environment_name}/variables/{name}"
  8324. ],
  8325. deleteOrgSecret: ["DELETE /orgs/{org}/actions/secrets/{secret_name}"],
  8326. deleteOrgVariable: ["DELETE /orgs/{org}/actions/variables/{name}"],
  8327. deleteRepoSecret: [
  8328. "DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}"
  8329. ],
  8330. deleteRepoVariable: [
  8331. "DELETE /repos/{owner}/{repo}/actions/variables/{name}"
  8332. ],
  8333. deleteSelfHostedRunnerFromOrg: [
  8334. "DELETE /orgs/{org}/actions/runners/{runner_id}"
  8335. ],
  8336. deleteSelfHostedRunnerFromRepo: [
  8337. "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}"
  8338. ],
  8339. deleteWorkflowRun: ["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}"],
  8340. deleteWorkflowRunLogs: [
  8341. "DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs"
  8342. ],
  8343. disableSelectedRepositoryGithubActionsOrganization: [
  8344. "DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}"
  8345. ],
  8346. disableWorkflow: [
  8347. "PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable"
  8348. ],
  8349. downloadArtifact: [
  8350. "GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}"
  8351. ],
  8352. downloadJobLogsForWorkflowRun: [
  8353. "GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs"
  8354. ],
  8355. downloadWorkflowRunAttemptLogs: [
  8356. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs"
  8357. ],
  8358. downloadWorkflowRunLogs: [
  8359. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs"
  8360. ],
  8361. enableSelectedRepositoryGithubActionsOrganization: [
  8362. "PUT /orgs/{org}/actions/permissions/repositories/{repository_id}"
  8363. ],
  8364. enableWorkflow: [
  8365. "PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable"
  8366. ],
  8367. forceCancelWorkflowRun: [
  8368. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/force-cancel"
  8369. ],
  8370. generateRunnerJitconfigForOrg: [
  8371. "POST /orgs/{org}/actions/runners/generate-jitconfig"
  8372. ],
  8373. generateRunnerJitconfigForRepo: [
  8374. "POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig"
  8375. ],
  8376. getActionsCacheList: ["GET /repos/{owner}/{repo}/actions/caches"],
  8377. getActionsCacheUsage: ["GET /repos/{owner}/{repo}/actions/cache/usage"],
  8378. getActionsCacheUsageByRepoForOrg: [
  8379. "GET /orgs/{org}/actions/cache/usage-by-repository"
  8380. ],
  8381. getActionsCacheUsageForOrg: ["GET /orgs/{org}/actions/cache/usage"],
  8382. getAllowedActionsOrganization: [
  8383. "GET /orgs/{org}/actions/permissions/selected-actions"
  8384. ],
  8385. getAllowedActionsRepository: [
  8386. "GET /repos/{owner}/{repo}/actions/permissions/selected-actions"
  8387. ],
  8388. getArtifact: ["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"],
  8389. getCustomOidcSubClaimForRepo: [
  8390. "GET /repos/{owner}/{repo}/actions/oidc/customization/sub"
  8391. ],
  8392. getEnvironmentPublicKey: [
  8393. "GET /repositories/{repository_id}/environments/{environment_name}/secrets/public-key"
  8394. ],
  8395. getEnvironmentSecret: [
  8396. "GET /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"
  8397. ],
  8398. getEnvironmentVariable: [
  8399. "GET /repositories/{repository_id}/environments/{environment_name}/variables/{name}"
  8400. ],
  8401. getGithubActionsDefaultWorkflowPermissionsOrganization: [
  8402. "GET /orgs/{org}/actions/permissions/workflow"
  8403. ],
  8404. getGithubActionsDefaultWorkflowPermissionsRepository: [
  8405. "GET /repos/{owner}/{repo}/actions/permissions/workflow"
  8406. ],
  8407. getGithubActionsPermissionsOrganization: [
  8408. "GET /orgs/{org}/actions/permissions"
  8409. ],
  8410. getGithubActionsPermissionsRepository: [
  8411. "GET /repos/{owner}/{repo}/actions/permissions"
  8412. ],
  8413. getJobForWorkflowRun: ["GET /repos/{owner}/{repo}/actions/jobs/{job_id}"],
  8414. getOrgPublicKey: ["GET /orgs/{org}/actions/secrets/public-key"],
  8415. getOrgSecret: ["GET /orgs/{org}/actions/secrets/{secret_name}"],
  8416. getOrgVariable: ["GET /orgs/{org}/actions/variables/{name}"],
  8417. getPendingDeploymentsForRun: [
  8418. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"
  8419. ],
  8420. getRepoPermissions: [
  8421. "GET /repos/{owner}/{repo}/actions/permissions",
  8422. {},
  8423. { renamed: ["actions", "getGithubActionsPermissionsRepository"] }
  8424. ],
  8425. getRepoPublicKey: ["GET /repos/{owner}/{repo}/actions/secrets/public-key"],
  8426. getRepoSecret: ["GET /repos/{owner}/{repo}/actions/secrets/{secret_name}"],
  8427. getRepoVariable: ["GET /repos/{owner}/{repo}/actions/variables/{name}"],
  8428. getReviewsForRun: [
  8429. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals"
  8430. ],
  8431. getSelfHostedRunnerForOrg: ["GET /orgs/{org}/actions/runners/{runner_id}"],
  8432. getSelfHostedRunnerForRepo: [
  8433. "GET /repos/{owner}/{repo}/actions/runners/{runner_id}"
  8434. ],
  8435. getWorkflow: ["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}"],
  8436. getWorkflowAccessToRepository: [
  8437. "GET /repos/{owner}/{repo}/actions/permissions/access"
  8438. ],
  8439. getWorkflowRun: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}"],
  8440. getWorkflowRunAttempt: [
  8441. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}"
  8442. ],
  8443. getWorkflowRunUsage: [
  8444. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing"
  8445. ],
  8446. getWorkflowUsage: [
  8447. "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing"
  8448. ],
  8449. listArtifactsForRepo: ["GET /repos/{owner}/{repo}/actions/artifacts"],
  8450. listEnvironmentSecrets: [
  8451. "GET /repositories/{repository_id}/environments/{environment_name}/secrets"
  8452. ],
  8453. listEnvironmentVariables: [
  8454. "GET /repositories/{repository_id}/environments/{environment_name}/variables"
  8455. ],
  8456. listJobsForWorkflowRun: [
  8457. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs"
  8458. ],
  8459. listJobsForWorkflowRunAttempt: [
  8460. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs"
  8461. ],
  8462. listLabelsForSelfHostedRunnerForOrg: [
  8463. "GET /orgs/{org}/actions/runners/{runner_id}/labels"
  8464. ],
  8465. listLabelsForSelfHostedRunnerForRepo: [
  8466. "GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
  8467. ],
  8468. listOrgSecrets: ["GET /orgs/{org}/actions/secrets"],
  8469. listOrgVariables: ["GET /orgs/{org}/actions/variables"],
  8470. listRepoOrganizationSecrets: [
  8471. "GET /repos/{owner}/{repo}/actions/organization-secrets"
  8472. ],
  8473. listRepoOrganizationVariables: [
  8474. "GET /repos/{owner}/{repo}/actions/organization-variables"
  8475. ],
  8476. listRepoSecrets: ["GET /repos/{owner}/{repo}/actions/secrets"],
  8477. listRepoVariables: ["GET /repos/{owner}/{repo}/actions/variables"],
  8478. listRepoWorkflows: ["GET /repos/{owner}/{repo}/actions/workflows"],
  8479. listRunnerApplicationsForOrg: ["GET /orgs/{org}/actions/runners/downloads"],
  8480. listRunnerApplicationsForRepo: [
  8481. "GET /repos/{owner}/{repo}/actions/runners/downloads"
  8482. ],
  8483. listSelectedReposForOrgSecret: [
  8484. "GET /orgs/{org}/actions/secrets/{secret_name}/repositories"
  8485. ],
  8486. listSelectedReposForOrgVariable: [
  8487. "GET /orgs/{org}/actions/variables/{name}/repositories"
  8488. ],
  8489. listSelectedRepositoriesEnabledGithubActionsOrganization: [
  8490. "GET /orgs/{org}/actions/permissions/repositories"
  8491. ],
  8492. listSelfHostedRunnersForOrg: ["GET /orgs/{org}/actions/runners"],
  8493. listSelfHostedRunnersForRepo: ["GET /repos/{owner}/{repo}/actions/runners"],
  8494. listWorkflowRunArtifacts: [
  8495. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts"
  8496. ],
  8497. listWorkflowRuns: [
  8498. "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs"
  8499. ],
  8500. listWorkflowRunsForRepo: ["GET /repos/{owner}/{repo}/actions/runs"],
  8501. reRunJobForWorkflowRun: [
  8502. "POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun"
  8503. ],
  8504. reRunWorkflow: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun"],
  8505. reRunWorkflowFailedJobs: [
  8506. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs"
  8507. ],
  8508. removeAllCustomLabelsFromSelfHostedRunnerForOrg: [
  8509. "DELETE /orgs/{org}/actions/runners/{runner_id}/labels"
  8510. ],
  8511. removeAllCustomLabelsFromSelfHostedRunnerForRepo: [
  8512. "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
  8513. ],
  8514. removeCustomLabelFromSelfHostedRunnerForOrg: [
  8515. "DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}"
  8516. ],
  8517. removeCustomLabelFromSelfHostedRunnerForRepo: [
  8518. "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name}"
  8519. ],
  8520. removeSelectedRepoFromOrgSecret: [
  8521. "DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"
  8522. ],
  8523. removeSelectedRepoFromOrgVariable: [
  8524. "DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"
  8525. ],
  8526. reviewCustomGatesForRun: [
  8527. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule"
  8528. ],
  8529. reviewPendingDeploymentsForRun: [
  8530. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"
  8531. ],
  8532. setAllowedActionsOrganization: [
  8533. "PUT /orgs/{org}/actions/permissions/selected-actions"
  8534. ],
  8535. setAllowedActionsRepository: [
  8536. "PUT /repos/{owner}/{repo}/actions/permissions/selected-actions"
  8537. ],
  8538. setCustomLabelsForSelfHostedRunnerForOrg: [
  8539. "PUT /orgs/{org}/actions/runners/{runner_id}/labels"
  8540. ],
  8541. setCustomLabelsForSelfHostedRunnerForRepo: [
  8542. "PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
  8543. ],
  8544. setCustomOidcSubClaimForRepo: [
  8545. "PUT /repos/{owner}/{repo}/actions/oidc/customization/sub"
  8546. ],
  8547. setGithubActionsDefaultWorkflowPermissionsOrganization: [
  8548. "PUT /orgs/{org}/actions/permissions/workflow"
  8549. ],
  8550. setGithubActionsDefaultWorkflowPermissionsRepository: [
  8551. "PUT /repos/{owner}/{repo}/actions/permissions/workflow"
  8552. ],
  8553. setGithubActionsPermissionsOrganization: [
  8554. "PUT /orgs/{org}/actions/permissions"
  8555. ],
  8556. setGithubActionsPermissionsRepository: [
  8557. "PUT /repos/{owner}/{repo}/actions/permissions"
  8558. ],
  8559. setSelectedReposForOrgSecret: [
  8560. "PUT /orgs/{org}/actions/secrets/{secret_name}/repositories"
  8561. ],
  8562. setSelectedReposForOrgVariable: [
  8563. "PUT /orgs/{org}/actions/variables/{name}/repositories"
  8564. ],
  8565. setSelectedRepositoriesEnabledGithubActionsOrganization: [
  8566. "PUT /orgs/{org}/actions/permissions/repositories"
  8567. ],
  8568. setWorkflowAccessToRepository: [
  8569. "PUT /repos/{owner}/{repo}/actions/permissions/access"
  8570. ],
  8571. updateEnvironmentVariable: [
  8572. "PATCH /repositories/{repository_id}/environments/{environment_name}/variables/{name}"
  8573. ],
  8574. updateOrgVariable: ["PATCH /orgs/{org}/actions/variables/{name}"],
  8575. updateRepoVariable: [
  8576. "PATCH /repos/{owner}/{repo}/actions/variables/{name}"
  8577. ]
  8578. },
  8579. activity: {
  8580. checkRepoIsStarredByAuthenticatedUser: ["GET /user/starred/{owner}/{repo}"],
  8581. deleteRepoSubscription: ["DELETE /repos/{owner}/{repo}/subscription"],
  8582. deleteThreadSubscription: [
  8583. "DELETE /notifications/threads/{thread_id}/subscription"
  8584. ],
  8585. getFeeds: ["GET /feeds"],
  8586. getRepoSubscription: ["GET /repos/{owner}/{repo}/subscription"],
  8587. getThread: ["GET /notifications/threads/{thread_id}"],
  8588. getThreadSubscriptionForAuthenticatedUser: [
  8589. "GET /notifications/threads/{thread_id}/subscription"
  8590. ],
  8591. listEventsForAuthenticatedUser: ["GET /users/{username}/events"],
  8592. listNotificationsForAuthenticatedUser: ["GET /notifications"],
  8593. listOrgEventsForAuthenticatedUser: [
  8594. "GET /users/{username}/events/orgs/{org}"
  8595. ],
  8596. listPublicEvents: ["GET /events"],
  8597. listPublicEventsForRepoNetwork: ["GET /networks/{owner}/{repo}/events"],
  8598. listPublicEventsForUser: ["GET /users/{username}/events/public"],
  8599. listPublicOrgEvents: ["GET /orgs/{org}/events"],
  8600. listReceivedEventsForUser: ["GET /users/{username}/received_events"],
  8601. listReceivedPublicEventsForUser: [
  8602. "GET /users/{username}/received_events/public"
  8603. ],
  8604. listRepoEvents: ["GET /repos/{owner}/{repo}/events"],
  8605. listRepoNotificationsForAuthenticatedUser: [
  8606. "GET /repos/{owner}/{repo}/notifications"
  8607. ],
  8608. listReposStarredByAuthenticatedUser: ["GET /user/starred"],
  8609. listReposStarredByUser: ["GET /users/{username}/starred"],
  8610. listReposWatchedByUser: ["GET /users/{username}/subscriptions"],
  8611. listStargazersForRepo: ["GET /repos/{owner}/{repo}/stargazers"],
  8612. listWatchedReposForAuthenticatedUser: ["GET /user/subscriptions"],
  8613. listWatchersForRepo: ["GET /repos/{owner}/{repo}/subscribers"],
  8614. markNotificationsAsRead: ["PUT /notifications"],
  8615. markRepoNotificationsAsRead: ["PUT /repos/{owner}/{repo}/notifications"],
  8616. markThreadAsDone: ["DELETE /notifications/threads/{thread_id}"],
  8617. markThreadAsRead: ["PATCH /notifications/threads/{thread_id}"],
  8618. setRepoSubscription: ["PUT /repos/{owner}/{repo}/subscription"],
  8619. setThreadSubscription: [
  8620. "PUT /notifications/threads/{thread_id}/subscription"
  8621. ],
  8622. starRepoForAuthenticatedUser: ["PUT /user/starred/{owner}/{repo}"],
  8623. unstarRepoForAuthenticatedUser: ["DELETE /user/starred/{owner}/{repo}"]
  8624. },
  8625. apps: {
  8626. addRepoToInstallation: [
  8627. "PUT /user/installations/{installation_id}/repositories/{repository_id}",
  8628. {},
  8629. { renamed: ["apps", "addRepoToInstallationForAuthenticatedUser"] }
  8630. ],
  8631. addRepoToInstallationForAuthenticatedUser: [
  8632. "PUT /user/installations/{installation_id}/repositories/{repository_id}"
  8633. ],
  8634. checkToken: ["POST /applications/{client_id}/token"],
  8635. createFromManifest: ["POST /app-manifests/{code}/conversions"],
  8636. createInstallationAccessToken: [
  8637. "POST /app/installations/{installation_id}/access_tokens"
  8638. ],
  8639. deleteAuthorization: ["DELETE /applications/{client_id}/grant"],
  8640. deleteInstallation: ["DELETE /app/installations/{installation_id}"],
  8641. deleteToken: ["DELETE /applications/{client_id}/token"],
  8642. getAuthenticated: ["GET /app"],
  8643. getBySlug: ["GET /apps/{app_slug}"],
  8644. getInstallation: ["GET /app/installations/{installation_id}"],
  8645. getOrgInstallation: ["GET /orgs/{org}/installation"],
  8646. getRepoInstallation: ["GET /repos/{owner}/{repo}/installation"],
  8647. getSubscriptionPlanForAccount: [
  8648. "GET /marketplace_listing/accounts/{account_id}"
  8649. ],
  8650. getSubscriptionPlanForAccountStubbed: [
  8651. "GET /marketplace_listing/stubbed/accounts/{account_id}"
  8652. ],
  8653. getUserInstallation: ["GET /users/{username}/installation"],
  8654. getWebhookConfigForApp: ["GET /app/hook/config"],
  8655. getWebhookDelivery: ["GET /app/hook/deliveries/{delivery_id}"],
  8656. listAccountsForPlan: ["GET /marketplace_listing/plans/{plan_id}/accounts"],
  8657. listAccountsForPlanStubbed: [
  8658. "GET /marketplace_listing/stubbed/plans/{plan_id}/accounts"
  8659. ],
  8660. listInstallationReposForAuthenticatedUser: [
  8661. "GET /user/installations/{installation_id}/repositories"
  8662. ],
  8663. listInstallationRequestsForAuthenticatedApp: [
  8664. "GET /app/installation-requests"
  8665. ],
  8666. listInstallations: ["GET /app/installations"],
  8667. listInstallationsForAuthenticatedUser: ["GET /user/installations"],
  8668. listPlans: ["GET /marketplace_listing/plans"],
  8669. listPlansStubbed: ["GET /marketplace_listing/stubbed/plans"],
  8670. listReposAccessibleToInstallation: ["GET /installation/repositories"],
  8671. listSubscriptionsForAuthenticatedUser: ["GET /user/marketplace_purchases"],
  8672. listSubscriptionsForAuthenticatedUserStubbed: [
  8673. "GET /user/marketplace_purchases/stubbed"
  8674. ],
  8675. listWebhookDeliveries: ["GET /app/hook/deliveries"],
  8676. redeliverWebhookDelivery: [
  8677. "POST /app/hook/deliveries/{delivery_id}/attempts"
  8678. ],
  8679. removeRepoFromInstallation: [
  8680. "DELETE /user/installations/{installation_id}/repositories/{repository_id}",
  8681. {},
  8682. { renamed: ["apps", "removeRepoFromInstallationForAuthenticatedUser"] }
  8683. ],
  8684. removeRepoFromInstallationForAuthenticatedUser: [
  8685. "DELETE /user/installations/{installation_id}/repositories/{repository_id}"
  8686. ],
  8687. resetToken: ["PATCH /applications/{client_id}/token"],
  8688. revokeInstallationAccessToken: ["DELETE /installation/token"],
  8689. scopeToken: ["POST /applications/{client_id}/token/scoped"],
  8690. suspendInstallation: ["PUT /app/installations/{installation_id}/suspended"],
  8691. unsuspendInstallation: [
  8692. "DELETE /app/installations/{installation_id}/suspended"
  8693. ],
  8694. updateWebhookConfigForApp: ["PATCH /app/hook/config"]
  8695. },
  8696. billing: {
  8697. getGithubActionsBillingOrg: ["GET /orgs/{org}/settings/billing/actions"],
  8698. getGithubActionsBillingUser: [
  8699. "GET /users/{username}/settings/billing/actions"
  8700. ],
  8701. getGithubPackagesBillingOrg: ["GET /orgs/{org}/settings/billing/packages"],
  8702. getGithubPackagesBillingUser: [
  8703. "GET /users/{username}/settings/billing/packages"
  8704. ],
  8705. getSharedStorageBillingOrg: [
  8706. "GET /orgs/{org}/settings/billing/shared-storage"
  8707. ],
  8708. getSharedStorageBillingUser: [
  8709. "GET /users/{username}/settings/billing/shared-storage"
  8710. ]
  8711. },
  8712. checks: {
  8713. create: ["POST /repos/{owner}/{repo}/check-runs"],
  8714. createSuite: ["POST /repos/{owner}/{repo}/check-suites"],
  8715. get: ["GET /repos/{owner}/{repo}/check-runs/{check_run_id}"],
  8716. getSuite: ["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}"],
  8717. listAnnotations: [
  8718. "GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations"
  8719. ],
  8720. listForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-runs"],
  8721. listForSuite: [
  8722. "GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs"
  8723. ],
  8724. listSuitesForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-suites"],
  8725. rerequestRun: [
  8726. "POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest"
  8727. ],
  8728. rerequestSuite: [
  8729. "POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest"
  8730. ],
  8731. setSuitesPreferences: [
  8732. "PATCH /repos/{owner}/{repo}/check-suites/preferences"
  8733. ],
  8734. update: ["PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}"]
  8735. },
  8736. codeScanning: {
  8737. deleteAnalysis: [
  8738. "DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}"
  8739. ],
  8740. getAlert: [
  8741. "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}",
  8742. {},
  8743. { renamedParameters: { alert_id: "alert_number" } }
  8744. ],
  8745. getAnalysis: [
  8746. "GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}"
  8747. ],
  8748. getCodeqlDatabase: [
  8749. "GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}"
  8750. ],
  8751. getDefaultSetup: ["GET /repos/{owner}/{repo}/code-scanning/default-setup"],
  8752. getSarif: ["GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}"],
  8753. listAlertInstances: [
  8754. "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances"
  8755. ],
  8756. listAlertsForOrg: ["GET /orgs/{org}/code-scanning/alerts"],
  8757. listAlertsForRepo: ["GET /repos/{owner}/{repo}/code-scanning/alerts"],
  8758. listAlertsInstances: [
  8759. "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances",
  8760. {},
  8761. { renamed: ["codeScanning", "listAlertInstances"] }
  8762. ],
  8763. listCodeqlDatabases: [
  8764. "GET /repos/{owner}/{repo}/code-scanning/codeql/databases"
  8765. ],
  8766. listRecentAnalyses: ["GET /repos/{owner}/{repo}/code-scanning/analyses"],
  8767. updateAlert: [
  8768. "PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}"
  8769. ],
  8770. updateDefaultSetup: [
  8771. "PATCH /repos/{owner}/{repo}/code-scanning/default-setup"
  8772. ],
  8773. uploadSarif: ["POST /repos/{owner}/{repo}/code-scanning/sarifs"]
  8774. },
  8775. codesOfConduct: {
  8776. getAllCodesOfConduct: ["GET /codes_of_conduct"],
  8777. getConductCode: ["GET /codes_of_conduct/{key}"]
  8778. },
  8779. codespaces: {
  8780. addRepositoryForSecretForAuthenticatedUser: [
  8781. "PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"
  8782. ],
  8783. addSelectedRepoToOrgSecret: [
  8784. "PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"
  8785. ],
  8786. checkPermissionsForDevcontainer: [
  8787. "GET /repos/{owner}/{repo}/codespaces/permissions_check"
  8788. ],
  8789. codespaceMachinesForAuthenticatedUser: [
  8790. "GET /user/codespaces/{codespace_name}/machines"
  8791. ],
  8792. createForAuthenticatedUser: ["POST /user/codespaces"],
  8793. createOrUpdateOrgSecret: [
  8794. "PUT /orgs/{org}/codespaces/secrets/{secret_name}"
  8795. ],
  8796. createOrUpdateRepoSecret: [
  8797. "PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"
  8798. ],
  8799. createOrUpdateSecretForAuthenticatedUser: [
  8800. "PUT /user/codespaces/secrets/{secret_name}"
  8801. ],
  8802. createWithPrForAuthenticatedUser: [
  8803. "POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces"
  8804. ],
  8805. createWithRepoForAuthenticatedUser: [
  8806. "POST /repos/{owner}/{repo}/codespaces"
  8807. ],
  8808. deleteForAuthenticatedUser: ["DELETE /user/codespaces/{codespace_name}"],
  8809. deleteFromOrganization: [
  8810. "DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name}"
  8811. ],
  8812. deleteOrgSecret: ["DELETE /orgs/{org}/codespaces/secrets/{secret_name}"],
  8813. deleteRepoSecret: [
  8814. "DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"
  8815. ],
  8816. deleteSecretForAuthenticatedUser: [
  8817. "DELETE /user/codespaces/secrets/{secret_name}"
  8818. ],
  8819. exportForAuthenticatedUser: [
  8820. "POST /user/codespaces/{codespace_name}/exports"
  8821. ],
  8822. getCodespacesForUserInOrg: [
  8823. "GET /orgs/{org}/members/{username}/codespaces"
  8824. ],
  8825. getExportDetailsForAuthenticatedUser: [
  8826. "GET /user/codespaces/{codespace_name}/exports/{export_id}"
  8827. ],
  8828. getForAuthenticatedUser: ["GET /user/codespaces/{codespace_name}"],
  8829. getOrgPublicKey: ["GET /orgs/{org}/codespaces/secrets/public-key"],
  8830. getOrgSecret: ["GET /orgs/{org}/codespaces/secrets/{secret_name}"],
  8831. getPublicKeyForAuthenticatedUser: [
  8832. "GET /user/codespaces/secrets/public-key"
  8833. ],
  8834. getRepoPublicKey: [
  8835. "GET /repos/{owner}/{repo}/codespaces/secrets/public-key"
  8836. ],
  8837. getRepoSecret: [
  8838. "GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"
  8839. ],
  8840. getSecretForAuthenticatedUser: [
  8841. "GET /user/codespaces/secrets/{secret_name}"
  8842. ],
  8843. listDevcontainersInRepositoryForAuthenticatedUser: [
  8844. "GET /repos/{owner}/{repo}/codespaces/devcontainers"
  8845. ],
  8846. listForAuthenticatedUser: ["GET /user/codespaces"],
  8847. listInOrganization: [
  8848. "GET /orgs/{org}/codespaces",
  8849. {},
  8850. { renamedParameters: { org_id: "org" } }
  8851. ],
  8852. listInRepositoryForAuthenticatedUser: [
  8853. "GET /repos/{owner}/{repo}/codespaces"
  8854. ],
  8855. listOrgSecrets: ["GET /orgs/{org}/codespaces/secrets"],
  8856. listRepoSecrets: ["GET /repos/{owner}/{repo}/codespaces/secrets"],
  8857. listRepositoriesForSecretForAuthenticatedUser: [
  8858. "GET /user/codespaces/secrets/{secret_name}/repositories"
  8859. ],
  8860. listSecretsForAuthenticatedUser: ["GET /user/codespaces/secrets"],
  8861. listSelectedReposForOrgSecret: [
  8862. "GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories"
  8863. ],
  8864. preFlightWithRepoForAuthenticatedUser: [
  8865. "GET /repos/{owner}/{repo}/codespaces/new"
  8866. ],
  8867. publishForAuthenticatedUser: [
  8868. "POST /user/codespaces/{codespace_name}/publish"
  8869. ],
  8870. removeRepositoryForSecretForAuthenticatedUser: [
  8871. "DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"
  8872. ],
  8873. removeSelectedRepoFromOrgSecret: [
  8874. "DELETE /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"
  8875. ],
  8876. repoMachinesForAuthenticatedUser: [
  8877. "GET /repos/{owner}/{repo}/codespaces/machines"
  8878. ],
  8879. setRepositoriesForSecretForAuthenticatedUser: [
  8880. "PUT /user/codespaces/secrets/{secret_name}/repositories"
  8881. ],
  8882. setSelectedReposForOrgSecret: [
  8883. "PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories"
  8884. ],
  8885. startForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/start"],
  8886. stopForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/stop"],
  8887. stopInOrganization: [
  8888. "POST /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop"
  8889. ],
  8890. updateForAuthenticatedUser: ["PATCH /user/codespaces/{codespace_name}"]
  8891. },
  8892. copilot: {
  8893. addCopilotSeatsForTeams: [
  8894. "POST /orgs/{org}/copilot/billing/selected_teams"
  8895. ],
  8896. addCopilotSeatsForUsers: [
  8897. "POST /orgs/{org}/copilot/billing/selected_users"
  8898. ],
  8899. cancelCopilotSeatAssignmentForTeams: [
  8900. "DELETE /orgs/{org}/copilot/billing/selected_teams"
  8901. ],
  8902. cancelCopilotSeatAssignmentForUsers: [
  8903. "DELETE /orgs/{org}/copilot/billing/selected_users"
  8904. ],
  8905. getCopilotOrganizationDetails: ["GET /orgs/{org}/copilot/billing"],
  8906. getCopilotSeatDetailsForUser: [
  8907. "GET /orgs/{org}/members/{username}/copilot"
  8908. ],
  8909. listCopilotSeats: ["GET /orgs/{org}/copilot/billing/seats"]
  8910. },
  8911. dependabot: {
  8912. addSelectedRepoToOrgSecret: [
  8913. "PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"
  8914. ],
  8915. createOrUpdateOrgSecret: [
  8916. "PUT /orgs/{org}/dependabot/secrets/{secret_name}"
  8917. ],
  8918. createOrUpdateRepoSecret: [
  8919. "PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"
  8920. ],
  8921. deleteOrgSecret: ["DELETE /orgs/{org}/dependabot/secrets/{secret_name}"],
  8922. deleteRepoSecret: [
  8923. "DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"
  8924. ],
  8925. getAlert: ["GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"],
  8926. getOrgPublicKey: ["GET /orgs/{org}/dependabot/secrets/public-key"],
  8927. getOrgSecret: ["GET /orgs/{org}/dependabot/secrets/{secret_name}"],
  8928. getRepoPublicKey: [
  8929. "GET /repos/{owner}/{repo}/dependabot/secrets/public-key"
  8930. ],
  8931. getRepoSecret: [
  8932. "GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"
  8933. ],
  8934. listAlertsForEnterprise: [
  8935. "GET /enterprises/{enterprise}/dependabot/alerts"
  8936. ],
  8937. listAlertsForOrg: ["GET /orgs/{org}/dependabot/alerts"],
  8938. listAlertsForRepo: ["GET /repos/{owner}/{repo}/dependabot/alerts"],
  8939. listOrgSecrets: ["GET /orgs/{org}/dependabot/secrets"],
  8940. listRepoSecrets: ["GET /repos/{owner}/{repo}/dependabot/secrets"],
  8941. listSelectedReposForOrgSecret: [
  8942. "GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories"
  8943. ],
  8944. removeSelectedRepoFromOrgSecret: [
  8945. "DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"
  8946. ],
  8947. setSelectedReposForOrgSecret: [
  8948. "PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories"
  8949. ],
  8950. updateAlert: [
  8951. "PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"
  8952. ]
  8953. },
  8954. dependencyGraph: {
  8955. createRepositorySnapshot: [
  8956. "POST /repos/{owner}/{repo}/dependency-graph/snapshots"
  8957. ],
  8958. diffRange: [
  8959. "GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead}"
  8960. ],
  8961. exportSbom: ["GET /repos/{owner}/{repo}/dependency-graph/sbom"]
  8962. },
  8963. emojis: { get: ["GET /emojis"] },
  8964. gists: {
  8965. checkIsStarred: ["GET /gists/{gist_id}/star"],
  8966. create: ["POST /gists"],
  8967. createComment: ["POST /gists/{gist_id}/comments"],
  8968. delete: ["DELETE /gists/{gist_id}"],
  8969. deleteComment: ["DELETE /gists/{gist_id}/comments/{comment_id}"],
  8970. fork: ["POST /gists/{gist_id}/forks"],
  8971. get: ["GET /gists/{gist_id}"],
  8972. getComment: ["GET /gists/{gist_id}/comments/{comment_id}"],
  8973. getRevision: ["GET /gists/{gist_id}/{sha}"],
  8974. list: ["GET /gists"],
  8975. listComments: ["GET /gists/{gist_id}/comments"],
  8976. listCommits: ["GET /gists/{gist_id}/commits"],
  8977. listForUser: ["GET /users/{username}/gists"],
  8978. listForks: ["GET /gists/{gist_id}/forks"],
  8979. listPublic: ["GET /gists/public"],
  8980. listStarred: ["GET /gists/starred"],
  8981. star: ["PUT /gists/{gist_id}/star"],
  8982. unstar: ["DELETE /gists/{gist_id}/star"],
  8983. update: ["PATCH /gists/{gist_id}"],
  8984. updateComment: ["PATCH /gists/{gist_id}/comments/{comment_id}"]
  8985. },
  8986. git: {
  8987. createBlob: ["POST /repos/{owner}/{repo}/git/blobs"],
  8988. createCommit: ["POST /repos/{owner}/{repo}/git/commits"],
  8989. createRef: ["POST /repos/{owner}/{repo}/git/refs"],
  8990. createTag: ["POST /repos/{owner}/{repo}/git/tags"],
  8991. createTree: ["POST /repos/{owner}/{repo}/git/trees"],
  8992. deleteRef: ["DELETE /repos/{owner}/{repo}/git/refs/{ref}"],
  8993. getBlob: ["GET /repos/{owner}/{repo}/git/blobs/{file_sha}"],
  8994. getCommit: ["GET /repos/{owner}/{repo}/git/commits/{commit_sha}"],
  8995. getRef: ["GET /repos/{owner}/{repo}/git/ref/{ref}"],
  8996. getTag: ["GET /repos/{owner}/{repo}/git/tags/{tag_sha}"],
  8997. getTree: ["GET /repos/{owner}/{repo}/git/trees/{tree_sha}"],
  8998. listMatchingRefs: ["GET /repos/{owner}/{repo}/git/matching-refs/{ref}"],
  8999. updateRef: ["PATCH /repos/{owner}/{repo}/git/refs/{ref}"]
  9000. },
  9001. gitignore: {
  9002. getAllTemplates: ["GET /gitignore/templates"],
  9003. getTemplate: ["GET /gitignore/templates/{name}"]
  9004. },
  9005. interactions: {
  9006. getRestrictionsForAuthenticatedUser: ["GET /user/interaction-limits"],
  9007. getRestrictionsForOrg: ["GET /orgs/{org}/interaction-limits"],
  9008. getRestrictionsForRepo: ["GET /repos/{owner}/{repo}/interaction-limits"],
  9009. getRestrictionsForYourPublicRepos: [
  9010. "GET /user/interaction-limits",
  9011. {},
  9012. { renamed: ["interactions", "getRestrictionsForAuthenticatedUser"] }
  9013. ],
  9014. removeRestrictionsForAuthenticatedUser: ["DELETE /user/interaction-limits"],
  9015. removeRestrictionsForOrg: ["DELETE /orgs/{org}/interaction-limits"],
  9016. removeRestrictionsForRepo: [
  9017. "DELETE /repos/{owner}/{repo}/interaction-limits"
  9018. ],
  9019. removeRestrictionsForYourPublicRepos: [
  9020. "DELETE /user/interaction-limits",
  9021. {},
  9022. { renamed: ["interactions", "removeRestrictionsForAuthenticatedUser"] }
  9023. ],
  9024. setRestrictionsForAuthenticatedUser: ["PUT /user/interaction-limits"],
  9025. setRestrictionsForOrg: ["PUT /orgs/{org}/interaction-limits"],
  9026. setRestrictionsForRepo: ["PUT /repos/{owner}/{repo}/interaction-limits"],
  9027. setRestrictionsForYourPublicRepos: [
  9028. "PUT /user/interaction-limits",
  9029. {},
  9030. { renamed: ["interactions", "setRestrictionsForAuthenticatedUser"] }
  9031. ]
  9032. },
  9033. issues: {
  9034. addAssignees: [
  9035. "POST /repos/{owner}/{repo}/issues/{issue_number}/assignees"
  9036. ],
  9037. addLabels: ["POST /repos/{owner}/{repo}/issues/{issue_number}/labels"],
  9038. checkUserCanBeAssigned: ["GET /repos/{owner}/{repo}/assignees/{assignee}"],
  9039. checkUserCanBeAssignedToIssue: [
  9040. "GET /repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}"
  9041. ],
  9042. create: ["POST /repos/{owner}/{repo}/issues"],
  9043. createComment: [
  9044. "POST /repos/{owner}/{repo}/issues/{issue_number}/comments"
  9045. ],
  9046. createLabel: ["POST /repos/{owner}/{repo}/labels"],
  9047. createMilestone: ["POST /repos/{owner}/{repo}/milestones"],
  9048. deleteComment: [
  9049. "DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}"
  9050. ],
  9051. deleteLabel: ["DELETE /repos/{owner}/{repo}/labels/{name}"],
  9052. deleteMilestone: [
  9053. "DELETE /repos/{owner}/{repo}/milestones/{milestone_number}"
  9054. ],
  9055. get: ["GET /repos/{owner}/{repo}/issues/{issue_number}"],
  9056. getComment: ["GET /repos/{owner}/{repo}/issues/comments/{comment_id}"],
  9057. getEvent: ["GET /repos/{owner}/{repo}/issues/events/{event_id}"],
  9058. getLabel: ["GET /repos/{owner}/{repo}/labels/{name}"],
  9059. getMilestone: ["GET /repos/{owner}/{repo}/milestones/{milestone_number}"],
  9060. list: ["GET /issues"],
  9061. listAssignees: ["GET /repos/{owner}/{repo}/assignees"],
  9062. listComments: ["GET /repos/{owner}/{repo}/issues/{issue_number}/comments"],
  9063. listCommentsForRepo: ["GET /repos/{owner}/{repo}/issues/comments"],
  9064. listEvents: ["GET /repos/{owner}/{repo}/issues/{issue_number}/events"],
  9065. listEventsForRepo: ["GET /repos/{owner}/{repo}/issues/events"],
  9066. listEventsForTimeline: [
  9067. "GET /repos/{owner}/{repo}/issues/{issue_number}/timeline"
  9068. ],
  9069. listForAuthenticatedUser: ["GET /user/issues"],
  9070. listForOrg: ["GET /orgs/{org}/issues"],
  9071. listForRepo: ["GET /repos/{owner}/{repo}/issues"],
  9072. listLabelsForMilestone: [
  9073. "GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels"
  9074. ],
  9075. listLabelsForRepo: ["GET /repos/{owner}/{repo}/labels"],
  9076. listLabelsOnIssue: [
  9077. "GET /repos/{owner}/{repo}/issues/{issue_number}/labels"
  9078. ],
  9079. listMilestones: ["GET /repos/{owner}/{repo}/milestones"],
  9080. lock: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/lock"],
  9081. removeAllLabels: [
  9082. "DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels"
  9083. ],
  9084. removeAssignees: [
  9085. "DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees"
  9086. ],
  9087. removeLabel: [
  9088. "DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}"
  9089. ],
  9090. setLabels: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/labels"],
  9091. unlock: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock"],
  9092. update: ["PATCH /repos/{owner}/{repo}/issues/{issue_number}"],
  9093. updateComment: ["PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}"],
  9094. updateLabel: ["PATCH /repos/{owner}/{repo}/labels/{name}"],
  9095. updateMilestone: [
  9096. "PATCH /repos/{owner}/{repo}/milestones/{milestone_number}"
  9097. ]
  9098. },
  9099. licenses: {
  9100. get: ["GET /licenses/{license}"],
  9101. getAllCommonlyUsed: ["GET /licenses"],
  9102. getForRepo: ["GET /repos/{owner}/{repo}/license"]
  9103. },
  9104. markdown: {
  9105. render: ["POST /markdown"],
  9106. renderRaw: [
  9107. "POST /markdown/raw",
  9108. { headers: { "content-type": "text/plain; charset=utf-8" } }
  9109. ]
  9110. },
  9111. meta: {
  9112. get: ["GET /meta"],
  9113. getAllVersions: ["GET /versions"],
  9114. getOctocat: ["GET /octocat"],
  9115. getZen: ["GET /zen"],
  9116. root: ["GET /"]
  9117. },
  9118. migrations: {
  9119. cancelImport: [
  9120. "DELETE /repos/{owner}/{repo}/import",
  9121. {},
  9122. {
  9123. deprecated: "octokit.rest.migrations.cancelImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#cancel-an-import"
  9124. }
  9125. ],
  9126. deleteArchiveForAuthenticatedUser: [
  9127. "DELETE /user/migrations/{migration_id}/archive"
  9128. ],
  9129. deleteArchiveForOrg: [
  9130. "DELETE /orgs/{org}/migrations/{migration_id}/archive"
  9131. ],
  9132. downloadArchiveForOrg: [
  9133. "GET /orgs/{org}/migrations/{migration_id}/archive"
  9134. ],
  9135. getArchiveForAuthenticatedUser: [
  9136. "GET /user/migrations/{migration_id}/archive"
  9137. ],
  9138. getCommitAuthors: [
  9139. "GET /repos/{owner}/{repo}/import/authors",
  9140. {},
  9141. {
  9142. deprecated: "octokit.rest.migrations.getCommitAuthors() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-commit-authors"
  9143. }
  9144. ],
  9145. getImportStatus: [
  9146. "GET /repos/{owner}/{repo}/import",
  9147. {},
  9148. {
  9149. deprecated: "octokit.rest.migrations.getImportStatus() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-an-import-status"
  9150. }
  9151. ],
  9152. getLargeFiles: [
  9153. "GET /repos/{owner}/{repo}/import/large_files",
  9154. {},
  9155. {
  9156. deprecated: "octokit.rest.migrations.getLargeFiles() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-large-files"
  9157. }
  9158. ],
  9159. getStatusForAuthenticatedUser: ["GET /user/migrations/{migration_id}"],
  9160. getStatusForOrg: ["GET /orgs/{org}/migrations/{migration_id}"],
  9161. listForAuthenticatedUser: ["GET /user/migrations"],
  9162. listForOrg: ["GET /orgs/{org}/migrations"],
  9163. listReposForAuthenticatedUser: [
  9164. "GET /user/migrations/{migration_id}/repositories"
  9165. ],
  9166. listReposForOrg: ["GET /orgs/{org}/migrations/{migration_id}/repositories"],
  9167. listReposForUser: [
  9168. "GET /user/migrations/{migration_id}/repositories",
  9169. {},
  9170. { renamed: ["migrations", "listReposForAuthenticatedUser"] }
  9171. ],
  9172. mapCommitAuthor: [
  9173. "PATCH /repos/{owner}/{repo}/import/authors/{author_id}",
  9174. {},
  9175. {
  9176. deprecated: "octokit.rest.migrations.mapCommitAuthor() is deprecated, see https://docs.github.com/rest/migrations/source-imports#map-a-commit-author"
  9177. }
  9178. ],
  9179. setLfsPreference: [
  9180. "PATCH /repos/{owner}/{repo}/import/lfs",
  9181. {},
  9182. {
  9183. deprecated: "octokit.rest.migrations.setLfsPreference() is deprecated, see https://docs.github.com/rest/migrations/source-imports#update-git-lfs-preference"
  9184. }
  9185. ],
  9186. startForAuthenticatedUser: ["POST /user/migrations"],
  9187. startForOrg: ["POST /orgs/{org}/migrations"],
  9188. startImport: [
  9189. "PUT /repos/{owner}/{repo}/import",
  9190. {},
  9191. {
  9192. deprecated: "octokit.rest.migrations.startImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#start-an-import"
  9193. }
  9194. ],
  9195. unlockRepoForAuthenticatedUser: [
  9196. "DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock"
  9197. ],
  9198. unlockRepoForOrg: [
  9199. "DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock"
  9200. ],
  9201. updateImport: [
  9202. "PATCH /repos/{owner}/{repo}/import",
  9203. {},
  9204. {
  9205. deprecated: "octokit.rest.migrations.updateImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#update-an-import"
  9206. }
  9207. ]
  9208. },
  9209. oidc: {
  9210. getOidcCustomSubTemplateForOrg: [
  9211. "GET /orgs/{org}/actions/oidc/customization/sub"
  9212. ],
  9213. updateOidcCustomSubTemplateForOrg: [
  9214. "PUT /orgs/{org}/actions/oidc/customization/sub"
  9215. ]
  9216. },
  9217. orgs: {
  9218. addSecurityManagerTeam: [
  9219. "PUT /orgs/{org}/security-managers/teams/{team_slug}"
  9220. ],
  9221. assignTeamToOrgRole: [
  9222. "PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"
  9223. ],
  9224. assignUserToOrgRole: [
  9225. "PUT /orgs/{org}/organization-roles/users/{username}/{role_id}"
  9226. ],
  9227. blockUser: ["PUT /orgs/{org}/blocks/{username}"],
  9228. cancelInvitation: ["DELETE /orgs/{org}/invitations/{invitation_id}"],
  9229. checkBlockedUser: ["GET /orgs/{org}/blocks/{username}"],
  9230. checkMembershipForUser: ["GET /orgs/{org}/members/{username}"],
  9231. checkPublicMembershipForUser: ["GET /orgs/{org}/public_members/{username}"],
  9232. convertMemberToOutsideCollaborator: [
  9233. "PUT /orgs/{org}/outside_collaborators/{username}"
  9234. ],
  9235. createCustomOrganizationRole: ["POST /orgs/{org}/organization-roles"],
  9236. createInvitation: ["POST /orgs/{org}/invitations"],
  9237. createOrUpdateCustomProperties: ["PATCH /orgs/{org}/properties/schema"],
  9238. createOrUpdateCustomPropertiesValuesForRepos: [
  9239. "PATCH /orgs/{org}/properties/values"
  9240. ],
  9241. createOrUpdateCustomProperty: [
  9242. "PUT /orgs/{org}/properties/schema/{custom_property_name}"
  9243. ],
  9244. createWebhook: ["POST /orgs/{org}/hooks"],
  9245. delete: ["DELETE /orgs/{org}"],
  9246. deleteCustomOrganizationRole: [
  9247. "DELETE /orgs/{org}/organization-roles/{role_id}"
  9248. ],
  9249. deleteWebhook: ["DELETE /orgs/{org}/hooks/{hook_id}"],
  9250. enableOrDisableSecurityProductOnAllOrgRepos: [
  9251. "POST /orgs/{org}/{security_product}/{enablement}"
  9252. ],
  9253. get: ["GET /orgs/{org}"],
  9254. getAllCustomProperties: ["GET /orgs/{org}/properties/schema"],
  9255. getCustomProperty: [
  9256. "GET /orgs/{org}/properties/schema/{custom_property_name}"
  9257. ],
  9258. getMembershipForAuthenticatedUser: ["GET /user/memberships/orgs/{org}"],
  9259. getMembershipForUser: ["GET /orgs/{org}/memberships/{username}"],
  9260. getOrgRole: ["GET /orgs/{org}/organization-roles/{role_id}"],
  9261. getWebhook: ["GET /orgs/{org}/hooks/{hook_id}"],
  9262. getWebhookConfigForOrg: ["GET /orgs/{org}/hooks/{hook_id}/config"],
  9263. getWebhookDelivery: [
  9264. "GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}"
  9265. ],
  9266. list: ["GET /organizations"],
  9267. listAppInstallations: ["GET /orgs/{org}/installations"],
  9268. listBlockedUsers: ["GET /orgs/{org}/blocks"],
  9269. listCustomPropertiesValuesForRepos: ["GET /orgs/{org}/properties/values"],
  9270. listFailedInvitations: ["GET /orgs/{org}/failed_invitations"],
  9271. listForAuthenticatedUser: ["GET /user/orgs"],
  9272. listForUser: ["GET /users/{username}/orgs"],
  9273. listInvitationTeams: ["GET /orgs/{org}/invitations/{invitation_id}/teams"],
  9274. listMembers: ["GET /orgs/{org}/members"],
  9275. listMembershipsForAuthenticatedUser: ["GET /user/memberships/orgs"],
  9276. listOrgRoleTeams: ["GET /orgs/{org}/organization-roles/{role_id}/teams"],
  9277. listOrgRoleUsers: ["GET /orgs/{org}/organization-roles/{role_id}/users"],
  9278. listOrgRoles: ["GET /orgs/{org}/organization-roles"],
  9279. listOrganizationFineGrainedPermissions: [
  9280. "GET /orgs/{org}/organization-fine-grained-permissions"
  9281. ],
  9282. listOutsideCollaborators: ["GET /orgs/{org}/outside_collaborators"],
  9283. listPatGrantRepositories: [
  9284. "GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories"
  9285. ],
  9286. listPatGrantRequestRepositories: [
  9287. "GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories"
  9288. ],
  9289. listPatGrantRequests: ["GET /orgs/{org}/personal-access-token-requests"],
  9290. listPatGrants: ["GET /orgs/{org}/personal-access-tokens"],
  9291. listPendingInvitations: ["GET /orgs/{org}/invitations"],
  9292. listPublicMembers: ["GET /orgs/{org}/public_members"],
  9293. listSecurityManagerTeams: ["GET /orgs/{org}/security-managers"],
  9294. listWebhookDeliveries: ["GET /orgs/{org}/hooks/{hook_id}/deliveries"],
  9295. listWebhooks: ["GET /orgs/{org}/hooks"],
  9296. patchCustomOrganizationRole: [
  9297. "PATCH /orgs/{org}/organization-roles/{role_id}"
  9298. ],
  9299. pingWebhook: ["POST /orgs/{org}/hooks/{hook_id}/pings"],
  9300. redeliverWebhookDelivery: [
  9301. "POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"
  9302. ],
  9303. removeCustomProperty: [
  9304. "DELETE /orgs/{org}/properties/schema/{custom_property_name}"
  9305. ],
  9306. removeMember: ["DELETE /orgs/{org}/members/{username}"],
  9307. removeMembershipForUser: ["DELETE /orgs/{org}/memberships/{username}"],
  9308. removeOutsideCollaborator: [
  9309. "DELETE /orgs/{org}/outside_collaborators/{username}"
  9310. ],
  9311. removePublicMembershipForAuthenticatedUser: [
  9312. "DELETE /orgs/{org}/public_members/{username}"
  9313. ],
  9314. removeSecurityManagerTeam: [
  9315. "DELETE /orgs/{org}/security-managers/teams/{team_slug}"
  9316. ],
  9317. reviewPatGrantRequest: [
  9318. "POST /orgs/{org}/personal-access-token-requests/{pat_request_id}"
  9319. ],
  9320. reviewPatGrantRequestsInBulk: [
  9321. "POST /orgs/{org}/personal-access-token-requests"
  9322. ],
  9323. revokeAllOrgRolesTeam: [
  9324. "DELETE /orgs/{org}/organization-roles/teams/{team_slug}"
  9325. ],
  9326. revokeAllOrgRolesUser: [
  9327. "DELETE /orgs/{org}/organization-roles/users/{username}"
  9328. ],
  9329. revokeOrgRoleTeam: [
  9330. "DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"
  9331. ],
  9332. revokeOrgRoleUser: [
  9333. "DELETE /orgs/{org}/organization-roles/users/{username}/{role_id}"
  9334. ],
  9335. setMembershipForUser: ["PUT /orgs/{org}/memberships/{username}"],
  9336. setPublicMembershipForAuthenticatedUser: [
  9337. "PUT /orgs/{org}/public_members/{username}"
  9338. ],
  9339. unblockUser: ["DELETE /orgs/{org}/blocks/{username}"],
  9340. update: ["PATCH /orgs/{org}"],
  9341. updateMembershipForAuthenticatedUser: [
  9342. "PATCH /user/memberships/orgs/{org}"
  9343. ],
  9344. updatePatAccess: ["POST /orgs/{org}/personal-access-tokens/{pat_id}"],
  9345. updatePatAccesses: ["POST /orgs/{org}/personal-access-tokens"],
  9346. updateWebhook: ["PATCH /orgs/{org}/hooks/{hook_id}"],
  9347. updateWebhookConfigForOrg: ["PATCH /orgs/{org}/hooks/{hook_id}/config"]
  9348. },
  9349. packages: {
  9350. deletePackageForAuthenticatedUser: [
  9351. "DELETE /user/packages/{package_type}/{package_name}"
  9352. ],
  9353. deletePackageForOrg: [
  9354. "DELETE /orgs/{org}/packages/{package_type}/{package_name}"
  9355. ],
  9356. deletePackageForUser: [
  9357. "DELETE /users/{username}/packages/{package_type}/{package_name}"
  9358. ],
  9359. deletePackageVersionForAuthenticatedUser: [
  9360. "DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9361. ],
  9362. deletePackageVersionForOrg: [
  9363. "DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9364. ],
  9365. deletePackageVersionForUser: [
  9366. "DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9367. ],
  9368. getAllPackageVersionsForAPackageOwnedByAnOrg: [
  9369. "GET /orgs/{org}/packages/{package_type}/{package_name}/versions",
  9370. {},
  9371. { renamed: ["packages", "getAllPackageVersionsForPackageOwnedByOrg"] }
  9372. ],
  9373. getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser: [
  9374. "GET /user/packages/{package_type}/{package_name}/versions",
  9375. {},
  9376. {
  9377. renamed: [
  9378. "packages",
  9379. "getAllPackageVersionsForPackageOwnedByAuthenticatedUser"
  9380. ]
  9381. }
  9382. ],
  9383. getAllPackageVersionsForPackageOwnedByAuthenticatedUser: [
  9384. "GET /user/packages/{package_type}/{package_name}/versions"
  9385. ],
  9386. getAllPackageVersionsForPackageOwnedByOrg: [
  9387. "GET /orgs/{org}/packages/{package_type}/{package_name}/versions"
  9388. ],
  9389. getAllPackageVersionsForPackageOwnedByUser: [
  9390. "GET /users/{username}/packages/{package_type}/{package_name}/versions"
  9391. ],
  9392. getPackageForAuthenticatedUser: [
  9393. "GET /user/packages/{package_type}/{package_name}"
  9394. ],
  9395. getPackageForOrganization: [
  9396. "GET /orgs/{org}/packages/{package_type}/{package_name}"
  9397. ],
  9398. getPackageForUser: [
  9399. "GET /users/{username}/packages/{package_type}/{package_name}"
  9400. ],
  9401. getPackageVersionForAuthenticatedUser: [
  9402. "GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9403. ],
  9404. getPackageVersionForOrganization: [
  9405. "GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9406. ],
  9407. getPackageVersionForUser: [
  9408. "GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9409. ],
  9410. listDockerMigrationConflictingPackagesForAuthenticatedUser: [
  9411. "GET /user/docker/conflicts"
  9412. ],
  9413. listDockerMigrationConflictingPackagesForOrganization: [
  9414. "GET /orgs/{org}/docker/conflicts"
  9415. ],
  9416. listDockerMigrationConflictingPackagesForUser: [
  9417. "GET /users/{username}/docker/conflicts"
  9418. ],
  9419. listPackagesForAuthenticatedUser: ["GET /user/packages"],
  9420. listPackagesForOrganization: ["GET /orgs/{org}/packages"],
  9421. listPackagesForUser: ["GET /users/{username}/packages"],
  9422. restorePackageForAuthenticatedUser: [
  9423. "POST /user/packages/{package_type}/{package_name}/restore{?token}"
  9424. ],
  9425. restorePackageForOrg: [
  9426. "POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}"
  9427. ],
  9428. restorePackageForUser: [
  9429. "POST /users/{username}/packages/{package_type}/{package_name}/restore{?token}"
  9430. ],
  9431. restorePackageVersionForAuthenticatedUser: [
  9432. "POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"
  9433. ],
  9434. restorePackageVersionForOrg: [
  9435. "POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"
  9436. ],
  9437. restorePackageVersionForUser: [
  9438. "POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"
  9439. ]
  9440. },
  9441. projects: {
  9442. addCollaborator: ["PUT /projects/{project_id}/collaborators/{username}"],
  9443. createCard: ["POST /projects/columns/{column_id}/cards"],
  9444. createColumn: ["POST /projects/{project_id}/columns"],
  9445. createForAuthenticatedUser: ["POST /user/projects"],
  9446. createForOrg: ["POST /orgs/{org}/projects"],
  9447. createForRepo: ["POST /repos/{owner}/{repo}/projects"],
  9448. delete: ["DELETE /projects/{project_id}"],
  9449. deleteCard: ["DELETE /projects/columns/cards/{card_id}"],
  9450. deleteColumn: ["DELETE /projects/columns/{column_id}"],
  9451. get: ["GET /projects/{project_id}"],
  9452. getCard: ["GET /projects/columns/cards/{card_id}"],
  9453. getColumn: ["GET /projects/columns/{column_id}"],
  9454. getPermissionForUser: [
  9455. "GET /projects/{project_id}/collaborators/{username}/permission"
  9456. ],
  9457. listCards: ["GET /projects/columns/{column_id}/cards"],
  9458. listCollaborators: ["GET /projects/{project_id}/collaborators"],
  9459. listColumns: ["GET /projects/{project_id}/columns"],
  9460. listForOrg: ["GET /orgs/{org}/projects"],
  9461. listForRepo: ["GET /repos/{owner}/{repo}/projects"],
  9462. listForUser: ["GET /users/{username}/projects"],
  9463. moveCard: ["POST /projects/columns/cards/{card_id}/moves"],
  9464. moveColumn: ["POST /projects/columns/{column_id}/moves"],
  9465. removeCollaborator: [
  9466. "DELETE /projects/{project_id}/collaborators/{username}"
  9467. ],
  9468. update: ["PATCH /projects/{project_id}"],
  9469. updateCard: ["PATCH /projects/columns/cards/{card_id}"],
  9470. updateColumn: ["PATCH /projects/columns/{column_id}"]
  9471. },
  9472. pulls: {
  9473. checkIfMerged: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/merge"],
  9474. create: ["POST /repos/{owner}/{repo}/pulls"],
  9475. createReplyForReviewComment: [
  9476. "POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies"
  9477. ],
  9478. createReview: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],
  9479. createReviewComment: [
  9480. "POST /repos/{owner}/{repo}/pulls/{pull_number}/comments"
  9481. ],
  9482. deletePendingReview: [
  9483. "DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"
  9484. ],
  9485. deleteReviewComment: [
  9486. "DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}"
  9487. ],
  9488. dismissReview: [
  9489. "PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals"
  9490. ],
  9491. get: ["GET /repos/{owner}/{repo}/pulls/{pull_number}"],
  9492. getReview: [
  9493. "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"
  9494. ],
  9495. getReviewComment: ["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}"],
  9496. list: ["GET /repos/{owner}/{repo}/pulls"],
  9497. listCommentsForReview: [
  9498. "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments"
  9499. ],
  9500. listCommits: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/commits"],
  9501. listFiles: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/files"],
  9502. listRequestedReviewers: [
  9503. "GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"
  9504. ],
  9505. listReviewComments: [
  9506. "GET /repos/{owner}/{repo}/pulls/{pull_number}/comments"
  9507. ],
  9508. listReviewCommentsForRepo: ["GET /repos/{owner}/{repo}/pulls/comments"],
  9509. listReviews: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],
  9510. merge: ["PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge"],
  9511. removeRequestedReviewers: [
  9512. "DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"
  9513. ],
  9514. requestReviewers: [
  9515. "POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"
  9516. ],
  9517. submitReview: [
  9518. "POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events"
  9519. ],
  9520. update: ["PATCH /repos/{owner}/{repo}/pulls/{pull_number}"],
  9521. updateBranch: [
  9522. "PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch"
  9523. ],
  9524. updateReview: [
  9525. "PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"
  9526. ],
  9527. updateReviewComment: [
  9528. "PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}"
  9529. ]
  9530. },
  9531. rateLimit: { get: ["GET /rate_limit"] },
  9532. reactions: {
  9533. createForCommitComment: [
  9534. "POST /repos/{owner}/{repo}/comments/{comment_id}/reactions"
  9535. ],
  9536. createForIssue: [
  9537. "POST /repos/{owner}/{repo}/issues/{issue_number}/reactions"
  9538. ],
  9539. createForIssueComment: [
  9540. "POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"
  9541. ],
  9542. createForPullRequestReviewComment: [
  9543. "POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"
  9544. ],
  9545. createForRelease: [
  9546. "POST /repos/{owner}/{repo}/releases/{release_id}/reactions"
  9547. ],
  9548. createForTeamDiscussionCommentInOrg: [
  9549. "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"
  9550. ],
  9551. createForTeamDiscussionInOrg: [
  9552. "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"
  9553. ],
  9554. deleteForCommitComment: [
  9555. "DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}"
  9556. ],
  9557. deleteForIssue: [
  9558. "DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}"
  9559. ],
  9560. deleteForIssueComment: [
  9561. "DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}"
  9562. ],
  9563. deleteForPullRequestComment: [
  9564. "DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}"
  9565. ],
  9566. deleteForRelease: [
  9567. "DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}"
  9568. ],
  9569. deleteForTeamDiscussion: [
  9570. "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}"
  9571. ],
  9572. deleteForTeamDiscussionComment: [
  9573. "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}"
  9574. ],
  9575. listForCommitComment: [
  9576. "GET /repos/{owner}/{repo}/comments/{comment_id}/reactions"
  9577. ],
  9578. listForIssue: ["GET /repos/{owner}/{repo}/issues/{issue_number}/reactions"],
  9579. listForIssueComment: [
  9580. "GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"
  9581. ],
  9582. listForPullRequestReviewComment: [
  9583. "GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"
  9584. ],
  9585. listForRelease: [
  9586. "GET /repos/{owner}/{repo}/releases/{release_id}/reactions"
  9587. ],
  9588. listForTeamDiscussionCommentInOrg: [
  9589. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"
  9590. ],
  9591. listForTeamDiscussionInOrg: [
  9592. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"
  9593. ]
  9594. },
  9595. repos: {
  9596. acceptInvitation: [
  9597. "PATCH /user/repository_invitations/{invitation_id}",
  9598. {},
  9599. { renamed: ["repos", "acceptInvitationForAuthenticatedUser"] }
  9600. ],
  9601. acceptInvitationForAuthenticatedUser: [
  9602. "PATCH /user/repository_invitations/{invitation_id}"
  9603. ],
  9604. addAppAccessRestrictions: [
  9605. "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",
  9606. {},
  9607. { mapToData: "apps" }
  9608. ],
  9609. addCollaborator: ["PUT /repos/{owner}/{repo}/collaborators/{username}"],
  9610. addStatusCheckContexts: [
  9611. "POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",
  9612. {},
  9613. { mapToData: "contexts" }
  9614. ],
  9615. addTeamAccessRestrictions: [
  9616. "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",
  9617. {},
  9618. { mapToData: "teams" }
  9619. ],
  9620. addUserAccessRestrictions: [
  9621. "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",
  9622. {},
  9623. { mapToData: "users" }
  9624. ],
  9625. cancelPagesDeployment: [
  9626. "POST /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}/cancel"
  9627. ],
  9628. checkAutomatedSecurityFixes: [
  9629. "GET /repos/{owner}/{repo}/automated-security-fixes"
  9630. ],
  9631. checkCollaborator: ["GET /repos/{owner}/{repo}/collaborators/{username}"],
  9632. checkVulnerabilityAlerts: [
  9633. "GET /repos/{owner}/{repo}/vulnerability-alerts"
  9634. ],
  9635. codeownersErrors: ["GET /repos/{owner}/{repo}/codeowners/errors"],
  9636. compareCommits: ["GET /repos/{owner}/{repo}/compare/{base}...{head}"],
  9637. compareCommitsWithBasehead: [
  9638. "GET /repos/{owner}/{repo}/compare/{basehead}"
  9639. ],
  9640. createAutolink: ["POST /repos/{owner}/{repo}/autolinks"],
  9641. createCommitComment: [
  9642. "POST /repos/{owner}/{repo}/commits/{commit_sha}/comments"
  9643. ],
  9644. createCommitSignatureProtection: [
  9645. "POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
  9646. ],
  9647. createCommitStatus: ["POST /repos/{owner}/{repo}/statuses/{sha}"],
  9648. createDeployKey: ["POST /repos/{owner}/{repo}/keys"],
  9649. createDeployment: ["POST /repos/{owner}/{repo}/deployments"],
  9650. createDeploymentBranchPolicy: [
  9651. "POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"
  9652. ],
  9653. createDeploymentProtectionRule: [
  9654. "POST /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"
  9655. ],
  9656. createDeploymentStatus: [
  9657. "POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"
  9658. ],
  9659. createDispatchEvent: ["POST /repos/{owner}/{repo}/dispatches"],
  9660. createForAuthenticatedUser: ["POST /user/repos"],
  9661. createFork: ["POST /repos/{owner}/{repo}/forks"],
  9662. createInOrg: ["POST /orgs/{org}/repos"],
  9663. createOrUpdateCustomPropertiesValues: [
  9664. "PATCH /repos/{owner}/{repo}/properties/values"
  9665. ],
  9666. createOrUpdateEnvironment: [
  9667. "PUT /repos/{owner}/{repo}/environments/{environment_name}"
  9668. ],
  9669. createOrUpdateFileContents: ["PUT /repos/{owner}/{repo}/contents/{path}"],
  9670. createOrgRuleset: ["POST /orgs/{org}/rulesets"],
  9671. createPagesDeployment: ["POST /repos/{owner}/{repo}/pages/deployments"],
  9672. createPagesSite: ["POST /repos/{owner}/{repo}/pages"],
  9673. createRelease: ["POST /repos/{owner}/{repo}/releases"],
  9674. createRepoRuleset: ["POST /repos/{owner}/{repo}/rulesets"],
  9675. createTagProtection: ["POST /repos/{owner}/{repo}/tags/protection"],
  9676. createUsingTemplate: [
  9677. "POST /repos/{template_owner}/{template_repo}/generate"
  9678. ],
  9679. createWebhook: ["POST /repos/{owner}/{repo}/hooks"],
  9680. declineInvitation: [
  9681. "DELETE /user/repository_invitations/{invitation_id}",
  9682. {},
  9683. { renamed: ["repos", "declineInvitationForAuthenticatedUser"] }
  9684. ],
  9685. declineInvitationForAuthenticatedUser: [
  9686. "DELETE /user/repository_invitations/{invitation_id}"
  9687. ],
  9688. delete: ["DELETE /repos/{owner}/{repo}"],
  9689. deleteAccessRestrictions: [
  9690. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"
  9691. ],
  9692. deleteAdminBranchProtection: [
  9693. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"
  9694. ],
  9695. deleteAnEnvironment: [
  9696. "DELETE /repos/{owner}/{repo}/environments/{environment_name}"
  9697. ],
  9698. deleteAutolink: ["DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}"],
  9699. deleteBranchProtection: [
  9700. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection"
  9701. ],
  9702. deleteCommitComment: ["DELETE /repos/{owner}/{repo}/comments/{comment_id}"],
  9703. deleteCommitSignatureProtection: [
  9704. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
  9705. ],
  9706. deleteDeployKey: ["DELETE /repos/{owner}/{repo}/keys/{key_id}"],
  9707. deleteDeployment: [
  9708. "DELETE /repos/{owner}/{repo}/deployments/{deployment_id}"
  9709. ],
  9710. deleteDeploymentBranchPolicy: [
  9711. "DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
  9712. ],
  9713. deleteFile: ["DELETE /repos/{owner}/{repo}/contents/{path}"],
  9714. deleteInvitation: [
  9715. "DELETE /repos/{owner}/{repo}/invitations/{invitation_id}"
  9716. ],
  9717. deleteOrgRuleset: ["DELETE /orgs/{org}/rulesets/{ruleset_id}"],
  9718. deletePagesSite: ["DELETE /repos/{owner}/{repo}/pages"],
  9719. deletePullRequestReviewProtection: [
  9720. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
  9721. ],
  9722. deleteRelease: ["DELETE /repos/{owner}/{repo}/releases/{release_id}"],
  9723. deleteReleaseAsset: [
  9724. "DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}"
  9725. ],
  9726. deleteRepoRuleset: ["DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id}"],
  9727. deleteTagProtection: [
  9728. "DELETE /repos/{owner}/{repo}/tags/protection/{tag_protection_id}"
  9729. ],
  9730. deleteWebhook: ["DELETE /repos/{owner}/{repo}/hooks/{hook_id}"],
  9731. disableAutomatedSecurityFixes: [
  9732. "DELETE /repos/{owner}/{repo}/automated-security-fixes"
  9733. ],
  9734. disableDeploymentProtectionRule: [
  9735. "DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"
  9736. ],
  9737. disablePrivateVulnerabilityReporting: [
  9738. "DELETE /repos/{owner}/{repo}/private-vulnerability-reporting"
  9739. ],
  9740. disableVulnerabilityAlerts: [
  9741. "DELETE /repos/{owner}/{repo}/vulnerability-alerts"
  9742. ],
  9743. downloadArchive: [
  9744. "GET /repos/{owner}/{repo}/zipball/{ref}",
  9745. {},
  9746. { renamed: ["repos", "downloadZipballArchive"] }
  9747. ],
  9748. downloadTarballArchive: ["GET /repos/{owner}/{repo}/tarball/{ref}"],
  9749. downloadZipballArchive: ["GET /repos/{owner}/{repo}/zipball/{ref}"],
  9750. enableAutomatedSecurityFixes: [
  9751. "PUT /repos/{owner}/{repo}/automated-security-fixes"
  9752. ],
  9753. enablePrivateVulnerabilityReporting: [
  9754. "PUT /repos/{owner}/{repo}/private-vulnerability-reporting"
  9755. ],
  9756. enableVulnerabilityAlerts: [
  9757. "PUT /repos/{owner}/{repo}/vulnerability-alerts"
  9758. ],
  9759. generateReleaseNotes: [
  9760. "POST /repos/{owner}/{repo}/releases/generate-notes"
  9761. ],
  9762. get: ["GET /repos/{owner}/{repo}"],
  9763. getAccessRestrictions: [
  9764. "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"
  9765. ],
  9766. getAdminBranchProtection: [
  9767. "GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"
  9768. ],
  9769. getAllDeploymentProtectionRules: [
  9770. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"
  9771. ],
  9772. getAllEnvironments: ["GET /repos/{owner}/{repo}/environments"],
  9773. getAllStatusCheckContexts: [
  9774. "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"
  9775. ],
  9776. getAllTopics: ["GET /repos/{owner}/{repo}/topics"],
  9777. getAppsWithAccessToProtectedBranch: [
  9778. "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"
  9779. ],
  9780. getAutolink: ["GET /repos/{owner}/{repo}/autolinks/{autolink_id}"],
  9781. getBranch: ["GET /repos/{owner}/{repo}/branches/{branch}"],
  9782. getBranchProtection: [
  9783. "GET /repos/{owner}/{repo}/branches/{branch}/protection"
  9784. ],
  9785. getBranchRules: ["GET /repos/{owner}/{repo}/rules/branches/{branch}"],
  9786. getClones: ["GET /repos/{owner}/{repo}/traffic/clones"],
  9787. getCodeFrequencyStats: ["GET /repos/{owner}/{repo}/stats/code_frequency"],
  9788. getCollaboratorPermissionLevel: [
  9789. "GET /repos/{owner}/{repo}/collaborators/{username}/permission"
  9790. ],
  9791. getCombinedStatusForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/status"],
  9792. getCommit: ["GET /repos/{owner}/{repo}/commits/{ref}"],
  9793. getCommitActivityStats: ["GET /repos/{owner}/{repo}/stats/commit_activity"],
  9794. getCommitComment: ["GET /repos/{owner}/{repo}/comments/{comment_id}"],
  9795. getCommitSignatureProtection: [
  9796. "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
  9797. ],
  9798. getCommunityProfileMetrics: ["GET /repos/{owner}/{repo}/community/profile"],
  9799. getContent: ["GET /repos/{owner}/{repo}/contents/{path}"],
  9800. getContributorsStats: ["GET /repos/{owner}/{repo}/stats/contributors"],
  9801. getCustomDeploymentProtectionRule: [
  9802. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"
  9803. ],
  9804. getCustomPropertiesValues: ["GET /repos/{owner}/{repo}/properties/values"],
  9805. getDeployKey: ["GET /repos/{owner}/{repo}/keys/{key_id}"],
  9806. getDeployment: ["GET /repos/{owner}/{repo}/deployments/{deployment_id}"],
  9807. getDeploymentBranchPolicy: [
  9808. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
  9809. ],
  9810. getDeploymentStatus: [
  9811. "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}"
  9812. ],
  9813. getEnvironment: [
  9814. "GET /repos/{owner}/{repo}/environments/{environment_name}"
  9815. ],
  9816. getLatestPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/latest"],
  9817. getLatestRelease: ["GET /repos/{owner}/{repo}/releases/latest"],
  9818. getOrgRuleSuite: ["GET /orgs/{org}/rulesets/rule-suites/{rule_suite_id}"],
  9819. getOrgRuleSuites: ["GET /orgs/{org}/rulesets/rule-suites"],
  9820. getOrgRuleset: ["GET /orgs/{org}/rulesets/{ruleset_id}"],
  9821. getOrgRulesets: ["GET /orgs/{org}/rulesets"],
  9822. getPages: ["GET /repos/{owner}/{repo}/pages"],
  9823. getPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/{build_id}"],
  9824. getPagesDeployment: [
  9825. "GET /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}"
  9826. ],
  9827. getPagesHealthCheck: ["GET /repos/{owner}/{repo}/pages/health"],
  9828. getParticipationStats: ["GET /repos/{owner}/{repo}/stats/participation"],
  9829. getPullRequestReviewProtection: [
  9830. "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
  9831. ],
  9832. getPunchCardStats: ["GET /repos/{owner}/{repo}/stats/punch_card"],
  9833. getReadme: ["GET /repos/{owner}/{repo}/readme"],
  9834. getReadmeInDirectory: ["GET /repos/{owner}/{repo}/readme/{dir}"],
  9835. getRelease: ["GET /repos/{owner}/{repo}/releases/{release_id}"],
  9836. getReleaseAsset: ["GET /repos/{owner}/{repo}/releases/assets/{asset_id}"],
  9837. getReleaseByTag: ["GET /repos/{owner}/{repo}/releases/tags/{tag}"],
  9838. getRepoRuleSuite: [
  9839. "GET /repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}"
  9840. ],
  9841. getRepoRuleSuites: ["GET /repos/{owner}/{repo}/rulesets/rule-suites"],
  9842. getRepoRuleset: ["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}"],
  9843. getRepoRulesets: ["GET /repos/{owner}/{repo}/rulesets"],
  9844. getStatusChecksProtection: [
  9845. "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
  9846. ],
  9847. getTeamsWithAccessToProtectedBranch: [
  9848. "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams"
  9849. ],
  9850. getTopPaths: ["GET /repos/{owner}/{repo}/traffic/popular/paths"],
  9851. getTopReferrers: ["GET /repos/{owner}/{repo}/traffic/popular/referrers"],
  9852. getUsersWithAccessToProtectedBranch: [
  9853. "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users"
  9854. ],
  9855. getViews: ["GET /repos/{owner}/{repo}/traffic/views"],
  9856. getWebhook: ["GET /repos/{owner}/{repo}/hooks/{hook_id}"],
  9857. getWebhookConfigForRepo: [
  9858. "GET /repos/{owner}/{repo}/hooks/{hook_id}/config"
  9859. ],
  9860. getWebhookDelivery: [
  9861. "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}"
  9862. ],
  9863. listActivities: ["GET /repos/{owner}/{repo}/activity"],
  9864. listAutolinks: ["GET /repos/{owner}/{repo}/autolinks"],
  9865. listBranches: ["GET /repos/{owner}/{repo}/branches"],
  9866. listBranchesForHeadCommit: [
  9867. "GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head"
  9868. ],
  9869. listCollaborators: ["GET /repos/{owner}/{repo}/collaborators"],
  9870. listCommentsForCommit: [
  9871. "GET /repos/{owner}/{repo}/commits/{commit_sha}/comments"
  9872. ],
  9873. listCommitCommentsForRepo: ["GET /repos/{owner}/{repo}/comments"],
  9874. listCommitStatusesForRef: [
  9875. "GET /repos/{owner}/{repo}/commits/{ref}/statuses"
  9876. ],
  9877. listCommits: ["GET /repos/{owner}/{repo}/commits"],
  9878. listContributors: ["GET /repos/{owner}/{repo}/contributors"],
  9879. listCustomDeploymentRuleIntegrations: [
  9880. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps"
  9881. ],
  9882. listDeployKeys: ["GET /repos/{owner}/{repo}/keys"],
  9883. listDeploymentBranchPolicies: [
  9884. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"
  9885. ],
  9886. listDeploymentStatuses: [
  9887. "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"
  9888. ],
  9889. listDeployments: ["GET /repos/{owner}/{repo}/deployments"],
  9890. listForAuthenticatedUser: ["GET /user/repos"],
  9891. listForOrg: ["GET /orgs/{org}/repos"],
  9892. listForUser: ["GET /users/{username}/repos"],
  9893. listForks: ["GET /repos/{owner}/{repo}/forks"],
  9894. listInvitations: ["GET /repos/{owner}/{repo}/invitations"],
  9895. listInvitationsForAuthenticatedUser: ["GET /user/repository_invitations"],
  9896. listLanguages: ["GET /repos/{owner}/{repo}/languages"],
  9897. listPagesBuilds: ["GET /repos/{owner}/{repo}/pages/builds"],
  9898. listPublic: ["GET /repositories"],
  9899. listPullRequestsAssociatedWithCommit: [
  9900. "GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls"
  9901. ],
  9902. listReleaseAssets: [
  9903. "GET /repos/{owner}/{repo}/releases/{release_id}/assets"
  9904. ],
  9905. listReleases: ["GET /repos/{owner}/{repo}/releases"],
  9906. listTagProtection: ["GET /repos/{owner}/{repo}/tags/protection"],
  9907. listTags: ["GET /repos/{owner}/{repo}/tags"],
  9908. listTeams: ["GET /repos/{owner}/{repo}/teams"],
  9909. listWebhookDeliveries: [
  9910. "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries"
  9911. ],
  9912. listWebhooks: ["GET /repos/{owner}/{repo}/hooks"],
  9913. merge: ["POST /repos/{owner}/{repo}/merges"],
  9914. mergeUpstream: ["POST /repos/{owner}/{repo}/merge-upstream"],
  9915. pingWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/pings"],
  9916. redeliverWebhookDelivery: [
  9917. "POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"
  9918. ],
  9919. removeAppAccessRestrictions: [
  9920. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",
  9921. {},
  9922. { mapToData: "apps" }
  9923. ],
  9924. removeCollaborator: [
  9925. "DELETE /repos/{owner}/{repo}/collaborators/{username}"
  9926. ],
  9927. removeStatusCheckContexts: [
  9928. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",
  9929. {},
  9930. { mapToData: "contexts" }
  9931. ],
  9932. removeStatusCheckProtection: [
  9933. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
  9934. ],
  9935. removeTeamAccessRestrictions: [
  9936. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",
  9937. {},
  9938. { mapToData: "teams" }
  9939. ],
  9940. removeUserAccessRestrictions: [
  9941. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",
  9942. {},
  9943. { mapToData: "users" }
  9944. ],
  9945. renameBranch: ["POST /repos/{owner}/{repo}/branches/{branch}/rename"],
  9946. replaceAllTopics: ["PUT /repos/{owner}/{repo}/topics"],
  9947. requestPagesBuild: ["POST /repos/{owner}/{repo}/pages/builds"],
  9948. setAdminBranchProtection: [
  9949. "POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"
  9950. ],
  9951. setAppAccessRestrictions: [
  9952. "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",
  9953. {},
  9954. { mapToData: "apps" }
  9955. ],
  9956. setStatusCheckContexts: [
  9957. "PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",
  9958. {},
  9959. { mapToData: "contexts" }
  9960. ],
  9961. setTeamAccessRestrictions: [
  9962. "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",
  9963. {},
  9964. { mapToData: "teams" }
  9965. ],
  9966. setUserAccessRestrictions: [
  9967. "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",
  9968. {},
  9969. { mapToData: "users" }
  9970. ],
  9971. testPushWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/tests"],
  9972. transfer: ["POST /repos/{owner}/{repo}/transfer"],
  9973. update: ["PATCH /repos/{owner}/{repo}"],
  9974. updateBranchProtection: [
  9975. "PUT /repos/{owner}/{repo}/branches/{branch}/protection"
  9976. ],
  9977. updateCommitComment: ["PATCH /repos/{owner}/{repo}/comments/{comment_id}"],
  9978. updateDeploymentBranchPolicy: [
  9979. "PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
  9980. ],
  9981. updateInformationAboutPagesSite: ["PUT /repos/{owner}/{repo}/pages"],
  9982. updateInvitation: [
  9983. "PATCH /repos/{owner}/{repo}/invitations/{invitation_id}"
  9984. ],
  9985. updateOrgRuleset: ["PUT /orgs/{org}/rulesets/{ruleset_id}"],
  9986. updatePullRequestReviewProtection: [
  9987. "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
  9988. ],
  9989. updateRelease: ["PATCH /repos/{owner}/{repo}/releases/{release_id}"],
  9990. updateReleaseAsset: [
  9991. "PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}"
  9992. ],
  9993. updateRepoRuleset: ["PUT /repos/{owner}/{repo}/rulesets/{ruleset_id}"],
  9994. updateStatusCheckPotection: [
  9995. "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks",
  9996. {},
  9997. { renamed: ["repos", "updateStatusCheckProtection"] }
  9998. ],
  9999. updateStatusCheckProtection: [
  10000. "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
  10001. ],
  10002. updateWebhook: ["PATCH /repos/{owner}/{repo}/hooks/{hook_id}"],
  10003. updateWebhookConfigForRepo: [
  10004. "PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config"
  10005. ],
  10006. uploadReleaseAsset: [
  10007. "POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}",
  10008. { baseUrl: "https://uploads.github.com" }
  10009. ]
  10010. },
  10011. search: {
  10012. code: ["GET /search/code"],
  10013. commits: ["GET /search/commits"],
  10014. issuesAndPullRequests: ["GET /search/issues"],
  10015. labels: ["GET /search/labels"],
  10016. repos: ["GET /search/repositories"],
  10017. topics: ["GET /search/topics"],
  10018. users: ["GET /search/users"]
  10019. },
  10020. secretScanning: {
  10021. getAlert: [
  10022. "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"
  10023. ],
  10024. listAlertsForEnterprise: [
  10025. "GET /enterprises/{enterprise}/secret-scanning/alerts"
  10026. ],
  10027. listAlertsForOrg: ["GET /orgs/{org}/secret-scanning/alerts"],
  10028. listAlertsForRepo: ["GET /repos/{owner}/{repo}/secret-scanning/alerts"],
  10029. listLocationsForAlert: [
  10030. "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations"
  10031. ],
  10032. updateAlert: [
  10033. "PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"
  10034. ]
  10035. },
  10036. securityAdvisories: {
  10037. createFork: [
  10038. "POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/forks"
  10039. ],
  10040. createPrivateVulnerabilityReport: [
  10041. "POST /repos/{owner}/{repo}/security-advisories/reports"
  10042. ],
  10043. createRepositoryAdvisory: [
  10044. "POST /repos/{owner}/{repo}/security-advisories"
  10045. ],
  10046. createRepositoryAdvisoryCveRequest: [
  10047. "POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/cve"
  10048. ],
  10049. getGlobalAdvisory: ["GET /advisories/{ghsa_id}"],
  10050. getRepositoryAdvisory: [
  10051. "GET /repos/{owner}/{repo}/security-advisories/{ghsa_id}"
  10052. ],
  10053. listGlobalAdvisories: ["GET /advisories"],
  10054. listOrgRepositoryAdvisories: ["GET /orgs/{org}/security-advisories"],
  10055. listRepositoryAdvisories: ["GET /repos/{owner}/{repo}/security-advisories"],
  10056. updateRepositoryAdvisory: [
  10057. "PATCH /repos/{owner}/{repo}/security-advisories/{ghsa_id}"
  10058. ]
  10059. },
  10060. teams: {
  10061. addOrUpdateMembershipForUserInOrg: [
  10062. "PUT /orgs/{org}/teams/{team_slug}/memberships/{username}"
  10063. ],
  10064. addOrUpdateProjectPermissionsInOrg: [
  10065. "PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}"
  10066. ],
  10067. addOrUpdateRepoPermissionsInOrg: [
  10068. "PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
  10069. ],
  10070. checkPermissionsForProjectInOrg: [
  10071. "GET /orgs/{org}/teams/{team_slug}/projects/{project_id}"
  10072. ],
  10073. checkPermissionsForRepoInOrg: [
  10074. "GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
  10075. ],
  10076. create: ["POST /orgs/{org}/teams"],
  10077. createDiscussionCommentInOrg: [
  10078. "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"
  10079. ],
  10080. createDiscussionInOrg: ["POST /orgs/{org}/teams/{team_slug}/discussions"],
  10081. deleteDiscussionCommentInOrg: [
  10082. "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"
  10083. ],
  10084. deleteDiscussionInOrg: [
  10085. "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"
  10086. ],
  10087. deleteInOrg: ["DELETE /orgs/{org}/teams/{team_slug}"],
  10088. getByName: ["GET /orgs/{org}/teams/{team_slug}"],
  10089. getDiscussionCommentInOrg: [
  10090. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"
  10091. ],
  10092. getDiscussionInOrg: [
  10093. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"
  10094. ],
  10095. getMembershipForUserInOrg: [
  10096. "GET /orgs/{org}/teams/{team_slug}/memberships/{username}"
  10097. ],
  10098. list: ["GET /orgs/{org}/teams"],
  10099. listChildInOrg: ["GET /orgs/{org}/teams/{team_slug}/teams"],
  10100. listDiscussionCommentsInOrg: [
  10101. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"
  10102. ],
  10103. listDiscussionsInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions"],
  10104. listForAuthenticatedUser: ["GET /user/teams"],
  10105. listMembersInOrg: ["GET /orgs/{org}/teams/{team_slug}/members"],
  10106. listPendingInvitationsInOrg: [
  10107. "GET /orgs/{org}/teams/{team_slug}/invitations"
  10108. ],
  10109. listProjectsInOrg: ["GET /orgs/{org}/teams/{team_slug}/projects"],
  10110. listReposInOrg: ["GET /orgs/{org}/teams/{team_slug}/repos"],
  10111. removeMembershipForUserInOrg: [
  10112. "DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}"
  10113. ],
  10114. removeProjectInOrg: [
  10115. "DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}"
  10116. ],
  10117. removeRepoInOrg: [
  10118. "DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
  10119. ],
  10120. updateDiscussionCommentInOrg: [
  10121. "PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"
  10122. ],
  10123. updateDiscussionInOrg: [
  10124. "PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"
  10125. ],
  10126. updateInOrg: ["PATCH /orgs/{org}/teams/{team_slug}"]
  10127. },
  10128. users: {
  10129. addEmailForAuthenticated: [
  10130. "POST /user/emails",
  10131. {},
  10132. { renamed: ["users", "addEmailForAuthenticatedUser"] }
  10133. ],
  10134. addEmailForAuthenticatedUser: ["POST /user/emails"],
  10135. addSocialAccountForAuthenticatedUser: ["POST /user/social_accounts"],
  10136. block: ["PUT /user/blocks/{username}"],
  10137. checkBlocked: ["GET /user/blocks/{username}"],
  10138. checkFollowingForUser: ["GET /users/{username}/following/{target_user}"],
  10139. checkPersonIsFollowedByAuthenticated: ["GET /user/following/{username}"],
  10140. createGpgKeyForAuthenticated: [
  10141. "POST /user/gpg_keys",
  10142. {},
  10143. { renamed: ["users", "createGpgKeyForAuthenticatedUser"] }
  10144. ],
  10145. createGpgKeyForAuthenticatedUser: ["POST /user/gpg_keys"],
  10146. createPublicSshKeyForAuthenticated: [
  10147. "POST /user/keys",
  10148. {},
  10149. { renamed: ["users", "createPublicSshKeyForAuthenticatedUser"] }
  10150. ],
  10151. createPublicSshKeyForAuthenticatedUser: ["POST /user/keys"],
  10152. createSshSigningKeyForAuthenticatedUser: ["POST /user/ssh_signing_keys"],
  10153. deleteEmailForAuthenticated: [
  10154. "DELETE /user/emails",
  10155. {},
  10156. { renamed: ["users", "deleteEmailForAuthenticatedUser"] }
  10157. ],
  10158. deleteEmailForAuthenticatedUser: ["DELETE /user/emails"],
  10159. deleteGpgKeyForAuthenticated: [
  10160. "DELETE /user/gpg_keys/{gpg_key_id}",
  10161. {},
  10162. { renamed: ["users", "deleteGpgKeyForAuthenticatedUser"] }
  10163. ],
  10164. deleteGpgKeyForAuthenticatedUser: ["DELETE /user/gpg_keys/{gpg_key_id}"],
  10165. deletePublicSshKeyForAuthenticated: [
  10166. "DELETE /user/keys/{key_id}",
  10167. {},
  10168. { renamed: ["users", "deletePublicSshKeyForAuthenticatedUser"] }
  10169. ],
  10170. deletePublicSshKeyForAuthenticatedUser: ["DELETE /user/keys/{key_id}"],
  10171. deleteSocialAccountForAuthenticatedUser: ["DELETE /user/social_accounts"],
  10172. deleteSshSigningKeyForAuthenticatedUser: [
  10173. "DELETE /user/ssh_signing_keys/{ssh_signing_key_id}"
  10174. ],
  10175. follow: ["PUT /user/following/{username}"],
  10176. getAuthenticated: ["GET /user"],
  10177. getByUsername: ["GET /users/{username}"],
  10178. getContextForUser: ["GET /users/{username}/hovercard"],
  10179. getGpgKeyForAuthenticated: [
  10180. "GET /user/gpg_keys/{gpg_key_id}",
  10181. {},
  10182. { renamed: ["users", "getGpgKeyForAuthenticatedUser"] }
  10183. ],
  10184. getGpgKeyForAuthenticatedUser: ["GET /user/gpg_keys/{gpg_key_id}"],
  10185. getPublicSshKeyForAuthenticated: [
  10186. "GET /user/keys/{key_id}",
  10187. {},
  10188. { renamed: ["users", "getPublicSshKeyForAuthenticatedUser"] }
  10189. ],
  10190. getPublicSshKeyForAuthenticatedUser: ["GET /user/keys/{key_id}"],
  10191. getSshSigningKeyForAuthenticatedUser: [
  10192. "GET /user/ssh_signing_keys/{ssh_signing_key_id}"
  10193. ],
  10194. list: ["GET /users"],
  10195. listBlockedByAuthenticated: [
  10196. "GET /user/blocks",
  10197. {},
  10198. { renamed: ["users", "listBlockedByAuthenticatedUser"] }
  10199. ],
  10200. listBlockedByAuthenticatedUser: ["GET /user/blocks"],
  10201. listEmailsForAuthenticated: [
  10202. "GET /user/emails",
  10203. {},
  10204. { renamed: ["users", "listEmailsForAuthenticatedUser"] }
  10205. ],
  10206. listEmailsForAuthenticatedUser: ["GET /user/emails"],
  10207. listFollowedByAuthenticated: [
  10208. "GET /user/following",
  10209. {},
  10210. { renamed: ["users", "listFollowedByAuthenticatedUser"] }
  10211. ],
  10212. listFollowedByAuthenticatedUser: ["GET /user/following"],
  10213. listFollowersForAuthenticatedUser: ["GET /user/followers"],
  10214. listFollowersForUser: ["GET /users/{username}/followers"],
  10215. listFollowingForUser: ["GET /users/{username}/following"],
  10216. listGpgKeysForAuthenticated: [
  10217. "GET /user/gpg_keys",
  10218. {},
  10219. { renamed: ["users", "listGpgKeysForAuthenticatedUser"] }
  10220. ],
  10221. listGpgKeysForAuthenticatedUser: ["GET /user/gpg_keys"],
  10222. listGpgKeysForUser: ["GET /users/{username}/gpg_keys"],
  10223. listPublicEmailsForAuthenticated: [
  10224. "GET /user/public_emails",
  10225. {},
  10226. { renamed: ["users", "listPublicEmailsForAuthenticatedUser"] }
  10227. ],
  10228. listPublicEmailsForAuthenticatedUser: ["GET /user/public_emails"],
  10229. listPublicKeysForUser: ["GET /users/{username}/keys"],
  10230. listPublicSshKeysForAuthenticated: [
  10231. "GET /user/keys",
  10232. {},
  10233. { renamed: ["users", "listPublicSshKeysForAuthenticatedUser"] }
  10234. ],
  10235. listPublicSshKeysForAuthenticatedUser: ["GET /user/keys"],
  10236. listSocialAccountsForAuthenticatedUser: ["GET /user/social_accounts"],
  10237. listSocialAccountsForUser: ["GET /users/{username}/social_accounts"],
  10238. listSshSigningKeysForAuthenticatedUser: ["GET /user/ssh_signing_keys"],
  10239. listSshSigningKeysForUser: ["GET /users/{username}/ssh_signing_keys"],
  10240. setPrimaryEmailVisibilityForAuthenticated: [
  10241. "PATCH /user/email/visibility",
  10242. {},
  10243. { renamed: ["users", "setPrimaryEmailVisibilityForAuthenticatedUser"] }
  10244. ],
  10245. setPrimaryEmailVisibilityForAuthenticatedUser: [
  10246. "PATCH /user/email/visibility"
  10247. ],
  10248. unblock: ["DELETE /user/blocks/{username}"],
  10249. unfollow: ["DELETE /user/following/{username}"],
  10250. updateAuthenticated: ["PATCH /user"]
  10251. }
  10252. };
  10253. var endpoints_default = Endpoints;
  10254. // pkg/dist-src/endpoints-to-methods.js
  10255. var endpointMethodsMap = /* @__PURE__ */ new Map();
  10256. for (const [scope, endpoints] of Object.entries(endpoints_default)) {
  10257. for (const [methodName, endpoint] of Object.entries(endpoints)) {
  10258. const [route, defaults, decorations] = endpoint;
  10259. const [method, url] = route.split(/ /);
  10260. const endpointDefaults = Object.assign(
  10261. {
  10262. method,
  10263. url
  10264. },
  10265. defaults
  10266. );
  10267. if (!endpointMethodsMap.has(scope)) {
  10268. endpointMethodsMap.set(scope, /* @__PURE__ */ new Map());
  10269. }
  10270. endpointMethodsMap.get(scope).set(methodName, {
  10271. scope,
  10272. methodName,
  10273. endpointDefaults,
  10274. decorations
  10275. });
  10276. }
  10277. }
  10278. var handler = {
  10279. has({ scope }, methodName) {
  10280. return endpointMethodsMap.get(scope).has(methodName);
  10281. },
  10282. getOwnPropertyDescriptor(target, methodName) {
  10283. return {
  10284. value: this.get(target, methodName),
  10285. // ensures method is in the cache
  10286. configurable: true,
  10287. writable: true,
  10288. enumerable: true
  10289. };
  10290. },
  10291. defineProperty(target, methodName, descriptor) {
  10292. Object.defineProperty(target.cache, methodName, descriptor);
  10293. return true;
  10294. },
  10295. deleteProperty(target, methodName) {
  10296. delete target.cache[methodName];
  10297. return true;
  10298. },
  10299. ownKeys({ scope }) {
  10300. return [...endpointMethodsMap.get(scope).keys()];
  10301. },
  10302. set(target, methodName, value) {
  10303. return target.cache[methodName] = value;
  10304. },
  10305. get({ octokit, scope, cache }, methodName) {
  10306. if (cache[methodName]) {
  10307. return cache[methodName];
  10308. }
  10309. const method = endpointMethodsMap.get(scope).get(methodName);
  10310. if (!method) {
  10311. return void 0;
  10312. }
  10313. const { endpointDefaults, decorations } = method;
  10314. if (decorations) {
  10315. cache[methodName] = decorate(
  10316. octokit,
  10317. scope,
  10318. methodName,
  10319. endpointDefaults,
  10320. decorations
  10321. );
  10322. } else {
  10323. cache[methodName] = octokit.request.defaults(endpointDefaults);
  10324. }
  10325. return cache[methodName];
  10326. }
  10327. };
  10328. function endpointsToMethods(octokit) {
  10329. const newMethods = {};
  10330. for (const scope of endpointMethodsMap.keys()) {
  10331. newMethods[scope] = new Proxy({ octokit, scope, cache: {} }, handler);
  10332. }
  10333. return newMethods;
  10334. }
  10335. function decorate(octokit, scope, methodName, defaults, decorations) {
  10336. const requestWithDefaults = octokit.request.defaults(defaults);
  10337. function withDecorations(...args) {
  10338. let options = requestWithDefaults.endpoint.merge(...args);
  10339. if (decorations.mapToData) {
  10340. options = Object.assign({}, options, {
  10341. data: options[decorations.mapToData],
  10342. [decorations.mapToData]: void 0
  10343. });
  10344. return requestWithDefaults(options);
  10345. }
  10346. if (decorations.renamed) {
  10347. const [newScope, newMethodName] = decorations.renamed;
  10348. octokit.log.warn(
  10349. `octokit.${scope}.${methodName}() has been renamed to octokit.${newScope}.${newMethodName}()`
  10350. );
  10351. }
  10352. if (decorations.deprecated) {
  10353. octokit.log.warn(decorations.deprecated);
  10354. }
  10355. if (decorations.renamedParameters) {
  10356. const options2 = requestWithDefaults.endpoint.merge(...args);
  10357. for (const [name, alias] of Object.entries(
  10358. decorations.renamedParameters
  10359. )) {
  10360. if (name in options2) {
  10361. octokit.log.warn(
  10362. `"${name}" parameter is deprecated for "octokit.${scope}.${methodName}()". Use "${alias}" instead`
  10363. );
  10364. if (!(alias in options2)) {
  10365. options2[alias] = options2[name];
  10366. }
  10367. delete options2[name];
  10368. }
  10369. }
  10370. return requestWithDefaults(options2);
  10371. }
  10372. return requestWithDefaults(...args);
  10373. }
  10374. return Object.assign(withDecorations, requestWithDefaults);
  10375. }
  10376. // pkg/dist-src/index.js
  10377. function restEndpointMethods(octokit) {
  10378. const api = endpointsToMethods(octokit);
  10379. return {
  10380. rest: api
  10381. };
  10382. }
  10383. restEndpointMethods.VERSION = VERSION;
  10384. function legacyRestEndpointMethods(octokit) {
  10385. const api = endpointsToMethods(octokit);
  10386. return {
  10387. ...api,
  10388. rest: api
  10389. };
  10390. }
  10391. legacyRestEndpointMethods.VERSION = VERSION;
  10392. // Annotate the CommonJS export names for ESM import in node:
  10393. 0 && (0);
  10394. /***/ }),
  10395. /***/ 537:
  10396. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  10397. "use strict";
  10398. var __create = Object.create;
  10399. var __defProp = Object.defineProperty;
  10400. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  10401. var __getOwnPropNames = Object.getOwnPropertyNames;
  10402. var __getProtoOf = Object.getPrototypeOf;
  10403. var __hasOwnProp = Object.prototype.hasOwnProperty;
  10404. var __export = (target, all) => {
  10405. for (var name in all)
  10406. __defProp(target, name, { get: all[name], enumerable: true });
  10407. };
  10408. var __copyProps = (to, from, except, desc) => {
  10409. if (from && typeof from === "object" || typeof from === "function") {
  10410. for (let key of __getOwnPropNames(from))
  10411. if (!__hasOwnProp.call(to, key) && key !== except)
  10412. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  10413. }
  10414. return to;
  10415. };
  10416. var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  10417. // If the importer is in node compatibility mode or this is not an ESM
  10418. // file that has been converted to a CommonJS file using a Babel-
  10419. // compatible transform (i.e. "__esModule" has not been set), then set
  10420. // "default" to the CommonJS "module.exports" for node compatibility.
  10421. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  10422. mod
  10423. ));
  10424. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  10425. // pkg/dist-src/index.js
  10426. var dist_src_exports = {};
  10427. __export(dist_src_exports, {
  10428. RequestError: () => RequestError
  10429. });
  10430. module.exports = __toCommonJS(dist_src_exports);
  10431. var import_deprecation = __nccwpck_require__(8932);
  10432. var import_once = __toESM(__nccwpck_require__(1223));
  10433. var logOnceCode = (0, import_once.default)((deprecation) => console.warn(deprecation));
  10434. var logOnceHeaders = (0, import_once.default)((deprecation) => console.warn(deprecation));
  10435. var RequestError = class extends Error {
  10436. constructor(message, statusCode, options) {
  10437. super(message);
  10438. if (Error.captureStackTrace) {
  10439. Error.captureStackTrace(this, this.constructor);
  10440. }
  10441. this.name = "HttpError";
  10442. this.status = statusCode;
  10443. let headers;
  10444. if ("headers" in options && typeof options.headers !== "undefined") {
  10445. headers = options.headers;
  10446. }
  10447. if ("response" in options) {
  10448. this.response = options.response;
  10449. headers = options.response.headers;
  10450. }
  10451. const requestCopy = Object.assign({}, options.request);
  10452. if (options.request.headers.authorization) {
  10453. requestCopy.headers = Object.assign({}, options.request.headers, {
  10454. authorization: options.request.headers.authorization.replace(
  10455. / .*$/,
  10456. " [REDACTED]"
  10457. )
  10458. });
  10459. }
  10460. requestCopy.url = requestCopy.url.replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]").replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
  10461. this.request = requestCopy;
  10462. Object.defineProperty(this, "code", {
  10463. get() {
  10464. logOnceCode(
  10465. new import_deprecation.Deprecation(
  10466. "[@octokit/request-error] `error.code` is deprecated, use `error.status`."
  10467. )
  10468. );
  10469. return statusCode;
  10470. }
  10471. });
  10472. Object.defineProperty(this, "headers", {
  10473. get() {
  10474. logOnceHeaders(
  10475. new import_deprecation.Deprecation(
  10476. "[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`."
  10477. )
  10478. );
  10479. return headers || {};
  10480. }
  10481. });
  10482. }
  10483. };
  10484. // Annotate the CommonJS export names for ESM import in node:
  10485. 0 && (0);
  10486. /***/ }),
  10487. /***/ 6234:
  10488. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  10489. "use strict";
  10490. var __defProp = Object.defineProperty;
  10491. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  10492. var __getOwnPropNames = Object.getOwnPropertyNames;
  10493. var __hasOwnProp = Object.prototype.hasOwnProperty;
  10494. var __export = (target, all) => {
  10495. for (var name in all)
  10496. __defProp(target, name, { get: all[name], enumerable: true });
  10497. };
  10498. var __copyProps = (to, from, except, desc) => {
  10499. if (from && typeof from === "object" || typeof from === "function") {
  10500. for (let key of __getOwnPropNames(from))
  10501. if (!__hasOwnProp.call(to, key) && key !== except)
  10502. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  10503. }
  10504. return to;
  10505. };
  10506. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  10507. // pkg/dist-src/index.js
  10508. var dist_src_exports = {};
  10509. __export(dist_src_exports, {
  10510. request: () => request
  10511. });
  10512. module.exports = __toCommonJS(dist_src_exports);
  10513. var import_endpoint = __nccwpck_require__(9440);
  10514. var import_universal_user_agent = __nccwpck_require__(5030);
  10515. // pkg/dist-src/version.js
  10516. var VERSION = "8.4.0";
  10517. // pkg/dist-src/is-plain-object.js
  10518. function isPlainObject(value) {
  10519. if (typeof value !== "object" || value === null)
  10520. return false;
  10521. if (Object.prototype.toString.call(value) !== "[object Object]")
  10522. return false;
  10523. const proto = Object.getPrototypeOf(value);
  10524. if (proto === null)
  10525. return true;
  10526. const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
  10527. return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
  10528. }
  10529. // pkg/dist-src/fetch-wrapper.js
  10530. var import_request_error = __nccwpck_require__(537);
  10531. // pkg/dist-src/get-buffer-response.js
  10532. function getBufferResponse(response) {
  10533. return response.arrayBuffer();
  10534. }
  10535. // pkg/dist-src/fetch-wrapper.js
  10536. function fetchWrapper(requestOptions) {
  10537. var _a, _b, _c, _d;
  10538. const log = requestOptions.request && requestOptions.request.log ? requestOptions.request.log : console;
  10539. const parseSuccessResponseBody = ((_a = requestOptions.request) == null ? void 0 : _a.parseSuccessResponseBody) !== false;
  10540. if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {
  10541. requestOptions.body = JSON.stringify(requestOptions.body);
  10542. }
  10543. let headers = {};
  10544. let status;
  10545. let url;
  10546. let { fetch } = globalThis;
  10547. if ((_b = requestOptions.request) == null ? void 0 : _b.fetch) {
  10548. fetch = requestOptions.request.fetch;
  10549. }
  10550. if (!fetch) {
  10551. throw new Error(
  10552. "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"
  10553. );
  10554. }
  10555. return fetch(requestOptions.url, {
  10556. method: requestOptions.method,
  10557. body: requestOptions.body,
  10558. redirect: (_c = requestOptions.request) == null ? void 0 : _c.redirect,
  10559. headers: requestOptions.headers,
  10560. signal: (_d = requestOptions.request) == null ? void 0 : _d.signal,
  10561. // duplex must be set if request.body is ReadableStream or Async Iterables.
  10562. // See https://fetch.spec.whatwg.org/#dom-requestinit-duplex.
  10563. ...requestOptions.body && { duplex: "half" }
  10564. }).then(async (response) => {
  10565. url = response.url;
  10566. status = response.status;
  10567. for (const keyAndValue of response.headers) {
  10568. headers[keyAndValue[0]] = keyAndValue[1];
  10569. }
  10570. if ("deprecation" in headers) {
  10571. const matches = headers.link && headers.link.match(/<([^>]+)>; rel="deprecation"/);
  10572. const deprecationLink = matches && matches.pop();
  10573. log.warn(
  10574. `[@octokit/request] "${requestOptions.method} ${requestOptions.url}" is deprecated. It is scheduled to be removed on ${headers.sunset}${deprecationLink ? `. See ${deprecationLink}` : ""}`
  10575. );
  10576. }
  10577. if (status === 204 || status === 205) {
  10578. return;
  10579. }
  10580. if (requestOptions.method === "HEAD") {
  10581. if (status < 400) {
  10582. return;
  10583. }
  10584. throw new import_request_error.RequestError(response.statusText, status, {
  10585. response: {
  10586. url,
  10587. status,
  10588. headers,
  10589. data: void 0
  10590. },
  10591. request: requestOptions
  10592. });
  10593. }
  10594. if (status === 304) {
  10595. throw new import_request_error.RequestError("Not modified", status, {
  10596. response: {
  10597. url,
  10598. status,
  10599. headers,
  10600. data: await getResponseData(response)
  10601. },
  10602. request: requestOptions
  10603. });
  10604. }
  10605. if (status >= 400) {
  10606. const data = await getResponseData(response);
  10607. const error = new import_request_error.RequestError(toErrorMessage(data), status, {
  10608. response: {
  10609. url,
  10610. status,
  10611. headers,
  10612. data
  10613. },
  10614. request: requestOptions
  10615. });
  10616. throw error;
  10617. }
  10618. return parseSuccessResponseBody ? await getResponseData(response) : response.body;
  10619. }).then((data) => {
  10620. return {
  10621. status,
  10622. url,
  10623. headers,
  10624. data
  10625. };
  10626. }).catch((error) => {
  10627. if (error instanceof import_request_error.RequestError)
  10628. throw error;
  10629. else if (error.name === "AbortError")
  10630. throw error;
  10631. let message = error.message;
  10632. if (error.name === "TypeError" && "cause" in error) {
  10633. if (error.cause instanceof Error) {
  10634. message = error.cause.message;
  10635. } else if (typeof error.cause === "string") {
  10636. message = error.cause;
  10637. }
  10638. }
  10639. throw new import_request_error.RequestError(message, 500, {
  10640. request: requestOptions
  10641. });
  10642. });
  10643. }
  10644. async function getResponseData(response) {
  10645. const contentType = response.headers.get("content-type");
  10646. if (/application\/json/.test(contentType)) {
  10647. return response.json().catch(() => response.text()).catch(() => "");
  10648. }
  10649. if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) {
  10650. return response.text();
  10651. }
  10652. return getBufferResponse(response);
  10653. }
  10654. function toErrorMessage(data) {
  10655. if (typeof data === "string")
  10656. return data;
  10657. let suffix;
  10658. if ("documentation_url" in data) {
  10659. suffix = ` - ${data.documentation_url}`;
  10660. } else {
  10661. suffix = "";
  10662. }
  10663. if ("message" in data) {
  10664. if (Array.isArray(data.errors)) {
  10665. return `${data.message}: ${data.errors.map(JSON.stringify).join(", ")}${suffix}`;
  10666. }
  10667. return `${data.message}${suffix}`;
  10668. }
  10669. return `Unknown error: ${JSON.stringify(data)}`;
  10670. }
  10671. // pkg/dist-src/with-defaults.js
  10672. function withDefaults(oldEndpoint, newDefaults) {
  10673. const endpoint2 = oldEndpoint.defaults(newDefaults);
  10674. const newApi = function(route, parameters) {
  10675. const endpointOptions = endpoint2.merge(route, parameters);
  10676. if (!endpointOptions.request || !endpointOptions.request.hook) {
  10677. return fetchWrapper(endpoint2.parse(endpointOptions));
  10678. }
  10679. const request2 = (route2, parameters2) => {
  10680. return fetchWrapper(
  10681. endpoint2.parse(endpoint2.merge(route2, parameters2))
  10682. );
  10683. };
  10684. Object.assign(request2, {
  10685. endpoint: endpoint2,
  10686. defaults: withDefaults.bind(null, endpoint2)
  10687. });
  10688. return endpointOptions.request.hook(request2, endpointOptions);
  10689. };
  10690. return Object.assign(newApi, {
  10691. endpoint: endpoint2,
  10692. defaults: withDefaults.bind(null, endpoint2)
  10693. });
  10694. }
  10695. // pkg/dist-src/index.js
  10696. var request = withDefaults(import_endpoint.endpoint, {
  10697. headers: {
  10698. "user-agent": `octokit-request.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`
  10699. }
  10700. });
  10701. // Annotate the CommonJS export names for ESM import in node:
  10702. 0 && (0);
  10703. /***/ }),
  10704. /***/ 3682:
  10705. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  10706. var register = __nccwpck_require__(4670);
  10707. var addHook = __nccwpck_require__(5549);
  10708. var removeHook = __nccwpck_require__(6819);
  10709. // bind with array of arguments: https://stackoverflow.com/a/21792913
  10710. var bind = Function.bind;
  10711. var bindable = bind.bind(bind);
  10712. function bindApi(hook, state, name) {
  10713. var removeHookRef = bindable(removeHook, null).apply(
  10714. null,
  10715. name ? [state, name] : [state]
  10716. );
  10717. hook.api = { remove: removeHookRef };
  10718. hook.remove = removeHookRef;
  10719. ["before", "error", "after", "wrap"].forEach(function (kind) {
  10720. var args = name ? [state, kind, name] : [state, kind];
  10721. hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args);
  10722. });
  10723. }
  10724. function HookSingular() {
  10725. var singularHookName = "h";
  10726. var singularHookState = {
  10727. registry: {},
  10728. };
  10729. var singularHook = register.bind(null, singularHookState, singularHookName);
  10730. bindApi(singularHook, singularHookState, singularHookName);
  10731. return singularHook;
  10732. }
  10733. function HookCollection() {
  10734. var state = {
  10735. registry: {},
  10736. };
  10737. var hook = register.bind(null, state);
  10738. bindApi(hook, state);
  10739. return hook;
  10740. }
  10741. var collectionHookDeprecationMessageDisplayed = false;
  10742. function Hook() {
  10743. if (!collectionHookDeprecationMessageDisplayed) {
  10744. console.warn(
  10745. '[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4'
  10746. );
  10747. collectionHookDeprecationMessageDisplayed = true;
  10748. }
  10749. return HookCollection();
  10750. }
  10751. Hook.Singular = HookSingular.bind();
  10752. Hook.Collection = HookCollection.bind();
  10753. module.exports = Hook;
  10754. // expose constructors as a named property for TypeScript
  10755. module.exports.Hook = Hook;
  10756. module.exports.Singular = Hook.Singular;
  10757. module.exports.Collection = Hook.Collection;
  10758. /***/ }),
  10759. /***/ 5549:
  10760. /***/ ((module) => {
  10761. module.exports = addHook;
  10762. function addHook(state, kind, name, hook) {
  10763. var orig = hook;
  10764. if (!state.registry[name]) {
  10765. state.registry[name] = [];
  10766. }
  10767. if (kind === "before") {
  10768. hook = function (method, options) {
  10769. return Promise.resolve()
  10770. .then(orig.bind(null, options))
  10771. .then(method.bind(null, options));
  10772. };
  10773. }
  10774. if (kind === "after") {
  10775. hook = function (method, options) {
  10776. var result;
  10777. return Promise.resolve()
  10778. .then(method.bind(null, options))
  10779. .then(function (result_) {
  10780. result = result_;
  10781. return orig(result, options);
  10782. })
  10783. .then(function () {
  10784. return result;
  10785. });
  10786. };
  10787. }
  10788. if (kind === "error") {
  10789. hook = function (method, options) {
  10790. return Promise.resolve()
  10791. .then(method.bind(null, options))
  10792. .catch(function (error) {
  10793. return orig(error, options);
  10794. });
  10795. };
  10796. }
  10797. state.registry[name].push({
  10798. hook: hook,
  10799. orig: orig,
  10800. });
  10801. }
  10802. /***/ }),
  10803. /***/ 4670:
  10804. /***/ ((module) => {
  10805. module.exports = register;
  10806. function register(state, name, method, options) {
  10807. if (typeof method !== "function") {
  10808. throw new Error("method for before hook must be a function");
  10809. }
  10810. if (!options) {
  10811. options = {};
  10812. }
  10813. if (Array.isArray(name)) {
  10814. return name.reverse().reduce(function (callback, name) {
  10815. return register.bind(null, state, name, callback, options);
  10816. }, method)();
  10817. }
  10818. return Promise.resolve().then(function () {
  10819. if (!state.registry[name]) {
  10820. return method(options);
  10821. }
  10822. return state.registry[name].reduce(function (method, registered) {
  10823. return registered.hook.bind(null, method, options);
  10824. }, method)();
  10825. });
  10826. }
  10827. /***/ }),
  10828. /***/ 6819:
  10829. /***/ ((module) => {
  10830. module.exports = removeHook;
  10831. function removeHook(state, name, method) {
  10832. if (!state.registry[name]) {
  10833. return;
  10834. }
  10835. var index = state.registry[name]
  10836. .map(function (registered) {
  10837. return registered.orig;
  10838. })
  10839. .indexOf(method);
  10840. if (index === -1) {
  10841. return;
  10842. }
  10843. state.registry[name].splice(index, 1);
  10844. }
  10845. /***/ }),
  10846. /***/ 8932:
  10847. /***/ ((__unused_webpack_module, exports) => {
  10848. "use strict";
  10849. Object.defineProperty(exports, "__esModule", ({ value: true }));
  10850. class Deprecation extends Error {
  10851. constructor(message) {
  10852. super(message); // Maintains proper stack trace (only available on V8)
  10853. /* istanbul ignore next */
  10854. if (Error.captureStackTrace) {
  10855. Error.captureStackTrace(this, this.constructor);
  10856. }
  10857. this.name = 'Deprecation';
  10858. }
  10859. }
  10860. exports.Deprecation = Deprecation;
  10861. /***/ }),
  10862. /***/ 1223:
  10863. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  10864. var wrappy = __nccwpck_require__(2940)
  10865. module.exports = wrappy(once)
  10866. module.exports.strict = wrappy(onceStrict)
  10867. once.proto = once(function () {
  10868. Object.defineProperty(Function.prototype, 'once', {
  10869. value: function () {
  10870. return once(this)
  10871. },
  10872. configurable: true
  10873. })
  10874. Object.defineProperty(Function.prototype, 'onceStrict', {
  10875. value: function () {
  10876. return onceStrict(this)
  10877. },
  10878. configurable: true
  10879. })
  10880. })
  10881. function once (fn) {
  10882. var f = function () {
  10883. if (f.called) return f.value
  10884. f.called = true
  10885. return f.value = fn.apply(this, arguments)
  10886. }
  10887. f.called = false
  10888. return f
  10889. }
  10890. function onceStrict (fn) {
  10891. var f = function () {
  10892. if (f.called)
  10893. throw new Error(f.onceError)
  10894. f.called = true
  10895. return f.value = fn.apply(this, arguments)
  10896. }
  10897. var name = fn.name || 'Function wrapped with `once`'
  10898. f.onceError = name + " shouldn't be called more than once"
  10899. f.called = false
  10900. return f
  10901. }
  10902. /***/ }),
  10903. /***/ 5911:
  10904. /***/ ((module, exports) => {
  10905. exports = module.exports = SemVer
  10906. var debug
  10907. /* istanbul ignore next */
  10908. if (typeof process === 'object' &&
  10909. process.env &&
  10910. process.env.NODE_DEBUG &&
  10911. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  10912. debug = function () {
  10913. var args = Array.prototype.slice.call(arguments, 0)
  10914. args.unshift('SEMVER')
  10915. console.log.apply(console, args)
  10916. }
  10917. } else {
  10918. debug = function () {}
  10919. }
  10920. // Note: this is the semver.org version of the spec that it implements
  10921. // Not necessarily the package version of this code.
  10922. exports.SEMVER_SPEC_VERSION = '2.0.0'
  10923. var MAX_LENGTH = 256
  10924. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  10925. /* istanbul ignore next */ 9007199254740991
  10926. // Max safe segment length for coercion.
  10927. var MAX_SAFE_COMPONENT_LENGTH = 16
  10928. var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6
  10929. // The actual regexps go on exports.re
  10930. var re = exports.re = []
  10931. var safeRe = exports.safeRe = []
  10932. var src = exports.src = []
  10933. var t = exports.tokens = {}
  10934. var R = 0
  10935. function tok (n) {
  10936. t[n] = R++
  10937. }
  10938. var LETTERDASHNUMBER = '[a-zA-Z0-9-]'
  10939. // Replace some greedy regex tokens to prevent regex dos issues. These regex are
  10940. // used internally via the safeRe object since all inputs in this library get
  10941. // normalized first to trim and collapse all extra whitespace. The original
  10942. // regexes are exported for userland consumption and lower level usage. A
  10943. // future breaking change could export the safer regex only with a note that
  10944. // all input should have extra whitespace removed.
  10945. var safeRegexReplacements = [
  10946. ['\\s', 1],
  10947. ['\\d', MAX_LENGTH],
  10948. [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH],
  10949. ]
  10950. function makeSafeRe (value) {
  10951. for (var i = 0; i < safeRegexReplacements.length; i++) {
  10952. var token = safeRegexReplacements[i][0]
  10953. var max = safeRegexReplacements[i][1]
  10954. value = value
  10955. .split(token + '*').join(token + '{0,' + max + '}')
  10956. .split(token + '+').join(token + '{1,' + max + '}')
  10957. }
  10958. return value
  10959. }
  10960. // The following Regular Expressions can be used for tokenizing,
  10961. // validating, and parsing SemVer version strings.
  10962. // ## Numeric Identifier
  10963. // A single `0`, or a non-zero digit followed by zero or more digits.
  10964. tok('NUMERICIDENTIFIER')
  10965. src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  10966. tok('NUMERICIDENTIFIERLOOSE')
  10967. src[t.NUMERICIDENTIFIERLOOSE] = '\\d+'
  10968. // ## Non-numeric Identifier
  10969. // Zero or more digits, followed by a letter or hyphen, and then zero or
  10970. // more letters, digits, or hyphens.
  10971. tok('NONNUMERICIDENTIFIER')
  10972. src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-]' + LETTERDASHNUMBER + '*'
  10973. // ## Main Version
  10974. // Three dot-separated numeric identifiers.
  10975. tok('MAINVERSION')
  10976. src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  10977. '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  10978. '(' + src[t.NUMERICIDENTIFIER] + ')'
  10979. tok('MAINVERSIONLOOSE')
  10980. src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  10981. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  10982. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')'
  10983. // ## Pre-release Version Identifier
  10984. // A numeric identifier, or a non-numeric identifier.
  10985. tok('PRERELEASEIDENTIFIER')
  10986. src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] +
  10987. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  10988. tok('PRERELEASEIDENTIFIERLOOSE')
  10989. src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] +
  10990. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  10991. // ## Pre-release Version
  10992. // Hyphen, followed by one or more dot-separated pre-release version
  10993. // identifiers.
  10994. tok('PRERELEASE')
  10995. src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] +
  10996. '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))'
  10997. tok('PRERELEASELOOSE')
  10998. src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] +
  10999. '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))'
  11000. // ## Build Metadata Identifier
  11001. // Any combination of digits, letters, or hyphens.
  11002. tok('BUILDIDENTIFIER')
  11003. src[t.BUILDIDENTIFIER] = LETTERDASHNUMBER + '+'
  11004. // ## Build Metadata
  11005. // Plus sign, followed by one or more period-separated build metadata
  11006. // identifiers.
  11007. tok('BUILD')
  11008. src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] +
  11009. '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))'
  11010. // ## Full Version String
  11011. // A main version, followed optionally by a pre-release version and
  11012. // build metadata.
  11013. // Note that the only major, minor, patch, and pre-release sections of
  11014. // the version string are capturing groups. The build metadata is not a
  11015. // capturing group, because it should not ever be used in version
  11016. // comparison.
  11017. tok('FULL')
  11018. tok('FULLPLAIN')
  11019. src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] +
  11020. src[t.PRERELEASE] + '?' +
  11021. src[t.BUILD] + '?'
  11022. src[t.FULL] = '^' + src[t.FULLPLAIN] + '$'
  11023. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  11024. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  11025. // common in the npm registry.
  11026. tok('LOOSEPLAIN')
  11027. src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] +
  11028. src[t.PRERELEASELOOSE] + '?' +
  11029. src[t.BUILD] + '?'
  11030. tok('LOOSE')
  11031. src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$'
  11032. tok('GTLT')
  11033. src[t.GTLT] = '((?:<|>)?=?)'
  11034. // Something like "2.*" or "1.2.x".
  11035. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  11036. // Only the first item is strictly required.
  11037. tok('XRANGEIDENTIFIERLOOSE')
  11038. src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  11039. tok('XRANGEIDENTIFIER')
  11040. src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*'
  11041. tok('XRANGEPLAIN')
  11042. src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' +
  11043. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  11044. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  11045. '(?:' + src[t.PRERELEASE] + ')?' +
  11046. src[t.BUILD] + '?' +
  11047. ')?)?'
  11048. tok('XRANGEPLAINLOOSE')
  11049. src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  11050. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  11051. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  11052. '(?:' + src[t.PRERELEASELOOSE] + ')?' +
  11053. src[t.BUILD] + '?' +
  11054. ')?)?'
  11055. tok('XRANGE')
  11056. src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$'
  11057. tok('XRANGELOOSE')
  11058. src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$'
  11059. // Coercion.
  11060. // Extract anything that could conceivably be a part of a valid semver
  11061. tok('COERCE')
  11062. src[t.COERCE] = '(^|[^\\d])' +
  11063. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  11064. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  11065. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  11066. '(?:$|[^\\d])'
  11067. tok('COERCERTL')
  11068. re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g')
  11069. safeRe[t.COERCERTL] = new RegExp(makeSafeRe(src[t.COERCE]), 'g')
  11070. // Tilde ranges.
  11071. // Meaning is "reasonably at or greater than"
  11072. tok('LONETILDE')
  11073. src[t.LONETILDE] = '(?:~>?)'
  11074. tok('TILDETRIM')
  11075. src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+'
  11076. re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g')
  11077. safeRe[t.TILDETRIM] = new RegExp(makeSafeRe(src[t.TILDETRIM]), 'g')
  11078. var tildeTrimReplace = '$1~'
  11079. tok('TILDE')
  11080. src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$'
  11081. tok('TILDELOOSE')
  11082. src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$'
  11083. // Caret ranges.
  11084. // Meaning is "at least and backwards compatible with"
  11085. tok('LONECARET')
  11086. src[t.LONECARET] = '(?:\\^)'
  11087. tok('CARETTRIM')
  11088. src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+'
  11089. re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g')
  11090. safeRe[t.CARETTRIM] = new RegExp(makeSafeRe(src[t.CARETTRIM]), 'g')
  11091. var caretTrimReplace = '$1^'
  11092. tok('CARET')
  11093. src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$'
  11094. tok('CARETLOOSE')
  11095. src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$'
  11096. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  11097. tok('COMPARATORLOOSE')
  11098. src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$'
  11099. tok('COMPARATOR')
  11100. src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$'
  11101. // An expression to strip any whitespace between the gtlt and the thing
  11102. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  11103. tok('COMPARATORTRIM')
  11104. src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] +
  11105. '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')'
  11106. // this one has to use the /g flag
  11107. re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g')
  11108. safeRe[t.COMPARATORTRIM] = new RegExp(makeSafeRe(src[t.COMPARATORTRIM]), 'g')
  11109. var comparatorTrimReplace = '$1$2$3'
  11110. // Something like `1.2.3 - 1.2.4`
  11111. // Note that these all use the loose form, because they'll be
  11112. // checked against either the strict or loose comparator form
  11113. // later.
  11114. tok('HYPHENRANGE')
  11115. src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' +
  11116. '\\s+-\\s+' +
  11117. '(' + src[t.XRANGEPLAIN] + ')' +
  11118. '\\s*$'
  11119. tok('HYPHENRANGELOOSE')
  11120. src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' +
  11121. '\\s+-\\s+' +
  11122. '(' + src[t.XRANGEPLAINLOOSE] + ')' +
  11123. '\\s*$'
  11124. // Star ranges basically just allow anything at all.
  11125. tok('STAR')
  11126. src[t.STAR] = '(<|>)?=?\\s*\\*'
  11127. // Compile to actual regexp objects.
  11128. // All are flag-free, unless they were created above with a flag.
  11129. for (var i = 0; i < R; i++) {
  11130. debug(i, src[i])
  11131. if (!re[i]) {
  11132. re[i] = new RegExp(src[i])
  11133. // Replace all greedy whitespace to prevent regex dos issues. These regex are
  11134. // used internally via the safeRe object since all inputs in this library get
  11135. // normalized first to trim and collapse all extra whitespace. The original
  11136. // regexes are exported for userland consumption and lower level usage. A
  11137. // future breaking change could export the safer regex only with a note that
  11138. // all input should have extra whitespace removed.
  11139. safeRe[i] = new RegExp(makeSafeRe(src[i]))
  11140. }
  11141. }
  11142. exports.parse = parse
  11143. function parse (version, options) {
  11144. if (!options || typeof options !== 'object') {
  11145. options = {
  11146. loose: !!options,
  11147. includePrerelease: false
  11148. }
  11149. }
  11150. if (version instanceof SemVer) {
  11151. return version
  11152. }
  11153. if (typeof version !== 'string') {
  11154. return null
  11155. }
  11156. if (version.length > MAX_LENGTH) {
  11157. return null
  11158. }
  11159. var r = options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL]
  11160. if (!r.test(version)) {
  11161. return null
  11162. }
  11163. try {
  11164. return new SemVer(version, options)
  11165. } catch (er) {
  11166. return null
  11167. }
  11168. }
  11169. exports.valid = valid
  11170. function valid (version, options) {
  11171. var v = parse(version, options)
  11172. return v ? v.version : null
  11173. }
  11174. exports.clean = clean
  11175. function clean (version, options) {
  11176. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  11177. return s ? s.version : null
  11178. }
  11179. exports.SemVer = SemVer
  11180. function SemVer (version, options) {
  11181. if (!options || typeof options !== 'object') {
  11182. options = {
  11183. loose: !!options,
  11184. includePrerelease: false
  11185. }
  11186. }
  11187. if (version instanceof SemVer) {
  11188. if (version.loose === options.loose) {
  11189. return version
  11190. } else {
  11191. version = version.version
  11192. }
  11193. } else if (typeof version !== 'string') {
  11194. throw new TypeError('Invalid Version: ' + version)
  11195. }
  11196. if (version.length > MAX_LENGTH) {
  11197. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  11198. }
  11199. if (!(this instanceof SemVer)) {
  11200. return new SemVer(version, options)
  11201. }
  11202. debug('SemVer', version, options)
  11203. this.options = options
  11204. this.loose = !!options.loose
  11205. var m = version.trim().match(options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL])
  11206. if (!m) {
  11207. throw new TypeError('Invalid Version: ' + version)
  11208. }
  11209. this.raw = version
  11210. // these are actually numbers
  11211. this.major = +m[1]
  11212. this.minor = +m[2]
  11213. this.patch = +m[3]
  11214. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  11215. throw new TypeError('Invalid major version')
  11216. }
  11217. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  11218. throw new TypeError('Invalid minor version')
  11219. }
  11220. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  11221. throw new TypeError('Invalid patch version')
  11222. }
  11223. // numberify any prerelease numeric ids
  11224. if (!m[4]) {
  11225. this.prerelease = []
  11226. } else {
  11227. this.prerelease = m[4].split('.').map(function (id) {
  11228. if (/^[0-9]+$/.test(id)) {
  11229. var num = +id
  11230. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  11231. return num
  11232. }
  11233. }
  11234. return id
  11235. })
  11236. }
  11237. this.build = m[5] ? m[5].split('.') : []
  11238. this.format()
  11239. }
  11240. SemVer.prototype.format = function () {
  11241. this.version = this.major + '.' + this.minor + '.' + this.patch
  11242. if (this.prerelease.length) {
  11243. this.version += '-' + this.prerelease.join('.')
  11244. }
  11245. return this.version
  11246. }
  11247. SemVer.prototype.toString = function () {
  11248. return this.version
  11249. }
  11250. SemVer.prototype.compare = function (other) {
  11251. debug('SemVer.compare', this.version, this.options, other)
  11252. if (!(other instanceof SemVer)) {
  11253. other = new SemVer(other, this.options)
  11254. }
  11255. return this.compareMain(other) || this.comparePre(other)
  11256. }
  11257. SemVer.prototype.compareMain = function (other) {
  11258. if (!(other instanceof SemVer)) {
  11259. other = new SemVer(other, this.options)
  11260. }
  11261. return compareIdentifiers(this.major, other.major) ||
  11262. compareIdentifiers(this.minor, other.minor) ||
  11263. compareIdentifiers(this.patch, other.patch)
  11264. }
  11265. SemVer.prototype.comparePre = function (other) {
  11266. if (!(other instanceof SemVer)) {
  11267. other = new SemVer(other, this.options)
  11268. }
  11269. // NOT having a prerelease is > having one
  11270. if (this.prerelease.length && !other.prerelease.length) {
  11271. return -1
  11272. } else if (!this.prerelease.length && other.prerelease.length) {
  11273. return 1
  11274. } else if (!this.prerelease.length && !other.prerelease.length) {
  11275. return 0
  11276. }
  11277. var i = 0
  11278. do {
  11279. var a = this.prerelease[i]
  11280. var b = other.prerelease[i]
  11281. debug('prerelease compare', i, a, b)
  11282. if (a === undefined && b === undefined) {
  11283. return 0
  11284. } else if (b === undefined) {
  11285. return 1
  11286. } else if (a === undefined) {
  11287. return -1
  11288. } else if (a === b) {
  11289. continue
  11290. } else {
  11291. return compareIdentifiers(a, b)
  11292. }
  11293. } while (++i)
  11294. }
  11295. SemVer.prototype.compareBuild = function (other) {
  11296. if (!(other instanceof SemVer)) {
  11297. other = new SemVer(other, this.options)
  11298. }
  11299. var i = 0
  11300. do {
  11301. var a = this.build[i]
  11302. var b = other.build[i]
  11303. debug('prerelease compare', i, a, b)
  11304. if (a === undefined && b === undefined) {
  11305. return 0
  11306. } else if (b === undefined) {
  11307. return 1
  11308. } else if (a === undefined) {
  11309. return -1
  11310. } else if (a === b) {
  11311. continue
  11312. } else {
  11313. return compareIdentifiers(a, b)
  11314. }
  11315. } while (++i)
  11316. }
  11317. // preminor will bump the version up to the next minor release, and immediately
  11318. // down to pre-release. premajor and prepatch work the same way.
  11319. SemVer.prototype.inc = function (release, identifier) {
  11320. switch (release) {
  11321. case 'premajor':
  11322. this.prerelease.length = 0
  11323. this.patch = 0
  11324. this.minor = 0
  11325. this.major++
  11326. this.inc('pre', identifier)
  11327. break
  11328. case 'preminor':
  11329. this.prerelease.length = 0
  11330. this.patch = 0
  11331. this.minor++
  11332. this.inc('pre', identifier)
  11333. break
  11334. case 'prepatch':
  11335. // If this is already a prerelease, it will bump to the next version
  11336. // drop any prereleases that might already exist, since they are not
  11337. // relevant at this point.
  11338. this.prerelease.length = 0
  11339. this.inc('patch', identifier)
  11340. this.inc('pre', identifier)
  11341. break
  11342. // If the input is a non-prerelease version, this acts the same as
  11343. // prepatch.
  11344. case 'prerelease':
  11345. if (this.prerelease.length === 0) {
  11346. this.inc('patch', identifier)
  11347. }
  11348. this.inc('pre', identifier)
  11349. break
  11350. case 'major':
  11351. // If this is a pre-major version, bump up to the same major version.
  11352. // Otherwise increment major.
  11353. // 1.0.0-5 bumps to 1.0.0
  11354. // 1.1.0 bumps to 2.0.0
  11355. if (this.minor !== 0 ||
  11356. this.patch !== 0 ||
  11357. this.prerelease.length === 0) {
  11358. this.major++
  11359. }
  11360. this.minor = 0
  11361. this.patch = 0
  11362. this.prerelease = []
  11363. break
  11364. case 'minor':
  11365. // If this is a pre-minor version, bump up to the same minor version.
  11366. // Otherwise increment minor.
  11367. // 1.2.0-5 bumps to 1.2.0
  11368. // 1.2.1 bumps to 1.3.0
  11369. if (this.patch !== 0 || this.prerelease.length === 0) {
  11370. this.minor++
  11371. }
  11372. this.patch = 0
  11373. this.prerelease = []
  11374. break
  11375. case 'patch':
  11376. // If this is not a pre-release version, it will increment the patch.
  11377. // If it is a pre-release it will bump up to the same patch version.
  11378. // 1.2.0-5 patches to 1.2.0
  11379. // 1.2.0 patches to 1.2.1
  11380. if (this.prerelease.length === 0) {
  11381. this.patch++
  11382. }
  11383. this.prerelease = []
  11384. break
  11385. // This probably shouldn't be used publicly.
  11386. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  11387. case 'pre':
  11388. if (this.prerelease.length === 0) {
  11389. this.prerelease = [0]
  11390. } else {
  11391. var i = this.prerelease.length
  11392. while (--i >= 0) {
  11393. if (typeof this.prerelease[i] === 'number') {
  11394. this.prerelease[i]++
  11395. i = -2
  11396. }
  11397. }
  11398. if (i === -1) {
  11399. // didn't increment anything
  11400. this.prerelease.push(0)
  11401. }
  11402. }
  11403. if (identifier) {
  11404. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  11405. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  11406. if (this.prerelease[0] === identifier) {
  11407. if (isNaN(this.prerelease[1])) {
  11408. this.prerelease = [identifier, 0]
  11409. }
  11410. } else {
  11411. this.prerelease = [identifier, 0]
  11412. }
  11413. }
  11414. break
  11415. default:
  11416. throw new Error('invalid increment argument: ' + release)
  11417. }
  11418. this.format()
  11419. this.raw = this.version
  11420. return this
  11421. }
  11422. exports.inc = inc
  11423. function inc (version, release, loose, identifier) {
  11424. if (typeof (loose) === 'string') {
  11425. identifier = loose
  11426. loose = undefined
  11427. }
  11428. try {
  11429. return new SemVer(version, loose).inc(release, identifier).version
  11430. } catch (er) {
  11431. return null
  11432. }
  11433. }
  11434. exports.diff = diff
  11435. function diff (version1, version2) {
  11436. if (eq(version1, version2)) {
  11437. return null
  11438. } else {
  11439. var v1 = parse(version1)
  11440. var v2 = parse(version2)
  11441. var prefix = ''
  11442. if (v1.prerelease.length || v2.prerelease.length) {
  11443. prefix = 'pre'
  11444. var defaultResult = 'prerelease'
  11445. }
  11446. for (var key in v1) {
  11447. if (key === 'major' || key === 'minor' || key === 'patch') {
  11448. if (v1[key] !== v2[key]) {
  11449. return prefix + key
  11450. }
  11451. }
  11452. }
  11453. return defaultResult // may be undefined
  11454. }
  11455. }
  11456. exports.compareIdentifiers = compareIdentifiers
  11457. var numeric = /^[0-9]+$/
  11458. function compareIdentifiers (a, b) {
  11459. var anum = numeric.test(a)
  11460. var bnum = numeric.test(b)
  11461. if (anum && bnum) {
  11462. a = +a
  11463. b = +b
  11464. }
  11465. return a === b ? 0
  11466. : (anum && !bnum) ? -1
  11467. : (bnum && !anum) ? 1
  11468. : a < b ? -1
  11469. : 1
  11470. }
  11471. exports.rcompareIdentifiers = rcompareIdentifiers
  11472. function rcompareIdentifiers (a, b) {
  11473. return compareIdentifiers(b, a)
  11474. }
  11475. exports.major = major
  11476. function major (a, loose) {
  11477. return new SemVer(a, loose).major
  11478. }
  11479. exports.minor = minor
  11480. function minor (a, loose) {
  11481. return new SemVer(a, loose).minor
  11482. }
  11483. exports.patch = patch
  11484. function patch (a, loose) {
  11485. return new SemVer(a, loose).patch
  11486. }
  11487. exports.compare = compare
  11488. function compare (a, b, loose) {
  11489. return new SemVer(a, loose).compare(new SemVer(b, loose))
  11490. }
  11491. exports.compareLoose = compareLoose
  11492. function compareLoose (a, b) {
  11493. return compare(a, b, true)
  11494. }
  11495. exports.compareBuild = compareBuild
  11496. function compareBuild (a, b, loose) {
  11497. var versionA = new SemVer(a, loose)
  11498. var versionB = new SemVer(b, loose)
  11499. return versionA.compare(versionB) || versionA.compareBuild(versionB)
  11500. }
  11501. exports.rcompare = rcompare
  11502. function rcompare (a, b, loose) {
  11503. return compare(b, a, loose)
  11504. }
  11505. exports.sort = sort
  11506. function sort (list, loose) {
  11507. return list.sort(function (a, b) {
  11508. return exports.compareBuild(a, b, loose)
  11509. })
  11510. }
  11511. exports.rsort = rsort
  11512. function rsort (list, loose) {
  11513. return list.sort(function (a, b) {
  11514. return exports.compareBuild(b, a, loose)
  11515. })
  11516. }
  11517. exports.gt = gt
  11518. function gt (a, b, loose) {
  11519. return compare(a, b, loose) > 0
  11520. }
  11521. exports.lt = lt
  11522. function lt (a, b, loose) {
  11523. return compare(a, b, loose) < 0
  11524. }
  11525. exports.eq = eq
  11526. function eq (a, b, loose) {
  11527. return compare(a, b, loose) === 0
  11528. }
  11529. exports.neq = neq
  11530. function neq (a, b, loose) {
  11531. return compare(a, b, loose) !== 0
  11532. }
  11533. exports.gte = gte
  11534. function gte (a, b, loose) {
  11535. return compare(a, b, loose) >= 0
  11536. }
  11537. exports.lte = lte
  11538. function lte (a, b, loose) {
  11539. return compare(a, b, loose) <= 0
  11540. }
  11541. exports.cmp = cmp
  11542. function cmp (a, op, b, loose) {
  11543. switch (op) {
  11544. case '===':
  11545. if (typeof a === 'object')
  11546. a = a.version
  11547. if (typeof b === 'object')
  11548. b = b.version
  11549. return a === b
  11550. case '!==':
  11551. if (typeof a === 'object')
  11552. a = a.version
  11553. if (typeof b === 'object')
  11554. b = b.version
  11555. return a !== b
  11556. case '':
  11557. case '=':
  11558. case '==':
  11559. return eq(a, b, loose)
  11560. case '!=':
  11561. return neq(a, b, loose)
  11562. case '>':
  11563. return gt(a, b, loose)
  11564. case '>=':
  11565. return gte(a, b, loose)
  11566. case '<':
  11567. return lt(a, b, loose)
  11568. case '<=':
  11569. return lte(a, b, loose)
  11570. default:
  11571. throw new TypeError('Invalid operator: ' + op)
  11572. }
  11573. }
  11574. exports.Comparator = Comparator
  11575. function Comparator (comp, options) {
  11576. if (!options || typeof options !== 'object') {
  11577. options = {
  11578. loose: !!options,
  11579. includePrerelease: false
  11580. }
  11581. }
  11582. if (comp instanceof Comparator) {
  11583. if (comp.loose === !!options.loose) {
  11584. return comp
  11585. } else {
  11586. comp = comp.value
  11587. }
  11588. }
  11589. if (!(this instanceof Comparator)) {
  11590. return new Comparator(comp, options)
  11591. }
  11592. comp = comp.trim().split(/\s+/).join(' ')
  11593. debug('comparator', comp, options)
  11594. this.options = options
  11595. this.loose = !!options.loose
  11596. this.parse(comp)
  11597. if (this.semver === ANY) {
  11598. this.value = ''
  11599. } else {
  11600. this.value = this.operator + this.semver.version
  11601. }
  11602. debug('comp', this)
  11603. }
  11604. var ANY = {}
  11605. Comparator.prototype.parse = function (comp) {
  11606. var r = this.options.loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]
  11607. var m = comp.match(r)
  11608. if (!m) {
  11609. throw new TypeError('Invalid comparator: ' + comp)
  11610. }
  11611. this.operator = m[1] !== undefined ? m[1] : ''
  11612. if (this.operator === '=') {
  11613. this.operator = ''
  11614. }
  11615. // if it literally is just '>' or '' then allow anything.
  11616. if (!m[2]) {
  11617. this.semver = ANY
  11618. } else {
  11619. this.semver = new SemVer(m[2], this.options.loose)
  11620. }
  11621. }
  11622. Comparator.prototype.toString = function () {
  11623. return this.value
  11624. }
  11625. Comparator.prototype.test = function (version) {
  11626. debug('Comparator.test', version, this.options.loose)
  11627. if (this.semver === ANY || version === ANY) {
  11628. return true
  11629. }
  11630. if (typeof version === 'string') {
  11631. try {
  11632. version = new SemVer(version, this.options)
  11633. } catch (er) {
  11634. return false
  11635. }
  11636. }
  11637. return cmp(version, this.operator, this.semver, this.options)
  11638. }
  11639. Comparator.prototype.intersects = function (comp, options) {
  11640. if (!(comp instanceof Comparator)) {
  11641. throw new TypeError('a Comparator is required')
  11642. }
  11643. if (!options || typeof options !== 'object') {
  11644. options = {
  11645. loose: !!options,
  11646. includePrerelease: false
  11647. }
  11648. }
  11649. var rangeTmp
  11650. if (this.operator === '') {
  11651. if (this.value === '') {
  11652. return true
  11653. }
  11654. rangeTmp = new Range(comp.value, options)
  11655. return satisfies(this.value, rangeTmp, options)
  11656. } else if (comp.operator === '') {
  11657. if (comp.value === '') {
  11658. return true
  11659. }
  11660. rangeTmp = new Range(this.value, options)
  11661. return satisfies(comp.semver, rangeTmp, options)
  11662. }
  11663. var sameDirectionIncreasing =
  11664. (this.operator === '>=' || this.operator === '>') &&
  11665. (comp.operator === '>=' || comp.operator === '>')
  11666. var sameDirectionDecreasing =
  11667. (this.operator === '<=' || this.operator === '<') &&
  11668. (comp.operator === '<=' || comp.operator === '<')
  11669. var sameSemVer = this.semver.version === comp.semver.version
  11670. var differentDirectionsInclusive =
  11671. (this.operator === '>=' || this.operator === '<=') &&
  11672. (comp.operator === '>=' || comp.operator === '<=')
  11673. var oppositeDirectionsLessThan =
  11674. cmp(this.semver, '<', comp.semver, options) &&
  11675. ((this.operator === '>=' || this.operator === '>') &&
  11676. (comp.operator === '<=' || comp.operator === '<'))
  11677. var oppositeDirectionsGreaterThan =
  11678. cmp(this.semver, '>', comp.semver, options) &&
  11679. ((this.operator === '<=' || this.operator === '<') &&
  11680. (comp.operator === '>=' || comp.operator === '>'))
  11681. return sameDirectionIncreasing || sameDirectionDecreasing ||
  11682. (sameSemVer && differentDirectionsInclusive) ||
  11683. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  11684. }
  11685. exports.Range = Range
  11686. function Range (range, options) {
  11687. if (!options || typeof options !== 'object') {
  11688. options = {
  11689. loose: !!options,
  11690. includePrerelease: false
  11691. }
  11692. }
  11693. if (range instanceof Range) {
  11694. if (range.loose === !!options.loose &&
  11695. range.includePrerelease === !!options.includePrerelease) {
  11696. return range
  11697. } else {
  11698. return new Range(range.raw, options)
  11699. }
  11700. }
  11701. if (range instanceof Comparator) {
  11702. return new Range(range.value, options)
  11703. }
  11704. if (!(this instanceof Range)) {
  11705. return new Range(range, options)
  11706. }
  11707. this.options = options
  11708. this.loose = !!options.loose
  11709. this.includePrerelease = !!options.includePrerelease
  11710. // First reduce all whitespace as much as possible so we do not have to rely
  11711. // on potentially slow regexes like \s*. This is then stored and used for
  11712. // future error messages as well.
  11713. this.raw = range
  11714. .trim()
  11715. .split(/\s+/)
  11716. .join(' ')
  11717. // First, split based on boolean or ||
  11718. this.set = this.raw.split('||').map(function (range) {
  11719. return this.parseRange(range.trim())
  11720. }, this).filter(function (c) {
  11721. // throw out any that are not relevant for whatever reason
  11722. return c.length
  11723. })
  11724. if (!this.set.length) {
  11725. throw new TypeError('Invalid SemVer Range: ' + this.raw)
  11726. }
  11727. this.format()
  11728. }
  11729. Range.prototype.format = function () {
  11730. this.range = this.set.map(function (comps) {
  11731. return comps.join(' ').trim()
  11732. }).join('||').trim()
  11733. return this.range
  11734. }
  11735. Range.prototype.toString = function () {
  11736. return this.range
  11737. }
  11738. Range.prototype.parseRange = function (range) {
  11739. var loose = this.options.loose
  11740. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  11741. var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE]
  11742. range = range.replace(hr, hyphenReplace)
  11743. debug('hyphen replace', range)
  11744. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  11745. range = range.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace)
  11746. debug('comparator trim', range, safeRe[t.COMPARATORTRIM])
  11747. // `~ 1.2.3` => `~1.2.3`
  11748. range = range.replace(safeRe[t.TILDETRIM], tildeTrimReplace)
  11749. // `^ 1.2.3` => `^1.2.3`
  11750. range = range.replace(safeRe[t.CARETTRIM], caretTrimReplace)
  11751. // normalize spaces
  11752. range = range.split(/\s+/).join(' ')
  11753. // At this point, the range is completely trimmed and
  11754. // ready to be split into comparators.
  11755. var compRe = loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]
  11756. var set = range.split(' ').map(function (comp) {
  11757. return parseComparator(comp, this.options)
  11758. }, this).join(' ').split(/\s+/)
  11759. if (this.options.loose) {
  11760. // in loose mode, throw out any that are not valid comparators
  11761. set = set.filter(function (comp) {
  11762. return !!comp.match(compRe)
  11763. })
  11764. }
  11765. set = set.map(function (comp) {
  11766. return new Comparator(comp, this.options)
  11767. }, this)
  11768. return set
  11769. }
  11770. Range.prototype.intersects = function (range, options) {
  11771. if (!(range instanceof Range)) {
  11772. throw new TypeError('a Range is required')
  11773. }
  11774. return this.set.some(function (thisComparators) {
  11775. return (
  11776. isSatisfiable(thisComparators, options) &&
  11777. range.set.some(function (rangeComparators) {
  11778. return (
  11779. isSatisfiable(rangeComparators, options) &&
  11780. thisComparators.every(function (thisComparator) {
  11781. return rangeComparators.every(function (rangeComparator) {
  11782. return thisComparator.intersects(rangeComparator, options)
  11783. })
  11784. })
  11785. )
  11786. })
  11787. )
  11788. })
  11789. }
  11790. // take a set of comparators and determine whether there
  11791. // exists a version which can satisfy it
  11792. function isSatisfiable (comparators, options) {
  11793. var result = true
  11794. var remainingComparators = comparators.slice()
  11795. var testComparator = remainingComparators.pop()
  11796. while (result && remainingComparators.length) {
  11797. result = remainingComparators.every(function (otherComparator) {
  11798. return testComparator.intersects(otherComparator, options)
  11799. })
  11800. testComparator = remainingComparators.pop()
  11801. }
  11802. return result
  11803. }
  11804. // Mostly just for testing and legacy API reasons
  11805. exports.toComparators = toComparators
  11806. function toComparators (range, options) {
  11807. return new Range(range, options).set.map(function (comp) {
  11808. return comp.map(function (c) {
  11809. return c.value
  11810. }).join(' ').trim().split(' ')
  11811. })
  11812. }
  11813. // comprised of xranges, tildes, stars, and gtlt's at this point.
  11814. // already replaced the hyphen ranges
  11815. // turn into a set of JUST comparators.
  11816. function parseComparator (comp, options) {
  11817. debug('comp', comp, options)
  11818. comp = replaceCarets(comp, options)
  11819. debug('caret', comp)
  11820. comp = replaceTildes(comp, options)
  11821. debug('tildes', comp)
  11822. comp = replaceXRanges(comp, options)
  11823. debug('xrange', comp)
  11824. comp = replaceStars(comp, options)
  11825. debug('stars', comp)
  11826. return comp
  11827. }
  11828. function isX (id) {
  11829. return !id || id.toLowerCase() === 'x' || id === '*'
  11830. }
  11831. // ~, ~> --> * (any, kinda silly)
  11832. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  11833. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  11834. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  11835. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  11836. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  11837. function replaceTildes (comp, options) {
  11838. return comp.trim().split(/\s+/).map(function (comp) {
  11839. return replaceTilde(comp, options)
  11840. }).join(' ')
  11841. }
  11842. function replaceTilde (comp, options) {
  11843. var r = options.loose ? safeRe[t.TILDELOOSE] : safeRe[t.TILDE]
  11844. return comp.replace(r, function (_, M, m, p, pr) {
  11845. debug('tilde', comp, _, M, m, p, pr)
  11846. var ret
  11847. if (isX(M)) {
  11848. ret = ''
  11849. } else if (isX(m)) {
  11850. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  11851. } else if (isX(p)) {
  11852. // ~1.2 == >=1.2.0 <1.3.0
  11853. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  11854. } else if (pr) {
  11855. debug('replaceTilde pr', pr)
  11856. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11857. ' <' + M + '.' + (+m + 1) + '.0'
  11858. } else {
  11859. // ~1.2.3 == >=1.2.3 <1.3.0
  11860. ret = '>=' + M + '.' + m + '.' + p +
  11861. ' <' + M + '.' + (+m + 1) + '.0'
  11862. }
  11863. debug('tilde return', ret)
  11864. return ret
  11865. })
  11866. }
  11867. // ^ --> * (any, kinda silly)
  11868. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  11869. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  11870. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  11871. // ^1.2.3 --> >=1.2.3 <2.0.0
  11872. // ^1.2.0 --> >=1.2.0 <2.0.0
  11873. function replaceCarets (comp, options) {
  11874. return comp.trim().split(/\s+/).map(function (comp) {
  11875. return replaceCaret(comp, options)
  11876. }).join(' ')
  11877. }
  11878. function replaceCaret (comp, options) {
  11879. debug('caret', comp, options)
  11880. var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[t.CARET]
  11881. return comp.replace(r, function (_, M, m, p, pr) {
  11882. debug('caret', comp, _, M, m, p, pr)
  11883. var ret
  11884. if (isX(M)) {
  11885. ret = ''
  11886. } else if (isX(m)) {
  11887. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  11888. } else if (isX(p)) {
  11889. if (M === '0') {
  11890. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  11891. } else {
  11892. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  11893. }
  11894. } else if (pr) {
  11895. debug('replaceCaret pr', pr)
  11896. if (M === '0') {
  11897. if (m === '0') {
  11898. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11899. ' <' + M + '.' + m + '.' + (+p + 1)
  11900. } else {
  11901. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11902. ' <' + M + '.' + (+m + 1) + '.0'
  11903. }
  11904. } else {
  11905. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11906. ' <' + (+M + 1) + '.0.0'
  11907. }
  11908. } else {
  11909. debug('no pr')
  11910. if (M === '0') {
  11911. if (m === '0') {
  11912. ret = '>=' + M + '.' + m + '.' + p +
  11913. ' <' + M + '.' + m + '.' + (+p + 1)
  11914. } else {
  11915. ret = '>=' + M + '.' + m + '.' + p +
  11916. ' <' + M + '.' + (+m + 1) + '.0'
  11917. }
  11918. } else {
  11919. ret = '>=' + M + '.' + m + '.' + p +
  11920. ' <' + (+M + 1) + '.0.0'
  11921. }
  11922. }
  11923. debug('caret return', ret)
  11924. return ret
  11925. })
  11926. }
  11927. function replaceXRanges (comp, options) {
  11928. debug('replaceXRanges', comp, options)
  11929. return comp.split(/\s+/).map(function (comp) {
  11930. return replaceXRange(comp, options)
  11931. }).join(' ')
  11932. }
  11933. function replaceXRange (comp, options) {
  11934. comp = comp.trim()
  11935. var r = options.loose ? safeRe[t.XRANGELOOSE] : safeRe[t.XRANGE]
  11936. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  11937. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  11938. var xM = isX(M)
  11939. var xm = xM || isX(m)
  11940. var xp = xm || isX(p)
  11941. var anyX = xp
  11942. if (gtlt === '=' && anyX) {
  11943. gtlt = ''
  11944. }
  11945. // if we're including prereleases in the match, then we need
  11946. // to fix this to -0, the lowest possible prerelease value
  11947. pr = options.includePrerelease ? '-0' : ''
  11948. if (xM) {
  11949. if (gtlt === '>' || gtlt === '<') {
  11950. // nothing is allowed
  11951. ret = '<0.0.0-0'
  11952. } else {
  11953. // nothing is forbidden
  11954. ret = '*'
  11955. }
  11956. } else if (gtlt && anyX) {
  11957. // we know patch is an x, because we have any x at all.
  11958. // replace X with 0
  11959. if (xm) {
  11960. m = 0
  11961. }
  11962. p = 0
  11963. if (gtlt === '>') {
  11964. // >1 => >=2.0.0
  11965. // >1.2 => >=1.3.0
  11966. // >1.2.3 => >= 1.2.4
  11967. gtlt = '>='
  11968. if (xm) {
  11969. M = +M + 1
  11970. m = 0
  11971. p = 0
  11972. } else {
  11973. m = +m + 1
  11974. p = 0
  11975. }
  11976. } else if (gtlt === '<=') {
  11977. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  11978. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  11979. gtlt = '<'
  11980. if (xm) {
  11981. M = +M + 1
  11982. } else {
  11983. m = +m + 1
  11984. }
  11985. }
  11986. ret = gtlt + M + '.' + m + '.' + p + pr
  11987. } else if (xm) {
  11988. ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr
  11989. } else if (xp) {
  11990. ret = '>=' + M + '.' + m + '.0' + pr +
  11991. ' <' + M + '.' + (+m + 1) + '.0' + pr
  11992. }
  11993. debug('xRange return', ret)
  11994. return ret
  11995. })
  11996. }
  11997. // Because * is AND-ed with everything else in the comparator,
  11998. // and '' means "any version", just remove the *s entirely.
  11999. function replaceStars (comp, options) {
  12000. debug('replaceStars', comp, options)
  12001. // Looseness is ignored here. star is always as loose as it gets!
  12002. return comp.trim().replace(safeRe[t.STAR], '')
  12003. }
  12004. // This function is passed to string.replace(re[t.HYPHENRANGE])
  12005. // M, m, patch, prerelease, build
  12006. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  12007. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  12008. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  12009. function hyphenReplace ($0,
  12010. from, fM, fm, fp, fpr, fb,
  12011. to, tM, tm, tp, tpr, tb) {
  12012. if (isX(fM)) {
  12013. from = ''
  12014. } else if (isX(fm)) {
  12015. from = '>=' + fM + '.0.0'
  12016. } else if (isX(fp)) {
  12017. from = '>=' + fM + '.' + fm + '.0'
  12018. } else {
  12019. from = '>=' + from
  12020. }
  12021. if (isX(tM)) {
  12022. to = ''
  12023. } else if (isX(tm)) {
  12024. to = '<' + (+tM + 1) + '.0.0'
  12025. } else if (isX(tp)) {
  12026. to = '<' + tM + '.' + (+tm + 1) + '.0'
  12027. } else if (tpr) {
  12028. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  12029. } else {
  12030. to = '<=' + to
  12031. }
  12032. return (from + ' ' + to).trim()
  12033. }
  12034. // if ANY of the sets match ALL of its comparators, then pass
  12035. Range.prototype.test = function (version) {
  12036. if (!version) {
  12037. return false
  12038. }
  12039. if (typeof version === 'string') {
  12040. try {
  12041. version = new SemVer(version, this.options)
  12042. } catch (er) {
  12043. return false
  12044. }
  12045. }
  12046. for (var i = 0; i < this.set.length; i++) {
  12047. if (testSet(this.set[i], version, this.options)) {
  12048. return true
  12049. }
  12050. }
  12051. return false
  12052. }
  12053. function testSet (set, version, options) {
  12054. for (var i = 0; i < set.length; i++) {
  12055. if (!set[i].test(version)) {
  12056. return false
  12057. }
  12058. }
  12059. if (version.prerelease.length && !options.includePrerelease) {
  12060. // Find the set of versions that are allowed to have prereleases
  12061. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  12062. // That should allow `1.2.3-pr.2` to pass.
  12063. // However, `1.2.4-alpha.notready` should NOT be allowed,
  12064. // even though it's within the range set by the comparators.
  12065. for (i = 0; i < set.length; i++) {
  12066. debug(set[i].semver)
  12067. if (set[i].semver === ANY) {
  12068. continue
  12069. }
  12070. if (set[i].semver.prerelease.length > 0) {
  12071. var allowed = set[i].semver
  12072. if (allowed.major === version.major &&
  12073. allowed.minor === version.minor &&
  12074. allowed.patch === version.patch) {
  12075. return true
  12076. }
  12077. }
  12078. }
  12079. // Version has a -pre, but it's not one of the ones we like.
  12080. return false
  12081. }
  12082. return true
  12083. }
  12084. exports.satisfies = satisfies
  12085. function satisfies (version, range, options) {
  12086. try {
  12087. range = new Range(range, options)
  12088. } catch (er) {
  12089. return false
  12090. }
  12091. return range.test(version)
  12092. }
  12093. exports.maxSatisfying = maxSatisfying
  12094. function maxSatisfying (versions, range, options) {
  12095. var max = null
  12096. var maxSV = null
  12097. try {
  12098. var rangeObj = new Range(range, options)
  12099. } catch (er) {
  12100. return null
  12101. }
  12102. versions.forEach(function (v) {
  12103. if (rangeObj.test(v)) {
  12104. // satisfies(v, range, options)
  12105. if (!max || maxSV.compare(v) === -1) {
  12106. // compare(max, v, true)
  12107. max = v
  12108. maxSV = new SemVer(max, options)
  12109. }
  12110. }
  12111. })
  12112. return max
  12113. }
  12114. exports.minSatisfying = minSatisfying
  12115. function minSatisfying (versions, range, options) {
  12116. var min = null
  12117. var minSV = null
  12118. try {
  12119. var rangeObj = new Range(range, options)
  12120. } catch (er) {
  12121. return null
  12122. }
  12123. versions.forEach(function (v) {
  12124. if (rangeObj.test(v)) {
  12125. // satisfies(v, range, options)
  12126. if (!min || minSV.compare(v) === 1) {
  12127. // compare(min, v, true)
  12128. min = v
  12129. minSV = new SemVer(min, options)
  12130. }
  12131. }
  12132. })
  12133. return min
  12134. }
  12135. exports.minVersion = minVersion
  12136. function minVersion (range, loose) {
  12137. range = new Range(range, loose)
  12138. var minver = new SemVer('0.0.0')
  12139. if (range.test(minver)) {
  12140. return minver
  12141. }
  12142. minver = new SemVer('0.0.0-0')
  12143. if (range.test(minver)) {
  12144. return minver
  12145. }
  12146. minver = null
  12147. for (var i = 0; i < range.set.length; ++i) {
  12148. var comparators = range.set[i]
  12149. comparators.forEach(function (comparator) {
  12150. // Clone to avoid manipulating the comparator's semver object.
  12151. var compver = new SemVer(comparator.semver.version)
  12152. switch (comparator.operator) {
  12153. case '>':
  12154. if (compver.prerelease.length === 0) {
  12155. compver.patch++
  12156. } else {
  12157. compver.prerelease.push(0)
  12158. }
  12159. compver.raw = compver.format()
  12160. /* fallthrough */
  12161. case '':
  12162. case '>=':
  12163. if (!minver || gt(minver, compver)) {
  12164. minver = compver
  12165. }
  12166. break
  12167. case '<':
  12168. case '<=':
  12169. /* Ignore maximum versions */
  12170. break
  12171. /* istanbul ignore next */
  12172. default:
  12173. throw new Error('Unexpected operation: ' + comparator.operator)
  12174. }
  12175. })
  12176. }
  12177. if (minver && range.test(minver)) {
  12178. return minver
  12179. }
  12180. return null
  12181. }
  12182. exports.validRange = validRange
  12183. function validRange (range, options) {
  12184. try {
  12185. // Return '*' instead of '' so that truthiness works.
  12186. // This will throw if it's invalid anyway
  12187. return new Range(range, options).range || '*'
  12188. } catch (er) {
  12189. return null
  12190. }
  12191. }
  12192. // Determine if version is less than all the versions possible in the range
  12193. exports.ltr = ltr
  12194. function ltr (version, range, options) {
  12195. return outside(version, range, '<', options)
  12196. }
  12197. // Determine if version is greater than all the versions possible in the range.
  12198. exports.gtr = gtr
  12199. function gtr (version, range, options) {
  12200. return outside(version, range, '>', options)
  12201. }
  12202. exports.outside = outside
  12203. function outside (version, range, hilo, options) {
  12204. version = new SemVer(version, options)
  12205. range = new Range(range, options)
  12206. var gtfn, ltefn, ltfn, comp, ecomp
  12207. switch (hilo) {
  12208. case '>':
  12209. gtfn = gt
  12210. ltefn = lte
  12211. ltfn = lt
  12212. comp = '>'
  12213. ecomp = '>='
  12214. break
  12215. case '<':
  12216. gtfn = lt
  12217. ltefn = gte
  12218. ltfn = gt
  12219. comp = '<'
  12220. ecomp = '<='
  12221. break
  12222. default:
  12223. throw new TypeError('Must provide a hilo val of "<" or ">"')
  12224. }
  12225. // If it satisifes the range it is not outside
  12226. if (satisfies(version, range, options)) {
  12227. return false
  12228. }
  12229. // From now on, variable terms are as if we're in "gtr" mode.
  12230. // but note that everything is flipped for the "ltr" function.
  12231. for (var i = 0; i < range.set.length; ++i) {
  12232. var comparators = range.set[i]
  12233. var high = null
  12234. var low = null
  12235. comparators.forEach(function (comparator) {
  12236. if (comparator.semver === ANY) {
  12237. comparator = new Comparator('>=0.0.0')
  12238. }
  12239. high = high || comparator
  12240. low = low || comparator
  12241. if (gtfn(comparator.semver, high.semver, options)) {
  12242. high = comparator
  12243. } else if (ltfn(comparator.semver, low.semver, options)) {
  12244. low = comparator
  12245. }
  12246. })
  12247. // If the edge version comparator has a operator then our version
  12248. // isn't outside it
  12249. if (high.operator === comp || high.operator === ecomp) {
  12250. return false
  12251. }
  12252. // If the lowest version comparator has an operator and our version
  12253. // is less than it then it isn't higher than the range
  12254. if ((!low.operator || low.operator === comp) &&
  12255. ltefn(version, low.semver)) {
  12256. return false
  12257. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  12258. return false
  12259. }
  12260. }
  12261. return true
  12262. }
  12263. exports.prerelease = prerelease
  12264. function prerelease (version, options) {
  12265. var parsed = parse(version, options)
  12266. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  12267. }
  12268. exports.intersects = intersects
  12269. function intersects (r1, r2, options) {
  12270. r1 = new Range(r1, options)
  12271. r2 = new Range(r2, options)
  12272. return r1.intersects(r2)
  12273. }
  12274. exports.coerce = coerce
  12275. function coerce (version, options) {
  12276. if (version instanceof SemVer) {
  12277. return version
  12278. }
  12279. if (typeof version === 'number') {
  12280. version = String(version)
  12281. }
  12282. if (typeof version !== 'string') {
  12283. return null
  12284. }
  12285. options = options || {}
  12286. var match = null
  12287. if (!options.rtl) {
  12288. match = version.match(safeRe[t.COERCE])
  12289. } else {
  12290. // Find the right-most coercible string that does not share
  12291. // a terminus with a more left-ward coercible string.
  12292. // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
  12293. //
  12294. // Walk through the string checking with a /g regexp
  12295. // Manually set the index so as to pick up overlapping matches.
  12296. // Stop when we get a match that ends at the string end, since no
  12297. // coercible string can be more right-ward without the same terminus.
  12298. var next
  12299. while ((next = safeRe[t.COERCERTL].exec(version)) &&
  12300. (!match || match.index + match[0].length !== version.length)
  12301. ) {
  12302. if (!match ||
  12303. next.index + next[0].length !== match.index + match[0].length) {
  12304. match = next
  12305. }
  12306. safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length
  12307. }
  12308. // leave it in a clean state
  12309. safeRe[t.COERCERTL].lastIndex = -1
  12310. }
  12311. if (match === null) {
  12312. return null
  12313. }
  12314. return parse(match[2] +
  12315. '.' + (match[3] || '0') +
  12316. '.' + (match[4] || '0'), options)
  12317. }
  12318. /***/ }),
  12319. /***/ 4294:
  12320. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  12321. module.exports = __nccwpck_require__(4219);
  12322. /***/ }),
  12323. /***/ 4219:
  12324. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  12325. "use strict";
  12326. var net = __nccwpck_require__(1808);
  12327. var tls = __nccwpck_require__(4404);
  12328. var http = __nccwpck_require__(3685);
  12329. var https = __nccwpck_require__(5687);
  12330. var events = __nccwpck_require__(2361);
  12331. var assert = __nccwpck_require__(9491);
  12332. var util = __nccwpck_require__(3837);
  12333. exports.httpOverHttp = httpOverHttp;
  12334. exports.httpsOverHttp = httpsOverHttp;
  12335. exports.httpOverHttps = httpOverHttps;
  12336. exports.httpsOverHttps = httpsOverHttps;
  12337. function httpOverHttp(options) {
  12338. var agent = new TunnelingAgent(options);
  12339. agent.request = http.request;
  12340. return agent;
  12341. }
  12342. function httpsOverHttp(options) {
  12343. var agent = new TunnelingAgent(options);
  12344. agent.request = http.request;
  12345. agent.createSocket = createSecureSocket;
  12346. agent.defaultPort = 443;
  12347. return agent;
  12348. }
  12349. function httpOverHttps(options) {
  12350. var agent = new TunnelingAgent(options);
  12351. agent.request = https.request;
  12352. return agent;
  12353. }
  12354. function httpsOverHttps(options) {
  12355. var agent = new TunnelingAgent(options);
  12356. agent.request = https.request;
  12357. agent.createSocket = createSecureSocket;
  12358. agent.defaultPort = 443;
  12359. return agent;
  12360. }
  12361. function TunnelingAgent(options) {
  12362. var self = this;
  12363. self.options = options || {};
  12364. self.proxyOptions = self.options.proxy || {};
  12365. self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;
  12366. self.requests = [];
  12367. self.sockets = [];
  12368. self.on('free', function onFree(socket, host, port, localAddress) {
  12369. var options = toOptions(host, port, localAddress);
  12370. for (var i = 0, len = self.requests.length; i < len; ++i) {
  12371. var pending = self.requests[i];
  12372. if (pending.host === options.host && pending.port === options.port) {
  12373. // Detect the request to connect same origin server,
  12374. // reuse the connection.
  12375. self.requests.splice(i, 1);
  12376. pending.request.onSocket(socket);
  12377. return;
  12378. }
  12379. }
  12380. socket.destroy();
  12381. self.removeSocket(socket);
  12382. });
  12383. }
  12384. util.inherits(TunnelingAgent, events.EventEmitter);
  12385. TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {
  12386. var self = this;
  12387. var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));
  12388. if (self.sockets.length >= this.maxSockets) {
  12389. // We are over limit so we'll add it to the queue.
  12390. self.requests.push(options);
  12391. return;
  12392. }
  12393. // If we are under maxSockets create a new one.
  12394. self.createSocket(options, function(socket) {
  12395. socket.on('free', onFree);
  12396. socket.on('close', onCloseOrRemove);
  12397. socket.on('agentRemove', onCloseOrRemove);
  12398. req.onSocket(socket);
  12399. function onFree() {
  12400. self.emit('free', socket, options);
  12401. }
  12402. function onCloseOrRemove(err) {
  12403. self.removeSocket(socket);
  12404. socket.removeListener('free', onFree);
  12405. socket.removeListener('close', onCloseOrRemove);
  12406. socket.removeListener('agentRemove', onCloseOrRemove);
  12407. }
  12408. });
  12409. };
  12410. TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
  12411. var self = this;
  12412. var placeholder = {};
  12413. self.sockets.push(placeholder);
  12414. var connectOptions = mergeOptions({}, self.proxyOptions, {
  12415. method: 'CONNECT',
  12416. path: options.host + ':' + options.port,
  12417. agent: false,
  12418. headers: {
  12419. host: options.host + ':' + options.port
  12420. }
  12421. });
  12422. if (options.localAddress) {
  12423. connectOptions.localAddress = options.localAddress;
  12424. }
  12425. if (connectOptions.proxyAuth) {
  12426. connectOptions.headers = connectOptions.headers || {};
  12427. connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
  12428. new Buffer(connectOptions.proxyAuth).toString('base64');
  12429. }
  12430. debug('making CONNECT request');
  12431. var connectReq = self.request(connectOptions);
  12432. connectReq.useChunkedEncodingByDefault = false; // for v0.6
  12433. connectReq.once('response', onResponse); // for v0.6
  12434. connectReq.once('upgrade', onUpgrade); // for v0.6
  12435. connectReq.once('connect', onConnect); // for v0.7 or later
  12436. connectReq.once('error', onError);
  12437. connectReq.end();
  12438. function onResponse(res) {
  12439. // Very hacky. This is necessary to avoid http-parser leaks.
  12440. res.upgrade = true;
  12441. }
  12442. function onUpgrade(res, socket, head) {
  12443. // Hacky.
  12444. process.nextTick(function() {
  12445. onConnect(res, socket, head);
  12446. });
  12447. }
  12448. function onConnect(res, socket, head) {
  12449. connectReq.removeAllListeners();
  12450. socket.removeAllListeners();
  12451. if (res.statusCode !== 200) {
  12452. debug('tunneling socket could not be established, statusCode=%d',
  12453. res.statusCode);
  12454. socket.destroy();
  12455. var error = new Error('tunneling socket could not be established, ' +
  12456. 'statusCode=' + res.statusCode);
  12457. error.code = 'ECONNRESET';
  12458. options.request.emit('error', error);
  12459. self.removeSocket(placeholder);
  12460. return;
  12461. }
  12462. if (head.length > 0) {
  12463. debug('got illegal response body from proxy');
  12464. socket.destroy();
  12465. var error = new Error('got illegal response body from proxy');
  12466. error.code = 'ECONNRESET';
  12467. options.request.emit('error', error);
  12468. self.removeSocket(placeholder);
  12469. return;
  12470. }
  12471. debug('tunneling connection has established');
  12472. self.sockets[self.sockets.indexOf(placeholder)] = socket;
  12473. return cb(socket);
  12474. }
  12475. function onError(cause) {
  12476. connectReq.removeAllListeners();
  12477. debug('tunneling socket could not be established, cause=%s\n',
  12478. cause.message, cause.stack);
  12479. var error = new Error('tunneling socket could not be established, ' +
  12480. 'cause=' + cause.message);
  12481. error.code = 'ECONNRESET';
  12482. options.request.emit('error', error);
  12483. self.removeSocket(placeholder);
  12484. }
  12485. };
  12486. TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
  12487. var pos = this.sockets.indexOf(socket)
  12488. if (pos === -1) {
  12489. return;
  12490. }
  12491. this.sockets.splice(pos, 1);
  12492. var pending = this.requests.shift();
  12493. if (pending) {
  12494. // If we have pending requests and a socket gets closed a new one
  12495. // needs to be created to take over in the pool for the one that closed.
  12496. this.createSocket(pending, function(socket) {
  12497. pending.request.onSocket(socket);
  12498. });
  12499. }
  12500. };
  12501. function createSecureSocket(options, cb) {
  12502. var self = this;
  12503. TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
  12504. var hostHeader = options.request.getHeader('host');
  12505. var tlsOptions = mergeOptions({}, self.options, {
  12506. socket: socket,
  12507. servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host
  12508. });
  12509. // 0 is dummy port for v0.6
  12510. var secureSocket = tls.connect(0, tlsOptions);
  12511. self.sockets[self.sockets.indexOf(socket)] = secureSocket;
  12512. cb(secureSocket);
  12513. });
  12514. }
  12515. function toOptions(host, port, localAddress) {
  12516. if (typeof host === 'string') { // since v0.10
  12517. return {
  12518. host: host,
  12519. port: port,
  12520. localAddress: localAddress
  12521. };
  12522. }
  12523. return host; // for v0.11 or later
  12524. }
  12525. function mergeOptions(target) {
  12526. for (var i = 1, len = arguments.length; i < len; ++i) {
  12527. var overrides = arguments[i];
  12528. if (typeof overrides === 'object') {
  12529. var keys = Object.keys(overrides);
  12530. for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
  12531. var k = keys[j];
  12532. if (overrides[k] !== undefined) {
  12533. target[k] = overrides[k];
  12534. }
  12535. }
  12536. }
  12537. }
  12538. return target;
  12539. }
  12540. var debug;
  12541. if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
  12542. debug = function() {
  12543. var args = Array.prototype.slice.call(arguments);
  12544. if (typeof args[0] === 'string') {
  12545. args[0] = 'TUNNEL: ' + args[0];
  12546. } else {
  12547. args.unshift('TUNNEL:');
  12548. }
  12549. console.error.apply(console, args);
  12550. }
  12551. } else {
  12552. debug = function() {};
  12553. }
  12554. exports.debug = debug; // for test
  12555. /***/ }),
  12556. /***/ 1773:
  12557. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  12558. "use strict";
  12559. const Client = __nccwpck_require__(3598)
  12560. const Dispatcher = __nccwpck_require__(412)
  12561. const errors = __nccwpck_require__(8045)
  12562. const Pool = __nccwpck_require__(4634)
  12563. const BalancedPool = __nccwpck_require__(7931)
  12564. const Agent = __nccwpck_require__(7890)
  12565. const util = __nccwpck_require__(3983)
  12566. const { InvalidArgumentError } = errors
  12567. const api = __nccwpck_require__(4059)
  12568. const buildConnector = __nccwpck_require__(2067)
  12569. const MockClient = __nccwpck_require__(8687)
  12570. const MockAgent = __nccwpck_require__(6771)
  12571. const MockPool = __nccwpck_require__(6193)
  12572. const mockErrors = __nccwpck_require__(888)
  12573. const ProxyAgent = __nccwpck_require__(7858)
  12574. const RetryHandler = __nccwpck_require__(2286)
  12575. const { getGlobalDispatcher, setGlobalDispatcher } = __nccwpck_require__(1892)
  12576. const DecoratorHandler = __nccwpck_require__(6930)
  12577. const RedirectHandler = __nccwpck_require__(2860)
  12578. const createRedirectInterceptor = __nccwpck_require__(8861)
  12579. let hasCrypto
  12580. try {
  12581. __nccwpck_require__(6113)
  12582. hasCrypto = true
  12583. } catch {
  12584. hasCrypto = false
  12585. }
  12586. Object.assign(Dispatcher.prototype, api)
  12587. module.exports.Dispatcher = Dispatcher
  12588. module.exports.Client = Client
  12589. module.exports.Pool = Pool
  12590. module.exports.BalancedPool = BalancedPool
  12591. module.exports.Agent = Agent
  12592. module.exports.ProxyAgent = ProxyAgent
  12593. module.exports.RetryHandler = RetryHandler
  12594. module.exports.DecoratorHandler = DecoratorHandler
  12595. module.exports.RedirectHandler = RedirectHandler
  12596. module.exports.createRedirectInterceptor = createRedirectInterceptor
  12597. module.exports.buildConnector = buildConnector
  12598. module.exports.errors = errors
  12599. function makeDispatcher (fn) {
  12600. return (url, opts, handler) => {
  12601. if (typeof opts === 'function') {
  12602. handler = opts
  12603. opts = null
  12604. }
  12605. if (!url || (typeof url !== 'string' && typeof url !== 'object' && !(url instanceof URL))) {
  12606. throw new InvalidArgumentError('invalid url')
  12607. }
  12608. if (opts != null && typeof opts !== 'object') {
  12609. throw new InvalidArgumentError('invalid opts')
  12610. }
  12611. if (opts && opts.path != null) {
  12612. if (typeof opts.path !== 'string') {
  12613. throw new InvalidArgumentError('invalid opts.path')
  12614. }
  12615. let path = opts.path
  12616. if (!opts.path.startsWith('/')) {
  12617. path = `/${path}`
  12618. }
  12619. url = new URL(util.parseOrigin(url).origin + path)
  12620. } else {
  12621. if (!opts) {
  12622. opts = typeof url === 'object' ? url : {}
  12623. }
  12624. url = util.parseURL(url)
  12625. }
  12626. const { agent, dispatcher = getGlobalDispatcher() } = opts
  12627. if (agent) {
  12628. throw new InvalidArgumentError('unsupported opts.agent. Did you mean opts.client?')
  12629. }
  12630. return fn.call(dispatcher, {
  12631. ...opts,
  12632. origin: url.origin,
  12633. path: url.search ? `${url.pathname}${url.search}` : url.pathname,
  12634. method: opts.method || (opts.body ? 'PUT' : 'GET')
  12635. }, handler)
  12636. }
  12637. }
  12638. module.exports.setGlobalDispatcher = setGlobalDispatcher
  12639. module.exports.getGlobalDispatcher = getGlobalDispatcher
  12640. if (util.nodeMajor > 16 || (util.nodeMajor === 16 && util.nodeMinor >= 8)) {
  12641. let fetchImpl = null
  12642. module.exports.fetch = async function fetch (resource) {
  12643. if (!fetchImpl) {
  12644. fetchImpl = (__nccwpck_require__(4881).fetch)
  12645. }
  12646. try {
  12647. return await fetchImpl(...arguments)
  12648. } catch (err) {
  12649. if (typeof err === 'object') {
  12650. Error.captureStackTrace(err, this)
  12651. }
  12652. throw err
  12653. }
  12654. }
  12655. module.exports.Headers = __nccwpck_require__(554).Headers
  12656. module.exports.Response = __nccwpck_require__(7823).Response
  12657. module.exports.Request = __nccwpck_require__(8359).Request
  12658. module.exports.FormData = __nccwpck_require__(2015).FormData
  12659. module.exports.File = __nccwpck_require__(8511).File
  12660. module.exports.FileReader = __nccwpck_require__(1446).FileReader
  12661. const { setGlobalOrigin, getGlobalOrigin } = __nccwpck_require__(1246)
  12662. module.exports.setGlobalOrigin = setGlobalOrigin
  12663. module.exports.getGlobalOrigin = getGlobalOrigin
  12664. const { CacheStorage } = __nccwpck_require__(7907)
  12665. const { kConstruct } = __nccwpck_require__(9174)
  12666. // Cache & CacheStorage are tightly coupled with fetch. Even if it may run
  12667. // in an older version of Node, it doesn't have any use without fetch.
  12668. module.exports.caches = new CacheStorage(kConstruct)
  12669. }
  12670. if (util.nodeMajor >= 16) {
  12671. const { deleteCookie, getCookies, getSetCookies, setCookie } = __nccwpck_require__(1724)
  12672. module.exports.deleteCookie = deleteCookie
  12673. module.exports.getCookies = getCookies
  12674. module.exports.getSetCookies = getSetCookies
  12675. module.exports.setCookie = setCookie
  12676. const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(685)
  12677. module.exports.parseMIMEType = parseMIMEType
  12678. module.exports.serializeAMimeType = serializeAMimeType
  12679. }
  12680. if (util.nodeMajor >= 18 && hasCrypto) {
  12681. const { WebSocket } = __nccwpck_require__(4284)
  12682. module.exports.WebSocket = WebSocket
  12683. }
  12684. module.exports.request = makeDispatcher(api.request)
  12685. module.exports.stream = makeDispatcher(api.stream)
  12686. module.exports.pipeline = makeDispatcher(api.pipeline)
  12687. module.exports.connect = makeDispatcher(api.connect)
  12688. module.exports.upgrade = makeDispatcher(api.upgrade)
  12689. module.exports.MockClient = MockClient
  12690. module.exports.MockPool = MockPool
  12691. module.exports.MockAgent = MockAgent
  12692. module.exports.mockErrors = mockErrors
  12693. /***/ }),
  12694. /***/ 7890:
  12695. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  12696. "use strict";
  12697. const { InvalidArgumentError } = __nccwpck_require__(8045)
  12698. const { kClients, kRunning, kClose, kDestroy, kDispatch, kInterceptors } = __nccwpck_require__(2785)
  12699. const DispatcherBase = __nccwpck_require__(4839)
  12700. const Pool = __nccwpck_require__(4634)
  12701. const Client = __nccwpck_require__(3598)
  12702. const util = __nccwpck_require__(3983)
  12703. const createRedirectInterceptor = __nccwpck_require__(8861)
  12704. const { WeakRef, FinalizationRegistry } = __nccwpck_require__(6436)()
  12705. const kOnConnect = Symbol('onConnect')
  12706. const kOnDisconnect = Symbol('onDisconnect')
  12707. const kOnConnectionError = Symbol('onConnectionError')
  12708. const kMaxRedirections = Symbol('maxRedirections')
  12709. const kOnDrain = Symbol('onDrain')
  12710. const kFactory = Symbol('factory')
  12711. const kFinalizer = Symbol('finalizer')
  12712. const kOptions = Symbol('options')
  12713. function defaultFactory (origin, opts) {
  12714. return opts && opts.connections === 1
  12715. ? new Client(origin, opts)
  12716. : new Pool(origin, opts)
  12717. }
  12718. class Agent extends DispatcherBase {
  12719. constructor ({ factory = defaultFactory, maxRedirections = 0, connect, ...options } = {}) {
  12720. super()
  12721. if (typeof factory !== 'function') {
  12722. throw new InvalidArgumentError('factory must be a function.')
  12723. }
  12724. if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {
  12725. throw new InvalidArgumentError('connect must be a function or an object')
  12726. }
  12727. if (!Number.isInteger(maxRedirections) || maxRedirections < 0) {
  12728. throw new InvalidArgumentError('maxRedirections must be a positive number')
  12729. }
  12730. if (connect && typeof connect !== 'function') {
  12731. connect = { ...connect }
  12732. }
  12733. this[kInterceptors] = options.interceptors && options.interceptors.Agent && Array.isArray(options.interceptors.Agent)
  12734. ? options.interceptors.Agent
  12735. : [createRedirectInterceptor({ maxRedirections })]
  12736. this[kOptions] = { ...util.deepClone(options), connect }
  12737. this[kOptions].interceptors = options.interceptors
  12738. ? { ...options.interceptors }
  12739. : undefined
  12740. this[kMaxRedirections] = maxRedirections
  12741. this[kFactory] = factory
  12742. this[kClients] = new Map()
  12743. this[kFinalizer] = new FinalizationRegistry(/* istanbul ignore next: gc is undeterministic */ key => {
  12744. const ref = this[kClients].get(key)
  12745. if (ref !== undefined && ref.deref() === undefined) {
  12746. this[kClients].delete(key)
  12747. }
  12748. })
  12749. const agent = this
  12750. this[kOnDrain] = (origin, targets) => {
  12751. agent.emit('drain', origin, [agent, ...targets])
  12752. }
  12753. this[kOnConnect] = (origin, targets) => {
  12754. agent.emit('connect', origin, [agent, ...targets])
  12755. }
  12756. this[kOnDisconnect] = (origin, targets, err) => {
  12757. agent.emit('disconnect', origin, [agent, ...targets], err)
  12758. }
  12759. this[kOnConnectionError] = (origin, targets, err) => {
  12760. agent.emit('connectionError', origin, [agent, ...targets], err)
  12761. }
  12762. }
  12763. get [kRunning] () {
  12764. let ret = 0
  12765. for (const ref of this[kClients].values()) {
  12766. const client = ref.deref()
  12767. /* istanbul ignore next: gc is undeterministic */
  12768. if (client) {
  12769. ret += client[kRunning]
  12770. }
  12771. }
  12772. return ret
  12773. }
  12774. [kDispatch] (opts, handler) {
  12775. let key
  12776. if (opts.origin && (typeof opts.origin === 'string' || opts.origin instanceof URL)) {
  12777. key = String(opts.origin)
  12778. } else {
  12779. throw new InvalidArgumentError('opts.origin must be a non-empty string or URL.')
  12780. }
  12781. const ref = this[kClients].get(key)
  12782. let dispatcher = ref ? ref.deref() : null
  12783. if (!dispatcher) {
  12784. dispatcher = this[kFactory](opts.origin, this[kOptions])
  12785. .on('drain', this[kOnDrain])
  12786. .on('connect', this[kOnConnect])
  12787. .on('disconnect', this[kOnDisconnect])
  12788. .on('connectionError', this[kOnConnectionError])
  12789. this[kClients].set(key, new WeakRef(dispatcher))
  12790. this[kFinalizer].register(dispatcher, key)
  12791. }
  12792. return dispatcher.dispatch(opts, handler)
  12793. }
  12794. async [kClose] () {
  12795. const closePromises = []
  12796. for (const ref of this[kClients].values()) {
  12797. const client = ref.deref()
  12798. /* istanbul ignore else: gc is undeterministic */
  12799. if (client) {
  12800. closePromises.push(client.close())
  12801. }
  12802. }
  12803. await Promise.all(closePromises)
  12804. }
  12805. async [kDestroy] (err) {
  12806. const destroyPromises = []
  12807. for (const ref of this[kClients].values()) {
  12808. const client = ref.deref()
  12809. /* istanbul ignore else: gc is undeterministic */
  12810. if (client) {
  12811. destroyPromises.push(client.destroy(err))
  12812. }
  12813. }
  12814. await Promise.all(destroyPromises)
  12815. }
  12816. }
  12817. module.exports = Agent
  12818. /***/ }),
  12819. /***/ 7032:
  12820. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  12821. const { addAbortListener } = __nccwpck_require__(3983)
  12822. const { RequestAbortedError } = __nccwpck_require__(8045)
  12823. const kListener = Symbol('kListener')
  12824. const kSignal = Symbol('kSignal')
  12825. function abort (self) {
  12826. if (self.abort) {
  12827. self.abort()
  12828. } else {
  12829. self.onError(new RequestAbortedError())
  12830. }
  12831. }
  12832. function addSignal (self, signal) {
  12833. self[kSignal] = null
  12834. self[kListener] = null
  12835. if (!signal) {
  12836. return
  12837. }
  12838. if (signal.aborted) {
  12839. abort(self)
  12840. return
  12841. }
  12842. self[kSignal] = signal
  12843. self[kListener] = () => {
  12844. abort(self)
  12845. }
  12846. addAbortListener(self[kSignal], self[kListener])
  12847. }
  12848. function removeSignal (self) {
  12849. if (!self[kSignal]) {
  12850. return
  12851. }
  12852. if ('removeEventListener' in self[kSignal]) {
  12853. self[kSignal].removeEventListener('abort', self[kListener])
  12854. } else {
  12855. self[kSignal].removeListener('abort', self[kListener])
  12856. }
  12857. self[kSignal] = null
  12858. self[kListener] = null
  12859. }
  12860. module.exports = {
  12861. addSignal,
  12862. removeSignal
  12863. }
  12864. /***/ }),
  12865. /***/ 9744:
  12866. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  12867. "use strict";
  12868. const { AsyncResource } = __nccwpck_require__(852)
  12869. const { InvalidArgumentError, RequestAbortedError, SocketError } = __nccwpck_require__(8045)
  12870. const util = __nccwpck_require__(3983)
  12871. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  12872. class ConnectHandler extends AsyncResource {
  12873. constructor (opts, callback) {
  12874. if (!opts || typeof opts !== 'object') {
  12875. throw new InvalidArgumentError('invalid opts')
  12876. }
  12877. if (typeof callback !== 'function') {
  12878. throw new InvalidArgumentError('invalid callback')
  12879. }
  12880. const { signal, opaque, responseHeaders } = opts
  12881. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  12882. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  12883. }
  12884. super('UNDICI_CONNECT')
  12885. this.opaque = opaque || null
  12886. this.responseHeaders = responseHeaders || null
  12887. this.callback = callback
  12888. this.abort = null
  12889. addSignal(this, signal)
  12890. }
  12891. onConnect (abort, context) {
  12892. if (!this.callback) {
  12893. throw new RequestAbortedError()
  12894. }
  12895. this.abort = abort
  12896. this.context = context
  12897. }
  12898. onHeaders () {
  12899. throw new SocketError('bad connect', null)
  12900. }
  12901. onUpgrade (statusCode, rawHeaders, socket) {
  12902. const { callback, opaque, context } = this
  12903. removeSignal(this)
  12904. this.callback = null
  12905. let headers = rawHeaders
  12906. // Indicates is an HTTP2Session
  12907. if (headers != null) {
  12908. headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  12909. }
  12910. this.runInAsyncScope(callback, null, null, {
  12911. statusCode,
  12912. headers,
  12913. socket,
  12914. opaque,
  12915. context
  12916. })
  12917. }
  12918. onError (err) {
  12919. const { callback, opaque } = this
  12920. removeSignal(this)
  12921. if (callback) {
  12922. this.callback = null
  12923. queueMicrotask(() => {
  12924. this.runInAsyncScope(callback, null, err, { opaque })
  12925. })
  12926. }
  12927. }
  12928. }
  12929. function connect (opts, callback) {
  12930. if (callback === undefined) {
  12931. return new Promise((resolve, reject) => {
  12932. connect.call(this, opts, (err, data) => {
  12933. return err ? reject(err) : resolve(data)
  12934. })
  12935. })
  12936. }
  12937. try {
  12938. const connectHandler = new ConnectHandler(opts, callback)
  12939. this.dispatch({ ...opts, method: 'CONNECT' }, connectHandler)
  12940. } catch (err) {
  12941. if (typeof callback !== 'function') {
  12942. throw err
  12943. }
  12944. const opaque = opts && opts.opaque
  12945. queueMicrotask(() => callback(err, { opaque }))
  12946. }
  12947. }
  12948. module.exports = connect
  12949. /***/ }),
  12950. /***/ 8752:
  12951. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  12952. "use strict";
  12953. const {
  12954. Readable,
  12955. Duplex,
  12956. PassThrough
  12957. } = __nccwpck_require__(2781)
  12958. const {
  12959. InvalidArgumentError,
  12960. InvalidReturnValueError,
  12961. RequestAbortedError
  12962. } = __nccwpck_require__(8045)
  12963. const util = __nccwpck_require__(3983)
  12964. const { AsyncResource } = __nccwpck_require__(852)
  12965. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  12966. const assert = __nccwpck_require__(9491)
  12967. const kResume = Symbol('resume')
  12968. class PipelineRequest extends Readable {
  12969. constructor () {
  12970. super({ autoDestroy: true })
  12971. this[kResume] = null
  12972. }
  12973. _read () {
  12974. const { [kResume]: resume } = this
  12975. if (resume) {
  12976. this[kResume] = null
  12977. resume()
  12978. }
  12979. }
  12980. _destroy (err, callback) {
  12981. this._read()
  12982. callback(err)
  12983. }
  12984. }
  12985. class PipelineResponse extends Readable {
  12986. constructor (resume) {
  12987. super({ autoDestroy: true })
  12988. this[kResume] = resume
  12989. }
  12990. _read () {
  12991. this[kResume]()
  12992. }
  12993. _destroy (err, callback) {
  12994. if (!err && !this._readableState.endEmitted) {
  12995. err = new RequestAbortedError()
  12996. }
  12997. callback(err)
  12998. }
  12999. }
  13000. class PipelineHandler extends AsyncResource {
  13001. constructor (opts, handler) {
  13002. if (!opts || typeof opts !== 'object') {
  13003. throw new InvalidArgumentError('invalid opts')
  13004. }
  13005. if (typeof handler !== 'function') {
  13006. throw new InvalidArgumentError('invalid handler')
  13007. }
  13008. const { signal, method, opaque, onInfo, responseHeaders } = opts
  13009. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  13010. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  13011. }
  13012. if (method === 'CONNECT') {
  13013. throw new InvalidArgumentError('invalid method')
  13014. }
  13015. if (onInfo && typeof onInfo !== 'function') {
  13016. throw new InvalidArgumentError('invalid onInfo callback')
  13017. }
  13018. super('UNDICI_PIPELINE')
  13019. this.opaque = opaque || null
  13020. this.responseHeaders = responseHeaders || null
  13021. this.handler = handler
  13022. this.abort = null
  13023. this.context = null
  13024. this.onInfo = onInfo || null
  13025. this.req = new PipelineRequest().on('error', util.nop)
  13026. this.ret = new Duplex({
  13027. readableObjectMode: opts.objectMode,
  13028. autoDestroy: true,
  13029. read: () => {
  13030. const { body } = this
  13031. if (body && body.resume) {
  13032. body.resume()
  13033. }
  13034. },
  13035. write: (chunk, encoding, callback) => {
  13036. const { req } = this
  13037. if (req.push(chunk, encoding) || req._readableState.destroyed) {
  13038. callback()
  13039. } else {
  13040. req[kResume] = callback
  13041. }
  13042. },
  13043. destroy: (err, callback) => {
  13044. const { body, req, res, ret, abort } = this
  13045. if (!err && !ret._readableState.endEmitted) {
  13046. err = new RequestAbortedError()
  13047. }
  13048. if (abort && err) {
  13049. abort()
  13050. }
  13051. util.destroy(body, err)
  13052. util.destroy(req, err)
  13053. util.destroy(res, err)
  13054. removeSignal(this)
  13055. callback(err)
  13056. }
  13057. }).on('prefinish', () => {
  13058. const { req } = this
  13059. // Node < 15 does not call _final in same tick.
  13060. req.push(null)
  13061. })
  13062. this.res = null
  13063. addSignal(this, signal)
  13064. }
  13065. onConnect (abort, context) {
  13066. const { ret, res } = this
  13067. assert(!res, 'pipeline cannot be retried')
  13068. if (ret.destroyed) {
  13069. throw new RequestAbortedError()
  13070. }
  13071. this.abort = abort
  13072. this.context = context
  13073. }
  13074. onHeaders (statusCode, rawHeaders, resume) {
  13075. const { opaque, handler, context } = this
  13076. if (statusCode < 200) {
  13077. if (this.onInfo) {
  13078. const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13079. this.onInfo({ statusCode, headers })
  13080. }
  13081. return
  13082. }
  13083. this.res = new PipelineResponse(resume)
  13084. let body
  13085. try {
  13086. this.handler = null
  13087. const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13088. body = this.runInAsyncScope(handler, null, {
  13089. statusCode,
  13090. headers,
  13091. opaque,
  13092. body: this.res,
  13093. context
  13094. })
  13095. } catch (err) {
  13096. this.res.on('error', util.nop)
  13097. throw err
  13098. }
  13099. if (!body || typeof body.on !== 'function') {
  13100. throw new InvalidReturnValueError('expected Readable')
  13101. }
  13102. body
  13103. .on('data', (chunk) => {
  13104. const { ret, body } = this
  13105. if (!ret.push(chunk) && body.pause) {
  13106. body.pause()
  13107. }
  13108. })
  13109. .on('error', (err) => {
  13110. const { ret } = this
  13111. util.destroy(ret, err)
  13112. })
  13113. .on('end', () => {
  13114. const { ret } = this
  13115. ret.push(null)
  13116. })
  13117. .on('close', () => {
  13118. const { ret } = this
  13119. if (!ret._readableState.ended) {
  13120. util.destroy(ret, new RequestAbortedError())
  13121. }
  13122. })
  13123. this.body = body
  13124. }
  13125. onData (chunk) {
  13126. const { res } = this
  13127. return res.push(chunk)
  13128. }
  13129. onComplete (trailers) {
  13130. const { res } = this
  13131. res.push(null)
  13132. }
  13133. onError (err) {
  13134. const { ret } = this
  13135. this.handler = null
  13136. util.destroy(ret, err)
  13137. }
  13138. }
  13139. function pipeline (opts, handler) {
  13140. try {
  13141. const pipelineHandler = new PipelineHandler(opts, handler)
  13142. this.dispatch({ ...opts, body: pipelineHandler.req }, pipelineHandler)
  13143. return pipelineHandler.ret
  13144. } catch (err) {
  13145. return new PassThrough().destroy(err)
  13146. }
  13147. }
  13148. module.exports = pipeline
  13149. /***/ }),
  13150. /***/ 5448:
  13151. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13152. "use strict";
  13153. const Readable = __nccwpck_require__(3858)
  13154. const {
  13155. InvalidArgumentError,
  13156. RequestAbortedError
  13157. } = __nccwpck_require__(8045)
  13158. const util = __nccwpck_require__(3983)
  13159. const { getResolveErrorBodyCallback } = __nccwpck_require__(7474)
  13160. const { AsyncResource } = __nccwpck_require__(852)
  13161. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  13162. class RequestHandler extends AsyncResource {
  13163. constructor (opts, callback) {
  13164. if (!opts || typeof opts !== 'object') {
  13165. throw new InvalidArgumentError('invalid opts')
  13166. }
  13167. const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError, highWaterMark } = opts
  13168. try {
  13169. if (typeof callback !== 'function') {
  13170. throw new InvalidArgumentError('invalid callback')
  13171. }
  13172. if (highWaterMark && (typeof highWaterMark !== 'number' || highWaterMark < 0)) {
  13173. throw new InvalidArgumentError('invalid highWaterMark')
  13174. }
  13175. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  13176. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  13177. }
  13178. if (method === 'CONNECT') {
  13179. throw new InvalidArgumentError('invalid method')
  13180. }
  13181. if (onInfo && typeof onInfo !== 'function') {
  13182. throw new InvalidArgumentError('invalid onInfo callback')
  13183. }
  13184. super('UNDICI_REQUEST')
  13185. } catch (err) {
  13186. if (util.isStream(body)) {
  13187. util.destroy(body.on('error', util.nop), err)
  13188. }
  13189. throw err
  13190. }
  13191. this.responseHeaders = responseHeaders || null
  13192. this.opaque = opaque || null
  13193. this.callback = callback
  13194. this.res = null
  13195. this.abort = null
  13196. this.body = body
  13197. this.trailers = {}
  13198. this.context = null
  13199. this.onInfo = onInfo || null
  13200. this.throwOnError = throwOnError
  13201. this.highWaterMark = highWaterMark
  13202. if (util.isStream(body)) {
  13203. body.on('error', (err) => {
  13204. this.onError(err)
  13205. })
  13206. }
  13207. addSignal(this, signal)
  13208. }
  13209. onConnect (abort, context) {
  13210. if (!this.callback) {
  13211. throw new RequestAbortedError()
  13212. }
  13213. this.abort = abort
  13214. this.context = context
  13215. }
  13216. onHeaders (statusCode, rawHeaders, resume, statusMessage) {
  13217. const { callback, opaque, abort, context, responseHeaders, highWaterMark } = this
  13218. const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13219. if (statusCode < 200) {
  13220. if (this.onInfo) {
  13221. this.onInfo({ statusCode, headers })
  13222. }
  13223. return
  13224. }
  13225. const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers
  13226. const contentType = parsedHeaders['content-type']
  13227. const body = new Readable({ resume, abort, contentType, highWaterMark })
  13228. this.callback = null
  13229. this.res = body
  13230. if (callback !== null) {
  13231. if (this.throwOnError && statusCode >= 400) {
  13232. this.runInAsyncScope(getResolveErrorBodyCallback, null,
  13233. { callback, body, contentType, statusCode, statusMessage, headers }
  13234. )
  13235. } else {
  13236. this.runInAsyncScope(callback, null, null, {
  13237. statusCode,
  13238. headers,
  13239. trailers: this.trailers,
  13240. opaque,
  13241. body,
  13242. context
  13243. })
  13244. }
  13245. }
  13246. }
  13247. onData (chunk) {
  13248. const { res } = this
  13249. return res.push(chunk)
  13250. }
  13251. onComplete (trailers) {
  13252. const { res } = this
  13253. removeSignal(this)
  13254. util.parseHeaders(trailers, this.trailers)
  13255. res.push(null)
  13256. }
  13257. onError (err) {
  13258. const { res, callback, body, opaque } = this
  13259. removeSignal(this)
  13260. if (callback) {
  13261. // TODO: Does this need queueMicrotask?
  13262. this.callback = null
  13263. queueMicrotask(() => {
  13264. this.runInAsyncScope(callback, null, err, { opaque })
  13265. })
  13266. }
  13267. if (res) {
  13268. this.res = null
  13269. // Ensure all queued handlers are invoked before destroying res.
  13270. queueMicrotask(() => {
  13271. util.destroy(res, err)
  13272. })
  13273. }
  13274. if (body) {
  13275. this.body = null
  13276. util.destroy(body, err)
  13277. }
  13278. }
  13279. }
  13280. function request (opts, callback) {
  13281. if (callback === undefined) {
  13282. return new Promise((resolve, reject) => {
  13283. request.call(this, opts, (err, data) => {
  13284. return err ? reject(err) : resolve(data)
  13285. })
  13286. })
  13287. }
  13288. try {
  13289. this.dispatch(opts, new RequestHandler(opts, callback))
  13290. } catch (err) {
  13291. if (typeof callback !== 'function') {
  13292. throw err
  13293. }
  13294. const opaque = opts && opts.opaque
  13295. queueMicrotask(() => callback(err, { opaque }))
  13296. }
  13297. }
  13298. module.exports = request
  13299. module.exports.RequestHandler = RequestHandler
  13300. /***/ }),
  13301. /***/ 5395:
  13302. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13303. "use strict";
  13304. const { finished, PassThrough } = __nccwpck_require__(2781)
  13305. const {
  13306. InvalidArgumentError,
  13307. InvalidReturnValueError,
  13308. RequestAbortedError
  13309. } = __nccwpck_require__(8045)
  13310. const util = __nccwpck_require__(3983)
  13311. const { getResolveErrorBodyCallback } = __nccwpck_require__(7474)
  13312. const { AsyncResource } = __nccwpck_require__(852)
  13313. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  13314. class StreamHandler extends AsyncResource {
  13315. constructor (opts, factory, callback) {
  13316. if (!opts || typeof opts !== 'object') {
  13317. throw new InvalidArgumentError('invalid opts')
  13318. }
  13319. const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError } = opts
  13320. try {
  13321. if (typeof callback !== 'function') {
  13322. throw new InvalidArgumentError('invalid callback')
  13323. }
  13324. if (typeof factory !== 'function') {
  13325. throw new InvalidArgumentError('invalid factory')
  13326. }
  13327. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  13328. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  13329. }
  13330. if (method === 'CONNECT') {
  13331. throw new InvalidArgumentError('invalid method')
  13332. }
  13333. if (onInfo && typeof onInfo !== 'function') {
  13334. throw new InvalidArgumentError('invalid onInfo callback')
  13335. }
  13336. super('UNDICI_STREAM')
  13337. } catch (err) {
  13338. if (util.isStream(body)) {
  13339. util.destroy(body.on('error', util.nop), err)
  13340. }
  13341. throw err
  13342. }
  13343. this.responseHeaders = responseHeaders || null
  13344. this.opaque = opaque || null
  13345. this.factory = factory
  13346. this.callback = callback
  13347. this.res = null
  13348. this.abort = null
  13349. this.context = null
  13350. this.trailers = null
  13351. this.body = body
  13352. this.onInfo = onInfo || null
  13353. this.throwOnError = throwOnError || false
  13354. if (util.isStream(body)) {
  13355. body.on('error', (err) => {
  13356. this.onError(err)
  13357. })
  13358. }
  13359. addSignal(this, signal)
  13360. }
  13361. onConnect (abort, context) {
  13362. if (!this.callback) {
  13363. throw new RequestAbortedError()
  13364. }
  13365. this.abort = abort
  13366. this.context = context
  13367. }
  13368. onHeaders (statusCode, rawHeaders, resume, statusMessage) {
  13369. const { factory, opaque, context, callback, responseHeaders } = this
  13370. const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13371. if (statusCode < 200) {
  13372. if (this.onInfo) {
  13373. this.onInfo({ statusCode, headers })
  13374. }
  13375. return
  13376. }
  13377. this.factory = null
  13378. let res
  13379. if (this.throwOnError && statusCode >= 400) {
  13380. const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers
  13381. const contentType = parsedHeaders['content-type']
  13382. res = new PassThrough()
  13383. this.callback = null
  13384. this.runInAsyncScope(getResolveErrorBodyCallback, null,
  13385. { callback, body: res, contentType, statusCode, statusMessage, headers }
  13386. )
  13387. } else {
  13388. if (factory === null) {
  13389. return
  13390. }
  13391. res = this.runInAsyncScope(factory, null, {
  13392. statusCode,
  13393. headers,
  13394. opaque,
  13395. context
  13396. })
  13397. if (
  13398. !res ||
  13399. typeof res.write !== 'function' ||
  13400. typeof res.end !== 'function' ||
  13401. typeof res.on !== 'function'
  13402. ) {
  13403. throw new InvalidReturnValueError('expected Writable')
  13404. }
  13405. // TODO: Avoid finished. It registers an unnecessary amount of listeners.
  13406. finished(res, { readable: false }, (err) => {
  13407. const { callback, res, opaque, trailers, abort } = this
  13408. this.res = null
  13409. if (err || !res.readable) {
  13410. util.destroy(res, err)
  13411. }
  13412. this.callback = null
  13413. this.runInAsyncScope(callback, null, err || null, { opaque, trailers })
  13414. if (err) {
  13415. abort()
  13416. }
  13417. })
  13418. }
  13419. res.on('drain', resume)
  13420. this.res = res
  13421. const needDrain = res.writableNeedDrain !== undefined
  13422. ? res.writableNeedDrain
  13423. : res._writableState && res._writableState.needDrain
  13424. return needDrain !== true
  13425. }
  13426. onData (chunk) {
  13427. const { res } = this
  13428. return res ? res.write(chunk) : true
  13429. }
  13430. onComplete (trailers) {
  13431. const { res } = this
  13432. removeSignal(this)
  13433. if (!res) {
  13434. return
  13435. }
  13436. this.trailers = util.parseHeaders(trailers)
  13437. res.end()
  13438. }
  13439. onError (err) {
  13440. const { res, callback, opaque, body } = this
  13441. removeSignal(this)
  13442. this.factory = null
  13443. if (res) {
  13444. this.res = null
  13445. util.destroy(res, err)
  13446. } else if (callback) {
  13447. this.callback = null
  13448. queueMicrotask(() => {
  13449. this.runInAsyncScope(callback, null, err, { opaque })
  13450. })
  13451. }
  13452. if (body) {
  13453. this.body = null
  13454. util.destroy(body, err)
  13455. }
  13456. }
  13457. }
  13458. function stream (opts, factory, callback) {
  13459. if (callback === undefined) {
  13460. return new Promise((resolve, reject) => {
  13461. stream.call(this, opts, factory, (err, data) => {
  13462. return err ? reject(err) : resolve(data)
  13463. })
  13464. })
  13465. }
  13466. try {
  13467. this.dispatch(opts, new StreamHandler(opts, factory, callback))
  13468. } catch (err) {
  13469. if (typeof callback !== 'function') {
  13470. throw err
  13471. }
  13472. const opaque = opts && opts.opaque
  13473. queueMicrotask(() => callback(err, { opaque }))
  13474. }
  13475. }
  13476. module.exports = stream
  13477. /***/ }),
  13478. /***/ 6923:
  13479. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13480. "use strict";
  13481. const { InvalidArgumentError, RequestAbortedError, SocketError } = __nccwpck_require__(8045)
  13482. const { AsyncResource } = __nccwpck_require__(852)
  13483. const util = __nccwpck_require__(3983)
  13484. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  13485. const assert = __nccwpck_require__(9491)
  13486. class UpgradeHandler extends AsyncResource {
  13487. constructor (opts, callback) {
  13488. if (!opts || typeof opts !== 'object') {
  13489. throw new InvalidArgumentError('invalid opts')
  13490. }
  13491. if (typeof callback !== 'function') {
  13492. throw new InvalidArgumentError('invalid callback')
  13493. }
  13494. const { signal, opaque, responseHeaders } = opts
  13495. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  13496. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  13497. }
  13498. super('UNDICI_UPGRADE')
  13499. this.responseHeaders = responseHeaders || null
  13500. this.opaque = opaque || null
  13501. this.callback = callback
  13502. this.abort = null
  13503. this.context = null
  13504. addSignal(this, signal)
  13505. }
  13506. onConnect (abort, context) {
  13507. if (!this.callback) {
  13508. throw new RequestAbortedError()
  13509. }
  13510. this.abort = abort
  13511. this.context = null
  13512. }
  13513. onHeaders () {
  13514. throw new SocketError('bad upgrade', null)
  13515. }
  13516. onUpgrade (statusCode, rawHeaders, socket) {
  13517. const { callback, opaque, context } = this
  13518. assert.strictEqual(statusCode, 101)
  13519. removeSignal(this)
  13520. this.callback = null
  13521. const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13522. this.runInAsyncScope(callback, null, null, {
  13523. headers,
  13524. socket,
  13525. opaque,
  13526. context
  13527. })
  13528. }
  13529. onError (err) {
  13530. const { callback, opaque } = this
  13531. removeSignal(this)
  13532. if (callback) {
  13533. this.callback = null
  13534. queueMicrotask(() => {
  13535. this.runInAsyncScope(callback, null, err, { opaque })
  13536. })
  13537. }
  13538. }
  13539. }
  13540. function upgrade (opts, callback) {
  13541. if (callback === undefined) {
  13542. return new Promise((resolve, reject) => {
  13543. upgrade.call(this, opts, (err, data) => {
  13544. return err ? reject(err) : resolve(data)
  13545. })
  13546. })
  13547. }
  13548. try {
  13549. const upgradeHandler = new UpgradeHandler(opts, callback)
  13550. this.dispatch({
  13551. ...opts,
  13552. method: opts.method || 'GET',
  13553. upgrade: opts.protocol || 'Websocket'
  13554. }, upgradeHandler)
  13555. } catch (err) {
  13556. if (typeof callback !== 'function') {
  13557. throw err
  13558. }
  13559. const opaque = opts && opts.opaque
  13560. queueMicrotask(() => callback(err, { opaque }))
  13561. }
  13562. }
  13563. module.exports = upgrade
  13564. /***/ }),
  13565. /***/ 4059:
  13566. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13567. "use strict";
  13568. module.exports.request = __nccwpck_require__(5448)
  13569. module.exports.stream = __nccwpck_require__(5395)
  13570. module.exports.pipeline = __nccwpck_require__(8752)
  13571. module.exports.upgrade = __nccwpck_require__(6923)
  13572. module.exports.connect = __nccwpck_require__(9744)
  13573. /***/ }),
  13574. /***/ 3858:
  13575. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13576. "use strict";
  13577. // Ported from https://github.com/nodejs/undici/pull/907
  13578. const assert = __nccwpck_require__(9491)
  13579. const { Readable } = __nccwpck_require__(2781)
  13580. const { RequestAbortedError, NotSupportedError, InvalidArgumentError } = __nccwpck_require__(8045)
  13581. const util = __nccwpck_require__(3983)
  13582. const { ReadableStreamFrom, toUSVString } = __nccwpck_require__(3983)
  13583. let Blob
  13584. const kConsume = Symbol('kConsume')
  13585. const kReading = Symbol('kReading')
  13586. const kBody = Symbol('kBody')
  13587. const kAbort = Symbol('abort')
  13588. const kContentType = Symbol('kContentType')
  13589. const noop = () => {}
  13590. module.exports = class BodyReadable extends Readable {
  13591. constructor ({
  13592. resume,
  13593. abort,
  13594. contentType = '',
  13595. highWaterMark = 64 * 1024 // Same as nodejs fs streams.
  13596. }) {
  13597. super({
  13598. autoDestroy: true,
  13599. read: resume,
  13600. highWaterMark
  13601. })
  13602. this._readableState.dataEmitted = false
  13603. this[kAbort] = abort
  13604. this[kConsume] = null
  13605. this[kBody] = null
  13606. this[kContentType] = contentType
  13607. // Is stream being consumed through Readable API?
  13608. // This is an optimization so that we avoid checking
  13609. // for 'data' and 'readable' listeners in the hot path
  13610. // inside push().
  13611. this[kReading] = false
  13612. }
  13613. destroy (err) {
  13614. if (this.destroyed) {
  13615. // Node < 16
  13616. return this
  13617. }
  13618. if (!err && !this._readableState.endEmitted) {
  13619. err = new RequestAbortedError()
  13620. }
  13621. if (err) {
  13622. this[kAbort]()
  13623. }
  13624. return super.destroy(err)
  13625. }
  13626. emit (ev, ...args) {
  13627. if (ev === 'data') {
  13628. // Node < 16.7
  13629. this._readableState.dataEmitted = true
  13630. } else if (ev === 'error') {
  13631. // Node < 16
  13632. this._readableState.errorEmitted = true
  13633. }
  13634. return super.emit(ev, ...args)
  13635. }
  13636. on (ev, ...args) {
  13637. if (ev === 'data' || ev === 'readable') {
  13638. this[kReading] = true
  13639. }
  13640. return super.on(ev, ...args)
  13641. }
  13642. addListener (ev, ...args) {
  13643. return this.on(ev, ...args)
  13644. }
  13645. off (ev, ...args) {
  13646. const ret = super.off(ev, ...args)
  13647. if (ev === 'data' || ev === 'readable') {
  13648. this[kReading] = (
  13649. this.listenerCount('data') > 0 ||
  13650. this.listenerCount('readable') > 0
  13651. )
  13652. }
  13653. return ret
  13654. }
  13655. removeListener (ev, ...args) {
  13656. return this.off(ev, ...args)
  13657. }
  13658. push (chunk) {
  13659. if (this[kConsume] && chunk !== null && this.readableLength === 0) {
  13660. consumePush(this[kConsume], chunk)
  13661. return this[kReading] ? super.push(chunk) : true
  13662. }
  13663. return super.push(chunk)
  13664. }
  13665. // https://fetch.spec.whatwg.org/#dom-body-text
  13666. async text () {
  13667. return consume(this, 'text')
  13668. }
  13669. // https://fetch.spec.whatwg.org/#dom-body-json
  13670. async json () {
  13671. return consume(this, 'json')
  13672. }
  13673. // https://fetch.spec.whatwg.org/#dom-body-blob
  13674. async blob () {
  13675. return consume(this, 'blob')
  13676. }
  13677. // https://fetch.spec.whatwg.org/#dom-body-arraybuffer
  13678. async arrayBuffer () {
  13679. return consume(this, 'arrayBuffer')
  13680. }
  13681. // https://fetch.spec.whatwg.org/#dom-body-formdata
  13682. async formData () {
  13683. // TODO: Implement.
  13684. throw new NotSupportedError()
  13685. }
  13686. // https://fetch.spec.whatwg.org/#dom-body-bodyused
  13687. get bodyUsed () {
  13688. return util.isDisturbed(this)
  13689. }
  13690. // https://fetch.spec.whatwg.org/#dom-body-body
  13691. get body () {
  13692. if (!this[kBody]) {
  13693. this[kBody] = ReadableStreamFrom(this)
  13694. if (this[kConsume]) {
  13695. // TODO: Is this the best way to force a lock?
  13696. this[kBody].getReader() // Ensure stream is locked.
  13697. assert(this[kBody].locked)
  13698. }
  13699. }
  13700. return this[kBody]
  13701. }
  13702. dump (opts) {
  13703. let limit = opts && Number.isFinite(opts.limit) ? opts.limit : 262144
  13704. const signal = opts && opts.signal
  13705. if (signal) {
  13706. try {
  13707. if (typeof signal !== 'object' || !('aborted' in signal)) {
  13708. throw new InvalidArgumentError('signal must be an AbortSignal')
  13709. }
  13710. util.throwIfAborted(signal)
  13711. } catch (err) {
  13712. return Promise.reject(err)
  13713. }
  13714. }
  13715. if (this.closed) {
  13716. return Promise.resolve(null)
  13717. }
  13718. return new Promise((resolve, reject) => {
  13719. const signalListenerCleanup = signal
  13720. ? util.addAbortListener(signal, () => {
  13721. this.destroy()
  13722. })
  13723. : noop
  13724. this
  13725. .on('close', function () {
  13726. signalListenerCleanup()
  13727. if (signal && signal.aborted) {
  13728. reject(signal.reason || Object.assign(new Error('The operation was aborted'), { name: 'AbortError' }))
  13729. } else {
  13730. resolve(null)
  13731. }
  13732. })
  13733. .on('error', noop)
  13734. .on('data', function (chunk) {
  13735. limit -= chunk.length
  13736. if (limit <= 0) {
  13737. this.destroy()
  13738. }
  13739. })
  13740. .resume()
  13741. })
  13742. }
  13743. }
  13744. // https://streams.spec.whatwg.org/#readablestream-locked
  13745. function isLocked (self) {
  13746. // Consume is an implicit lock.
  13747. return (self[kBody] && self[kBody].locked === true) || self[kConsume]
  13748. }
  13749. // https://fetch.spec.whatwg.org/#body-unusable
  13750. function isUnusable (self) {
  13751. return util.isDisturbed(self) || isLocked(self)
  13752. }
  13753. async function consume (stream, type) {
  13754. if (isUnusable(stream)) {
  13755. throw new TypeError('unusable')
  13756. }
  13757. assert(!stream[kConsume])
  13758. return new Promise((resolve, reject) => {
  13759. stream[kConsume] = {
  13760. type,
  13761. stream,
  13762. resolve,
  13763. reject,
  13764. length: 0,
  13765. body: []
  13766. }
  13767. stream
  13768. .on('error', function (err) {
  13769. consumeFinish(this[kConsume], err)
  13770. })
  13771. .on('close', function () {
  13772. if (this[kConsume].body !== null) {
  13773. consumeFinish(this[kConsume], new RequestAbortedError())
  13774. }
  13775. })
  13776. process.nextTick(consumeStart, stream[kConsume])
  13777. })
  13778. }
  13779. function consumeStart (consume) {
  13780. if (consume.body === null) {
  13781. return
  13782. }
  13783. const { _readableState: state } = consume.stream
  13784. for (const chunk of state.buffer) {
  13785. consumePush(consume, chunk)
  13786. }
  13787. if (state.endEmitted) {
  13788. consumeEnd(this[kConsume])
  13789. } else {
  13790. consume.stream.on('end', function () {
  13791. consumeEnd(this[kConsume])
  13792. })
  13793. }
  13794. consume.stream.resume()
  13795. while (consume.stream.read() != null) {
  13796. // Loop
  13797. }
  13798. }
  13799. function consumeEnd (consume) {
  13800. const { type, body, resolve, stream, length } = consume
  13801. try {
  13802. if (type === 'text') {
  13803. resolve(toUSVString(Buffer.concat(body)))
  13804. } else if (type === 'json') {
  13805. resolve(JSON.parse(Buffer.concat(body)))
  13806. } else if (type === 'arrayBuffer') {
  13807. const dst = new Uint8Array(length)
  13808. let pos = 0
  13809. for (const buf of body) {
  13810. dst.set(buf, pos)
  13811. pos += buf.byteLength
  13812. }
  13813. resolve(dst.buffer)
  13814. } else if (type === 'blob') {
  13815. if (!Blob) {
  13816. Blob = (__nccwpck_require__(4300).Blob)
  13817. }
  13818. resolve(new Blob(body, { type: stream[kContentType] }))
  13819. }
  13820. consumeFinish(consume)
  13821. } catch (err) {
  13822. stream.destroy(err)
  13823. }
  13824. }
  13825. function consumePush (consume, chunk) {
  13826. consume.length += chunk.length
  13827. consume.body.push(chunk)
  13828. }
  13829. function consumeFinish (consume, err) {
  13830. if (consume.body === null) {
  13831. return
  13832. }
  13833. if (err) {
  13834. consume.reject(err)
  13835. } else {
  13836. consume.resolve()
  13837. }
  13838. consume.type = null
  13839. consume.stream = null
  13840. consume.resolve = null
  13841. consume.reject = null
  13842. consume.length = 0
  13843. consume.body = null
  13844. }
  13845. /***/ }),
  13846. /***/ 7474:
  13847. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13848. const assert = __nccwpck_require__(9491)
  13849. const {
  13850. ResponseStatusCodeError
  13851. } = __nccwpck_require__(8045)
  13852. const { toUSVString } = __nccwpck_require__(3983)
  13853. async function getResolveErrorBodyCallback ({ callback, body, contentType, statusCode, statusMessage, headers }) {
  13854. assert(body)
  13855. let chunks = []
  13856. let limit = 0
  13857. for await (const chunk of body) {
  13858. chunks.push(chunk)
  13859. limit += chunk.length
  13860. if (limit > 128 * 1024) {
  13861. chunks = null
  13862. break
  13863. }
  13864. }
  13865. if (statusCode === 204 || !contentType || !chunks) {
  13866. process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers))
  13867. return
  13868. }
  13869. try {
  13870. if (contentType.startsWith('application/json')) {
  13871. const payload = JSON.parse(toUSVString(Buffer.concat(chunks)))
  13872. process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers, payload))
  13873. return
  13874. }
  13875. if (contentType.startsWith('text/')) {
  13876. const payload = toUSVString(Buffer.concat(chunks))
  13877. process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers, payload))
  13878. return
  13879. }
  13880. } catch (err) {
  13881. // Process in a fallback if error
  13882. }
  13883. process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers))
  13884. }
  13885. module.exports = { getResolveErrorBodyCallback }
  13886. /***/ }),
  13887. /***/ 7931:
  13888. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13889. "use strict";
  13890. const {
  13891. BalancedPoolMissingUpstreamError,
  13892. InvalidArgumentError
  13893. } = __nccwpck_require__(8045)
  13894. const {
  13895. PoolBase,
  13896. kClients,
  13897. kNeedDrain,
  13898. kAddClient,
  13899. kRemoveClient,
  13900. kGetDispatcher
  13901. } = __nccwpck_require__(3198)
  13902. const Pool = __nccwpck_require__(4634)
  13903. const { kUrl, kInterceptors } = __nccwpck_require__(2785)
  13904. const { parseOrigin } = __nccwpck_require__(3983)
  13905. const kFactory = Symbol('factory')
  13906. const kOptions = Symbol('options')
  13907. const kGreatestCommonDivisor = Symbol('kGreatestCommonDivisor')
  13908. const kCurrentWeight = Symbol('kCurrentWeight')
  13909. const kIndex = Symbol('kIndex')
  13910. const kWeight = Symbol('kWeight')
  13911. const kMaxWeightPerServer = Symbol('kMaxWeightPerServer')
  13912. const kErrorPenalty = Symbol('kErrorPenalty')
  13913. function getGreatestCommonDivisor (a, b) {
  13914. if (b === 0) return a
  13915. return getGreatestCommonDivisor(b, a % b)
  13916. }
  13917. function defaultFactory (origin, opts) {
  13918. return new Pool(origin, opts)
  13919. }
  13920. class BalancedPool extends PoolBase {
  13921. constructor (upstreams = [], { factory = defaultFactory, ...opts } = {}) {
  13922. super()
  13923. this[kOptions] = opts
  13924. this[kIndex] = -1
  13925. this[kCurrentWeight] = 0
  13926. this[kMaxWeightPerServer] = this[kOptions].maxWeightPerServer || 100
  13927. this[kErrorPenalty] = this[kOptions].errorPenalty || 15
  13928. if (!Array.isArray(upstreams)) {
  13929. upstreams = [upstreams]
  13930. }
  13931. if (typeof factory !== 'function') {
  13932. throw new InvalidArgumentError('factory must be a function.')
  13933. }
  13934. this[kInterceptors] = opts.interceptors && opts.interceptors.BalancedPool && Array.isArray(opts.interceptors.BalancedPool)
  13935. ? opts.interceptors.BalancedPool
  13936. : []
  13937. this[kFactory] = factory
  13938. for (const upstream of upstreams) {
  13939. this.addUpstream(upstream)
  13940. }
  13941. this._updateBalancedPoolStats()
  13942. }
  13943. addUpstream (upstream) {
  13944. const upstreamOrigin = parseOrigin(upstream).origin
  13945. if (this[kClients].find((pool) => (
  13946. pool[kUrl].origin === upstreamOrigin &&
  13947. pool.closed !== true &&
  13948. pool.destroyed !== true
  13949. ))) {
  13950. return this
  13951. }
  13952. const pool = this[kFactory](upstreamOrigin, Object.assign({}, this[kOptions]))
  13953. this[kAddClient](pool)
  13954. pool.on('connect', () => {
  13955. pool[kWeight] = Math.min(this[kMaxWeightPerServer], pool[kWeight] + this[kErrorPenalty])
  13956. })
  13957. pool.on('connectionError', () => {
  13958. pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty])
  13959. this._updateBalancedPoolStats()
  13960. })
  13961. pool.on('disconnect', (...args) => {
  13962. const err = args[2]
  13963. if (err && err.code === 'UND_ERR_SOCKET') {
  13964. // decrease the weight of the pool.
  13965. pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty])
  13966. this._updateBalancedPoolStats()
  13967. }
  13968. })
  13969. for (const client of this[kClients]) {
  13970. client[kWeight] = this[kMaxWeightPerServer]
  13971. }
  13972. this._updateBalancedPoolStats()
  13973. return this
  13974. }
  13975. _updateBalancedPoolStats () {
  13976. this[kGreatestCommonDivisor] = this[kClients].map(p => p[kWeight]).reduce(getGreatestCommonDivisor, 0)
  13977. }
  13978. removeUpstream (upstream) {
  13979. const upstreamOrigin = parseOrigin(upstream).origin
  13980. const pool = this[kClients].find((pool) => (
  13981. pool[kUrl].origin === upstreamOrigin &&
  13982. pool.closed !== true &&
  13983. pool.destroyed !== true
  13984. ))
  13985. if (pool) {
  13986. this[kRemoveClient](pool)
  13987. }
  13988. return this
  13989. }
  13990. get upstreams () {
  13991. return this[kClients]
  13992. .filter(dispatcher => dispatcher.closed !== true && dispatcher.destroyed !== true)
  13993. .map((p) => p[kUrl].origin)
  13994. }
  13995. [kGetDispatcher] () {
  13996. // We validate that pools is greater than 0,
  13997. // otherwise we would have to wait until an upstream
  13998. // is added, which might never happen.
  13999. if (this[kClients].length === 0) {
  14000. throw new BalancedPoolMissingUpstreamError()
  14001. }
  14002. const dispatcher = this[kClients].find(dispatcher => (
  14003. !dispatcher[kNeedDrain] &&
  14004. dispatcher.closed !== true &&
  14005. dispatcher.destroyed !== true
  14006. ))
  14007. if (!dispatcher) {
  14008. return
  14009. }
  14010. const allClientsBusy = this[kClients].map(pool => pool[kNeedDrain]).reduce((a, b) => a && b, true)
  14011. if (allClientsBusy) {
  14012. return
  14013. }
  14014. let counter = 0
  14015. let maxWeightIndex = this[kClients].findIndex(pool => !pool[kNeedDrain])
  14016. while (counter++ < this[kClients].length) {
  14017. this[kIndex] = (this[kIndex] + 1) % this[kClients].length
  14018. const pool = this[kClients][this[kIndex]]
  14019. // find pool index with the largest weight
  14020. if (pool[kWeight] > this[kClients][maxWeightIndex][kWeight] && !pool[kNeedDrain]) {
  14021. maxWeightIndex = this[kIndex]
  14022. }
  14023. // decrease the current weight every `this[kClients].length`.
  14024. if (this[kIndex] === 0) {
  14025. // Set the current weight to the next lower weight.
  14026. this[kCurrentWeight] = this[kCurrentWeight] - this[kGreatestCommonDivisor]
  14027. if (this[kCurrentWeight] <= 0) {
  14028. this[kCurrentWeight] = this[kMaxWeightPerServer]
  14029. }
  14030. }
  14031. if (pool[kWeight] >= this[kCurrentWeight] && (!pool[kNeedDrain])) {
  14032. return pool
  14033. }
  14034. }
  14035. this[kCurrentWeight] = this[kClients][maxWeightIndex][kWeight]
  14036. this[kIndex] = maxWeightIndex
  14037. return this[kClients][maxWeightIndex]
  14038. }
  14039. }
  14040. module.exports = BalancedPool
  14041. /***/ }),
  14042. /***/ 6101:
  14043. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  14044. "use strict";
  14045. const { kConstruct } = __nccwpck_require__(9174)
  14046. const { urlEquals, fieldValues: getFieldValues } = __nccwpck_require__(2396)
  14047. const { kEnumerableProperty, isDisturbed } = __nccwpck_require__(3983)
  14048. const { kHeadersList } = __nccwpck_require__(2785)
  14049. const { webidl } = __nccwpck_require__(1744)
  14050. const { Response, cloneResponse } = __nccwpck_require__(7823)
  14051. const { Request } = __nccwpck_require__(8359)
  14052. const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(5861)
  14053. const { fetching } = __nccwpck_require__(4881)
  14054. const { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = __nccwpck_require__(2538)
  14055. const assert = __nccwpck_require__(9491)
  14056. const { getGlobalDispatcher } = __nccwpck_require__(1892)
  14057. /**
  14058. * @see https://w3c.github.io/ServiceWorker/#dfn-cache-batch-operation
  14059. * @typedef {Object} CacheBatchOperation
  14060. * @property {'delete' | 'put'} type
  14061. * @property {any} request
  14062. * @property {any} response
  14063. * @property {import('../../types/cache').CacheQueryOptions} options
  14064. */
  14065. /**
  14066. * @see https://w3c.github.io/ServiceWorker/#dfn-request-response-list
  14067. * @typedef {[any, any][]} requestResponseList
  14068. */
  14069. class Cache {
  14070. /**
  14071. * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-request-response-list
  14072. * @type {requestResponseList}
  14073. */
  14074. #relevantRequestResponseList
  14075. constructor () {
  14076. if (arguments[0] !== kConstruct) {
  14077. webidl.illegalConstructor()
  14078. }
  14079. this.#relevantRequestResponseList = arguments[1]
  14080. }
  14081. async match (request, options = {}) {
  14082. webidl.brandCheck(this, Cache)
  14083. webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.match' })
  14084. request = webidl.converters.RequestInfo(request)
  14085. options = webidl.converters.CacheQueryOptions(options)
  14086. const p = await this.matchAll(request, options)
  14087. if (p.length === 0) {
  14088. return
  14089. }
  14090. return p[0]
  14091. }
  14092. async matchAll (request = undefined, options = {}) {
  14093. webidl.brandCheck(this, Cache)
  14094. if (request !== undefined) request = webidl.converters.RequestInfo(request)
  14095. options = webidl.converters.CacheQueryOptions(options)
  14096. // 1.
  14097. let r = null
  14098. // 2.
  14099. if (request !== undefined) {
  14100. if (request instanceof Request) {
  14101. // 2.1.1
  14102. r = request[kState]
  14103. // 2.1.2
  14104. if (r.method !== 'GET' && !options.ignoreMethod) {
  14105. return []
  14106. }
  14107. } else if (typeof request === 'string') {
  14108. // 2.2.1
  14109. r = new Request(request)[kState]
  14110. }
  14111. }
  14112. // 5.
  14113. // 5.1
  14114. const responses = []
  14115. // 5.2
  14116. if (request === undefined) {
  14117. // 5.2.1
  14118. for (const requestResponse of this.#relevantRequestResponseList) {
  14119. responses.push(requestResponse[1])
  14120. }
  14121. } else { // 5.3
  14122. // 5.3.1
  14123. const requestResponses = this.#queryCache(r, options)
  14124. // 5.3.2
  14125. for (const requestResponse of requestResponses) {
  14126. responses.push(requestResponse[1])
  14127. }
  14128. }
  14129. // 5.4
  14130. // We don't implement CORs so we don't need to loop over the responses, yay!
  14131. // 5.5.1
  14132. const responseList = []
  14133. // 5.5.2
  14134. for (const response of responses) {
  14135. // 5.5.2.1
  14136. const responseObject = new Response(response.body?.source ?? null)
  14137. const body = responseObject[kState].body
  14138. responseObject[kState] = response
  14139. responseObject[kState].body = body
  14140. responseObject[kHeaders][kHeadersList] = response.headersList
  14141. responseObject[kHeaders][kGuard] = 'immutable'
  14142. responseList.push(responseObject)
  14143. }
  14144. // 6.
  14145. return Object.freeze(responseList)
  14146. }
  14147. async add (request) {
  14148. webidl.brandCheck(this, Cache)
  14149. webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.add' })
  14150. request = webidl.converters.RequestInfo(request)
  14151. // 1.
  14152. const requests = [request]
  14153. // 2.
  14154. const responseArrayPromise = this.addAll(requests)
  14155. // 3.
  14156. return await responseArrayPromise
  14157. }
  14158. async addAll (requests) {
  14159. webidl.brandCheck(this, Cache)
  14160. webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.addAll' })
  14161. requests = webidl.converters['sequence<RequestInfo>'](requests)
  14162. // 1.
  14163. const responsePromises = []
  14164. // 2.
  14165. const requestList = []
  14166. // 3.
  14167. for (const request of requests) {
  14168. if (typeof request === 'string') {
  14169. continue
  14170. }
  14171. // 3.1
  14172. const r = request[kState]
  14173. // 3.2
  14174. if (!urlIsHttpHttpsScheme(r.url) || r.method !== 'GET') {
  14175. throw webidl.errors.exception({
  14176. header: 'Cache.addAll',
  14177. message: 'Expected http/s scheme when method is not GET.'
  14178. })
  14179. }
  14180. }
  14181. // 4.
  14182. /** @type {ReturnType<typeof fetching>[]} */
  14183. const fetchControllers = []
  14184. // 5.
  14185. for (const request of requests) {
  14186. // 5.1
  14187. const r = new Request(request)[kState]
  14188. // 5.2
  14189. if (!urlIsHttpHttpsScheme(r.url)) {
  14190. throw webidl.errors.exception({
  14191. header: 'Cache.addAll',
  14192. message: 'Expected http/s scheme.'
  14193. })
  14194. }
  14195. // 5.4
  14196. r.initiator = 'fetch'
  14197. r.destination = 'subresource'
  14198. // 5.5
  14199. requestList.push(r)
  14200. // 5.6
  14201. const responsePromise = createDeferredPromise()
  14202. // 5.7
  14203. fetchControllers.push(fetching({
  14204. request: r,
  14205. dispatcher: getGlobalDispatcher(),
  14206. processResponse (response) {
  14207. // 1.
  14208. if (response.type === 'error' || response.status === 206 || response.status < 200 || response.status > 299) {
  14209. responsePromise.reject(webidl.errors.exception({
  14210. header: 'Cache.addAll',
  14211. message: 'Received an invalid status code or the request failed.'
  14212. }))
  14213. } else if (response.headersList.contains('vary')) { // 2.
  14214. // 2.1
  14215. const fieldValues = getFieldValues(response.headersList.get('vary'))
  14216. // 2.2
  14217. for (const fieldValue of fieldValues) {
  14218. // 2.2.1
  14219. if (fieldValue === '*') {
  14220. responsePromise.reject(webidl.errors.exception({
  14221. header: 'Cache.addAll',
  14222. message: 'invalid vary field value'
  14223. }))
  14224. for (const controller of fetchControllers) {
  14225. controller.abort()
  14226. }
  14227. return
  14228. }
  14229. }
  14230. }
  14231. },
  14232. processResponseEndOfBody (response) {
  14233. // 1.
  14234. if (response.aborted) {
  14235. responsePromise.reject(new DOMException('aborted', 'AbortError'))
  14236. return
  14237. }
  14238. // 2.
  14239. responsePromise.resolve(response)
  14240. }
  14241. }))
  14242. // 5.8
  14243. responsePromises.push(responsePromise.promise)
  14244. }
  14245. // 6.
  14246. const p = Promise.all(responsePromises)
  14247. // 7.
  14248. const responses = await p
  14249. // 7.1
  14250. const operations = []
  14251. // 7.2
  14252. let index = 0
  14253. // 7.3
  14254. for (const response of responses) {
  14255. // 7.3.1
  14256. /** @type {CacheBatchOperation} */
  14257. const operation = {
  14258. type: 'put', // 7.3.2
  14259. request: requestList[index], // 7.3.3
  14260. response // 7.3.4
  14261. }
  14262. operations.push(operation) // 7.3.5
  14263. index++ // 7.3.6
  14264. }
  14265. // 7.5
  14266. const cacheJobPromise = createDeferredPromise()
  14267. // 7.6.1
  14268. let errorData = null
  14269. // 7.6.2
  14270. try {
  14271. this.#batchCacheOperations(operations)
  14272. } catch (e) {
  14273. errorData = e
  14274. }
  14275. // 7.6.3
  14276. queueMicrotask(() => {
  14277. // 7.6.3.1
  14278. if (errorData === null) {
  14279. cacheJobPromise.resolve(undefined)
  14280. } else {
  14281. // 7.6.3.2
  14282. cacheJobPromise.reject(errorData)
  14283. }
  14284. })
  14285. // 7.7
  14286. return cacheJobPromise.promise
  14287. }
  14288. async put (request, response) {
  14289. webidl.brandCheck(this, Cache)
  14290. webidl.argumentLengthCheck(arguments, 2, { header: 'Cache.put' })
  14291. request = webidl.converters.RequestInfo(request)
  14292. response = webidl.converters.Response(response)
  14293. // 1.
  14294. let innerRequest = null
  14295. // 2.
  14296. if (request instanceof Request) {
  14297. innerRequest = request[kState]
  14298. } else { // 3.
  14299. innerRequest = new Request(request)[kState]
  14300. }
  14301. // 4.
  14302. if (!urlIsHttpHttpsScheme(innerRequest.url) || innerRequest.method !== 'GET') {
  14303. throw webidl.errors.exception({
  14304. header: 'Cache.put',
  14305. message: 'Expected an http/s scheme when method is not GET'
  14306. })
  14307. }
  14308. // 5.
  14309. const innerResponse = response[kState]
  14310. // 6.
  14311. if (innerResponse.status === 206) {
  14312. throw webidl.errors.exception({
  14313. header: 'Cache.put',
  14314. message: 'Got 206 status'
  14315. })
  14316. }
  14317. // 7.
  14318. if (innerResponse.headersList.contains('vary')) {
  14319. // 7.1.
  14320. const fieldValues = getFieldValues(innerResponse.headersList.get('vary'))
  14321. // 7.2.
  14322. for (const fieldValue of fieldValues) {
  14323. // 7.2.1
  14324. if (fieldValue === '*') {
  14325. throw webidl.errors.exception({
  14326. header: 'Cache.put',
  14327. message: 'Got * vary field value'
  14328. })
  14329. }
  14330. }
  14331. }
  14332. // 8.
  14333. if (innerResponse.body && (isDisturbed(innerResponse.body.stream) || innerResponse.body.stream.locked)) {
  14334. throw webidl.errors.exception({
  14335. header: 'Cache.put',
  14336. message: 'Response body is locked or disturbed'
  14337. })
  14338. }
  14339. // 9.
  14340. const clonedResponse = cloneResponse(innerResponse)
  14341. // 10.
  14342. const bodyReadPromise = createDeferredPromise()
  14343. // 11.
  14344. if (innerResponse.body != null) {
  14345. // 11.1
  14346. const stream = innerResponse.body.stream
  14347. // 11.2
  14348. const reader = stream.getReader()
  14349. // 11.3
  14350. readAllBytes(reader).then(bodyReadPromise.resolve, bodyReadPromise.reject)
  14351. } else {
  14352. bodyReadPromise.resolve(undefined)
  14353. }
  14354. // 12.
  14355. /** @type {CacheBatchOperation[]} */
  14356. const operations = []
  14357. // 13.
  14358. /** @type {CacheBatchOperation} */
  14359. const operation = {
  14360. type: 'put', // 14.
  14361. request: innerRequest, // 15.
  14362. response: clonedResponse // 16.
  14363. }
  14364. // 17.
  14365. operations.push(operation)
  14366. // 19.
  14367. const bytes = await bodyReadPromise.promise
  14368. if (clonedResponse.body != null) {
  14369. clonedResponse.body.source = bytes
  14370. }
  14371. // 19.1
  14372. const cacheJobPromise = createDeferredPromise()
  14373. // 19.2.1
  14374. let errorData = null
  14375. // 19.2.2
  14376. try {
  14377. this.#batchCacheOperations(operations)
  14378. } catch (e) {
  14379. errorData = e
  14380. }
  14381. // 19.2.3
  14382. queueMicrotask(() => {
  14383. // 19.2.3.1
  14384. if (errorData === null) {
  14385. cacheJobPromise.resolve()
  14386. } else { // 19.2.3.2
  14387. cacheJobPromise.reject(errorData)
  14388. }
  14389. })
  14390. return cacheJobPromise.promise
  14391. }
  14392. async delete (request, options = {}) {
  14393. webidl.brandCheck(this, Cache)
  14394. webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.delete' })
  14395. request = webidl.converters.RequestInfo(request)
  14396. options = webidl.converters.CacheQueryOptions(options)
  14397. /**
  14398. * @type {Request}
  14399. */
  14400. let r = null
  14401. if (request instanceof Request) {
  14402. r = request[kState]
  14403. if (r.method !== 'GET' && !options.ignoreMethod) {
  14404. return false
  14405. }
  14406. } else {
  14407. assert(typeof request === 'string')
  14408. r = new Request(request)[kState]
  14409. }
  14410. /** @type {CacheBatchOperation[]} */
  14411. const operations = []
  14412. /** @type {CacheBatchOperation} */
  14413. const operation = {
  14414. type: 'delete',
  14415. request: r,
  14416. options
  14417. }
  14418. operations.push(operation)
  14419. const cacheJobPromise = createDeferredPromise()
  14420. let errorData = null
  14421. let requestResponses
  14422. try {
  14423. requestResponses = this.#batchCacheOperations(operations)
  14424. } catch (e) {
  14425. errorData = e
  14426. }
  14427. queueMicrotask(() => {
  14428. if (errorData === null) {
  14429. cacheJobPromise.resolve(!!requestResponses?.length)
  14430. } else {
  14431. cacheJobPromise.reject(errorData)
  14432. }
  14433. })
  14434. return cacheJobPromise.promise
  14435. }
  14436. /**
  14437. * @see https://w3c.github.io/ServiceWorker/#dom-cache-keys
  14438. * @param {any} request
  14439. * @param {import('../../types/cache').CacheQueryOptions} options
  14440. * @returns {readonly Request[]}
  14441. */
  14442. async keys (request = undefined, options = {}) {
  14443. webidl.brandCheck(this, Cache)
  14444. if (request !== undefined) request = webidl.converters.RequestInfo(request)
  14445. options = webidl.converters.CacheQueryOptions(options)
  14446. // 1.
  14447. let r = null
  14448. // 2.
  14449. if (request !== undefined) {
  14450. // 2.1
  14451. if (request instanceof Request) {
  14452. // 2.1.1
  14453. r = request[kState]
  14454. // 2.1.2
  14455. if (r.method !== 'GET' && !options.ignoreMethod) {
  14456. return []
  14457. }
  14458. } else if (typeof request === 'string') { // 2.2
  14459. r = new Request(request)[kState]
  14460. }
  14461. }
  14462. // 4.
  14463. const promise = createDeferredPromise()
  14464. // 5.
  14465. // 5.1
  14466. const requests = []
  14467. // 5.2
  14468. if (request === undefined) {
  14469. // 5.2.1
  14470. for (const requestResponse of this.#relevantRequestResponseList) {
  14471. // 5.2.1.1
  14472. requests.push(requestResponse[0])
  14473. }
  14474. } else { // 5.3
  14475. // 5.3.1
  14476. const requestResponses = this.#queryCache(r, options)
  14477. // 5.3.2
  14478. for (const requestResponse of requestResponses) {
  14479. // 5.3.2.1
  14480. requests.push(requestResponse[0])
  14481. }
  14482. }
  14483. // 5.4
  14484. queueMicrotask(() => {
  14485. // 5.4.1
  14486. const requestList = []
  14487. // 5.4.2
  14488. for (const request of requests) {
  14489. const requestObject = new Request('https://a')
  14490. requestObject[kState] = request
  14491. requestObject[kHeaders][kHeadersList] = request.headersList
  14492. requestObject[kHeaders][kGuard] = 'immutable'
  14493. requestObject[kRealm] = request.client
  14494. // 5.4.2.1
  14495. requestList.push(requestObject)
  14496. }
  14497. // 5.4.3
  14498. promise.resolve(Object.freeze(requestList))
  14499. })
  14500. return promise.promise
  14501. }
  14502. /**
  14503. * @see https://w3c.github.io/ServiceWorker/#batch-cache-operations-algorithm
  14504. * @param {CacheBatchOperation[]} operations
  14505. * @returns {requestResponseList}
  14506. */
  14507. #batchCacheOperations (operations) {
  14508. // 1.
  14509. const cache = this.#relevantRequestResponseList
  14510. // 2.
  14511. const backupCache = [...cache]
  14512. // 3.
  14513. const addedItems = []
  14514. // 4.1
  14515. const resultList = []
  14516. try {
  14517. // 4.2
  14518. for (const operation of operations) {
  14519. // 4.2.1
  14520. if (operation.type !== 'delete' && operation.type !== 'put') {
  14521. throw webidl.errors.exception({
  14522. header: 'Cache.#batchCacheOperations',
  14523. message: 'operation type does not match "delete" or "put"'
  14524. })
  14525. }
  14526. // 4.2.2
  14527. if (operation.type === 'delete' && operation.response != null) {
  14528. throw webidl.errors.exception({
  14529. header: 'Cache.#batchCacheOperations',
  14530. message: 'delete operation should not have an associated response'
  14531. })
  14532. }
  14533. // 4.2.3
  14534. if (this.#queryCache(operation.request, operation.options, addedItems).length) {
  14535. throw new DOMException('???', 'InvalidStateError')
  14536. }
  14537. // 4.2.4
  14538. let requestResponses
  14539. // 4.2.5
  14540. if (operation.type === 'delete') {
  14541. // 4.2.5.1
  14542. requestResponses = this.#queryCache(operation.request, operation.options)
  14543. // TODO: the spec is wrong, this is needed to pass WPTs
  14544. if (requestResponses.length === 0) {
  14545. return []
  14546. }
  14547. // 4.2.5.2
  14548. for (const requestResponse of requestResponses) {
  14549. const idx = cache.indexOf(requestResponse)
  14550. assert(idx !== -1)
  14551. // 4.2.5.2.1
  14552. cache.splice(idx, 1)
  14553. }
  14554. } else if (operation.type === 'put') { // 4.2.6
  14555. // 4.2.6.1
  14556. if (operation.response == null) {
  14557. throw webidl.errors.exception({
  14558. header: 'Cache.#batchCacheOperations',
  14559. message: 'put operation should have an associated response'
  14560. })
  14561. }
  14562. // 4.2.6.2
  14563. const r = operation.request
  14564. // 4.2.6.3
  14565. if (!urlIsHttpHttpsScheme(r.url)) {
  14566. throw webidl.errors.exception({
  14567. header: 'Cache.#batchCacheOperations',
  14568. message: 'expected http or https scheme'
  14569. })
  14570. }
  14571. // 4.2.6.4
  14572. if (r.method !== 'GET') {
  14573. throw webidl.errors.exception({
  14574. header: 'Cache.#batchCacheOperations',
  14575. message: 'not get method'
  14576. })
  14577. }
  14578. // 4.2.6.5
  14579. if (operation.options != null) {
  14580. throw webidl.errors.exception({
  14581. header: 'Cache.#batchCacheOperations',
  14582. message: 'options must not be defined'
  14583. })
  14584. }
  14585. // 4.2.6.6
  14586. requestResponses = this.#queryCache(operation.request)
  14587. // 4.2.6.7
  14588. for (const requestResponse of requestResponses) {
  14589. const idx = cache.indexOf(requestResponse)
  14590. assert(idx !== -1)
  14591. // 4.2.6.7.1
  14592. cache.splice(idx, 1)
  14593. }
  14594. // 4.2.6.8
  14595. cache.push([operation.request, operation.response])
  14596. // 4.2.6.10
  14597. addedItems.push([operation.request, operation.response])
  14598. }
  14599. // 4.2.7
  14600. resultList.push([operation.request, operation.response])
  14601. }
  14602. // 4.3
  14603. return resultList
  14604. } catch (e) { // 5.
  14605. // 5.1
  14606. this.#relevantRequestResponseList.length = 0
  14607. // 5.2
  14608. this.#relevantRequestResponseList = backupCache
  14609. // 5.3
  14610. throw e
  14611. }
  14612. }
  14613. /**
  14614. * @see https://w3c.github.io/ServiceWorker/#query-cache
  14615. * @param {any} requestQuery
  14616. * @param {import('../../types/cache').CacheQueryOptions} options
  14617. * @param {requestResponseList} targetStorage
  14618. * @returns {requestResponseList}
  14619. */
  14620. #queryCache (requestQuery, options, targetStorage) {
  14621. /** @type {requestResponseList} */
  14622. const resultList = []
  14623. const storage = targetStorage ?? this.#relevantRequestResponseList
  14624. for (const requestResponse of storage) {
  14625. const [cachedRequest, cachedResponse] = requestResponse
  14626. if (this.#requestMatchesCachedItem(requestQuery, cachedRequest, cachedResponse, options)) {
  14627. resultList.push(requestResponse)
  14628. }
  14629. }
  14630. return resultList
  14631. }
  14632. /**
  14633. * @see https://w3c.github.io/ServiceWorker/#request-matches-cached-item-algorithm
  14634. * @param {any} requestQuery
  14635. * @param {any} request
  14636. * @param {any | null} response
  14637. * @param {import('../../types/cache').CacheQueryOptions | undefined} options
  14638. * @returns {boolean}
  14639. */
  14640. #requestMatchesCachedItem (requestQuery, request, response = null, options) {
  14641. // if (options?.ignoreMethod === false && request.method === 'GET') {
  14642. // return false
  14643. // }
  14644. const queryURL = new URL(requestQuery.url)
  14645. const cachedURL = new URL(request.url)
  14646. if (options?.ignoreSearch) {
  14647. cachedURL.search = ''
  14648. queryURL.search = ''
  14649. }
  14650. if (!urlEquals(queryURL, cachedURL, true)) {
  14651. return false
  14652. }
  14653. if (
  14654. response == null ||
  14655. options?.ignoreVary ||
  14656. !response.headersList.contains('vary')
  14657. ) {
  14658. return true
  14659. }
  14660. const fieldValues = getFieldValues(response.headersList.get('vary'))
  14661. for (const fieldValue of fieldValues) {
  14662. if (fieldValue === '*') {
  14663. return false
  14664. }
  14665. const requestValue = request.headersList.get(fieldValue)
  14666. const queryValue = requestQuery.headersList.get(fieldValue)
  14667. // If one has the header and the other doesn't, or one has
  14668. // a different value than the other, return false
  14669. if (requestValue !== queryValue) {
  14670. return false
  14671. }
  14672. }
  14673. return true
  14674. }
  14675. }
  14676. Object.defineProperties(Cache.prototype, {
  14677. [Symbol.toStringTag]: {
  14678. value: 'Cache',
  14679. configurable: true
  14680. },
  14681. match: kEnumerableProperty,
  14682. matchAll: kEnumerableProperty,
  14683. add: kEnumerableProperty,
  14684. addAll: kEnumerableProperty,
  14685. put: kEnumerableProperty,
  14686. delete: kEnumerableProperty,
  14687. keys: kEnumerableProperty
  14688. })
  14689. const cacheQueryOptionConverters = [
  14690. {
  14691. key: 'ignoreSearch',
  14692. converter: webidl.converters.boolean,
  14693. defaultValue: false
  14694. },
  14695. {
  14696. key: 'ignoreMethod',
  14697. converter: webidl.converters.boolean,
  14698. defaultValue: false
  14699. },
  14700. {
  14701. key: 'ignoreVary',
  14702. converter: webidl.converters.boolean,
  14703. defaultValue: false
  14704. }
  14705. ]
  14706. webidl.converters.CacheQueryOptions = webidl.dictionaryConverter(cacheQueryOptionConverters)
  14707. webidl.converters.MultiCacheQueryOptions = webidl.dictionaryConverter([
  14708. ...cacheQueryOptionConverters,
  14709. {
  14710. key: 'cacheName',
  14711. converter: webidl.converters.DOMString
  14712. }
  14713. ])
  14714. webidl.converters.Response = webidl.interfaceConverter(Response)
  14715. webidl.converters['sequence<RequestInfo>'] = webidl.sequenceConverter(
  14716. webidl.converters.RequestInfo
  14717. )
  14718. module.exports = {
  14719. Cache
  14720. }
  14721. /***/ }),
  14722. /***/ 7907:
  14723. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  14724. "use strict";
  14725. const { kConstruct } = __nccwpck_require__(9174)
  14726. const { Cache } = __nccwpck_require__(6101)
  14727. const { webidl } = __nccwpck_require__(1744)
  14728. const { kEnumerableProperty } = __nccwpck_require__(3983)
  14729. class CacheStorage {
  14730. /**
  14731. * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-name-to-cache-map
  14732. * @type {Map<string, import('./cache').requestResponseList}
  14733. */
  14734. #caches = new Map()
  14735. constructor () {
  14736. if (arguments[0] !== kConstruct) {
  14737. webidl.illegalConstructor()
  14738. }
  14739. }
  14740. async match (request, options = {}) {
  14741. webidl.brandCheck(this, CacheStorage)
  14742. webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.match' })
  14743. request = webidl.converters.RequestInfo(request)
  14744. options = webidl.converters.MultiCacheQueryOptions(options)
  14745. // 1.
  14746. if (options.cacheName != null) {
  14747. // 1.1.1.1
  14748. if (this.#caches.has(options.cacheName)) {
  14749. // 1.1.1.1.1
  14750. const cacheList = this.#caches.get(options.cacheName)
  14751. const cache = new Cache(kConstruct, cacheList)
  14752. return await cache.match(request, options)
  14753. }
  14754. } else { // 2.
  14755. // 2.2
  14756. for (const cacheList of this.#caches.values()) {
  14757. const cache = new Cache(kConstruct, cacheList)
  14758. // 2.2.1.2
  14759. const response = await cache.match(request, options)
  14760. if (response !== undefined) {
  14761. return response
  14762. }
  14763. }
  14764. }
  14765. }
  14766. /**
  14767. * @see https://w3c.github.io/ServiceWorker/#cache-storage-has
  14768. * @param {string} cacheName
  14769. * @returns {Promise<boolean>}
  14770. */
  14771. async has (cacheName) {
  14772. webidl.brandCheck(this, CacheStorage)
  14773. webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.has' })
  14774. cacheName = webidl.converters.DOMString(cacheName)
  14775. // 2.1.1
  14776. // 2.2
  14777. return this.#caches.has(cacheName)
  14778. }
  14779. /**
  14780. * @see https://w3c.github.io/ServiceWorker/#dom-cachestorage-open
  14781. * @param {string} cacheName
  14782. * @returns {Promise<Cache>}
  14783. */
  14784. async open (cacheName) {
  14785. webidl.brandCheck(this, CacheStorage)
  14786. webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.open' })
  14787. cacheName = webidl.converters.DOMString(cacheName)
  14788. // 2.1
  14789. if (this.#caches.has(cacheName)) {
  14790. // await caches.open('v1') !== await caches.open('v1')
  14791. // 2.1.1
  14792. const cache = this.#caches.get(cacheName)
  14793. // 2.1.1.1
  14794. return new Cache(kConstruct, cache)
  14795. }
  14796. // 2.2
  14797. const cache = []
  14798. // 2.3
  14799. this.#caches.set(cacheName, cache)
  14800. // 2.4
  14801. return new Cache(kConstruct, cache)
  14802. }
  14803. /**
  14804. * @see https://w3c.github.io/ServiceWorker/#cache-storage-delete
  14805. * @param {string} cacheName
  14806. * @returns {Promise<boolean>}
  14807. */
  14808. async delete (cacheName) {
  14809. webidl.brandCheck(this, CacheStorage)
  14810. webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.delete' })
  14811. cacheName = webidl.converters.DOMString(cacheName)
  14812. return this.#caches.delete(cacheName)
  14813. }
  14814. /**
  14815. * @see https://w3c.github.io/ServiceWorker/#cache-storage-keys
  14816. * @returns {string[]}
  14817. */
  14818. async keys () {
  14819. webidl.brandCheck(this, CacheStorage)
  14820. // 2.1
  14821. const keys = this.#caches.keys()
  14822. // 2.2
  14823. return [...keys]
  14824. }
  14825. }
  14826. Object.defineProperties(CacheStorage.prototype, {
  14827. [Symbol.toStringTag]: {
  14828. value: 'CacheStorage',
  14829. configurable: true
  14830. },
  14831. match: kEnumerableProperty,
  14832. has: kEnumerableProperty,
  14833. open: kEnumerableProperty,
  14834. delete: kEnumerableProperty,
  14835. keys: kEnumerableProperty
  14836. })
  14837. module.exports = {
  14838. CacheStorage
  14839. }
  14840. /***/ }),
  14841. /***/ 9174:
  14842. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  14843. "use strict";
  14844. module.exports = {
  14845. kConstruct: (__nccwpck_require__(2785).kConstruct)
  14846. }
  14847. /***/ }),
  14848. /***/ 2396:
  14849. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  14850. "use strict";
  14851. const assert = __nccwpck_require__(9491)
  14852. const { URLSerializer } = __nccwpck_require__(685)
  14853. const { isValidHeaderName } = __nccwpck_require__(2538)
  14854. /**
  14855. * @see https://url.spec.whatwg.org/#concept-url-equals
  14856. * @param {URL} A
  14857. * @param {URL} B
  14858. * @param {boolean | undefined} excludeFragment
  14859. * @returns {boolean}
  14860. */
  14861. function urlEquals (A, B, excludeFragment = false) {
  14862. const serializedA = URLSerializer(A, excludeFragment)
  14863. const serializedB = URLSerializer(B, excludeFragment)
  14864. return serializedA === serializedB
  14865. }
  14866. /**
  14867. * @see https://github.com/chromium/chromium/blob/694d20d134cb553d8d89e5500b9148012b1ba299/content/browser/cache_storage/cache_storage_cache.cc#L260-L262
  14868. * @param {string} header
  14869. */
  14870. function fieldValues (header) {
  14871. assert(header !== null)
  14872. const values = []
  14873. for (let value of header.split(',')) {
  14874. value = value.trim()
  14875. if (!value.length) {
  14876. continue
  14877. } else if (!isValidHeaderName(value)) {
  14878. continue
  14879. }
  14880. values.push(value)
  14881. }
  14882. return values
  14883. }
  14884. module.exports = {
  14885. urlEquals,
  14886. fieldValues
  14887. }
  14888. /***/ }),
  14889. /***/ 3598:
  14890. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  14891. "use strict";
  14892. // @ts-check
  14893. /* global WebAssembly */
  14894. const assert = __nccwpck_require__(9491)
  14895. const net = __nccwpck_require__(1808)
  14896. const http = __nccwpck_require__(3685)
  14897. const { pipeline } = __nccwpck_require__(2781)
  14898. const util = __nccwpck_require__(3983)
  14899. const timers = __nccwpck_require__(9459)
  14900. const Request = __nccwpck_require__(2905)
  14901. const DispatcherBase = __nccwpck_require__(4839)
  14902. const {
  14903. RequestContentLengthMismatchError,
  14904. ResponseContentLengthMismatchError,
  14905. InvalidArgumentError,
  14906. RequestAbortedError,
  14907. HeadersTimeoutError,
  14908. HeadersOverflowError,
  14909. SocketError,
  14910. InformationalError,
  14911. BodyTimeoutError,
  14912. HTTPParserError,
  14913. ResponseExceededMaxSizeError,
  14914. ClientDestroyedError
  14915. } = __nccwpck_require__(8045)
  14916. const buildConnector = __nccwpck_require__(2067)
  14917. const {
  14918. kUrl,
  14919. kReset,
  14920. kServerName,
  14921. kClient,
  14922. kBusy,
  14923. kParser,
  14924. kConnect,
  14925. kBlocking,
  14926. kResuming,
  14927. kRunning,
  14928. kPending,
  14929. kSize,
  14930. kWriting,
  14931. kQueue,
  14932. kConnected,
  14933. kConnecting,
  14934. kNeedDrain,
  14935. kNoRef,
  14936. kKeepAliveDefaultTimeout,
  14937. kHostHeader,
  14938. kPendingIdx,
  14939. kRunningIdx,
  14940. kError,
  14941. kPipelining,
  14942. kSocket,
  14943. kKeepAliveTimeoutValue,
  14944. kMaxHeadersSize,
  14945. kKeepAliveMaxTimeout,
  14946. kKeepAliveTimeoutThreshold,
  14947. kHeadersTimeout,
  14948. kBodyTimeout,
  14949. kStrictContentLength,
  14950. kConnector,
  14951. kMaxRedirections,
  14952. kMaxRequests,
  14953. kCounter,
  14954. kClose,
  14955. kDestroy,
  14956. kDispatch,
  14957. kInterceptors,
  14958. kLocalAddress,
  14959. kMaxResponseSize,
  14960. kHTTPConnVersion,
  14961. // HTTP2
  14962. kHost,
  14963. kHTTP2Session,
  14964. kHTTP2SessionState,
  14965. kHTTP2BuildRequest,
  14966. kHTTP2CopyHeaders,
  14967. kHTTP1BuildRequest
  14968. } = __nccwpck_require__(2785)
  14969. /** @type {import('http2')} */
  14970. let http2
  14971. try {
  14972. http2 = __nccwpck_require__(5158)
  14973. } catch {
  14974. // @ts-ignore
  14975. http2 = { constants: {} }
  14976. }
  14977. const {
  14978. constants: {
  14979. HTTP2_HEADER_AUTHORITY,
  14980. HTTP2_HEADER_METHOD,
  14981. HTTP2_HEADER_PATH,
  14982. HTTP2_HEADER_SCHEME,
  14983. HTTP2_HEADER_CONTENT_LENGTH,
  14984. HTTP2_HEADER_EXPECT,
  14985. HTTP2_HEADER_STATUS
  14986. }
  14987. } = http2
  14988. // Experimental
  14989. let h2ExperimentalWarned = false
  14990. const FastBuffer = Buffer[Symbol.species]
  14991. const kClosedResolve = Symbol('kClosedResolve')
  14992. const channels = {}
  14993. try {
  14994. const diagnosticsChannel = __nccwpck_require__(7643)
  14995. channels.sendHeaders = diagnosticsChannel.channel('undici:client:sendHeaders')
  14996. channels.beforeConnect = diagnosticsChannel.channel('undici:client:beforeConnect')
  14997. channels.connectError = diagnosticsChannel.channel('undici:client:connectError')
  14998. channels.connected = diagnosticsChannel.channel('undici:client:connected')
  14999. } catch {
  15000. channels.sendHeaders = { hasSubscribers: false }
  15001. channels.beforeConnect = { hasSubscribers: false }
  15002. channels.connectError = { hasSubscribers: false }
  15003. channels.connected = { hasSubscribers: false }
  15004. }
  15005. /**
  15006. * @type {import('../types/client').default}
  15007. */
  15008. class Client extends DispatcherBase {
  15009. /**
  15010. *
  15011. * @param {string|URL} url
  15012. * @param {import('../types/client').Client.Options} options
  15013. */
  15014. constructor (url, {
  15015. interceptors,
  15016. maxHeaderSize,
  15017. headersTimeout,
  15018. socketTimeout,
  15019. requestTimeout,
  15020. connectTimeout,
  15021. bodyTimeout,
  15022. idleTimeout,
  15023. keepAlive,
  15024. keepAliveTimeout,
  15025. maxKeepAliveTimeout,
  15026. keepAliveMaxTimeout,
  15027. keepAliveTimeoutThreshold,
  15028. socketPath,
  15029. pipelining,
  15030. tls,
  15031. strictContentLength,
  15032. maxCachedSessions,
  15033. maxRedirections,
  15034. connect,
  15035. maxRequestsPerClient,
  15036. localAddress,
  15037. maxResponseSize,
  15038. autoSelectFamily,
  15039. autoSelectFamilyAttemptTimeout,
  15040. // h2
  15041. allowH2,
  15042. maxConcurrentStreams
  15043. } = {}) {
  15044. super()
  15045. if (keepAlive !== undefined) {
  15046. throw new InvalidArgumentError('unsupported keepAlive, use pipelining=0 instead')
  15047. }
  15048. if (socketTimeout !== undefined) {
  15049. throw new InvalidArgumentError('unsupported socketTimeout, use headersTimeout & bodyTimeout instead')
  15050. }
  15051. if (requestTimeout !== undefined) {
  15052. throw new InvalidArgumentError('unsupported requestTimeout, use headersTimeout & bodyTimeout instead')
  15053. }
  15054. if (idleTimeout !== undefined) {
  15055. throw new InvalidArgumentError('unsupported idleTimeout, use keepAliveTimeout instead')
  15056. }
  15057. if (maxKeepAliveTimeout !== undefined) {
  15058. throw new InvalidArgumentError('unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead')
  15059. }
  15060. if (maxHeaderSize != null && !Number.isFinite(maxHeaderSize)) {
  15061. throw new InvalidArgumentError('invalid maxHeaderSize')
  15062. }
  15063. if (socketPath != null && typeof socketPath !== 'string') {
  15064. throw new InvalidArgumentError('invalid socketPath')
  15065. }
  15066. if (connectTimeout != null && (!Number.isFinite(connectTimeout) || connectTimeout < 0)) {
  15067. throw new InvalidArgumentError('invalid connectTimeout')
  15068. }
  15069. if (keepAliveTimeout != null && (!Number.isFinite(keepAliveTimeout) || keepAliveTimeout <= 0)) {
  15070. throw new InvalidArgumentError('invalid keepAliveTimeout')
  15071. }
  15072. if (keepAliveMaxTimeout != null && (!Number.isFinite(keepAliveMaxTimeout) || keepAliveMaxTimeout <= 0)) {
  15073. throw new InvalidArgumentError('invalid keepAliveMaxTimeout')
  15074. }
  15075. if (keepAliveTimeoutThreshold != null && !Number.isFinite(keepAliveTimeoutThreshold)) {
  15076. throw new InvalidArgumentError('invalid keepAliveTimeoutThreshold')
  15077. }
  15078. if (headersTimeout != null && (!Number.isInteger(headersTimeout) || headersTimeout < 0)) {
  15079. throw new InvalidArgumentError('headersTimeout must be a positive integer or zero')
  15080. }
  15081. if (bodyTimeout != null && (!Number.isInteger(bodyTimeout) || bodyTimeout < 0)) {
  15082. throw new InvalidArgumentError('bodyTimeout must be a positive integer or zero')
  15083. }
  15084. if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {
  15085. throw new InvalidArgumentError('connect must be a function or an object')
  15086. }
  15087. if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) {
  15088. throw new InvalidArgumentError('maxRedirections must be a positive number')
  15089. }
  15090. if (maxRequestsPerClient != null && (!Number.isInteger(maxRequestsPerClient) || maxRequestsPerClient < 0)) {
  15091. throw new InvalidArgumentError('maxRequestsPerClient must be a positive number')
  15092. }
  15093. if (localAddress != null && (typeof localAddress !== 'string' || net.isIP(localAddress) === 0)) {
  15094. throw new InvalidArgumentError('localAddress must be valid string IP address')
  15095. }
  15096. if (maxResponseSize != null && (!Number.isInteger(maxResponseSize) || maxResponseSize < -1)) {
  15097. throw new InvalidArgumentError('maxResponseSize must be a positive number')
  15098. }
  15099. if (
  15100. autoSelectFamilyAttemptTimeout != null &&
  15101. (!Number.isInteger(autoSelectFamilyAttemptTimeout) || autoSelectFamilyAttemptTimeout < -1)
  15102. ) {
  15103. throw new InvalidArgumentError('autoSelectFamilyAttemptTimeout must be a positive number')
  15104. }
  15105. // h2
  15106. if (allowH2 != null && typeof allowH2 !== 'boolean') {
  15107. throw new InvalidArgumentError('allowH2 must be a valid boolean value')
  15108. }
  15109. if (maxConcurrentStreams != null && (typeof maxConcurrentStreams !== 'number' || maxConcurrentStreams < 1)) {
  15110. throw new InvalidArgumentError('maxConcurrentStreams must be a possitive integer, greater than 0')
  15111. }
  15112. if (typeof connect !== 'function') {
  15113. connect = buildConnector({
  15114. ...tls,
  15115. maxCachedSessions,
  15116. allowH2,
  15117. socketPath,
  15118. timeout: connectTimeout,
  15119. ...(util.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined),
  15120. ...connect
  15121. })
  15122. }
  15123. this[kInterceptors] = interceptors && interceptors.Client && Array.isArray(interceptors.Client)
  15124. ? interceptors.Client
  15125. : [createRedirectInterceptor({ maxRedirections })]
  15126. this[kUrl] = util.parseOrigin(url)
  15127. this[kConnector] = connect
  15128. this[kSocket] = null
  15129. this[kPipelining] = pipelining != null ? pipelining : 1
  15130. this[kMaxHeadersSize] = maxHeaderSize || http.maxHeaderSize
  15131. this[kKeepAliveDefaultTimeout] = keepAliveTimeout == null ? 4e3 : keepAliveTimeout
  15132. this[kKeepAliveMaxTimeout] = keepAliveMaxTimeout == null ? 600e3 : keepAliveMaxTimeout
  15133. this[kKeepAliveTimeoutThreshold] = keepAliveTimeoutThreshold == null ? 1e3 : keepAliveTimeoutThreshold
  15134. this[kKeepAliveTimeoutValue] = this[kKeepAliveDefaultTimeout]
  15135. this[kServerName] = null
  15136. this[kLocalAddress] = localAddress != null ? localAddress : null
  15137. this[kResuming] = 0 // 0, idle, 1, scheduled, 2 resuming
  15138. this[kNeedDrain] = 0 // 0, idle, 1, scheduled, 2 resuming
  15139. this[kHostHeader] = `host: ${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ''}\r\n`
  15140. this[kBodyTimeout] = bodyTimeout != null ? bodyTimeout : 300e3
  15141. this[kHeadersTimeout] = headersTimeout != null ? headersTimeout : 300e3
  15142. this[kStrictContentLength] = strictContentLength == null ? true : strictContentLength
  15143. this[kMaxRedirections] = maxRedirections
  15144. this[kMaxRequests] = maxRequestsPerClient
  15145. this[kClosedResolve] = null
  15146. this[kMaxResponseSize] = maxResponseSize > -1 ? maxResponseSize : -1
  15147. this[kHTTPConnVersion] = 'h1'
  15148. // HTTP/2
  15149. this[kHTTP2Session] = null
  15150. this[kHTTP2SessionState] = !allowH2
  15151. ? null
  15152. : {
  15153. // streams: null, // Fixed queue of streams - For future support of `push`
  15154. openStreams: 0, // Keep track of them to decide wether or not unref the session
  15155. maxConcurrentStreams: maxConcurrentStreams != null ? maxConcurrentStreams : 100 // Max peerConcurrentStreams for a Node h2 server
  15156. }
  15157. this[kHost] = `${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ''}`
  15158. // kQueue is built up of 3 sections separated by
  15159. // the kRunningIdx and kPendingIdx indices.
  15160. // | complete | running | pending |
  15161. // ^ kRunningIdx ^ kPendingIdx ^ kQueue.length
  15162. // kRunningIdx points to the first running element.
  15163. // kPendingIdx points to the first pending element.
  15164. // This implements a fast queue with an amortized
  15165. // time of O(1).
  15166. this[kQueue] = []
  15167. this[kRunningIdx] = 0
  15168. this[kPendingIdx] = 0
  15169. }
  15170. get pipelining () {
  15171. return this[kPipelining]
  15172. }
  15173. set pipelining (value) {
  15174. this[kPipelining] = value
  15175. resume(this, true)
  15176. }
  15177. get [kPending] () {
  15178. return this[kQueue].length - this[kPendingIdx]
  15179. }
  15180. get [kRunning] () {
  15181. return this[kPendingIdx] - this[kRunningIdx]
  15182. }
  15183. get [kSize] () {
  15184. return this[kQueue].length - this[kRunningIdx]
  15185. }
  15186. get [kConnected] () {
  15187. return !!this[kSocket] && !this[kConnecting] && !this[kSocket].destroyed
  15188. }
  15189. get [kBusy] () {
  15190. const socket = this[kSocket]
  15191. return (
  15192. (socket && (socket[kReset] || socket[kWriting] || socket[kBlocking])) ||
  15193. (this[kSize] >= (this[kPipelining] || 1)) ||
  15194. this[kPending] > 0
  15195. )
  15196. }
  15197. /* istanbul ignore: only used for test */
  15198. [kConnect] (cb) {
  15199. connect(this)
  15200. this.once('connect', cb)
  15201. }
  15202. [kDispatch] (opts, handler) {
  15203. const origin = opts.origin || this[kUrl].origin
  15204. const request = this[kHTTPConnVersion] === 'h2'
  15205. ? Request[kHTTP2BuildRequest](origin, opts, handler)
  15206. : Request[kHTTP1BuildRequest](origin, opts, handler)
  15207. this[kQueue].push(request)
  15208. if (this[kResuming]) {
  15209. // Do nothing.
  15210. } else if (util.bodyLength(request.body) == null && util.isIterable(request.body)) {
  15211. // Wait a tick in case stream/iterator is ended in the same tick.
  15212. this[kResuming] = 1
  15213. process.nextTick(resume, this)
  15214. } else {
  15215. resume(this, true)
  15216. }
  15217. if (this[kResuming] && this[kNeedDrain] !== 2 && this[kBusy]) {
  15218. this[kNeedDrain] = 2
  15219. }
  15220. return this[kNeedDrain] < 2
  15221. }
  15222. async [kClose] () {
  15223. // TODO: for H2 we need to gracefully flush the remaining enqueued
  15224. // request and close each stream.
  15225. return new Promise((resolve) => {
  15226. if (!this[kSize]) {
  15227. resolve(null)
  15228. } else {
  15229. this[kClosedResolve] = resolve
  15230. }
  15231. })
  15232. }
  15233. async [kDestroy] (err) {
  15234. return new Promise((resolve) => {
  15235. const requests = this[kQueue].splice(this[kPendingIdx])
  15236. for (let i = 0; i < requests.length; i++) {
  15237. const request = requests[i]
  15238. errorRequest(this, request, err)
  15239. }
  15240. const callback = () => {
  15241. if (this[kClosedResolve]) {
  15242. // TODO (fix): Should we error here with ClientDestroyedError?
  15243. this[kClosedResolve]()
  15244. this[kClosedResolve] = null
  15245. }
  15246. resolve()
  15247. }
  15248. if (this[kHTTP2Session] != null) {
  15249. util.destroy(this[kHTTP2Session], err)
  15250. this[kHTTP2Session] = null
  15251. this[kHTTP2SessionState] = null
  15252. }
  15253. if (!this[kSocket]) {
  15254. queueMicrotask(callback)
  15255. } else {
  15256. util.destroy(this[kSocket].on('close', callback), err)
  15257. }
  15258. resume(this)
  15259. })
  15260. }
  15261. }
  15262. function onHttp2SessionError (err) {
  15263. assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')
  15264. this[kSocket][kError] = err
  15265. onError(this[kClient], err)
  15266. }
  15267. function onHttp2FrameError (type, code, id) {
  15268. const err = new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`)
  15269. if (id === 0) {
  15270. this[kSocket][kError] = err
  15271. onError(this[kClient], err)
  15272. }
  15273. }
  15274. function onHttp2SessionEnd () {
  15275. util.destroy(this, new SocketError('other side closed'))
  15276. util.destroy(this[kSocket], new SocketError('other side closed'))
  15277. }
  15278. function onHTTP2GoAway (code) {
  15279. const client = this[kClient]
  15280. const err = new InformationalError(`HTTP/2: "GOAWAY" frame received with code ${code}`)
  15281. client[kSocket] = null
  15282. client[kHTTP2Session] = null
  15283. if (client.destroyed) {
  15284. assert(this[kPending] === 0)
  15285. // Fail entire queue.
  15286. const requests = client[kQueue].splice(client[kRunningIdx])
  15287. for (let i = 0; i < requests.length; i++) {
  15288. const request = requests[i]
  15289. errorRequest(this, request, err)
  15290. }
  15291. } else if (client[kRunning] > 0) {
  15292. // Fail head of pipeline.
  15293. const request = client[kQueue][client[kRunningIdx]]
  15294. client[kQueue][client[kRunningIdx]++] = null
  15295. errorRequest(client, request, err)
  15296. }
  15297. client[kPendingIdx] = client[kRunningIdx]
  15298. assert(client[kRunning] === 0)
  15299. client.emit('disconnect',
  15300. client[kUrl],
  15301. [client],
  15302. err
  15303. )
  15304. resume(client)
  15305. }
  15306. const constants = __nccwpck_require__(953)
  15307. const createRedirectInterceptor = __nccwpck_require__(8861)
  15308. const EMPTY_BUF = Buffer.alloc(0)
  15309. async function lazyllhttp () {
  15310. const llhttpWasmData = process.env.JEST_WORKER_ID ? __nccwpck_require__(1145) : undefined
  15311. let mod
  15312. try {
  15313. mod = await WebAssembly.compile(Buffer.from(__nccwpck_require__(5627), 'base64'))
  15314. } catch (e) {
  15315. /* istanbul ignore next */
  15316. // We could check if the error was caused by the simd option not
  15317. // being enabled, but the occurring of this other error
  15318. // * https://github.com/emscripten-core/emscripten/issues/11495
  15319. // got me to remove that check to avoid breaking Node 12.
  15320. mod = await WebAssembly.compile(Buffer.from(llhttpWasmData || __nccwpck_require__(1145), 'base64'))
  15321. }
  15322. return await WebAssembly.instantiate(mod, {
  15323. env: {
  15324. /* eslint-disable camelcase */
  15325. wasm_on_url: (p, at, len) => {
  15326. /* istanbul ignore next */
  15327. return 0
  15328. },
  15329. wasm_on_status: (p, at, len) => {
  15330. assert.strictEqual(currentParser.ptr, p)
  15331. const start = at - currentBufferPtr + currentBufferRef.byteOffset
  15332. return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
  15333. },
  15334. wasm_on_message_begin: (p) => {
  15335. assert.strictEqual(currentParser.ptr, p)
  15336. return currentParser.onMessageBegin() || 0
  15337. },
  15338. wasm_on_header_field: (p, at, len) => {
  15339. assert.strictEqual(currentParser.ptr, p)
  15340. const start = at - currentBufferPtr + currentBufferRef.byteOffset
  15341. return currentParser.onHeaderField(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
  15342. },
  15343. wasm_on_header_value: (p, at, len) => {
  15344. assert.strictEqual(currentParser.ptr, p)
  15345. const start = at - currentBufferPtr + currentBufferRef.byteOffset
  15346. return currentParser.onHeaderValue(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
  15347. },
  15348. wasm_on_headers_complete: (p, statusCode, upgrade, shouldKeepAlive) => {
  15349. assert.strictEqual(currentParser.ptr, p)
  15350. return currentParser.onHeadersComplete(statusCode, Boolean(upgrade), Boolean(shouldKeepAlive)) || 0
  15351. },
  15352. wasm_on_body: (p, at, len) => {
  15353. assert.strictEqual(currentParser.ptr, p)
  15354. const start = at - currentBufferPtr + currentBufferRef.byteOffset
  15355. return currentParser.onBody(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
  15356. },
  15357. wasm_on_message_complete: (p) => {
  15358. assert.strictEqual(currentParser.ptr, p)
  15359. return currentParser.onMessageComplete() || 0
  15360. }
  15361. /* eslint-enable camelcase */
  15362. }
  15363. })
  15364. }
  15365. let llhttpInstance = null
  15366. let llhttpPromise = lazyllhttp()
  15367. llhttpPromise.catch()
  15368. let currentParser = null
  15369. let currentBufferRef = null
  15370. let currentBufferSize = 0
  15371. let currentBufferPtr = null
  15372. const TIMEOUT_HEADERS = 1
  15373. const TIMEOUT_BODY = 2
  15374. const TIMEOUT_IDLE = 3
  15375. class Parser {
  15376. constructor (client, socket, { exports }) {
  15377. assert(Number.isFinite(client[kMaxHeadersSize]) && client[kMaxHeadersSize] > 0)
  15378. this.llhttp = exports
  15379. this.ptr = this.llhttp.llhttp_alloc(constants.TYPE.RESPONSE)
  15380. this.client = client
  15381. this.socket = socket
  15382. this.timeout = null
  15383. this.timeoutValue = null
  15384. this.timeoutType = null
  15385. this.statusCode = null
  15386. this.statusText = ''
  15387. this.upgrade = false
  15388. this.headers = []
  15389. this.headersSize = 0
  15390. this.headersMaxSize = client[kMaxHeadersSize]
  15391. this.shouldKeepAlive = false
  15392. this.paused = false
  15393. this.resume = this.resume.bind(this)
  15394. this.bytesRead = 0
  15395. this.keepAlive = ''
  15396. this.contentLength = ''
  15397. this.connection = ''
  15398. this.maxResponseSize = client[kMaxResponseSize]
  15399. }
  15400. setTimeout (value, type) {
  15401. this.timeoutType = type
  15402. if (value !== this.timeoutValue) {
  15403. timers.clearTimeout(this.timeout)
  15404. if (value) {
  15405. this.timeout = timers.setTimeout(onParserTimeout, value, this)
  15406. // istanbul ignore else: only for jest
  15407. if (this.timeout.unref) {
  15408. this.timeout.unref()
  15409. }
  15410. } else {
  15411. this.timeout = null
  15412. }
  15413. this.timeoutValue = value
  15414. } else if (this.timeout) {
  15415. // istanbul ignore else: only for jest
  15416. if (this.timeout.refresh) {
  15417. this.timeout.refresh()
  15418. }
  15419. }
  15420. }
  15421. resume () {
  15422. if (this.socket.destroyed || !this.paused) {
  15423. return
  15424. }
  15425. assert(this.ptr != null)
  15426. assert(currentParser == null)
  15427. this.llhttp.llhttp_resume(this.ptr)
  15428. assert(this.timeoutType === TIMEOUT_BODY)
  15429. if (this.timeout) {
  15430. // istanbul ignore else: only for jest
  15431. if (this.timeout.refresh) {
  15432. this.timeout.refresh()
  15433. }
  15434. }
  15435. this.paused = false
  15436. this.execute(this.socket.read() || EMPTY_BUF) // Flush parser.
  15437. this.readMore()
  15438. }
  15439. readMore () {
  15440. while (!this.paused && this.ptr) {
  15441. const chunk = this.socket.read()
  15442. if (chunk === null) {
  15443. break
  15444. }
  15445. this.execute(chunk)
  15446. }
  15447. }
  15448. execute (data) {
  15449. assert(this.ptr != null)
  15450. assert(currentParser == null)
  15451. assert(!this.paused)
  15452. const { socket, llhttp } = this
  15453. if (data.length > currentBufferSize) {
  15454. if (currentBufferPtr) {
  15455. llhttp.free(currentBufferPtr)
  15456. }
  15457. currentBufferSize = Math.ceil(data.length / 4096) * 4096
  15458. currentBufferPtr = llhttp.malloc(currentBufferSize)
  15459. }
  15460. new Uint8Array(llhttp.memory.buffer, currentBufferPtr, currentBufferSize).set(data)
  15461. // Call `execute` on the wasm parser.
  15462. // We pass the `llhttp_parser` pointer address, the pointer address of buffer view data,
  15463. // and finally the length of bytes to parse.
  15464. // The return value is an error code or `constants.ERROR.OK`.
  15465. try {
  15466. let ret
  15467. try {
  15468. currentBufferRef = data
  15469. currentParser = this
  15470. ret = llhttp.llhttp_execute(this.ptr, currentBufferPtr, data.length)
  15471. /* eslint-disable-next-line no-useless-catch */
  15472. } catch (err) {
  15473. /* istanbul ignore next: difficult to make a test case for */
  15474. throw err
  15475. } finally {
  15476. currentParser = null
  15477. currentBufferRef = null
  15478. }
  15479. const offset = llhttp.llhttp_get_error_pos(this.ptr) - currentBufferPtr
  15480. if (ret === constants.ERROR.PAUSED_UPGRADE) {
  15481. this.onUpgrade(data.slice(offset))
  15482. } else if (ret === constants.ERROR.PAUSED) {
  15483. this.paused = true
  15484. socket.unshift(data.slice(offset))
  15485. } else if (ret !== constants.ERROR.OK) {
  15486. const ptr = llhttp.llhttp_get_error_reason(this.ptr)
  15487. let message = ''
  15488. /* istanbul ignore else: difficult to make a test case for */
  15489. if (ptr) {
  15490. const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0)
  15491. message =
  15492. 'Response does not match the HTTP/1.1 protocol (' +
  15493. Buffer.from(llhttp.memory.buffer, ptr, len).toString() +
  15494. ')'
  15495. }
  15496. throw new HTTPParserError(message, constants.ERROR[ret], data.slice(offset))
  15497. }
  15498. } catch (err) {
  15499. util.destroy(socket, err)
  15500. }
  15501. }
  15502. destroy () {
  15503. assert(this.ptr != null)
  15504. assert(currentParser == null)
  15505. this.llhttp.llhttp_free(this.ptr)
  15506. this.ptr = null
  15507. timers.clearTimeout(this.timeout)
  15508. this.timeout = null
  15509. this.timeoutValue = null
  15510. this.timeoutType = null
  15511. this.paused = false
  15512. }
  15513. onStatus (buf) {
  15514. this.statusText = buf.toString()
  15515. }
  15516. onMessageBegin () {
  15517. const { socket, client } = this
  15518. /* istanbul ignore next: difficult to make a test case for */
  15519. if (socket.destroyed) {
  15520. return -1
  15521. }
  15522. const request = client[kQueue][client[kRunningIdx]]
  15523. if (!request) {
  15524. return -1
  15525. }
  15526. }
  15527. onHeaderField (buf) {
  15528. const len = this.headers.length
  15529. if ((len & 1) === 0) {
  15530. this.headers.push(buf)
  15531. } else {
  15532. this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf])
  15533. }
  15534. this.trackHeader(buf.length)
  15535. }
  15536. onHeaderValue (buf) {
  15537. let len = this.headers.length
  15538. if ((len & 1) === 1) {
  15539. this.headers.push(buf)
  15540. len += 1
  15541. } else {
  15542. this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf])
  15543. }
  15544. const key = this.headers[len - 2]
  15545. if (key.length === 10 && key.toString().toLowerCase() === 'keep-alive') {
  15546. this.keepAlive += buf.toString()
  15547. } else if (key.length === 10 && key.toString().toLowerCase() === 'connection') {
  15548. this.connection += buf.toString()
  15549. } else if (key.length === 14 && key.toString().toLowerCase() === 'content-length') {
  15550. this.contentLength += buf.toString()
  15551. }
  15552. this.trackHeader(buf.length)
  15553. }
  15554. trackHeader (len) {
  15555. this.headersSize += len
  15556. if (this.headersSize >= this.headersMaxSize) {
  15557. util.destroy(this.socket, new HeadersOverflowError())
  15558. }
  15559. }
  15560. onUpgrade (head) {
  15561. const { upgrade, client, socket, headers, statusCode } = this
  15562. assert(upgrade)
  15563. const request = client[kQueue][client[kRunningIdx]]
  15564. assert(request)
  15565. assert(!socket.destroyed)
  15566. assert(socket === client[kSocket])
  15567. assert(!this.paused)
  15568. assert(request.upgrade || request.method === 'CONNECT')
  15569. this.statusCode = null
  15570. this.statusText = ''
  15571. this.shouldKeepAlive = null
  15572. assert(this.headers.length % 2 === 0)
  15573. this.headers = []
  15574. this.headersSize = 0
  15575. socket.unshift(head)
  15576. socket[kParser].destroy()
  15577. socket[kParser] = null
  15578. socket[kClient] = null
  15579. socket[kError] = null
  15580. socket
  15581. .removeListener('error', onSocketError)
  15582. .removeListener('readable', onSocketReadable)
  15583. .removeListener('end', onSocketEnd)
  15584. .removeListener('close', onSocketClose)
  15585. client[kSocket] = null
  15586. client[kQueue][client[kRunningIdx]++] = null
  15587. client.emit('disconnect', client[kUrl], [client], new InformationalError('upgrade'))
  15588. try {
  15589. request.onUpgrade(statusCode, headers, socket)
  15590. } catch (err) {
  15591. util.destroy(socket, err)
  15592. }
  15593. resume(client)
  15594. }
  15595. onHeadersComplete (statusCode, upgrade, shouldKeepAlive) {
  15596. const { client, socket, headers, statusText } = this
  15597. /* istanbul ignore next: difficult to make a test case for */
  15598. if (socket.destroyed) {
  15599. return -1
  15600. }
  15601. const request = client[kQueue][client[kRunningIdx]]
  15602. /* istanbul ignore next: difficult to make a test case for */
  15603. if (!request) {
  15604. return -1
  15605. }
  15606. assert(!this.upgrade)
  15607. assert(this.statusCode < 200)
  15608. if (statusCode === 100) {
  15609. util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket)))
  15610. return -1
  15611. }
  15612. /* this can only happen if server is misbehaving */
  15613. if (upgrade && !request.upgrade) {
  15614. util.destroy(socket, new SocketError('bad upgrade', util.getSocketInfo(socket)))
  15615. return -1
  15616. }
  15617. assert.strictEqual(this.timeoutType, TIMEOUT_HEADERS)
  15618. this.statusCode = statusCode
  15619. this.shouldKeepAlive = (
  15620. shouldKeepAlive ||
  15621. // Override llhttp value which does not allow keepAlive for HEAD.
  15622. (request.method === 'HEAD' && !socket[kReset] && this.connection.toLowerCase() === 'keep-alive')
  15623. )
  15624. if (this.statusCode >= 200) {
  15625. const bodyTimeout = request.bodyTimeout != null
  15626. ? request.bodyTimeout
  15627. : client[kBodyTimeout]
  15628. this.setTimeout(bodyTimeout, TIMEOUT_BODY)
  15629. } else if (this.timeout) {
  15630. // istanbul ignore else: only for jest
  15631. if (this.timeout.refresh) {
  15632. this.timeout.refresh()
  15633. }
  15634. }
  15635. if (request.method === 'CONNECT') {
  15636. assert(client[kRunning] === 1)
  15637. this.upgrade = true
  15638. return 2
  15639. }
  15640. if (upgrade) {
  15641. assert(client[kRunning] === 1)
  15642. this.upgrade = true
  15643. return 2
  15644. }
  15645. assert(this.headers.length % 2 === 0)
  15646. this.headers = []
  15647. this.headersSize = 0
  15648. if (this.shouldKeepAlive && client[kPipelining]) {
  15649. const keepAliveTimeout = this.keepAlive ? util.parseKeepAliveTimeout(this.keepAlive) : null
  15650. if (keepAliveTimeout != null) {
  15651. const timeout = Math.min(
  15652. keepAliveTimeout - client[kKeepAliveTimeoutThreshold],
  15653. client[kKeepAliveMaxTimeout]
  15654. )
  15655. if (timeout <= 0) {
  15656. socket[kReset] = true
  15657. } else {
  15658. client[kKeepAliveTimeoutValue] = timeout
  15659. }
  15660. } else {
  15661. client[kKeepAliveTimeoutValue] = client[kKeepAliveDefaultTimeout]
  15662. }
  15663. } else {
  15664. // Stop more requests from being dispatched.
  15665. socket[kReset] = true
  15666. }
  15667. const pause = request.onHeaders(statusCode, headers, this.resume, statusText) === false
  15668. if (request.aborted) {
  15669. return -1
  15670. }
  15671. if (request.method === 'HEAD') {
  15672. return 1
  15673. }
  15674. if (statusCode < 200) {
  15675. return 1
  15676. }
  15677. if (socket[kBlocking]) {
  15678. socket[kBlocking] = false
  15679. resume(client)
  15680. }
  15681. return pause ? constants.ERROR.PAUSED : 0
  15682. }
  15683. onBody (buf) {
  15684. const { client, socket, statusCode, maxResponseSize } = this
  15685. if (socket.destroyed) {
  15686. return -1
  15687. }
  15688. const request = client[kQueue][client[kRunningIdx]]
  15689. assert(request)
  15690. assert.strictEqual(this.timeoutType, TIMEOUT_BODY)
  15691. if (this.timeout) {
  15692. // istanbul ignore else: only for jest
  15693. if (this.timeout.refresh) {
  15694. this.timeout.refresh()
  15695. }
  15696. }
  15697. assert(statusCode >= 200)
  15698. if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) {
  15699. util.destroy(socket, new ResponseExceededMaxSizeError())
  15700. return -1
  15701. }
  15702. this.bytesRead += buf.length
  15703. if (request.onData(buf) === false) {
  15704. return constants.ERROR.PAUSED
  15705. }
  15706. }
  15707. onMessageComplete () {
  15708. const { client, socket, statusCode, upgrade, headers, contentLength, bytesRead, shouldKeepAlive } = this
  15709. if (socket.destroyed && (!statusCode || shouldKeepAlive)) {
  15710. return -1
  15711. }
  15712. if (upgrade) {
  15713. return
  15714. }
  15715. const request = client[kQueue][client[kRunningIdx]]
  15716. assert(request)
  15717. assert(statusCode >= 100)
  15718. this.statusCode = null
  15719. this.statusText = ''
  15720. this.bytesRead = 0
  15721. this.contentLength = ''
  15722. this.keepAlive = ''
  15723. this.connection = ''
  15724. assert(this.headers.length % 2 === 0)
  15725. this.headers = []
  15726. this.headersSize = 0
  15727. if (statusCode < 200) {
  15728. return
  15729. }
  15730. /* istanbul ignore next: should be handled by llhttp? */
  15731. if (request.method !== 'HEAD' && contentLength && bytesRead !== parseInt(contentLength, 10)) {
  15732. util.destroy(socket, new ResponseContentLengthMismatchError())
  15733. return -1
  15734. }
  15735. request.onComplete(headers)
  15736. client[kQueue][client[kRunningIdx]++] = null
  15737. if (socket[kWriting]) {
  15738. assert.strictEqual(client[kRunning], 0)
  15739. // Response completed before request.
  15740. util.destroy(socket, new InformationalError('reset'))
  15741. return constants.ERROR.PAUSED
  15742. } else if (!shouldKeepAlive) {
  15743. util.destroy(socket, new InformationalError('reset'))
  15744. return constants.ERROR.PAUSED
  15745. } else if (socket[kReset] && client[kRunning] === 0) {
  15746. // Destroy socket once all requests have completed.
  15747. // The request at the tail of the pipeline is the one
  15748. // that requested reset and no further requests should
  15749. // have been queued since then.
  15750. util.destroy(socket, new InformationalError('reset'))
  15751. return constants.ERROR.PAUSED
  15752. } else if (client[kPipelining] === 1) {
  15753. // We must wait a full event loop cycle to reuse this socket to make sure
  15754. // that non-spec compliant servers are not closing the connection even if they
  15755. // said they won't.
  15756. setImmediate(resume, client)
  15757. } else {
  15758. resume(client)
  15759. }
  15760. }
  15761. }
  15762. function onParserTimeout (parser) {
  15763. const { socket, timeoutType, client } = parser
  15764. /* istanbul ignore else */
  15765. if (timeoutType === TIMEOUT_HEADERS) {
  15766. if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) {
  15767. assert(!parser.paused, 'cannot be paused while waiting for headers')
  15768. util.destroy(socket, new HeadersTimeoutError())
  15769. }
  15770. } else if (timeoutType === TIMEOUT_BODY) {
  15771. if (!parser.paused) {
  15772. util.destroy(socket, new BodyTimeoutError())
  15773. }
  15774. } else if (timeoutType === TIMEOUT_IDLE) {
  15775. assert(client[kRunning] === 0 && client[kKeepAliveTimeoutValue])
  15776. util.destroy(socket, new InformationalError('socket idle timeout'))
  15777. }
  15778. }
  15779. function onSocketReadable () {
  15780. const { [kParser]: parser } = this
  15781. if (parser) {
  15782. parser.readMore()
  15783. }
  15784. }
  15785. function onSocketError (err) {
  15786. const { [kClient]: client, [kParser]: parser } = this
  15787. assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')
  15788. if (client[kHTTPConnVersion] !== 'h2') {
  15789. // On Mac OS, we get an ECONNRESET even if there is a full body to be forwarded
  15790. // to the user.
  15791. if (err.code === 'ECONNRESET' && parser.statusCode && !parser.shouldKeepAlive) {
  15792. // We treat all incoming data so for as a valid response.
  15793. parser.onMessageComplete()
  15794. return
  15795. }
  15796. }
  15797. this[kError] = err
  15798. onError(this[kClient], err)
  15799. }
  15800. function onError (client, err) {
  15801. if (
  15802. client[kRunning] === 0 &&
  15803. err.code !== 'UND_ERR_INFO' &&
  15804. err.code !== 'UND_ERR_SOCKET'
  15805. ) {
  15806. // Error is not caused by running request and not a recoverable
  15807. // socket error.
  15808. assert(client[kPendingIdx] === client[kRunningIdx])
  15809. const requests = client[kQueue].splice(client[kRunningIdx])
  15810. for (let i = 0; i < requests.length; i++) {
  15811. const request = requests[i]
  15812. errorRequest(client, request, err)
  15813. }
  15814. assert(client[kSize] === 0)
  15815. }
  15816. }
  15817. function onSocketEnd () {
  15818. const { [kParser]: parser, [kClient]: client } = this
  15819. if (client[kHTTPConnVersion] !== 'h2') {
  15820. if (parser.statusCode && !parser.shouldKeepAlive) {
  15821. // We treat all incoming data so far as a valid response.
  15822. parser.onMessageComplete()
  15823. return
  15824. }
  15825. }
  15826. util.destroy(this, new SocketError('other side closed', util.getSocketInfo(this)))
  15827. }
  15828. function onSocketClose () {
  15829. const { [kClient]: client, [kParser]: parser } = this
  15830. if (client[kHTTPConnVersion] === 'h1' && parser) {
  15831. if (!this[kError] && parser.statusCode && !parser.shouldKeepAlive) {
  15832. // We treat all incoming data so far as a valid response.
  15833. parser.onMessageComplete()
  15834. }
  15835. this[kParser].destroy()
  15836. this[kParser] = null
  15837. }
  15838. const err = this[kError] || new SocketError('closed', util.getSocketInfo(this))
  15839. client[kSocket] = null
  15840. if (client.destroyed) {
  15841. assert(client[kPending] === 0)
  15842. // Fail entire queue.
  15843. const requests = client[kQueue].splice(client[kRunningIdx])
  15844. for (let i = 0; i < requests.length; i++) {
  15845. const request = requests[i]
  15846. errorRequest(client, request, err)
  15847. }
  15848. } else if (client[kRunning] > 0 && err.code !== 'UND_ERR_INFO') {
  15849. // Fail head of pipeline.
  15850. const request = client[kQueue][client[kRunningIdx]]
  15851. client[kQueue][client[kRunningIdx]++] = null
  15852. errorRequest(client, request, err)
  15853. }
  15854. client[kPendingIdx] = client[kRunningIdx]
  15855. assert(client[kRunning] === 0)
  15856. client.emit('disconnect', client[kUrl], [client], err)
  15857. resume(client)
  15858. }
  15859. async function connect (client) {
  15860. assert(!client[kConnecting])
  15861. assert(!client[kSocket])
  15862. let { host, hostname, protocol, port } = client[kUrl]
  15863. // Resolve ipv6
  15864. if (hostname[0] === '[') {
  15865. const idx = hostname.indexOf(']')
  15866. assert(idx !== -1)
  15867. const ip = hostname.substring(1, idx)
  15868. assert(net.isIP(ip))
  15869. hostname = ip
  15870. }
  15871. client[kConnecting] = true
  15872. if (channels.beforeConnect.hasSubscribers) {
  15873. channels.beforeConnect.publish({
  15874. connectParams: {
  15875. host,
  15876. hostname,
  15877. protocol,
  15878. port,
  15879. servername: client[kServerName],
  15880. localAddress: client[kLocalAddress]
  15881. },
  15882. connector: client[kConnector]
  15883. })
  15884. }
  15885. try {
  15886. const socket = await new Promise((resolve, reject) => {
  15887. client[kConnector]({
  15888. host,
  15889. hostname,
  15890. protocol,
  15891. port,
  15892. servername: client[kServerName],
  15893. localAddress: client[kLocalAddress]
  15894. }, (err, socket) => {
  15895. if (err) {
  15896. reject(err)
  15897. } else {
  15898. resolve(socket)
  15899. }
  15900. })
  15901. })
  15902. if (client.destroyed) {
  15903. util.destroy(socket.on('error', () => {}), new ClientDestroyedError())
  15904. return
  15905. }
  15906. client[kConnecting] = false
  15907. assert(socket)
  15908. const isH2 = socket.alpnProtocol === 'h2'
  15909. if (isH2) {
  15910. if (!h2ExperimentalWarned) {
  15911. h2ExperimentalWarned = true
  15912. process.emitWarning('H2 support is experimental, expect them to change at any time.', {
  15913. code: 'UNDICI-H2'
  15914. })
  15915. }
  15916. const session = http2.connect(client[kUrl], {
  15917. createConnection: () => socket,
  15918. peerMaxConcurrentStreams: client[kHTTP2SessionState].maxConcurrentStreams
  15919. })
  15920. client[kHTTPConnVersion] = 'h2'
  15921. session[kClient] = client
  15922. session[kSocket] = socket
  15923. session.on('error', onHttp2SessionError)
  15924. session.on('frameError', onHttp2FrameError)
  15925. session.on('end', onHttp2SessionEnd)
  15926. session.on('goaway', onHTTP2GoAway)
  15927. session.on('close', onSocketClose)
  15928. session.unref()
  15929. client[kHTTP2Session] = session
  15930. socket[kHTTP2Session] = session
  15931. } else {
  15932. if (!llhttpInstance) {
  15933. llhttpInstance = await llhttpPromise
  15934. llhttpPromise = null
  15935. }
  15936. socket[kNoRef] = false
  15937. socket[kWriting] = false
  15938. socket[kReset] = false
  15939. socket[kBlocking] = false
  15940. socket[kParser] = new Parser(client, socket, llhttpInstance)
  15941. }
  15942. socket[kCounter] = 0
  15943. socket[kMaxRequests] = client[kMaxRequests]
  15944. socket[kClient] = client
  15945. socket[kError] = null
  15946. socket
  15947. .on('error', onSocketError)
  15948. .on('readable', onSocketReadable)
  15949. .on('end', onSocketEnd)
  15950. .on('close', onSocketClose)
  15951. client[kSocket] = socket
  15952. if (channels.connected.hasSubscribers) {
  15953. channels.connected.publish({
  15954. connectParams: {
  15955. host,
  15956. hostname,
  15957. protocol,
  15958. port,
  15959. servername: client[kServerName],
  15960. localAddress: client[kLocalAddress]
  15961. },
  15962. connector: client[kConnector],
  15963. socket
  15964. })
  15965. }
  15966. client.emit('connect', client[kUrl], [client])
  15967. } catch (err) {
  15968. if (client.destroyed) {
  15969. return
  15970. }
  15971. client[kConnecting] = false
  15972. if (channels.connectError.hasSubscribers) {
  15973. channels.connectError.publish({
  15974. connectParams: {
  15975. host,
  15976. hostname,
  15977. protocol,
  15978. port,
  15979. servername: client[kServerName],
  15980. localAddress: client[kLocalAddress]
  15981. },
  15982. connector: client[kConnector],
  15983. error: err
  15984. })
  15985. }
  15986. if (err.code === 'ERR_TLS_CERT_ALTNAME_INVALID') {
  15987. assert(client[kRunning] === 0)
  15988. while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) {
  15989. const request = client[kQueue][client[kPendingIdx]++]
  15990. errorRequest(client, request, err)
  15991. }
  15992. } else {
  15993. onError(client, err)
  15994. }
  15995. client.emit('connectionError', client[kUrl], [client], err)
  15996. }
  15997. resume(client)
  15998. }
  15999. function emitDrain (client) {
  16000. client[kNeedDrain] = 0
  16001. client.emit('drain', client[kUrl], [client])
  16002. }
  16003. function resume (client, sync) {
  16004. if (client[kResuming] === 2) {
  16005. return
  16006. }
  16007. client[kResuming] = 2
  16008. _resume(client, sync)
  16009. client[kResuming] = 0
  16010. if (client[kRunningIdx] > 256) {
  16011. client[kQueue].splice(0, client[kRunningIdx])
  16012. client[kPendingIdx] -= client[kRunningIdx]
  16013. client[kRunningIdx] = 0
  16014. }
  16015. }
  16016. function _resume (client, sync) {
  16017. while (true) {
  16018. if (client.destroyed) {
  16019. assert(client[kPending] === 0)
  16020. return
  16021. }
  16022. if (client[kClosedResolve] && !client[kSize]) {
  16023. client[kClosedResolve]()
  16024. client[kClosedResolve] = null
  16025. return
  16026. }
  16027. const socket = client[kSocket]
  16028. if (socket && !socket.destroyed && socket.alpnProtocol !== 'h2') {
  16029. if (client[kSize] === 0) {
  16030. if (!socket[kNoRef] && socket.unref) {
  16031. socket.unref()
  16032. socket[kNoRef] = true
  16033. }
  16034. } else if (socket[kNoRef] && socket.ref) {
  16035. socket.ref()
  16036. socket[kNoRef] = false
  16037. }
  16038. if (client[kSize] === 0) {
  16039. if (socket[kParser].timeoutType !== TIMEOUT_IDLE) {
  16040. socket[kParser].setTimeout(client[kKeepAliveTimeoutValue], TIMEOUT_IDLE)
  16041. }
  16042. } else if (client[kRunning] > 0 && socket[kParser].statusCode < 200) {
  16043. if (socket[kParser].timeoutType !== TIMEOUT_HEADERS) {
  16044. const request = client[kQueue][client[kRunningIdx]]
  16045. const headersTimeout = request.headersTimeout != null
  16046. ? request.headersTimeout
  16047. : client[kHeadersTimeout]
  16048. socket[kParser].setTimeout(headersTimeout, TIMEOUT_HEADERS)
  16049. }
  16050. }
  16051. }
  16052. if (client[kBusy]) {
  16053. client[kNeedDrain] = 2
  16054. } else if (client[kNeedDrain] === 2) {
  16055. if (sync) {
  16056. client[kNeedDrain] = 1
  16057. process.nextTick(emitDrain, client)
  16058. } else {
  16059. emitDrain(client)
  16060. }
  16061. continue
  16062. }
  16063. if (client[kPending] === 0) {
  16064. return
  16065. }
  16066. if (client[kRunning] >= (client[kPipelining] || 1)) {
  16067. return
  16068. }
  16069. const request = client[kQueue][client[kPendingIdx]]
  16070. if (client[kUrl].protocol === 'https:' && client[kServerName] !== request.servername) {
  16071. if (client[kRunning] > 0) {
  16072. return
  16073. }
  16074. client[kServerName] = request.servername
  16075. if (socket && socket.servername !== request.servername) {
  16076. util.destroy(socket, new InformationalError('servername changed'))
  16077. return
  16078. }
  16079. }
  16080. if (client[kConnecting]) {
  16081. return
  16082. }
  16083. if (!socket && !client[kHTTP2Session]) {
  16084. connect(client)
  16085. return
  16086. }
  16087. if (socket.destroyed || socket[kWriting] || socket[kReset] || socket[kBlocking]) {
  16088. return
  16089. }
  16090. if (client[kRunning] > 0 && !request.idempotent) {
  16091. // Non-idempotent request cannot be retried.
  16092. // Ensure that no other requests are inflight and
  16093. // could cause failure.
  16094. return
  16095. }
  16096. if (client[kRunning] > 0 && (request.upgrade || request.method === 'CONNECT')) {
  16097. // Don't dispatch an upgrade until all preceding requests have completed.
  16098. // A misbehaving server might upgrade the connection before all pipelined
  16099. // request has completed.
  16100. return
  16101. }
  16102. if (client[kRunning] > 0 && util.bodyLength(request.body) !== 0 &&
  16103. (util.isStream(request.body) || util.isAsyncIterable(request.body))) {
  16104. // Request with stream or iterator body can error while other requests
  16105. // are inflight and indirectly error those as well.
  16106. // Ensure this doesn't happen by waiting for inflight
  16107. // to complete before dispatching.
  16108. // Request with stream or iterator body cannot be retried.
  16109. // Ensure that no other requests are inflight and
  16110. // could cause failure.
  16111. return
  16112. }
  16113. if (!request.aborted && write(client, request)) {
  16114. client[kPendingIdx]++
  16115. } else {
  16116. client[kQueue].splice(client[kPendingIdx], 1)
  16117. }
  16118. }
  16119. }
  16120. // https://www.rfc-editor.org/rfc/rfc7230#section-3.3.2
  16121. function shouldSendContentLength (method) {
  16122. return method !== 'GET' && method !== 'HEAD' && method !== 'OPTIONS' && method !== 'TRACE' && method !== 'CONNECT'
  16123. }
  16124. function write (client, request) {
  16125. if (client[kHTTPConnVersion] === 'h2') {
  16126. writeH2(client, client[kHTTP2Session], request)
  16127. return
  16128. }
  16129. const { body, method, path, host, upgrade, headers, blocking, reset } = request
  16130. // https://tools.ietf.org/html/rfc7231#section-4.3.1
  16131. // https://tools.ietf.org/html/rfc7231#section-4.3.2
  16132. // https://tools.ietf.org/html/rfc7231#section-4.3.5
  16133. // Sending a payload body on a request that does not
  16134. // expect it can cause undefined behavior on some
  16135. // servers and corrupt connection state. Do not
  16136. // re-use the connection for further requests.
  16137. const expectsPayload = (
  16138. method === 'PUT' ||
  16139. method === 'POST' ||
  16140. method === 'PATCH'
  16141. )
  16142. if (body && typeof body.read === 'function') {
  16143. // Try to read EOF in order to get length.
  16144. body.read(0)
  16145. }
  16146. const bodyLength = util.bodyLength(body)
  16147. let contentLength = bodyLength
  16148. if (contentLength === null) {
  16149. contentLength = request.contentLength
  16150. }
  16151. if (contentLength === 0 && !expectsPayload) {
  16152. // https://tools.ietf.org/html/rfc7230#section-3.3.2
  16153. // A user agent SHOULD NOT send a Content-Length header field when
  16154. // the request message does not contain a payload body and the method
  16155. // semantics do not anticipate such a body.
  16156. contentLength = null
  16157. }
  16158. // https://github.com/nodejs/undici/issues/2046
  16159. // A user agent may send a Content-Length header with 0 value, this should be allowed.
  16160. if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength !== null && request.contentLength !== contentLength) {
  16161. if (client[kStrictContentLength]) {
  16162. errorRequest(client, request, new RequestContentLengthMismatchError())
  16163. return false
  16164. }
  16165. process.emitWarning(new RequestContentLengthMismatchError())
  16166. }
  16167. const socket = client[kSocket]
  16168. try {
  16169. request.onConnect((err) => {
  16170. if (request.aborted || request.completed) {
  16171. return
  16172. }
  16173. errorRequest(client, request, err || new RequestAbortedError())
  16174. util.destroy(socket, new InformationalError('aborted'))
  16175. })
  16176. } catch (err) {
  16177. errorRequest(client, request, err)
  16178. }
  16179. if (request.aborted) {
  16180. return false
  16181. }
  16182. if (method === 'HEAD') {
  16183. // https://github.com/mcollina/undici/issues/258
  16184. // Close after a HEAD request to interop with misbehaving servers
  16185. // that may send a body in the response.
  16186. socket[kReset] = true
  16187. }
  16188. if (upgrade || method === 'CONNECT') {
  16189. // On CONNECT or upgrade, block pipeline from dispatching further
  16190. // requests on this connection.
  16191. socket[kReset] = true
  16192. }
  16193. if (reset != null) {
  16194. socket[kReset] = reset
  16195. }
  16196. if (client[kMaxRequests] && socket[kCounter]++ >= client[kMaxRequests]) {
  16197. socket[kReset] = true
  16198. }
  16199. if (blocking) {
  16200. socket[kBlocking] = true
  16201. }
  16202. let header = `${method} ${path} HTTP/1.1\r\n`
  16203. if (typeof host === 'string') {
  16204. header += `host: ${host}\r\n`
  16205. } else {
  16206. header += client[kHostHeader]
  16207. }
  16208. if (upgrade) {
  16209. header += `connection: upgrade\r\nupgrade: ${upgrade}\r\n`
  16210. } else if (client[kPipelining] && !socket[kReset]) {
  16211. header += 'connection: keep-alive\r\n'
  16212. } else {
  16213. header += 'connection: close\r\n'
  16214. }
  16215. if (headers) {
  16216. header += headers
  16217. }
  16218. if (channels.sendHeaders.hasSubscribers) {
  16219. channels.sendHeaders.publish({ request, headers: header, socket })
  16220. }
  16221. /* istanbul ignore else: assertion */
  16222. if (!body || bodyLength === 0) {
  16223. if (contentLength === 0) {
  16224. socket.write(`${header}content-length: 0\r\n\r\n`, 'latin1')
  16225. } else {
  16226. assert(contentLength === null, 'no body must not have content length')
  16227. socket.write(`${header}\r\n`, 'latin1')
  16228. }
  16229. request.onRequestSent()
  16230. } else if (util.isBuffer(body)) {
  16231. assert(contentLength === body.byteLength, 'buffer body must have content length')
  16232. socket.cork()
  16233. socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1')
  16234. socket.write(body)
  16235. socket.uncork()
  16236. request.onBodySent(body)
  16237. request.onRequestSent()
  16238. if (!expectsPayload) {
  16239. socket[kReset] = true
  16240. }
  16241. } else if (util.isBlobLike(body)) {
  16242. if (typeof body.stream === 'function') {
  16243. writeIterable({ body: body.stream(), client, request, socket, contentLength, header, expectsPayload })
  16244. } else {
  16245. writeBlob({ body, client, request, socket, contentLength, header, expectsPayload })
  16246. }
  16247. } else if (util.isStream(body)) {
  16248. writeStream({ body, client, request, socket, contentLength, header, expectsPayload })
  16249. } else if (util.isIterable(body)) {
  16250. writeIterable({ body, client, request, socket, contentLength, header, expectsPayload })
  16251. } else {
  16252. assert(false)
  16253. }
  16254. return true
  16255. }
  16256. function writeH2 (client, session, request) {
  16257. const { body, method, path, host, upgrade, expectContinue, signal, headers: reqHeaders } = request
  16258. let headers
  16259. if (typeof reqHeaders === 'string') headers = Request[kHTTP2CopyHeaders](reqHeaders.trim())
  16260. else headers = reqHeaders
  16261. if (upgrade) {
  16262. errorRequest(client, request, new Error('Upgrade not supported for H2'))
  16263. return false
  16264. }
  16265. try {
  16266. // TODO(HTTP/2): Should we call onConnect immediately or on stream ready event?
  16267. request.onConnect((err) => {
  16268. if (request.aborted || request.completed) {
  16269. return
  16270. }
  16271. errorRequest(client, request, err || new RequestAbortedError())
  16272. })
  16273. } catch (err) {
  16274. errorRequest(client, request, err)
  16275. }
  16276. if (request.aborted) {
  16277. return false
  16278. }
  16279. /** @type {import('node:http2').ClientHttp2Stream} */
  16280. let stream
  16281. const h2State = client[kHTTP2SessionState]
  16282. headers[HTTP2_HEADER_AUTHORITY] = host || client[kHost]
  16283. headers[HTTP2_HEADER_METHOD] = method
  16284. if (method === 'CONNECT') {
  16285. session.ref()
  16286. // we are already connected, streams are pending, first request
  16287. // will create a new stream. We trigger a request to create the stream and wait until
  16288. // `ready` event is triggered
  16289. // We disabled endStream to allow the user to write to the stream
  16290. stream = session.request(headers, { endStream: false, signal })
  16291. if (stream.id && !stream.pending) {
  16292. request.onUpgrade(null, null, stream)
  16293. ++h2State.openStreams
  16294. } else {
  16295. stream.once('ready', () => {
  16296. request.onUpgrade(null, null, stream)
  16297. ++h2State.openStreams
  16298. })
  16299. }
  16300. stream.once('close', () => {
  16301. h2State.openStreams -= 1
  16302. // TODO(HTTP/2): unref only if current streams count is 0
  16303. if (h2State.openStreams === 0) session.unref()
  16304. })
  16305. return true
  16306. }
  16307. // https://tools.ietf.org/html/rfc7540#section-8.3
  16308. // :path and :scheme headers must be omited when sending CONNECT
  16309. headers[HTTP2_HEADER_PATH] = path
  16310. headers[HTTP2_HEADER_SCHEME] = 'https'
  16311. // https://tools.ietf.org/html/rfc7231#section-4.3.1
  16312. // https://tools.ietf.org/html/rfc7231#section-4.3.2
  16313. // https://tools.ietf.org/html/rfc7231#section-4.3.5
  16314. // Sending a payload body on a request that does not
  16315. // expect it can cause undefined behavior on some
  16316. // servers and corrupt connection state. Do not
  16317. // re-use the connection for further requests.
  16318. const expectsPayload = (
  16319. method === 'PUT' ||
  16320. method === 'POST' ||
  16321. method === 'PATCH'
  16322. )
  16323. if (body && typeof body.read === 'function') {
  16324. // Try to read EOF in order to get length.
  16325. body.read(0)
  16326. }
  16327. let contentLength = util.bodyLength(body)
  16328. if (contentLength == null) {
  16329. contentLength = request.contentLength
  16330. }
  16331. if (contentLength === 0 || !expectsPayload) {
  16332. // https://tools.ietf.org/html/rfc7230#section-3.3.2
  16333. // A user agent SHOULD NOT send a Content-Length header field when
  16334. // the request message does not contain a payload body and the method
  16335. // semantics do not anticipate such a body.
  16336. contentLength = null
  16337. }
  16338. // https://github.com/nodejs/undici/issues/2046
  16339. // A user agent may send a Content-Length header with 0 value, this should be allowed.
  16340. if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength != null && request.contentLength !== contentLength) {
  16341. if (client[kStrictContentLength]) {
  16342. errorRequest(client, request, new RequestContentLengthMismatchError())
  16343. return false
  16344. }
  16345. process.emitWarning(new RequestContentLengthMismatchError())
  16346. }
  16347. if (contentLength != null) {
  16348. assert(body, 'no body must not have content length')
  16349. headers[HTTP2_HEADER_CONTENT_LENGTH] = `${contentLength}`
  16350. }
  16351. session.ref()
  16352. const shouldEndStream = method === 'GET' || method === 'HEAD'
  16353. if (expectContinue) {
  16354. headers[HTTP2_HEADER_EXPECT] = '100-continue'
  16355. stream = session.request(headers, { endStream: shouldEndStream, signal })
  16356. stream.once('continue', writeBodyH2)
  16357. } else {
  16358. stream = session.request(headers, {
  16359. endStream: shouldEndStream,
  16360. signal
  16361. })
  16362. writeBodyH2()
  16363. }
  16364. // Increment counter as we have new several streams open
  16365. ++h2State.openStreams
  16366. stream.once('response', headers => {
  16367. const { [HTTP2_HEADER_STATUS]: statusCode, ...realHeaders } = headers
  16368. if (request.onHeaders(Number(statusCode), realHeaders, stream.resume.bind(stream), '') === false) {
  16369. stream.pause()
  16370. }
  16371. })
  16372. stream.once('end', () => {
  16373. request.onComplete([])
  16374. })
  16375. stream.on('data', (chunk) => {
  16376. if (request.onData(chunk) === false) {
  16377. stream.pause()
  16378. }
  16379. })
  16380. stream.once('close', () => {
  16381. h2State.openStreams -= 1
  16382. // TODO(HTTP/2): unref only if current streams count is 0
  16383. if (h2State.openStreams === 0) {
  16384. session.unref()
  16385. }
  16386. })
  16387. stream.once('error', function (err) {
  16388. if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) {
  16389. h2State.streams -= 1
  16390. util.destroy(stream, err)
  16391. }
  16392. })
  16393. stream.once('frameError', (type, code) => {
  16394. const err = new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`)
  16395. errorRequest(client, request, err)
  16396. if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) {
  16397. h2State.streams -= 1
  16398. util.destroy(stream, err)
  16399. }
  16400. })
  16401. // stream.on('aborted', () => {
  16402. // // TODO(HTTP/2): Support aborted
  16403. // })
  16404. // stream.on('timeout', () => {
  16405. // // TODO(HTTP/2): Support timeout
  16406. // })
  16407. // stream.on('push', headers => {
  16408. // // TODO(HTTP/2): Suppor push
  16409. // })
  16410. // stream.on('trailers', headers => {
  16411. // // TODO(HTTP/2): Support trailers
  16412. // })
  16413. return true
  16414. function writeBodyH2 () {
  16415. /* istanbul ignore else: assertion */
  16416. if (!body) {
  16417. request.onRequestSent()
  16418. } else if (util.isBuffer(body)) {
  16419. assert(contentLength === body.byteLength, 'buffer body must have content length')
  16420. stream.cork()
  16421. stream.write(body)
  16422. stream.uncork()
  16423. stream.end()
  16424. request.onBodySent(body)
  16425. request.onRequestSent()
  16426. } else if (util.isBlobLike(body)) {
  16427. if (typeof body.stream === 'function') {
  16428. writeIterable({
  16429. client,
  16430. request,
  16431. contentLength,
  16432. h2stream: stream,
  16433. expectsPayload,
  16434. body: body.stream(),
  16435. socket: client[kSocket],
  16436. header: ''
  16437. })
  16438. } else {
  16439. writeBlob({
  16440. body,
  16441. client,
  16442. request,
  16443. contentLength,
  16444. expectsPayload,
  16445. h2stream: stream,
  16446. header: '',
  16447. socket: client[kSocket]
  16448. })
  16449. }
  16450. } else if (util.isStream(body)) {
  16451. writeStream({
  16452. body,
  16453. client,
  16454. request,
  16455. contentLength,
  16456. expectsPayload,
  16457. socket: client[kSocket],
  16458. h2stream: stream,
  16459. header: ''
  16460. })
  16461. } else if (util.isIterable(body)) {
  16462. writeIterable({
  16463. body,
  16464. client,
  16465. request,
  16466. contentLength,
  16467. expectsPayload,
  16468. header: '',
  16469. h2stream: stream,
  16470. socket: client[kSocket]
  16471. })
  16472. } else {
  16473. assert(false)
  16474. }
  16475. }
  16476. }
  16477. function writeStream ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) {
  16478. assert(contentLength !== 0 || client[kRunning] === 0, 'stream body cannot be pipelined')
  16479. if (client[kHTTPConnVersion] === 'h2') {
  16480. // For HTTP/2, is enough to pipe the stream
  16481. const pipe = pipeline(
  16482. body,
  16483. h2stream,
  16484. (err) => {
  16485. if (err) {
  16486. util.destroy(body, err)
  16487. util.destroy(h2stream, err)
  16488. } else {
  16489. request.onRequestSent()
  16490. }
  16491. }
  16492. )
  16493. pipe.on('data', onPipeData)
  16494. pipe.once('end', () => {
  16495. pipe.removeListener('data', onPipeData)
  16496. util.destroy(pipe)
  16497. })
  16498. function onPipeData (chunk) {
  16499. request.onBodySent(chunk)
  16500. }
  16501. return
  16502. }
  16503. let finished = false
  16504. const writer = new AsyncWriter({ socket, request, contentLength, client, expectsPayload, header })
  16505. const onData = function (chunk) {
  16506. if (finished) {
  16507. return
  16508. }
  16509. try {
  16510. if (!writer.write(chunk) && this.pause) {
  16511. this.pause()
  16512. }
  16513. } catch (err) {
  16514. util.destroy(this, err)
  16515. }
  16516. }
  16517. const onDrain = function () {
  16518. if (finished) {
  16519. return
  16520. }
  16521. if (body.resume) {
  16522. body.resume()
  16523. }
  16524. }
  16525. const onAbort = function () {
  16526. if (finished) {
  16527. return
  16528. }
  16529. const err = new RequestAbortedError()
  16530. queueMicrotask(() => onFinished(err))
  16531. }
  16532. const onFinished = function (err) {
  16533. if (finished) {
  16534. return
  16535. }
  16536. finished = true
  16537. assert(socket.destroyed || (socket[kWriting] && client[kRunning] <= 1))
  16538. socket
  16539. .off('drain', onDrain)
  16540. .off('error', onFinished)
  16541. body
  16542. .removeListener('data', onData)
  16543. .removeListener('end', onFinished)
  16544. .removeListener('error', onFinished)
  16545. .removeListener('close', onAbort)
  16546. if (!err) {
  16547. try {
  16548. writer.end()
  16549. } catch (er) {
  16550. err = er
  16551. }
  16552. }
  16553. writer.destroy(err)
  16554. if (err && (err.code !== 'UND_ERR_INFO' || err.message !== 'reset')) {
  16555. util.destroy(body, err)
  16556. } else {
  16557. util.destroy(body)
  16558. }
  16559. }
  16560. body
  16561. .on('data', onData)
  16562. .on('end', onFinished)
  16563. .on('error', onFinished)
  16564. .on('close', onAbort)
  16565. if (body.resume) {
  16566. body.resume()
  16567. }
  16568. socket
  16569. .on('drain', onDrain)
  16570. .on('error', onFinished)
  16571. }
  16572. async function writeBlob ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) {
  16573. assert(contentLength === body.size, 'blob body must have content length')
  16574. const isH2 = client[kHTTPConnVersion] === 'h2'
  16575. try {
  16576. if (contentLength != null && contentLength !== body.size) {
  16577. throw new RequestContentLengthMismatchError()
  16578. }
  16579. const buffer = Buffer.from(await body.arrayBuffer())
  16580. if (isH2) {
  16581. h2stream.cork()
  16582. h2stream.write(buffer)
  16583. h2stream.uncork()
  16584. } else {
  16585. socket.cork()
  16586. socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1')
  16587. socket.write(buffer)
  16588. socket.uncork()
  16589. }
  16590. request.onBodySent(buffer)
  16591. request.onRequestSent()
  16592. if (!expectsPayload) {
  16593. socket[kReset] = true
  16594. }
  16595. resume(client)
  16596. } catch (err) {
  16597. util.destroy(isH2 ? h2stream : socket, err)
  16598. }
  16599. }
  16600. async function writeIterable ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) {
  16601. assert(contentLength !== 0 || client[kRunning] === 0, 'iterator body cannot be pipelined')
  16602. let callback = null
  16603. function onDrain () {
  16604. if (callback) {
  16605. const cb = callback
  16606. callback = null
  16607. cb()
  16608. }
  16609. }
  16610. const waitForDrain = () => new Promise((resolve, reject) => {
  16611. assert(callback === null)
  16612. if (socket[kError]) {
  16613. reject(socket[kError])
  16614. } else {
  16615. callback = resolve
  16616. }
  16617. })
  16618. if (client[kHTTPConnVersion] === 'h2') {
  16619. h2stream
  16620. .on('close', onDrain)
  16621. .on('drain', onDrain)
  16622. try {
  16623. // It's up to the user to somehow abort the async iterable.
  16624. for await (const chunk of body) {
  16625. if (socket[kError]) {
  16626. throw socket[kError]
  16627. }
  16628. const res = h2stream.write(chunk)
  16629. request.onBodySent(chunk)
  16630. if (!res) {
  16631. await waitForDrain()
  16632. }
  16633. }
  16634. } catch (err) {
  16635. h2stream.destroy(err)
  16636. } finally {
  16637. request.onRequestSent()
  16638. h2stream.end()
  16639. h2stream
  16640. .off('close', onDrain)
  16641. .off('drain', onDrain)
  16642. }
  16643. return
  16644. }
  16645. socket
  16646. .on('close', onDrain)
  16647. .on('drain', onDrain)
  16648. const writer = new AsyncWriter({ socket, request, contentLength, client, expectsPayload, header })
  16649. try {
  16650. // It's up to the user to somehow abort the async iterable.
  16651. for await (const chunk of body) {
  16652. if (socket[kError]) {
  16653. throw socket[kError]
  16654. }
  16655. if (!writer.write(chunk)) {
  16656. await waitForDrain()
  16657. }
  16658. }
  16659. writer.end()
  16660. } catch (err) {
  16661. writer.destroy(err)
  16662. } finally {
  16663. socket
  16664. .off('close', onDrain)
  16665. .off('drain', onDrain)
  16666. }
  16667. }
  16668. class AsyncWriter {
  16669. constructor ({ socket, request, contentLength, client, expectsPayload, header }) {
  16670. this.socket = socket
  16671. this.request = request
  16672. this.contentLength = contentLength
  16673. this.client = client
  16674. this.bytesWritten = 0
  16675. this.expectsPayload = expectsPayload
  16676. this.header = header
  16677. socket[kWriting] = true
  16678. }
  16679. write (chunk) {
  16680. const { socket, request, contentLength, client, bytesWritten, expectsPayload, header } = this
  16681. if (socket[kError]) {
  16682. throw socket[kError]
  16683. }
  16684. if (socket.destroyed) {
  16685. return false
  16686. }
  16687. const len = Buffer.byteLength(chunk)
  16688. if (!len) {
  16689. return true
  16690. }
  16691. // We should defer writing chunks.
  16692. if (contentLength !== null && bytesWritten + len > contentLength) {
  16693. if (client[kStrictContentLength]) {
  16694. throw new RequestContentLengthMismatchError()
  16695. }
  16696. process.emitWarning(new RequestContentLengthMismatchError())
  16697. }
  16698. socket.cork()
  16699. if (bytesWritten === 0) {
  16700. if (!expectsPayload) {
  16701. socket[kReset] = true
  16702. }
  16703. if (contentLength === null) {
  16704. socket.write(`${header}transfer-encoding: chunked\r\n`, 'latin1')
  16705. } else {
  16706. socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1')
  16707. }
  16708. }
  16709. if (contentLength === null) {
  16710. socket.write(`\r\n${len.toString(16)}\r\n`, 'latin1')
  16711. }
  16712. this.bytesWritten += len
  16713. const ret = socket.write(chunk)
  16714. socket.uncork()
  16715. request.onBodySent(chunk)
  16716. if (!ret) {
  16717. if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {
  16718. // istanbul ignore else: only for jest
  16719. if (socket[kParser].timeout.refresh) {
  16720. socket[kParser].timeout.refresh()
  16721. }
  16722. }
  16723. }
  16724. return ret
  16725. }
  16726. end () {
  16727. const { socket, contentLength, client, bytesWritten, expectsPayload, header, request } = this
  16728. request.onRequestSent()
  16729. socket[kWriting] = false
  16730. if (socket[kError]) {
  16731. throw socket[kError]
  16732. }
  16733. if (socket.destroyed) {
  16734. return
  16735. }
  16736. if (bytesWritten === 0) {
  16737. if (expectsPayload) {
  16738. // https://tools.ietf.org/html/rfc7230#section-3.3.2
  16739. // A user agent SHOULD send a Content-Length in a request message when
  16740. // no Transfer-Encoding is sent and the request method defines a meaning
  16741. // for an enclosed payload body.
  16742. socket.write(`${header}content-length: 0\r\n\r\n`, 'latin1')
  16743. } else {
  16744. socket.write(`${header}\r\n`, 'latin1')
  16745. }
  16746. } else if (contentLength === null) {
  16747. socket.write('\r\n0\r\n\r\n', 'latin1')
  16748. }
  16749. if (contentLength !== null && bytesWritten !== contentLength) {
  16750. if (client[kStrictContentLength]) {
  16751. throw new RequestContentLengthMismatchError()
  16752. } else {
  16753. process.emitWarning(new RequestContentLengthMismatchError())
  16754. }
  16755. }
  16756. if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {
  16757. // istanbul ignore else: only for jest
  16758. if (socket[kParser].timeout.refresh) {
  16759. socket[kParser].timeout.refresh()
  16760. }
  16761. }
  16762. resume(client)
  16763. }
  16764. destroy (err) {
  16765. const { socket, client } = this
  16766. socket[kWriting] = false
  16767. if (err) {
  16768. assert(client[kRunning] <= 1, 'pipeline should only contain this request')
  16769. util.destroy(socket, err)
  16770. }
  16771. }
  16772. }
  16773. function errorRequest (client, request, err) {
  16774. try {
  16775. request.onError(err)
  16776. assert(request.aborted)
  16777. } catch (err) {
  16778. client.emit('error', err)
  16779. }
  16780. }
  16781. module.exports = Client
  16782. /***/ }),
  16783. /***/ 6436:
  16784. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  16785. "use strict";
  16786. /* istanbul ignore file: only for Node 12 */
  16787. const { kConnected, kSize } = __nccwpck_require__(2785)
  16788. class CompatWeakRef {
  16789. constructor (value) {
  16790. this.value = value
  16791. }
  16792. deref () {
  16793. return this.value[kConnected] === 0 && this.value[kSize] === 0
  16794. ? undefined
  16795. : this.value
  16796. }
  16797. }
  16798. class CompatFinalizer {
  16799. constructor (finalizer) {
  16800. this.finalizer = finalizer
  16801. }
  16802. register (dispatcher, key) {
  16803. if (dispatcher.on) {
  16804. dispatcher.on('disconnect', () => {
  16805. if (dispatcher[kConnected] === 0 && dispatcher[kSize] === 0) {
  16806. this.finalizer(key)
  16807. }
  16808. })
  16809. }
  16810. }
  16811. }
  16812. module.exports = function () {
  16813. // FIXME: remove workaround when the Node bug is fixed
  16814. // https://github.com/nodejs/node/issues/49344#issuecomment-1741776308
  16815. if (process.env.NODE_V8_COVERAGE) {
  16816. return {
  16817. WeakRef: CompatWeakRef,
  16818. FinalizationRegistry: CompatFinalizer
  16819. }
  16820. }
  16821. return {
  16822. WeakRef: global.WeakRef || CompatWeakRef,
  16823. FinalizationRegistry: global.FinalizationRegistry || CompatFinalizer
  16824. }
  16825. }
  16826. /***/ }),
  16827. /***/ 663:
  16828. /***/ ((module) => {
  16829. "use strict";
  16830. // https://wicg.github.io/cookie-store/#cookie-maximum-attribute-value-size
  16831. const maxAttributeValueSize = 1024
  16832. // https://wicg.github.io/cookie-store/#cookie-maximum-name-value-pair-size
  16833. const maxNameValuePairSize = 4096
  16834. module.exports = {
  16835. maxAttributeValueSize,
  16836. maxNameValuePairSize
  16837. }
  16838. /***/ }),
  16839. /***/ 1724:
  16840. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  16841. "use strict";
  16842. const { parseSetCookie } = __nccwpck_require__(4408)
  16843. const { stringify, getHeadersList } = __nccwpck_require__(3121)
  16844. const { webidl } = __nccwpck_require__(1744)
  16845. const { Headers } = __nccwpck_require__(554)
  16846. /**
  16847. * @typedef {Object} Cookie
  16848. * @property {string} name
  16849. * @property {string} value
  16850. * @property {Date|number|undefined} expires
  16851. * @property {number|undefined} maxAge
  16852. * @property {string|undefined} domain
  16853. * @property {string|undefined} path
  16854. * @property {boolean|undefined} secure
  16855. * @property {boolean|undefined} httpOnly
  16856. * @property {'Strict'|'Lax'|'None'} sameSite
  16857. * @property {string[]} unparsed
  16858. */
  16859. /**
  16860. * @param {Headers} headers
  16861. * @returns {Record<string, string>}
  16862. */
  16863. function getCookies (headers) {
  16864. webidl.argumentLengthCheck(arguments, 1, { header: 'getCookies' })
  16865. webidl.brandCheck(headers, Headers, { strict: false })
  16866. const cookie = headers.get('cookie')
  16867. const out = {}
  16868. if (!cookie) {
  16869. return out
  16870. }
  16871. for (const piece of cookie.split(';')) {
  16872. const [name, ...value] = piece.split('=')
  16873. out[name.trim()] = value.join('=')
  16874. }
  16875. return out
  16876. }
  16877. /**
  16878. * @param {Headers} headers
  16879. * @param {string} name
  16880. * @param {{ path?: string, domain?: string }|undefined} attributes
  16881. * @returns {void}
  16882. */
  16883. function deleteCookie (headers, name, attributes) {
  16884. webidl.argumentLengthCheck(arguments, 2, { header: 'deleteCookie' })
  16885. webidl.brandCheck(headers, Headers, { strict: false })
  16886. name = webidl.converters.DOMString(name)
  16887. attributes = webidl.converters.DeleteCookieAttributes(attributes)
  16888. // Matches behavior of
  16889. // https://github.com/denoland/deno_std/blob/63827b16330b82489a04614027c33b7904e08be5/http/cookie.ts#L278
  16890. setCookie(headers, {
  16891. name,
  16892. value: '',
  16893. expires: new Date(0),
  16894. ...attributes
  16895. })
  16896. }
  16897. /**
  16898. * @param {Headers} headers
  16899. * @returns {Cookie[]}
  16900. */
  16901. function getSetCookies (headers) {
  16902. webidl.argumentLengthCheck(arguments, 1, { header: 'getSetCookies' })
  16903. webidl.brandCheck(headers, Headers, { strict: false })
  16904. const cookies = getHeadersList(headers).cookies
  16905. if (!cookies) {
  16906. return []
  16907. }
  16908. // In older versions of undici, cookies is a list of name:value.
  16909. return cookies.map((pair) => parseSetCookie(Array.isArray(pair) ? pair[1] : pair))
  16910. }
  16911. /**
  16912. * @param {Headers} headers
  16913. * @param {Cookie} cookie
  16914. * @returns {void}
  16915. */
  16916. function setCookie (headers, cookie) {
  16917. webidl.argumentLengthCheck(arguments, 2, { header: 'setCookie' })
  16918. webidl.brandCheck(headers, Headers, { strict: false })
  16919. cookie = webidl.converters.Cookie(cookie)
  16920. const str = stringify(cookie)
  16921. if (str) {
  16922. headers.append('Set-Cookie', stringify(cookie))
  16923. }
  16924. }
  16925. webidl.converters.DeleteCookieAttributes = webidl.dictionaryConverter([
  16926. {
  16927. converter: webidl.nullableConverter(webidl.converters.DOMString),
  16928. key: 'path',
  16929. defaultValue: null
  16930. },
  16931. {
  16932. converter: webidl.nullableConverter(webidl.converters.DOMString),
  16933. key: 'domain',
  16934. defaultValue: null
  16935. }
  16936. ])
  16937. webidl.converters.Cookie = webidl.dictionaryConverter([
  16938. {
  16939. converter: webidl.converters.DOMString,
  16940. key: 'name'
  16941. },
  16942. {
  16943. converter: webidl.converters.DOMString,
  16944. key: 'value'
  16945. },
  16946. {
  16947. converter: webidl.nullableConverter((value) => {
  16948. if (typeof value === 'number') {
  16949. return webidl.converters['unsigned long long'](value)
  16950. }
  16951. return new Date(value)
  16952. }),
  16953. key: 'expires',
  16954. defaultValue: null
  16955. },
  16956. {
  16957. converter: webidl.nullableConverter(webidl.converters['long long']),
  16958. key: 'maxAge',
  16959. defaultValue: null
  16960. },
  16961. {
  16962. converter: webidl.nullableConverter(webidl.converters.DOMString),
  16963. key: 'domain',
  16964. defaultValue: null
  16965. },
  16966. {
  16967. converter: webidl.nullableConverter(webidl.converters.DOMString),
  16968. key: 'path',
  16969. defaultValue: null
  16970. },
  16971. {
  16972. converter: webidl.nullableConverter(webidl.converters.boolean),
  16973. key: 'secure',
  16974. defaultValue: null
  16975. },
  16976. {
  16977. converter: webidl.nullableConverter(webidl.converters.boolean),
  16978. key: 'httpOnly',
  16979. defaultValue: null
  16980. },
  16981. {
  16982. converter: webidl.converters.USVString,
  16983. key: 'sameSite',
  16984. allowedValues: ['Strict', 'Lax', 'None']
  16985. },
  16986. {
  16987. converter: webidl.sequenceConverter(webidl.converters.DOMString),
  16988. key: 'unparsed',
  16989. defaultValue: []
  16990. }
  16991. ])
  16992. module.exports = {
  16993. getCookies,
  16994. deleteCookie,
  16995. getSetCookies,
  16996. setCookie
  16997. }
  16998. /***/ }),
  16999. /***/ 4408:
  17000. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  17001. "use strict";
  17002. const { maxNameValuePairSize, maxAttributeValueSize } = __nccwpck_require__(663)
  17003. const { isCTLExcludingHtab } = __nccwpck_require__(3121)
  17004. const { collectASequenceOfCodePointsFast } = __nccwpck_require__(685)
  17005. const assert = __nccwpck_require__(9491)
  17006. /**
  17007. * @description Parses the field-value attributes of a set-cookie header string.
  17008. * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4
  17009. * @param {string} header
  17010. * @returns if the header is invalid, null will be returned
  17011. */
  17012. function parseSetCookie (header) {
  17013. // 1. If the set-cookie-string contains a %x00-08 / %x0A-1F / %x7F
  17014. // character (CTL characters excluding HTAB): Abort these steps and
  17015. // ignore the set-cookie-string entirely.
  17016. if (isCTLExcludingHtab(header)) {
  17017. return null
  17018. }
  17019. let nameValuePair = ''
  17020. let unparsedAttributes = ''
  17021. let name = ''
  17022. let value = ''
  17023. // 2. If the set-cookie-string contains a %x3B (";") character:
  17024. if (header.includes(';')) {
  17025. // 1. The name-value-pair string consists of the characters up to,
  17026. // but not including, the first %x3B (";"), and the unparsed-
  17027. // attributes consist of the remainder of the set-cookie-string
  17028. // (including the %x3B (";") in question).
  17029. const position = { position: 0 }
  17030. nameValuePair = collectASequenceOfCodePointsFast(';', header, position)
  17031. unparsedAttributes = header.slice(position.position)
  17032. } else {
  17033. // Otherwise:
  17034. // 1. The name-value-pair string consists of all the characters
  17035. // contained in the set-cookie-string, and the unparsed-
  17036. // attributes is the empty string.
  17037. nameValuePair = header
  17038. }
  17039. // 3. If the name-value-pair string lacks a %x3D ("=") character, then
  17040. // the name string is empty, and the value string is the value of
  17041. // name-value-pair.
  17042. if (!nameValuePair.includes('=')) {
  17043. value = nameValuePair
  17044. } else {
  17045. // Otherwise, the name string consists of the characters up to, but
  17046. // not including, the first %x3D ("=") character, and the (possibly
  17047. // empty) value string consists of the characters after the first
  17048. // %x3D ("=") character.
  17049. const position = { position: 0 }
  17050. name = collectASequenceOfCodePointsFast(
  17051. '=',
  17052. nameValuePair,
  17053. position
  17054. )
  17055. value = nameValuePair.slice(position.position + 1)
  17056. }
  17057. // 4. Remove any leading or trailing WSP characters from the name
  17058. // string and the value string.
  17059. name = name.trim()
  17060. value = value.trim()
  17061. // 5. If the sum of the lengths of the name string and the value string
  17062. // is more than 4096 octets, abort these steps and ignore the set-
  17063. // cookie-string entirely.
  17064. if (name.length + value.length > maxNameValuePairSize) {
  17065. return null
  17066. }
  17067. // 6. The cookie-name is the name string, and the cookie-value is the
  17068. // value string.
  17069. return {
  17070. name, value, ...parseUnparsedAttributes(unparsedAttributes)
  17071. }
  17072. }
  17073. /**
  17074. * Parses the remaining attributes of a set-cookie header
  17075. * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4
  17076. * @param {string} unparsedAttributes
  17077. * @param {[Object.<string, unknown>]={}} cookieAttributeList
  17078. */
  17079. function parseUnparsedAttributes (unparsedAttributes, cookieAttributeList = {}) {
  17080. // 1. If the unparsed-attributes string is empty, skip the rest of
  17081. // these steps.
  17082. if (unparsedAttributes.length === 0) {
  17083. return cookieAttributeList
  17084. }
  17085. // 2. Discard the first character of the unparsed-attributes (which
  17086. // will be a %x3B (";") character).
  17087. assert(unparsedAttributes[0] === ';')
  17088. unparsedAttributes = unparsedAttributes.slice(1)
  17089. let cookieAv = ''
  17090. // 3. If the remaining unparsed-attributes contains a %x3B (";")
  17091. // character:
  17092. if (unparsedAttributes.includes(';')) {
  17093. // 1. Consume the characters of the unparsed-attributes up to, but
  17094. // not including, the first %x3B (";") character.
  17095. cookieAv = collectASequenceOfCodePointsFast(
  17096. ';',
  17097. unparsedAttributes,
  17098. { position: 0 }
  17099. )
  17100. unparsedAttributes = unparsedAttributes.slice(cookieAv.length)
  17101. } else {
  17102. // Otherwise:
  17103. // 1. Consume the remainder of the unparsed-attributes.
  17104. cookieAv = unparsedAttributes
  17105. unparsedAttributes = ''
  17106. }
  17107. // Let the cookie-av string be the characters consumed in this step.
  17108. let attributeName = ''
  17109. let attributeValue = ''
  17110. // 4. If the cookie-av string contains a %x3D ("=") character:
  17111. if (cookieAv.includes('=')) {
  17112. // 1. The (possibly empty) attribute-name string consists of the
  17113. // characters up to, but not including, the first %x3D ("=")
  17114. // character, and the (possibly empty) attribute-value string
  17115. // consists of the characters after the first %x3D ("=")
  17116. // character.
  17117. const position = { position: 0 }
  17118. attributeName = collectASequenceOfCodePointsFast(
  17119. '=',
  17120. cookieAv,
  17121. position
  17122. )
  17123. attributeValue = cookieAv.slice(position.position + 1)
  17124. } else {
  17125. // Otherwise:
  17126. // 1. The attribute-name string consists of the entire cookie-av
  17127. // string, and the attribute-value string is empty.
  17128. attributeName = cookieAv
  17129. }
  17130. // 5. Remove any leading or trailing WSP characters from the attribute-
  17131. // name string and the attribute-value string.
  17132. attributeName = attributeName.trim()
  17133. attributeValue = attributeValue.trim()
  17134. // 6. If the attribute-value is longer than 1024 octets, ignore the
  17135. // cookie-av string and return to Step 1 of this algorithm.
  17136. if (attributeValue.length > maxAttributeValueSize) {
  17137. return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
  17138. }
  17139. // 7. Process the attribute-name and attribute-value according to the
  17140. // requirements in the following subsections. (Notice that
  17141. // attributes with unrecognized attribute-names are ignored.)
  17142. const attributeNameLowercase = attributeName.toLowerCase()
  17143. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.1
  17144. // If the attribute-name case-insensitively matches the string
  17145. // "Expires", the user agent MUST process the cookie-av as follows.
  17146. if (attributeNameLowercase === 'expires') {
  17147. // 1. Let the expiry-time be the result of parsing the attribute-value
  17148. // as cookie-date (see Section 5.1.1).
  17149. const expiryTime = new Date(attributeValue)
  17150. // 2. If the attribute-value failed to parse as a cookie date, ignore
  17151. // the cookie-av.
  17152. cookieAttributeList.expires = expiryTime
  17153. } else if (attributeNameLowercase === 'max-age') {
  17154. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.2
  17155. // If the attribute-name case-insensitively matches the string "Max-
  17156. // Age", the user agent MUST process the cookie-av as follows.
  17157. // 1. If the first character of the attribute-value is not a DIGIT or a
  17158. // "-" character, ignore the cookie-av.
  17159. const charCode = attributeValue.charCodeAt(0)
  17160. if ((charCode < 48 || charCode > 57) && attributeValue[0] !== '-') {
  17161. return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
  17162. }
  17163. // 2. If the remainder of attribute-value contains a non-DIGIT
  17164. // character, ignore the cookie-av.
  17165. if (!/^\d+$/.test(attributeValue)) {
  17166. return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
  17167. }
  17168. // 3. Let delta-seconds be the attribute-value converted to an integer.
  17169. const deltaSeconds = Number(attributeValue)
  17170. // 4. Let cookie-age-limit be the maximum age of the cookie (which
  17171. // SHOULD be 400 days or less, see Section 4.1.2.2).
  17172. // 5. Set delta-seconds to the smaller of its present value and cookie-
  17173. // age-limit.
  17174. // deltaSeconds = Math.min(deltaSeconds * 1000, maxExpiresMs)
  17175. // 6. If delta-seconds is less than or equal to zero (0), let expiry-
  17176. // time be the earliest representable date and time. Otherwise, let
  17177. // the expiry-time be the current date and time plus delta-seconds
  17178. // seconds.
  17179. // const expiryTime = deltaSeconds <= 0 ? Date.now() : Date.now() + deltaSeconds
  17180. // 7. Append an attribute to the cookie-attribute-list with an
  17181. // attribute-name of Max-Age and an attribute-value of expiry-time.
  17182. cookieAttributeList.maxAge = deltaSeconds
  17183. } else if (attributeNameLowercase === 'domain') {
  17184. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.3
  17185. // If the attribute-name case-insensitively matches the string "Domain",
  17186. // the user agent MUST process the cookie-av as follows.
  17187. // 1. Let cookie-domain be the attribute-value.
  17188. let cookieDomain = attributeValue
  17189. // 2. If cookie-domain starts with %x2E ("."), let cookie-domain be
  17190. // cookie-domain without its leading %x2E (".").
  17191. if (cookieDomain[0] === '.') {
  17192. cookieDomain = cookieDomain.slice(1)
  17193. }
  17194. // 3. Convert the cookie-domain to lower case.
  17195. cookieDomain = cookieDomain.toLowerCase()
  17196. // 4. Append an attribute to the cookie-attribute-list with an
  17197. // attribute-name of Domain and an attribute-value of cookie-domain.
  17198. cookieAttributeList.domain = cookieDomain
  17199. } else if (attributeNameLowercase === 'path') {
  17200. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.4
  17201. // If the attribute-name case-insensitively matches the string "Path",
  17202. // the user agent MUST process the cookie-av as follows.
  17203. // 1. If the attribute-value is empty or if the first character of the
  17204. // attribute-value is not %x2F ("/"):
  17205. let cookiePath = ''
  17206. if (attributeValue.length === 0 || attributeValue[0] !== '/') {
  17207. // 1. Let cookie-path be the default-path.
  17208. cookiePath = '/'
  17209. } else {
  17210. // Otherwise:
  17211. // 1. Let cookie-path be the attribute-value.
  17212. cookiePath = attributeValue
  17213. }
  17214. // 2. Append an attribute to the cookie-attribute-list with an
  17215. // attribute-name of Path and an attribute-value of cookie-path.
  17216. cookieAttributeList.path = cookiePath
  17217. } else if (attributeNameLowercase === 'secure') {
  17218. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.5
  17219. // If the attribute-name case-insensitively matches the string "Secure",
  17220. // the user agent MUST append an attribute to the cookie-attribute-list
  17221. // with an attribute-name of Secure and an empty attribute-value.
  17222. cookieAttributeList.secure = true
  17223. } else if (attributeNameLowercase === 'httponly') {
  17224. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.6
  17225. // If the attribute-name case-insensitively matches the string
  17226. // "HttpOnly", the user agent MUST append an attribute to the cookie-
  17227. // attribute-list with an attribute-name of HttpOnly and an empty
  17228. // attribute-value.
  17229. cookieAttributeList.httpOnly = true
  17230. } else if (attributeNameLowercase === 'samesite') {
  17231. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.7
  17232. // If the attribute-name case-insensitively matches the string
  17233. // "SameSite", the user agent MUST process the cookie-av as follows:
  17234. // 1. Let enforcement be "Default".
  17235. let enforcement = 'Default'
  17236. const attributeValueLowercase = attributeValue.toLowerCase()
  17237. // 2. If cookie-av's attribute-value is a case-insensitive match for
  17238. // "None", set enforcement to "None".
  17239. if (attributeValueLowercase.includes('none')) {
  17240. enforcement = 'None'
  17241. }
  17242. // 3. If cookie-av's attribute-value is a case-insensitive match for
  17243. // "Strict", set enforcement to "Strict".
  17244. if (attributeValueLowercase.includes('strict')) {
  17245. enforcement = 'Strict'
  17246. }
  17247. // 4. If cookie-av's attribute-value is a case-insensitive match for
  17248. // "Lax", set enforcement to "Lax".
  17249. if (attributeValueLowercase.includes('lax')) {
  17250. enforcement = 'Lax'
  17251. }
  17252. // 5. Append an attribute to the cookie-attribute-list with an
  17253. // attribute-name of "SameSite" and an attribute-value of
  17254. // enforcement.
  17255. cookieAttributeList.sameSite = enforcement
  17256. } else {
  17257. cookieAttributeList.unparsed ??= []
  17258. cookieAttributeList.unparsed.push(`${attributeName}=${attributeValue}`)
  17259. }
  17260. // 8. Return to Step 1 of this algorithm.
  17261. return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
  17262. }
  17263. module.exports = {
  17264. parseSetCookie,
  17265. parseUnparsedAttributes
  17266. }
  17267. /***/ }),
  17268. /***/ 3121:
  17269. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  17270. "use strict";
  17271. const assert = __nccwpck_require__(9491)
  17272. const { kHeadersList } = __nccwpck_require__(2785)
  17273. function isCTLExcludingHtab (value) {
  17274. if (value.length === 0) {
  17275. return false
  17276. }
  17277. for (const char of value) {
  17278. const code = char.charCodeAt(0)
  17279. if (
  17280. (code >= 0x00 || code <= 0x08) ||
  17281. (code >= 0x0A || code <= 0x1F) ||
  17282. code === 0x7F
  17283. ) {
  17284. return false
  17285. }
  17286. }
  17287. }
  17288. /**
  17289. CHAR = <any US-ASCII character (octets 0 - 127)>
  17290. token = 1*<any CHAR except CTLs or separators>
  17291. separators = "(" | ")" | "<" | ">" | "@"
  17292. | "," | ";" | ":" | "\" | <">
  17293. | "/" | "[" | "]" | "?" | "="
  17294. | "{" | "}" | SP | HT
  17295. * @param {string} name
  17296. */
  17297. function validateCookieName (name) {
  17298. for (const char of name) {
  17299. const code = char.charCodeAt(0)
  17300. if (
  17301. (code <= 0x20 || code > 0x7F) ||
  17302. char === '(' ||
  17303. char === ')' ||
  17304. char === '>' ||
  17305. char === '<' ||
  17306. char === '@' ||
  17307. char === ',' ||
  17308. char === ';' ||
  17309. char === ':' ||
  17310. char === '\\' ||
  17311. char === '"' ||
  17312. char === '/' ||
  17313. char === '[' ||
  17314. char === ']' ||
  17315. char === '?' ||
  17316. char === '=' ||
  17317. char === '{' ||
  17318. char === '}'
  17319. ) {
  17320. throw new Error('Invalid cookie name')
  17321. }
  17322. }
  17323. }
  17324. /**
  17325. cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE )
  17326. cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E
  17327. ; US-ASCII characters excluding CTLs,
  17328. ; whitespace DQUOTE, comma, semicolon,
  17329. ; and backslash
  17330. * @param {string} value
  17331. */
  17332. function validateCookieValue (value) {
  17333. for (const char of value) {
  17334. const code = char.charCodeAt(0)
  17335. if (
  17336. code < 0x21 || // exclude CTLs (0-31)
  17337. code === 0x22 ||
  17338. code === 0x2C ||
  17339. code === 0x3B ||
  17340. code === 0x5C ||
  17341. code > 0x7E // non-ascii
  17342. ) {
  17343. throw new Error('Invalid header value')
  17344. }
  17345. }
  17346. }
  17347. /**
  17348. * path-value = <any CHAR except CTLs or ";">
  17349. * @param {string} path
  17350. */
  17351. function validateCookiePath (path) {
  17352. for (const char of path) {
  17353. const code = char.charCodeAt(0)
  17354. if (code < 0x21 || char === ';') {
  17355. throw new Error('Invalid cookie path')
  17356. }
  17357. }
  17358. }
  17359. /**
  17360. * I have no idea why these values aren't allowed to be honest,
  17361. * but Deno tests these. - Khafra
  17362. * @param {string} domain
  17363. */
  17364. function validateCookieDomain (domain) {
  17365. if (
  17366. domain.startsWith('-') ||
  17367. domain.endsWith('.') ||
  17368. domain.endsWith('-')
  17369. ) {
  17370. throw new Error('Invalid cookie domain')
  17371. }
  17372. }
  17373. /**
  17374. * @see https://www.rfc-editor.org/rfc/rfc7231#section-7.1.1.1
  17375. * @param {number|Date} date
  17376. IMF-fixdate = day-name "," SP date1 SP time-of-day SP GMT
  17377. ; fixed length/zone/capitalization subset of the format
  17378. ; see Section 3.3 of [RFC5322]
  17379. day-name = %x4D.6F.6E ; "Mon", case-sensitive
  17380. / %x54.75.65 ; "Tue", case-sensitive
  17381. / %x57.65.64 ; "Wed", case-sensitive
  17382. / %x54.68.75 ; "Thu", case-sensitive
  17383. / %x46.72.69 ; "Fri", case-sensitive
  17384. / %x53.61.74 ; "Sat", case-sensitive
  17385. / %x53.75.6E ; "Sun", case-sensitive
  17386. date1 = day SP month SP year
  17387. ; e.g., 02 Jun 1982
  17388. day = 2DIGIT
  17389. month = %x4A.61.6E ; "Jan", case-sensitive
  17390. / %x46.65.62 ; "Feb", case-sensitive
  17391. / %x4D.61.72 ; "Mar", case-sensitive
  17392. / %x41.70.72 ; "Apr", case-sensitive
  17393. / %x4D.61.79 ; "May", case-sensitive
  17394. / %x4A.75.6E ; "Jun", case-sensitive
  17395. / %x4A.75.6C ; "Jul", case-sensitive
  17396. / %x41.75.67 ; "Aug", case-sensitive
  17397. / %x53.65.70 ; "Sep", case-sensitive
  17398. / %x4F.63.74 ; "Oct", case-sensitive
  17399. / %x4E.6F.76 ; "Nov", case-sensitive
  17400. / %x44.65.63 ; "Dec", case-sensitive
  17401. year = 4DIGIT
  17402. GMT = %x47.4D.54 ; "GMT", case-sensitive
  17403. time-of-day = hour ":" minute ":" second
  17404. ; 00:00:00 - 23:59:60 (leap second)
  17405. hour = 2DIGIT
  17406. minute = 2DIGIT
  17407. second = 2DIGIT
  17408. */
  17409. function toIMFDate (date) {
  17410. if (typeof date === 'number') {
  17411. date = new Date(date)
  17412. }
  17413. const days = [
  17414. 'Sun', 'Mon', 'Tue', 'Wed',
  17415. 'Thu', 'Fri', 'Sat'
  17416. ]
  17417. const months = [
  17418. 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
  17419. 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'
  17420. ]
  17421. const dayName = days[date.getUTCDay()]
  17422. const day = date.getUTCDate().toString().padStart(2, '0')
  17423. const month = months[date.getUTCMonth()]
  17424. const year = date.getUTCFullYear()
  17425. const hour = date.getUTCHours().toString().padStart(2, '0')
  17426. const minute = date.getUTCMinutes().toString().padStart(2, '0')
  17427. const second = date.getUTCSeconds().toString().padStart(2, '0')
  17428. return `${dayName}, ${day} ${month} ${year} ${hour}:${minute}:${second} GMT`
  17429. }
  17430. /**
  17431. max-age-av = "Max-Age=" non-zero-digit *DIGIT
  17432. ; In practice, both expires-av and max-age-av
  17433. ; are limited to dates representable by the
  17434. ; user agent.
  17435. * @param {number} maxAge
  17436. */
  17437. function validateCookieMaxAge (maxAge) {
  17438. if (maxAge < 0) {
  17439. throw new Error('Invalid cookie max-age')
  17440. }
  17441. }
  17442. /**
  17443. * @see https://www.rfc-editor.org/rfc/rfc6265#section-4.1.1
  17444. * @param {import('./index').Cookie} cookie
  17445. */
  17446. function stringify (cookie) {
  17447. if (cookie.name.length === 0) {
  17448. return null
  17449. }
  17450. validateCookieName(cookie.name)
  17451. validateCookieValue(cookie.value)
  17452. const out = [`${cookie.name}=${cookie.value}`]
  17453. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.1
  17454. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.2
  17455. if (cookie.name.startsWith('__Secure-')) {
  17456. cookie.secure = true
  17457. }
  17458. if (cookie.name.startsWith('__Host-')) {
  17459. cookie.secure = true
  17460. cookie.domain = null
  17461. cookie.path = '/'
  17462. }
  17463. if (cookie.secure) {
  17464. out.push('Secure')
  17465. }
  17466. if (cookie.httpOnly) {
  17467. out.push('HttpOnly')
  17468. }
  17469. if (typeof cookie.maxAge === 'number') {
  17470. validateCookieMaxAge(cookie.maxAge)
  17471. out.push(`Max-Age=${cookie.maxAge}`)
  17472. }
  17473. if (cookie.domain) {
  17474. validateCookieDomain(cookie.domain)
  17475. out.push(`Domain=${cookie.domain}`)
  17476. }
  17477. if (cookie.path) {
  17478. validateCookiePath(cookie.path)
  17479. out.push(`Path=${cookie.path}`)
  17480. }
  17481. if (cookie.expires && cookie.expires.toString() !== 'Invalid Date') {
  17482. out.push(`Expires=${toIMFDate(cookie.expires)}`)
  17483. }
  17484. if (cookie.sameSite) {
  17485. out.push(`SameSite=${cookie.sameSite}`)
  17486. }
  17487. for (const part of cookie.unparsed) {
  17488. if (!part.includes('=')) {
  17489. throw new Error('Invalid unparsed')
  17490. }
  17491. const [key, ...value] = part.split('=')
  17492. out.push(`${key.trim()}=${value.join('=')}`)
  17493. }
  17494. return out.join('; ')
  17495. }
  17496. let kHeadersListNode
  17497. function getHeadersList (headers) {
  17498. if (headers[kHeadersList]) {
  17499. return headers[kHeadersList]
  17500. }
  17501. if (!kHeadersListNode) {
  17502. kHeadersListNode = Object.getOwnPropertySymbols(headers).find(
  17503. (symbol) => symbol.description === 'headers list'
  17504. )
  17505. assert(kHeadersListNode, 'Headers cannot be parsed')
  17506. }
  17507. const headersList = headers[kHeadersListNode]
  17508. assert(headersList)
  17509. return headersList
  17510. }
  17511. module.exports = {
  17512. isCTLExcludingHtab,
  17513. stringify,
  17514. getHeadersList
  17515. }
  17516. /***/ }),
  17517. /***/ 2067:
  17518. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  17519. "use strict";
  17520. const net = __nccwpck_require__(1808)
  17521. const assert = __nccwpck_require__(9491)
  17522. const util = __nccwpck_require__(3983)
  17523. const { InvalidArgumentError, ConnectTimeoutError } = __nccwpck_require__(8045)
  17524. let tls // include tls conditionally since it is not always available
  17525. // TODO: session re-use does not wait for the first
  17526. // connection to resolve the session and might therefore
  17527. // resolve the same servername multiple times even when
  17528. // re-use is enabled.
  17529. let SessionCache
  17530. // FIXME: remove workaround when the Node bug is fixed
  17531. // https://github.com/nodejs/node/issues/49344#issuecomment-1741776308
  17532. if (global.FinalizationRegistry && !process.env.NODE_V8_COVERAGE) {
  17533. SessionCache = class WeakSessionCache {
  17534. constructor (maxCachedSessions) {
  17535. this._maxCachedSessions = maxCachedSessions
  17536. this._sessionCache = new Map()
  17537. this._sessionRegistry = new global.FinalizationRegistry((key) => {
  17538. if (this._sessionCache.size < this._maxCachedSessions) {
  17539. return
  17540. }
  17541. const ref = this._sessionCache.get(key)
  17542. if (ref !== undefined && ref.deref() === undefined) {
  17543. this._sessionCache.delete(key)
  17544. }
  17545. })
  17546. }
  17547. get (sessionKey) {
  17548. const ref = this._sessionCache.get(sessionKey)
  17549. return ref ? ref.deref() : null
  17550. }
  17551. set (sessionKey, session) {
  17552. if (this._maxCachedSessions === 0) {
  17553. return
  17554. }
  17555. this._sessionCache.set(sessionKey, new WeakRef(session))
  17556. this._sessionRegistry.register(session, sessionKey)
  17557. }
  17558. }
  17559. } else {
  17560. SessionCache = class SimpleSessionCache {
  17561. constructor (maxCachedSessions) {
  17562. this._maxCachedSessions = maxCachedSessions
  17563. this._sessionCache = new Map()
  17564. }
  17565. get (sessionKey) {
  17566. return this._sessionCache.get(sessionKey)
  17567. }
  17568. set (sessionKey, session) {
  17569. if (this._maxCachedSessions === 0) {
  17570. return
  17571. }
  17572. if (this._sessionCache.size >= this._maxCachedSessions) {
  17573. // remove the oldest session
  17574. const { value: oldestKey } = this._sessionCache.keys().next()
  17575. this._sessionCache.delete(oldestKey)
  17576. }
  17577. this._sessionCache.set(sessionKey, session)
  17578. }
  17579. }
  17580. }
  17581. function buildConnector ({ allowH2, maxCachedSessions, socketPath, timeout, ...opts }) {
  17582. if (maxCachedSessions != null && (!Number.isInteger(maxCachedSessions) || maxCachedSessions < 0)) {
  17583. throw new InvalidArgumentError('maxCachedSessions must be a positive integer or zero')
  17584. }
  17585. const options = { path: socketPath, ...opts }
  17586. const sessionCache = new SessionCache(maxCachedSessions == null ? 100 : maxCachedSessions)
  17587. timeout = timeout == null ? 10e3 : timeout
  17588. allowH2 = allowH2 != null ? allowH2 : false
  17589. return function connect ({ hostname, host, protocol, port, servername, localAddress, httpSocket }, callback) {
  17590. let socket
  17591. if (protocol === 'https:') {
  17592. if (!tls) {
  17593. tls = __nccwpck_require__(4404)
  17594. }
  17595. servername = servername || options.servername || util.getServerName(host) || null
  17596. const sessionKey = servername || hostname
  17597. const session = sessionCache.get(sessionKey) || null
  17598. assert(sessionKey)
  17599. socket = tls.connect({
  17600. highWaterMark: 16384, // TLS in node can't have bigger HWM anyway...
  17601. ...options,
  17602. servername,
  17603. session,
  17604. localAddress,
  17605. // TODO(HTTP/2): Add support for h2c
  17606. ALPNProtocols: allowH2 ? ['http/1.1', 'h2'] : ['http/1.1'],
  17607. socket: httpSocket, // upgrade socket connection
  17608. port: port || 443,
  17609. host: hostname
  17610. })
  17611. socket
  17612. .on('session', function (session) {
  17613. // TODO (fix): Can a session become invalid once established? Don't think so?
  17614. sessionCache.set(sessionKey, session)
  17615. })
  17616. } else {
  17617. assert(!httpSocket, 'httpSocket can only be sent on TLS update')
  17618. socket = net.connect({
  17619. highWaterMark: 64 * 1024, // Same as nodejs fs streams.
  17620. ...options,
  17621. localAddress,
  17622. port: port || 80,
  17623. host: hostname
  17624. })
  17625. }
  17626. // Set TCP keep alive options on the socket here instead of in connect() for the case of assigning the socket
  17627. if (options.keepAlive == null || options.keepAlive) {
  17628. const keepAliveInitialDelay = options.keepAliveInitialDelay === undefined ? 60e3 : options.keepAliveInitialDelay
  17629. socket.setKeepAlive(true, keepAliveInitialDelay)
  17630. }
  17631. const cancelTimeout = setupTimeout(() => onConnectTimeout(socket), timeout)
  17632. socket
  17633. .setNoDelay(true)
  17634. .once(protocol === 'https:' ? 'secureConnect' : 'connect', function () {
  17635. cancelTimeout()
  17636. if (callback) {
  17637. const cb = callback
  17638. callback = null
  17639. cb(null, this)
  17640. }
  17641. })
  17642. .on('error', function (err) {
  17643. cancelTimeout()
  17644. if (callback) {
  17645. const cb = callback
  17646. callback = null
  17647. cb(err)
  17648. }
  17649. })
  17650. return socket
  17651. }
  17652. }
  17653. function setupTimeout (onConnectTimeout, timeout) {
  17654. if (!timeout) {
  17655. return () => {}
  17656. }
  17657. let s1 = null
  17658. let s2 = null
  17659. const timeoutId = setTimeout(() => {
  17660. // setImmediate is added to make sure that we priotorise socket error events over timeouts
  17661. s1 = setImmediate(() => {
  17662. if (process.platform === 'win32') {
  17663. // Windows needs an extra setImmediate probably due to implementation differences in the socket logic
  17664. s2 = setImmediate(() => onConnectTimeout())
  17665. } else {
  17666. onConnectTimeout()
  17667. }
  17668. })
  17669. }, timeout)
  17670. return () => {
  17671. clearTimeout(timeoutId)
  17672. clearImmediate(s1)
  17673. clearImmediate(s2)
  17674. }
  17675. }
  17676. function onConnectTimeout (socket) {
  17677. util.destroy(socket, new ConnectTimeoutError())
  17678. }
  17679. module.exports = buildConnector
  17680. /***/ }),
  17681. /***/ 4462:
  17682. /***/ ((module) => {
  17683. "use strict";
  17684. /** @type {Record<string, string | undefined>} */
  17685. const headerNameLowerCasedRecord = {}
  17686. // https://developer.mozilla.org/docs/Web/HTTP/Headers
  17687. const wellknownHeaderNames = [
  17688. 'Accept',
  17689. 'Accept-Encoding',
  17690. 'Accept-Language',
  17691. 'Accept-Ranges',
  17692. 'Access-Control-Allow-Credentials',
  17693. 'Access-Control-Allow-Headers',
  17694. 'Access-Control-Allow-Methods',
  17695. 'Access-Control-Allow-Origin',
  17696. 'Access-Control-Expose-Headers',
  17697. 'Access-Control-Max-Age',
  17698. 'Access-Control-Request-Headers',
  17699. 'Access-Control-Request-Method',
  17700. 'Age',
  17701. 'Allow',
  17702. 'Alt-Svc',
  17703. 'Alt-Used',
  17704. 'Authorization',
  17705. 'Cache-Control',
  17706. 'Clear-Site-Data',
  17707. 'Connection',
  17708. 'Content-Disposition',
  17709. 'Content-Encoding',
  17710. 'Content-Language',
  17711. 'Content-Length',
  17712. 'Content-Location',
  17713. 'Content-Range',
  17714. 'Content-Security-Policy',
  17715. 'Content-Security-Policy-Report-Only',
  17716. 'Content-Type',
  17717. 'Cookie',
  17718. 'Cross-Origin-Embedder-Policy',
  17719. 'Cross-Origin-Opener-Policy',
  17720. 'Cross-Origin-Resource-Policy',
  17721. 'Date',
  17722. 'Device-Memory',
  17723. 'Downlink',
  17724. 'ECT',
  17725. 'ETag',
  17726. 'Expect',
  17727. 'Expect-CT',
  17728. 'Expires',
  17729. 'Forwarded',
  17730. 'From',
  17731. 'Host',
  17732. 'If-Match',
  17733. 'If-Modified-Since',
  17734. 'If-None-Match',
  17735. 'If-Range',
  17736. 'If-Unmodified-Since',
  17737. 'Keep-Alive',
  17738. 'Last-Modified',
  17739. 'Link',
  17740. 'Location',
  17741. 'Max-Forwards',
  17742. 'Origin',
  17743. 'Permissions-Policy',
  17744. 'Pragma',
  17745. 'Proxy-Authenticate',
  17746. 'Proxy-Authorization',
  17747. 'RTT',
  17748. 'Range',
  17749. 'Referer',
  17750. 'Referrer-Policy',
  17751. 'Refresh',
  17752. 'Retry-After',
  17753. 'Sec-WebSocket-Accept',
  17754. 'Sec-WebSocket-Extensions',
  17755. 'Sec-WebSocket-Key',
  17756. 'Sec-WebSocket-Protocol',
  17757. 'Sec-WebSocket-Version',
  17758. 'Server',
  17759. 'Server-Timing',
  17760. 'Service-Worker-Allowed',
  17761. 'Service-Worker-Navigation-Preload',
  17762. 'Set-Cookie',
  17763. 'SourceMap',
  17764. 'Strict-Transport-Security',
  17765. 'Supports-Loading-Mode',
  17766. 'TE',
  17767. 'Timing-Allow-Origin',
  17768. 'Trailer',
  17769. 'Transfer-Encoding',
  17770. 'Upgrade',
  17771. 'Upgrade-Insecure-Requests',
  17772. 'User-Agent',
  17773. 'Vary',
  17774. 'Via',
  17775. 'WWW-Authenticate',
  17776. 'X-Content-Type-Options',
  17777. 'X-DNS-Prefetch-Control',
  17778. 'X-Frame-Options',
  17779. 'X-Permitted-Cross-Domain-Policies',
  17780. 'X-Powered-By',
  17781. 'X-Requested-With',
  17782. 'X-XSS-Protection'
  17783. ]
  17784. for (let i = 0; i < wellknownHeaderNames.length; ++i) {
  17785. const key = wellknownHeaderNames[i]
  17786. const lowerCasedKey = key.toLowerCase()
  17787. headerNameLowerCasedRecord[key] = headerNameLowerCasedRecord[lowerCasedKey] =
  17788. lowerCasedKey
  17789. }
  17790. // Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`.
  17791. Object.setPrototypeOf(headerNameLowerCasedRecord, null)
  17792. module.exports = {
  17793. wellknownHeaderNames,
  17794. headerNameLowerCasedRecord
  17795. }
  17796. /***/ }),
  17797. /***/ 8045:
  17798. /***/ ((module) => {
  17799. "use strict";
  17800. class UndiciError extends Error {
  17801. constructor (message) {
  17802. super(message)
  17803. this.name = 'UndiciError'
  17804. this.code = 'UND_ERR'
  17805. }
  17806. }
  17807. class ConnectTimeoutError extends UndiciError {
  17808. constructor (message) {
  17809. super(message)
  17810. Error.captureStackTrace(this, ConnectTimeoutError)
  17811. this.name = 'ConnectTimeoutError'
  17812. this.message = message || 'Connect Timeout Error'
  17813. this.code = 'UND_ERR_CONNECT_TIMEOUT'
  17814. }
  17815. }
  17816. class HeadersTimeoutError extends UndiciError {
  17817. constructor (message) {
  17818. super(message)
  17819. Error.captureStackTrace(this, HeadersTimeoutError)
  17820. this.name = 'HeadersTimeoutError'
  17821. this.message = message || 'Headers Timeout Error'
  17822. this.code = 'UND_ERR_HEADERS_TIMEOUT'
  17823. }
  17824. }
  17825. class HeadersOverflowError extends UndiciError {
  17826. constructor (message) {
  17827. super(message)
  17828. Error.captureStackTrace(this, HeadersOverflowError)
  17829. this.name = 'HeadersOverflowError'
  17830. this.message = message || 'Headers Overflow Error'
  17831. this.code = 'UND_ERR_HEADERS_OVERFLOW'
  17832. }
  17833. }
  17834. class BodyTimeoutError extends UndiciError {
  17835. constructor (message) {
  17836. super(message)
  17837. Error.captureStackTrace(this, BodyTimeoutError)
  17838. this.name = 'BodyTimeoutError'
  17839. this.message = message || 'Body Timeout Error'
  17840. this.code = 'UND_ERR_BODY_TIMEOUT'
  17841. }
  17842. }
  17843. class ResponseStatusCodeError extends UndiciError {
  17844. constructor (message, statusCode, headers, body) {
  17845. super(message)
  17846. Error.captureStackTrace(this, ResponseStatusCodeError)
  17847. this.name = 'ResponseStatusCodeError'
  17848. this.message = message || 'Response Status Code Error'
  17849. this.code = 'UND_ERR_RESPONSE_STATUS_CODE'
  17850. this.body = body
  17851. this.status = statusCode
  17852. this.statusCode = statusCode
  17853. this.headers = headers
  17854. }
  17855. }
  17856. class InvalidArgumentError extends UndiciError {
  17857. constructor (message) {
  17858. super(message)
  17859. Error.captureStackTrace(this, InvalidArgumentError)
  17860. this.name = 'InvalidArgumentError'
  17861. this.message = message || 'Invalid Argument Error'
  17862. this.code = 'UND_ERR_INVALID_ARG'
  17863. }
  17864. }
  17865. class InvalidReturnValueError extends UndiciError {
  17866. constructor (message) {
  17867. super(message)
  17868. Error.captureStackTrace(this, InvalidReturnValueError)
  17869. this.name = 'InvalidReturnValueError'
  17870. this.message = message || 'Invalid Return Value Error'
  17871. this.code = 'UND_ERR_INVALID_RETURN_VALUE'
  17872. }
  17873. }
  17874. class RequestAbortedError extends UndiciError {
  17875. constructor (message) {
  17876. super(message)
  17877. Error.captureStackTrace(this, RequestAbortedError)
  17878. this.name = 'AbortError'
  17879. this.message = message || 'Request aborted'
  17880. this.code = 'UND_ERR_ABORTED'
  17881. }
  17882. }
  17883. class InformationalError extends UndiciError {
  17884. constructor (message) {
  17885. super(message)
  17886. Error.captureStackTrace(this, InformationalError)
  17887. this.name = 'InformationalError'
  17888. this.message = message || 'Request information'
  17889. this.code = 'UND_ERR_INFO'
  17890. }
  17891. }
  17892. class RequestContentLengthMismatchError extends UndiciError {
  17893. constructor (message) {
  17894. super(message)
  17895. Error.captureStackTrace(this, RequestContentLengthMismatchError)
  17896. this.name = 'RequestContentLengthMismatchError'
  17897. this.message = message || 'Request body length does not match content-length header'
  17898. this.code = 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH'
  17899. }
  17900. }
  17901. class ResponseContentLengthMismatchError extends UndiciError {
  17902. constructor (message) {
  17903. super(message)
  17904. Error.captureStackTrace(this, ResponseContentLengthMismatchError)
  17905. this.name = 'ResponseContentLengthMismatchError'
  17906. this.message = message || 'Response body length does not match content-length header'
  17907. this.code = 'UND_ERR_RES_CONTENT_LENGTH_MISMATCH'
  17908. }
  17909. }
  17910. class ClientDestroyedError extends UndiciError {
  17911. constructor (message) {
  17912. super(message)
  17913. Error.captureStackTrace(this, ClientDestroyedError)
  17914. this.name = 'ClientDestroyedError'
  17915. this.message = message || 'The client is destroyed'
  17916. this.code = 'UND_ERR_DESTROYED'
  17917. }
  17918. }
  17919. class ClientClosedError extends UndiciError {
  17920. constructor (message) {
  17921. super(message)
  17922. Error.captureStackTrace(this, ClientClosedError)
  17923. this.name = 'ClientClosedError'
  17924. this.message = message || 'The client is closed'
  17925. this.code = 'UND_ERR_CLOSED'
  17926. }
  17927. }
  17928. class SocketError extends UndiciError {
  17929. constructor (message, socket) {
  17930. super(message)
  17931. Error.captureStackTrace(this, SocketError)
  17932. this.name = 'SocketError'
  17933. this.message = message || 'Socket error'
  17934. this.code = 'UND_ERR_SOCKET'
  17935. this.socket = socket
  17936. }
  17937. }
  17938. class NotSupportedError extends UndiciError {
  17939. constructor (message) {
  17940. super(message)
  17941. Error.captureStackTrace(this, NotSupportedError)
  17942. this.name = 'NotSupportedError'
  17943. this.message = message || 'Not supported error'
  17944. this.code = 'UND_ERR_NOT_SUPPORTED'
  17945. }
  17946. }
  17947. class BalancedPoolMissingUpstreamError extends UndiciError {
  17948. constructor (message) {
  17949. super(message)
  17950. Error.captureStackTrace(this, NotSupportedError)
  17951. this.name = 'MissingUpstreamError'
  17952. this.message = message || 'No upstream has been added to the BalancedPool'
  17953. this.code = 'UND_ERR_BPL_MISSING_UPSTREAM'
  17954. }
  17955. }
  17956. class HTTPParserError extends Error {
  17957. constructor (message, code, data) {
  17958. super(message)
  17959. Error.captureStackTrace(this, HTTPParserError)
  17960. this.name = 'HTTPParserError'
  17961. this.code = code ? `HPE_${code}` : undefined
  17962. this.data = data ? data.toString() : undefined
  17963. }
  17964. }
  17965. class ResponseExceededMaxSizeError extends UndiciError {
  17966. constructor (message) {
  17967. super(message)
  17968. Error.captureStackTrace(this, ResponseExceededMaxSizeError)
  17969. this.name = 'ResponseExceededMaxSizeError'
  17970. this.message = message || 'Response content exceeded max size'
  17971. this.code = 'UND_ERR_RES_EXCEEDED_MAX_SIZE'
  17972. }
  17973. }
  17974. class RequestRetryError extends UndiciError {
  17975. constructor (message, code, { headers, data }) {
  17976. super(message)
  17977. Error.captureStackTrace(this, RequestRetryError)
  17978. this.name = 'RequestRetryError'
  17979. this.message = message || 'Request retry error'
  17980. this.code = 'UND_ERR_REQ_RETRY'
  17981. this.statusCode = code
  17982. this.data = data
  17983. this.headers = headers
  17984. }
  17985. }
  17986. module.exports = {
  17987. HTTPParserError,
  17988. UndiciError,
  17989. HeadersTimeoutError,
  17990. HeadersOverflowError,
  17991. BodyTimeoutError,
  17992. RequestContentLengthMismatchError,
  17993. ConnectTimeoutError,
  17994. ResponseStatusCodeError,
  17995. InvalidArgumentError,
  17996. InvalidReturnValueError,
  17997. RequestAbortedError,
  17998. ClientDestroyedError,
  17999. ClientClosedError,
  18000. InformationalError,
  18001. SocketError,
  18002. NotSupportedError,
  18003. ResponseContentLengthMismatchError,
  18004. BalancedPoolMissingUpstreamError,
  18005. ResponseExceededMaxSizeError,
  18006. RequestRetryError
  18007. }
  18008. /***/ }),
  18009. /***/ 2905:
  18010. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  18011. "use strict";
  18012. const {
  18013. InvalidArgumentError,
  18014. NotSupportedError
  18015. } = __nccwpck_require__(8045)
  18016. const assert = __nccwpck_require__(9491)
  18017. const { kHTTP2BuildRequest, kHTTP2CopyHeaders, kHTTP1BuildRequest } = __nccwpck_require__(2785)
  18018. const util = __nccwpck_require__(3983)
  18019. // tokenRegExp and headerCharRegex have been lifted from
  18020. // https://github.com/nodejs/node/blob/main/lib/_http_common.js
  18021. /**
  18022. * Verifies that the given val is a valid HTTP token
  18023. * per the rules defined in RFC 7230
  18024. * See https://tools.ietf.org/html/rfc7230#section-3.2.6
  18025. */
  18026. const tokenRegExp = /^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/
  18027. /**
  18028. * Matches if val contains an invalid field-vchar
  18029. * field-value = *( field-content / obs-fold )
  18030. * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]
  18031. * field-vchar = VCHAR / obs-text
  18032. */
  18033. const headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/
  18034. // Verifies that a given path is valid does not contain control chars \x00 to \x20
  18035. const invalidPathRegex = /[^\u0021-\u00ff]/
  18036. const kHandler = Symbol('handler')
  18037. const channels = {}
  18038. let extractBody
  18039. try {
  18040. const diagnosticsChannel = __nccwpck_require__(7643)
  18041. channels.create = diagnosticsChannel.channel('undici:request:create')
  18042. channels.bodySent = diagnosticsChannel.channel('undici:request:bodySent')
  18043. channels.headers = diagnosticsChannel.channel('undici:request:headers')
  18044. channels.trailers = diagnosticsChannel.channel('undici:request:trailers')
  18045. channels.error = diagnosticsChannel.channel('undici:request:error')
  18046. } catch {
  18047. channels.create = { hasSubscribers: false }
  18048. channels.bodySent = { hasSubscribers: false }
  18049. channels.headers = { hasSubscribers: false }
  18050. channels.trailers = { hasSubscribers: false }
  18051. channels.error = { hasSubscribers: false }
  18052. }
  18053. class Request {
  18054. constructor (origin, {
  18055. path,
  18056. method,
  18057. body,
  18058. headers,
  18059. query,
  18060. idempotent,
  18061. blocking,
  18062. upgrade,
  18063. headersTimeout,
  18064. bodyTimeout,
  18065. reset,
  18066. throwOnError,
  18067. expectContinue
  18068. }, handler) {
  18069. if (typeof path !== 'string') {
  18070. throw new InvalidArgumentError('path must be a string')
  18071. } else if (
  18072. path[0] !== '/' &&
  18073. !(path.startsWith('http://') || path.startsWith('https://')) &&
  18074. method !== 'CONNECT'
  18075. ) {
  18076. throw new InvalidArgumentError('path must be an absolute URL or start with a slash')
  18077. } else if (invalidPathRegex.exec(path) !== null) {
  18078. throw new InvalidArgumentError('invalid request path')
  18079. }
  18080. if (typeof method !== 'string') {
  18081. throw new InvalidArgumentError('method must be a string')
  18082. } else if (tokenRegExp.exec(method) === null) {
  18083. throw new InvalidArgumentError('invalid request method')
  18084. }
  18085. if (upgrade && typeof upgrade !== 'string') {
  18086. throw new InvalidArgumentError('upgrade must be a string')
  18087. }
  18088. if (headersTimeout != null && (!Number.isFinite(headersTimeout) || headersTimeout < 0)) {
  18089. throw new InvalidArgumentError('invalid headersTimeout')
  18090. }
  18091. if (bodyTimeout != null && (!Number.isFinite(bodyTimeout) || bodyTimeout < 0)) {
  18092. throw new InvalidArgumentError('invalid bodyTimeout')
  18093. }
  18094. if (reset != null && typeof reset !== 'boolean') {
  18095. throw new InvalidArgumentError('invalid reset')
  18096. }
  18097. if (expectContinue != null && typeof expectContinue !== 'boolean') {
  18098. throw new InvalidArgumentError('invalid expectContinue')
  18099. }
  18100. this.headersTimeout = headersTimeout
  18101. this.bodyTimeout = bodyTimeout
  18102. this.throwOnError = throwOnError === true
  18103. this.method = method
  18104. this.abort = null
  18105. if (body == null) {
  18106. this.body = null
  18107. } else if (util.isStream(body)) {
  18108. this.body = body
  18109. const rState = this.body._readableState
  18110. if (!rState || !rState.autoDestroy) {
  18111. this.endHandler = function autoDestroy () {
  18112. util.destroy(this)
  18113. }
  18114. this.body.on('end', this.endHandler)
  18115. }
  18116. this.errorHandler = err => {
  18117. if (this.abort) {
  18118. this.abort(err)
  18119. } else {
  18120. this.error = err
  18121. }
  18122. }
  18123. this.body.on('error', this.errorHandler)
  18124. } else if (util.isBuffer(body)) {
  18125. this.body = body.byteLength ? body : null
  18126. } else if (ArrayBuffer.isView(body)) {
  18127. this.body = body.buffer.byteLength ? Buffer.from(body.buffer, body.byteOffset, body.byteLength) : null
  18128. } else if (body instanceof ArrayBuffer) {
  18129. this.body = body.byteLength ? Buffer.from(body) : null
  18130. } else if (typeof body === 'string') {
  18131. this.body = body.length ? Buffer.from(body) : null
  18132. } else if (util.isFormDataLike(body) || util.isIterable(body) || util.isBlobLike(body)) {
  18133. this.body = body
  18134. } else {
  18135. throw new InvalidArgumentError('body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable')
  18136. }
  18137. this.completed = false
  18138. this.aborted = false
  18139. this.upgrade = upgrade || null
  18140. this.path = query ? util.buildURL(path, query) : path
  18141. this.origin = origin
  18142. this.idempotent = idempotent == null
  18143. ? method === 'HEAD' || method === 'GET'
  18144. : idempotent
  18145. this.blocking = blocking == null ? false : blocking
  18146. this.reset = reset == null ? null : reset
  18147. this.host = null
  18148. this.contentLength = null
  18149. this.contentType = null
  18150. this.headers = ''
  18151. // Only for H2
  18152. this.expectContinue = expectContinue != null ? expectContinue : false
  18153. if (Array.isArray(headers)) {
  18154. if (headers.length % 2 !== 0) {
  18155. throw new InvalidArgumentError('headers array must be even')
  18156. }
  18157. for (let i = 0; i < headers.length; i += 2) {
  18158. processHeader(this, headers[i], headers[i + 1])
  18159. }
  18160. } else if (headers && typeof headers === 'object') {
  18161. const keys = Object.keys(headers)
  18162. for (let i = 0; i < keys.length; i++) {
  18163. const key = keys[i]
  18164. processHeader(this, key, headers[key])
  18165. }
  18166. } else if (headers != null) {
  18167. throw new InvalidArgumentError('headers must be an object or an array')
  18168. }
  18169. if (util.isFormDataLike(this.body)) {
  18170. if (util.nodeMajor < 16 || (util.nodeMajor === 16 && util.nodeMinor < 8)) {
  18171. throw new InvalidArgumentError('Form-Data bodies are only supported in node v16.8 and newer.')
  18172. }
  18173. if (!extractBody) {
  18174. extractBody = (__nccwpck_require__(9990).extractBody)
  18175. }
  18176. const [bodyStream, contentType] = extractBody(body)
  18177. if (this.contentType == null) {
  18178. this.contentType = contentType
  18179. this.headers += `content-type: ${contentType}\r\n`
  18180. }
  18181. this.body = bodyStream.stream
  18182. this.contentLength = bodyStream.length
  18183. } else if (util.isBlobLike(body) && this.contentType == null && body.type) {
  18184. this.contentType = body.type
  18185. this.headers += `content-type: ${body.type}\r\n`
  18186. }
  18187. util.validateHandler(handler, method, upgrade)
  18188. this.servername = util.getServerName(this.host)
  18189. this[kHandler] = handler
  18190. if (channels.create.hasSubscribers) {
  18191. channels.create.publish({ request: this })
  18192. }
  18193. }
  18194. onBodySent (chunk) {
  18195. if (this[kHandler].onBodySent) {
  18196. try {
  18197. return this[kHandler].onBodySent(chunk)
  18198. } catch (err) {
  18199. this.abort(err)
  18200. }
  18201. }
  18202. }
  18203. onRequestSent () {
  18204. if (channels.bodySent.hasSubscribers) {
  18205. channels.bodySent.publish({ request: this })
  18206. }
  18207. if (this[kHandler].onRequestSent) {
  18208. try {
  18209. return this[kHandler].onRequestSent()
  18210. } catch (err) {
  18211. this.abort(err)
  18212. }
  18213. }
  18214. }
  18215. onConnect (abort) {
  18216. assert(!this.aborted)
  18217. assert(!this.completed)
  18218. if (this.error) {
  18219. abort(this.error)
  18220. } else {
  18221. this.abort = abort
  18222. return this[kHandler].onConnect(abort)
  18223. }
  18224. }
  18225. onHeaders (statusCode, headers, resume, statusText) {
  18226. assert(!this.aborted)
  18227. assert(!this.completed)
  18228. if (channels.headers.hasSubscribers) {
  18229. channels.headers.publish({ request: this, response: { statusCode, headers, statusText } })
  18230. }
  18231. try {
  18232. return this[kHandler].onHeaders(statusCode, headers, resume, statusText)
  18233. } catch (err) {
  18234. this.abort(err)
  18235. }
  18236. }
  18237. onData (chunk) {
  18238. assert(!this.aborted)
  18239. assert(!this.completed)
  18240. try {
  18241. return this[kHandler].onData(chunk)
  18242. } catch (err) {
  18243. this.abort(err)
  18244. return false
  18245. }
  18246. }
  18247. onUpgrade (statusCode, headers, socket) {
  18248. assert(!this.aborted)
  18249. assert(!this.completed)
  18250. return this[kHandler].onUpgrade(statusCode, headers, socket)
  18251. }
  18252. onComplete (trailers) {
  18253. this.onFinally()
  18254. assert(!this.aborted)
  18255. this.completed = true
  18256. if (channels.trailers.hasSubscribers) {
  18257. channels.trailers.publish({ request: this, trailers })
  18258. }
  18259. try {
  18260. return this[kHandler].onComplete(trailers)
  18261. } catch (err) {
  18262. // TODO (fix): This might be a bad idea?
  18263. this.onError(err)
  18264. }
  18265. }
  18266. onError (error) {
  18267. this.onFinally()
  18268. if (channels.error.hasSubscribers) {
  18269. channels.error.publish({ request: this, error })
  18270. }
  18271. if (this.aborted) {
  18272. return
  18273. }
  18274. this.aborted = true
  18275. return this[kHandler].onError(error)
  18276. }
  18277. onFinally () {
  18278. if (this.errorHandler) {
  18279. this.body.off('error', this.errorHandler)
  18280. this.errorHandler = null
  18281. }
  18282. if (this.endHandler) {
  18283. this.body.off('end', this.endHandler)
  18284. this.endHandler = null
  18285. }
  18286. }
  18287. // TODO: adjust to support H2
  18288. addHeader (key, value) {
  18289. processHeader(this, key, value)
  18290. return this
  18291. }
  18292. static [kHTTP1BuildRequest] (origin, opts, handler) {
  18293. // TODO: Migrate header parsing here, to make Requests
  18294. // HTTP agnostic
  18295. return new Request(origin, opts, handler)
  18296. }
  18297. static [kHTTP2BuildRequest] (origin, opts, handler) {
  18298. const headers = opts.headers
  18299. opts = { ...opts, headers: null }
  18300. const request = new Request(origin, opts, handler)
  18301. request.headers = {}
  18302. if (Array.isArray(headers)) {
  18303. if (headers.length % 2 !== 0) {
  18304. throw new InvalidArgumentError('headers array must be even')
  18305. }
  18306. for (let i = 0; i < headers.length; i += 2) {
  18307. processHeader(request, headers[i], headers[i + 1], true)
  18308. }
  18309. } else if (headers && typeof headers === 'object') {
  18310. const keys = Object.keys(headers)
  18311. for (let i = 0; i < keys.length; i++) {
  18312. const key = keys[i]
  18313. processHeader(request, key, headers[key], true)
  18314. }
  18315. } else if (headers != null) {
  18316. throw new InvalidArgumentError('headers must be an object or an array')
  18317. }
  18318. return request
  18319. }
  18320. static [kHTTP2CopyHeaders] (raw) {
  18321. const rawHeaders = raw.split('\r\n')
  18322. const headers = {}
  18323. for (const header of rawHeaders) {
  18324. const [key, value] = header.split(': ')
  18325. if (value == null || value.length === 0) continue
  18326. if (headers[key]) headers[key] += `,${value}`
  18327. else headers[key] = value
  18328. }
  18329. return headers
  18330. }
  18331. }
  18332. function processHeaderValue (key, val, skipAppend) {
  18333. if (val && typeof val === 'object') {
  18334. throw new InvalidArgumentError(`invalid ${key} header`)
  18335. }
  18336. val = val != null ? `${val}` : ''
  18337. if (headerCharRegex.exec(val) !== null) {
  18338. throw new InvalidArgumentError(`invalid ${key} header`)
  18339. }
  18340. return skipAppend ? val : `${key}: ${val}\r\n`
  18341. }
  18342. function processHeader (request, key, val, skipAppend = false) {
  18343. if (val && (typeof val === 'object' && !Array.isArray(val))) {
  18344. throw new InvalidArgumentError(`invalid ${key} header`)
  18345. } else if (val === undefined) {
  18346. return
  18347. }
  18348. if (
  18349. request.host === null &&
  18350. key.length === 4 &&
  18351. key.toLowerCase() === 'host'
  18352. ) {
  18353. if (headerCharRegex.exec(val) !== null) {
  18354. throw new InvalidArgumentError(`invalid ${key} header`)
  18355. }
  18356. // Consumed by Client
  18357. request.host = val
  18358. } else if (
  18359. request.contentLength === null &&
  18360. key.length === 14 &&
  18361. key.toLowerCase() === 'content-length'
  18362. ) {
  18363. request.contentLength = parseInt(val, 10)
  18364. if (!Number.isFinite(request.contentLength)) {
  18365. throw new InvalidArgumentError('invalid content-length header')
  18366. }
  18367. } else if (
  18368. request.contentType === null &&
  18369. key.length === 12 &&
  18370. key.toLowerCase() === 'content-type'
  18371. ) {
  18372. request.contentType = val
  18373. if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend)
  18374. else request.headers += processHeaderValue(key, val)
  18375. } else if (
  18376. key.length === 17 &&
  18377. key.toLowerCase() === 'transfer-encoding'
  18378. ) {
  18379. throw new InvalidArgumentError('invalid transfer-encoding header')
  18380. } else if (
  18381. key.length === 10 &&
  18382. key.toLowerCase() === 'connection'
  18383. ) {
  18384. const value = typeof val === 'string' ? val.toLowerCase() : null
  18385. if (value !== 'close' && value !== 'keep-alive') {
  18386. throw new InvalidArgumentError('invalid connection header')
  18387. } else if (value === 'close') {
  18388. request.reset = true
  18389. }
  18390. } else if (
  18391. key.length === 10 &&
  18392. key.toLowerCase() === 'keep-alive'
  18393. ) {
  18394. throw new InvalidArgumentError('invalid keep-alive header')
  18395. } else if (
  18396. key.length === 7 &&
  18397. key.toLowerCase() === 'upgrade'
  18398. ) {
  18399. throw new InvalidArgumentError('invalid upgrade header')
  18400. } else if (
  18401. key.length === 6 &&
  18402. key.toLowerCase() === 'expect'
  18403. ) {
  18404. throw new NotSupportedError('expect header not supported')
  18405. } else if (tokenRegExp.exec(key) === null) {
  18406. throw new InvalidArgumentError('invalid header key')
  18407. } else {
  18408. if (Array.isArray(val)) {
  18409. for (let i = 0; i < val.length; i++) {
  18410. if (skipAppend) {
  18411. if (request.headers[key]) request.headers[key] += `,${processHeaderValue(key, val[i], skipAppend)}`
  18412. else request.headers[key] = processHeaderValue(key, val[i], skipAppend)
  18413. } else {
  18414. request.headers += processHeaderValue(key, val[i])
  18415. }
  18416. }
  18417. } else {
  18418. if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend)
  18419. else request.headers += processHeaderValue(key, val)
  18420. }
  18421. }
  18422. }
  18423. module.exports = Request
  18424. /***/ }),
  18425. /***/ 2785:
  18426. /***/ ((module) => {
  18427. module.exports = {
  18428. kClose: Symbol('close'),
  18429. kDestroy: Symbol('destroy'),
  18430. kDispatch: Symbol('dispatch'),
  18431. kUrl: Symbol('url'),
  18432. kWriting: Symbol('writing'),
  18433. kResuming: Symbol('resuming'),
  18434. kQueue: Symbol('queue'),
  18435. kConnect: Symbol('connect'),
  18436. kConnecting: Symbol('connecting'),
  18437. kHeadersList: Symbol('headers list'),
  18438. kKeepAliveDefaultTimeout: Symbol('default keep alive timeout'),
  18439. kKeepAliveMaxTimeout: Symbol('max keep alive timeout'),
  18440. kKeepAliveTimeoutThreshold: Symbol('keep alive timeout threshold'),
  18441. kKeepAliveTimeoutValue: Symbol('keep alive timeout'),
  18442. kKeepAlive: Symbol('keep alive'),
  18443. kHeadersTimeout: Symbol('headers timeout'),
  18444. kBodyTimeout: Symbol('body timeout'),
  18445. kServerName: Symbol('server name'),
  18446. kLocalAddress: Symbol('local address'),
  18447. kHost: Symbol('host'),
  18448. kNoRef: Symbol('no ref'),
  18449. kBodyUsed: Symbol('used'),
  18450. kRunning: Symbol('running'),
  18451. kBlocking: Symbol('blocking'),
  18452. kPending: Symbol('pending'),
  18453. kSize: Symbol('size'),
  18454. kBusy: Symbol('busy'),
  18455. kQueued: Symbol('queued'),
  18456. kFree: Symbol('free'),
  18457. kConnected: Symbol('connected'),
  18458. kClosed: Symbol('closed'),
  18459. kNeedDrain: Symbol('need drain'),
  18460. kReset: Symbol('reset'),
  18461. kDestroyed: Symbol.for('nodejs.stream.destroyed'),
  18462. kMaxHeadersSize: Symbol('max headers size'),
  18463. kRunningIdx: Symbol('running index'),
  18464. kPendingIdx: Symbol('pending index'),
  18465. kError: Symbol('error'),
  18466. kClients: Symbol('clients'),
  18467. kClient: Symbol('client'),
  18468. kParser: Symbol('parser'),
  18469. kOnDestroyed: Symbol('destroy callbacks'),
  18470. kPipelining: Symbol('pipelining'),
  18471. kSocket: Symbol('socket'),
  18472. kHostHeader: Symbol('host header'),
  18473. kConnector: Symbol('connector'),
  18474. kStrictContentLength: Symbol('strict content length'),
  18475. kMaxRedirections: Symbol('maxRedirections'),
  18476. kMaxRequests: Symbol('maxRequestsPerClient'),
  18477. kProxy: Symbol('proxy agent options'),
  18478. kCounter: Symbol('socket request counter'),
  18479. kInterceptors: Symbol('dispatch interceptors'),
  18480. kMaxResponseSize: Symbol('max response size'),
  18481. kHTTP2Session: Symbol('http2Session'),
  18482. kHTTP2SessionState: Symbol('http2Session state'),
  18483. kHTTP2BuildRequest: Symbol('http2 build request'),
  18484. kHTTP1BuildRequest: Symbol('http1 build request'),
  18485. kHTTP2CopyHeaders: Symbol('http2 copy headers'),
  18486. kHTTPConnVersion: Symbol('http connection version'),
  18487. kRetryHandlerDefaultRetry: Symbol('retry agent default retry'),
  18488. kConstruct: Symbol('constructable')
  18489. }
  18490. /***/ }),
  18491. /***/ 3983:
  18492. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  18493. "use strict";
  18494. const assert = __nccwpck_require__(9491)
  18495. const { kDestroyed, kBodyUsed } = __nccwpck_require__(2785)
  18496. const { IncomingMessage } = __nccwpck_require__(3685)
  18497. const stream = __nccwpck_require__(2781)
  18498. const net = __nccwpck_require__(1808)
  18499. const { InvalidArgumentError } = __nccwpck_require__(8045)
  18500. const { Blob } = __nccwpck_require__(4300)
  18501. const nodeUtil = __nccwpck_require__(3837)
  18502. const { stringify } = __nccwpck_require__(3477)
  18503. const { headerNameLowerCasedRecord } = __nccwpck_require__(4462)
  18504. const [nodeMajor, nodeMinor] = process.versions.node.split('.').map(v => Number(v))
  18505. function nop () {}
  18506. function isStream (obj) {
  18507. return obj && typeof obj === 'object' && typeof obj.pipe === 'function' && typeof obj.on === 'function'
  18508. }
  18509. // based on https://github.com/node-fetch/fetch-blob/blob/8ab587d34080de94140b54f07168451e7d0b655e/index.js#L229-L241 (MIT License)
  18510. function isBlobLike (object) {
  18511. return (Blob && object instanceof Blob) || (
  18512. object &&
  18513. typeof object === 'object' &&
  18514. (typeof object.stream === 'function' ||
  18515. typeof object.arrayBuffer === 'function') &&
  18516. /^(Blob|File)$/.test(object[Symbol.toStringTag])
  18517. )
  18518. }
  18519. function buildURL (url, queryParams) {
  18520. if (url.includes('?') || url.includes('#')) {
  18521. throw new Error('Query params cannot be passed when url already contains "?" or "#".')
  18522. }
  18523. const stringified = stringify(queryParams)
  18524. if (stringified) {
  18525. url += '?' + stringified
  18526. }
  18527. return url
  18528. }
  18529. function parseURL (url) {
  18530. if (typeof url === 'string') {
  18531. url = new URL(url)
  18532. if (!/^https?:/.test(url.origin || url.protocol)) {
  18533. throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')
  18534. }
  18535. return url
  18536. }
  18537. if (!url || typeof url !== 'object') {
  18538. throw new InvalidArgumentError('Invalid URL: The URL argument must be a non-null object.')
  18539. }
  18540. if (!/^https?:/.test(url.origin || url.protocol)) {
  18541. throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')
  18542. }
  18543. if (!(url instanceof URL)) {
  18544. if (url.port != null && url.port !== '' && !Number.isFinite(parseInt(url.port))) {
  18545. throw new InvalidArgumentError('Invalid URL: port must be a valid integer or a string representation of an integer.')
  18546. }
  18547. if (url.path != null && typeof url.path !== 'string') {
  18548. throw new InvalidArgumentError('Invalid URL path: the path must be a string or null/undefined.')
  18549. }
  18550. if (url.pathname != null && typeof url.pathname !== 'string') {
  18551. throw new InvalidArgumentError('Invalid URL pathname: the pathname must be a string or null/undefined.')
  18552. }
  18553. if (url.hostname != null && typeof url.hostname !== 'string') {
  18554. throw new InvalidArgumentError('Invalid URL hostname: the hostname must be a string or null/undefined.')
  18555. }
  18556. if (url.origin != null && typeof url.origin !== 'string') {
  18557. throw new InvalidArgumentError('Invalid URL origin: the origin must be a string or null/undefined.')
  18558. }
  18559. const port = url.port != null
  18560. ? url.port
  18561. : (url.protocol === 'https:' ? 443 : 80)
  18562. let origin = url.origin != null
  18563. ? url.origin
  18564. : `${url.protocol}//${url.hostname}:${port}`
  18565. let path = url.path != null
  18566. ? url.path
  18567. : `${url.pathname || ''}${url.search || ''}`
  18568. if (origin.endsWith('/')) {
  18569. origin = origin.substring(0, origin.length - 1)
  18570. }
  18571. if (path && !path.startsWith('/')) {
  18572. path = `/${path}`
  18573. }
  18574. // new URL(path, origin) is unsafe when `path` contains an absolute URL
  18575. // From https://developer.mozilla.org/en-US/docs/Web/API/URL/URL:
  18576. // If first parameter is a relative URL, second param is required, and will be used as the base URL.
  18577. // If first parameter is an absolute URL, a given second param will be ignored.
  18578. url = new URL(origin + path)
  18579. }
  18580. return url
  18581. }
  18582. function parseOrigin (url) {
  18583. url = parseURL(url)
  18584. if (url.pathname !== '/' || url.search || url.hash) {
  18585. throw new InvalidArgumentError('invalid url')
  18586. }
  18587. return url
  18588. }
  18589. function getHostname (host) {
  18590. if (host[0] === '[') {
  18591. const idx = host.indexOf(']')
  18592. assert(idx !== -1)
  18593. return host.substring(1, idx)
  18594. }
  18595. const idx = host.indexOf(':')
  18596. if (idx === -1) return host
  18597. return host.substring(0, idx)
  18598. }
  18599. // IP addresses are not valid server names per RFC6066
  18600. // > Currently, the only server names supported are DNS hostnames
  18601. function getServerName (host) {
  18602. if (!host) {
  18603. return null
  18604. }
  18605. assert.strictEqual(typeof host, 'string')
  18606. const servername = getHostname(host)
  18607. if (net.isIP(servername)) {
  18608. return ''
  18609. }
  18610. return servername
  18611. }
  18612. function deepClone (obj) {
  18613. return JSON.parse(JSON.stringify(obj))
  18614. }
  18615. function isAsyncIterable (obj) {
  18616. return !!(obj != null && typeof obj[Symbol.asyncIterator] === 'function')
  18617. }
  18618. function isIterable (obj) {
  18619. return !!(obj != null && (typeof obj[Symbol.iterator] === 'function' || typeof obj[Symbol.asyncIterator] === 'function'))
  18620. }
  18621. function bodyLength (body) {
  18622. if (body == null) {
  18623. return 0
  18624. } else if (isStream(body)) {
  18625. const state = body._readableState
  18626. return state && state.objectMode === false && state.ended === true && Number.isFinite(state.length)
  18627. ? state.length
  18628. : null
  18629. } else if (isBlobLike(body)) {
  18630. return body.size != null ? body.size : null
  18631. } else if (isBuffer(body)) {
  18632. return body.byteLength
  18633. }
  18634. return null
  18635. }
  18636. function isDestroyed (stream) {
  18637. return !stream || !!(stream.destroyed || stream[kDestroyed])
  18638. }
  18639. function isReadableAborted (stream) {
  18640. const state = stream && stream._readableState
  18641. return isDestroyed(stream) && state && !state.endEmitted
  18642. }
  18643. function destroy (stream, err) {
  18644. if (stream == null || !isStream(stream) || isDestroyed(stream)) {
  18645. return
  18646. }
  18647. if (typeof stream.destroy === 'function') {
  18648. if (Object.getPrototypeOf(stream).constructor === IncomingMessage) {
  18649. // See: https://github.com/nodejs/node/pull/38505/files
  18650. stream.socket = null
  18651. }
  18652. stream.destroy(err)
  18653. } else if (err) {
  18654. process.nextTick((stream, err) => {
  18655. stream.emit('error', err)
  18656. }, stream, err)
  18657. }
  18658. if (stream.destroyed !== true) {
  18659. stream[kDestroyed] = true
  18660. }
  18661. }
  18662. const KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/
  18663. function parseKeepAliveTimeout (val) {
  18664. const m = val.toString().match(KEEPALIVE_TIMEOUT_EXPR)
  18665. return m ? parseInt(m[1], 10) * 1000 : null
  18666. }
  18667. /**
  18668. * Retrieves a header name and returns its lowercase value.
  18669. * @param {string | Buffer} value Header name
  18670. * @returns {string}
  18671. */
  18672. function headerNameToString (value) {
  18673. return headerNameLowerCasedRecord[value] || value.toLowerCase()
  18674. }
  18675. function parseHeaders (headers, obj = {}) {
  18676. // For H2 support
  18677. if (!Array.isArray(headers)) return headers
  18678. for (let i = 0; i < headers.length; i += 2) {
  18679. const key = headers[i].toString().toLowerCase()
  18680. let val = obj[key]
  18681. if (!val) {
  18682. if (Array.isArray(headers[i + 1])) {
  18683. obj[key] = headers[i + 1].map(x => x.toString('utf8'))
  18684. } else {
  18685. obj[key] = headers[i + 1].toString('utf8')
  18686. }
  18687. } else {
  18688. if (!Array.isArray(val)) {
  18689. val = [val]
  18690. obj[key] = val
  18691. }
  18692. val.push(headers[i + 1].toString('utf8'))
  18693. }
  18694. }
  18695. // See https://github.com/nodejs/node/pull/46528
  18696. if ('content-length' in obj && 'content-disposition' in obj) {
  18697. obj['content-disposition'] = Buffer.from(obj['content-disposition']).toString('latin1')
  18698. }
  18699. return obj
  18700. }
  18701. function parseRawHeaders (headers) {
  18702. const ret = []
  18703. let hasContentLength = false
  18704. let contentDispositionIdx = -1
  18705. for (let n = 0; n < headers.length; n += 2) {
  18706. const key = headers[n + 0].toString()
  18707. const val = headers[n + 1].toString('utf8')
  18708. if (key.length === 14 && (key === 'content-length' || key.toLowerCase() === 'content-length')) {
  18709. ret.push(key, val)
  18710. hasContentLength = true
  18711. } else if (key.length === 19 && (key === 'content-disposition' || key.toLowerCase() === 'content-disposition')) {
  18712. contentDispositionIdx = ret.push(key, val) - 1
  18713. } else {
  18714. ret.push(key, val)
  18715. }
  18716. }
  18717. // See https://github.com/nodejs/node/pull/46528
  18718. if (hasContentLength && contentDispositionIdx !== -1) {
  18719. ret[contentDispositionIdx] = Buffer.from(ret[contentDispositionIdx]).toString('latin1')
  18720. }
  18721. return ret
  18722. }
  18723. function isBuffer (buffer) {
  18724. // See, https://github.com/mcollina/undici/pull/319
  18725. return buffer instanceof Uint8Array || Buffer.isBuffer(buffer)
  18726. }
  18727. function validateHandler (handler, method, upgrade) {
  18728. if (!handler || typeof handler !== 'object') {
  18729. throw new InvalidArgumentError('handler must be an object')
  18730. }
  18731. if (typeof handler.onConnect !== 'function') {
  18732. throw new InvalidArgumentError('invalid onConnect method')
  18733. }
  18734. if (typeof handler.onError !== 'function') {
  18735. throw new InvalidArgumentError('invalid onError method')
  18736. }
  18737. if (typeof handler.onBodySent !== 'function' && handler.onBodySent !== undefined) {
  18738. throw new InvalidArgumentError('invalid onBodySent method')
  18739. }
  18740. if (upgrade || method === 'CONNECT') {
  18741. if (typeof handler.onUpgrade !== 'function') {
  18742. throw new InvalidArgumentError('invalid onUpgrade method')
  18743. }
  18744. } else {
  18745. if (typeof handler.onHeaders !== 'function') {
  18746. throw new InvalidArgumentError('invalid onHeaders method')
  18747. }
  18748. if (typeof handler.onData !== 'function') {
  18749. throw new InvalidArgumentError('invalid onData method')
  18750. }
  18751. if (typeof handler.onComplete !== 'function') {
  18752. throw new InvalidArgumentError('invalid onComplete method')
  18753. }
  18754. }
  18755. }
  18756. // A body is disturbed if it has been read from and it cannot
  18757. // be re-used without losing state or data.
  18758. function isDisturbed (body) {
  18759. return !!(body && (
  18760. stream.isDisturbed
  18761. ? stream.isDisturbed(body) || body[kBodyUsed] // TODO (fix): Why is body[kBodyUsed] needed?
  18762. : body[kBodyUsed] ||
  18763. body.readableDidRead ||
  18764. (body._readableState && body._readableState.dataEmitted) ||
  18765. isReadableAborted(body)
  18766. ))
  18767. }
  18768. function isErrored (body) {
  18769. return !!(body && (
  18770. stream.isErrored
  18771. ? stream.isErrored(body)
  18772. : /state: 'errored'/.test(nodeUtil.inspect(body)
  18773. )))
  18774. }
  18775. function isReadable (body) {
  18776. return !!(body && (
  18777. stream.isReadable
  18778. ? stream.isReadable(body)
  18779. : /state: 'readable'/.test(nodeUtil.inspect(body)
  18780. )))
  18781. }
  18782. function getSocketInfo (socket) {
  18783. return {
  18784. localAddress: socket.localAddress,
  18785. localPort: socket.localPort,
  18786. remoteAddress: socket.remoteAddress,
  18787. remotePort: socket.remotePort,
  18788. remoteFamily: socket.remoteFamily,
  18789. timeout: socket.timeout,
  18790. bytesWritten: socket.bytesWritten,
  18791. bytesRead: socket.bytesRead
  18792. }
  18793. }
  18794. async function * convertIterableToBuffer (iterable) {
  18795. for await (const chunk of iterable) {
  18796. yield Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk)
  18797. }
  18798. }
  18799. let ReadableStream
  18800. function ReadableStreamFrom (iterable) {
  18801. if (!ReadableStream) {
  18802. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  18803. }
  18804. if (ReadableStream.from) {
  18805. return ReadableStream.from(convertIterableToBuffer(iterable))
  18806. }
  18807. let iterator
  18808. return new ReadableStream(
  18809. {
  18810. async start () {
  18811. iterator = iterable[Symbol.asyncIterator]()
  18812. },
  18813. async pull (controller) {
  18814. const { done, value } = await iterator.next()
  18815. if (done) {
  18816. queueMicrotask(() => {
  18817. controller.close()
  18818. })
  18819. } else {
  18820. const buf = Buffer.isBuffer(value) ? value : Buffer.from(value)
  18821. controller.enqueue(new Uint8Array(buf))
  18822. }
  18823. return controller.desiredSize > 0
  18824. },
  18825. async cancel (reason) {
  18826. await iterator.return()
  18827. }
  18828. },
  18829. 0
  18830. )
  18831. }
  18832. // The chunk should be a FormData instance and contains
  18833. // all the required methods.
  18834. function isFormDataLike (object) {
  18835. return (
  18836. object &&
  18837. typeof object === 'object' &&
  18838. typeof object.append === 'function' &&
  18839. typeof object.delete === 'function' &&
  18840. typeof object.get === 'function' &&
  18841. typeof object.getAll === 'function' &&
  18842. typeof object.has === 'function' &&
  18843. typeof object.set === 'function' &&
  18844. object[Symbol.toStringTag] === 'FormData'
  18845. )
  18846. }
  18847. function throwIfAborted (signal) {
  18848. if (!signal) { return }
  18849. if (typeof signal.throwIfAborted === 'function') {
  18850. signal.throwIfAborted()
  18851. } else {
  18852. if (signal.aborted) {
  18853. // DOMException not available < v17.0.0
  18854. const err = new Error('The operation was aborted')
  18855. err.name = 'AbortError'
  18856. throw err
  18857. }
  18858. }
  18859. }
  18860. function addAbortListener (signal, listener) {
  18861. if ('addEventListener' in signal) {
  18862. signal.addEventListener('abort', listener, { once: true })
  18863. return () => signal.removeEventListener('abort', listener)
  18864. }
  18865. signal.addListener('abort', listener)
  18866. return () => signal.removeListener('abort', listener)
  18867. }
  18868. const hasToWellFormed = !!String.prototype.toWellFormed
  18869. /**
  18870. * @param {string} val
  18871. */
  18872. function toUSVString (val) {
  18873. if (hasToWellFormed) {
  18874. return `${val}`.toWellFormed()
  18875. } else if (nodeUtil.toUSVString) {
  18876. return nodeUtil.toUSVString(val)
  18877. }
  18878. return `${val}`
  18879. }
  18880. // Parsed accordingly to RFC 9110
  18881. // https://www.rfc-editor.org/rfc/rfc9110#field.content-range
  18882. function parseRangeHeader (range) {
  18883. if (range == null || range === '') return { start: 0, end: null, size: null }
  18884. const m = range ? range.match(/^bytes (\d+)-(\d+)\/(\d+)?$/) : null
  18885. return m
  18886. ? {
  18887. start: parseInt(m[1]),
  18888. end: m[2] ? parseInt(m[2]) : null,
  18889. size: m[3] ? parseInt(m[3]) : null
  18890. }
  18891. : null
  18892. }
  18893. const kEnumerableProperty = Object.create(null)
  18894. kEnumerableProperty.enumerable = true
  18895. module.exports = {
  18896. kEnumerableProperty,
  18897. nop,
  18898. isDisturbed,
  18899. isErrored,
  18900. isReadable,
  18901. toUSVString,
  18902. isReadableAborted,
  18903. isBlobLike,
  18904. parseOrigin,
  18905. parseURL,
  18906. getServerName,
  18907. isStream,
  18908. isIterable,
  18909. isAsyncIterable,
  18910. isDestroyed,
  18911. headerNameToString,
  18912. parseRawHeaders,
  18913. parseHeaders,
  18914. parseKeepAliveTimeout,
  18915. destroy,
  18916. bodyLength,
  18917. deepClone,
  18918. ReadableStreamFrom,
  18919. isBuffer,
  18920. validateHandler,
  18921. getSocketInfo,
  18922. isFormDataLike,
  18923. buildURL,
  18924. throwIfAborted,
  18925. addAbortListener,
  18926. parseRangeHeader,
  18927. nodeMajor,
  18928. nodeMinor,
  18929. nodeHasAutoSelectFamily: nodeMajor > 18 || (nodeMajor === 18 && nodeMinor >= 13),
  18930. safeHTTPMethods: ['GET', 'HEAD', 'OPTIONS', 'TRACE']
  18931. }
  18932. /***/ }),
  18933. /***/ 4839:
  18934. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  18935. "use strict";
  18936. const Dispatcher = __nccwpck_require__(412)
  18937. const {
  18938. ClientDestroyedError,
  18939. ClientClosedError,
  18940. InvalidArgumentError
  18941. } = __nccwpck_require__(8045)
  18942. const { kDestroy, kClose, kDispatch, kInterceptors } = __nccwpck_require__(2785)
  18943. const kDestroyed = Symbol('destroyed')
  18944. const kClosed = Symbol('closed')
  18945. const kOnDestroyed = Symbol('onDestroyed')
  18946. const kOnClosed = Symbol('onClosed')
  18947. const kInterceptedDispatch = Symbol('Intercepted Dispatch')
  18948. class DispatcherBase extends Dispatcher {
  18949. constructor () {
  18950. super()
  18951. this[kDestroyed] = false
  18952. this[kOnDestroyed] = null
  18953. this[kClosed] = false
  18954. this[kOnClosed] = []
  18955. }
  18956. get destroyed () {
  18957. return this[kDestroyed]
  18958. }
  18959. get closed () {
  18960. return this[kClosed]
  18961. }
  18962. get interceptors () {
  18963. return this[kInterceptors]
  18964. }
  18965. set interceptors (newInterceptors) {
  18966. if (newInterceptors) {
  18967. for (let i = newInterceptors.length - 1; i >= 0; i--) {
  18968. const interceptor = this[kInterceptors][i]
  18969. if (typeof interceptor !== 'function') {
  18970. throw new InvalidArgumentError('interceptor must be an function')
  18971. }
  18972. }
  18973. }
  18974. this[kInterceptors] = newInterceptors
  18975. }
  18976. close (callback) {
  18977. if (callback === undefined) {
  18978. return new Promise((resolve, reject) => {
  18979. this.close((err, data) => {
  18980. return err ? reject(err) : resolve(data)
  18981. })
  18982. })
  18983. }
  18984. if (typeof callback !== 'function') {
  18985. throw new InvalidArgumentError('invalid callback')
  18986. }
  18987. if (this[kDestroyed]) {
  18988. queueMicrotask(() => callback(new ClientDestroyedError(), null))
  18989. return
  18990. }
  18991. if (this[kClosed]) {
  18992. if (this[kOnClosed]) {
  18993. this[kOnClosed].push(callback)
  18994. } else {
  18995. queueMicrotask(() => callback(null, null))
  18996. }
  18997. return
  18998. }
  18999. this[kClosed] = true
  19000. this[kOnClosed].push(callback)
  19001. const onClosed = () => {
  19002. const callbacks = this[kOnClosed]
  19003. this[kOnClosed] = null
  19004. for (let i = 0; i < callbacks.length; i++) {
  19005. callbacks[i](null, null)
  19006. }
  19007. }
  19008. // Should not error.
  19009. this[kClose]()
  19010. .then(() => this.destroy())
  19011. .then(() => {
  19012. queueMicrotask(onClosed)
  19013. })
  19014. }
  19015. destroy (err, callback) {
  19016. if (typeof err === 'function') {
  19017. callback = err
  19018. err = null
  19019. }
  19020. if (callback === undefined) {
  19021. return new Promise((resolve, reject) => {
  19022. this.destroy(err, (err, data) => {
  19023. return err ? /* istanbul ignore next: should never error */ reject(err) : resolve(data)
  19024. })
  19025. })
  19026. }
  19027. if (typeof callback !== 'function') {
  19028. throw new InvalidArgumentError('invalid callback')
  19029. }
  19030. if (this[kDestroyed]) {
  19031. if (this[kOnDestroyed]) {
  19032. this[kOnDestroyed].push(callback)
  19033. } else {
  19034. queueMicrotask(() => callback(null, null))
  19035. }
  19036. return
  19037. }
  19038. if (!err) {
  19039. err = new ClientDestroyedError()
  19040. }
  19041. this[kDestroyed] = true
  19042. this[kOnDestroyed] = this[kOnDestroyed] || []
  19043. this[kOnDestroyed].push(callback)
  19044. const onDestroyed = () => {
  19045. const callbacks = this[kOnDestroyed]
  19046. this[kOnDestroyed] = null
  19047. for (let i = 0; i < callbacks.length; i++) {
  19048. callbacks[i](null, null)
  19049. }
  19050. }
  19051. // Should not error.
  19052. this[kDestroy](err).then(() => {
  19053. queueMicrotask(onDestroyed)
  19054. })
  19055. }
  19056. [kInterceptedDispatch] (opts, handler) {
  19057. if (!this[kInterceptors] || this[kInterceptors].length === 0) {
  19058. this[kInterceptedDispatch] = this[kDispatch]
  19059. return this[kDispatch](opts, handler)
  19060. }
  19061. let dispatch = this[kDispatch].bind(this)
  19062. for (let i = this[kInterceptors].length - 1; i >= 0; i--) {
  19063. dispatch = this[kInterceptors][i](dispatch)
  19064. }
  19065. this[kInterceptedDispatch] = dispatch
  19066. return dispatch(opts, handler)
  19067. }
  19068. dispatch (opts, handler) {
  19069. if (!handler || typeof handler !== 'object') {
  19070. throw new InvalidArgumentError('handler must be an object')
  19071. }
  19072. try {
  19073. if (!opts || typeof opts !== 'object') {
  19074. throw new InvalidArgumentError('opts must be an object.')
  19075. }
  19076. if (this[kDestroyed] || this[kOnDestroyed]) {
  19077. throw new ClientDestroyedError()
  19078. }
  19079. if (this[kClosed]) {
  19080. throw new ClientClosedError()
  19081. }
  19082. return this[kInterceptedDispatch](opts, handler)
  19083. } catch (err) {
  19084. if (typeof handler.onError !== 'function') {
  19085. throw new InvalidArgumentError('invalid onError method')
  19086. }
  19087. handler.onError(err)
  19088. return false
  19089. }
  19090. }
  19091. }
  19092. module.exports = DispatcherBase
  19093. /***/ }),
  19094. /***/ 412:
  19095. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  19096. "use strict";
  19097. const EventEmitter = __nccwpck_require__(2361)
  19098. class Dispatcher extends EventEmitter {
  19099. dispatch () {
  19100. throw new Error('not implemented')
  19101. }
  19102. close () {
  19103. throw new Error('not implemented')
  19104. }
  19105. destroy () {
  19106. throw new Error('not implemented')
  19107. }
  19108. }
  19109. module.exports = Dispatcher
  19110. /***/ }),
  19111. /***/ 9990:
  19112. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  19113. "use strict";
  19114. const Busboy = __nccwpck_require__(727)
  19115. const util = __nccwpck_require__(3983)
  19116. const {
  19117. ReadableStreamFrom,
  19118. isBlobLike,
  19119. isReadableStreamLike,
  19120. readableStreamClose,
  19121. createDeferredPromise,
  19122. fullyReadBody
  19123. } = __nccwpck_require__(2538)
  19124. const { FormData } = __nccwpck_require__(2015)
  19125. const { kState } = __nccwpck_require__(5861)
  19126. const { webidl } = __nccwpck_require__(1744)
  19127. const { DOMException, structuredClone } = __nccwpck_require__(1037)
  19128. const { Blob, File: NativeFile } = __nccwpck_require__(4300)
  19129. const { kBodyUsed } = __nccwpck_require__(2785)
  19130. const assert = __nccwpck_require__(9491)
  19131. const { isErrored } = __nccwpck_require__(3983)
  19132. const { isUint8Array, isArrayBuffer } = __nccwpck_require__(9830)
  19133. const { File: UndiciFile } = __nccwpck_require__(8511)
  19134. const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(685)
  19135. let ReadableStream = globalThis.ReadableStream
  19136. /** @type {globalThis['File']} */
  19137. const File = NativeFile ?? UndiciFile
  19138. const textEncoder = new TextEncoder()
  19139. const textDecoder = new TextDecoder()
  19140. // https://fetch.spec.whatwg.org/#concept-bodyinit-extract
  19141. function extractBody (object, keepalive = false) {
  19142. if (!ReadableStream) {
  19143. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  19144. }
  19145. // 1. Let stream be null.
  19146. let stream = null
  19147. // 2. If object is a ReadableStream object, then set stream to object.
  19148. if (object instanceof ReadableStream) {
  19149. stream = object
  19150. } else if (isBlobLike(object)) {
  19151. // 3. Otherwise, if object is a Blob object, set stream to the
  19152. // result of running object’s get stream.
  19153. stream = object.stream()
  19154. } else {
  19155. // 4. Otherwise, set stream to a new ReadableStream object, and set
  19156. // up stream.
  19157. stream = new ReadableStream({
  19158. async pull (controller) {
  19159. controller.enqueue(
  19160. typeof source === 'string' ? textEncoder.encode(source) : source
  19161. )
  19162. queueMicrotask(() => readableStreamClose(controller))
  19163. },
  19164. start () {},
  19165. type: undefined
  19166. })
  19167. }
  19168. // 5. Assert: stream is a ReadableStream object.
  19169. assert(isReadableStreamLike(stream))
  19170. // 6. Let action be null.
  19171. let action = null
  19172. // 7. Let source be null.
  19173. let source = null
  19174. // 8. Let length be null.
  19175. let length = null
  19176. // 9. Let type be null.
  19177. let type = null
  19178. // 10. Switch on object:
  19179. if (typeof object === 'string') {
  19180. // Set source to the UTF-8 encoding of object.
  19181. // Note: setting source to a Uint8Array here breaks some mocking assumptions.
  19182. source = object
  19183. // Set type to `text/plain;charset=UTF-8`.
  19184. type = 'text/plain;charset=UTF-8'
  19185. } else if (object instanceof URLSearchParams) {
  19186. // URLSearchParams
  19187. // spec says to run application/x-www-form-urlencoded on body.list
  19188. // this is implemented in Node.js as apart of an URLSearchParams instance toString method
  19189. // See: https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/lib/internal/url.js#L490
  19190. // and https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/lib/internal/url.js#L1100
  19191. // Set source to the result of running the application/x-www-form-urlencoded serializer with object’s list.
  19192. source = object.toString()
  19193. // Set type to `application/x-www-form-urlencoded;charset=UTF-8`.
  19194. type = 'application/x-www-form-urlencoded;charset=UTF-8'
  19195. } else if (isArrayBuffer(object)) {
  19196. // BufferSource/ArrayBuffer
  19197. // Set source to a copy of the bytes held by object.
  19198. source = new Uint8Array(object.slice())
  19199. } else if (ArrayBuffer.isView(object)) {
  19200. // BufferSource/ArrayBufferView
  19201. // Set source to a copy of the bytes held by object.
  19202. source = new Uint8Array(object.buffer.slice(object.byteOffset, object.byteOffset + object.byteLength))
  19203. } else if (util.isFormDataLike(object)) {
  19204. const boundary = `----formdata-undici-0${`${Math.floor(Math.random() * 1e11)}`.padStart(11, '0')}`
  19205. const prefix = `--${boundary}\r\nContent-Disposition: form-data`
  19206. /*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */
  19207. const escape = (str) =>
  19208. str.replace(/\n/g, '%0A').replace(/\r/g, '%0D').replace(/"/g, '%22')
  19209. const normalizeLinefeeds = (value) => value.replace(/\r?\n|\r/g, '\r\n')
  19210. // Set action to this step: run the multipart/form-data
  19211. // encoding algorithm, with object’s entry list and UTF-8.
  19212. // - This ensures that the body is immutable and can't be changed afterwords
  19213. // - That the content-length is calculated in advance.
  19214. // - And that all parts are pre-encoded and ready to be sent.
  19215. const blobParts = []
  19216. const rn = new Uint8Array([13, 10]) // '\r\n'
  19217. length = 0
  19218. let hasUnknownSizeValue = false
  19219. for (const [name, value] of object) {
  19220. if (typeof value === 'string') {
  19221. const chunk = textEncoder.encode(prefix +
  19222. `; name="${escape(normalizeLinefeeds(name))}"` +
  19223. `\r\n\r\n${normalizeLinefeeds(value)}\r\n`)
  19224. blobParts.push(chunk)
  19225. length += chunk.byteLength
  19226. } else {
  19227. const chunk = textEncoder.encode(`${prefix}; name="${escape(normalizeLinefeeds(name))}"` +
  19228. (value.name ? `; filename="${escape(value.name)}"` : '') + '\r\n' +
  19229. `Content-Type: ${
  19230. value.type || 'application/octet-stream'
  19231. }\r\n\r\n`)
  19232. blobParts.push(chunk, value, rn)
  19233. if (typeof value.size === 'number') {
  19234. length += chunk.byteLength + value.size + rn.byteLength
  19235. } else {
  19236. hasUnknownSizeValue = true
  19237. }
  19238. }
  19239. }
  19240. const chunk = textEncoder.encode(`--${boundary}--`)
  19241. blobParts.push(chunk)
  19242. length += chunk.byteLength
  19243. if (hasUnknownSizeValue) {
  19244. length = null
  19245. }
  19246. // Set source to object.
  19247. source = object
  19248. action = async function * () {
  19249. for (const part of blobParts) {
  19250. if (part.stream) {
  19251. yield * part.stream()
  19252. } else {
  19253. yield part
  19254. }
  19255. }
  19256. }
  19257. // Set type to `multipart/form-data; boundary=`,
  19258. // followed by the multipart/form-data boundary string generated
  19259. // by the multipart/form-data encoding algorithm.
  19260. type = 'multipart/form-data; boundary=' + boundary
  19261. } else if (isBlobLike(object)) {
  19262. // Blob
  19263. // Set source to object.
  19264. source = object
  19265. // Set length to object’s size.
  19266. length = object.size
  19267. // If object’s type attribute is not the empty byte sequence, set
  19268. // type to its value.
  19269. if (object.type) {
  19270. type = object.type
  19271. }
  19272. } else if (typeof object[Symbol.asyncIterator] === 'function') {
  19273. // If keepalive is true, then throw a TypeError.
  19274. if (keepalive) {
  19275. throw new TypeError('keepalive')
  19276. }
  19277. // If object is disturbed or locked, then throw a TypeError.
  19278. if (util.isDisturbed(object) || object.locked) {
  19279. throw new TypeError(
  19280. 'Response body object should not be disturbed or locked'
  19281. )
  19282. }
  19283. stream =
  19284. object instanceof ReadableStream ? object : ReadableStreamFrom(object)
  19285. }
  19286. // 11. If source is a byte sequence, then set action to a
  19287. // step that returns source and length to source’s length.
  19288. if (typeof source === 'string' || util.isBuffer(source)) {
  19289. length = Buffer.byteLength(source)
  19290. }
  19291. // 12. If action is non-null, then run these steps in in parallel:
  19292. if (action != null) {
  19293. // Run action.
  19294. let iterator
  19295. stream = new ReadableStream({
  19296. async start () {
  19297. iterator = action(object)[Symbol.asyncIterator]()
  19298. },
  19299. async pull (controller) {
  19300. const { value, done } = await iterator.next()
  19301. if (done) {
  19302. // When running action is done, close stream.
  19303. queueMicrotask(() => {
  19304. controller.close()
  19305. })
  19306. } else {
  19307. // Whenever one or more bytes are available and stream is not errored,
  19308. // enqueue a Uint8Array wrapping an ArrayBuffer containing the available
  19309. // bytes into stream.
  19310. if (!isErrored(stream)) {
  19311. controller.enqueue(new Uint8Array(value))
  19312. }
  19313. }
  19314. return controller.desiredSize > 0
  19315. },
  19316. async cancel (reason) {
  19317. await iterator.return()
  19318. },
  19319. type: undefined
  19320. })
  19321. }
  19322. // 13. Let body be a body whose stream is stream, source is source,
  19323. // and length is length.
  19324. const body = { stream, source, length }
  19325. // 14. Return (body, type).
  19326. return [body, type]
  19327. }
  19328. // https://fetch.spec.whatwg.org/#bodyinit-safely-extract
  19329. function safelyExtractBody (object, keepalive = false) {
  19330. if (!ReadableStream) {
  19331. // istanbul ignore next
  19332. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  19333. }
  19334. // To safely extract a body and a `Content-Type` value from
  19335. // a byte sequence or BodyInit object object, run these steps:
  19336. // 1. If object is a ReadableStream object, then:
  19337. if (object instanceof ReadableStream) {
  19338. // Assert: object is neither disturbed nor locked.
  19339. // istanbul ignore next
  19340. assert(!util.isDisturbed(object), 'The body has already been consumed.')
  19341. // istanbul ignore next
  19342. assert(!object.locked, 'The stream is locked.')
  19343. }
  19344. // 2. Return the results of extracting object.
  19345. return extractBody(object, keepalive)
  19346. }
  19347. function cloneBody (body) {
  19348. // To clone a body body, run these steps:
  19349. // https://fetch.spec.whatwg.org/#concept-body-clone
  19350. // 1. Let « out1, out2 » be the result of teeing body’s stream.
  19351. const [out1, out2] = body.stream.tee()
  19352. const out2Clone = structuredClone(out2, { transfer: [out2] })
  19353. // This, for whatever reasons, unrefs out2Clone which allows
  19354. // the process to exit by itself.
  19355. const [, finalClone] = out2Clone.tee()
  19356. // 2. Set body’s stream to out1.
  19357. body.stream = out1
  19358. // 3. Return a body whose stream is out2 and other members are copied from body.
  19359. return {
  19360. stream: finalClone,
  19361. length: body.length,
  19362. source: body.source
  19363. }
  19364. }
  19365. async function * consumeBody (body) {
  19366. if (body) {
  19367. if (isUint8Array(body)) {
  19368. yield body
  19369. } else {
  19370. const stream = body.stream
  19371. if (util.isDisturbed(stream)) {
  19372. throw new TypeError('The body has already been consumed.')
  19373. }
  19374. if (stream.locked) {
  19375. throw new TypeError('The stream is locked.')
  19376. }
  19377. // Compat.
  19378. stream[kBodyUsed] = true
  19379. yield * stream
  19380. }
  19381. }
  19382. }
  19383. function throwIfAborted (state) {
  19384. if (state.aborted) {
  19385. throw new DOMException('The operation was aborted.', 'AbortError')
  19386. }
  19387. }
  19388. function bodyMixinMethods (instance) {
  19389. const methods = {
  19390. blob () {
  19391. // The blob() method steps are to return the result of
  19392. // running consume body with this and the following step
  19393. // given a byte sequence bytes: return a Blob whose
  19394. // contents are bytes and whose type attribute is this’s
  19395. // MIME type.
  19396. return specConsumeBody(this, (bytes) => {
  19397. let mimeType = bodyMimeType(this)
  19398. if (mimeType === 'failure') {
  19399. mimeType = ''
  19400. } else if (mimeType) {
  19401. mimeType = serializeAMimeType(mimeType)
  19402. }
  19403. // Return a Blob whose contents are bytes and type attribute
  19404. // is mimeType.
  19405. return new Blob([bytes], { type: mimeType })
  19406. }, instance)
  19407. },
  19408. arrayBuffer () {
  19409. // The arrayBuffer() method steps are to return the result
  19410. // of running consume body with this and the following step
  19411. // given a byte sequence bytes: return a new ArrayBuffer
  19412. // whose contents are bytes.
  19413. return specConsumeBody(this, (bytes) => {
  19414. return new Uint8Array(bytes).buffer
  19415. }, instance)
  19416. },
  19417. text () {
  19418. // The text() method steps are to return the result of running
  19419. // consume body with this and UTF-8 decode.
  19420. return specConsumeBody(this, utf8DecodeBytes, instance)
  19421. },
  19422. json () {
  19423. // The json() method steps are to return the result of running
  19424. // consume body with this and parse JSON from bytes.
  19425. return specConsumeBody(this, parseJSONFromBytes, instance)
  19426. },
  19427. async formData () {
  19428. webidl.brandCheck(this, instance)
  19429. throwIfAborted(this[kState])
  19430. const contentType = this.headers.get('Content-Type')
  19431. // If mimeType’s essence is "multipart/form-data", then:
  19432. if (/multipart\/form-data/.test(contentType)) {
  19433. const headers = {}
  19434. for (const [key, value] of this.headers) headers[key.toLowerCase()] = value
  19435. const responseFormData = new FormData()
  19436. let busboy
  19437. try {
  19438. busboy = new Busboy({
  19439. headers,
  19440. preservePath: true
  19441. })
  19442. } catch (err) {
  19443. throw new DOMException(`${err}`, 'AbortError')
  19444. }
  19445. busboy.on('field', (name, value) => {
  19446. responseFormData.append(name, value)
  19447. })
  19448. busboy.on('file', (name, value, filename, encoding, mimeType) => {
  19449. const chunks = []
  19450. if (encoding === 'base64' || encoding.toLowerCase() === 'base64') {
  19451. let base64chunk = ''
  19452. value.on('data', (chunk) => {
  19453. base64chunk += chunk.toString().replace(/[\r\n]/gm, '')
  19454. const end = base64chunk.length - base64chunk.length % 4
  19455. chunks.push(Buffer.from(base64chunk.slice(0, end), 'base64'))
  19456. base64chunk = base64chunk.slice(end)
  19457. })
  19458. value.on('end', () => {
  19459. chunks.push(Buffer.from(base64chunk, 'base64'))
  19460. responseFormData.append(name, new File(chunks, filename, { type: mimeType }))
  19461. })
  19462. } else {
  19463. value.on('data', (chunk) => {
  19464. chunks.push(chunk)
  19465. })
  19466. value.on('end', () => {
  19467. responseFormData.append(name, new File(chunks, filename, { type: mimeType }))
  19468. })
  19469. }
  19470. })
  19471. const busboyResolve = new Promise((resolve, reject) => {
  19472. busboy.on('finish', resolve)
  19473. busboy.on('error', (err) => reject(new TypeError(err)))
  19474. })
  19475. if (this.body !== null) for await (const chunk of consumeBody(this[kState].body)) busboy.write(chunk)
  19476. busboy.end()
  19477. await busboyResolve
  19478. return responseFormData
  19479. } else if (/application\/x-www-form-urlencoded/.test(contentType)) {
  19480. // Otherwise, if mimeType’s essence is "application/x-www-form-urlencoded", then:
  19481. // 1. Let entries be the result of parsing bytes.
  19482. let entries
  19483. try {
  19484. let text = ''
  19485. // application/x-www-form-urlencoded parser will keep the BOM.
  19486. // https://url.spec.whatwg.org/#concept-urlencoded-parser
  19487. // Note that streaming decoder is stateful and cannot be reused
  19488. const streamingDecoder = new TextDecoder('utf-8', { ignoreBOM: true })
  19489. for await (const chunk of consumeBody(this[kState].body)) {
  19490. if (!isUint8Array(chunk)) {
  19491. throw new TypeError('Expected Uint8Array chunk')
  19492. }
  19493. text += streamingDecoder.decode(chunk, { stream: true })
  19494. }
  19495. text += streamingDecoder.decode()
  19496. entries = new URLSearchParams(text)
  19497. } catch (err) {
  19498. // istanbul ignore next: Unclear when new URLSearchParams can fail on a string.
  19499. // 2. If entries is failure, then throw a TypeError.
  19500. throw Object.assign(new TypeError(), { cause: err })
  19501. }
  19502. // 3. Return a new FormData object whose entries are entries.
  19503. const formData = new FormData()
  19504. for (const [name, value] of entries) {
  19505. formData.append(name, value)
  19506. }
  19507. return formData
  19508. } else {
  19509. // Wait a tick before checking if the request has been aborted.
  19510. // Otherwise, a TypeError can be thrown when an AbortError should.
  19511. await Promise.resolve()
  19512. throwIfAborted(this[kState])
  19513. // Otherwise, throw a TypeError.
  19514. throw webidl.errors.exception({
  19515. header: `${instance.name}.formData`,
  19516. message: 'Could not parse content as FormData.'
  19517. })
  19518. }
  19519. }
  19520. }
  19521. return methods
  19522. }
  19523. function mixinBody (prototype) {
  19524. Object.assign(prototype.prototype, bodyMixinMethods(prototype))
  19525. }
  19526. /**
  19527. * @see https://fetch.spec.whatwg.org/#concept-body-consume-body
  19528. * @param {Response|Request} object
  19529. * @param {(value: unknown) => unknown} convertBytesToJSValue
  19530. * @param {Response|Request} instance
  19531. */
  19532. async function specConsumeBody (object, convertBytesToJSValue, instance) {
  19533. webidl.brandCheck(object, instance)
  19534. throwIfAborted(object[kState])
  19535. // 1. If object is unusable, then return a promise rejected
  19536. // with a TypeError.
  19537. if (bodyUnusable(object[kState].body)) {
  19538. throw new TypeError('Body is unusable')
  19539. }
  19540. // 2. Let promise be a new promise.
  19541. const promise = createDeferredPromise()
  19542. // 3. Let errorSteps given error be to reject promise with error.
  19543. const errorSteps = (error) => promise.reject(error)
  19544. // 4. Let successSteps given a byte sequence data be to resolve
  19545. // promise with the result of running convertBytesToJSValue
  19546. // with data. If that threw an exception, then run errorSteps
  19547. // with that exception.
  19548. const successSteps = (data) => {
  19549. try {
  19550. promise.resolve(convertBytesToJSValue(data))
  19551. } catch (e) {
  19552. errorSteps(e)
  19553. }
  19554. }
  19555. // 5. If object’s body is null, then run successSteps with an
  19556. // empty byte sequence.
  19557. if (object[kState].body == null) {
  19558. successSteps(new Uint8Array())
  19559. return promise.promise
  19560. }
  19561. // 6. Otherwise, fully read object’s body given successSteps,
  19562. // errorSteps, and object’s relevant global object.
  19563. await fullyReadBody(object[kState].body, successSteps, errorSteps)
  19564. // 7. Return promise.
  19565. return promise.promise
  19566. }
  19567. // https://fetch.spec.whatwg.org/#body-unusable
  19568. function bodyUnusable (body) {
  19569. // An object including the Body interface mixin is
  19570. // said to be unusable if its body is non-null and
  19571. // its body’s stream is disturbed or locked.
  19572. return body != null && (body.stream.locked || util.isDisturbed(body.stream))
  19573. }
  19574. /**
  19575. * @see https://encoding.spec.whatwg.org/#utf-8-decode
  19576. * @param {Buffer} buffer
  19577. */
  19578. function utf8DecodeBytes (buffer) {
  19579. if (buffer.length === 0) {
  19580. return ''
  19581. }
  19582. // 1. Let buffer be the result of peeking three bytes from
  19583. // ioQueue, converted to a byte sequence.
  19584. // 2. If buffer is 0xEF 0xBB 0xBF, then read three
  19585. // bytes from ioQueue. (Do nothing with those bytes.)
  19586. if (buffer[0] === 0xEF && buffer[1] === 0xBB && buffer[2] === 0xBF) {
  19587. buffer = buffer.subarray(3)
  19588. }
  19589. // 3. Process a queue with an instance of UTF-8’s
  19590. // decoder, ioQueue, output, and "replacement".
  19591. const output = textDecoder.decode(buffer)
  19592. // 4. Return output.
  19593. return output
  19594. }
  19595. /**
  19596. * @see https://infra.spec.whatwg.org/#parse-json-bytes-to-a-javascript-value
  19597. * @param {Uint8Array} bytes
  19598. */
  19599. function parseJSONFromBytes (bytes) {
  19600. return JSON.parse(utf8DecodeBytes(bytes))
  19601. }
  19602. /**
  19603. * @see https://fetch.spec.whatwg.org/#concept-body-mime-type
  19604. * @param {import('./response').Response|import('./request').Request} object
  19605. */
  19606. function bodyMimeType (object) {
  19607. const { headersList } = object[kState]
  19608. const contentType = headersList.get('content-type')
  19609. if (contentType === null) {
  19610. return 'failure'
  19611. }
  19612. return parseMIMEType(contentType)
  19613. }
  19614. module.exports = {
  19615. extractBody,
  19616. safelyExtractBody,
  19617. cloneBody,
  19618. mixinBody
  19619. }
  19620. /***/ }),
  19621. /***/ 1037:
  19622. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  19623. "use strict";
  19624. const { MessageChannel, receiveMessageOnPort } = __nccwpck_require__(1267)
  19625. const corsSafeListedMethods = ['GET', 'HEAD', 'POST']
  19626. const corsSafeListedMethodsSet = new Set(corsSafeListedMethods)
  19627. const nullBodyStatus = [101, 204, 205, 304]
  19628. const redirectStatus = [301, 302, 303, 307, 308]
  19629. const redirectStatusSet = new Set(redirectStatus)
  19630. // https://fetch.spec.whatwg.org/#block-bad-port
  19631. const badPorts = [
  19632. '1', '7', '9', '11', '13', '15', '17', '19', '20', '21', '22', '23', '25', '37', '42', '43', '53', '69', '77', '79',
  19633. '87', '95', '101', '102', '103', '104', '109', '110', '111', '113', '115', '117', '119', '123', '135', '137',
  19634. '139', '143', '161', '179', '389', '427', '465', '512', '513', '514', '515', '526', '530', '531', '532',
  19635. '540', '548', '554', '556', '563', '587', '601', '636', '989', '990', '993', '995', '1719', '1720', '1723',
  19636. '2049', '3659', '4045', '5060', '5061', '6000', '6566', '6665', '6666', '6667', '6668', '6669', '6697',
  19637. '10080'
  19638. ]
  19639. const badPortsSet = new Set(badPorts)
  19640. // https://w3c.github.io/webappsec-referrer-policy/#referrer-policies
  19641. const referrerPolicy = [
  19642. '',
  19643. 'no-referrer',
  19644. 'no-referrer-when-downgrade',
  19645. 'same-origin',
  19646. 'origin',
  19647. 'strict-origin',
  19648. 'origin-when-cross-origin',
  19649. 'strict-origin-when-cross-origin',
  19650. 'unsafe-url'
  19651. ]
  19652. const referrerPolicySet = new Set(referrerPolicy)
  19653. const requestRedirect = ['follow', 'manual', 'error']
  19654. const safeMethods = ['GET', 'HEAD', 'OPTIONS', 'TRACE']
  19655. const safeMethodsSet = new Set(safeMethods)
  19656. const requestMode = ['navigate', 'same-origin', 'no-cors', 'cors']
  19657. const requestCredentials = ['omit', 'same-origin', 'include']
  19658. const requestCache = [
  19659. 'default',
  19660. 'no-store',
  19661. 'reload',
  19662. 'no-cache',
  19663. 'force-cache',
  19664. 'only-if-cached'
  19665. ]
  19666. // https://fetch.spec.whatwg.org/#request-body-header-name
  19667. const requestBodyHeader = [
  19668. 'content-encoding',
  19669. 'content-language',
  19670. 'content-location',
  19671. 'content-type',
  19672. // See https://github.com/nodejs/undici/issues/2021
  19673. // 'Content-Length' is a forbidden header name, which is typically
  19674. // removed in the Headers implementation. However, undici doesn't
  19675. // filter out headers, so we add it here.
  19676. 'content-length'
  19677. ]
  19678. // https://fetch.spec.whatwg.org/#enumdef-requestduplex
  19679. const requestDuplex = [
  19680. 'half'
  19681. ]
  19682. // http://fetch.spec.whatwg.org/#forbidden-method
  19683. const forbiddenMethods = ['CONNECT', 'TRACE', 'TRACK']
  19684. const forbiddenMethodsSet = new Set(forbiddenMethods)
  19685. const subresource = [
  19686. 'audio',
  19687. 'audioworklet',
  19688. 'font',
  19689. 'image',
  19690. 'manifest',
  19691. 'paintworklet',
  19692. 'script',
  19693. 'style',
  19694. 'track',
  19695. 'video',
  19696. 'xslt',
  19697. ''
  19698. ]
  19699. const subresourceSet = new Set(subresource)
  19700. /** @type {globalThis['DOMException']} */
  19701. const DOMException = globalThis.DOMException ?? (() => {
  19702. // DOMException was only made a global in Node v17.0.0,
  19703. // but fetch supports >= v16.8.
  19704. try {
  19705. atob('~')
  19706. } catch (err) {
  19707. return Object.getPrototypeOf(err).constructor
  19708. }
  19709. })()
  19710. let channel
  19711. /** @type {globalThis['structuredClone']} */
  19712. const structuredClone =
  19713. globalThis.structuredClone ??
  19714. // https://github.com/nodejs/node/blob/b27ae24dcc4251bad726d9d84baf678d1f707fed/lib/internal/structured_clone.js
  19715. // structuredClone was added in v17.0.0, but fetch supports v16.8
  19716. function structuredClone (value, options = undefined) {
  19717. if (arguments.length === 0) {
  19718. throw new TypeError('missing argument')
  19719. }
  19720. if (!channel) {
  19721. channel = new MessageChannel()
  19722. }
  19723. channel.port1.unref()
  19724. channel.port2.unref()
  19725. channel.port1.postMessage(value, options?.transfer)
  19726. return receiveMessageOnPort(channel.port2).message
  19727. }
  19728. module.exports = {
  19729. DOMException,
  19730. structuredClone,
  19731. subresource,
  19732. forbiddenMethods,
  19733. requestBodyHeader,
  19734. referrerPolicy,
  19735. requestRedirect,
  19736. requestMode,
  19737. requestCredentials,
  19738. requestCache,
  19739. redirectStatus,
  19740. corsSafeListedMethods,
  19741. nullBodyStatus,
  19742. safeMethods,
  19743. badPorts,
  19744. requestDuplex,
  19745. subresourceSet,
  19746. badPortsSet,
  19747. redirectStatusSet,
  19748. corsSafeListedMethodsSet,
  19749. safeMethodsSet,
  19750. forbiddenMethodsSet,
  19751. referrerPolicySet
  19752. }
  19753. /***/ }),
  19754. /***/ 685:
  19755. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  19756. const assert = __nccwpck_require__(9491)
  19757. const { atob } = __nccwpck_require__(4300)
  19758. const { isomorphicDecode } = __nccwpck_require__(2538)
  19759. const encoder = new TextEncoder()
  19760. /**
  19761. * @see https://mimesniff.spec.whatwg.org/#http-token-code-point
  19762. */
  19763. const HTTP_TOKEN_CODEPOINTS = /^[!#$%&'*+-.^_|~A-Za-z0-9]+$/
  19764. const HTTP_WHITESPACE_REGEX = /(\u000A|\u000D|\u0009|\u0020)/ // eslint-disable-line
  19765. /**
  19766. * @see https://mimesniff.spec.whatwg.org/#http-quoted-string-token-code-point
  19767. */
  19768. const HTTP_QUOTED_STRING_TOKENS = /[\u0009|\u0020-\u007E|\u0080-\u00FF]/ // eslint-disable-line
  19769. // https://fetch.spec.whatwg.org/#data-url-processor
  19770. /** @param {URL} dataURL */
  19771. function dataURLProcessor (dataURL) {
  19772. // 1. Assert: dataURL’s scheme is "data".
  19773. assert(dataURL.protocol === 'data:')
  19774. // 2. Let input be the result of running the URL
  19775. // serializer on dataURL with exclude fragment
  19776. // set to true.
  19777. let input = URLSerializer(dataURL, true)
  19778. // 3. Remove the leading "data:" string from input.
  19779. input = input.slice(5)
  19780. // 4. Let position point at the start of input.
  19781. const position = { position: 0 }
  19782. // 5. Let mimeType be the result of collecting a
  19783. // sequence of code points that are not equal
  19784. // to U+002C (,), given position.
  19785. let mimeType = collectASequenceOfCodePointsFast(
  19786. ',',
  19787. input,
  19788. position
  19789. )
  19790. // 6. Strip leading and trailing ASCII whitespace
  19791. // from mimeType.
  19792. // Undici implementation note: we need to store the
  19793. // length because if the mimetype has spaces removed,
  19794. // the wrong amount will be sliced from the input in
  19795. // step #9
  19796. const mimeTypeLength = mimeType.length
  19797. mimeType = removeASCIIWhitespace(mimeType, true, true)
  19798. // 7. If position is past the end of input, then
  19799. // return failure
  19800. if (position.position >= input.length) {
  19801. return 'failure'
  19802. }
  19803. // 8. Advance position by 1.
  19804. position.position++
  19805. // 9. Let encodedBody be the remainder of input.
  19806. const encodedBody = input.slice(mimeTypeLength + 1)
  19807. // 10. Let body be the percent-decoding of encodedBody.
  19808. let body = stringPercentDecode(encodedBody)
  19809. // 11. If mimeType ends with U+003B (;), followed by
  19810. // zero or more U+0020 SPACE, followed by an ASCII
  19811. // case-insensitive match for "base64", then:
  19812. if (/;(\u0020){0,}base64$/i.test(mimeType)) {
  19813. // 1. Let stringBody be the isomorphic decode of body.
  19814. const stringBody = isomorphicDecode(body)
  19815. // 2. Set body to the forgiving-base64 decode of
  19816. // stringBody.
  19817. body = forgivingBase64(stringBody)
  19818. // 3. If body is failure, then return failure.
  19819. if (body === 'failure') {
  19820. return 'failure'
  19821. }
  19822. // 4. Remove the last 6 code points from mimeType.
  19823. mimeType = mimeType.slice(0, -6)
  19824. // 5. Remove trailing U+0020 SPACE code points from mimeType,
  19825. // if any.
  19826. mimeType = mimeType.replace(/(\u0020)+$/, '')
  19827. // 6. Remove the last U+003B (;) code point from mimeType.
  19828. mimeType = mimeType.slice(0, -1)
  19829. }
  19830. // 12. If mimeType starts with U+003B (;), then prepend
  19831. // "text/plain" to mimeType.
  19832. if (mimeType.startsWith(';')) {
  19833. mimeType = 'text/plain' + mimeType
  19834. }
  19835. // 13. Let mimeTypeRecord be the result of parsing
  19836. // mimeType.
  19837. let mimeTypeRecord = parseMIMEType(mimeType)
  19838. // 14. If mimeTypeRecord is failure, then set
  19839. // mimeTypeRecord to text/plain;charset=US-ASCII.
  19840. if (mimeTypeRecord === 'failure') {
  19841. mimeTypeRecord = parseMIMEType('text/plain;charset=US-ASCII')
  19842. }
  19843. // 15. Return a new data: URL struct whose MIME
  19844. // type is mimeTypeRecord and body is body.
  19845. // https://fetch.spec.whatwg.org/#data-url-struct
  19846. return { mimeType: mimeTypeRecord, body }
  19847. }
  19848. // https://url.spec.whatwg.org/#concept-url-serializer
  19849. /**
  19850. * @param {URL} url
  19851. * @param {boolean} excludeFragment
  19852. */
  19853. function URLSerializer (url, excludeFragment = false) {
  19854. if (!excludeFragment) {
  19855. return url.href
  19856. }
  19857. const href = url.href
  19858. const hashLength = url.hash.length
  19859. return hashLength === 0 ? href : href.substring(0, href.length - hashLength)
  19860. }
  19861. // https://infra.spec.whatwg.org/#collect-a-sequence-of-code-points
  19862. /**
  19863. * @param {(char: string) => boolean} condition
  19864. * @param {string} input
  19865. * @param {{ position: number }} position
  19866. */
  19867. function collectASequenceOfCodePoints (condition, input, position) {
  19868. // 1. Let result be the empty string.
  19869. let result = ''
  19870. // 2. While position doesn’t point past the end of input and the
  19871. // code point at position within input meets the condition condition:
  19872. while (position.position < input.length && condition(input[position.position])) {
  19873. // 1. Append that code point to the end of result.
  19874. result += input[position.position]
  19875. // 2. Advance position by 1.
  19876. position.position++
  19877. }
  19878. // 3. Return result.
  19879. return result
  19880. }
  19881. /**
  19882. * A faster collectASequenceOfCodePoints that only works when comparing a single character.
  19883. * @param {string} char
  19884. * @param {string} input
  19885. * @param {{ position: number }} position
  19886. */
  19887. function collectASequenceOfCodePointsFast (char, input, position) {
  19888. const idx = input.indexOf(char, position.position)
  19889. const start = position.position
  19890. if (idx === -1) {
  19891. position.position = input.length
  19892. return input.slice(start)
  19893. }
  19894. position.position = idx
  19895. return input.slice(start, position.position)
  19896. }
  19897. // https://url.spec.whatwg.org/#string-percent-decode
  19898. /** @param {string} input */
  19899. function stringPercentDecode (input) {
  19900. // 1. Let bytes be the UTF-8 encoding of input.
  19901. const bytes = encoder.encode(input)
  19902. // 2. Return the percent-decoding of bytes.
  19903. return percentDecode(bytes)
  19904. }
  19905. // https://url.spec.whatwg.org/#percent-decode
  19906. /** @param {Uint8Array} input */
  19907. function percentDecode (input) {
  19908. // 1. Let output be an empty byte sequence.
  19909. /** @type {number[]} */
  19910. const output = []
  19911. // 2. For each byte byte in input:
  19912. for (let i = 0; i < input.length; i++) {
  19913. const byte = input[i]
  19914. // 1. If byte is not 0x25 (%), then append byte to output.
  19915. if (byte !== 0x25) {
  19916. output.push(byte)
  19917. // 2. Otherwise, if byte is 0x25 (%) and the next two bytes
  19918. // after byte in input are not in the ranges
  19919. // 0x30 (0) to 0x39 (9), 0x41 (A) to 0x46 (F),
  19920. // and 0x61 (a) to 0x66 (f), all inclusive, append byte
  19921. // to output.
  19922. } else if (
  19923. byte === 0x25 &&
  19924. !/^[0-9A-Fa-f]{2}$/i.test(String.fromCharCode(input[i + 1], input[i + 2]))
  19925. ) {
  19926. output.push(0x25)
  19927. // 3. Otherwise:
  19928. } else {
  19929. // 1. Let bytePoint be the two bytes after byte in input,
  19930. // decoded, and then interpreted as hexadecimal number.
  19931. const nextTwoBytes = String.fromCharCode(input[i + 1], input[i + 2])
  19932. const bytePoint = Number.parseInt(nextTwoBytes, 16)
  19933. // 2. Append a byte whose value is bytePoint to output.
  19934. output.push(bytePoint)
  19935. // 3. Skip the next two bytes in input.
  19936. i += 2
  19937. }
  19938. }
  19939. // 3. Return output.
  19940. return Uint8Array.from(output)
  19941. }
  19942. // https://mimesniff.spec.whatwg.org/#parse-a-mime-type
  19943. /** @param {string} input */
  19944. function parseMIMEType (input) {
  19945. // 1. Remove any leading and trailing HTTP whitespace
  19946. // from input.
  19947. input = removeHTTPWhitespace(input, true, true)
  19948. // 2. Let position be a position variable for input,
  19949. // initially pointing at the start of input.
  19950. const position = { position: 0 }
  19951. // 3. Let type be the result of collecting a sequence
  19952. // of code points that are not U+002F (/) from
  19953. // input, given position.
  19954. const type = collectASequenceOfCodePointsFast(
  19955. '/',
  19956. input,
  19957. position
  19958. )
  19959. // 4. If type is the empty string or does not solely
  19960. // contain HTTP token code points, then return failure.
  19961. // https://mimesniff.spec.whatwg.org/#http-token-code-point
  19962. if (type.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(type)) {
  19963. return 'failure'
  19964. }
  19965. // 5. If position is past the end of input, then return
  19966. // failure
  19967. if (position.position > input.length) {
  19968. return 'failure'
  19969. }
  19970. // 6. Advance position by 1. (This skips past U+002F (/).)
  19971. position.position++
  19972. // 7. Let subtype be the result of collecting a sequence of
  19973. // code points that are not U+003B (;) from input, given
  19974. // position.
  19975. let subtype = collectASequenceOfCodePointsFast(
  19976. ';',
  19977. input,
  19978. position
  19979. )
  19980. // 8. Remove any trailing HTTP whitespace from subtype.
  19981. subtype = removeHTTPWhitespace(subtype, false, true)
  19982. // 9. If subtype is the empty string or does not solely
  19983. // contain HTTP token code points, then return failure.
  19984. if (subtype.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(subtype)) {
  19985. return 'failure'
  19986. }
  19987. const typeLowercase = type.toLowerCase()
  19988. const subtypeLowercase = subtype.toLowerCase()
  19989. // 10. Let mimeType be a new MIME type record whose type
  19990. // is type, in ASCII lowercase, and subtype is subtype,
  19991. // in ASCII lowercase.
  19992. // https://mimesniff.spec.whatwg.org/#mime-type
  19993. const mimeType = {
  19994. type: typeLowercase,
  19995. subtype: subtypeLowercase,
  19996. /** @type {Map<string, string>} */
  19997. parameters: new Map(),
  19998. // https://mimesniff.spec.whatwg.org/#mime-type-essence
  19999. essence: `${typeLowercase}/${subtypeLowercase}`
  20000. }
  20001. // 11. While position is not past the end of input:
  20002. while (position.position < input.length) {
  20003. // 1. Advance position by 1. (This skips past U+003B (;).)
  20004. position.position++
  20005. // 2. Collect a sequence of code points that are HTTP
  20006. // whitespace from input given position.
  20007. collectASequenceOfCodePoints(
  20008. // https://fetch.spec.whatwg.org/#http-whitespace
  20009. char => HTTP_WHITESPACE_REGEX.test(char),
  20010. input,
  20011. position
  20012. )
  20013. // 3. Let parameterName be the result of collecting a
  20014. // sequence of code points that are not U+003B (;)
  20015. // or U+003D (=) from input, given position.
  20016. let parameterName = collectASequenceOfCodePoints(
  20017. (char) => char !== ';' && char !== '=',
  20018. input,
  20019. position
  20020. )
  20021. // 4. Set parameterName to parameterName, in ASCII
  20022. // lowercase.
  20023. parameterName = parameterName.toLowerCase()
  20024. // 5. If position is not past the end of input, then:
  20025. if (position.position < input.length) {
  20026. // 1. If the code point at position within input is
  20027. // U+003B (;), then continue.
  20028. if (input[position.position] === ';') {
  20029. continue
  20030. }
  20031. // 2. Advance position by 1. (This skips past U+003D (=).)
  20032. position.position++
  20033. }
  20034. // 6. If position is past the end of input, then break.
  20035. if (position.position > input.length) {
  20036. break
  20037. }
  20038. // 7. Let parameterValue be null.
  20039. let parameterValue = null
  20040. // 8. If the code point at position within input is
  20041. // U+0022 ("), then:
  20042. if (input[position.position] === '"') {
  20043. // 1. Set parameterValue to the result of collecting
  20044. // an HTTP quoted string from input, given position
  20045. // and the extract-value flag.
  20046. parameterValue = collectAnHTTPQuotedString(input, position, true)
  20047. // 2. Collect a sequence of code points that are not
  20048. // U+003B (;) from input, given position.
  20049. collectASequenceOfCodePointsFast(
  20050. ';',
  20051. input,
  20052. position
  20053. )
  20054. // 9. Otherwise:
  20055. } else {
  20056. // 1. Set parameterValue to the result of collecting
  20057. // a sequence of code points that are not U+003B (;)
  20058. // from input, given position.
  20059. parameterValue = collectASequenceOfCodePointsFast(
  20060. ';',
  20061. input,
  20062. position
  20063. )
  20064. // 2. Remove any trailing HTTP whitespace from parameterValue.
  20065. parameterValue = removeHTTPWhitespace(parameterValue, false, true)
  20066. // 3. If parameterValue is the empty string, then continue.
  20067. if (parameterValue.length === 0) {
  20068. continue
  20069. }
  20070. }
  20071. // 10. If all of the following are true
  20072. // - parameterName is not the empty string
  20073. // - parameterName solely contains HTTP token code points
  20074. // - parameterValue solely contains HTTP quoted-string token code points
  20075. // - mimeType’s parameters[parameterName] does not exist
  20076. // then set mimeType’s parameters[parameterName] to parameterValue.
  20077. if (
  20078. parameterName.length !== 0 &&
  20079. HTTP_TOKEN_CODEPOINTS.test(parameterName) &&
  20080. (parameterValue.length === 0 || HTTP_QUOTED_STRING_TOKENS.test(parameterValue)) &&
  20081. !mimeType.parameters.has(parameterName)
  20082. ) {
  20083. mimeType.parameters.set(parameterName, parameterValue)
  20084. }
  20085. }
  20086. // 12. Return mimeType.
  20087. return mimeType
  20088. }
  20089. // https://infra.spec.whatwg.org/#forgiving-base64-decode
  20090. /** @param {string} data */
  20091. function forgivingBase64 (data) {
  20092. // 1. Remove all ASCII whitespace from data.
  20093. data = data.replace(/[\u0009\u000A\u000C\u000D\u0020]/g, '') // eslint-disable-line
  20094. // 2. If data’s code point length divides by 4 leaving
  20095. // no remainder, then:
  20096. if (data.length % 4 === 0) {
  20097. // 1. If data ends with one or two U+003D (=) code points,
  20098. // then remove them from data.
  20099. data = data.replace(/=?=$/, '')
  20100. }
  20101. // 3. If data’s code point length divides by 4 leaving
  20102. // a remainder of 1, then return failure.
  20103. if (data.length % 4 === 1) {
  20104. return 'failure'
  20105. }
  20106. // 4. If data contains a code point that is not one of
  20107. // U+002B (+)
  20108. // U+002F (/)
  20109. // ASCII alphanumeric
  20110. // then return failure.
  20111. if (/[^+/0-9A-Za-z]/.test(data)) {
  20112. return 'failure'
  20113. }
  20114. const binary = atob(data)
  20115. const bytes = new Uint8Array(binary.length)
  20116. for (let byte = 0; byte < binary.length; byte++) {
  20117. bytes[byte] = binary.charCodeAt(byte)
  20118. }
  20119. return bytes
  20120. }
  20121. // https://fetch.spec.whatwg.org/#collect-an-http-quoted-string
  20122. // tests: https://fetch.spec.whatwg.org/#example-http-quoted-string
  20123. /**
  20124. * @param {string} input
  20125. * @param {{ position: number }} position
  20126. * @param {boolean?} extractValue
  20127. */
  20128. function collectAnHTTPQuotedString (input, position, extractValue) {
  20129. // 1. Let positionStart be position.
  20130. const positionStart = position.position
  20131. // 2. Let value be the empty string.
  20132. let value = ''
  20133. // 3. Assert: the code point at position within input
  20134. // is U+0022 (").
  20135. assert(input[position.position] === '"')
  20136. // 4. Advance position by 1.
  20137. position.position++
  20138. // 5. While true:
  20139. while (true) {
  20140. // 1. Append the result of collecting a sequence of code points
  20141. // that are not U+0022 (") or U+005C (\) from input, given
  20142. // position, to value.
  20143. value += collectASequenceOfCodePoints(
  20144. (char) => char !== '"' && char !== '\\',
  20145. input,
  20146. position
  20147. )
  20148. // 2. If position is past the end of input, then break.
  20149. if (position.position >= input.length) {
  20150. break
  20151. }
  20152. // 3. Let quoteOrBackslash be the code point at position within
  20153. // input.
  20154. const quoteOrBackslash = input[position.position]
  20155. // 4. Advance position by 1.
  20156. position.position++
  20157. // 5. If quoteOrBackslash is U+005C (\), then:
  20158. if (quoteOrBackslash === '\\') {
  20159. // 1. If position is past the end of input, then append
  20160. // U+005C (\) to value and break.
  20161. if (position.position >= input.length) {
  20162. value += '\\'
  20163. break
  20164. }
  20165. // 2. Append the code point at position within input to value.
  20166. value += input[position.position]
  20167. // 3. Advance position by 1.
  20168. position.position++
  20169. // 6. Otherwise:
  20170. } else {
  20171. // 1. Assert: quoteOrBackslash is U+0022 (").
  20172. assert(quoteOrBackslash === '"')
  20173. // 2. Break.
  20174. break
  20175. }
  20176. }
  20177. // 6. If the extract-value flag is set, then return value.
  20178. if (extractValue) {
  20179. return value
  20180. }
  20181. // 7. Return the code points from positionStart to position,
  20182. // inclusive, within input.
  20183. return input.slice(positionStart, position.position)
  20184. }
  20185. /**
  20186. * @see https://mimesniff.spec.whatwg.org/#serialize-a-mime-type
  20187. */
  20188. function serializeAMimeType (mimeType) {
  20189. assert(mimeType !== 'failure')
  20190. const { parameters, essence } = mimeType
  20191. // 1. Let serialization be the concatenation of mimeType’s
  20192. // type, U+002F (/), and mimeType’s subtype.
  20193. let serialization = essence
  20194. // 2. For each name → value of mimeType’s parameters:
  20195. for (let [name, value] of parameters.entries()) {
  20196. // 1. Append U+003B (;) to serialization.
  20197. serialization += ';'
  20198. // 2. Append name to serialization.
  20199. serialization += name
  20200. // 3. Append U+003D (=) to serialization.
  20201. serialization += '='
  20202. // 4. If value does not solely contain HTTP token code
  20203. // points or value is the empty string, then:
  20204. if (!HTTP_TOKEN_CODEPOINTS.test(value)) {
  20205. // 1. Precede each occurence of U+0022 (") or
  20206. // U+005C (\) in value with U+005C (\).
  20207. value = value.replace(/(\\|")/g, '\\$1')
  20208. // 2. Prepend U+0022 (") to value.
  20209. value = '"' + value
  20210. // 3. Append U+0022 (") to value.
  20211. value += '"'
  20212. }
  20213. // 5. Append value to serialization.
  20214. serialization += value
  20215. }
  20216. // 3. Return serialization.
  20217. return serialization
  20218. }
  20219. /**
  20220. * @see https://fetch.spec.whatwg.org/#http-whitespace
  20221. * @param {string} char
  20222. */
  20223. function isHTTPWhiteSpace (char) {
  20224. return char === '\r' || char === '\n' || char === '\t' || char === ' '
  20225. }
  20226. /**
  20227. * @see https://fetch.spec.whatwg.org/#http-whitespace
  20228. * @param {string} str
  20229. */
  20230. function removeHTTPWhitespace (str, leading = true, trailing = true) {
  20231. let lead = 0
  20232. let trail = str.length - 1
  20233. if (leading) {
  20234. for (; lead < str.length && isHTTPWhiteSpace(str[lead]); lead++);
  20235. }
  20236. if (trailing) {
  20237. for (; trail > 0 && isHTTPWhiteSpace(str[trail]); trail--);
  20238. }
  20239. return str.slice(lead, trail + 1)
  20240. }
  20241. /**
  20242. * @see https://infra.spec.whatwg.org/#ascii-whitespace
  20243. * @param {string} char
  20244. */
  20245. function isASCIIWhitespace (char) {
  20246. return char === '\r' || char === '\n' || char === '\t' || char === '\f' || char === ' '
  20247. }
  20248. /**
  20249. * @see https://infra.spec.whatwg.org/#strip-leading-and-trailing-ascii-whitespace
  20250. */
  20251. function removeASCIIWhitespace (str, leading = true, trailing = true) {
  20252. let lead = 0
  20253. let trail = str.length - 1
  20254. if (leading) {
  20255. for (; lead < str.length && isASCIIWhitespace(str[lead]); lead++);
  20256. }
  20257. if (trailing) {
  20258. for (; trail > 0 && isASCIIWhitespace(str[trail]); trail--);
  20259. }
  20260. return str.slice(lead, trail + 1)
  20261. }
  20262. module.exports = {
  20263. dataURLProcessor,
  20264. URLSerializer,
  20265. collectASequenceOfCodePoints,
  20266. collectASequenceOfCodePointsFast,
  20267. stringPercentDecode,
  20268. parseMIMEType,
  20269. collectAnHTTPQuotedString,
  20270. serializeAMimeType
  20271. }
  20272. /***/ }),
  20273. /***/ 8511:
  20274. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  20275. "use strict";
  20276. const { Blob, File: NativeFile } = __nccwpck_require__(4300)
  20277. const { types } = __nccwpck_require__(3837)
  20278. const { kState } = __nccwpck_require__(5861)
  20279. const { isBlobLike } = __nccwpck_require__(2538)
  20280. const { webidl } = __nccwpck_require__(1744)
  20281. const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(685)
  20282. const { kEnumerableProperty } = __nccwpck_require__(3983)
  20283. const encoder = new TextEncoder()
  20284. class File extends Blob {
  20285. constructor (fileBits, fileName, options = {}) {
  20286. // The File constructor is invoked with two or three parameters, depending
  20287. // on whether the optional dictionary parameter is used. When the File()
  20288. // constructor is invoked, user agents must run the following steps:
  20289. webidl.argumentLengthCheck(arguments, 2, { header: 'File constructor' })
  20290. fileBits = webidl.converters['sequence<BlobPart>'](fileBits)
  20291. fileName = webidl.converters.USVString(fileName)
  20292. options = webidl.converters.FilePropertyBag(options)
  20293. // 1. Let bytes be the result of processing blob parts given fileBits and
  20294. // options.
  20295. // Note: Blob handles this for us
  20296. // 2. Let n be the fileName argument to the constructor.
  20297. const n = fileName
  20298. // 3. Process FilePropertyBag dictionary argument by running the following
  20299. // substeps:
  20300. // 1. If the type member is provided and is not the empty string, let t
  20301. // be set to the type dictionary member. If t contains any characters
  20302. // outside the range U+0020 to U+007E, then set t to the empty string
  20303. // and return from these substeps.
  20304. // 2. Convert every character in t to ASCII lowercase.
  20305. let t = options.type
  20306. let d
  20307. // eslint-disable-next-line no-labels
  20308. substep: {
  20309. if (t) {
  20310. t = parseMIMEType(t)
  20311. if (t === 'failure') {
  20312. t = ''
  20313. // eslint-disable-next-line no-labels
  20314. break substep
  20315. }
  20316. t = serializeAMimeType(t).toLowerCase()
  20317. }
  20318. // 3. If the lastModified member is provided, let d be set to the
  20319. // lastModified dictionary member. If it is not provided, set d to the
  20320. // current date and time represented as the number of milliseconds since
  20321. // the Unix Epoch (which is the equivalent of Date.now() [ECMA-262]).
  20322. d = options.lastModified
  20323. }
  20324. // 4. Return a new File object F such that:
  20325. // F refers to the bytes byte sequence.
  20326. // F.size is set to the number of total bytes in bytes.
  20327. // F.name is set to n.
  20328. // F.type is set to t.
  20329. // F.lastModified is set to d.
  20330. super(processBlobParts(fileBits, options), { type: t })
  20331. this[kState] = {
  20332. name: n,
  20333. lastModified: d,
  20334. type: t
  20335. }
  20336. }
  20337. get name () {
  20338. webidl.brandCheck(this, File)
  20339. return this[kState].name
  20340. }
  20341. get lastModified () {
  20342. webidl.brandCheck(this, File)
  20343. return this[kState].lastModified
  20344. }
  20345. get type () {
  20346. webidl.brandCheck(this, File)
  20347. return this[kState].type
  20348. }
  20349. }
  20350. class FileLike {
  20351. constructor (blobLike, fileName, options = {}) {
  20352. // TODO: argument idl type check
  20353. // The File constructor is invoked with two or three parameters, depending
  20354. // on whether the optional dictionary parameter is used. When the File()
  20355. // constructor is invoked, user agents must run the following steps:
  20356. // 1. Let bytes be the result of processing blob parts given fileBits and
  20357. // options.
  20358. // 2. Let n be the fileName argument to the constructor.
  20359. const n = fileName
  20360. // 3. Process FilePropertyBag dictionary argument by running the following
  20361. // substeps:
  20362. // 1. If the type member is provided and is not the empty string, let t
  20363. // be set to the type dictionary member. If t contains any characters
  20364. // outside the range U+0020 to U+007E, then set t to the empty string
  20365. // and return from these substeps.
  20366. // TODO
  20367. const t = options.type
  20368. // 2. Convert every character in t to ASCII lowercase.
  20369. // TODO
  20370. // 3. If the lastModified member is provided, let d be set to the
  20371. // lastModified dictionary member. If it is not provided, set d to the
  20372. // current date and time represented as the number of milliseconds since
  20373. // the Unix Epoch (which is the equivalent of Date.now() [ECMA-262]).
  20374. const d = options.lastModified ?? Date.now()
  20375. // 4. Return a new File object F such that:
  20376. // F refers to the bytes byte sequence.
  20377. // F.size is set to the number of total bytes in bytes.
  20378. // F.name is set to n.
  20379. // F.type is set to t.
  20380. // F.lastModified is set to d.
  20381. this[kState] = {
  20382. blobLike,
  20383. name: n,
  20384. type: t,
  20385. lastModified: d
  20386. }
  20387. }
  20388. stream (...args) {
  20389. webidl.brandCheck(this, FileLike)
  20390. return this[kState].blobLike.stream(...args)
  20391. }
  20392. arrayBuffer (...args) {
  20393. webidl.brandCheck(this, FileLike)
  20394. return this[kState].blobLike.arrayBuffer(...args)
  20395. }
  20396. slice (...args) {
  20397. webidl.brandCheck(this, FileLike)
  20398. return this[kState].blobLike.slice(...args)
  20399. }
  20400. text (...args) {
  20401. webidl.brandCheck(this, FileLike)
  20402. return this[kState].blobLike.text(...args)
  20403. }
  20404. get size () {
  20405. webidl.brandCheck(this, FileLike)
  20406. return this[kState].blobLike.size
  20407. }
  20408. get type () {
  20409. webidl.brandCheck(this, FileLike)
  20410. return this[kState].blobLike.type
  20411. }
  20412. get name () {
  20413. webidl.brandCheck(this, FileLike)
  20414. return this[kState].name
  20415. }
  20416. get lastModified () {
  20417. webidl.brandCheck(this, FileLike)
  20418. return this[kState].lastModified
  20419. }
  20420. get [Symbol.toStringTag] () {
  20421. return 'File'
  20422. }
  20423. }
  20424. Object.defineProperties(File.prototype, {
  20425. [Symbol.toStringTag]: {
  20426. value: 'File',
  20427. configurable: true
  20428. },
  20429. name: kEnumerableProperty,
  20430. lastModified: kEnumerableProperty
  20431. })
  20432. webidl.converters.Blob = webidl.interfaceConverter(Blob)
  20433. webidl.converters.BlobPart = function (V, opts) {
  20434. if (webidl.util.Type(V) === 'Object') {
  20435. if (isBlobLike(V)) {
  20436. return webidl.converters.Blob(V, { strict: false })
  20437. }
  20438. if (
  20439. ArrayBuffer.isView(V) ||
  20440. types.isAnyArrayBuffer(V)
  20441. ) {
  20442. return webidl.converters.BufferSource(V, opts)
  20443. }
  20444. }
  20445. return webidl.converters.USVString(V, opts)
  20446. }
  20447. webidl.converters['sequence<BlobPart>'] = webidl.sequenceConverter(
  20448. webidl.converters.BlobPart
  20449. )
  20450. // https://www.w3.org/TR/FileAPI/#dfn-FilePropertyBag
  20451. webidl.converters.FilePropertyBag = webidl.dictionaryConverter([
  20452. {
  20453. key: 'lastModified',
  20454. converter: webidl.converters['long long'],
  20455. get defaultValue () {
  20456. return Date.now()
  20457. }
  20458. },
  20459. {
  20460. key: 'type',
  20461. converter: webidl.converters.DOMString,
  20462. defaultValue: ''
  20463. },
  20464. {
  20465. key: 'endings',
  20466. converter: (value) => {
  20467. value = webidl.converters.DOMString(value)
  20468. value = value.toLowerCase()
  20469. if (value !== 'native') {
  20470. value = 'transparent'
  20471. }
  20472. return value
  20473. },
  20474. defaultValue: 'transparent'
  20475. }
  20476. ])
  20477. /**
  20478. * @see https://www.w3.org/TR/FileAPI/#process-blob-parts
  20479. * @param {(NodeJS.TypedArray|Blob|string)[]} parts
  20480. * @param {{ type: string, endings: string }} options
  20481. */
  20482. function processBlobParts (parts, options) {
  20483. // 1. Let bytes be an empty sequence of bytes.
  20484. /** @type {NodeJS.TypedArray[]} */
  20485. const bytes = []
  20486. // 2. For each element in parts:
  20487. for (const element of parts) {
  20488. // 1. If element is a USVString, run the following substeps:
  20489. if (typeof element === 'string') {
  20490. // 1. Let s be element.
  20491. let s = element
  20492. // 2. If the endings member of options is "native", set s
  20493. // to the result of converting line endings to native
  20494. // of element.
  20495. if (options.endings === 'native') {
  20496. s = convertLineEndingsNative(s)
  20497. }
  20498. // 3. Append the result of UTF-8 encoding s to bytes.
  20499. bytes.push(encoder.encode(s))
  20500. } else if (
  20501. types.isAnyArrayBuffer(element) ||
  20502. types.isTypedArray(element)
  20503. ) {
  20504. // 2. If element is a BufferSource, get a copy of the
  20505. // bytes held by the buffer source, and append those
  20506. // bytes to bytes.
  20507. if (!element.buffer) { // ArrayBuffer
  20508. bytes.push(new Uint8Array(element))
  20509. } else {
  20510. bytes.push(
  20511. new Uint8Array(element.buffer, element.byteOffset, element.byteLength)
  20512. )
  20513. }
  20514. } else if (isBlobLike(element)) {
  20515. // 3. If element is a Blob, append the bytes it represents
  20516. // to bytes.
  20517. bytes.push(element)
  20518. }
  20519. }
  20520. // 3. Return bytes.
  20521. return bytes
  20522. }
  20523. /**
  20524. * @see https://www.w3.org/TR/FileAPI/#convert-line-endings-to-native
  20525. * @param {string} s
  20526. */
  20527. function convertLineEndingsNative (s) {
  20528. // 1. Let native line ending be be the code point U+000A LF.
  20529. let nativeLineEnding = '\n'
  20530. // 2. If the underlying platform’s conventions are to
  20531. // represent newlines as a carriage return and line feed
  20532. // sequence, set native line ending to the code point
  20533. // U+000D CR followed by the code point U+000A LF.
  20534. if (process.platform === 'win32') {
  20535. nativeLineEnding = '\r\n'
  20536. }
  20537. return s.replace(/\r?\n/g, nativeLineEnding)
  20538. }
  20539. // If this function is moved to ./util.js, some tools (such as
  20540. // rollup) will warn about circular dependencies. See:
  20541. // https://github.com/nodejs/undici/issues/1629
  20542. function isFileLike (object) {
  20543. return (
  20544. (NativeFile && object instanceof NativeFile) ||
  20545. object instanceof File || (
  20546. object &&
  20547. (typeof object.stream === 'function' ||
  20548. typeof object.arrayBuffer === 'function') &&
  20549. object[Symbol.toStringTag] === 'File'
  20550. )
  20551. )
  20552. }
  20553. module.exports = { File, FileLike, isFileLike }
  20554. /***/ }),
  20555. /***/ 2015:
  20556. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  20557. "use strict";
  20558. const { isBlobLike, toUSVString, makeIterator } = __nccwpck_require__(2538)
  20559. const { kState } = __nccwpck_require__(5861)
  20560. const { File: UndiciFile, FileLike, isFileLike } = __nccwpck_require__(8511)
  20561. const { webidl } = __nccwpck_require__(1744)
  20562. const { Blob, File: NativeFile } = __nccwpck_require__(4300)
  20563. /** @type {globalThis['File']} */
  20564. const File = NativeFile ?? UndiciFile
  20565. // https://xhr.spec.whatwg.org/#formdata
  20566. class FormData {
  20567. constructor (form) {
  20568. if (form !== undefined) {
  20569. throw webidl.errors.conversionFailed({
  20570. prefix: 'FormData constructor',
  20571. argument: 'Argument 1',
  20572. types: ['undefined']
  20573. })
  20574. }
  20575. this[kState] = []
  20576. }
  20577. append (name, value, filename = undefined) {
  20578. webidl.brandCheck(this, FormData)
  20579. webidl.argumentLengthCheck(arguments, 2, { header: 'FormData.append' })
  20580. if (arguments.length === 3 && !isBlobLike(value)) {
  20581. throw new TypeError(
  20582. "Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'"
  20583. )
  20584. }
  20585. // 1. Let value be value if given; otherwise blobValue.
  20586. name = webidl.converters.USVString(name)
  20587. value = isBlobLike(value)
  20588. ? webidl.converters.Blob(value, { strict: false })
  20589. : webidl.converters.USVString(value)
  20590. filename = arguments.length === 3
  20591. ? webidl.converters.USVString(filename)
  20592. : undefined
  20593. // 2. Let entry be the result of creating an entry with
  20594. // name, value, and filename if given.
  20595. const entry = makeEntry(name, value, filename)
  20596. // 3. Append entry to this’s entry list.
  20597. this[kState].push(entry)
  20598. }
  20599. delete (name) {
  20600. webidl.brandCheck(this, FormData)
  20601. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.delete' })
  20602. name = webidl.converters.USVString(name)
  20603. // The delete(name) method steps are to remove all entries whose name
  20604. // is name from this’s entry list.
  20605. this[kState] = this[kState].filter(entry => entry.name !== name)
  20606. }
  20607. get (name) {
  20608. webidl.brandCheck(this, FormData)
  20609. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.get' })
  20610. name = webidl.converters.USVString(name)
  20611. // 1. If there is no entry whose name is name in this’s entry list,
  20612. // then return null.
  20613. const idx = this[kState].findIndex((entry) => entry.name === name)
  20614. if (idx === -1) {
  20615. return null
  20616. }
  20617. // 2. Return the value of the first entry whose name is name from
  20618. // this’s entry list.
  20619. return this[kState][idx].value
  20620. }
  20621. getAll (name) {
  20622. webidl.brandCheck(this, FormData)
  20623. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.getAll' })
  20624. name = webidl.converters.USVString(name)
  20625. // 1. If there is no entry whose name is name in this’s entry list,
  20626. // then return the empty list.
  20627. // 2. Return the values of all entries whose name is name, in order,
  20628. // from this’s entry list.
  20629. return this[kState]
  20630. .filter((entry) => entry.name === name)
  20631. .map((entry) => entry.value)
  20632. }
  20633. has (name) {
  20634. webidl.brandCheck(this, FormData)
  20635. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.has' })
  20636. name = webidl.converters.USVString(name)
  20637. // The has(name) method steps are to return true if there is an entry
  20638. // whose name is name in this’s entry list; otherwise false.
  20639. return this[kState].findIndex((entry) => entry.name === name) !== -1
  20640. }
  20641. set (name, value, filename = undefined) {
  20642. webidl.brandCheck(this, FormData)
  20643. webidl.argumentLengthCheck(arguments, 2, { header: 'FormData.set' })
  20644. if (arguments.length === 3 && !isBlobLike(value)) {
  20645. throw new TypeError(
  20646. "Failed to execute 'set' on 'FormData': parameter 2 is not of type 'Blob'"
  20647. )
  20648. }
  20649. // The set(name, value) and set(name, blobValue, filename) method steps
  20650. // are:
  20651. // 1. Let value be value if given; otherwise blobValue.
  20652. name = webidl.converters.USVString(name)
  20653. value = isBlobLike(value)
  20654. ? webidl.converters.Blob(value, { strict: false })
  20655. : webidl.converters.USVString(value)
  20656. filename = arguments.length === 3
  20657. ? toUSVString(filename)
  20658. : undefined
  20659. // 2. Let entry be the result of creating an entry with name, value, and
  20660. // filename if given.
  20661. const entry = makeEntry(name, value, filename)
  20662. // 3. If there are entries in this’s entry list whose name is name, then
  20663. // replace the first such entry with entry and remove the others.
  20664. const idx = this[kState].findIndex((entry) => entry.name === name)
  20665. if (idx !== -1) {
  20666. this[kState] = [
  20667. ...this[kState].slice(0, idx),
  20668. entry,
  20669. ...this[kState].slice(idx + 1).filter((entry) => entry.name !== name)
  20670. ]
  20671. } else {
  20672. // 4. Otherwise, append entry to this’s entry list.
  20673. this[kState].push(entry)
  20674. }
  20675. }
  20676. entries () {
  20677. webidl.brandCheck(this, FormData)
  20678. return makeIterator(
  20679. () => this[kState].map(pair => [pair.name, pair.value]),
  20680. 'FormData',
  20681. 'key+value'
  20682. )
  20683. }
  20684. keys () {
  20685. webidl.brandCheck(this, FormData)
  20686. return makeIterator(
  20687. () => this[kState].map(pair => [pair.name, pair.value]),
  20688. 'FormData',
  20689. 'key'
  20690. )
  20691. }
  20692. values () {
  20693. webidl.brandCheck(this, FormData)
  20694. return makeIterator(
  20695. () => this[kState].map(pair => [pair.name, pair.value]),
  20696. 'FormData',
  20697. 'value'
  20698. )
  20699. }
  20700. /**
  20701. * @param {(value: string, key: string, self: FormData) => void} callbackFn
  20702. * @param {unknown} thisArg
  20703. */
  20704. forEach (callbackFn, thisArg = globalThis) {
  20705. webidl.brandCheck(this, FormData)
  20706. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.forEach' })
  20707. if (typeof callbackFn !== 'function') {
  20708. throw new TypeError(
  20709. "Failed to execute 'forEach' on 'FormData': parameter 1 is not of type 'Function'."
  20710. )
  20711. }
  20712. for (const [key, value] of this) {
  20713. callbackFn.apply(thisArg, [value, key, this])
  20714. }
  20715. }
  20716. }
  20717. FormData.prototype[Symbol.iterator] = FormData.prototype.entries
  20718. Object.defineProperties(FormData.prototype, {
  20719. [Symbol.toStringTag]: {
  20720. value: 'FormData',
  20721. configurable: true
  20722. }
  20723. })
  20724. /**
  20725. * @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#create-an-entry
  20726. * @param {string} name
  20727. * @param {string|Blob} value
  20728. * @param {?string} filename
  20729. * @returns
  20730. */
  20731. function makeEntry (name, value, filename) {
  20732. // 1. Set name to the result of converting name into a scalar value string.
  20733. // "To convert a string into a scalar value string, replace any surrogates
  20734. // with U+FFFD."
  20735. // see: https://nodejs.org/dist/latest-v18.x/docs/api/buffer.html#buftostringencoding-start-end
  20736. name = Buffer.from(name).toString('utf8')
  20737. // 2. If value is a string, then set value to the result of converting
  20738. // value into a scalar value string.
  20739. if (typeof value === 'string') {
  20740. value = Buffer.from(value).toString('utf8')
  20741. } else {
  20742. // 3. Otherwise:
  20743. // 1. If value is not a File object, then set value to a new File object,
  20744. // representing the same bytes, whose name attribute value is "blob"
  20745. if (!isFileLike(value)) {
  20746. value = value instanceof Blob
  20747. ? new File([value], 'blob', { type: value.type })
  20748. : new FileLike(value, 'blob', { type: value.type })
  20749. }
  20750. // 2. If filename is given, then set value to a new File object,
  20751. // representing the same bytes, whose name attribute is filename.
  20752. if (filename !== undefined) {
  20753. /** @type {FilePropertyBag} */
  20754. const options = {
  20755. type: value.type,
  20756. lastModified: value.lastModified
  20757. }
  20758. value = (NativeFile && value instanceof NativeFile) || value instanceof UndiciFile
  20759. ? new File([value], filename, options)
  20760. : new FileLike(value, filename, options)
  20761. }
  20762. }
  20763. // 4. Return an entry whose name is name and whose value is value.
  20764. return { name, value }
  20765. }
  20766. module.exports = { FormData }
  20767. /***/ }),
  20768. /***/ 1246:
  20769. /***/ ((module) => {
  20770. "use strict";
  20771. // In case of breaking changes, increase the version
  20772. // number to avoid conflicts.
  20773. const globalOrigin = Symbol.for('undici.globalOrigin.1')
  20774. function getGlobalOrigin () {
  20775. return globalThis[globalOrigin]
  20776. }
  20777. function setGlobalOrigin (newOrigin) {
  20778. if (newOrigin === undefined) {
  20779. Object.defineProperty(globalThis, globalOrigin, {
  20780. value: undefined,
  20781. writable: true,
  20782. enumerable: false,
  20783. configurable: false
  20784. })
  20785. return
  20786. }
  20787. const parsedURL = new URL(newOrigin)
  20788. if (parsedURL.protocol !== 'http:' && parsedURL.protocol !== 'https:') {
  20789. throw new TypeError(`Only http & https urls are allowed, received ${parsedURL.protocol}`)
  20790. }
  20791. Object.defineProperty(globalThis, globalOrigin, {
  20792. value: parsedURL,
  20793. writable: true,
  20794. enumerable: false,
  20795. configurable: false
  20796. })
  20797. }
  20798. module.exports = {
  20799. getGlobalOrigin,
  20800. setGlobalOrigin
  20801. }
  20802. /***/ }),
  20803. /***/ 554:
  20804. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  20805. "use strict";
  20806. // https://github.com/Ethan-Arrowood/undici-fetch
  20807. const { kHeadersList, kConstruct } = __nccwpck_require__(2785)
  20808. const { kGuard } = __nccwpck_require__(5861)
  20809. const { kEnumerableProperty } = __nccwpck_require__(3983)
  20810. const {
  20811. makeIterator,
  20812. isValidHeaderName,
  20813. isValidHeaderValue
  20814. } = __nccwpck_require__(2538)
  20815. const { webidl } = __nccwpck_require__(1744)
  20816. const assert = __nccwpck_require__(9491)
  20817. const kHeadersMap = Symbol('headers map')
  20818. const kHeadersSortedMap = Symbol('headers map sorted')
  20819. /**
  20820. * @param {number} code
  20821. */
  20822. function isHTTPWhiteSpaceCharCode (code) {
  20823. return code === 0x00a || code === 0x00d || code === 0x009 || code === 0x020
  20824. }
  20825. /**
  20826. * @see https://fetch.spec.whatwg.org/#concept-header-value-normalize
  20827. * @param {string} potentialValue
  20828. */
  20829. function headerValueNormalize (potentialValue) {
  20830. // To normalize a byte sequence potentialValue, remove
  20831. // any leading and trailing HTTP whitespace bytes from
  20832. // potentialValue.
  20833. let i = 0; let j = potentialValue.length
  20834. while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(j - 1))) --j
  20835. while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(i))) ++i
  20836. return i === 0 && j === potentialValue.length ? potentialValue : potentialValue.substring(i, j)
  20837. }
  20838. function fill (headers, object) {
  20839. // To fill a Headers object headers with a given object object, run these steps:
  20840. // 1. If object is a sequence, then for each header in object:
  20841. // Note: webidl conversion to array has already been done.
  20842. if (Array.isArray(object)) {
  20843. for (let i = 0; i < object.length; ++i) {
  20844. const header = object[i]
  20845. // 1. If header does not contain exactly two items, then throw a TypeError.
  20846. if (header.length !== 2) {
  20847. throw webidl.errors.exception({
  20848. header: 'Headers constructor',
  20849. message: `expected name/value pair to be length 2, found ${header.length}.`
  20850. })
  20851. }
  20852. // 2. Append (header’s first item, header’s second item) to headers.
  20853. appendHeader(headers, header[0], header[1])
  20854. }
  20855. } else if (typeof object === 'object' && object !== null) {
  20856. // Note: null should throw
  20857. // 2. Otherwise, object is a record, then for each key → value in object,
  20858. // append (key, value) to headers
  20859. const keys = Object.keys(object)
  20860. for (let i = 0; i < keys.length; ++i) {
  20861. appendHeader(headers, keys[i], object[keys[i]])
  20862. }
  20863. } else {
  20864. throw webidl.errors.conversionFailed({
  20865. prefix: 'Headers constructor',
  20866. argument: 'Argument 1',
  20867. types: ['sequence<sequence<ByteString>>', 'record<ByteString, ByteString>']
  20868. })
  20869. }
  20870. }
  20871. /**
  20872. * @see https://fetch.spec.whatwg.org/#concept-headers-append
  20873. */
  20874. function appendHeader (headers, name, value) {
  20875. // 1. Normalize value.
  20876. value = headerValueNormalize(value)
  20877. // 2. If name is not a header name or value is not a
  20878. // header value, then throw a TypeError.
  20879. if (!isValidHeaderName(name)) {
  20880. throw webidl.errors.invalidArgument({
  20881. prefix: 'Headers.append',
  20882. value: name,
  20883. type: 'header name'
  20884. })
  20885. } else if (!isValidHeaderValue(value)) {
  20886. throw webidl.errors.invalidArgument({
  20887. prefix: 'Headers.append',
  20888. value,
  20889. type: 'header value'
  20890. })
  20891. }
  20892. // 3. If headers’s guard is "immutable", then throw a TypeError.
  20893. // 4. Otherwise, if headers’s guard is "request" and name is a
  20894. // forbidden header name, return.
  20895. // Note: undici does not implement forbidden header names
  20896. if (headers[kGuard] === 'immutable') {
  20897. throw new TypeError('immutable')
  20898. } else if (headers[kGuard] === 'request-no-cors') {
  20899. // 5. Otherwise, if headers’s guard is "request-no-cors":
  20900. // TODO
  20901. }
  20902. // 6. Otherwise, if headers’s guard is "response" and name is a
  20903. // forbidden response-header name, return.
  20904. // 7. Append (name, value) to headers’s header list.
  20905. return headers[kHeadersList].append(name, value)
  20906. // 8. If headers’s guard is "request-no-cors", then remove
  20907. // privileged no-CORS request headers from headers
  20908. }
  20909. class HeadersList {
  20910. /** @type {[string, string][]|null} */
  20911. cookies = null
  20912. constructor (init) {
  20913. if (init instanceof HeadersList) {
  20914. this[kHeadersMap] = new Map(init[kHeadersMap])
  20915. this[kHeadersSortedMap] = init[kHeadersSortedMap]
  20916. this.cookies = init.cookies === null ? null : [...init.cookies]
  20917. } else {
  20918. this[kHeadersMap] = new Map(init)
  20919. this[kHeadersSortedMap] = null
  20920. }
  20921. }
  20922. // https://fetch.spec.whatwg.org/#header-list-contains
  20923. contains (name) {
  20924. // A header list list contains a header name name if list
  20925. // contains a header whose name is a byte-case-insensitive
  20926. // match for name.
  20927. name = name.toLowerCase()
  20928. return this[kHeadersMap].has(name)
  20929. }
  20930. clear () {
  20931. this[kHeadersMap].clear()
  20932. this[kHeadersSortedMap] = null
  20933. this.cookies = null
  20934. }
  20935. // https://fetch.spec.whatwg.org/#concept-header-list-append
  20936. append (name, value) {
  20937. this[kHeadersSortedMap] = null
  20938. // 1. If list contains name, then set name to the first such
  20939. // header’s name.
  20940. const lowercaseName = name.toLowerCase()
  20941. const exists = this[kHeadersMap].get(lowercaseName)
  20942. // 2. Append (name, value) to list.
  20943. if (exists) {
  20944. const delimiter = lowercaseName === 'cookie' ? '; ' : ', '
  20945. this[kHeadersMap].set(lowercaseName, {
  20946. name: exists.name,
  20947. value: `${exists.value}${delimiter}${value}`
  20948. })
  20949. } else {
  20950. this[kHeadersMap].set(lowercaseName, { name, value })
  20951. }
  20952. if (lowercaseName === 'set-cookie') {
  20953. this.cookies ??= []
  20954. this.cookies.push(value)
  20955. }
  20956. }
  20957. // https://fetch.spec.whatwg.org/#concept-header-list-set
  20958. set (name, value) {
  20959. this[kHeadersSortedMap] = null
  20960. const lowercaseName = name.toLowerCase()
  20961. if (lowercaseName === 'set-cookie') {
  20962. this.cookies = [value]
  20963. }
  20964. // 1. If list contains name, then set the value of
  20965. // the first such header to value and remove the
  20966. // others.
  20967. // 2. Otherwise, append header (name, value) to list.
  20968. this[kHeadersMap].set(lowercaseName, { name, value })
  20969. }
  20970. // https://fetch.spec.whatwg.org/#concept-header-list-delete
  20971. delete (name) {
  20972. this[kHeadersSortedMap] = null
  20973. name = name.toLowerCase()
  20974. if (name === 'set-cookie') {
  20975. this.cookies = null
  20976. }
  20977. this[kHeadersMap].delete(name)
  20978. }
  20979. // https://fetch.spec.whatwg.org/#concept-header-list-get
  20980. get (name) {
  20981. const value = this[kHeadersMap].get(name.toLowerCase())
  20982. // 1. If list does not contain name, then return null.
  20983. // 2. Return the values of all headers in list whose name
  20984. // is a byte-case-insensitive match for name,
  20985. // separated from each other by 0x2C 0x20, in order.
  20986. return value === undefined ? null : value.value
  20987. }
  20988. * [Symbol.iterator] () {
  20989. // use the lowercased name
  20990. for (const [name, { value }] of this[kHeadersMap]) {
  20991. yield [name, value]
  20992. }
  20993. }
  20994. get entries () {
  20995. const headers = {}
  20996. if (this[kHeadersMap].size) {
  20997. for (const { name, value } of this[kHeadersMap].values()) {
  20998. headers[name] = value
  20999. }
  21000. }
  21001. return headers
  21002. }
  21003. }
  21004. // https://fetch.spec.whatwg.org/#headers-class
  21005. class Headers {
  21006. constructor (init = undefined) {
  21007. if (init === kConstruct) {
  21008. return
  21009. }
  21010. this[kHeadersList] = new HeadersList()
  21011. // The new Headers(init) constructor steps are:
  21012. // 1. Set this’s guard to "none".
  21013. this[kGuard] = 'none'
  21014. // 2. If init is given, then fill this with init.
  21015. if (init !== undefined) {
  21016. init = webidl.converters.HeadersInit(init)
  21017. fill(this, init)
  21018. }
  21019. }
  21020. // https://fetch.spec.whatwg.org/#dom-headers-append
  21021. append (name, value) {
  21022. webidl.brandCheck(this, Headers)
  21023. webidl.argumentLengthCheck(arguments, 2, { header: 'Headers.append' })
  21024. name = webidl.converters.ByteString(name)
  21025. value = webidl.converters.ByteString(value)
  21026. return appendHeader(this, name, value)
  21027. }
  21028. // https://fetch.spec.whatwg.org/#dom-headers-delete
  21029. delete (name) {
  21030. webidl.brandCheck(this, Headers)
  21031. webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.delete' })
  21032. name = webidl.converters.ByteString(name)
  21033. // 1. If name is not a header name, then throw a TypeError.
  21034. if (!isValidHeaderName(name)) {
  21035. throw webidl.errors.invalidArgument({
  21036. prefix: 'Headers.delete',
  21037. value: name,
  21038. type: 'header name'
  21039. })
  21040. }
  21041. // 2. If this’s guard is "immutable", then throw a TypeError.
  21042. // 3. Otherwise, if this’s guard is "request" and name is a
  21043. // forbidden header name, return.
  21044. // 4. Otherwise, if this’s guard is "request-no-cors", name
  21045. // is not a no-CORS-safelisted request-header name, and
  21046. // name is not a privileged no-CORS request-header name,
  21047. // return.
  21048. // 5. Otherwise, if this’s guard is "response" and name is
  21049. // a forbidden response-header name, return.
  21050. // Note: undici does not implement forbidden header names
  21051. if (this[kGuard] === 'immutable') {
  21052. throw new TypeError('immutable')
  21053. } else if (this[kGuard] === 'request-no-cors') {
  21054. // TODO
  21055. }
  21056. // 6. If this’s header list does not contain name, then
  21057. // return.
  21058. if (!this[kHeadersList].contains(name)) {
  21059. return
  21060. }
  21061. // 7. Delete name from this’s header list.
  21062. // 8. If this’s guard is "request-no-cors", then remove
  21063. // privileged no-CORS request headers from this.
  21064. this[kHeadersList].delete(name)
  21065. }
  21066. // https://fetch.spec.whatwg.org/#dom-headers-get
  21067. get (name) {
  21068. webidl.brandCheck(this, Headers)
  21069. webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.get' })
  21070. name = webidl.converters.ByteString(name)
  21071. // 1. If name is not a header name, then throw a TypeError.
  21072. if (!isValidHeaderName(name)) {
  21073. throw webidl.errors.invalidArgument({
  21074. prefix: 'Headers.get',
  21075. value: name,
  21076. type: 'header name'
  21077. })
  21078. }
  21079. // 2. Return the result of getting name from this’s header
  21080. // list.
  21081. return this[kHeadersList].get(name)
  21082. }
  21083. // https://fetch.spec.whatwg.org/#dom-headers-has
  21084. has (name) {
  21085. webidl.brandCheck(this, Headers)
  21086. webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.has' })
  21087. name = webidl.converters.ByteString(name)
  21088. // 1. If name is not a header name, then throw a TypeError.
  21089. if (!isValidHeaderName(name)) {
  21090. throw webidl.errors.invalidArgument({
  21091. prefix: 'Headers.has',
  21092. value: name,
  21093. type: 'header name'
  21094. })
  21095. }
  21096. // 2. Return true if this’s header list contains name;
  21097. // otherwise false.
  21098. return this[kHeadersList].contains(name)
  21099. }
  21100. // https://fetch.spec.whatwg.org/#dom-headers-set
  21101. set (name, value) {
  21102. webidl.brandCheck(this, Headers)
  21103. webidl.argumentLengthCheck(arguments, 2, { header: 'Headers.set' })
  21104. name = webidl.converters.ByteString(name)
  21105. value = webidl.converters.ByteString(value)
  21106. // 1. Normalize value.
  21107. value = headerValueNormalize(value)
  21108. // 2. If name is not a header name or value is not a
  21109. // header value, then throw a TypeError.
  21110. if (!isValidHeaderName(name)) {
  21111. throw webidl.errors.invalidArgument({
  21112. prefix: 'Headers.set',
  21113. value: name,
  21114. type: 'header name'
  21115. })
  21116. } else if (!isValidHeaderValue(value)) {
  21117. throw webidl.errors.invalidArgument({
  21118. prefix: 'Headers.set',
  21119. value,
  21120. type: 'header value'
  21121. })
  21122. }
  21123. // 3. If this’s guard is "immutable", then throw a TypeError.
  21124. // 4. Otherwise, if this’s guard is "request" and name is a
  21125. // forbidden header name, return.
  21126. // 5. Otherwise, if this’s guard is "request-no-cors" and
  21127. // name/value is not a no-CORS-safelisted request-header,
  21128. // return.
  21129. // 6. Otherwise, if this’s guard is "response" and name is a
  21130. // forbidden response-header name, return.
  21131. // Note: undici does not implement forbidden header names
  21132. if (this[kGuard] === 'immutable') {
  21133. throw new TypeError('immutable')
  21134. } else if (this[kGuard] === 'request-no-cors') {
  21135. // TODO
  21136. }
  21137. // 7. Set (name, value) in this’s header list.
  21138. // 8. If this’s guard is "request-no-cors", then remove
  21139. // privileged no-CORS request headers from this
  21140. this[kHeadersList].set(name, value)
  21141. }
  21142. // https://fetch.spec.whatwg.org/#dom-headers-getsetcookie
  21143. getSetCookie () {
  21144. webidl.brandCheck(this, Headers)
  21145. // 1. If this’s header list does not contain `Set-Cookie`, then return « ».
  21146. // 2. Return the values of all headers in this’s header list whose name is
  21147. // a byte-case-insensitive match for `Set-Cookie`, in order.
  21148. const list = this[kHeadersList].cookies
  21149. if (list) {
  21150. return [...list]
  21151. }
  21152. return []
  21153. }
  21154. // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine
  21155. get [kHeadersSortedMap] () {
  21156. if (this[kHeadersList][kHeadersSortedMap]) {
  21157. return this[kHeadersList][kHeadersSortedMap]
  21158. }
  21159. // 1. Let headers be an empty list of headers with the key being the name
  21160. // and value the value.
  21161. const headers = []
  21162. // 2. Let names be the result of convert header names to a sorted-lowercase
  21163. // set with all the names of the headers in list.
  21164. const names = [...this[kHeadersList]].sort((a, b) => a[0] < b[0] ? -1 : 1)
  21165. const cookies = this[kHeadersList].cookies
  21166. // 3. For each name of names:
  21167. for (let i = 0; i < names.length; ++i) {
  21168. const [name, value] = names[i]
  21169. // 1. If name is `set-cookie`, then:
  21170. if (name === 'set-cookie') {
  21171. // 1. Let values be a list of all values of headers in list whose name
  21172. // is a byte-case-insensitive match for name, in order.
  21173. // 2. For each value of values:
  21174. // 1. Append (name, value) to headers.
  21175. for (let j = 0; j < cookies.length; ++j) {
  21176. headers.push([name, cookies[j]])
  21177. }
  21178. } else {
  21179. // 2. Otherwise:
  21180. // 1. Let value be the result of getting name from list.
  21181. // 2. Assert: value is non-null.
  21182. assert(value !== null)
  21183. // 3. Append (name, value) to headers.
  21184. headers.push([name, value])
  21185. }
  21186. }
  21187. this[kHeadersList][kHeadersSortedMap] = headers
  21188. // 4. Return headers.
  21189. return headers
  21190. }
  21191. keys () {
  21192. webidl.brandCheck(this, Headers)
  21193. if (this[kGuard] === 'immutable') {
  21194. const value = this[kHeadersSortedMap]
  21195. return makeIterator(() => value, 'Headers',
  21196. 'key')
  21197. }
  21198. return makeIterator(
  21199. () => [...this[kHeadersSortedMap].values()],
  21200. 'Headers',
  21201. 'key'
  21202. )
  21203. }
  21204. values () {
  21205. webidl.brandCheck(this, Headers)
  21206. if (this[kGuard] === 'immutable') {
  21207. const value = this[kHeadersSortedMap]
  21208. return makeIterator(() => value, 'Headers',
  21209. 'value')
  21210. }
  21211. return makeIterator(
  21212. () => [...this[kHeadersSortedMap].values()],
  21213. 'Headers',
  21214. 'value'
  21215. )
  21216. }
  21217. entries () {
  21218. webidl.brandCheck(this, Headers)
  21219. if (this[kGuard] === 'immutable') {
  21220. const value = this[kHeadersSortedMap]
  21221. return makeIterator(() => value, 'Headers',
  21222. 'key+value')
  21223. }
  21224. return makeIterator(
  21225. () => [...this[kHeadersSortedMap].values()],
  21226. 'Headers',
  21227. 'key+value'
  21228. )
  21229. }
  21230. /**
  21231. * @param {(value: string, key: string, self: Headers) => void} callbackFn
  21232. * @param {unknown} thisArg
  21233. */
  21234. forEach (callbackFn, thisArg = globalThis) {
  21235. webidl.brandCheck(this, Headers)
  21236. webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.forEach' })
  21237. if (typeof callbackFn !== 'function') {
  21238. throw new TypeError(
  21239. "Failed to execute 'forEach' on 'Headers': parameter 1 is not of type 'Function'."
  21240. )
  21241. }
  21242. for (const [key, value] of this) {
  21243. callbackFn.apply(thisArg, [value, key, this])
  21244. }
  21245. }
  21246. [Symbol.for('nodejs.util.inspect.custom')] () {
  21247. webidl.brandCheck(this, Headers)
  21248. return this[kHeadersList]
  21249. }
  21250. }
  21251. Headers.prototype[Symbol.iterator] = Headers.prototype.entries
  21252. Object.defineProperties(Headers.prototype, {
  21253. append: kEnumerableProperty,
  21254. delete: kEnumerableProperty,
  21255. get: kEnumerableProperty,
  21256. has: kEnumerableProperty,
  21257. set: kEnumerableProperty,
  21258. getSetCookie: kEnumerableProperty,
  21259. keys: kEnumerableProperty,
  21260. values: kEnumerableProperty,
  21261. entries: kEnumerableProperty,
  21262. forEach: kEnumerableProperty,
  21263. [Symbol.iterator]: { enumerable: false },
  21264. [Symbol.toStringTag]: {
  21265. value: 'Headers',
  21266. configurable: true
  21267. }
  21268. })
  21269. webidl.converters.HeadersInit = function (V) {
  21270. if (webidl.util.Type(V) === 'Object') {
  21271. if (V[Symbol.iterator]) {
  21272. return webidl.converters['sequence<sequence<ByteString>>'](V)
  21273. }
  21274. return webidl.converters['record<ByteString, ByteString>'](V)
  21275. }
  21276. throw webidl.errors.conversionFailed({
  21277. prefix: 'Headers constructor',
  21278. argument: 'Argument 1',
  21279. types: ['sequence<sequence<ByteString>>', 'record<ByteString, ByteString>']
  21280. })
  21281. }
  21282. module.exports = {
  21283. fill,
  21284. Headers,
  21285. HeadersList
  21286. }
  21287. /***/ }),
  21288. /***/ 4881:
  21289. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  21290. "use strict";
  21291. // https://github.com/Ethan-Arrowood/undici-fetch
  21292. const {
  21293. Response,
  21294. makeNetworkError,
  21295. makeAppropriateNetworkError,
  21296. filterResponse,
  21297. makeResponse
  21298. } = __nccwpck_require__(7823)
  21299. const { Headers } = __nccwpck_require__(554)
  21300. const { Request, makeRequest } = __nccwpck_require__(8359)
  21301. const zlib = __nccwpck_require__(9796)
  21302. const {
  21303. bytesMatch,
  21304. makePolicyContainer,
  21305. clonePolicyContainer,
  21306. requestBadPort,
  21307. TAOCheck,
  21308. appendRequestOriginHeader,
  21309. responseLocationURL,
  21310. requestCurrentURL,
  21311. setRequestReferrerPolicyOnRedirect,
  21312. tryUpgradeRequestToAPotentiallyTrustworthyURL,
  21313. createOpaqueTimingInfo,
  21314. appendFetchMetadata,
  21315. corsCheck,
  21316. crossOriginResourcePolicyCheck,
  21317. determineRequestsReferrer,
  21318. coarsenedSharedCurrentTime,
  21319. createDeferredPromise,
  21320. isBlobLike,
  21321. sameOrigin,
  21322. isCancelled,
  21323. isAborted,
  21324. isErrorLike,
  21325. fullyReadBody,
  21326. readableStreamClose,
  21327. isomorphicEncode,
  21328. urlIsLocal,
  21329. urlIsHttpHttpsScheme,
  21330. urlHasHttpsScheme
  21331. } = __nccwpck_require__(2538)
  21332. const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(5861)
  21333. const assert = __nccwpck_require__(9491)
  21334. const { safelyExtractBody } = __nccwpck_require__(9990)
  21335. const {
  21336. redirectStatusSet,
  21337. nullBodyStatus,
  21338. safeMethodsSet,
  21339. requestBodyHeader,
  21340. subresourceSet,
  21341. DOMException
  21342. } = __nccwpck_require__(1037)
  21343. const { kHeadersList } = __nccwpck_require__(2785)
  21344. const EE = __nccwpck_require__(2361)
  21345. const { Readable, pipeline } = __nccwpck_require__(2781)
  21346. const { addAbortListener, isErrored, isReadable, nodeMajor, nodeMinor } = __nccwpck_require__(3983)
  21347. const { dataURLProcessor, serializeAMimeType } = __nccwpck_require__(685)
  21348. const { TransformStream } = __nccwpck_require__(5356)
  21349. const { getGlobalDispatcher } = __nccwpck_require__(1892)
  21350. const { webidl } = __nccwpck_require__(1744)
  21351. const { STATUS_CODES } = __nccwpck_require__(3685)
  21352. const GET_OR_HEAD = ['GET', 'HEAD']
  21353. /** @type {import('buffer').resolveObjectURL} */
  21354. let resolveObjectURL
  21355. let ReadableStream = globalThis.ReadableStream
  21356. class Fetch extends EE {
  21357. constructor (dispatcher) {
  21358. super()
  21359. this.dispatcher = dispatcher
  21360. this.connection = null
  21361. this.dump = false
  21362. this.state = 'ongoing'
  21363. // 2 terminated listeners get added per request,
  21364. // but only 1 gets removed. If there are 20 redirects,
  21365. // 21 listeners will be added.
  21366. // See https://github.com/nodejs/undici/issues/1711
  21367. // TODO (fix): Find and fix root cause for leaked listener.
  21368. this.setMaxListeners(21)
  21369. }
  21370. terminate (reason) {
  21371. if (this.state !== 'ongoing') {
  21372. return
  21373. }
  21374. this.state = 'terminated'
  21375. this.connection?.destroy(reason)
  21376. this.emit('terminated', reason)
  21377. }
  21378. // https://fetch.spec.whatwg.org/#fetch-controller-abort
  21379. abort (error) {
  21380. if (this.state !== 'ongoing') {
  21381. return
  21382. }
  21383. // 1. Set controller’s state to "aborted".
  21384. this.state = 'aborted'
  21385. // 2. Let fallbackError be an "AbortError" DOMException.
  21386. // 3. Set error to fallbackError if it is not given.
  21387. if (!error) {
  21388. error = new DOMException('The operation was aborted.', 'AbortError')
  21389. }
  21390. // 4. Let serializedError be StructuredSerialize(error).
  21391. // If that threw an exception, catch it, and let
  21392. // serializedError be StructuredSerialize(fallbackError).
  21393. // 5. Set controller’s serialized abort reason to serializedError.
  21394. this.serializedAbortReason = error
  21395. this.connection?.destroy(error)
  21396. this.emit('terminated', error)
  21397. }
  21398. }
  21399. // https://fetch.spec.whatwg.org/#fetch-method
  21400. function fetch (input, init = {}) {
  21401. webidl.argumentLengthCheck(arguments, 1, { header: 'globalThis.fetch' })
  21402. // 1. Let p be a new promise.
  21403. const p = createDeferredPromise()
  21404. // 2. Let requestObject be the result of invoking the initial value of
  21405. // Request as constructor with input and init as arguments. If this throws
  21406. // an exception, reject p with it and return p.
  21407. let requestObject
  21408. try {
  21409. requestObject = new Request(input, init)
  21410. } catch (e) {
  21411. p.reject(e)
  21412. return p.promise
  21413. }
  21414. // 3. Let request be requestObject’s request.
  21415. const request = requestObject[kState]
  21416. // 4. If requestObject’s signal’s aborted flag is set, then:
  21417. if (requestObject.signal.aborted) {
  21418. // 1. Abort the fetch() call with p, request, null, and
  21419. // requestObject’s signal’s abort reason.
  21420. abortFetch(p, request, null, requestObject.signal.reason)
  21421. // 2. Return p.
  21422. return p.promise
  21423. }
  21424. // 5. Let globalObject be request’s client’s global object.
  21425. const globalObject = request.client.globalObject
  21426. // 6. If globalObject is a ServiceWorkerGlobalScope object, then set
  21427. // request’s service-workers mode to "none".
  21428. if (globalObject?.constructor?.name === 'ServiceWorkerGlobalScope') {
  21429. request.serviceWorkers = 'none'
  21430. }
  21431. // 7. Let responseObject be null.
  21432. let responseObject = null
  21433. // 8. Let relevantRealm be this’s relevant Realm.
  21434. const relevantRealm = null
  21435. // 9. Let locallyAborted be false.
  21436. let locallyAborted = false
  21437. // 10. Let controller be null.
  21438. let controller = null
  21439. // 11. Add the following abort steps to requestObject’s signal:
  21440. addAbortListener(
  21441. requestObject.signal,
  21442. () => {
  21443. // 1. Set locallyAborted to true.
  21444. locallyAborted = true
  21445. // 2. Assert: controller is non-null.
  21446. assert(controller != null)
  21447. // 3. Abort controller with requestObject’s signal’s abort reason.
  21448. controller.abort(requestObject.signal.reason)
  21449. // 4. Abort the fetch() call with p, request, responseObject,
  21450. // and requestObject’s signal’s abort reason.
  21451. abortFetch(p, request, responseObject, requestObject.signal.reason)
  21452. }
  21453. )
  21454. // 12. Let handleFetchDone given response response be to finalize and
  21455. // report timing with response, globalObject, and "fetch".
  21456. const handleFetchDone = (response) =>
  21457. finalizeAndReportTiming(response, 'fetch')
  21458. // 13. Set controller to the result of calling fetch given request,
  21459. // with processResponseEndOfBody set to handleFetchDone, and processResponse
  21460. // given response being these substeps:
  21461. const processResponse = (response) => {
  21462. // 1. If locallyAborted is true, terminate these substeps.
  21463. if (locallyAborted) {
  21464. return Promise.resolve()
  21465. }
  21466. // 2. If response’s aborted flag is set, then:
  21467. if (response.aborted) {
  21468. // 1. Let deserializedError be the result of deserialize a serialized
  21469. // abort reason given controller’s serialized abort reason and
  21470. // relevantRealm.
  21471. // 2. Abort the fetch() call with p, request, responseObject, and
  21472. // deserializedError.
  21473. abortFetch(p, request, responseObject, controller.serializedAbortReason)
  21474. return Promise.resolve()
  21475. }
  21476. // 3. If response is a network error, then reject p with a TypeError
  21477. // and terminate these substeps.
  21478. if (response.type === 'error') {
  21479. p.reject(
  21480. Object.assign(new TypeError('fetch failed'), { cause: response.error })
  21481. )
  21482. return Promise.resolve()
  21483. }
  21484. // 4. Set responseObject to the result of creating a Response object,
  21485. // given response, "immutable", and relevantRealm.
  21486. responseObject = new Response()
  21487. responseObject[kState] = response
  21488. responseObject[kRealm] = relevantRealm
  21489. responseObject[kHeaders][kHeadersList] = response.headersList
  21490. responseObject[kHeaders][kGuard] = 'immutable'
  21491. responseObject[kHeaders][kRealm] = relevantRealm
  21492. // 5. Resolve p with responseObject.
  21493. p.resolve(responseObject)
  21494. }
  21495. controller = fetching({
  21496. request,
  21497. processResponseEndOfBody: handleFetchDone,
  21498. processResponse,
  21499. dispatcher: init.dispatcher ?? getGlobalDispatcher() // undici
  21500. })
  21501. // 14. Return p.
  21502. return p.promise
  21503. }
  21504. // https://fetch.spec.whatwg.org/#finalize-and-report-timing
  21505. function finalizeAndReportTiming (response, initiatorType = 'other') {
  21506. // 1. If response is an aborted network error, then return.
  21507. if (response.type === 'error' && response.aborted) {
  21508. return
  21509. }
  21510. // 2. If response’s URL list is null or empty, then return.
  21511. if (!response.urlList?.length) {
  21512. return
  21513. }
  21514. // 3. Let originalURL be response’s URL list[0].
  21515. const originalURL = response.urlList[0]
  21516. // 4. Let timingInfo be response’s timing info.
  21517. let timingInfo = response.timingInfo
  21518. // 5. Let cacheState be response’s cache state.
  21519. let cacheState = response.cacheState
  21520. // 6. If originalURL’s scheme is not an HTTP(S) scheme, then return.
  21521. if (!urlIsHttpHttpsScheme(originalURL)) {
  21522. return
  21523. }
  21524. // 7. If timingInfo is null, then return.
  21525. if (timingInfo === null) {
  21526. return
  21527. }
  21528. // 8. If response’s timing allow passed flag is not set, then:
  21529. if (!response.timingAllowPassed) {
  21530. // 1. Set timingInfo to a the result of creating an opaque timing info for timingInfo.
  21531. timingInfo = createOpaqueTimingInfo({
  21532. startTime: timingInfo.startTime
  21533. })
  21534. // 2. Set cacheState to the empty string.
  21535. cacheState = ''
  21536. }
  21537. // 9. Set timingInfo’s end time to the coarsened shared current time
  21538. // given global’s relevant settings object’s cross-origin isolated
  21539. // capability.
  21540. // TODO: given global’s relevant settings object’s cross-origin isolated
  21541. // capability?
  21542. timingInfo.endTime = coarsenedSharedCurrentTime()
  21543. // 10. Set response’s timing info to timingInfo.
  21544. response.timingInfo = timingInfo
  21545. // 11. Mark resource timing for timingInfo, originalURL, initiatorType,
  21546. // global, and cacheState.
  21547. markResourceTiming(
  21548. timingInfo,
  21549. originalURL,
  21550. initiatorType,
  21551. globalThis,
  21552. cacheState
  21553. )
  21554. }
  21555. // https://w3c.github.io/resource-timing/#dfn-mark-resource-timing
  21556. function markResourceTiming (timingInfo, originalURL, initiatorType, globalThis, cacheState) {
  21557. if (nodeMajor > 18 || (nodeMajor === 18 && nodeMinor >= 2)) {
  21558. performance.markResourceTiming(timingInfo, originalURL.href, initiatorType, globalThis, cacheState)
  21559. }
  21560. }
  21561. // https://fetch.spec.whatwg.org/#abort-fetch
  21562. function abortFetch (p, request, responseObject, error) {
  21563. // Note: AbortSignal.reason was added in node v17.2.0
  21564. // which would give us an undefined error to reject with.
  21565. // Remove this once node v16 is no longer supported.
  21566. if (!error) {
  21567. error = new DOMException('The operation was aborted.', 'AbortError')
  21568. }
  21569. // 1. Reject promise with error.
  21570. p.reject(error)
  21571. // 2. If request’s body is not null and is readable, then cancel request’s
  21572. // body with error.
  21573. if (request.body != null && isReadable(request.body?.stream)) {
  21574. request.body.stream.cancel(error).catch((err) => {
  21575. if (err.code === 'ERR_INVALID_STATE') {
  21576. // Node bug?
  21577. return
  21578. }
  21579. throw err
  21580. })
  21581. }
  21582. // 3. If responseObject is null, then return.
  21583. if (responseObject == null) {
  21584. return
  21585. }
  21586. // 4. Let response be responseObject’s response.
  21587. const response = responseObject[kState]
  21588. // 5. If response’s body is not null and is readable, then error response’s
  21589. // body with error.
  21590. if (response.body != null && isReadable(response.body?.stream)) {
  21591. response.body.stream.cancel(error).catch((err) => {
  21592. if (err.code === 'ERR_INVALID_STATE') {
  21593. // Node bug?
  21594. return
  21595. }
  21596. throw err
  21597. })
  21598. }
  21599. }
  21600. // https://fetch.spec.whatwg.org/#fetching
  21601. function fetching ({
  21602. request,
  21603. processRequestBodyChunkLength,
  21604. processRequestEndOfBody,
  21605. processResponse,
  21606. processResponseEndOfBody,
  21607. processResponseConsumeBody,
  21608. useParallelQueue = false,
  21609. dispatcher // undici
  21610. }) {
  21611. // 1. Let taskDestination be null.
  21612. let taskDestination = null
  21613. // 2. Let crossOriginIsolatedCapability be false.
  21614. let crossOriginIsolatedCapability = false
  21615. // 3. If request’s client is non-null, then:
  21616. if (request.client != null) {
  21617. // 1. Set taskDestination to request’s client’s global object.
  21618. taskDestination = request.client.globalObject
  21619. // 2. Set crossOriginIsolatedCapability to request’s client’s cross-origin
  21620. // isolated capability.
  21621. crossOriginIsolatedCapability =
  21622. request.client.crossOriginIsolatedCapability
  21623. }
  21624. // 4. If useParallelQueue is true, then set taskDestination to the result of
  21625. // starting a new parallel queue.
  21626. // TODO
  21627. // 5. Let timingInfo be a new fetch timing info whose start time and
  21628. // post-redirect start time are the coarsened shared current time given
  21629. // crossOriginIsolatedCapability.
  21630. const currenTime = coarsenedSharedCurrentTime(crossOriginIsolatedCapability)
  21631. const timingInfo = createOpaqueTimingInfo({
  21632. startTime: currenTime
  21633. })
  21634. // 6. Let fetchParams be a new fetch params whose
  21635. // request is request,
  21636. // timing info is timingInfo,
  21637. // process request body chunk length is processRequestBodyChunkLength,
  21638. // process request end-of-body is processRequestEndOfBody,
  21639. // process response is processResponse,
  21640. // process response consume body is processResponseConsumeBody,
  21641. // process response end-of-body is processResponseEndOfBody,
  21642. // task destination is taskDestination,
  21643. // and cross-origin isolated capability is crossOriginIsolatedCapability.
  21644. const fetchParams = {
  21645. controller: new Fetch(dispatcher),
  21646. request,
  21647. timingInfo,
  21648. processRequestBodyChunkLength,
  21649. processRequestEndOfBody,
  21650. processResponse,
  21651. processResponseConsumeBody,
  21652. processResponseEndOfBody,
  21653. taskDestination,
  21654. crossOriginIsolatedCapability
  21655. }
  21656. // 7. If request’s body is a byte sequence, then set request’s body to
  21657. // request’s body as a body.
  21658. // NOTE: Since fetching is only called from fetch, body should already be
  21659. // extracted.
  21660. assert(!request.body || request.body.stream)
  21661. // 8. If request’s window is "client", then set request’s window to request’s
  21662. // client, if request’s client’s global object is a Window object; otherwise
  21663. // "no-window".
  21664. if (request.window === 'client') {
  21665. // TODO: What if request.client is null?
  21666. request.window =
  21667. request.client?.globalObject?.constructor?.name === 'Window'
  21668. ? request.client
  21669. : 'no-window'
  21670. }
  21671. // 9. If request’s origin is "client", then set request’s origin to request’s
  21672. // client’s origin.
  21673. if (request.origin === 'client') {
  21674. // TODO: What if request.client is null?
  21675. request.origin = request.client?.origin
  21676. }
  21677. // 10. If all of the following conditions are true:
  21678. // TODO
  21679. // 11. If request’s policy container is "client", then:
  21680. if (request.policyContainer === 'client') {
  21681. // 1. If request’s client is non-null, then set request’s policy
  21682. // container to a clone of request’s client’s policy container. [HTML]
  21683. if (request.client != null) {
  21684. request.policyContainer = clonePolicyContainer(
  21685. request.client.policyContainer
  21686. )
  21687. } else {
  21688. // 2. Otherwise, set request’s policy container to a new policy
  21689. // container.
  21690. request.policyContainer = makePolicyContainer()
  21691. }
  21692. }
  21693. // 12. If request’s header list does not contain `Accept`, then:
  21694. if (!request.headersList.contains('accept')) {
  21695. // 1. Let value be `*/*`.
  21696. const value = '*/*'
  21697. // 2. A user agent should set value to the first matching statement, if
  21698. // any, switching on request’s destination:
  21699. // "document"
  21700. // "frame"
  21701. // "iframe"
  21702. // `text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8`
  21703. // "image"
  21704. // `image/png,image/svg+xml,image/*;q=0.8,*/*;q=0.5`
  21705. // "style"
  21706. // `text/css,*/*;q=0.1`
  21707. // TODO
  21708. // 3. Append `Accept`/value to request’s header list.
  21709. request.headersList.append('accept', value)
  21710. }
  21711. // 13. If request’s header list does not contain `Accept-Language`, then
  21712. // user agents should append `Accept-Language`/an appropriate value to
  21713. // request’s header list.
  21714. if (!request.headersList.contains('accept-language')) {
  21715. request.headersList.append('accept-language', '*')
  21716. }
  21717. // 14. If request’s priority is null, then use request’s initiator and
  21718. // destination appropriately in setting request’s priority to a
  21719. // user-agent-defined object.
  21720. if (request.priority === null) {
  21721. // TODO
  21722. }
  21723. // 15. If request is a subresource request, then:
  21724. if (subresourceSet.has(request.destination)) {
  21725. // TODO
  21726. }
  21727. // 16. Run main fetch given fetchParams.
  21728. mainFetch(fetchParams)
  21729. .catch(err => {
  21730. fetchParams.controller.terminate(err)
  21731. })
  21732. // 17. Return fetchParam's controller
  21733. return fetchParams.controller
  21734. }
  21735. // https://fetch.spec.whatwg.org/#concept-main-fetch
  21736. async function mainFetch (fetchParams, recursive = false) {
  21737. // 1. Let request be fetchParams’s request.
  21738. const request = fetchParams.request
  21739. // 2. Let response be null.
  21740. let response = null
  21741. // 3. If request’s local-URLs-only flag is set and request’s current URL is
  21742. // not local, then set response to a network error.
  21743. if (request.localURLsOnly && !urlIsLocal(requestCurrentURL(request))) {
  21744. response = makeNetworkError('local URLs only')
  21745. }
  21746. // 4. Run report Content Security Policy violations for request.
  21747. // TODO
  21748. // 5. Upgrade request to a potentially trustworthy URL, if appropriate.
  21749. tryUpgradeRequestToAPotentiallyTrustworthyURL(request)
  21750. // 6. If should request be blocked due to a bad port, should fetching request
  21751. // be blocked as mixed content, or should request be blocked by Content
  21752. // Security Policy returns blocked, then set response to a network error.
  21753. if (requestBadPort(request) === 'blocked') {
  21754. response = makeNetworkError('bad port')
  21755. }
  21756. // TODO: should fetching request be blocked as mixed content?
  21757. // TODO: should request be blocked by Content Security Policy?
  21758. // 7. If request’s referrer policy is the empty string, then set request’s
  21759. // referrer policy to request’s policy container’s referrer policy.
  21760. if (request.referrerPolicy === '') {
  21761. request.referrerPolicy = request.policyContainer.referrerPolicy
  21762. }
  21763. // 8. If request’s referrer is not "no-referrer", then set request’s
  21764. // referrer to the result of invoking determine request’s referrer.
  21765. if (request.referrer !== 'no-referrer') {
  21766. request.referrer = determineRequestsReferrer(request)
  21767. }
  21768. // 9. Set request’s current URL’s scheme to "https" if all of the following
  21769. // conditions are true:
  21770. // - request’s current URL’s scheme is "http"
  21771. // - request’s current URL’s host is a domain
  21772. // - Matching request’s current URL’s host per Known HSTS Host Domain Name
  21773. // Matching results in either a superdomain match with an asserted
  21774. // includeSubDomains directive or a congruent match (with or without an
  21775. // asserted includeSubDomains directive). [HSTS]
  21776. // TODO
  21777. // 10. If recursive is false, then run the remaining steps in parallel.
  21778. // TODO
  21779. // 11. If response is null, then set response to the result of running
  21780. // the steps corresponding to the first matching statement:
  21781. if (response === null) {
  21782. response = await (async () => {
  21783. const currentURL = requestCurrentURL(request)
  21784. if (
  21785. // - request’s current URL’s origin is same origin with request’s origin,
  21786. // and request’s response tainting is "basic"
  21787. (sameOrigin(currentURL, request.url) && request.responseTainting === 'basic') ||
  21788. // request’s current URL’s scheme is "data"
  21789. (currentURL.protocol === 'data:') ||
  21790. // - request’s mode is "navigate" or "websocket"
  21791. (request.mode === 'navigate' || request.mode === 'websocket')
  21792. ) {
  21793. // 1. Set request’s response tainting to "basic".
  21794. request.responseTainting = 'basic'
  21795. // 2. Return the result of running scheme fetch given fetchParams.
  21796. return await schemeFetch(fetchParams)
  21797. }
  21798. // request’s mode is "same-origin"
  21799. if (request.mode === 'same-origin') {
  21800. // 1. Return a network error.
  21801. return makeNetworkError('request mode cannot be "same-origin"')
  21802. }
  21803. // request’s mode is "no-cors"
  21804. if (request.mode === 'no-cors') {
  21805. // 1. If request’s redirect mode is not "follow", then return a network
  21806. // error.
  21807. if (request.redirect !== 'follow') {
  21808. return makeNetworkError(
  21809. 'redirect mode cannot be "follow" for "no-cors" request'
  21810. )
  21811. }
  21812. // 2. Set request’s response tainting to "opaque".
  21813. request.responseTainting = 'opaque'
  21814. // 3. Return the result of running scheme fetch given fetchParams.
  21815. return await schemeFetch(fetchParams)
  21816. }
  21817. // request’s current URL’s scheme is not an HTTP(S) scheme
  21818. if (!urlIsHttpHttpsScheme(requestCurrentURL(request))) {
  21819. // Return a network error.
  21820. return makeNetworkError('URL scheme must be a HTTP(S) scheme')
  21821. }
  21822. // - request’s use-CORS-preflight flag is set
  21823. // - request’s unsafe-request flag is set and either request’s method is
  21824. // not a CORS-safelisted method or CORS-unsafe request-header names with
  21825. // request’s header list is not empty
  21826. // 1. Set request’s response tainting to "cors".
  21827. // 2. Let corsWithPreflightResponse be the result of running HTTP fetch
  21828. // given fetchParams and true.
  21829. // 3. If corsWithPreflightResponse is a network error, then clear cache
  21830. // entries using request.
  21831. // 4. Return corsWithPreflightResponse.
  21832. // TODO
  21833. // Otherwise
  21834. // 1. Set request’s response tainting to "cors".
  21835. request.responseTainting = 'cors'
  21836. // 2. Return the result of running HTTP fetch given fetchParams.
  21837. return await httpFetch(fetchParams)
  21838. })()
  21839. }
  21840. // 12. If recursive is true, then return response.
  21841. if (recursive) {
  21842. return response
  21843. }
  21844. // 13. If response is not a network error and response is not a filtered
  21845. // response, then:
  21846. if (response.status !== 0 && !response.internalResponse) {
  21847. // If request’s response tainting is "cors", then:
  21848. if (request.responseTainting === 'cors') {
  21849. // 1. Let headerNames be the result of extracting header list values
  21850. // given `Access-Control-Expose-Headers` and response’s header list.
  21851. // TODO
  21852. // 2. If request’s credentials mode is not "include" and headerNames
  21853. // contains `*`, then set response’s CORS-exposed header-name list to
  21854. // all unique header names in response’s header list.
  21855. // TODO
  21856. // 3. Otherwise, if headerNames is not null or failure, then set
  21857. // response’s CORS-exposed header-name list to headerNames.
  21858. // TODO
  21859. }
  21860. // Set response to the following filtered response with response as its
  21861. // internal response, depending on request’s response tainting:
  21862. if (request.responseTainting === 'basic') {
  21863. response = filterResponse(response, 'basic')
  21864. } else if (request.responseTainting === 'cors') {
  21865. response = filterResponse(response, 'cors')
  21866. } else if (request.responseTainting === 'opaque') {
  21867. response = filterResponse(response, 'opaque')
  21868. } else {
  21869. assert(false)
  21870. }
  21871. }
  21872. // 14. Let internalResponse be response, if response is a network error,
  21873. // and response’s internal response otherwise.
  21874. let internalResponse =
  21875. response.status === 0 ? response : response.internalResponse
  21876. // 15. If internalResponse’s URL list is empty, then set it to a clone of
  21877. // request’s URL list.
  21878. if (internalResponse.urlList.length === 0) {
  21879. internalResponse.urlList.push(...request.urlList)
  21880. }
  21881. // 16. If request’s timing allow failed flag is unset, then set
  21882. // internalResponse’s timing allow passed flag.
  21883. if (!request.timingAllowFailed) {
  21884. response.timingAllowPassed = true
  21885. }
  21886. // 17. If response is not a network error and any of the following returns
  21887. // blocked
  21888. // - should internalResponse to request be blocked as mixed content
  21889. // - should internalResponse to request be blocked by Content Security Policy
  21890. // - should internalResponse to request be blocked due to its MIME type
  21891. // - should internalResponse to request be blocked due to nosniff
  21892. // TODO
  21893. // 18. If response’s type is "opaque", internalResponse’s status is 206,
  21894. // internalResponse’s range-requested flag is set, and request’s header
  21895. // list does not contain `Range`, then set response and internalResponse
  21896. // to a network error.
  21897. if (
  21898. response.type === 'opaque' &&
  21899. internalResponse.status === 206 &&
  21900. internalResponse.rangeRequested &&
  21901. !request.headers.contains('range')
  21902. ) {
  21903. response = internalResponse = makeNetworkError()
  21904. }
  21905. // 19. If response is not a network error and either request’s method is
  21906. // `HEAD` or `CONNECT`, or internalResponse’s status is a null body status,
  21907. // set internalResponse’s body to null and disregard any enqueuing toward
  21908. // it (if any).
  21909. if (
  21910. response.status !== 0 &&
  21911. (request.method === 'HEAD' ||
  21912. request.method === 'CONNECT' ||
  21913. nullBodyStatus.includes(internalResponse.status))
  21914. ) {
  21915. internalResponse.body = null
  21916. fetchParams.controller.dump = true
  21917. }
  21918. // 20. If request’s integrity metadata is not the empty string, then:
  21919. if (request.integrity) {
  21920. // 1. Let processBodyError be this step: run fetch finale given fetchParams
  21921. // and a network error.
  21922. const processBodyError = (reason) =>
  21923. fetchFinale(fetchParams, makeNetworkError(reason))
  21924. // 2. If request’s response tainting is "opaque", or response’s body is null,
  21925. // then run processBodyError and abort these steps.
  21926. if (request.responseTainting === 'opaque' || response.body == null) {
  21927. processBodyError(response.error)
  21928. return
  21929. }
  21930. // 3. Let processBody given bytes be these steps:
  21931. const processBody = (bytes) => {
  21932. // 1. If bytes do not match request’s integrity metadata,
  21933. // then run processBodyError and abort these steps. [SRI]
  21934. if (!bytesMatch(bytes, request.integrity)) {
  21935. processBodyError('integrity mismatch')
  21936. return
  21937. }
  21938. // 2. Set response’s body to bytes as a body.
  21939. response.body = safelyExtractBody(bytes)[0]
  21940. // 3. Run fetch finale given fetchParams and response.
  21941. fetchFinale(fetchParams, response)
  21942. }
  21943. // 4. Fully read response’s body given processBody and processBodyError.
  21944. await fullyReadBody(response.body, processBody, processBodyError)
  21945. } else {
  21946. // 21. Otherwise, run fetch finale given fetchParams and response.
  21947. fetchFinale(fetchParams, response)
  21948. }
  21949. }
  21950. // https://fetch.spec.whatwg.org/#concept-scheme-fetch
  21951. // given a fetch params fetchParams
  21952. function schemeFetch (fetchParams) {
  21953. // Note: since the connection is destroyed on redirect, which sets fetchParams to a
  21954. // cancelled state, we do not want this condition to trigger *unless* there have been
  21955. // no redirects. See https://github.com/nodejs/undici/issues/1776
  21956. // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams.
  21957. if (isCancelled(fetchParams) && fetchParams.request.redirectCount === 0) {
  21958. return Promise.resolve(makeAppropriateNetworkError(fetchParams))
  21959. }
  21960. // 2. Let request be fetchParams’s request.
  21961. const { request } = fetchParams
  21962. const { protocol: scheme } = requestCurrentURL(request)
  21963. // 3. Switch on request’s current URL’s scheme and run the associated steps:
  21964. switch (scheme) {
  21965. case 'about:': {
  21966. // If request’s current URL’s path is the string "blank", then return a new response
  21967. // whose status message is `OK`, header list is « (`Content-Type`, `text/html;charset=utf-8`) »,
  21968. // and body is the empty byte sequence as a body.
  21969. // Otherwise, return a network error.
  21970. return Promise.resolve(makeNetworkError('about scheme is not supported'))
  21971. }
  21972. case 'blob:': {
  21973. if (!resolveObjectURL) {
  21974. resolveObjectURL = (__nccwpck_require__(4300).resolveObjectURL)
  21975. }
  21976. // 1. Let blobURLEntry be request’s current URL’s blob URL entry.
  21977. const blobURLEntry = requestCurrentURL(request)
  21978. // https://github.com/web-platform-tests/wpt/blob/7b0ebaccc62b566a1965396e5be7bb2bc06f841f/FileAPI/url/resources/fetch-tests.js#L52-L56
  21979. // Buffer.resolveObjectURL does not ignore URL queries.
  21980. if (blobURLEntry.search.length !== 0) {
  21981. return Promise.resolve(makeNetworkError('NetworkError when attempting to fetch resource.'))
  21982. }
  21983. const blobURLEntryObject = resolveObjectURL(blobURLEntry.toString())
  21984. // 2. If request’s method is not `GET`, blobURLEntry is null, or blobURLEntry’s
  21985. // object is not a Blob object, then return a network error.
  21986. if (request.method !== 'GET' || !isBlobLike(blobURLEntryObject)) {
  21987. return Promise.resolve(makeNetworkError('invalid method'))
  21988. }
  21989. // 3. Let bodyWithType be the result of safely extracting blobURLEntry’s object.
  21990. const bodyWithType = safelyExtractBody(blobURLEntryObject)
  21991. // 4. Let body be bodyWithType’s body.
  21992. const body = bodyWithType[0]
  21993. // 5. Let length be body’s length, serialized and isomorphic encoded.
  21994. const length = isomorphicEncode(`${body.length}`)
  21995. // 6. Let type be bodyWithType’s type if it is non-null; otherwise the empty byte sequence.
  21996. const type = bodyWithType[1] ?? ''
  21997. // 7. Return a new response whose status message is `OK`, header list is
  21998. // « (`Content-Length`, length), (`Content-Type`, type) », and body is body.
  21999. const response = makeResponse({
  22000. statusText: 'OK',
  22001. headersList: [
  22002. ['content-length', { name: 'Content-Length', value: length }],
  22003. ['content-type', { name: 'Content-Type', value: type }]
  22004. ]
  22005. })
  22006. response.body = body
  22007. return Promise.resolve(response)
  22008. }
  22009. case 'data:': {
  22010. // 1. Let dataURLStruct be the result of running the
  22011. // data: URL processor on request’s current URL.
  22012. const currentURL = requestCurrentURL(request)
  22013. const dataURLStruct = dataURLProcessor(currentURL)
  22014. // 2. If dataURLStruct is failure, then return a
  22015. // network error.
  22016. if (dataURLStruct === 'failure') {
  22017. return Promise.resolve(makeNetworkError('failed to fetch the data URL'))
  22018. }
  22019. // 3. Let mimeType be dataURLStruct’s MIME type, serialized.
  22020. const mimeType = serializeAMimeType(dataURLStruct.mimeType)
  22021. // 4. Return a response whose status message is `OK`,
  22022. // header list is « (`Content-Type`, mimeType) »,
  22023. // and body is dataURLStruct’s body as a body.
  22024. return Promise.resolve(makeResponse({
  22025. statusText: 'OK',
  22026. headersList: [
  22027. ['content-type', { name: 'Content-Type', value: mimeType }]
  22028. ],
  22029. body: safelyExtractBody(dataURLStruct.body)[0]
  22030. }))
  22031. }
  22032. case 'file:': {
  22033. // For now, unfortunate as it is, file URLs are left as an exercise for the reader.
  22034. // When in doubt, return a network error.
  22035. return Promise.resolve(makeNetworkError('not implemented... yet...'))
  22036. }
  22037. case 'http:':
  22038. case 'https:': {
  22039. // Return the result of running HTTP fetch given fetchParams.
  22040. return httpFetch(fetchParams)
  22041. .catch((err) => makeNetworkError(err))
  22042. }
  22043. default: {
  22044. return Promise.resolve(makeNetworkError('unknown scheme'))
  22045. }
  22046. }
  22047. }
  22048. // https://fetch.spec.whatwg.org/#finalize-response
  22049. function finalizeResponse (fetchParams, response) {
  22050. // 1. Set fetchParams’s request’s done flag.
  22051. fetchParams.request.done = true
  22052. // 2, If fetchParams’s process response done is not null, then queue a fetch
  22053. // task to run fetchParams’s process response done given response, with
  22054. // fetchParams’s task destination.
  22055. if (fetchParams.processResponseDone != null) {
  22056. queueMicrotask(() => fetchParams.processResponseDone(response))
  22057. }
  22058. }
  22059. // https://fetch.spec.whatwg.org/#fetch-finale
  22060. function fetchFinale (fetchParams, response) {
  22061. // 1. If response is a network error, then:
  22062. if (response.type === 'error') {
  22063. // 1. Set response’s URL list to « fetchParams’s request’s URL list[0] ».
  22064. response.urlList = [fetchParams.request.urlList[0]]
  22065. // 2. Set response’s timing info to the result of creating an opaque timing
  22066. // info for fetchParams’s timing info.
  22067. response.timingInfo = createOpaqueTimingInfo({
  22068. startTime: fetchParams.timingInfo.startTime
  22069. })
  22070. }
  22071. // 2. Let processResponseEndOfBody be the following steps:
  22072. const processResponseEndOfBody = () => {
  22073. // 1. Set fetchParams’s request’s done flag.
  22074. fetchParams.request.done = true
  22075. // If fetchParams’s process response end-of-body is not null,
  22076. // then queue a fetch task to run fetchParams’s process response
  22077. // end-of-body given response with fetchParams’s task destination.
  22078. if (fetchParams.processResponseEndOfBody != null) {
  22079. queueMicrotask(() => fetchParams.processResponseEndOfBody(response))
  22080. }
  22081. }
  22082. // 3. If fetchParams’s process response is non-null, then queue a fetch task
  22083. // to run fetchParams’s process response given response, with fetchParams’s
  22084. // task destination.
  22085. if (fetchParams.processResponse != null) {
  22086. queueMicrotask(() => fetchParams.processResponse(response))
  22087. }
  22088. // 4. If response’s body is null, then run processResponseEndOfBody.
  22089. if (response.body == null) {
  22090. processResponseEndOfBody()
  22091. } else {
  22092. // 5. Otherwise:
  22093. // 1. Let transformStream be a new a TransformStream.
  22094. // 2. Let identityTransformAlgorithm be an algorithm which, given chunk,
  22095. // enqueues chunk in transformStream.
  22096. const identityTransformAlgorithm = (chunk, controller) => {
  22097. controller.enqueue(chunk)
  22098. }
  22099. // 3. Set up transformStream with transformAlgorithm set to identityTransformAlgorithm
  22100. // and flushAlgorithm set to processResponseEndOfBody.
  22101. const transformStream = new TransformStream({
  22102. start () {},
  22103. transform: identityTransformAlgorithm,
  22104. flush: processResponseEndOfBody
  22105. }, {
  22106. size () {
  22107. return 1
  22108. }
  22109. }, {
  22110. size () {
  22111. return 1
  22112. }
  22113. })
  22114. // 4. Set response’s body to the result of piping response’s body through transformStream.
  22115. response.body = { stream: response.body.stream.pipeThrough(transformStream) }
  22116. }
  22117. // 6. If fetchParams’s process response consume body is non-null, then:
  22118. if (fetchParams.processResponseConsumeBody != null) {
  22119. // 1. Let processBody given nullOrBytes be this step: run fetchParams’s
  22120. // process response consume body given response and nullOrBytes.
  22121. const processBody = (nullOrBytes) => fetchParams.processResponseConsumeBody(response, nullOrBytes)
  22122. // 2. Let processBodyError be this step: run fetchParams’s process
  22123. // response consume body given response and failure.
  22124. const processBodyError = (failure) => fetchParams.processResponseConsumeBody(response, failure)
  22125. // 3. If response’s body is null, then queue a fetch task to run processBody
  22126. // given null, with fetchParams’s task destination.
  22127. if (response.body == null) {
  22128. queueMicrotask(() => processBody(null))
  22129. } else {
  22130. // 4. Otherwise, fully read response’s body given processBody, processBodyError,
  22131. // and fetchParams’s task destination.
  22132. return fullyReadBody(response.body, processBody, processBodyError)
  22133. }
  22134. return Promise.resolve()
  22135. }
  22136. }
  22137. // https://fetch.spec.whatwg.org/#http-fetch
  22138. async function httpFetch (fetchParams) {
  22139. // 1. Let request be fetchParams’s request.
  22140. const request = fetchParams.request
  22141. // 2. Let response be null.
  22142. let response = null
  22143. // 3. Let actualResponse be null.
  22144. let actualResponse = null
  22145. // 4. Let timingInfo be fetchParams’s timing info.
  22146. const timingInfo = fetchParams.timingInfo
  22147. // 5. If request’s service-workers mode is "all", then:
  22148. if (request.serviceWorkers === 'all') {
  22149. // TODO
  22150. }
  22151. // 6. If response is null, then:
  22152. if (response === null) {
  22153. // 1. If makeCORSPreflight is true and one of these conditions is true:
  22154. // TODO
  22155. // 2. If request’s redirect mode is "follow", then set request’s
  22156. // service-workers mode to "none".
  22157. if (request.redirect === 'follow') {
  22158. request.serviceWorkers = 'none'
  22159. }
  22160. // 3. Set response and actualResponse to the result of running
  22161. // HTTP-network-or-cache fetch given fetchParams.
  22162. actualResponse = response = await httpNetworkOrCacheFetch(fetchParams)
  22163. // 4. If request’s response tainting is "cors" and a CORS check
  22164. // for request and response returns failure, then return a network error.
  22165. if (
  22166. request.responseTainting === 'cors' &&
  22167. corsCheck(request, response) === 'failure'
  22168. ) {
  22169. return makeNetworkError('cors failure')
  22170. }
  22171. // 5. If the TAO check for request and response returns failure, then set
  22172. // request’s timing allow failed flag.
  22173. if (TAOCheck(request, response) === 'failure') {
  22174. request.timingAllowFailed = true
  22175. }
  22176. }
  22177. // 7. If either request’s response tainting or response’s type
  22178. // is "opaque", and the cross-origin resource policy check with
  22179. // request’s origin, request’s client, request’s destination,
  22180. // and actualResponse returns blocked, then return a network error.
  22181. if (
  22182. (request.responseTainting === 'opaque' || response.type === 'opaque') &&
  22183. crossOriginResourcePolicyCheck(
  22184. request.origin,
  22185. request.client,
  22186. request.destination,
  22187. actualResponse
  22188. ) === 'blocked'
  22189. ) {
  22190. return makeNetworkError('blocked')
  22191. }
  22192. // 8. If actualResponse’s status is a redirect status, then:
  22193. if (redirectStatusSet.has(actualResponse.status)) {
  22194. // 1. If actualResponse’s status is not 303, request’s body is not null,
  22195. // and the connection uses HTTP/2, then user agents may, and are even
  22196. // encouraged to, transmit an RST_STREAM frame.
  22197. // See, https://github.com/whatwg/fetch/issues/1288
  22198. if (request.redirect !== 'manual') {
  22199. fetchParams.controller.connection.destroy()
  22200. }
  22201. // 2. Switch on request’s redirect mode:
  22202. if (request.redirect === 'error') {
  22203. // Set response to a network error.
  22204. response = makeNetworkError('unexpected redirect')
  22205. } else if (request.redirect === 'manual') {
  22206. // Set response to an opaque-redirect filtered response whose internal
  22207. // response is actualResponse.
  22208. // NOTE(spec): On the web this would return an `opaqueredirect` response,
  22209. // but that doesn't make sense server side.
  22210. // See https://github.com/nodejs/undici/issues/1193.
  22211. response = actualResponse
  22212. } else if (request.redirect === 'follow') {
  22213. // Set response to the result of running HTTP-redirect fetch given
  22214. // fetchParams and response.
  22215. response = await httpRedirectFetch(fetchParams, response)
  22216. } else {
  22217. assert(false)
  22218. }
  22219. }
  22220. // 9. Set response’s timing info to timingInfo.
  22221. response.timingInfo = timingInfo
  22222. // 10. Return response.
  22223. return response
  22224. }
  22225. // https://fetch.spec.whatwg.org/#http-redirect-fetch
  22226. function httpRedirectFetch (fetchParams, response) {
  22227. // 1. Let request be fetchParams’s request.
  22228. const request = fetchParams.request
  22229. // 2. Let actualResponse be response, if response is not a filtered response,
  22230. // and response’s internal response otherwise.
  22231. const actualResponse = response.internalResponse
  22232. ? response.internalResponse
  22233. : response
  22234. // 3. Let locationURL be actualResponse’s location URL given request’s current
  22235. // URL’s fragment.
  22236. let locationURL
  22237. try {
  22238. locationURL = responseLocationURL(
  22239. actualResponse,
  22240. requestCurrentURL(request).hash
  22241. )
  22242. // 4. If locationURL is null, then return response.
  22243. if (locationURL == null) {
  22244. return response
  22245. }
  22246. } catch (err) {
  22247. // 5. If locationURL is failure, then return a network error.
  22248. return Promise.resolve(makeNetworkError(err))
  22249. }
  22250. // 6. If locationURL’s scheme is not an HTTP(S) scheme, then return a network
  22251. // error.
  22252. if (!urlIsHttpHttpsScheme(locationURL)) {
  22253. return Promise.resolve(makeNetworkError('URL scheme must be a HTTP(S) scheme'))
  22254. }
  22255. // 7. If request’s redirect count is 20, then return a network error.
  22256. if (request.redirectCount === 20) {
  22257. return Promise.resolve(makeNetworkError('redirect count exceeded'))
  22258. }
  22259. // 8. Increase request’s redirect count by 1.
  22260. request.redirectCount += 1
  22261. // 9. If request’s mode is "cors", locationURL includes credentials, and
  22262. // request’s origin is not same origin with locationURL’s origin, then return
  22263. // a network error.
  22264. if (
  22265. request.mode === 'cors' &&
  22266. (locationURL.username || locationURL.password) &&
  22267. !sameOrigin(request, locationURL)
  22268. ) {
  22269. return Promise.resolve(makeNetworkError('cross origin not allowed for request mode "cors"'))
  22270. }
  22271. // 10. If request’s response tainting is "cors" and locationURL includes
  22272. // credentials, then return a network error.
  22273. if (
  22274. request.responseTainting === 'cors' &&
  22275. (locationURL.username || locationURL.password)
  22276. ) {
  22277. return Promise.resolve(makeNetworkError(
  22278. 'URL cannot contain credentials for request mode "cors"'
  22279. ))
  22280. }
  22281. // 11. If actualResponse’s status is not 303, request’s body is non-null,
  22282. // and request’s body’s source is null, then return a network error.
  22283. if (
  22284. actualResponse.status !== 303 &&
  22285. request.body != null &&
  22286. request.body.source == null
  22287. ) {
  22288. return Promise.resolve(makeNetworkError())
  22289. }
  22290. // 12. If one of the following is true
  22291. // - actualResponse’s status is 301 or 302 and request’s method is `POST`
  22292. // - actualResponse’s status is 303 and request’s method is not `GET` or `HEAD`
  22293. if (
  22294. ([301, 302].includes(actualResponse.status) && request.method === 'POST') ||
  22295. (actualResponse.status === 303 &&
  22296. !GET_OR_HEAD.includes(request.method))
  22297. ) {
  22298. // then:
  22299. // 1. Set request’s method to `GET` and request’s body to null.
  22300. request.method = 'GET'
  22301. request.body = null
  22302. // 2. For each headerName of request-body-header name, delete headerName from
  22303. // request’s header list.
  22304. for (const headerName of requestBodyHeader) {
  22305. request.headersList.delete(headerName)
  22306. }
  22307. }
  22308. // 13. If request’s current URL’s origin is not same origin with locationURL’s
  22309. // origin, then for each headerName of CORS non-wildcard request-header name,
  22310. // delete headerName from request’s header list.
  22311. if (!sameOrigin(requestCurrentURL(request), locationURL)) {
  22312. // https://fetch.spec.whatwg.org/#cors-non-wildcard-request-header-name
  22313. request.headersList.delete('authorization')
  22314. // https://fetch.spec.whatwg.org/#authentication-entries
  22315. request.headersList.delete('proxy-authorization', true)
  22316. // "Cookie" and "Host" are forbidden request-headers, which undici doesn't implement.
  22317. request.headersList.delete('cookie')
  22318. request.headersList.delete('host')
  22319. }
  22320. // 14. If request’s body is non-null, then set request’s body to the first return
  22321. // value of safely extracting request’s body’s source.
  22322. if (request.body != null) {
  22323. assert(request.body.source != null)
  22324. request.body = safelyExtractBody(request.body.source)[0]
  22325. }
  22326. // 15. Let timingInfo be fetchParams’s timing info.
  22327. const timingInfo = fetchParams.timingInfo
  22328. // 16. Set timingInfo’s redirect end time and post-redirect start time to the
  22329. // coarsened shared current time given fetchParams’s cross-origin isolated
  22330. // capability.
  22331. timingInfo.redirectEndTime = timingInfo.postRedirectStartTime =
  22332. coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability)
  22333. // 17. If timingInfo’s redirect start time is 0, then set timingInfo’s
  22334. // redirect start time to timingInfo’s start time.
  22335. if (timingInfo.redirectStartTime === 0) {
  22336. timingInfo.redirectStartTime = timingInfo.startTime
  22337. }
  22338. // 18. Append locationURL to request’s URL list.
  22339. request.urlList.push(locationURL)
  22340. // 19. Invoke set request’s referrer policy on redirect on request and
  22341. // actualResponse.
  22342. setRequestReferrerPolicyOnRedirect(request, actualResponse)
  22343. // 20. Return the result of running main fetch given fetchParams and true.
  22344. return mainFetch(fetchParams, true)
  22345. }
  22346. // https://fetch.spec.whatwg.org/#http-network-or-cache-fetch
  22347. async function httpNetworkOrCacheFetch (
  22348. fetchParams,
  22349. isAuthenticationFetch = false,
  22350. isNewConnectionFetch = false
  22351. ) {
  22352. // 1. Let request be fetchParams’s request.
  22353. const request = fetchParams.request
  22354. // 2. Let httpFetchParams be null.
  22355. let httpFetchParams = null
  22356. // 3. Let httpRequest be null.
  22357. let httpRequest = null
  22358. // 4. Let response be null.
  22359. let response = null
  22360. // 5. Let storedResponse be null.
  22361. // TODO: cache
  22362. // 6. Let httpCache be null.
  22363. const httpCache = null
  22364. // 7. Let the revalidatingFlag be unset.
  22365. const revalidatingFlag = false
  22366. // 8. Run these steps, but abort when the ongoing fetch is terminated:
  22367. // 1. If request’s window is "no-window" and request’s redirect mode is
  22368. // "error", then set httpFetchParams to fetchParams and httpRequest to
  22369. // request.
  22370. if (request.window === 'no-window' && request.redirect === 'error') {
  22371. httpFetchParams = fetchParams
  22372. httpRequest = request
  22373. } else {
  22374. // Otherwise:
  22375. // 1. Set httpRequest to a clone of request.
  22376. httpRequest = makeRequest(request)
  22377. // 2. Set httpFetchParams to a copy of fetchParams.
  22378. httpFetchParams = { ...fetchParams }
  22379. // 3. Set httpFetchParams’s request to httpRequest.
  22380. httpFetchParams.request = httpRequest
  22381. }
  22382. // 3. Let includeCredentials be true if one of
  22383. const includeCredentials =
  22384. request.credentials === 'include' ||
  22385. (request.credentials === 'same-origin' &&
  22386. request.responseTainting === 'basic')
  22387. // 4. Let contentLength be httpRequest’s body’s length, if httpRequest’s
  22388. // body is non-null; otherwise null.
  22389. const contentLength = httpRequest.body ? httpRequest.body.length : null
  22390. // 5. Let contentLengthHeaderValue be null.
  22391. let contentLengthHeaderValue = null
  22392. // 6. If httpRequest’s body is null and httpRequest’s method is `POST` or
  22393. // `PUT`, then set contentLengthHeaderValue to `0`.
  22394. if (
  22395. httpRequest.body == null &&
  22396. ['POST', 'PUT'].includes(httpRequest.method)
  22397. ) {
  22398. contentLengthHeaderValue = '0'
  22399. }
  22400. // 7. If contentLength is non-null, then set contentLengthHeaderValue to
  22401. // contentLength, serialized and isomorphic encoded.
  22402. if (contentLength != null) {
  22403. contentLengthHeaderValue = isomorphicEncode(`${contentLength}`)
  22404. }
  22405. // 8. If contentLengthHeaderValue is non-null, then append
  22406. // `Content-Length`/contentLengthHeaderValue to httpRequest’s header
  22407. // list.
  22408. if (contentLengthHeaderValue != null) {
  22409. httpRequest.headersList.append('content-length', contentLengthHeaderValue)
  22410. }
  22411. // 9. If contentLengthHeaderValue is non-null, then append (`Content-Length`,
  22412. // contentLengthHeaderValue) to httpRequest’s header list.
  22413. // 10. If contentLength is non-null and httpRequest’s keepalive is true,
  22414. // then:
  22415. if (contentLength != null && httpRequest.keepalive) {
  22416. // NOTE: keepalive is a noop outside of browser context.
  22417. }
  22418. // 11. If httpRequest’s referrer is a URL, then append
  22419. // `Referer`/httpRequest’s referrer, serialized and isomorphic encoded,
  22420. // to httpRequest’s header list.
  22421. if (httpRequest.referrer instanceof URL) {
  22422. httpRequest.headersList.append('referer', isomorphicEncode(httpRequest.referrer.href))
  22423. }
  22424. // 12. Append a request `Origin` header for httpRequest.
  22425. appendRequestOriginHeader(httpRequest)
  22426. // 13. Append the Fetch metadata headers for httpRequest. [FETCH-METADATA]
  22427. appendFetchMetadata(httpRequest)
  22428. // 14. If httpRequest’s header list does not contain `User-Agent`, then
  22429. // user agents should append `User-Agent`/default `User-Agent` value to
  22430. // httpRequest’s header list.
  22431. if (!httpRequest.headersList.contains('user-agent')) {
  22432. httpRequest.headersList.append('user-agent', typeof esbuildDetection === 'undefined' ? 'undici' : 'node')
  22433. }
  22434. // 15. If httpRequest’s cache mode is "default" and httpRequest’s header
  22435. // list contains `If-Modified-Since`, `If-None-Match`,
  22436. // `If-Unmodified-Since`, `If-Match`, or `If-Range`, then set
  22437. // httpRequest’s cache mode to "no-store".
  22438. if (
  22439. httpRequest.cache === 'default' &&
  22440. (httpRequest.headersList.contains('if-modified-since') ||
  22441. httpRequest.headersList.contains('if-none-match') ||
  22442. httpRequest.headersList.contains('if-unmodified-since') ||
  22443. httpRequest.headersList.contains('if-match') ||
  22444. httpRequest.headersList.contains('if-range'))
  22445. ) {
  22446. httpRequest.cache = 'no-store'
  22447. }
  22448. // 16. If httpRequest’s cache mode is "no-cache", httpRequest’s prevent
  22449. // no-cache cache-control header modification flag is unset, and
  22450. // httpRequest’s header list does not contain `Cache-Control`, then append
  22451. // `Cache-Control`/`max-age=0` to httpRequest’s header list.
  22452. if (
  22453. httpRequest.cache === 'no-cache' &&
  22454. !httpRequest.preventNoCacheCacheControlHeaderModification &&
  22455. !httpRequest.headersList.contains('cache-control')
  22456. ) {
  22457. httpRequest.headersList.append('cache-control', 'max-age=0')
  22458. }
  22459. // 17. If httpRequest’s cache mode is "no-store" or "reload", then:
  22460. if (httpRequest.cache === 'no-store' || httpRequest.cache === 'reload') {
  22461. // 1. If httpRequest’s header list does not contain `Pragma`, then append
  22462. // `Pragma`/`no-cache` to httpRequest’s header list.
  22463. if (!httpRequest.headersList.contains('pragma')) {
  22464. httpRequest.headersList.append('pragma', 'no-cache')
  22465. }
  22466. // 2. If httpRequest’s header list does not contain `Cache-Control`,
  22467. // then append `Cache-Control`/`no-cache` to httpRequest’s header list.
  22468. if (!httpRequest.headersList.contains('cache-control')) {
  22469. httpRequest.headersList.append('cache-control', 'no-cache')
  22470. }
  22471. }
  22472. // 18. If httpRequest’s header list contains `Range`, then append
  22473. // `Accept-Encoding`/`identity` to httpRequest’s header list.
  22474. if (httpRequest.headersList.contains('range')) {
  22475. httpRequest.headersList.append('accept-encoding', 'identity')
  22476. }
  22477. // 19. Modify httpRequest’s header list per HTTP. Do not append a given
  22478. // header if httpRequest’s header list contains that header’s name.
  22479. // TODO: https://github.com/whatwg/fetch/issues/1285#issuecomment-896560129
  22480. if (!httpRequest.headersList.contains('accept-encoding')) {
  22481. if (urlHasHttpsScheme(requestCurrentURL(httpRequest))) {
  22482. httpRequest.headersList.append('accept-encoding', 'br, gzip, deflate')
  22483. } else {
  22484. httpRequest.headersList.append('accept-encoding', 'gzip, deflate')
  22485. }
  22486. }
  22487. httpRequest.headersList.delete('host')
  22488. // 20. If includeCredentials is true, then:
  22489. if (includeCredentials) {
  22490. // 1. If the user agent is not configured to block cookies for httpRequest
  22491. // (see section 7 of [COOKIES]), then:
  22492. // TODO: credentials
  22493. // 2. If httpRequest’s header list does not contain `Authorization`, then:
  22494. // TODO: credentials
  22495. }
  22496. // 21. If there’s a proxy-authentication entry, use it as appropriate.
  22497. // TODO: proxy-authentication
  22498. // 22. Set httpCache to the result of determining the HTTP cache
  22499. // partition, given httpRequest.
  22500. // TODO: cache
  22501. // 23. If httpCache is null, then set httpRequest’s cache mode to
  22502. // "no-store".
  22503. if (httpCache == null) {
  22504. httpRequest.cache = 'no-store'
  22505. }
  22506. // 24. If httpRequest’s cache mode is neither "no-store" nor "reload",
  22507. // then:
  22508. if (httpRequest.mode !== 'no-store' && httpRequest.mode !== 'reload') {
  22509. // TODO: cache
  22510. }
  22511. // 9. If aborted, then return the appropriate network error for fetchParams.
  22512. // TODO
  22513. // 10. If response is null, then:
  22514. if (response == null) {
  22515. // 1. If httpRequest’s cache mode is "only-if-cached", then return a
  22516. // network error.
  22517. if (httpRequest.mode === 'only-if-cached') {
  22518. return makeNetworkError('only if cached')
  22519. }
  22520. // 2. Let forwardResponse be the result of running HTTP-network fetch
  22521. // given httpFetchParams, includeCredentials, and isNewConnectionFetch.
  22522. const forwardResponse = await httpNetworkFetch(
  22523. httpFetchParams,
  22524. includeCredentials,
  22525. isNewConnectionFetch
  22526. )
  22527. // 3. If httpRequest’s method is unsafe and forwardResponse’s status is
  22528. // in the range 200 to 399, inclusive, invalidate appropriate stored
  22529. // responses in httpCache, as per the "Invalidation" chapter of HTTP
  22530. // Caching, and set storedResponse to null. [HTTP-CACHING]
  22531. if (
  22532. !safeMethodsSet.has(httpRequest.method) &&
  22533. forwardResponse.status >= 200 &&
  22534. forwardResponse.status <= 399
  22535. ) {
  22536. // TODO: cache
  22537. }
  22538. // 4. If the revalidatingFlag is set and forwardResponse’s status is 304,
  22539. // then:
  22540. if (revalidatingFlag && forwardResponse.status === 304) {
  22541. // TODO: cache
  22542. }
  22543. // 5. If response is null, then:
  22544. if (response == null) {
  22545. // 1. Set response to forwardResponse.
  22546. response = forwardResponse
  22547. // 2. Store httpRequest and forwardResponse in httpCache, as per the
  22548. // "Storing Responses in Caches" chapter of HTTP Caching. [HTTP-CACHING]
  22549. // TODO: cache
  22550. }
  22551. }
  22552. // 11. Set response’s URL list to a clone of httpRequest’s URL list.
  22553. response.urlList = [...httpRequest.urlList]
  22554. // 12. If httpRequest’s header list contains `Range`, then set response’s
  22555. // range-requested flag.
  22556. if (httpRequest.headersList.contains('range')) {
  22557. response.rangeRequested = true
  22558. }
  22559. // 13. Set response’s request-includes-credentials to includeCredentials.
  22560. response.requestIncludesCredentials = includeCredentials
  22561. // 14. If response’s status is 401, httpRequest’s response tainting is not
  22562. // "cors", includeCredentials is true, and request’s window is an environment
  22563. // settings object, then:
  22564. // TODO
  22565. // 15. If response’s status is 407, then:
  22566. if (response.status === 407) {
  22567. // 1. If request’s window is "no-window", then return a network error.
  22568. if (request.window === 'no-window') {
  22569. return makeNetworkError()
  22570. }
  22571. // 2. ???
  22572. // 3. If fetchParams is canceled, then return the appropriate network error for fetchParams.
  22573. if (isCancelled(fetchParams)) {
  22574. return makeAppropriateNetworkError(fetchParams)
  22575. }
  22576. // 4. Prompt the end user as appropriate in request’s window and store
  22577. // the result as a proxy-authentication entry. [HTTP-AUTH]
  22578. // TODO: Invoke some kind of callback?
  22579. // 5. Set response to the result of running HTTP-network-or-cache fetch given
  22580. // fetchParams.
  22581. // TODO
  22582. return makeNetworkError('proxy authentication required')
  22583. }
  22584. // 16. If all of the following are true
  22585. if (
  22586. // response’s status is 421
  22587. response.status === 421 &&
  22588. // isNewConnectionFetch is false
  22589. !isNewConnectionFetch &&
  22590. // request’s body is null, or request’s body is non-null and request’s body’s source is non-null
  22591. (request.body == null || request.body.source != null)
  22592. ) {
  22593. // then:
  22594. // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams.
  22595. if (isCancelled(fetchParams)) {
  22596. return makeAppropriateNetworkError(fetchParams)
  22597. }
  22598. // 2. Set response to the result of running HTTP-network-or-cache
  22599. // fetch given fetchParams, isAuthenticationFetch, and true.
  22600. // TODO (spec): The spec doesn't specify this but we need to cancel
  22601. // the active response before we can start a new one.
  22602. // https://github.com/whatwg/fetch/issues/1293
  22603. fetchParams.controller.connection.destroy()
  22604. response = await httpNetworkOrCacheFetch(
  22605. fetchParams,
  22606. isAuthenticationFetch,
  22607. true
  22608. )
  22609. }
  22610. // 17. If isAuthenticationFetch is true, then create an authentication entry
  22611. if (isAuthenticationFetch) {
  22612. // TODO
  22613. }
  22614. // 18. Return response.
  22615. return response
  22616. }
  22617. // https://fetch.spec.whatwg.org/#http-network-fetch
  22618. async function httpNetworkFetch (
  22619. fetchParams,
  22620. includeCredentials = false,
  22621. forceNewConnection = false
  22622. ) {
  22623. assert(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed)
  22624. fetchParams.controller.connection = {
  22625. abort: null,
  22626. destroyed: false,
  22627. destroy (err) {
  22628. if (!this.destroyed) {
  22629. this.destroyed = true
  22630. this.abort?.(err ?? new DOMException('The operation was aborted.', 'AbortError'))
  22631. }
  22632. }
  22633. }
  22634. // 1. Let request be fetchParams’s request.
  22635. const request = fetchParams.request
  22636. // 2. Let response be null.
  22637. let response = null
  22638. // 3. Let timingInfo be fetchParams’s timing info.
  22639. const timingInfo = fetchParams.timingInfo
  22640. // 4. Let httpCache be the result of determining the HTTP cache partition,
  22641. // given request.
  22642. // TODO: cache
  22643. const httpCache = null
  22644. // 5. If httpCache is null, then set request’s cache mode to "no-store".
  22645. if (httpCache == null) {
  22646. request.cache = 'no-store'
  22647. }
  22648. // 6. Let networkPartitionKey be the result of determining the network
  22649. // partition key given request.
  22650. // TODO
  22651. // 7. Let newConnection be "yes" if forceNewConnection is true; otherwise
  22652. // "no".
  22653. const newConnection = forceNewConnection ? 'yes' : 'no' // eslint-disable-line no-unused-vars
  22654. // 8. Switch on request’s mode:
  22655. if (request.mode === 'websocket') {
  22656. // Let connection be the result of obtaining a WebSocket connection,
  22657. // given request’s current URL.
  22658. // TODO
  22659. } else {
  22660. // Let connection be the result of obtaining a connection, given
  22661. // networkPartitionKey, request’s current URL’s origin,
  22662. // includeCredentials, and forceNewConnection.
  22663. // TODO
  22664. }
  22665. // 9. Run these steps, but abort when the ongoing fetch is terminated:
  22666. // 1. If connection is failure, then return a network error.
  22667. // 2. Set timingInfo’s final connection timing info to the result of
  22668. // calling clamp and coarsen connection timing info with connection’s
  22669. // timing info, timingInfo’s post-redirect start time, and fetchParams’s
  22670. // cross-origin isolated capability.
  22671. // 3. If connection is not an HTTP/2 connection, request’s body is non-null,
  22672. // and request’s body’s source is null, then append (`Transfer-Encoding`,
  22673. // `chunked`) to request’s header list.
  22674. // 4. Set timingInfo’s final network-request start time to the coarsened
  22675. // shared current time given fetchParams’s cross-origin isolated
  22676. // capability.
  22677. // 5. Set response to the result of making an HTTP request over connection
  22678. // using request with the following caveats:
  22679. // - Follow the relevant requirements from HTTP. [HTTP] [HTTP-SEMANTICS]
  22680. // [HTTP-COND] [HTTP-CACHING] [HTTP-AUTH]
  22681. // - If request’s body is non-null, and request’s body’s source is null,
  22682. // then the user agent may have a buffer of up to 64 kibibytes and store
  22683. // a part of request’s body in that buffer. If the user agent reads from
  22684. // request’s body beyond that buffer’s size and the user agent needs to
  22685. // resend request, then instead return a network error.
  22686. // - Set timingInfo’s final network-response start time to the coarsened
  22687. // shared current time given fetchParams’s cross-origin isolated capability,
  22688. // immediately after the user agent’s HTTP parser receives the first byte
  22689. // of the response (e.g., frame header bytes for HTTP/2 or response status
  22690. // line for HTTP/1.x).
  22691. // - Wait until all the headers are transmitted.
  22692. // - Any responses whose status is in the range 100 to 199, inclusive,
  22693. // and is not 101, are to be ignored, except for the purposes of setting
  22694. // timingInfo’s final network-response start time above.
  22695. // - If request’s header list contains `Transfer-Encoding`/`chunked` and
  22696. // response is transferred via HTTP/1.0 or older, then return a network
  22697. // error.
  22698. // - If the HTTP request results in a TLS client certificate dialog, then:
  22699. // 1. If request’s window is an environment settings object, make the
  22700. // dialog available in request’s window.
  22701. // 2. Otherwise, return a network error.
  22702. // To transmit request’s body body, run these steps:
  22703. let requestBody = null
  22704. // 1. If body is null and fetchParams’s process request end-of-body is
  22705. // non-null, then queue a fetch task given fetchParams’s process request
  22706. // end-of-body and fetchParams’s task destination.
  22707. if (request.body == null && fetchParams.processRequestEndOfBody) {
  22708. queueMicrotask(() => fetchParams.processRequestEndOfBody())
  22709. } else if (request.body != null) {
  22710. // 2. Otherwise, if body is non-null:
  22711. // 1. Let processBodyChunk given bytes be these steps:
  22712. const processBodyChunk = async function * (bytes) {
  22713. // 1. If the ongoing fetch is terminated, then abort these steps.
  22714. if (isCancelled(fetchParams)) {
  22715. return
  22716. }
  22717. // 2. Run this step in parallel: transmit bytes.
  22718. yield bytes
  22719. // 3. If fetchParams’s process request body is non-null, then run
  22720. // fetchParams’s process request body given bytes’s length.
  22721. fetchParams.processRequestBodyChunkLength?.(bytes.byteLength)
  22722. }
  22723. // 2. Let processEndOfBody be these steps:
  22724. const processEndOfBody = () => {
  22725. // 1. If fetchParams is canceled, then abort these steps.
  22726. if (isCancelled(fetchParams)) {
  22727. return
  22728. }
  22729. // 2. If fetchParams’s process request end-of-body is non-null,
  22730. // then run fetchParams’s process request end-of-body.
  22731. if (fetchParams.processRequestEndOfBody) {
  22732. fetchParams.processRequestEndOfBody()
  22733. }
  22734. }
  22735. // 3. Let processBodyError given e be these steps:
  22736. const processBodyError = (e) => {
  22737. // 1. If fetchParams is canceled, then abort these steps.
  22738. if (isCancelled(fetchParams)) {
  22739. return
  22740. }
  22741. // 2. If e is an "AbortError" DOMException, then abort fetchParams’s controller.
  22742. if (e.name === 'AbortError') {
  22743. fetchParams.controller.abort()
  22744. } else {
  22745. fetchParams.controller.terminate(e)
  22746. }
  22747. }
  22748. // 4. Incrementally read request’s body given processBodyChunk, processEndOfBody,
  22749. // processBodyError, and fetchParams’s task destination.
  22750. requestBody = (async function * () {
  22751. try {
  22752. for await (const bytes of request.body.stream) {
  22753. yield * processBodyChunk(bytes)
  22754. }
  22755. processEndOfBody()
  22756. } catch (err) {
  22757. processBodyError(err)
  22758. }
  22759. })()
  22760. }
  22761. try {
  22762. // socket is only provided for websockets
  22763. const { body, status, statusText, headersList, socket } = await dispatch({ body: requestBody })
  22764. if (socket) {
  22765. response = makeResponse({ status, statusText, headersList, socket })
  22766. } else {
  22767. const iterator = body[Symbol.asyncIterator]()
  22768. fetchParams.controller.next = () => iterator.next()
  22769. response = makeResponse({ status, statusText, headersList })
  22770. }
  22771. } catch (err) {
  22772. // 10. If aborted, then:
  22773. if (err.name === 'AbortError') {
  22774. // 1. If connection uses HTTP/2, then transmit an RST_STREAM frame.
  22775. fetchParams.controller.connection.destroy()
  22776. // 2. Return the appropriate network error for fetchParams.
  22777. return makeAppropriateNetworkError(fetchParams, err)
  22778. }
  22779. return makeNetworkError(err)
  22780. }
  22781. // 11. Let pullAlgorithm be an action that resumes the ongoing fetch
  22782. // if it is suspended.
  22783. const pullAlgorithm = () => {
  22784. fetchParams.controller.resume()
  22785. }
  22786. // 12. Let cancelAlgorithm be an algorithm that aborts fetchParams’s
  22787. // controller with reason, given reason.
  22788. const cancelAlgorithm = (reason) => {
  22789. fetchParams.controller.abort(reason)
  22790. }
  22791. // 13. Let highWaterMark be a non-negative, non-NaN number, chosen by
  22792. // the user agent.
  22793. // TODO
  22794. // 14. Let sizeAlgorithm be an algorithm that accepts a chunk object
  22795. // and returns a non-negative, non-NaN, non-infinite number, chosen by the user agent.
  22796. // TODO
  22797. // 15. Let stream be a new ReadableStream.
  22798. // 16. Set up stream with pullAlgorithm set to pullAlgorithm,
  22799. // cancelAlgorithm set to cancelAlgorithm, highWaterMark set to
  22800. // highWaterMark, and sizeAlgorithm set to sizeAlgorithm.
  22801. if (!ReadableStream) {
  22802. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  22803. }
  22804. const stream = new ReadableStream(
  22805. {
  22806. async start (controller) {
  22807. fetchParams.controller.controller = controller
  22808. },
  22809. async pull (controller) {
  22810. await pullAlgorithm(controller)
  22811. },
  22812. async cancel (reason) {
  22813. await cancelAlgorithm(reason)
  22814. }
  22815. },
  22816. {
  22817. highWaterMark: 0,
  22818. size () {
  22819. return 1
  22820. }
  22821. }
  22822. )
  22823. // 17. Run these steps, but abort when the ongoing fetch is terminated:
  22824. // 1. Set response’s body to a new body whose stream is stream.
  22825. response.body = { stream }
  22826. // 2. If response is not a network error and request’s cache mode is
  22827. // not "no-store", then update response in httpCache for request.
  22828. // TODO
  22829. // 3. If includeCredentials is true and the user agent is not configured
  22830. // to block cookies for request (see section 7 of [COOKIES]), then run the
  22831. // "set-cookie-string" parsing algorithm (see section 5.2 of [COOKIES]) on
  22832. // the value of each header whose name is a byte-case-insensitive match for
  22833. // `Set-Cookie` in response’s header list, if any, and request’s current URL.
  22834. // TODO
  22835. // 18. If aborted, then:
  22836. // TODO
  22837. // 19. Run these steps in parallel:
  22838. // 1. Run these steps, but abort when fetchParams is canceled:
  22839. fetchParams.controller.on('terminated', onAborted)
  22840. fetchParams.controller.resume = async () => {
  22841. // 1. While true
  22842. while (true) {
  22843. // 1-3. See onData...
  22844. // 4. Set bytes to the result of handling content codings given
  22845. // codings and bytes.
  22846. let bytes
  22847. let isFailure
  22848. try {
  22849. const { done, value } = await fetchParams.controller.next()
  22850. if (isAborted(fetchParams)) {
  22851. break
  22852. }
  22853. bytes = done ? undefined : value
  22854. } catch (err) {
  22855. if (fetchParams.controller.ended && !timingInfo.encodedBodySize) {
  22856. // zlib doesn't like empty streams.
  22857. bytes = undefined
  22858. } else {
  22859. bytes = err
  22860. // err may be propagated from the result of calling readablestream.cancel,
  22861. // which might not be an error. https://github.com/nodejs/undici/issues/2009
  22862. isFailure = true
  22863. }
  22864. }
  22865. if (bytes === undefined) {
  22866. // 2. Otherwise, if the bytes transmission for response’s message
  22867. // body is done normally and stream is readable, then close
  22868. // stream, finalize response for fetchParams and response, and
  22869. // abort these in-parallel steps.
  22870. readableStreamClose(fetchParams.controller.controller)
  22871. finalizeResponse(fetchParams, response)
  22872. return
  22873. }
  22874. // 5. Increase timingInfo’s decoded body size by bytes’s length.
  22875. timingInfo.decodedBodySize += bytes?.byteLength ?? 0
  22876. // 6. If bytes is failure, then terminate fetchParams’s controller.
  22877. if (isFailure) {
  22878. fetchParams.controller.terminate(bytes)
  22879. return
  22880. }
  22881. // 7. Enqueue a Uint8Array wrapping an ArrayBuffer containing bytes
  22882. // into stream.
  22883. fetchParams.controller.controller.enqueue(new Uint8Array(bytes))
  22884. // 8. If stream is errored, then terminate the ongoing fetch.
  22885. if (isErrored(stream)) {
  22886. fetchParams.controller.terminate()
  22887. return
  22888. }
  22889. // 9. If stream doesn’t need more data ask the user agent to suspend
  22890. // the ongoing fetch.
  22891. if (!fetchParams.controller.controller.desiredSize) {
  22892. return
  22893. }
  22894. }
  22895. }
  22896. // 2. If aborted, then:
  22897. function onAborted (reason) {
  22898. // 2. If fetchParams is aborted, then:
  22899. if (isAborted(fetchParams)) {
  22900. // 1. Set response’s aborted flag.
  22901. response.aborted = true
  22902. // 2. If stream is readable, then error stream with the result of
  22903. // deserialize a serialized abort reason given fetchParams’s
  22904. // controller’s serialized abort reason and an
  22905. // implementation-defined realm.
  22906. if (isReadable(stream)) {
  22907. fetchParams.controller.controller.error(
  22908. fetchParams.controller.serializedAbortReason
  22909. )
  22910. }
  22911. } else {
  22912. // 3. Otherwise, if stream is readable, error stream with a TypeError.
  22913. if (isReadable(stream)) {
  22914. fetchParams.controller.controller.error(new TypeError('terminated', {
  22915. cause: isErrorLike(reason) ? reason : undefined
  22916. }))
  22917. }
  22918. }
  22919. // 4. If connection uses HTTP/2, then transmit an RST_STREAM frame.
  22920. // 5. Otherwise, the user agent should close connection unless it would be bad for performance to do so.
  22921. fetchParams.controller.connection.destroy()
  22922. }
  22923. // 20. Return response.
  22924. return response
  22925. async function dispatch ({ body }) {
  22926. const url = requestCurrentURL(request)
  22927. /** @type {import('../..').Agent} */
  22928. const agent = fetchParams.controller.dispatcher
  22929. return new Promise((resolve, reject) => agent.dispatch(
  22930. {
  22931. path: url.pathname + url.search,
  22932. origin: url.origin,
  22933. method: request.method,
  22934. body: fetchParams.controller.dispatcher.isMockActive ? request.body && (request.body.source || request.body.stream) : body,
  22935. headers: request.headersList.entries,
  22936. maxRedirections: 0,
  22937. upgrade: request.mode === 'websocket' ? 'websocket' : undefined
  22938. },
  22939. {
  22940. body: null,
  22941. abort: null,
  22942. onConnect (abort) {
  22943. // TODO (fix): Do we need connection here?
  22944. const { connection } = fetchParams.controller
  22945. if (connection.destroyed) {
  22946. abort(new DOMException('The operation was aborted.', 'AbortError'))
  22947. } else {
  22948. fetchParams.controller.on('terminated', abort)
  22949. this.abort = connection.abort = abort
  22950. }
  22951. },
  22952. onHeaders (status, headersList, resume, statusText) {
  22953. if (status < 200) {
  22954. return
  22955. }
  22956. let codings = []
  22957. let location = ''
  22958. const headers = new Headers()
  22959. // For H2, the headers are a plain JS object
  22960. // We distinguish between them and iterate accordingly
  22961. if (Array.isArray(headersList)) {
  22962. for (let n = 0; n < headersList.length; n += 2) {
  22963. const key = headersList[n + 0].toString('latin1')
  22964. const val = headersList[n + 1].toString('latin1')
  22965. if (key.toLowerCase() === 'content-encoding') {
  22966. // https://www.rfc-editor.org/rfc/rfc7231#section-3.1.2.1
  22967. // "All content-coding values are case-insensitive..."
  22968. codings = val.toLowerCase().split(',').map((x) => x.trim())
  22969. } else if (key.toLowerCase() === 'location') {
  22970. location = val
  22971. }
  22972. headers[kHeadersList].append(key, val)
  22973. }
  22974. } else {
  22975. const keys = Object.keys(headersList)
  22976. for (const key of keys) {
  22977. const val = headersList[key]
  22978. if (key.toLowerCase() === 'content-encoding') {
  22979. // https://www.rfc-editor.org/rfc/rfc7231#section-3.1.2.1
  22980. // "All content-coding values are case-insensitive..."
  22981. codings = val.toLowerCase().split(',').map((x) => x.trim()).reverse()
  22982. } else if (key.toLowerCase() === 'location') {
  22983. location = val
  22984. }
  22985. headers[kHeadersList].append(key, val)
  22986. }
  22987. }
  22988. this.body = new Readable({ read: resume })
  22989. const decoders = []
  22990. const willFollow = request.redirect === 'follow' &&
  22991. location &&
  22992. redirectStatusSet.has(status)
  22993. // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding
  22994. if (request.method !== 'HEAD' && request.method !== 'CONNECT' && !nullBodyStatus.includes(status) && !willFollow) {
  22995. for (const coding of codings) {
  22996. // https://www.rfc-editor.org/rfc/rfc9112.html#section-7.2
  22997. if (coding === 'x-gzip' || coding === 'gzip') {
  22998. decoders.push(zlib.createGunzip({
  22999. // Be less strict when decoding compressed responses, since sometimes
  23000. // servers send slightly invalid responses that are still accepted
  23001. // by common browsers.
  23002. // Always using Z_SYNC_FLUSH is what cURL does.
  23003. flush: zlib.constants.Z_SYNC_FLUSH,
  23004. finishFlush: zlib.constants.Z_SYNC_FLUSH
  23005. }))
  23006. } else if (coding === 'deflate') {
  23007. decoders.push(zlib.createInflate())
  23008. } else if (coding === 'br') {
  23009. decoders.push(zlib.createBrotliDecompress())
  23010. } else {
  23011. decoders.length = 0
  23012. break
  23013. }
  23014. }
  23015. }
  23016. resolve({
  23017. status,
  23018. statusText,
  23019. headersList: headers[kHeadersList],
  23020. body: decoders.length
  23021. ? pipeline(this.body, ...decoders, () => { })
  23022. : this.body.on('error', () => {})
  23023. })
  23024. return true
  23025. },
  23026. onData (chunk) {
  23027. if (fetchParams.controller.dump) {
  23028. return
  23029. }
  23030. // 1. If one or more bytes have been transmitted from response’s
  23031. // message body, then:
  23032. // 1. Let bytes be the transmitted bytes.
  23033. const bytes = chunk
  23034. // 2. Let codings be the result of extracting header list values
  23035. // given `Content-Encoding` and response’s header list.
  23036. // See pullAlgorithm.
  23037. // 3. Increase timingInfo’s encoded body size by bytes’s length.
  23038. timingInfo.encodedBodySize += bytes.byteLength
  23039. // 4. See pullAlgorithm...
  23040. return this.body.push(bytes)
  23041. },
  23042. onComplete () {
  23043. if (this.abort) {
  23044. fetchParams.controller.off('terminated', this.abort)
  23045. }
  23046. fetchParams.controller.ended = true
  23047. this.body.push(null)
  23048. },
  23049. onError (error) {
  23050. if (this.abort) {
  23051. fetchParams.controller.off('terminated', this.abort)
  23052. }
  23053. this.body?.destroy(error)
  23054. fetchParams.controller.terminate(error)
  23055. reject(error)
  23056. },
  23057. onUpgrade (status, headersList, socket) {
  23058. if (status !== 101) {
  23059. return
  23060. }
  23061. const headers = new Headers()
  23062. for (let n = 0; n < headersList.length; n += 2) {
  23063. const key = headersList[n + 0].toString('latin1')
  23064. const val = headersList[n + 1].toString('latin1')
  23065. headers[kHeadersList].append(key, val)
  23066. }
  23067. resolve({
  23068. status,
  23069. statusText: STATUS_CODES[status],
  23070. headersList: headers[kHeadersList],
  23071. socket
  23072. })
  23073. return true
  23074. }
  23075. }
  23076. ))
  23077. }
  23078. }
  23079. module.exports = {
  23080. fetch,
  23081. Fetch,
  23082. fetching,
  23083. finalizeAndReportTiming
  23084. }
  23085. /***/ }),
  23086. /***/ 8359:
  23087. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  23088. "use strict";
  23089. /* globals AbortController */
  23090. const { extractBody, mixinBody, cloneBody } = __nccwpck_require__(9990)
  23091. const { Headers, fill: fillHeaders, HeadersList } = __nccwpck_require__(554)
  23092. const { FinalizationRegistry } = __nccwpck_require__(6436)()
  23093. const util = __nccwpck_require__(3983)
  23094. const {
  23095. isValidHTTPToken,
  23096. sameOrigin,
  23097. normalizeMethod,
  23098. makePolicyContainer,
  23099. normalizeMethodRecord
  23100. } = __nccwpck_require__(2538)
  23101. const {
  23102. forbiddenMethodsSet,
  23103. corsSafeListedMethodsSet,
  23104. referrerPolicy,
  23105. requestRedirect,
  23106. requestMode,
  23107. requestCredentials,
  23108. requestCache,
  23109. requestDuplex
  23110. } = __nccwpck_require__(1037)
  23111. const { kEnumerableProperty } = util
  23112. const { kHeaders, kSignal, kState, kGuard, kRealm } = __nccwpck_require__(5861)
  23113. const { webidl } = __nccwpck_require__(1744)
  23114. const { getGlobalOrigin } = __nccwpck_require__(1246)
  23115. const { URLSerializer } = __nccwpck_require__(685)
  23116. const { kHeadersList, kConstruct } = __nccwpck_require__(2785)
  23117. const assert = __nccwpck_require__(9491)
  23118. const { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = __nccwpck_require__(2361)
  23119. let TransformStream = globalThis.TransformStream
  23120. const kAbortController = Symbol('abortController')
  23121. const requestFinalizer = new FinalizationRegistry(({ signal, abort }) => {
  23122. signal.removeEventListener('abort', abort)
  23123. })
  23124. // https://fetch.spec.whatwg.org/#request-class
  23125. class Request {
  23126. // https://fetch.spec.whatwg.org/#dom-request
  23127. constructor (input, init = {}) {
  23128. if (input === kConstruct) {
  23129. return
  23130. }
  23131. webidl.argumentLengthCheck(arguments, 1, { header: 'Request constructor' })
  23132. input = webidl.converters.RequestInfo(input)
  23133. init = webidl.converters.RequestInit(init)
  23134. // https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object
  23135. this[kRealm] = {
  23136. settingsObject: {
  23137. baseUrl: getGlobalOrigin(),
  23138. get origin () {
  23139. return this.baseUrl?.origin
  23140. },
  23141. policyContainer: makePolicyContainer()
  23142. }
  23143. }
  23144. // 1. Let request be null.
  23145. let request = null
  23146. // 2. Let fallbackMode be null.
  23147. let fallbackMode = null
  23148. // 3. Let baseURL be this’s relevant settings object’s API base URL.
  23149. const baseUrl = this[kRealm].settingsObject.baseUrl
  23150. // 4. Let signal be null.
  23151. let signal = null
  23152. // 5. If input is a string, then:
  23153. if (typeof input === 'string') {
  23154. // 1. Let parsedURL be the result of parsing input with baseURL.
  23155. // 2. If parsedURL is failure, then throw a TypeError.
  23156. let parsedURL
  23157. try {
  23158. parsedURL = new URL(input, baseUrl)
  23159. } catch (err) {
  23160. throw new TypeError('Failed to parse URL from ' + input, { cause: err })
  23161. }
  23162. // 3. If parsedURL includes credentials, then throw a TypeError.
  23163. if (parsedURL.username || parsedURL.password) {
  23164. throw new TypeError(
  23165. 'Request cannot be constructed from a URL that includes credentials: ' +
  23166. input
  23167. )
  23168. }
  23169. // 4. Set request to a new request whose URL is parsedURL.
  23170. request = makeRequest({ urlList: [parsedURL] })
  23171. // 5. Set fallbackMode to "cors".
  23172. fallbackMode = 'cors'
  23173. } else {
  23174. // 6. Otherwise:
  23175. // 7. Assert: input is a Request object.
  23176. assert(input instanceof Request)
  23177. // 8. Set request to input’s request.
  23178. request = input[kState]
  23179. // 9. Set signal to input’s signal.
  23180. signal = input[kSignal]
  23181. }
  23182. // 7. Let origin be this’s relevant settings object’s origin.
  23183. const origin = this[kRealm].settingsObject.origin
  23184. // 8. Let window be "client".
  23185. let window = 'client'
  23186. // 9. If request’s window is an environment settings object and its origin
  23187. // is same origin with origin, then set window to request’s window.
  23188. if (
  23189. request.window?.constructor?.name === 'EnvironmentSettingsObject' &&
  23190. sameOrigin(request.window, origin)
  23191. ) {
  23192. window = request.window
  23193. }
  23194. // 10. If init["window"] exists and is non-null, then throw a TypeError.
  23195. if (init.window != null) {
  23196. throw new TypeError(`'window' option '${window}' must be null`)
  23197. }
  23198. // 11. If init["window"] exists, then set window to "no-window".
  23199. if ('window' in init) {
  23200. window = 'no-window'
  23201. }
  23202. // 12. Set request to a new request with the following properties:
  23203. request = makeRequest({
  23204. // URL request’s URL.
  23205. // undici implementation note: this is set as the first item in request's urlList in makeRequest
  23206. // method request’s method.
  23207. method: request.method,
  23208. // header list A copy of request’s header list.
  23209. // undici implementation note: headersList is cloned in makeRequest
  23210. headersList: request.headersList,
  23211. // unsafe-request flag Set.
  23212. unsafeRequest: request.unsafeRequest,
  23213. // client This’s relevant settings object.
  23214. client: this[kRealm].settingsObject,
  23215. // window window.
  23216. window,
  23217. // priority request’s priority.
  23218. priority: request.priority,
  23219. // origin request’s origin. The propagation of the origin is only significant for navigation requests
  23220. // being handled by a service worker. In this scenario a request can have an origin that is different
  23221. // from the current client.
  23222. origin: request.origin,
  23223. // referrer request’s referrer.
  23224. referrer: request.referrer,
  23225. // referrer policy request’s referrer policy.
  23226. referrerPolicy: request.referrerPolicy,
  23227. // mode request’s mode.
  23228. mode: request.mode,
  23229. // credentials mode request’s credentials mode.
  23230. credentials: request.credentials,
  23231. // cache mode request’s cache mode.
  23232. cache: request.cache,
  23233. // redirect mode request’s redirect mode.
  23234. redirect: request.redirect,
  23235. // integrity metadata request’s integrity metadata.
  23236. integrity: request.integrity,
  23237. // keepalive request’s keepalive.
  23238. keepalive: request.keepalive,
  23239. // reload-navigation flag request’s reload-navigation flag.
  23240. reloadNavigation: request.reloadNavigation,
  23241. // history-navigation flag request’s history-navigation flag.
  23242. historyNavigation: request.historyNavigation,
  23243. // URL list A clone of request’s URL list.
  23244. urlList: [...request.urlList]
  23245. })
  23246. const initHasKey = Object.keys(init).length !== 0
  23247. // 13. If init is not empty, then:
  23248. if (initHasKey) {
  23249. // 1. If request’s mode is "navigate", then set it to "same-origin".
  23250. if (request.mode === 'navigate') {
  23251. request.mode = 'same-origin'
  23252. }
  23253. // 2. Unset request’s reload-navigation flag.
  23254. request.reloadNavigation = false
  23255. // 3. Unset request’s history-navigation flag.
  23256. request.historyNavigation = false
  23257. // 4. Set request’s origin to "client".
  23258. request.origin = 'client'
  23259. // 5. Set request’s referrer to "client"
  23260. request.referrer = 'client'
  23261. // 6. Set request’s referrer policy to the empty string.
  23262. request.referrerPolicy = ''
  23263. // 7. Set request’s URL to request’s current URL.
  23264. request.url = request.urlList[request.urlList.length - 1]
  23265. // 8. Set request’s URL list to « request’s URL ».
  23266. request.urlList = [request.url]
  23267. }
  23268. // 14. If init["referrer"] exists, then:
  23269. if (init.referrer !== undefined) {
  23270. // 1. Let referrer be init["referrer"].
  23271. const referrer = init.referrer
  23272. // 2. If referrer is the empty string, then set request’s referrer to "no-referrer".
  23273. if (referrer === '') {
  23274. request.referrer = 'no-referrer'
  23275. } else {
  23276. // 1. Let parsedReferrer be the result of parsing referrer with
  23277. // baseURL.
  23278. // 2. If parsedReferrer is failure, then throw a TypeError.
  23279. let parsedReferrer
  23280. try {
  23281. parsedReferrer = new URL(referrer, baseUrl)
  23282. } catch (err) {
  23283. throw new TypeError(`Referrer "${referrer}" is not a valid URL.`, { cause: err })
  23284. }
  23285. // 3. If one of the following is true
  23286. // - parsedReferrer’s scheme is "about" and path is the string "client"
  23287. // - parsedReferrer’s origin is not same origin with origin
  23288. // then set request’s referrer to "client".
  23289. if (
  23290. (parsedReferrer.protocol === 'about:' && parsedReferrer.hostname === 'client') ||
  23291. (origin && !sameOrigin(parsedReferrer, this[kRealm].settingsObject.baseUrl))
  23292. ) {
  23293. request.referrer = 'client'
  23294. } else {
  23295. // 4. Otherwise, set request’s referrer to parsedReferrer.
  23296. request.referrer = parsedReferrer
  23297. }
  23298. }
  23299. }
  23300. // 15. If init["referrerPolicy"] exists, then set request’s referrer policy
  23301. // to it.
  23302. if (init.referrerPolicy !== undefined) {
  23303. request.referrerPolicy = init.referrerPolicy
  23304. }
  23305. // 16. Let mode be init["mode"] if it exists, and fallbackMode otherwise.
  23306. let mode
  23307. if (init.mode !== undefined) {
  23308. mode = init.mode
  23309. } else {
  23310. mode = fallbackMode
  23311. }
  23312. // 17. If mode is "navigate", then throw a TypeError.
  23313. if (mode === 'navigate') {
  23314. throw webidl.errors.exception({
  23315. header: 'Request constructor',
  23316. message: 'invalid request mode navigate.'
  23317. })
  23318. }
  23319. // 18. If mode is non-null, set request’s mode to mode.
  23320. if (mode != null) {
  23321. request.mode = mode
  23322. }
  23323. // 19. If init["credentials"] exists, then set request’s credentials mode
  23324. // to it.
  23325. if (init.credentials !== undefined) {
  23326. request.credentials = init.credentials
  23327. }
  23328. // 18. If init["cache"] exists, then set request’s cache mode to it.
  23329. if (init.cache !== undefined) {
  23330. request.cache = init.cache
  23331. }
  23332. // 21. If request’s cache mode is "only-if-cached" and request’s mode is
  23333. // not "same-origin", then throw a TypeError.
  23334. if (request.cache === 'only-if-cached' && request.mode !== 'same-origin') {
  23335. throw new TypeError(
  23336. "'only-if-cached' can be set only with 'same-origin' mode"
  23337. )
  23338. }
  23339. // 22. If init["redirect"] exists, then set request’s redirect mode to it.
  23340. if (init.redirect !== undefined) {
  23341. request.redirect = init.redirect
  23342. }
  23343. // 23. If init["integrity"] exists, then set request’s integrity metadata to it.
  23344. if (init.integrity != null) {
  23345. request.integrity = String(init.integrity)
  23346. }
  23347. // 24. If init["keepalive"] exists, then set request’s keepalive to it.
  23348. if (init.keepalive !== undefined) {
  23349. request.keepalive = Boolean(init.keepalive)
  23350. }
  23351. // 25. If init["method"] exists, then:
  23352. if (init.method !== undefined) {
  23353. // 1. Let method be init["method"].
  23354. let method = init.method
  23355. // 2. If method is not a method or method is a forbidden method, then
  23356. // throw a TypeError.
  23357. if (!isValidHTTPToken(method)) {
  23358. throw new TypeError(`'${method}' is not a valid HTTP method.`)
  23359. }
  23360. if (forbiddenMethodsSet.has(method.toUpperCase())) {
  23361. throw new TypeError(`'${method}' HTTP method is unsupported.`)
  23362. }
  23363. // 3. Normalize method.
  23364. method = normalizeMethodRecord[method] ?? normalizeMethod(method)
  23365. // 4. Set request’s method to method.
  23366. request.method = method
  23367. }
  23368. // 26. If init["signal"] exists, then set signal to it.
  23369. if (init.signal !== undefined) {
  23370. signal = init.signal
  23371. }
  23372. // 27. Set this’s request to request.
  23373. this[kState] = request
  23374. // 28. Set this’s signal to a new AbortSignal object with this’s relevant
  23375. // Realm.
  23376. // TODO: could this be simplified with AbortSignal.any
  23377. // (https://dom.spec.whatwg.org/#dom-abortsignal-any)
  23378. const ac = new AbortController()
  23379. this[kSignal] = ac.signal
  23380. this[kSignal][kRealm] = this[kRealm]
  23381. // 29. If signal is not null, then make this’s signal follow signal.
  23382. if (signal != null) {
  23383. if (
  23384. !signal ||
  23385. typeof signal.aborted !== 'boolean' ||
  23386. typeof signal.addEventListener !== 'function'
  23387. ) {
  23388. throw new TypeError(
  23389. "Failed to construct 'Request': member signal is not of type AbortSignal."
  23390. )
  23391. }
  23392. if (signal.aborted) {
  23393. ac.abort(signal.reason)
  23394. } else {
  23395. // Keep a strong ref to ac while request object
  23396. // is alive. This is needed to prevent AbortController
  23397. // from being prematurely garbage collected.
  23398. // See, https://github.com/nodejs/undici/issues/1926.
  23399. this[kAbortController] = ac
  23400. const acRef = new WeakRef(ac)
  23401. const abort = function () {
  23402. const ac = acRef.deref()
  23403. if (ac !== undefined) {
  23404. ac.abort(this.reason)
  23405. }
  23406. }
  23407. // Third-party AbortControllers may not work with these.
  23408. // See, https://github.com/nodejs/undici/pull/1910#issuecomment-1464495619.
  23409. try {
  23410. // If the max amount of listeners is equal to the default, increase it
  23411. // This is only available in node >= v19.9.0
  23412. if (typeof getMaxListeners === 'function' && getMaxListeners(signal) === defaultMaxListeners) {
  23413. setMaxListeners(100, signal)
  23414. } else if (getEventListeners(signal, 'abort').length >= defaultMaxListeners) {
  23415. setMaxListeners(100, signal)
  23416. }
  23417. } catch {}
  23418. util.addAbortListener(signal, abort)
  23419. requestFinalizer.register(ac, { signal, abort })
  23420. }
  23421. }
  23422. // 30. Set this’s headers to a new Headers object with this’s relevant
  23423. // Realm, whose header list is request’s header list and guard is
  23424. // "request".
  23425. this[kHeaders] = new Headers(kConstruct)
  23426. this[kHeaders][kHeadersList] = request.headersList
  23427. this[kHeaders][kGuard] = 'request'
  23428. this[kHeaders][kRealm] = this[kRealm]
  23429. // 31. If this’s request’s mode is "no-cors", then:
  23430. if (mode === 'no-cors') {
  23431. // 1. If this’s request’s method is not a CORS-safelisted method,
  23432. // then throw a TypeError.
  23433. if (!corsSafeListedMethodsSet.has(request.method)) {
  23434. throw new TypeError(
  23435. `'${request.method} is unsupported in no-cors mode.`
  23436. )
  23437. }
  23438. // 2. Set this’s headers’s guard to "request-no-cors".
  23439. this[kHeaders][kGuard] = 'request-no-cors'
  23440. }
  23441. // 32. If init is not empty, then:
  23442. if (initHasKey) {
  23443. /** @type {HeadersList} */
  23444. const headersList = this[kHeaders][kHeadersList]
  23445. // 1. Let headers be a copy of this’s headers and its associated header
  23446. // list.
  23447. // 2. If init["headers"] exists, then set headers to init["headers"].
  23448. const headers = init.headers !== undefined ? init.headers : new HeadersList(headersList)
  23449. // 3. Empty this’s headers’s header list.
  23450. headersList.clear()
  23451. // 4. If headers is a Headers object, then for each header in its header
  23452. // list, append header’s name/header’s value to this’s headers.
  23453. if (headers instanceof HeadersList) {
  23454. for (const [key, val] of headers) {
  23455. headersList.append(key, val)
  23456. }
  23457. // Note: Copy the `set-cookie` meta-data.
  23458. headersList.cookies = headers.cookies
  23459. } else {
  23460. // 5. Otherwise, fill this’s headers with headers.
  23461. fillHeaders(this[kHeaders], headers)
  23462. }
  23463. }
  23464. // 33. Let inputBody be input’s request’s body if input is a Request
  23465. // object; otherwise null.
  23466. const inputBody = input instanceof Request ? input[kState].body : null
  23467. // 34. If either init["body"] exists and is non-null or inputBody is
  23468. // non-null, and request’s method is `GET` or `HEAD`, then throw a
  23469. // TypeError.
  23470. if (
  23471. (init.body != null || inputBody != null) &&
  23472. (request.method === 'GET' || request.method === 'HEAD')
  23473. ) {
  23474. throw new TypeError('Request with GET/HEAD method cannot have body.')
  23475. }
  23476. // 35. Let initBody be null.
  23477. let initBody = null
  23478. // 36. If init["body"] exists and is non-null, then:
  23479. if (init.body != null) {
  23480. // 1. Let Content-Type be null.
  23481. // 2. Set initBody and Content-Type to the result of extracting
  23482. // init["body"], with keepalive set to request’s keepalive.
  23483. const [extractedBody, contentType] = extractBody(
  23484. init.body,
  23485. request.keepalive
  23486. )
  23487. initBody = extractedBody
  23488. // 3, If Content-Type is non-null and this’s headers’s header list does
  23489. // not contain `Content-Type`, then append `Content-Type`/Content-Type to
  23490. // this’s headers.
  23491. if (contentType && !this[kHeaders][kHeadersList].contains('content-type')) {
  23492. this[kHeaders].append('content-type', contentType)
  23493. }
  23494. }
  23495. // 37. Let inputOrInitBody be initBody if it is non-null; otherwise
  23496. // inputBody.
  23497. const inputOrInitBody = initBody ?? inputBody
  23498. // 38. If inputOrInitBody is non-null and inputOrInitBody’s source is
  23499. // null, then:
  23500. if (inputOrInitBody != null && inputOrInitBody.source == null) {
  23501. // 1. If initBody is non-null and init["duplex"] does not exist,
  23502. // then throw a TypeError.
  23503. if (initBody != null && init.duplex == null) {
  23504. throw new TypeError('RequestInit: duplex option is required when sending a body.')
  23505. }
  23506. // 2. If this’s request’s mode is neither "same-origin" nor "cors",
  23507. // then throw a TypeError.
  23508. if (request.mode !== 'same-origin' && request.mode !== 'cors') {
  23509. throw new TypeError(
  23510. 'If request is made from ReadableStream, mode should be "same-origin" or "cors"'
  23511. )
  23512. }
  23513. // 3. Set this’s request’s use-CORS-preflight flag.
  23514. request.useCORSPreflightFlag = true
  23515. }
  23516. // 39. Let finalBody be inputOrInitBody.
  23517. let finalBody = inputOrInitBody
  23518. // 40. If initBody is null and inputBody is non-null, then:
  23519. if (initBody == null && inputBody != null) {
  23520. // 1. If input is unusable, then throw a TypeError.
  23521. if (util.isDisturbed(inputBody.stream) || inputBody.stream.locked) {
  23522. throw new TypeError(
  23523. 'Cannot construct a Request with a Request object that has already been used.'
  23524. )
  23525. }
  23526. // 2. Set finalBody to the result of creating a proxy for inputBody.
  23527. if (!TransformStream) {
  23528. TransformStream = (__nccwpck_require__(5356).TransformStream)
  23529. }
  23530. // https://streams.spec.whatwg.org/#readablestream-create-a-proxy
  23531. const identityTransform = new TransformStream()
  23532. inputBody.stream.pipeThrough(identityTransform)
  23533. finalBody = {
  23534. source: inputBody.source,
  23535. length: inputBody.length,
  23536. stream: identityTransform.readable
  23537. }
  23538. }
  23539. // 41. Set this’s request’s body to finalBody.
  23540. this[kState].body = finalBody
  23541. }
  23542. // Returns request’s HTTP method, which is "GET" by default.
  23543. get method () {
  23544. webidl.brandCheck(this, Request)
  23545. // The method getter steps are to return this’s request’s method.
  23546. return this[kState].method
  23547. }
  23548. // Returns the URL of request as a string.
  23549. get url () {
  23550. webidl.brandCheck(this, Request)
  23551. // The url getter steps are to return this’s request’s URL, serialized.
  23552. return URLSerializer(this[kState].url)
  23553. }
  23554. // Returns a Headers object consisting of the headers associated with request.
  23555. // Note that headers added in the network layer by the user agent will not
  23556. // be accounted for in this object, e.g., the "Host" header.
  23557. get headers () {
  23558. webidl.brandCheck(this, Request)
  23559. // The headers getter steps are to return this’s headers.
  23560. return this[kHeaders]
  23561. }
  23562. // Returns the kind of resource requested by request, e.g., "document"
  23563. // or "script".
  23564. get destination () {
  23565. webidl.brandCheck(this, Request)
  23566. // The destination getter are to return this’s request’s destination.
  23567. return this[kState].destination
  23568. }
  23569. // Returns the referrer of request. Its value can be a same-origin URL if
  23570. // explicitly set in init, the empty string to indicate no referrer, and
  23571. // "about:client" when defaulting to the global’s default. This is used
  23572. // during fetching to determine the value of the `Referer` header of the
  23573. // request being made.
  23574. get referrer () {
  23575. webidl.brandCheck(this, Request)
  23576. // 1. If this’s request’s referrer is "no-referrer", then return the
  23577. // empty string.
  23578. if (this[kState].referrer === 'no-referrer') {
  23579. return ''
  23580. }
  23581. // 2. If this’s request’s referrer is "client", then return
  23582. // "about:client".
  23583. if (this[kState].referrer === 'client') {
  23584. return 'about:client'
  23585. }
  23586. // Return this’s request’s referrer, serialized.
  23587. return this[kState].referrer.toString()
  23588. }
  23589. // Returns the referrer policy associated with request.
  23590. // This is used during fetching to compute the value of the request’s
  23591. // referrer.
  23592. get referrerPolicy () {
  23593. webidl.brandCheck(this, Request)
  23594. // The referrerPolicy getter steps are to return this’s request’s referrer policy.
  23595. return this[kState].referrerPolicy
  23596. }
  23597. // Returns the mode associated with request, which is a string indicating
  23598. // whether the request will use CORS, or will be restricted to same-origin
  23599. // URLs.
  23600. get mode () {
  23601. webidl.brandCheck(this, Request)
  23602. // The mode getter steps are to return this’s request’s mode.
  23603. return this[kState].mode
  23604. }
  23605. // Returns the credentials mode associated with request,
  23606. // which is a string indicating whether credentials will be sent with the
  23607. // request always, never, or only when sent to a same-origin URL.
  23608. get credentials () {
  23609. // The credentials getter steps are to return this’s request’s credentials mode.
  23610. return this[kState].credentials
  23611. }
  23612. // Returns the cache mode associated with request,
  23613. // which is a string indicating how the request will
  23614. // interact with the browser’s cache when fetching.
  23615. get cache () {
  23616. webidl.brandCheck(this, Request)
  23617. // The cache getter steps are to return this’s request’s cache mode.
  23618. return this[kState].cache
  23619. }
  23620. // Returns the redirect mode associated with request,
  23621. // which is a string indicating how redirects for the
  23622. // request will be handled during fetching. A request
  23623. // will follow redirects by default.
  23624. get redirect () {
  23625. webidl.brandCheck(this, Request)
  23626. // The redirect getter steps are to return this’s request’s redirect mode.
  23627. return this[kState].redirect
  23628. }
  23629. // Returns request’s subresource integrity metadata, which is a
  23630. // cryptographic hash of the resource being fetched. Its value
  23631. // consists of multiple hashes separated by whitespace. [SRI]
  23632. get integrity () {
  23633. webidl.brandCheck(this, Request)
  23634. // The integrity getter steps are to return this’s request’s integrity
  23635. // metadata.
  23636. return this[kState].integrity
  23637. }
  23638. // Returns a boolean indicating whether or not request can outlive the
  23639. // global in which it was created.
  23640. get keepalive () {
  23641. webidl.brandCheck(this, Request)
  23642. // The keepalive getter steps are to return this’s request’s keepalive.
  23643. return this[kState].keepalive
  23644. }
  23645. // Returns a boolean indicating whether or not request is for a reload
  23646. // navigation.
  23647. get isReloadNavigation () {
  23648. webidl.brandCheck(this, Request)
  23649. // The isReloadNavigation getter steps are to return true if this’s
  23650. // request’s reload-navigation flag is set; otherwise false.
  23651. return this[kState].reloadNavigation
  23652. }
  23653. // Returns a boolean indicating whether or not request is for a history
  23654. // navigation (a.k.a. back-foward navigation).
  23655. get isHistoryNavigation () {
  23656. webidl.brandCheck(this, Request)
  23657. // The isHistoryNavigation getter steps are to return true if this’s request’s
  23658. // history-navigation flag is set; otherwise false.
  23659. return this[kState].historyNavigation
  23660. }
  23661. // Returns the signal associated with request, which is an AbortSignal
  23662. // object indicating whether or not request has been aborted, and its
  23663. // abort event handler.
  23664. get signal () {
  23665. webidl.brandCheck(this, Request)
  23666. // The signal getter steps are to return this’s signal.
  23667. return this[kSignal]
  23668. }
  23669. get body () {
  23670. webidl.brandCheck(this, Request)
  23671. return this[kState].body ? this[kState].body.stream : null
  23672. }
  23673. get bodyUsed () {
  23674. webidl.brandCheck(this, Request)
  23675. return !!this[kState].body && util.isDisturbed(this[kState].body.stream)
  23676. }
  23677. get duplex () {
  23678. webidl.brandCheck(this, Request)
  23679. return 'half'
  23680. }
  23681. // Returns a clone of request.
  23682. clone () {
  23683. webidl.brandCheck(this, Request)
  23684. // 1. If this is unusable, then throw a TypeError.
  23685. if (this.bodyUsed || this.body?.locked) {
  23686. throw new TypeError('unusable')
  23687. }
  23688. // 2. Let clonedRequest be the result of cloning this’s request.
  23689. const clonedRequest = cloneRequest(this[kState])
  23690. // 3. Let clonedRequestObject be the result of creating a Request object,
  23691. // given clonedRequest, this’s headers’s guard, and this’s relevant Realm.
  23692. const clonedRequestObject = new Request(kConstruct)
  23693. clonedRequestObject[kState] = clonedRequest
  23694. clonedRequestObject[kRealm] = this[kRealm]
  23695. clonedRequestObject[kHeaders] = new Headers(kConstruct)
  23696. clonedRequestObject[kHeaders][kHeadersList] = clonedRequest.headersList
  23697. clonedRequestObject[kHeaders][kGuard] = this[kHeaders][kGuard]
  23698. clonedRequestObject[kHeaders][kRealm] = this[kHeaders][kRealm]
  23699. // 4. Make clonedRequestObject’s signal follow this’s signal.
  23700. const ac = new AbortController()
  23701. if (this.signal.aborted) {
  23702. ac.abort(this.signal.reason)
  23703. } else {
  23704. util.addAbortListener(
  23705. this.signal,
  23706. () => {
  23707. ac.abort(this.signal.reason)
  23708. }
  23709. )
  23710. }
  23711. clonedRequestObject[kSignal] = ac.signal
  23712. // 4. Return clonedRequestObject.
  23713. return clonedRequestObject
  23714. }
  23715. }
  23716. mixinBody(Request)
  23717. function makeRequest (init) {
  23718. // https://fetch.spec.whatwg.org/#requests
  23719. const request = {
  23720. method: 'GET',
  23721. localURLsOnly: false,
  23722. unsafeRequest: false,
  23723. body: null,
  23724. client: null,
  23725. reservedClient: null,
  23726. replacesClientId: '',
  23727. window: 'client',
  23728. keepalive: false,
  23729. serviceWorkers: 'all',
  23730. initiator: '',
  23731. destination: '',
  23732. priority: null,
  23733. origin: 'client',
  23734. policyContainer: 'client',
  23735. referrer: 'client',
  23736. referrerPolicy: '',
  23737. mode: 'no-cors',
  23738. useCORSPreflightFlag: false,
  23739. credentials: 'same-origin',
  23740. useCredentials: false,
  23741. cache: 'default',
  23742. redirect: 'follow',
  23743. integrity: '',
  23744. cryptoGraphicsNonceMetadata: '',
  23745. parserMetadata: '',
  23746. reloadNavigation: false,
  23747. historyNavigation: false,
  23748. userActivation: false,
  23749. taintedOrigin: false,
  23750. redirectCount: 0,
  23751. responseTainting: 'basic',
  23752. preventNoCacheCacheControlHeaderModification: false,
  23753. done: false,
  23754. timingAllowFailed: false,
  23755. ...init,
  23756. headersList: init.headersList
  23757. ? new HeadersList(init.headersList)
  23758. : new HeadersList()
  23759. }
  23760. request.url = request.urlList[0]
  23761. return request
  23762. }
  23763. // https://fetch.spec.whatwg.org/#concept-request-clone
  23764. function cloneRequest (request) {
  23765. // To clone a request request, run these steps:
  23766. // 1. Let newRequest be a copy of request, except for its body.
  23767. const newRequest = makeRequest({ ...request, body: null })
  23768. // 2. If request’s body is non-null, set newRequest’s body to the
  23769. // result of cloning request’s body.
  23770. if (request.body != null) {
  23771. newRequest.body = cloneBody(request.body)
  23772. }
  23773. // 3. Return newRequest.
  23774. return newRequest
  23775. }
  23776. Object.defineProperties(Request.prototype, {
  23777. method: kEnumerableProperty,
  23778. url: kEnumerableProperty,
  23779. headers: kEnumerableProperty,
  23780. redirect: kEnumerableProperty,
  23781. clone: kEnumerableProperty,
  23782. signal: kEnumerableProperty,
  23783. duplex: kEnumerableProperty,
  23784. destination: kEnumerableProperty,
  23785. body: kEnumerableProperty,
  23786. bodyUsed: kEnumerableProperty,
  23787. isHistoryNavigation: kEnumerableProperty,
  23788. isReloadNavigation: kEnumerableProperty,
  23789. keepalive: kEnumerableProperty,
  23790. integrity: kEnumerableProperty,
  23791. cache: kEnumerableProperty,
  23792. credentials: kEnumerableProperty,
  23793. attribute: kEnumerableProperty,
  23794. referrerPolicy: kEnumerableProperty,
  23795. referrer: kEnumerableProperty,
  23796. mode: kEnumerableProperty,
  23797. [Symbol.toStringTag]: {
  23798. value: 'Request',
  23799. configurable: true
  23800. }
  23801. })
  23802. webidl.converters.Request = webidl.interfaceConverter(
  23803. Request
  23804. )
  23805. // https://fetch.spec.whatwg.org/#requestinfo
  23806. webidl.converters.RequestInfo = function (V) {
  23807. if (typeof V === 'string') {
  23808. return webidl.converters.USVString(V)
  23809. }
  23810. if (V instanceof Request) {
  23811. return webidl.converters.Request(V)
  23812. }
  23813. return webidl.converters.USVString(V)
  23814. }
  23815. webidl.converters.AbortSignal = webidl.interfaceConverter(
  23816. AbortSignal
  23817. )
  23818. // https://fetch.spec.whatwg.org/#requestinit
  23819. webidl.converters.RequestInit = webidl.dictionaryConverter([
  23820. {
  23821. key: 'method',
  23822. converter: webidl.converters.ByteString
  23823. },
  23824. {
  23825. key: 'headers',
  23826. converter: webidl.converters.HeadersInit
  23827. },
  23828. {
  23829. key: 'body',
  23830. converter: webidl.nullableConverter(
  23831. webidl.converters.BodyInit
  23832. )
  23833. },
  23834. {
  23835. key: 'referrer',
  23836. converter: webidl.converters.USVString
  23837. },
  23838. {
  23839. key: 'referrerPolicy',
  23840. converter: webidl.converters.DOMString,
  23841. // https://w3c.github.io/webappsec-referrer-policy/#referrer-policy
  23842. allowedValues: referrerPolicy
  23843. },
  23844. {
  23845. key: 'mode',
  23846. converter: webidl.converters.DOMString,
  23847. // https://fetch.spec.whatwg.org/#concept-request-mode
  23848. allowedValues: requestMode
  23849. },
  23850. {
  23851. key: 'credentials',
  23852. converter: webidl.converters.DOMString,
  23853. // https://fetch.spec.whatwg.org/#requestcredentials
  23854. allowedValues: requestCredentials
  23855. },
  23856. {
  23857. key: 'cache',
  23858. converter: webidl.converters.DOMString,
  23859. // https://fetch.spec.whatwg.org/#requestcache
  23860. allowedValues: requestCache
  23861. },
  23862. {
  23863. key: 'redirect',
  23864. converter: webidl.converters.DOMString,
  23865. // https://fetch.spec.whatwg.org/#requestredirect
  23866. allowedValues: requestRedirect
  23867. },
  23868. {
  23869. key: 'integrity',
  23870. converter: webidl.converters.DOMString
  23871. },
  23872. {
  23873. key: 'keepalive',
  23874. converter: webidl.converters.boolean
  23875. },
  23876. {
  23877. key: 'signal',
  23878. converter: webidl.nullableConverter(
  23879. (signal) => webidl.converters.AbortSignal(
  23880. signal,
  23881. { strict: false }
  23882. )
  23883. )
  23884. },
  23885. {
  23886. key: 'window',
  23887. converter: webidl.converters.any
  23888. },
  23889. {
  23890. key: 'duplex',
  23891. converter: webidl.converters.DOMString,
  23892. allowedValues: requestDuplex
  23893. }
  23894. ])
  23895. module.exports = { Request, makeRequest }
  23896. /***/ }),
  23897. /***/ 7823:
  23898. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  23899. "use strict";
  23900. const { Headers, HeadersList, fill } = __nccwpck_require__(554)
  23901. const { extractBody, cloneBody, mixinBody } = __nccwpck_require__(9990)
  23902. const util = __nccwpck_require__(3983)
  23903. const { kEnumerableProperty } = util
  23904. const {
  23905. isValidReasonPhrase,
  23906. isCancelled,
  23907. isAborted,
  23908. isBlobLike,
  23909. serializeJavascriptValueToJSONString,
  23910. isErrorLike,
  23911. isomorphicEncode
  23912. } = __nccwpck_require__(2538)
  23913. const {
  23914. redirectStatusSet,
  23915. nullBodyStatus,
  23916. DOMException
  23917. } = __nccwpck_require__(1037)
  23918. const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(5861)
  23919. const { webidl } = __nccwpck_require__(1744)
  23920. const { FormData } = __nccwpck_require__(2015)
  23921. const { getGlobalOrigin } = __nccwpck_require__(1246)
  23922. const { URLSerializer } = __nccwpck_require__(685)
  23923. const { kHeadersList, kConstruct } = __nccwpck_require__(2785)
  23924. const assert = __nccwpck_require__(9491)
  23925. const { types } = __nccwpck_require__(3837)
  23926. const ReadableStream = globalThis.ReadableStream || (__nccwpck_require__(5356).ReadableStream)
  23927. const textEncoder = new TextEncoder('utf-8')
  23928. // https://fetch.spec.whatwg.org/#response-class
  23929. class Response {
  23930. // Creates network error Response.
  23931. static error () {
  23932. // TODO
  23933. const relevantRealm = { settingsObject: {} }
  23934. // The static error() method steps are to return the result of creating a
  23935. // Response object, given a new network error, "immutable", and this’s
  23936. // relevant Realm.
  23937. const responseObject = new Response()
  23938. responseObject[kState] = makeNetworkError()
  23939. responseObject[kRealm] = relevantRealm
  23940. responseObject[kHeaders][kHeadersList] = responseObject[kState].headersList
  23941. responseObject[kHeaders][kGuard] = 'immutable'
  23942. responseObject[kHeaders][kRealm] = relevantRealm
  23943. return responseObject
  23944. }
  23945. // https://fetch.spec.whatwg.org/#dom-response-json
  23946. static json (data, init = {}) {
  23947. webidl.argumentLengthCheck(arguments, 1, { header: 'Response.json' })
  23948. if (init !== null) {
  23949. init = webidl.converters.ResponseInit(init)
  23950. }
  23951. // 1. Let bytes the result of running serialize a JavaScript value to JSON bytes on data.
  23952. const bytes = textEncoder.encode(
  23953. serializeJavascriptValueToJSONString(data)
  23954. )
  23955. // 2. Let body be the result of extracting bytes.
  23956. const body = extractBody(bytes)
  23957. // 3. Let responseObject be the result of creating a Response object, given a new response,
  23958. // "response", and this’s relevant Realm.
  23959. const relevantRealm = { settingsObject: {} }
  23960. const responseObject = new Response()
  23961. responseObject[kRealm] = relevantRealm
  23962. responseObject[kHeaders][kGuard] = 'response'
  23963. responseObject[kHeaders][kRealm] = relevantRealm
  23964. // 4. Perform initialize a response given responseObject, init, and (body, "application/json").
  23965. initializeResponse(responseObject, init, { body: body[0], type: 'application/json' })
  23966. // 5. Return responseObject.
  23967. return responseObject
  23968. }
  23969. // Creates a redirect Response that redirects to url with status status.
  23970. static redirect (url, status = 302) {
  23971. const relevantRealm = { settingsObject: {} }
  23972. webidl.argumentLengthCheck(arguments, 1, { header: 'Response.redirect' })
  23973. url = webidl.converters.USVString(url)
  23974. status = webidl.converters['unsigned short'](status)
  23975. // 1. Let parsedURL be the result of parsing url with current settings
  23976. // object’s API base URL.
  23977. // 2. If parsedURL is failure, then throw a TypeError.
  23978. // TODO: base-URL?
  23979. let parsedURL
  23980. try {
  23981. parsedURL = new URL(url, getGlobalOrigin())
  23982. } catch (err) {
  23983. throw Object.assign(new TypeError('Failed to parse URL from ' + url), {
  23984. cause: err
  23985. })
  23986. }
  23987. // 3. If status is not a redirect status, then throw a RangeError.
  23988. if (!redirectStatusSet.has(status)) {
  23989. throw new RangeError('Invalid status code ' + status)
  23990. }
  23991. // 4. Let responseObject be the result of creating a Response object,
  23992. // given a new response, "immutable", and this’s relevant Realm.
  23993. const responseObject = new Response()
  23994. responseObject[kRealm] = relevantRealm
  23995. responseObject[kHeaders][kGuard] = 'immutable'
  23996. responseObject[kHeaders][kRealm] = relevantRealm
  23997. // 5. Set responseObject’s response’s status to status.
  23998. responseObject[kState].status = status
  23999. // 6. Let value be parsedURL, serialized and isomorphic encoded.
  24000. const value = isomorphicEncode(URLSerializer(parsedURL))
  24001. // 7. Append `Location`/value to responseObject’s response’s header list.
  24002. responseObject[kState].headersList.append('location', value)
  24003. // 8. Return responseObject.
  24004. return responseObject
  24005. }
  24006. // https://fetch.spec.whatwg.org/#dom-response
  24007. constructor (body = null, init = {}) {
  24008. if (body !== null) {
  24009. body = webidl.converters.BodyInit(body)
  24010. }
  24011. init = webidl.converters.ResponseInit(init)
  24012. // TODO
  24013. this[kRealm] = { settingsObject: {} }
  24014. // 1. Set this’s response to a new response.
  24015. this[kState] = makeResponse({})
  24016. // 2. Set this’s headers to a new Headers object with this’s relevant
  24017. // Realm, whose header list is this’s response’s header list and guard
  24018. // is "response".
  24019. this[kHeaders] = new Headers(kConstruct)
  24020. this[kHeaders][kGuard] = 'response'
  24021. this[kHeaders][kHeadersList] = this[kState].headersList
  24022. this[kHeaders][kRealm] = this[kRealm]
  24023. // 3. Let bodyWithType be null.
  24024. let bodyWithType = null
  24025. // 4. If body is non-null, then set bodyWithType to the result of extracting body.
  24026. if (body != null) {
  24027. const [extractedBody, type] = extractBody(body)
  24028. bodyWithType = { body: extractedBody, type }
  24029. }
  24030. // 5. Perform initialize a response given this, init, and bodyWithType.
  24031. initializeResponse(this, init, bodyWithType)
  24032. }
  24033. // Returns response’s type, e.g., "cors".
  24034. get type () {
  24035. webidl.brandCheck(this, Response)
  24036. // The type getter steps are to return this’s response’s type.
  24037. return this[kState].type
  24038. }
  24039. // Returns response’s URL, if it has one; otherwise the empty string.
  24040. get url () {
  24041. webidl.brandCheck(this, Response)
  24042. const urlList = this[kState].urlList
  24043. // The url getter steps are to return the empty string if this’s
  24044. // response’s URL is null; otherwise this’s response’s URL,
  24045. // serialized with exclude fragment set to true.
  24046. const url = urlList[urlList.length - 1] ?? null
  24047. if (url === null) {
  24048. return ''
  24049. }
  24050. return URLSerializer(url, true)
  24051. }
  24052. // Returns whether response was obtained through a redirect.
  24053. get redirected () {
  24054. webidl.brandCheck(this, Response)
  24055. // The redirected getter steps are to return true if this’s response’s URL
  24056. // list has more than one item; otherwise false.
  24057. return this[kState].urlList.length > 1
  24058. }
  24059. // Returns response’s status.
  24060. get status () {
  24061. webidl.brandCheck(this, Response)
  24062. // The status getter steps are to return this’s response’s status.
  24063. return this[kState].status
  24064. }
  24065. // Returns whether response’s status is an ok status.
  24066. get ok () {
  24067. webidl.brandCheck(this, Response)
  24068. // The ok getter steps are to return true if this’s response’s status is an
  24069. // ok status; otherwise false.
  24070. return this[kState].status >= 200 && this[kState].status <= 299
  24071. }
  24072. // Returns response’s status message.
  24073. get statusText () {
  24074. webidl.brandCheck(this, Response)
  24075. // The statusText getter steps are to return this’s response’s status
  24076. // message.
  24077. return this[kState].statusText
  24078. }
  24079. // Returns response’s headers as Headers.
  24080. get headers () {
  24081. webidl.brandCheck(this, Response)
  24082. // The headers getter steps are to return this’s headers.
  24083. return this[kHeaders]
  24084. }
  24085. get body () {
  24086. webidl.brandCheck(this, Response)
  24087. return this[kState].body ? this[kState].body.stream : null
  24088. }
  24089. get bodyUsed () {
  24090. webidl.brandCheck(this, Response)
  24091. return !!this[kState].body && util.isDisturbed(this[kState].body.stream)
  24092. }
  24093. // Returns a clone of response.
  24094. clone () {
  24095. webidl.brandCheck(this, Response)
  24096. // 1. If this is unusable, then throw a TypeError.
  24097. if (this.bodyUsed || (this.body && this.body.locked)) {
  24098. throw webidl.errors.exception({
  24099. header: 'Response.clone',
  24100. message: 'Body has already been consumed.'
  24101. })
  24102. }
  24103. // 2. Let clonedResponse be the result of cloning this’s response.
  24104. const clonedResponse = cloneResponse(this[kState])
  24105. // 3. Return the result of creating a Response object, given
  24106. // clonedResponse, this’s headers’s guard, and this’s relevant Realm.
  24107. const clonedResponseObject = new Response()
  24108. clonedResponseObject[kState] = clonedResponse
  24109. clonedResponseObject[kRealm] = this[kRealm]
  24110. clonedResponseObject[kHeaders][kHeadersList] = clonedResponse.headersList
  24111. clonedResponseObject[kHeaders][kGuard] = this[kHeaders][kGuard]
  24112. clonedResponseObject[kHeaders][kRealm] = this[kHeaders][kRealm]
  24113. return clonedResponseObject
  24114. }
  24115. }
  24116. mixinBody(Response)
  24117. Object.defineProperties(Response.prototype, {
  24118. type: kEnumerableProperty,
  24119. url: kEnumerableProperty,
  24120. status: kEnumerableProperty,
  24121. ok: kEnumerableProperty,
  24122. redirected: kEnumerableProperty,
  24123. statusText: kEnumerableProperty,
  24124. headers: kEnumerableProperty,
  24125. clone: kEnumerableProperty,
  24126. body: kEnumerableProperty,
  24127. bodyUsed: kEnumerableProperty,
  24128. [Symbol.toStringTag]: {
  24129. value: 'Response',
  24130. configurable: true
  24131. }
  24132. })
  24133. Object.defineProperties(Response, {
  24134. json: kEnumerableProperty,
  24135. redirect: kEnumerableProperty,
  24136. error: kEnumerableProperty
  24137. })
  24138. // https://fetch.spec.whatwg.org/#concept-response-clone
  24139. function cloneResponse (response) {
  24140. // To clone a response response, run these steps:
  24141. // 1. If response is a filtered response, then return a new identical
  24142. // filtered response whose internal response is a clone of response’s
  24143. // internal response.
  24144. if (response.internalResponse) {
  24145. return filterResponse(
  24146. cloneResponse(response.internalResponse),
  24147. response.type
  24148. )
  24149. }
  24150. // 2. Let newResponse be a copy of response, except for its body.
  24151. const newResponse = makeResponse({ ...response, body: null })
  24152. // 3. If response’s body is non-null, then set newResponse’s body to the
  24153. // result of cloning response’s body.
  24154. if (response.body != null) {
  24155. newResponse.body = cloneBody(response.body)
  24156. }
  24157. // 4. Return newResponse.
  24158. return newResponse
  24159. }
  24160. function makeResponse (init) {
  24161. return {
  24162. aborted: false,
  24163. rangeRequested: false,
  24164. timingAllowPassed: false,
  24165. requestIncludesCredentials: false,
  24166. type: 'default',
  24167. status: 200,
  24168. timingInfo: null,
  24169. cacheState: '',
  24170. statusText: '',
  24171. ...init,
  24172. headersList: init.headersList
  24173. ? new HeadersList(init.headersList)
  24174. : new HeadersList(),
  24175. urlList: init.urlList ? [...init.urlList] : []
  24176. }
  24177. }
  24178. function makeNetworkError (reason) {
  24179. const isError = isErrorLike(reason)
  24180. return makeResponse({
  24181. type: 'error',
  24182. status: 0,
  24183. error: isError
  24184. ? reason
  24185. : new Error(reason ? String(reason) : reason),
  24186. aborted: reason && reason.name === 'AbortError'
  24187. })
  24188. }
  24189. function makeFilteredResponse (response, state) {
  24190. state = {
  24191. internalResponse: response,
  24192. ...state
  24193. }
  24194. return new Proxy(response, {
  24195. get (target, p) {
  24196. return p in state ? state[p] : target[p]
  24197. },
  24198. set (target, p, value) {
  24199. assert(!(p in state))
  24200. target[p] = value
  24201. return true
  24202. }
  24203. })
  24204. }
  24205. // https://fetch.spec.whatwg.org/#concept-filtered-response
  24206. function filterResponse (response, type) {
  24207. // Set response to the following filtered response with response as its
  24208. // internal response, depending on request’s response tainting:
  24209. if (type === 'basic') {
  24210. // A basic filtered response is a filtered response whose type is "basic"
  24211. // and header list excludes any headers in internal response’s header list
  24212. // whose name is a forbidden response-header name.
  24213. // Note: undici does not implement forbidden response-header names
  24214. return makeFilteredResponse(response, {
  24215. type: 'basic',
  24216. headersList: response.headersList
  24217. })
  24218. } else if (type === 'cors') {
  24219. // A CORS filtered response is a filtered response whose type is "cors"
  24220. // and header list excludes any headers in internal response’s header
  24221. // list whose name is not a CORS-safelisted response-header name, given
  24222. // internal response’s CORS-exposed header-name list.
  24223. // Note: undici does not implement CORS-safelisted response-header names
  24224. return makeFilteredResponse(response, {
  24225. type: 'cors',
  24226. headersList: response.headersList
  24227. })
  24228. } else if (type === 'opaque') {
  24229. // An opaque filtered response is a filtered response whose type is
  24230. // "opaque", URL list is the empty list, status is 0, status message
  24231. // is the empty byte sequence, header list is empty, and body is null.
  24232. return makeFilteredResponse(response, {
  24233. type: 'opaque',
  24234. urlList: Object.freeze([]),
  24235. status: 0,
  24236. statusText: '',
  24237. body: null
  24238. })
  24239. } else if (type === 'opaqueredirect') {
  24240. // An opaque-redirect filtered response is a filtered response whose type
  24241. // is "opaqueredirect", status is 0, status message is the empty byte
  24242. // sequence, header list is empty, and body is null.
  24243. return makeFilteredResponse(response, {
  24244. type: 'opaqueredirect',
  24245. status: 0,
  24246. statusText: '',
  24247. headersList: [],
  24248. body: null
  24249. })
  24250. } else {
  24251. assert(false)
  24252. }
  24253. }
  24254. // https://fetch.spec.whatwg.org/#appropriate-network-error
  24255. function makeAppropriateNetworkError (fetchParams, err = null) {
  24256. // 1. Assert: fetchParams is canceled.
  24257. assert(isCancelled(fetchParams))
  24258. // 2. Return an aborted network error if fetchParams is aborted;
  24259. // otherwise return a network error.
  24260. return isAborted(fetchParams)
  24261. ? makeNetworkError(Object.assign(new DOMException('The operation was aborted.', 'AbortError'), { cause: err }))
  24262. : makeNetworkError(Object.assign(new DOMException('Request was cancelled.'), { cause: err }))
  24263. }
  24264. // https://whatpr.org/fetch/1392.html#initialize-a-response
  24265. function initializeResponse (response, init, body) {
  24266. // 1. If init["status"] is not in the range 200 to 599, inclusive, then
  24267. // throw a RangeError.
  24268. if (init.status !== null && (init.status < 200 || init.status > 599)) {
  24269. throw new RangeError('init["status"] must be in the range of 200 to 599, inclusive.')
  24270. }
  24271. // 2. If init["statusText"] does not match the reason-phrase token production,
  24272. // then throw a TypeError.
  24273. if ('statusText' in init && init.statusText != null) {
  24274. // See, https://datatracker.ietf.org/doc/html/rfc7230#section-3.1.2:
  24275. // reason-phrase = *( HTAB / SP / VCHAR / obs-text )
  24276. if (!isValidReasonPhrase(String(init.statusText))) {
  24277. throw new TypeError('Invalid statusText')
  24278. }
  24279. }
  24280. // 3. Set response’s response’s status to init["status"].
  24281. if ('status' in init && init.status != null) {
  24282. response[kState].status = init.status
  24283. }
  24284. // 4. Set response’s response’s status message to init["statusText"].
  24285. if ('statusText' in init && init.statusText != null) {
  24286. response[kState].statusText = init.statusText
  24287. }
  24288. // 5. If init["headers"] exists, then fill response’s headers with init["headers"].
  24289. if ('headers' in init && init.headers != null) {
  24290. fill(response[kHeaders], init.headers)
  24291. }
  24292. // 6. If body was given, then:
  24293. if (body) {
  24294. // 1. If response's status is a null body status, then throw a TypeError.
  24295. if (nullBodyStatus.includes(response.status)) {
  24296. throw webidl.errors.exception({
  24297. header: 'Response constructor',
  24298. message: 'Invalid response status code ' + response.status
  24299. })
  24300. }
  24301. // 2. Set response's body to body's body.
  24302. response[kState].body = body.body
  24303. // 3. If body's type is non-null and response's header list does not contain
  24304. // `Content-Type`, then append (`Content-Type`, body's type) to response's header list.
  24305. if (body.type != null && !response[kState].headersList.contains('Content-Type')) {
  24306. response[kState].headersList.append('content-type', body.type)
  24307. }
  24308. }
  24309. }
  24310. webidl.converters.ReadableStream = webidl.interfaceConverter(
  24311. ReadableStream
  24312. )
  24313. webidl.converters.FormData = webidl.interfaceConverter(
  24314. FormData
  24315. )
  24316. webidl.converters.URLSearchParams = webidl.interfaceConverter(
  24317. URLSearchParams
  24318. )
  24319. // https://fetch.spec.whatwg.org/#typedefdef-xmlhttprequestbodyinit
  24320. webidl.converters.XMLHttpRequestBodyInit = function (V) {
  24321. if (typeof V === 'string') {
  24322. return webidl.converters.USVString(V)
  24323. }
  24324. if (isBlobLike(V)) {
  24325. return webidl.converters.Blob(V, { strict: false })
  24326. }
  24327. if (types.isArrayBuffer(V) || types.isTypedArray(V) || types.isDataView(V)) {
  24328. return webidl.converters.BufferSource(V)
  24329. }
  24330. if (util.isFormDataLike(V)) {
  24331. return webidl.converters.FormData(V, { strict: false })
  24332. }
  24333. if (V instanceof URLSearchParams) {
  24334. return webidl.converters.URLSearchParams(V)
  24335. }
  24336. return webidl.converters.DOMString(V)
  24337. }
  24338. // https://fetch.spec.whatwg.org/#bodyinit
  24339. webidl.converters.BodyInit = function (V) {
  24340. if (V instanceof ReadableStream) {
  24341. return webidl.converters.ReadableStream(V)
  24342. }
  24343. // Note: the spec doesn't include async iterables,
  24344. // this is an undici extension.
  24345. if (V?.[Symbol.asyncIterator]) {
  24346. return V
  24347. }
  24348. return webidl.converters.XMLHttpRequestBodyInit(V)
  24349. }
  24350. webidl.converters.ResponseInit = webidl.dictionaryConverter([
  24351. {
  24352. key: 'status',
  24353. converter: webidl.converters['unsigned short'],
  24354. defaultValue: 200
  24355. },
  24356. {
  24357. key: 'statusText',
  24358. converter: webidl.converters.ByteString,
  24359. defaultValue: ''
  24360. },
  24361. {
  24362. key: 'headers',
  24363. converter: webidl.converters.HeadersInit
  24364. }
  24365. ])
  24366. module.exports = {
  24367. makeNetworkError,
  24368. makeResponse,
  24369. makeAppropriateNetworkError,
  24370. filterResponse,
  24371. Response,
  24372. cloneResponse
  24373. }
  24374. /***/ }),
  24375. /***/ 5861:
  24376. /***/ ((module) => {
  24377. "use strict";
  24378. module.exports = {
  24379. kUrl: Symbol('url'),
  24380. kHeaders: Symbol('headers'),
  24381. kSignal: Symbol('signal'),
  24382. kState: Symbol('state'),
  24383. kGuard: Symbol('guard'),
  24384. kRealm: Symbol('realm')
  24385. }
  24386. /***/ }),
  24387. /***/ 2538:
  24388. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  24389. "use strict";
  24390. const { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = __nccwpck_require__(1037)
  24391. const { getGlobalOrigin } = __nccwpck_require__(1246)
  24392. const { performance } = __nccwpck_require__(4074)
  24393. const { isBlobLike, toUSVString, ReadableStreamFrom } = __nccwpck_require__(3983)
  24394. const assert = __nccwpck_require__(9491)
  24395. const { isUint8Array } = __nccwpck_require__(9830)
  24396. let supportedHashes = []
  24397. // https://nodejs.org/api/crypto.html#determining-if-crypto-support-is-unavailable
  24398. /** @type {import('crypto')|undefined} */
  24399. let crypto
  24400. try {
  24401. crypto = __nccwpck_require__(6113)
  24402. const possibleRelevantHashes = ['sha256', 'sha384', 'sha512']
  24403. supportedHashes = crypto.getHashes().filter((hash) => possibleRelevantHashes.includes(hash))
  24404. /* c8 ignore next 3 */
  24405. } catch {
  24406. }
  24407. function responseURL (response) {
  24408. // https://fetch.spec.whatwg.org/#responses
  24409. // A response has an associated URL. It is a pointer to the last URL
  24410. // in response’s URL list and null if response’s URL list is empty.
  24411. const urlList = response.urlList
  24412. const length = urlList.length
  24413. return length === 0 ? null : urlList[length - 1].toString()
  24414. }
  24415. // https://fetch.spec.whatwg.org/#concept-response-location-url
  24416. function responseLocationURL (response, requestFragment) {
  24417. // 1. If response’s status is not a redirect status, then return null.
  24418. if (!redirectStatusSet.has(response.status)) {
  24419. return null
  24420. }
  24421. // 2. Let location be the result of extracting header list values given
  24422. // `Location` and response’s header list.
  24423. let location = response.headersList.get('location')
  24424. // 3. If location is a header value, then set location to the result of
  24425. // parsing location with response’s URL.
  24426. if (location !== null && isValidHeaderValue(location)) {
  24427. location = new URL(location, responseURL(response))
  24428. }
  24429. // 4. If location is a URL whose fragment is null, then set location’s
  24430. // fragment to requestFragment.
  24431. if (location && !location.hash) {
  24432. location.hash = requestFragment
  24433. }
  24434. // 5. Return location.
  24435. return location
  24436. }
  24437. /** @returns {URL} */
  24438. function requestCurrentURL (request) {
  24439. return request.urlList[request.urlList.length - 1]
  24440. }
  24441. function requestBadPort (request) {
  24442. // 1. Let url be request’s current URL.
  24443. const url = requestCurrentURL(request)
  24444. // 2. If url’s scheme is an HTTP(S) scheme and url’s port is a bad port,
  24445. // then return blocked.
  24446. if (urlIsHttpHttpsScheme(url) && badPortsSet.has(url.port)) {
  24447. return 'blocked'
  24448. }
  24449. // 3. Return allowed.
  24450. return 'allowed'
  24451. }
  24452. function isErrorLike (object) {
  24453. return object instanceof Error || (
  24454. object?.constructor?.name === 'Error' ||
  24455. object?.constructor?.name === 'DOMException'
  24456. )
  24457. }
  24458. // Check whether |statusText| is a ByteString and
  24459. // matches the Reason-Phrase token production.
  24460. // RFC 2616: https://tools.ietf.org/html/rfc2616
  24461. // RFC 7230: https://tools.ietf.org/html/rfc7230
  24462. // "reason-phrase = *( HTAB / SP / VCHAR / obs-text )"
  24463. // https://github.com/chromium/chromium/blob/94.0.4604.1/third_party/blink/renderer/core/fetch/response.cc#L116
  24464. function isValidReasonPhrase (statusText) {
  24465. for (let i = 0; i < statusText.length; ++i) {
  24466. const c = statusText.charCodeAt(i)
  24467. if (
  24468. !(
  24469. (
  24470. c === 0x09 || // HTAB
  24471. (c >= 0x20 && c <= 0x7e) || // SP / VCHAR
  24472. (c >= 0x80 && c <= 0xff)
  24473. ) // obs-text
  24474. )
  24475. ) {
  24476. return false
  24477. }
  24478. }
  24479. return true
  24480. }
  24481. /**
  24482. * @see https://tools.ietf.org/html/rfc7230#section-3.2.6
  24483. * @param {number} c
  24484. */
  24485. function isTokenCharCode (c) {
  24486. switch (c) {
  24487. case 0x22:
  24488. case 0x28:
  24489. case 0x29:
  24490. case 0x2c:
  24491. case 0x2f:
  24492. case 0x3a:
  24493. case 0x3b:
  24494. case 0x3c:
  24495. case 0x3d:
  24496. case 0x3e:
  24497. case 0x3f:
  24498. case 0x40:
  24499. case 0x5b:
  24500. case 0x5c:
  24501. case 0x5d:
  24502. case 0x7b:
  24503. case 0x7d:
  24504. // DQUOTE and "(),/:;<=>?@[\]{}"
  24505. return false
  24506. default:
  24507. // VCHAR %x21-7E
  24508. return c >= 0x21 && c <= 0x7e
  24509. }
  24510. }
  24511. /**
  24512. * @param {string} characters
  24513. */
  24514. function isValidHTTPToken (characters) {
  24515. if (characters.length === 0) {
  24516. return false
  24517. }
  24518. for (let i = 0; i < characters.length; ++i) {
  24519. if (!isTokenCharCode(characters.charCodeAt(i))) {
  24520. return false
  24521. }
  24522. }
  24523. return true
  24524. }
  24525. /**
  24526. * @see https://fetch.spec.whatwg.org/#header-name
  24527. * @param {string} potentialValue
  24528. */
  24529. function isValidHeaderName (potentialValue) {
  24530. return isValidHTTPToken(potentialValue)
  24531. }
  24532. /**
  24533. * @see https://fetch.spec.whatwg.org/#header-value
  24534. * @param {string} potentialValue
  24535. */
  24536. function isValidHeaderValue (potentialValue) {
  24537. // - Has no leading or trailing HTTP tab or space bytes.
  24538. // - Contains no 0x00 (NUL) or HTTP newline bytes.
  24539. if (
  24540. potentialValue.startsWith('\t') ||
  24541. potentialValue.startsWith(' ') ||
  24542. potentialValue.endsWith('\t') ||
  24543. potentialValue.endsWith(' ')
  24544. ) {
  24545. return false
  24546. }
  24547. if (
  24548. potentialValue.includes('\0') ||
  24549. potentialValue.includes('\r') ||
  24550. potentialValue.includes('\n')
  24551. ) {
  24552. return false
  24553. }
  24554. return true
  24555. }
  24556. // https://w3c.github.io/webappsec-referrer-policy/#set-requests-referrer-policy-on-redirect
  24557. function setRequestReferrerPolicyOnRedirect (request, actualResponse) {
  24558. // Given a request request and a response actualResponse, this algorithm
  24559. // updates request’s referrer policy according to the Referrer-Policy
  24560. // header (if any) in actualResponse.
  24561. // 1. Let policy be the result of executing § 8.1 Parse a referrer policy
  24562. // from a Referrer-Policy header on actualResponse.
  24563. // 8.1 Parse a referrer policy from a Referrer-Policy header
  24564. // 1. Let policy-tokens be the result of extracting header list values given `Referrer-Policy` and response’s header list.
  24565. const { headersList } = actualResponse
  24566. // 2. Let policy be the empty string.
  24567. // 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.
  24568. // 4. Return policy.
  24569. const policyHeader = (headersList.get('referrer-policy') ?? '').split(',')
  24570. // Note: As the referrer-policy can contain multiple policies
  24571. // separated by comma, we need to loop through all of them
  24572. // and pick the first valid one.
  24573. // Ref: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy#specify_a_fallback_policy
  24574. let policy = ''
  24575. if (policyHeader.length > 0) {
  24576. // The right-most policy takes precedence.
  24577. // The left-most policy is the fallback.
  24578. for (let i = policyHeader.length; i !== 0; i--) {
  24579. const token = policyHeader[i - 1].trim()
  24580. if (referrerPolicyTokens.has(token)) {
  24581. policy = token
  24582. break
  24583. }
  24584. }
  24585. }
  24586. // 2. If policy is not the empty string, then set request’s referrer policy to policy.
  24587. if (policy !== '') {
  24588. request.referrerPolicy = policy
  24589. }
  24590. }
  24591. // https://fetch.spec.whatwg.org/#cross-origin-resource-policy-check
  24592. function crossOriginResourcePolicyCheck () {
  24593. // TODO
  24594. return 'allowed'
  24595. }
  24596. // https://fetch.spec.whatwg.org/#concept-cors-check
  24597. function corsCheck () {
  24598. // TODO
  24599. return 'success'
  24600. }
  24601. // https://fetch.spec.whatwg.org/#concept-tao-check
  24602. function TAOCheck () {
  24603. // TODO
  24604. return 'success'
  24605. }
  24606. function appendFetchMetadata (httpRequest) {
  24607. // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-dest-header
  24608. // TODO
  24609. // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-mode-header
  24610. // 1. Assert: r’s url is a potentially trustworthy URL.
  24611. // TODO
  24612. // 2. Let header be a Structured Header whose value is a token.
  24613. let header = null
  24614. // 3. Set header’s value to r’s mode.
  24615. header = httpRequest.mode
  24616. // 4. Set a structured field value `Sec-Fetch-Mode`/header in r’s header list.
  24617. httpRequest.headersList.set('sec-fetch-mode', header)
  24618. // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-site-header
  24619. // TODO
  24620. // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-user-header
  24621. // TODO
  24622. }
  24623. // https://fetch.spec.whatwg.org/#append-a-request-origin-header
  24624. function appendRequestOriginHeader (request) {
  24625. // 1. Let serializedOrigin be the result of byte-serializing a request origin with request.
  24626. let serializedOrigin = request.origin
  24627. // 2. If request’s response tainting is "cors" or request’s mode is "websocket", then append (`Origin`, serializedOrigin) to request’s header list.
  24628. if (request.responseTainting === 'cors' || request.mode === 'websocket') {
  24629. if (serializedOrigin) {
  24630. request.headersList.append('origin', serializedOrigin)
  24631. }
  24632. // 3. Otherwise, if request’s method is neither `GET` nor `HEAD`, then:
  24633. } else if (request.method !== 'GET' && request.method !== 'HEAD') {
  24634. // 1. Switch on request’s referrer policy:
  24635. switch (request.referrerPolicy) {
  24636. case 'no-referrer':
  24637. // Set serializedOrigin to `null`.
  24638. serializedOrigin = null
  24639. break
  24640. case 'no-referrer-when-downgrade':
  24641. case 'strict-origin':
  24642. case 'strict-origin-when-cross-origin':
  24643. // 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`.
  24644. if (request.origin && urlHasHttpsScheme(request.origin) && !urlHasHttpsScheme(requestCurrentURL(request))) {
  24645. serializedOrigin = null
  24646. }
  24647. break
  24648. case 'same-origin':
  24649. // If request’s origin is not same origin with request’s current URL’s origin, then set serializedOrigin to `null`.
  24650. if (!sameOrigin(request, requestCurrentURL(request))) {
  24651. serializedOrigin = null
  24652. }
  24653. break
  24654. default:
  24655. // Do nothing.
  24656. }
  24657. if (serializedOrigin) {
  24658. // 2. Append (`Origin`, serializedOrigin) to request’s header list.
  24659. request.headersList.append('origin', serializedOrigin)
  24660. }
  24661. }
  24662. }
  24663. function coarsenedSharedCurrentTime (crossOriginIsolatedCapability) {
  24664. // TODO
  24665. return performance.now()
  24666. }
  24667. // https://fetch.spec.whatwg.org/#create-an-opaque-timing-info
  24668. function createOpaqueTimingInfo (timingInfo) {
  24669. return {
  24670. startTime: timingInfo.startTime ?? 0,
  24671. redirectStartTime: 0,
  24672. redirectEndTime: 0,
  24673. postRedirectStartTime: timingInfo.startTime ?? 0,
  24674. finalServiceWorkerStartTime: 0,
  24675. finalNetworkResponseStartTime: 0,
  24676. finalNetworkRequestStartTime: 0,
  24677. endTime: 0,
  24678. encodedBodySize: 0,
  24679. decodedBodySize: 0,
  24680. finalConnectionTimingInfo: null
  24681. }
  24682. }
  24683. // https://html.spec.whatwg.org/multipage/origin.html#policy-container
  24684. function makePolicyContainer () {
  24685. // Note: the fetch spec doesn't make use of embedder policy or CSP list
  24686. return {
  24687. referrerPolicy: 'strict-origin-when-cross-origin'
  24688. }
  24689. }
  24690. // https://html.spec.whatwg.org/multipage/origin.html#clone-a-policy-container
  24691. function clonePolicyContainer (policyContainer) {
  24692. return {
  24693. referrerPolicy: policyContainer.referrerPolicy
  24694. }
  24695. }
  24696. // https://w3c.github.io/webappsec-referrer-policy/#determine-requests-referrer
  24697. function determineRequestsReferrer (request) {
  24698. // 1. Let policy be request's referrer policy.
  24699. const policy = request.referrerPolicy
  24700. // Note: policy cannot (shouldn't) be null or an empty string.
  24701. assert(policy)
  24702. // 2. Let environment be request’s client.
  24703. let referrerSource = null
  24704. // 3. Switch on request’s referrer:
  24705. if (request.referrer === 'client') {
  24706. // Note: node isn't a browser and doesn't implement document/iframes,
  24707. // so we bypass this step and replace it with our own.
  24708. const globalOrigin = getGlobalOrigin()
  24709. if (!globalOrigin || globalOrigin.origin === 'null') {
  24710. return 'no-referrer'
  24711. }
  24712. // note: we need to clone it as it's mutated
  24713. referrerSource = new URL(globalOrigin)
  24714. } else if (request.referrer instanceof URL) {
  24715. // Let referrerSource be request’s referrer.
  24716. referrerSource = request.referrer
  24717. }
  24718. // 4. Let request’s referrerURL be the result of stripping referrerSource for
  24719. // use as a referrer.
  24720. let referrerURL = stripURLForReferrer(referrerSource)
  24721. // 5. Let referrerOrigin be the result of stripping referrerSource for use as
  24722. // a referrer, with the origin-only flag set to true.
  24723. const referrerOrigin = stripURLForReferrer(referrerSource, true)
  24724. // 6. If the result of serializing referrerURL is a string whose length is
  24725. // greater than 4096, set referrerURL to referrerOrigin.
  24726. if (referrerURL.toString().length > 4096) {
  24727. referrerURL = referrerOrigin
  24728. }
  24729. const areSameOrigin = sameOrigin(request, referrerURL)
  24730. const isNonPotentiallyTrustWorthy = isURLPotentiallyTrustworthy(referrerURL) &&
  24731. !isURLPotentiallyTrustworthy(request.url)
  24732. // 8. Execute the switch statements corresponding to the value of policy:
  24733. switch (policy) {
  24734. case 'origin': return referrerOrigin != null ? referrerOrigin : stripURLForReferrer(referrerSource, true)
  24735. case 'unsafe-url': return referrerURL
  24736. case 'same-origin':
  24737. return areSameOrigin ? referrerOrigin : 'no-referrer'
  24738. case 'origin-when-cross-origin':
  24739. return areSameOrigin ? referrerURL : referrerOrigin
  24740. case 'strict-origin-when-cross-origin': {
  24741. const currentURL = requestCurrentURL(request)
  24742. // 1. If the origin of referrerURL and the origin of request’s current
  24743. // URL are the same, then return referrerURL.
  24744. if (sameOrigin(referrerURL, currentURL)) {
  24745. return referrerURL
  24746. }
  24747. // 2. If referrerURL is a potentially trustworthy URL and request’s
  24748. // current URL is not a potentially trustworthy URL, then return no
  24749. // referrer.
  24750. if (isURLPotentiallyTrustworthy(referrerURL) && !isURLPotentiallyTrustworthy(currentURL)) {
  24751. return 'no-referrer'
  24752. }
  24753. // 3. Return referrerOrigin.
  24754. return referrerOrigin
  24755. }
  24756. case 'strict-origin': // eslint-disable-line
  24757. /**
  24758. * 1. If referrerURL is a potentially trustworthy URL and
  24759. * request’s current URL is not a potentially trustworthy URL,
  24760. * then return no referrer.
  24761. * 2. Return referrerOrigin
  24762. */
  24763. case 'no-referrer-when-downgrade': // eslint-disable-line
  24764. /**
  24765. * 1. If referrerURL is a potentially trustworthy URL and
  24766. * request’s current URL is not a potentially trustworthy URL,
  24767. * then return no referrer.
  24768. * 2. Return referrerOrigin
  24769. */
  24770. default: // eslint-disable-line
  24771. return isNonPotentiallyTrustWorthy ? 'no-referrer' : referrerOrigin
  24772. }
  24773. }
  24774. /**
  24775. * @see https://w3c.github.io/webappsec-referrer-policy/#strip-url
  24776. * @param {URL} url
  24777. * @param {boolean|undefined} originOnly
  24778. */
  24779. function stripURLForReferrer (url, originOnly) {
  24780. // 1. Assert: url is a URL.
  24781. assert(url instanceof URL)
  24782. // 2. If url’s scheme is a local scheme, then return no referrer.
  24783. if (url.protocol === 'file:' || url.protocol === 'about:' || url.protocol === 'blank:') {
  24784. return 'no-referrer'
  24785. }
  24786. // 3. Set url’s username to the empty string.
  24787. url.username = ''
  24788. // 4. Set url’s password to the empty string.
  24789. url.password = ''
  24790. // 5. Set url’s fragment to null.
  24791. url.hash = ''
  24792. // 6. If the origin-only flag is true, then:
  24793. if (originOnly) {
  24794. // 1. Set url’s path to « the empty string ».
  24795. url.pathname = ''
  24796. // 2. Set url’s query to null.
  24797. url.search = ''
  24798. }
  24799. // 7. Return url.
  24800. return url
  24801. }
  24802. function isURLPotentiallyTrustworthy (url) {
  24803. if (!(url instanceof URL)) {
  24804. return false
  24805. }
  24806. // If child of about, return true
  24807. if (url.href === 'about:blank' || url.href === 'about:srcdoc') {
  24808. return true
  24809. }
  24810. // If scheme is data, return true
  24811. if (url.protocol === 'data:') return true
  24812. // If file, return true
  24813. if (url.protocol === 'file:') return true
  24814. return isOriginPotentiallyTrustworthy(url.origin)
  24815. function isOriginPotentiallyTrustworthy (origin) {
  24816. // If origin is explicitly null, return false
  24817. if (origin == null || origin === 'null') return false
  24818. const originAsURL = new URL(origin)
  24819. // If secure, return true
  24820. if (originAsURL.protocol === 'https:' || originAsURL.protocol === 'wss:') {
  24821. return true
  24822. }
  24823. // If localhost or variants, return true
  24824. if (/^127(?:\.[0-9]+){0,2}\.[0-9]+$|^\[(?:0*:)*?:?0*1\]$/.test(originAsURL.hostname) ||
  24825. (originAsURL.hostname === 'localhost' || originAsURL.hostname.includes('localhost.')) ||
  24826. (originAsURL.hostname.endsWith('.localhost'))) {
  24827. return true
  24828. }
  24829. // If any other, return false
  24830. return false
  24831. }
  24832. }
  24833. /**
  24834. * @see https://w3c.github.io/webappsec-subresource-integrity/#does-response-match-metadatalist
  24835. * @param {Uint8Array} bytes
  24836. * @param {string} metadataList
  24837. */
  24838. function bytesMatch (bytes, metadataList) {
  24839. // If node is not built with OpenSSL support, we cannot check
  24840. // a request's integrity, so allow it by default (the spec will
  24841. // allow requests if an invalid hash is given, as precedence).
  24842. /* istanbul ignore if: only if node is built with --without-ssl */
  24843. if (crypto === undefined) {
  24844. return true
  24845. }
  24846. // 1. Let parsedMetadata be the result of parsing metadataList.
  24847. const parsedMetadata = parseMetadata(metadataList)
  24848. // 2. If parsedMetadata is no metadata, return true.
  24849. if (parsedMetadata === 'no metadata') {
  24850. return true
  24851. }
  24852. // 3. If response is not eligible for integrity validation, return false.
  24853. // TODO
  24854. // 4. If parsedMetadata is the empty set, return true.
  24855. if (parsedMetadata.length === 0) {
  24856. return true
  24857. }
  24858. // 5. Let metadata be the result of getting the strongest
  24859. // metadata from parsedMetadata.
  24860. const strongest = getStrongestMetadata(parsedMetadata)
  24861. const metadata = filterMetadataListByAlgorithm(parsedMetadata, strongest)
  24862. // 6. For each item in metadata:
  24863. for (const item of metadata) {
  24864. // 1. Let algorithm be the alg component of item.
  24865. const algorithm = item.algo
  24866. // 2. Let expectedValue be the val component of item.
  24867. const expectedValue = item.hash
  24868. // See https://github.com/web-platform-tests/wpt/commit/e4c5cc7a5e48093220528dfdd1c4012dc3837a0e
  24869. // "be liberal with padding". This is annoying, and it's not even in the spec.
  24870. // 3. Let actualValue be the result of applying algorithm to bytes.
  24871. let actualValue = crypto.createHash(algorithm).update(bytes).digest('base64')
  24872. if (actualValue[actualValue.length - 1] === '=') {
  24873. if (actualValue[actualValue.length - 2] === '=') {
  24874. actualValue = actualValue.slice(0, -2)
  24875. } else {
  24876. actualValue = actualValue.slice(0, -1)
  24877. }
  24878. }
  24879. // 4. If actualValue is a case-sensitive match for expectedValue,
  24880. // return true.
  24881. if (compareBase64Mixed(actualValue, expectedValue)) {
  24882. return true
  24883. }
  24884. }
  24885. // 7. Return false.
  24886. return false
  24887. }
  24888. // https://w3c.github.io/webappsec-subresource-integrity/#grammardef-hash-with-options
  24889. // https://www.w3.org/TR/CSP2/#source-list-syntax
  24890. // https://www.rfc-editor.org/rfc/rfc5234#appendix-B.1
  24891. const parseHashWithOptions = /(?<algo>sha256|sha384|sha512)-((?<hash>[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\s|$)( +[!-~]*)?)?/i
  24892. /**
  24893. * @see https://w3c.github.io/webappsec-subresource-integrity/#parse-metadata
  24894. * @param {string} metadata
  24895. */
  24896. function parseMetadata (metadata) {
  24897. // 1. Let result be the empty set.
  24898. /** @type {{ algo: string, hash: string }[]} */
  24899. const result = []
  24900. // 2. Let empty be equal to true.
  24901. let empty = true
  24902. // 3. For each token returned by splitting metadata on spaces:
  24903. for (const token of metadata.split(' ')) {
  24904. // 1. Set empty to false.
  24905. empty = false
  24906. // 2. Parse token as a hash-with-options.
  24907. const parsedToken = parseHashWithOptions.exec(token)
  24908. // 3. If token does not parse, continue to the next token.
  24909. if (
  24910. parsedToken === null ||
  24911. parsedToken.groups === undefined ||
  24912. parsedToken.groups.algo === undefined
  24913. ) {
  24914. // Note: Chromium blocks the request at this point, but Firefox
  24915. // gives a warning that an invalid integrity was given. The
  24916. // correct behavior is to ignore these, and subsequently not
  24917. // check the integrity of the resource.
  24918. continue
  24919. }
  24920. // 4. Let algorithm be the hash-algo component of token.
  24921. const algorithm = parsedToken.groups.algo.toLowerCase()
  24922. // 5. If algorithm is a hash function recognized by the user
  24923. // agent, add the parsed token to result.
  24924. if (supportedHashes.includes(algorithm)) {
  24925. result.push(parsedToken.groups)
  24926. }
  24927. }
  24928. // 4. Return no metadata if empty is true, otherwise return result.
  24929. if (empty === true) {
  24930. return 'no metadata'
  24931. }
  24932. return result
  24933. }
  24934. /**
  24935. * @param {{ algo: 'sha256' | 'sha384' | 'sha512' }[]} metadataList
  24936. */
  24937. function getStrongestMetadata (metadataList) {
  24938. // Let algorithm be the algo component of the first item in metadataList.
  24939. // Can be sha256
  24940. let algorithm = metadataList[0].algo
  24941. // If the algorithm is sha512, then it is the strongest
  24942. // and we can return immediately
  24943. if (algorithm[3] === '5') {
  24944. return algorithm
  24945. }
  24946. for (let i = 1; i < metadataList.length; ++i) {
  24947. const metadata = metadataList[i]
  24948. // If the algorithm is sha512, then it is the strongest
  24949. // and we can break the loop immediately
  24950. if (metadata.algo[3] === '5') {
  24951. algorithm = 'sha512'
  24952. break
  24953. // If the algorithm is sha384, then a potential sha256 or sha384 is ignored
  24954. } else if (algorithm[3] === '3') {
  24955. continue
  24956. // algorithm is sha256, check if algorithm is sha384 and if so, set it as
  24957. // the strongest
  24958. } else if (metadata.algo[3] === '3') {
  24959. algorithm = 'sha384'
  24960. }
  24961. }
  24962. return algorithm
  24963. }
  24964. function filterMetadataListByAlgorithm (metadataList, algorithm) {
  24965. if (metadataList.length === 1) {
  24966. return metadataList
  24967. }
  24968. let pos = 0
  24969. for (let i = 0; i < metadataList.length; ++i) {
  24970. if (metadataList[i].algo === algorithm) {
  24971. metadataList[pos++] = metadataList[i]
  24972. }
  24973. }
  24974. metadataList.length = pos
  24975. return metadataList
  24976. }
  24977. /**
  24978. * Compares two base64 strings, allowing for base64url
  24979. * in the second string.
  24980. *
  24981. * @param {string} actualValue always base64
  24982. * @param {string} expectedValue base64 or base64url
  24983. * @returns {boolean}
  24984. */
  24985. function compareBase64Mixed (actualValue, expectedValue) {
  24986. if (actualValue.length !== expectedValue.length) {
  24987. return false
  24988. }
  24989. for (let i = 0; i < actualValue.length; ++i) {
  24990. if (actualValue[i] !== expectedValue[i]) {
  24991. if (
  24992. (actualValue[i] === '+' && expectedValue[i] === '-') ||
  24993. (actualValue[i] === '/' && expectedValue[i] === '_')
  24994. ) {
  24995. continue
  24996. }
  24997. return false
  24998. }
  24999. }
  25000. return true
  25001. }
  25002. // https://w3c.github.io/webappsec-upgrade-insecure-requests/#upgrade-request
  25003. function tryUpgradeRequestToAPotentiallyTrustworthyURL (request) {
  25004. // TODO
  25005. }
  25006. /**
  25007. * @link {https://html.spec.whatwg.org/multipage/origin.html#same-origin}
  25008. * @param {URL} A
  25009. * @param {URL} B
  25010. */
  25011. function sameOrigin (A, B) {
  25012. // 1. If A and B are the same opaque origin, then return true.
  25013. if (A.origin === B.origin && A.origin === 'null') {
  25014. return true
  25015. }
  25016. // 2. If A and B are both tuple origins and their schemes,
  25017. // hosts, and port are identical, then return true.
  25018. if (A.protocol === B.protocol && A.hostname === B.hostname && A.port === B.port) {
  25019. return true
  25020. }
  25021. // 3. Return false.
  25022. return false
  25023. }
  25024. function createDeferredPromise () {
  25025. let res
  25026. let rej
  25027. const promise = new Promise((resolve, reject) => {
  25028. res = resolve
  25029. rej = reject
  25030. })
  25031. return { promise, resolve: res, reject: rej }
  25032. }
  25033. function isAborted (fetchParams) {
  25034. return fetchParams.controller.state === 'aborted'
  25035. }
  25036. function isCancelled (fetchParams) {
  25037. return fetchParams.controller.state === 'aborted' ||
  25038. fetchParams.controller.state === 'terminated'
  25039. }
  25040. const normalizeMethodRecord = {
  25041. delete: 'DELETE',
  25042. DELETE: 'DELETE',
  25043. get: 'GET',
  25044. GET: 'GET',
  25045. head: 'HEAD',
  25046. HEAD: 'HEAD',
  25047. options: 'OPTIONS',
  25048. OPTIONS: 'OPTIONS',
  25049. post: 'POST',
  25050. POST: 'POST',
  25051. put: 'PUT',
  25052. PUT: 'PUT'
  25053. }
  25054. // Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`.
  25055. Object.setPrototypeOf(normalizeMethodRecord, null)
  25056. /**
  25057. * @see https://fetch.spec.whatwg.org/#concept-method-normalize
  25058. * @param {string} method
  25059. */
  25060. function normalizeMethod (method) {
  25061. return normalizeMethodRecord[method.toLowerCase()] ?? method
  25062. }
  25063. // https://infra.spec.whatwg.org/#serialize-a-javascript-value-to-a-json-string
  25064. function serializeJavascriptValueToJSONString (value) {
  25065. // 1. Let result be ? Call(%JSON.stringify%, undefined, « value »).
  25066. const result = JSON.stringify(value)
  25067. // 2. If result is undefined, then throw a TypeError.
  25068. if (result === undefined) {
  25069. throw new TypeError('Value is not JSON serializable')
  25070. }
  25071. // 3. Assert: result is a string.
  25072. assert(typeof result === 'string')
  25073. // 4. Return result.
  25074. return result
  25075. }
  25076. // https://tc39.es/ecma262/#sec-%25iteratorprototype%25-object
  25077. const esIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))
  25078. /**
  25079. * @see https://webidl.spec.whatwg.org/#dfn-iterator-prototype-object
  25080. * @param {() => unknown[]} iterator
  25081. * @param {string} name name of the instance
  25082. * @param {'key'|'value'|'key+value'} kind
  25083. */
  25084. function makeIterator (iterator, name, kind) {
  25085. const object = {
  25086. index: 0,
  25087. kind,
  25088. target: iterator
  25089. }
  25090. const i = {
  25091. next () {
  25092. // 1. Let interface be the interface for which the iterator prototype object exists.
  25093. // 2. Let thisValue be the this value.
  25094. // 3. Let object be ? ToObject(thisValue).
  25095. // 4. If object is a platform object, then perform a security
  25096. // check, passing:
  25097. // 5. If object is not a default iterator object for interface,
  25098. // then throw a TypeError.
  25099. if (Object.getPrototypeOf(this) !== i) {
  25100. throw new TypeError(
  25101. `'next' called on an object that does not implement interface ${name} Iterator.`
  25102. )
  25103. }
  25104. // 6. Let index be object’s index.
  25105. // 7. Let kind be object’s kind.
  25106. // 8. Let values be object’s target's value pairs to iterate over.
  25107. const { index, kind, target } = object
  25108. const values = target()
  25109. // 9. Let len be the length of values.
  25110. const len = values.length
  25111. // 10. If index is greater than or equal to len, then return
  25112. // CreateIterResultObject(undefined, true).
  25113. if (index >= len) {
  25114. return { value: undefined, done: true }
  25115. }
  25116. // 11. Let pair be the entry in values at index index.
  25117. const pair = values[index]
  25118. // 12. Set object’s index to index + 1.
  25119. object.index = index + 1
  25120. // 13. Return the iterator result for pair and kind.
  25121. return iteratorResult(pair, kind)
  25122. },
  25123. // The class string of an iterator prototype object for a given interface is the
  25124. // result of concatenating the identifier of the interface and the string " Iterator".
  25125. [Symbol.toStringTag]: `${name} Iterator`
  25126. }
  25127. // The [[Prototype]] internal slot of an iterator prototype object must be %IteratorPrototype%.
  25128. Object.setPrototypeOf(i, esIteratorPrototype)
  25129. // esIteratorPrototype needs to be the prototype of i
  25130. // which is the prototype of an empty object. Yes, it's confusing.
  25131. return Object.setPrototypeOf({}, i)
  25132. }
  25133. // https://webidl.spec.whatwg.org/#iterator-result
  25134. function iteratorResult (pair, kind) {
  25135. let result
  25136. // 1. Let result be a value determined by the value of kind:
  25137. switch (kind) {
  25138. case 'key': {
  25139. // 1. Let idlKey be pair’s key.
  25140. // 2. Let key be the result of converting idlKey to an
  25141. // ECMAScript value.
  25142. // 3. result is key.
  25143. result = pair[0]
  25144. break
  25145. }
  25146. case 'value': {
  25147. // 1. Let idlValue be pair’s value.
  25148. // 2. Let value be the result of converting idlValue to
  25149. // an ECMAScript value.
  25150. // 3. result is value.
  25151. result = pair[1]
  25152. break
  25153. }
  25154. case 'key+value': {
  25155. // 1. Let idlKey be pair’s key.
  25156. // 2. Let idlValue be pair’s value.
  25157. // 3. Let key be the result of converting idlKey to an
  25158. // ECMAScript value.
  25159. // 4. Let value be the result of converting idlValue to
  25160. // an ECMAScript value.
  25161. // 5. Let array be ! ArrayCreate(2).
  25162. // 6. Call ! CreateDataProperty(array, "0", key).
  25163. // 7. Call ! CreateDataProperty(array, "1", value).
  25164. // 8. result is array.
  25165. result = pair
  25166. break
  25167. }
  25168. }
  25169. // 2. Return CreateIterResultObject(result, false).
  25170. return { value: result, done: false }
  25171. }
  25172. /**
  25173. * @see https://fetch.spec.whatwg.org/#body-fully-read
  25174. */
  25175. async function fullyReadBody (body, processBody, processBodyError) {
  25176. // 1. If taskDestination is null, then set taskDestination to
  25177. // the result of starting a new parallel queue.
  25178. // 2. Let successSteps given a byte sequence bytes be to queue a
  25179. // fetch task to run processBody given bytes, with taskDestination.
  25180. const successSteps = processBody
  25181. // 3. Let errorSteps be to queue a fetch task to run processBodyError,
  25182. // with taskDestination.
  25183. const errorSteps = processBodyError
  25184. // 4. Let reader be the result of getting a reader for body’s stream.
  25185. // If that threw an exception, then run errorSteps with that
  25186. // exception and return.
  25187. let reader
  25188. try {
  25189. reader = body.stream.getReader()
  25190. } catch (e) {
  25191. errorSteps(e)
  25192. return
  25193. }
  25194. // 5. Read all bytes from reader, given successSteps and errorSteps.
  25195. try {
  25196. const result = await readAllBytes(reader)
  25197. successSteps(result)
  25198. } catch (e) {
  25199. errorSteps(e)
  25200. }
  25201. }
  25202. /** @type {ReadableStream} */
  25203. let ReadableStream = globalThis.ReadableStream
  25204. function isReadableStreamLike (stream) {
  25205. if (!ReadableStream) {
  25206. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  25207. }
  25208. return stream instanceof ReadableStream || (
  25209. stream[Symbol.toStringTag] === 'ReadableStream' &&
  25210. typeof stream.tee === 'function'
  25211. )
  25212. }
  25213. const MAXIMUM_ARGUMENT_LENGTH = 65535
  25214. /**
  25215. * @see https://infra.spec.whatwg.org/#isomorphic-decode
  25216. * @param {number[]|Uint8Array} input
  25217. */
  25218. function isomorphicDecode (input) {
  25219. // 1. To isomorphic decode a byte sequence input, return a string whose code point
  25220. // length is equal to input’s length and whose code points have the same values
  25221. // as the values of input’s bytes, in the same order.
  25222. if (input.length < MAXIMUM_ARGUMENT_LENGTH) {
  25223. return String.fromCharCode(...input)
  25224. }
  25225. return input.reduce((previous, current) => previous + String.fromCharCode(current), '')
  25226. }
  25227. /**
  25228. * @param {ReadableStreamController<Uint8Array>} controller
  25229. */
  25230. function readableStreamClose (controller) {
  25231. try {
  25232. controller.close()
  25233. } catch (err) {
  25234. // TODO: add comment explaining why this error occurs.
  25235. if (!err.message.includes('Controller is already closed')) {
  25236. throw err
  25237. }
  25238. }
  25239. }
  25240. /**
  25241. * @see https://infra.spec.whatwg.org/#isomorphic-encode
  25242. * @param {string} input
  25243. */
  25244. function isomorphicEncode (input) {
  25245. // 1. Assert: input contains no code points greater than U+00FF.
  25246. for (let i = 0; i < input.length; i++) {
  25247. assert(input.charCodeAt(i) <= 0xFF)
  25248. }
  25249. // 2. Return a byte sequence whose length is equal to input’s code
  25250. // point length and whose bytes have the same values as the
  25251. // values of input’s code points, in the same order
  25252. return input
  25253. }
  25254. /**
  25255. * @see https://streams.spec.whatwg.org/#readablestreamdefaultreader-read-all-bytes
  25256. * @see https://streams.spec.whatwg.org/#read-loop
  25257. * @param {ReadableStreamDefaultReader} reader
  25258. */
  25259. async function readAllBytes (reader) {
  25260. const bytes = []
  25261. let byteLength = 0
  25262. while (true) {
  25263. const { done, value: chunk } = await reader.read()
  25264. if (done) {
  25265. // 1. Call successSteps with bytes.
  25266. return Buffer.concat(bytes, byteLength)
  25267. }
  25268. // 1. If chunk is not a Uint8Array object, call failureSteps
  25269. // with a TypeError and abort these steps.
  25270. if (!isUint8Array(chunk)) {
  25271. throw new TypeError('Received non-Uint8Array chunk')
  25272. }
  25273. // 2. Append the bytes represented by chunk to bytes.
  25274. bytes.push(chunk)
  25275. byteLength += chunk.length
  25276. // 3. Read-loop given reader, bytes, successSteps, and failureSteps.
  25277. }
  25278. }
  25279. /**
  25280. * @see https://fetch.spec.whatwg.org/#is-local
  25281. * @param {URL} url
  25282. */
  25283. function urlIsLocal (url) {
  25284. assert('protocol' in url) // ensure it's a url object
  25285. const protocol = url.protocol
  25286. return protocol === 'about:' || protocol === 'blob:' || protocol === 'data:'
  25287. }
  25288. /**
  25289. * @param {string|URL} url
  25290. */
  25291. function urlHasHttpsScheme (url) {
  25292. if (typeof url === 'string') {
  25293. return url.startsWith('https:')
  25294. }
  25295. return url.protocol === 'https:'
  25296. }
  25297. /**
  25298. * @see https://fetch.spec.whatwg.org/#http-scheme
  25299. * @param {URL} url
  25300. */
  25301. function urlIsHttpHttpsScheme (url) {
  25302. assert('protocol' in url) // ensure it's a url object
  25303. const protocol = url.protocol
  25304. return protocol === 'http:' || protocol === 'https:'
  25305. }
  25306. /**
  25307. * Fetch supports node >= 16.8.0, but Object.hasOwn was added in v16.9.0.
  25308. */
  25309. const hasOwn = Object.hasOwn || ((dict, key) => Object.prototype.hasOwnProperty.call(dict, key))
  25310. module.exports = {
  25311. isAborted,
  25312. isCancelled,
  25313. createDeferredPromise,
  25314. ReadableStreamFrom,
  25315. toUSVString,
  25316. tryUpgradeRequestToAPotentiallyTrustworthyURL,
  25317. coarsenedSharedCurrentTime,
  25318. determineRequestsReferrer,
  25319. makePolicyContainer,
  25320. clonePolicyContainer,
  25321. appendFetchMetadata,
  25322. appendRequestOriginHeader,
  25323. TAOCheck,
  25324. corsCheck,
  25325. crossOriginResourcePolicyCheck,
  25326. createOpaqueTimingInfo,
  25327. setRequestReferrerPolicyOnRedirect,
  25328. isValidHTTPToken,
  25329. requestBadPort,
  25330. requestCurrentURL,
  25331. responseURL,
  25332. responseLocationURL,
  25333. isBlobLike,
  25334. isURLPotentiallyTrustworthy,
  25335. isValidReasonPhrase,
  25336. sameOrigin,
  25337. normalizeMethod,
  25338. serializeJavascriptValueToJSONString,
  25339. makeIterator,
  25340. isValidHeaderName,
  25341. isValidHeaderValue,
  25342. hasOwn,
  25343. isErrorLike,
  25344. fullyReadBody,
  25345. bytesMatch,
  25346. isReadableStreamLike,
  25347. readableStreamClose,
  25348. isomorphicEncode,
  25349. isomorphicDecode,
  25350. urlIsLocal,
  25351. urlHasHttpsScheme,
  25352. urlIsHttpHttpsScheme,
  25353. readAllBytes,
  25354. normalizeMethodRecord,
  25355. parseMetadata
  25356. }
  25357. /***/ }),
  25358. /***/ 1744:
  25359. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  25360. "use strict";
  25361. const { types } = __nccwpck_require__(3837)
  25362. const { hasOwn, toUSVString } = __nccwpck_require__(2538)
  25363. /** @type {import('../../types/webidl').Webidl} */
  25364. const webidl = {}
  25365. webidl.converters = {}
  25366. webidl.util = {}
  25367. webidl.errors = {}
  25368. webidl.errors.exception = function (message) {
  25369. return new TypeError(`${message.header}: ${message.message}`)
  25370. }
  25371. webidl.errors.conversionFailed = function (context) {
  25372. const plural = context.types.length === 1 ? '' : ' one of'
  25373. const message =
  25374. `${context.argument} could not be converted to` +
  25375. `${plural}: ${context.types.join(', ')}.`
  25376. return webidl.errors.exception({
  25377. header: context.prefix,
  25378. message
  25379. })
  25380. }
  25381. webidl.errors.invalidArgument = function (context) {
  25382. return webidl.errors.exception({
  25383. header: context.prefix,
  25384. message: `"${context.value}" is an invalid ${context.type}.`
  25385. })
  25386. }
  25387. // https://webidl.spec.whatwg.org/#implements
  25388. webidl.brandCheck = function (V, I, opts = undefined) {
  25389. if (opts?.strict !== false && !(V instanceof I)) {
  25390. throw new TypeError('Illegal invocation')
  25391. } else {
  25392. return V?.[Symbol.toStringTag] === I.prototype[Symbol.toStringTag]
  25393. }
  25394. }
  25395. webidl.argumentLengthCheck = function ({ length }, min, ctx) {
  25396. if (length < min) {
  25397. throw webidl.errors.exception({
  25398. message: `${min} argument${min !== 1 ? 's' : ''} required, ` +
  25399. `but${length ? ' only' : ''} ${length} found.`,
  25400. ...ctx
  25401. })
  25402. }
  25403. }
  25404. webidl.illegalConstructor = function () {
  25405. throw webidl.errors.exception({
  25406. header: 'TypeError',
  25407. message: 'Illegal constructor'
  25408. })
  25409. }
  25410. // https://tc39.es/ecma262/#sec-ecmascript-data-types-and-values
  25411. webidl.util.Type = function (V) {
  25412. switch (typeof V) {
  25413. case 'undefined': return 'Undefined'
  25414. case 'boolean': return 'Boolean'
  25415. case 'string': return 'String'
  25416. case 'symbol': return 'Symbol'
  25417. case 'number': return 'Number'
  25418. case 'bigint': return 'BigInt'
  25419. case 'function':
  25420. case 'object': {
  25421. if (V === null) {
  25422. return 'Null'
  25423. }
  25424. return 'Object'
  25425. }
  25426. }
  25427. }
  25428. // https://webidl.spec.whatwg.org/#abstract-opdef-converttoint
  25429. webidl.util.ConvertToInt = function (V, bitLength, signedness, opts = {}) {
  25430. let upperBound
  25431. let lowerBound
  25432. // 1. If bitLength is 64, then:
  25433. if (bitLength === 64) {
  25434. // 1. Let upperBound be 2^53 − 1.
  25435. upperBound = Math.pow(2, 53) - 1
  25436. // 2. If signedness is "unsigned", then let lowerBound be 0.
  25437. if (signedness === 'unsigned') {
  25438. lowerBound = 0
  25439. } else {
  25440. // 3. Otherwise let lowerBound be −2^53 + 1.
  25441. lowerBound = Math.pow(-2, 53) + 1
  25442. }
  25443. } else if (signedness === 'unsigned') {
  25444. // 2. Otherwise, if signedness is "unsigned", then:
  25445. // 1. Let lowerBound be 0.
  25446. lowerBound = 0
  25447. // 2. Let upperBound be 2^bitLength − 1.
  25448. upperBound = Math.pow(2, bitLength) - 1
  25449. } else {
  25450. // 3. Otherwise:
  25451. // 1. Let lowerBound be -2^bitLength − 1.
  25452. lowerBound = Math.pow(-2, bitLength) - 1
  25453. // 2. Let upperBound be 2^bitLength − 1 − 1.
  25454. upperBound = Math.pow(2, bitLength - 1) - 1
  25455. }
  25456. // 4. Let x be ? ToNumber(V).
  25457. let x = Number(V)
  25458. // 5. If x is −0, then set x to +0.
  25459. if (x === 0) {
  25460. x = 0
  25461. }
  25462. // 6. If the conversion is to an IDL type associated
  25463. // with the [EnforceRange] extended attribute, then:
  25464. if (opts.enforceRange === true) {
  25465. // 1. If x is NaN, +∞, or −∞, then throw a TypeError.
  25466. if (
  25467. Number.isNaN(x) ||
  25468. x === Number.POSITIVE_INFINITY ||
  25469. x === Number.NEGATIVE_INFINITY
  25470. ) {
  25471. throw webidl.errors.exception({
  25472. header: 'Integer conversion',
  25473. message: `Could not convert ${V} to an integer.`
  25474. })
  25475. }
  25476. // 2. Set x to IntegerPart(x).
  25477. x = webidl.util.IntegerPart(x)
  25478. // 3. If x < lowerBound or x > upperBound, then
  25479. // throw a TypeError.
  25480. if (x < lowerBound || x > upperBound) {
  25481. throw webidl.errors.exception({
  25482. header: 'Integer conversion',
  25483. message: `Value must be between ${lowerBound}-${upperBound}, got ${x}.`
  25484. })
  25485. }
  25486. // 4. Return x.
  25487. return x
  25488. }
  25489. // 7. If x is not NaN and the conversion is to an IDL
  25490. // type associated with the [Clamp] extended
  25491. // attribute, then:
  25492. if (!Number.isNaN(x) && opts.clamp === true) {
  25493. // 1. Set x to min(max(x, lowerBound), upperBound).
  25494. x = Math.min(Math.max(x, lowerBound), upperBound)
  25495. // 2. Round x to the nearest integer, choosing the
  25496. // even integer if it lies halfway between two,
  25497. // and choosing +0 rather than −0.
  25498. if (Math.floor(x) % 2 === 0) {
  25499. x = Math.floor(x)
  25500. } else {
  25501. x = Math.ceil(x)
  25502. }
  25503. // 3. Return x.
  25504. return x
  25505. }
  25506. // 8. If x is NaN, +0, +∞, or −∞, then return +0.
  25507. if (
  25508. Number.isNaN(x) ||
  25509. (x === 0 && Object.is(0, x)) ||
  25510. x === Number.POSITIVE_INFINITY ||
  25511. x === Number.NEGATIVE_INFINITY
  25512. ) {
  25513. return 0
  25514. }
  25515. // 9. Set x to IntegerPart(x).
  25516. x = webidl.util.IntegerPart(x)
  25517. // 10. Set x to x modulo 2^bitLength.
  25518. x = x % Math.pow(2, bitLength)
  25519. // 11. If signedness is "signed" and x ≥ 2^bitLength − 1,
  25520. // then return x − 2^bitLength.
  25521. if (signedness === 'signed' && x >= Math.pow(2, bitLength) - 1) {
  25522. return x - Math.pow(2, bitLength)
  25523. }
  25524. // 12. Otherwise, return x.
  25525. return x
  25526. }
  25527. // https://webidl.spec.whatwg.org/#abstract-opdef-integerpart
  25528. webidl.util.IntegerPart = function (n) {
  25529. // 1. Let r be floor(abs(n)).
  25530. const r = Math.floor(Math.abs(n))
  25531. // 2. If n < 0, then return -1 × r.
  25532. if (n < 0) {
  25533. return -1 * r
  25534. }
  25535. // 3. Otherwise, return r.
  25536. return r
  25537. }
  25538. // https://webidl.spec.whatwg.org/#es-sequence
  25539. webidl.sequenceConverter = function (converter) {
  25540. return (V) => {
  25541. // 1. If Type(V) is not Object, throw a TypeError.
  25542. if (webidl.util.Type(V) !== 'Object') {
  25543. throw webidl.errors.exception({
  25544. header: 'Sequence',
  25545. message: `Value of type ${webidl.util.Type(V)} is not an Object.`
  25546. })
  25547. }
  25548. // 2. Let method be ? GetMethod(V, @@iterator).
  25549. /** @type {Generator} */
  25550. const method = V?.[Symbol.iterator]?.()
  25551. const seq = []
  25552. // 3. If method is undefined, throw a TypeError.
  25553. if (
  25554. method === undefined ||
  25555. typeof method.next !== 'function'
  25556. ) {
  25557. throw webidl.errors.exception({
  25558. header: 'Sequence',
  25559. message: 'Object is not an iterator.'
  25560. })
  25561. }
  25562. // https://webidl.spec.whatwg.org/#create-sequence-from-iterable
  25563. while (true) {
  25564. const { done, value } = method.next()
  25565. if (done) {
  25566. break
  25567. }
  25568. seq.push(converter(value))
  25569. }
  25570. return seq
  25571. }
  25572. }
  25573. // https://webidl.spec.whatwg.org/#es-to-record
  25574. webidl.recordConverter = function (keyConverter, valueConverter) {
  25575. return (O) => {
  25576. // 1. If Type(O) is not Object, throw a TypeError.
  25577. if (webidl.util.Type(O) !== 'Object') {
  25578. throw webidl.errors.exception({
  25579. header: 'Record',
  25580. message: `Value of type ${webidl.util.Type(O)} is not an Object.`
  25581. })
  25582. }
  25583. // 2. Let result be a new empty instance of record<K, V>.
  25584. const result = {}
  25585. if (!types.isProxy(O)) {
  25586. // Object.keys only returns enumerable properties
  25587. const keys = Object.keys(O)
  25588. for (const key of keys) {
  25589. // 1. Let typedKey be key converted to an IDL value of type K.
  25590. const typedKey = keyConverter(key)
  25591. // 2. Let value be ? Get(O, key).
  25592. // 3. Let typedValue be value converted to an IDL value of type V.
  25593. const typedValue = valueConverter(O[key])
  25594. // 4. Set result[typedKey] to typedValue.
  25595. result[typedKey] = typedValue
  25596. }
  25597. // 5. Return result.
  25598. return result
  25599. }
  25600. // 3. Let keys be ? O.[[OwnPropertyKeys]]().
  25601. const keys = Reflect.ownKeys(O)
  25602. // 4. For each key of keys.
  25603. for (const key of keys) {
  25604. // 1. Let desc be ? O.[[GetOwnProperty]](key).
  25605. const desc = Reflect.getOwnPropertyDescriptor(O, key)
  25606. // 2. If desc is not undefined and desc.[[Enumerable]] is true:
  25607. if (desc?.enumerable) {
  25608. // 1. Let typedKey be key converted to an IDL value of type K.
  25609. const typedKey = keyConverter(key)
  25610. // 2. Let value be ? Get(O, key).
  25611. // 3. Let typedValue be value converted to an IDL value of type V.
  25612. const typedValue = valueConverter(O[key])
  25613. // 4. Set result[typedKey] to typedValue.
  25614. result[typedKey] = typedValue
  25615. }
  25616. }
  25617. // 5. Return result.
  25618. return result
  25619. }
  25620. }
  25621. webidl.interfaceConverter = function (i) {
  25622. return (V, opts = {}) => {
  25623. if (opts.strict !== false && !(V instanceof i)) {
  25624. throw webidl.errors.exception({
  25625. header: i.name,
  25626. message: `Expected ${V} to be an instance of ${i.name}.`
  25627. })
  25628. }
  25629. return V
  25630. }
  25631. }
  25632. webidl.dictionaryConverter = function (converters) {
  25633. return (dictionary) => {
  25634. const type = webidl.util.Type(dictionary)
  25635. const dict = {}
  25636. if (type === 'Null' || type === 'Undefined') {
  25637. return dict
  25638. } else if (type !== 'Object') {
  25639. throw webidl.errors.exception({
  25640. header: 'Dictionary',
  25641. message: `Expected ${dictionary} to be one of: Null, Undefined, Object.`
  25642. })
  25643. }
  25644. for (const options of converters) {
  25645. const { key, defaultValue, required, converter } = options
  25646. if (required === true) {
  25647. if (!hasOwn(dictionary, key)) {
  25648. throw webidl.errors.exception({
  25649. header: 'Dictionary',
  25650. message: `Missing required key "${key}".`
  25651. })
  25652. }
  25653. }
  25654. let value = dictionary[key]
  25655. const hasDefault = hasOwn(options, 'defaultValue')
  25656. // Only use defaultValue if value is undefined and
  25657. // a defaultValue options was provided.
  25658. if (hasDefault && value !== null) {
  25659. value = value ?? defaultValue
  25660. }
  25661. // A key can be optional and have no default value.
  25662. // When this happens, do not perform a conversion,
  25663. // and do not assign the key a value.
  25664. if (required || hasDefault || value !== undefined) {
  25665. value = converter(value)
  25666. if (
  25667. options.allowedValues &&
  25668. !options.allowedValues.includes(value)
  25669. ) {
  25670. throw webidl.errors.exception({
  25671. header: 'Dictionary',
  25672. message: `${value} is not an accepted type. Expected one of ${options.allowedValues.join(', ')}.`
  25673. })
  25674. }
  25675. dict[key] = value
  25676. }
  25677. }
  25678. return dict
  25679. }
  25680. }
  25681. webidl.nullableConverter = function (converter) {
  25682. return (V) => {
  25683. if (V === null) {
  25684. return V
  25685. }
  25686. return converter(V)
  25687. }
  25688. }
  25689. // https://webidl.spec.whatwg.org/#es-DOMString
  25690. webidl.converters.DOMString = function (V, opts = {}) {
  25691. // 1. If V is null and the conversion is to an IDL type
  25692. // associated with the [LegacyNullToEmptyString]
  25693. // extended attribute, then return the DOMString value
  25694. // that represents the empty string.
  25695. if (V === null && opts.legacyNullToEmptyString) {
  25696. return ''
  25697. }
  25698. // 2. Let x be ? ToString(V).
  25699. if (typeof V === 'symbol') {
  25700. throw new TypeError('Could not convert argument of type symbol to string.')
  25701. }
  25702. // 3. Return the IDL DOMString value that represents the
  25703. // same sequence of code units as the one the
  25704. // ECMAScript String value x represents.
  25705. return String(V)
  25706. }
  25707. // https://webidl.spec.whatwg.org/#es-ByteString
  25708. webidl.converters.ByteString = function (V) {
  25709. // 1. Let x be ? ToString(V).
  25710. // Note: DOMString converter perform ? ToString(V)
  25711. const x = webidl.converters.DOMString(V)
  25712. // 2. If the value of any element of x is greater than
  25713. // 255, then throw a TypeError.
  25714. for (let index = 0; index < x.length; index++) {
  25715. if (x.charCodeAt(index) > 255) {
  25716. throw new TypeError(
  25717. 'Cannot convert argument to a ByteString because the character at ' +
  25718. `index ${index} has a value of ${x.charCodeAt(index)} which is greater than 255.`
  25719. )
  25720. }
  25721. }
  25722. // 3. Return an IDL ByteString value whose length is the
  25723. // length of x, and where the value of each element is
  25724. // the value of the corresponding element of x.
  25725. return x
  25726. }
  25727. // https://webidl.spec.whatwg.org/#es-USVString
  25728. webidl.converters.USVString = toUSVString
  25729. // https://webidl.spec.whatwg.org/#es-boolean
  25730. webidl.converters.boolean = function (V) {
  25731. // 1. Let x be the result of computing ToBoolean(V).
  25732. const x = Boolean(V)
  25733. // 2. Return the IDL boolean value that is the one that represents
  25734. // the same truth value as the ECMAScript Boolean value x.
  25735. return x
  25736. }
  25737. // https://webidl.spec.whatwg.org/#es-any
  25738. webidl.converters.any = function (V) {
  25739. return V
  25740. }
  25741. // https://webidl.spec.whatwg.org/#es-long-long
  25742. webidl.converters['long long'] = function (V) {
  25743. // 1. Let x be ? ConvertToInt(V, 64, "signed").
  25744. const x = webidl.util.ConvertToInt(V, 64, 'signed')
  25745. // 2. Return the IDL long long value that represents
  25746. // the same numeric value as x.
  25747. return x
  25748. }
  25749. // https://webidl.spec.whatwg.org/#es-unsigned-long-long
  25750. webidl.converters['unsigned long long'] = function (V) {
  25751. // 1. Let x be ? ConvertToInt(V, 64, "unsigned").
  25752. const x = webidl.util.ConvertToInt(V, 64, 'unsigned')
  25753. // 2. Return the IDL unsigned long long value that
  25754. // represents the same numeric value as x.
  25755. return x
  25756. }
  25757. // https://webidl.spec.whatwg.org/#es-unsigned-long
  25758. webidl.converters['unsigned long'] = function (V) {
  25759. // 1. Let x be ? ConvertToInt(V, 32, "unsigned").
  25760. const x = webidl.util.ConvertToInt(V, 32, 'unsigned')
  25761. // 2. Return the IDL unsigned long value that
  25762. // represents the same numeric value as x.
  25763. return x
  25764. }
  25765. // https://webidl.spec.whatwg.org/#es-unsigned-short
  25766. webidl.converters['unsigned short'] = function (V, opts) {
  25767. // 1. Let x be ? ConvertToInt(V, 16, "unsigned").
  25768. const x = webidl.util.ConvertToInt(V, 16, 'unsigned', opts)
  25769. // 2. Return the IDL unsigned short value that represents
  25770. // the same numeric value as x.
  25771. return x
  25772. }
  25773. // https://webidl.spec.whatwg.org/#idl-ArrayBuffer
  25774. webidl.converters.ArrayBuffer = function (V, opts = {}) {
  25775. // 1. If Type(V) is not Object, or V does not have an
  25776. // [[ArrayBufferData]] internal slot, then throw a
  25777. // TypeError.
  25778. // see: https://tc39.es/ecma262/#sec-properties-of-the-arraybuffer-instances
  25779. // see: https://tc39.es/ecma262/#sec-properties-of-the-sharedarraybuffer-instances
  25780. if (
  25781. webidl.util.Type(V) !== 'Object' ||
  25782. !types.isAnyArrayBuffer(V)
  25783. ) {
  25784. throw webidl.errors.conversionFailed({
  25785. prefix: `${V}`,
  25786. argument: `${V}`,
  25787. types: ['ArrayBuffer']
  25788. })
  25789. }
  25790. // 2. If the conversion is not to an IDL type associated
  25791. // with the [AllowShared] extended attribute, and
  25792. // IsSharedArrayBuffer(V) is true, then throw a
  25793. // TypeError.
  25794. if (opts.allowShared === false && types.isSharedArrayBuffer(V)) {
  25795. throw webidl.errors.exception({
  25796. header: 'ArrayBuffer',
  25797. message: 'SharedArrayBuffer is not allowed.'
  25798. })
  25799. }
  25800. // 3. If the conversion is not to an IDL type associated
  25801. // with the [AllowResizable] extended attribute, and
  25802. // IsResizableArrayBuffer(V) is true, then throw a
  25803. // TypeError.
  25804. // Note: resizable ArrayBuffers are currently a proposal.
  25805. // 4. Return the IDL ArrayBuffer value that is a
  25806. // reference to the same object as V.
  25807. return V
  25808. }
  25809. webidl.converters.TypedArray = function (V, T, opts = {}) {
  25810. // 1. Let T be the IDL type V is being converted to.
  25811. // 2. If Type(V) is not Object, or V does not have a
  25812. // [[TypedArrayName]] internal slot with a value
  25813. // equal to T’s name, then throw a TypeError.
  25814. if (
  25815. webidl.util.Type(V) !== 'Object' ||
  25816. !types.isTypedArray(V) ||
  25817. V.constructor.name !== T.name
  25818. ) {
  25819. throw webidl.errors.conversionFailed({
  25820. prefix: `${T.name}`,
  25821. argument: `${V}`,
  25822. types: [T.name]
  25823. })
  25824. }
  25825. // 3. If the conversion is not to an IDL type associated
  25826. // with the [AllowShared] extended attribute, and
  25827. // IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is
  25828. // true, then throw a TypeError.
  25829. if (opts.allowShared === false && types.isSharedArrayBuffer(V.buffer)) {
  25830. throw webidl.errors.exception({
  25831. header: 'ArrayBuffer',
  25832. message: 'SharedArrayBuffer is not allowed.'
  25833. })
  25834. }
  25835. // 4. If the conversion is not to an IDL type associated
  25836. // with the [AllowResizable] extended attribute, and
  25837. // IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is
  25838. // true, then throw a TypeError.
  25839. // Note: resizable array buffers are currently a proposal
  25840. // 5. Return the IDL value of type T that is a reference
  25841. // to the same object as V.
  25842. return V
  25843. }
  25844. webidl.converters.DataView = function (V, opts = {}) {
  25845. // 1. If Type(V) is not Object, or V does not have a
  25846. // [[DataView]] internal slot, then throw a TypeError.
  25847. if (webidl.util.Type(V) !== 'Object' || !types.isDataView(V)) {
  25848. throw webidl.errors.exception({
  25849. header: 'DataView',
  25850. message: 'Object is not a DataView.'
  25851. })
  25852. }
  25853. // 2. If the conversion is not to an IDL type associated
  25854. // with the [AllowShared] extended attribute, and
  25855. // IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is true,
  25856. // then throw a TypeError.
  25857. if (opts.allowShared === false && types.isSharedArrayBuffer(V.buffer)) {
  25858. throw webidl.errors.exception({
  25859. header: 'ArrayBuffer',
  25860. message: 'SharedArrayBuffer is not allowed.'
  25861. })
  25862. }
  25863. // 3. If the conversion is not to an IDL type associated
  25864. // with the [AllowResizable] extended attribute, and
  25865. // IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is
  25866. // true, then throw a TypeError.
  25867. // Note: resizable ArrayBuffers are currently a proposal
  25868. // 4. Return the IDL DataView value that is a reference
  25869. // to the same object as V.
  25870. return V
  25871. }
  25872. // https://webidl.spec.whatwg.org/#BufferSource
  25873. webidl.converters.BufferSource = function (V, opts = {}) {
  25874. if (types.isAnyArrayBuffer(V)) {
  25875. return webidl.converters.ArrayBuffer(V, opts)
  25876. }
  25877. if (types.isTypedArray(V)) {
  25878. return webidl.converters.TypedArray(V, V.constructor)
  25879. }
  25880. if (types.isDataView(V)) {
  25881. return webidl.converters.DataView(V, opts)
  25882. }
  25883. throw new TypeError(`Could not convert ${V} to a BufferSource.`)
  25884. }
  25885. webidl.converters['sequence<ByteString>'] = webidl.sequenceConverter(
  25886. webidl.converters.ByteString
  25887. )
  25888. webidl.converters['sequence<sequence<ByteString>>'] = webidl.sequenceConverter(
  25889. webidl.converters['sequence<ByteString>']
  25890. )
  25891. webidl.converters['record<ByteString, ByteString>'] = webidl.recordConverter(
  25892. webidl.converters.ByteString,
  25893. webidl.converters.ByteString
  25894. )
  25895. module.exports = {
  25896. webidl
  25897. }
  25898. /***/ }),
  25899. /***/ 4854:
  25900. /***/ ((module) => {
  25901. "use strict";
  25902. /**
  25903. * @see https://encoding.spec.whatwg.org/#concept-encoding-get
  25904. * @param {string|undefined} label
  25905. */
  25906. function getEncoding (label) {
  25907. if (!label) {
  25908. return 'failure'
  25909. }
  25910. // 1. Remove any leading and trailing ASCII whitespace from label.
  25911. // 2. If label is an ASCII case-insensitive match for any of the
  25912. // labels listed in the table below, then return the
  25913. // corresponding encoding; otherwise return failure.
  25914. switch (label.trim().toLowerCase()) {
  25915. case 'unicode-1-1-utf-8':
  25916. case 'unicode11utf8':
  25917. case 'unicode20utf8':
  25918. case 'utf-8':
  25919. case 'utf8':
  25920. case 'x-unicode20utf8':
  25921. return 'UTF-8'
  25922. case '866':
  25923. case 'cp866':
  25924. case 'csibm866':
  25925. case 'ibm866':
  25926. return 'IBM866'
  25927. case 'csisolatin2':
  25928. case 'iso-8859-2':
  25929. case 'iso-ir-101':
  25930. case 'iso8859-2':
  25931. case 'iso88592':
  25932. case 'iso_8859-2':
  25933. case 'iso_8859-2:1987':
  25934. case 'l2':
  25935. case 'latin2':
  25936. return 'ISO-8859-2'
  25937. case 'csisolatin3':
  25938. case 'iso-8859-3':
  25939. case 'iso-ir-109':
  25940. case 'iso8859-3':
  25941. case 'iso88593':
  25942. case 'iso_8859-3':
  25943. case 'iso_8859-3:1988':
  25944. case 'l3':
  25945. case 'latin3':
  25946. return 'ISO-8859-3'
  25947. case 'csisolatin4':
  25948. case 'iso-8859-4':
  25949. case 'iso-ir-110':
  25950. case 'iso8859-4':
  25951. case 'iso88594':
  25952. case 'iso_8859-4':
  25953. case 'iso_8859-4:1988':
  25954. case 'l4':
  25955. case 'latin4':
  25956. return 'ISO-8859-4'
  25957. case 'csisolatincyrillic':
  25958. case 'cyrillic':
  25959. case 'iso-8859-5':
  25960. case 'iso-ir-144':
  25961. case 'iso8859-5':
  25962. case 'iso88595':
  25963. case 'iso_8859-5':
  25964. case 'iso_8859-5:1988':
  25965. return 'ISO-8859-5'
  25966. case 'arabic':
  25967. case 'asmo-708':
  25968. case 'csiso88596e':
  25969. case 'csiso88596i':
  25970. case 'csisolatinarabic':
  25971. case 'ecma-114':
  25972. case 'iso-8859-6':
  25973. case 'iso-8859-6-e':
  25974. case 'iso-8859-6-i':
  25975. case 'iso-ir-127':
  25976. case 'iso8859-6':
  25977. case 'iso88596':
  25978. case 'iso_8859-6':
  25979. case 'iso_8859-6:1987':
  25980. return 'ISO-8859-6'
  25981. case 'csisolatingreek':
  25982. case 'ecma-118':
  25983. case 'elot_928':
  25984. case 'greek':
  25985. case 'greek8':
  25986. case 'iso-8859-7':
  25987. case 'iso-ir-126':
  25988. case 'iso8859-7':
  25989. case 'iso88597':
  25990. case 'iso_8859-7':
  25991. case 'iso_8859-7:1987':
  25992. case 'sun_eu_greek':
  25993. return 'ISO-8859-7'
  25994. case 'csiso88598e':
  25995. case 'csisolatinhebrew':
  25996. case 'hebrew':
  25997. case 'iso-8859-8':
  25998. case 'iso-8859-8-e':
  25999. case 'iso-ir-138':
  26000. case 'iso8859-8':
  26001. case 'iso88598':
  26002. case 'iso_8859-8':
  26003. case 'iso_8859-8:1988':
  26004. case 'visual':
  26005. return 'ISO-8859-8'
  26006. case 'csiso88598i':
  26007. case 'iso-8859-8-i':
  26008. case 'logical':
  26009. return 'ISO-8859-8-I'
  26010. case 'csisolatin6':
  26011. case 'iso-8859-10':
  26012. case 'iso-ir-157':
  26013. case 'iso8859-10':
  26014. case 'iso885910':
  26015. case 'l6':
  26016. case 'latin6':
  26017. return 'ISO-8859-10'
  26018. case 'iso-8859-13':
  26019. case 'iso8859-13':
  26020. case 'iso885913':
  26021. return 'ISO-8859-13'
  26022. case 'iso-8859-14':
  26023. case 'iso8859-14':
  26024. case 'iso885914':
  26025. return 'ISO-8859-14'
  26026. case 'csisolatin9':
  26027. case 'iso-8859-15':
  26028. case 'iso8859-15':
  26029. case 'iso885915':
  26030. case 'iso_8859-15':
  26031. case 'l9':
  26032. return 'ISO-8859-15'
  26033. case 'iso-8859-16':
  26034. return 'ISO-8859-16'
  26035. case 'cskoi8r':
  26036. case 'koi':
  26037. case 'koi8':
  26038. case 'koi8-r':
  26039. case 'koi8_r':
  26040. return 'KOI8-R'
  26041. case 'koi8-ru':
  26042. case 'koi8-u':
  26043. return 'KOI8-U'
  26044. case 'csmacintosh':
  26045. case 'mac':
  26046. case 'macintosh':
  26047. case 'x-mac-roman':
  26048. return 'macintosh'
  26049. case 'iso-8859-11':
  26050. case 'iso8859-11':
  26051. case 'iso885911':
  26052. case 'tis-620':
  26053. case 'windows-874':
  26054. return 'windows-874'
  26055. case 'cp1250':
  26056. case 'windows-1250':
  26057. case 'x-cp1250':
  26058. return 'windows-1250'
  26059. case 'cp1251':
  26060. case 'windows-1251':
  26061. case 'x-cp1251':
  26062. return 'windows-1251'
  26063. case 'ansi_x3.4-1968':
  26064. case 'ascii':
  26065. case 'cp1252':
  26066. case 'cp819':
  26067. case 'csisolatin1':
  26068. case 'ibm819':
  26069. case 'iso-8859-1':
  26070. case 'iso-ir-100':
  26071. case 'iso8859-1':
  26072. case 'iso88591':
  26073. case 'iso_8859-1':
  26074. case 'iso_8859-1:1987':
  26075. case 'l1':
  26076. case 'latin1':
  26077. case 'us-ascii':
  26078. case 'windows-1252':
  26079. case 'x-cp1252':
  26080. return 'windows-1252'
  26081. case 'cp1253':
  26082. case 'windows-1253':
  26083. case 'x-cp1253':
  26084. return 'windows-1253'
  26085. case 'cp1254':
  26086. case 'csisolatin5':
  26087. case 'iso-8859-9':
  26088. case 'iso-ir-148':
  26089. case 'iso8859-9':
  26090. case 'iso88599':
  26091. case 'iso_8859-9':
  26092. case 'iso_8859-9:1989':
  26093. case 'l5':
  26094. case 'latin5':
  26095. case 'windows-1254':
  26096. case 'x-cp1254':
  26097. return 'windows-1254'
  26098. case 'cp1255':
  26099. case 'windows-1255':
  26100. case 'x-cp1255':
  26101. return 'windows-1255'
  26102. case 'cp1256':
  26103. case 'windows-1256':
  26104. case 'x-cp1256':
  26105. return 'windows-1256'
  26106. case 'cp1257':
  26107. case 'windows-1257':
  26108. case 'x-cp1257':
  26109. return 'windows-1257'
  26110. case 'cp1258':
  26111. case 'windows-1258':
  26112. case 'x-cp1258':
  26113. return 'windows-1258'
  26114. case 'x-mac-cyrillic':
  26115. case 'x-mac-ukrainian':
  26116. return 'x-mac-cyrillic'
  26117. case 'chinese':
  26118. case 'csgb2312':
  26119. case 'csiso58gb231280':
  26120. case 'gb2312':
  26121. case 'gb_2312':
  26122. case 'gb_2312-80':
  26123. case 'gbk':
  26124. case 'iso-ir-58':
  26125. case 'x-gbk':
  26126. return 'GBK'
  26127. case 'gb18030':
  26128. return 'gb18030'
  26129. case 'big5':
  26130. case 'big5-hkscs':
  26131. case 'cn-big5':
  26132. case 'csbig5':
  26133. case 'x-x-big5':
  26134. return 'Big5'
  26135. case 'cseucpkdfmtjapanese':
  26136. case 'euc-jp':
  26137. case 'x-euc-jp':
  26138. return 'EUC-JP'
  26139. case 'csiso2022jp':
  26140. case 'iso-2022-jp':
  26141. return 'ISO-2022-JP'
  26142. case 'csshiftjis':
  26143. case 'ms932':
  26144. case 'ms_kanji':
  26145. case 'shift-jis':
  26146. case 'shift_jis':
  26147. case 'sjis':
  26148. case 'windows-31j':
  26149. case 'x-sjis':
  26150. return 'Shift_JIS'
  26151. case 'cseuckr':
  26152. case 'csksc56011987':
  26153. case 'euc-kr':
  26154. case 'iso-ir-149':
  26155. case 'korean':
  26156. case 'ks_c_5601-1987':
  26157. case 'ks_c_5601-1989':
  26158. case 'ksc5601':
  26159. case 'ksc_5601':
  26160. case 'windows-949':
  26161. return 'EUC-KR'
  26162. case 'csiso2022kr':
  26163. case 'hz-gb-2312':
  26164. case 'iso-2022-cn':
  26165. case 'iso-2022-cn-ext':
  26166. case 'iso-2022-kr':
  26167. case 'replacement':
  26168. return 'replacement'
  26169. case 'unicodefffe':
  26170. case 'utf-16be':
  26171. return 'UTF-16BE'
  26172. case 'csunicode':
  26173. case 'iso-10646-ucs-2':
  26174. case 'ucs-2':
  26175. case 'unicode':
  26176. case 'unicodefeff':
  26177. case 'utf-16':
  26178. case 'utf-16le':
  26179. return 'UTF-16LE'
  26180. case 'x-user-defined':
  26181. return 'x-user-defined'
  26182. default: return 'failure'
  26183. }
  26184. }
  26185. module.exports = {
  26186. getEncoding
  26187. }
  26188. /***/ }),
  26189. /***/ 1446:
  26190. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  26191. "use strict";
  26192. const {
  26193. staticPropertyDescriptors,
  26194. readOperation,
  26195. fireAProgressEvent
  26196. } = __nccwpck_require__(7530)
  26197. const {
  26198. kState,
  26199. kError,
  26200. kResult,
  26201. kEvents,
  26202. kAborted
  26203. } = __nccwpck_require__(9054)
  26204. const { webidl } = __nccwpck_require__(1744)
  26205. const { kEnumerableProperty } = __nccwpck_require__(3983)
  26206. class FileReader extends EventTarget {
  26207. constructor () {
  26208. super()
  26209. this[kState] = 'empty'
  26210. this[kResult] = null
  26211. this[kError] = null
  26212. this[kEvents] = {
  26213. loadend: null,
  26214. error: null,
  26215. abort: null,
  26216. load: null,
  26217. progress: null,
  26218. loadstart: null
  26219. }
  26220. }
  26221. /**
  26222. * @see https://w3c.github.io/FileAPI/#dfn-readAsArrayBuffer
  26223. * @param {import('buffer').Blob} blob
  26224. */
  26225. readAsArrayBuffer (blob) {
  26226. webidl.brandCheck(this, FileReader)
  26227. webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsArrayBuffer' })
  26228. blob = webidl.converters.Blob(blob, { strict: false })
  26229. // The readAsArrayBuffer(blob) method, when invoked,
  26230. // must initiate a read operation for blob with ArrayBuffer.
  26231. readOperation(this, blob, 'ArrayBuffer')
  26232. }
  26233. /**
  26234. * @see https://w3c.github.io/FileAPI/#readAsBinaryString
  26235. * @param {import('buffer').Blob} blob
  26236. */
  26237. readAsBinaryString (blob) {
  26238. webidl.brandCheck(this, FileReader)
  26239. webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsBinaryString' })
  26240. blob = webidl.converters.Blob(blob, { strict: false })
  26241. // The readAsBinaryString(blob) method, when invoked,
  26242. // must initiate a read operation for blob with BinaryString.
  26243. readOperation(this, blob, 'BinaryString')
  26244. }
  26245. /**
  26246. * @see https://w3c.github.io/FileAPI/#readAsDataText
  26247. * @param {import('buffer').Blob} blob
  26248. * @param {string?} encoding
  26249. */
  26250. readAsText (blob, encoding = undefined) {
  26251. webidl.brandCheck(this, FileReader)
  26252. webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsText' })
  26253. blob = webidl.converters.Blob(blob, { strict: false })
  26254. if (encoding !== undefined) {
  26255. encoding = webidl.converters.DOMString(encoding)
  26256. }
  26257. // The readAsText(blob, encoding) method, when invoked,
  26258. // must initiate a read operation for blob with Text and encoding.
  26259. readOperation(this, blob, 'Text', encoding)
  26260. }
  26261. /**
  26262. * @see https://w3c.github.io/FileAPI/#dfn-readAsDataURL
  26263. * @param {import('buffer').Blob} blob
  26264. */
  26265. readAsDataURL (blob) {
  26266. webidl.brandCheck(this, FileReader)
  26267. webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsDataURL' })
  26268. blob = webidl.converters.Blob(blob, { strict: false })
  26269. // The readAsDataURL(blob) method, when invoked, must
  26270. // initiate a read operation for blob with DataURL.
  26271. readOperation(this, blob, 'DataURL')
  26272. }
  26273. /**
  26274. * @see https://w3c.github.io/FileAPI/#dfn-abort
  26275. */
  26276. abort () {
  26277. // 1. If this's state is "empty" or if this's state is
  26278. // "done" set this's result to null and terminate
  26279. // this algorithm.
  26280. if (this[kState] === 'empty' || this[kState] === 'done') {
  26281. this[kResult] = null
  26282. return
  26283. }
  26284. // 2. If this's state is "loading" set this's state to
  26285. // "done" and set this's result to null.
  26286. if (this[kState] === 'loading') {
  26287. this[kState] = 'done'
  26288. this[kResult] = null
  26289. }
  26290. // 3. If there are any tasks from this on the file reading
  26291. // task source in an affiliated task queue, then remove
  26292. // those tasks from that task queue.
  26293. this[kAborted] = true
  26294. // 4. Terminate the algorithm for the read method being processed.
  26295. // TODO
  26296. // 5. Fire a progress event called abort at this.
  26297. fireAProgressEvent('abort', this)
  26298. // 6. If this's state is not "loading", fire a progress
  26299. // event called loadend at this.
  26300. if (this[kState] !== 'loading') {
  26301. fireAProgressEvent('loadend', this)
  26302. }
  26303. }
  26304. /**
  26305. * @see https://w3c.github.io/FileAPI/#dom-filereader-readystate
  26306. */
  26307. get readyState () {
  26308. webidl.brandCheck(this, FileReader)
  26309. switch (this[kState]) {
  26310. case 'empty': return this.EMPTY
  26311. case 'loading': return this.LOADING
  26312. case 'done': return this.DONE
  26313. }
  26314. }
  26315. /**
  26316. * @see https://w3c.github.io/FileAPI/#dom-filereader-result
  26317. */
  26318. get result () {
  26319. webidl.brandCheck(this, FileReader)
  26320. // The result attribute’s getter, when invoked, must return
  26321. // this's result.
  26322. return this[kResult]
  26323. }
  26324. /**
  26325. * @see https://w3c.github.io/FileAPI/#dom-filereader-error
  26326. */
  26327. get error () {
  26328. webidl.brandCheck(this, FileReader)
  26329. // The error attribute’s getter, when invoked, must return
  26330. // this's error.
  26331. return this[kError]
  26332. }
  26333. get onloadend () {
  26334. webidl.brandCheck(this, FileReader)
  26335. return this[kEvents].loadend
  26336. }
  26337. set onloadend (fn) {
  26338. webidl.brandCheck(this, FileReader)
  26339. if (this[kEvents].loadend) {
  26340. this.removeEventListener('loadend', this[kEvents].loadend)
  26341. }
  26342. if (typeof fn === 'function') {
  26343. this[kEvents].loadend = fn
  26344. this.addEventListener('loadend', fn)
  26345. } else {
  26346. this[kEvents].loadend = null
  26347. }
  26348. }
  26349. get onerror () {
  26350. webidl.brandCheck(this, FileReader)
  26351. return this[kEvents].error
  26352. }
  26353. set onerror (fn) {
  26354. webidl.brandCheck(this, FileReader)
  26355. if (this[kEvents].error) {
  26356. this.removeEventListener('error', this[kEvents].error)
  26357. }
  26358. if (typeof fn === 'function') {
  26359. this[kEvents].error = fn
  26360. this.addEventListener('error', fn)
  26361. } else {
  26362. this[kEvents].error = null
  26363. }
  26364. }
  26365. get onloadstart () {
  26366. webidl.brandCheck(this, FileReader)
  26367. return this[kEvents].loadstart
  26368. }
  26369. set onloadstart (fn) {
  26370. webidl.brandCheck(this, FileReader)
  26371. if (this[kEvents].loadstart) {
  26372. this.removeEventListener('loadstart', this[kEvents].loadstart)
  26373. }
  26374. if (typeof fn === 'function') {
  26375. this[kEvents].loadstart = fn
  26376. this.addEventListener('loadstart', fn)
  26377. } else {
  26378. this[kEvents].loadstart = null
  26379. }
  26380. }
  26381. get onprogress () {
  26382. webidl.brandCheck(this, FileReader)
  26383. return this[kEvents].progress
  26384. }
  26385. set onprogress (fn) {
  26386. webidl.brandCheck(this, FileReader)
  26387. if (this[kEvents].progress) {
  26388. this.removeEventListener('progress', this[kEvents].progress)
  26389. }
  26390. if (typeof fn === 'function') {
  26391. this[kEvents].progress = fn
  26392. this.addEventListener('progress', fn)
  26393. } else {
  26394. this[kEvents].progress = null
  26395. }
  26396. }
  26397. get onload () {
  26398. webidl.brandCheck(this, FileReader)
  26399. return this[kEvents].load
  26400. }
  26401. set onload (fn) {
  26402. webidl.brandCheck(this, FileReader)
  26403. if (this[kEvents].load) {
  26404. this.removeEventListener('load', this[kEvents].load)
  26405. }
  26406. if (typeof fn === 'function') {
  26407. this[kEvents].load = fn
  26408. this.addEventListener('load', fn)
  26409. } else {
  26410. this[kEvents].load = null
  26411. }
  26412. }
  26413. get onabort () {
  26414. webidl.brandCheck(this, FileReader)
  26415. return this[kEvents].abort
  26416. }
  26417. set onabort (fn) {
  26418. webidl.brandCheck(this, FileReader)
  26419. if (this[kEvents].abort) {
  26420. this.removeEventListener('abort', this[kEvents].abort)
  26421. }
  26422. if (typeof fn === 'function') {
  26423. this[kEvents].abort = fn
  26424. this.addEventListener('abort', fn)
  26425. } else {
  26426. this[kEvents].abort = null
  26427. }
  26428. }
  26429. }
  26430. // https://w3c.github.io/FileAPI/#dom-filereader-empty
  26431. FileReader.EMPTY = FileReader.prototype.EMPTY = 0
  26432. // https://w3c.github.io/FileAPI/#dom-filereader-loading
  26433. FileReader.LOADING = FileReader.prototype.LOADING = 1
  26434. // https://w3c.github.io/FileAPI/#dom-filereader-done
  26435. FileReader.DONE = FileReader.prototype.DONE = 2
  26436. Object.defineProperties(FileReader.prototype, {
  26437. EMPTY: staticPropertyDescriptors,
  26438. LOADING: staticPropertyDescriptors,
  26439. DONE: staticPropertyDescriptors,
  26440. readAsArrayBuffer: kEnumerableProperty,
  26441. readAsBinaryString: kEnumerableProperty,
  26442. readAsText: kEnumerableProperty,
  26443. readAsDataURL: kEnumerableProperty,
  26444. abort: kEnumerableProperty,
  26445. readyState: kEnumerableProperty,
  26446. result: kEnumerableProperty,
  26447. error: kEnumerableProperty,
  26448. onloadstart: kEnumerableProperty,
  26449. onprogress: kEnumerableProperty,
  26450. onload: kEnumerableProperty,
  26451. onabort: kEnumerableProperty,
  26452. onerror: kEnumerableProperty,
  26453. onloadend: kEnumerableProperty,
  26454. [Symbol.toStringTag]: {
  26455. value: 'FileReader',
  26456. writable: false,
  26457. enumerable: false,
  26458. configurable: true
  26459. }
  26460. })
  26461. Object.defineProperties(FileReader, {
  26462. EMPTY: staticPropertyDescriptors,
  26463. LOADING: staticPropertyDescriptors,
  26464. DONE: staticPropertyDescriptors
  26465. })
  26466. module.exports = {
  26467. FileReader
  26468. }
  26469. /***/ }),
  26470. /***/ 5504:
  26471. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  26472. "use strict";
  26473. const { webidl } = __nccwpck_require__(1744)
  26474. const kState = Symbol('ProgressEvent state')
  26475. /**
  26476. * @see https://xhr.spec.whatwg.org/#progressevent
  26477. */
  26478. class ProgressEvent extends Event {
  26479. constructor (type, eventInitDict = {}) {
  26480. type = webidl.converters.DOMString(type)
  26481. eventInitDict = webidl.converters.ProgressEventInit(eventInitDict ?? {})
  26482. super(type, eventInitDict)
  26483. this[kState] = {
  26484. lengthComputable: eventInitDict.lengthComputable,
  26485. loaded: eventInitDict.loaded,
  26486. total: eventInitDict.total
  26487. }
  26488. }
  26489. get lengthComputable () {
  26490. webidl.brandCheck(this, ProgressEvent)
  26491. return this[kState].lengthComputable
  26492. }
  26493. get loaded () {
  26494. webidl.brandCheck(this, ProgressEvent)
  26495. return this[kState].loaded
  26496. }
  26497. get total () {
  26498. webidl.brandCheck(this, ProgressEvent)
  26499. return this[kState].total
  26500. }
  26501. }
  26502. webidl.converters.ProgressEventInit = webidl.dictionaryConverter([
  26503. {
  26504. key: 'lengthComputable',
  26505. converter: webidl.converters.boolean,
  26506. defaultValue: false
  26507. },
  26508. {
  26509. key: 'loaded',
  26510. converter: webidl.converters['unsigned long long'],
  26511. defaultValue: 0
  26512. },
  26513. {
  26514. key: 'total',
  26515. converter: webidl.converters['unsigned long long'],
  26516. defaultValue: 0
  26517. },
  26518. {
  26519. key: 'bubbles',
  26520. converter: webidl.converters.boolean,
  26521. defaultValue: false
  26522. },
  26523. {
  26524. key: 'cancelable',
  26525. converter: webidl.converters.boolean,
  26526. defaultValue: false
  26527. },
  26528. {
  26529. key: 'composed',
  26530. converter: webidl.converters.boolean,
  26531. defaultValue: false
  26532. }
  26533. ])
  26534. module.exports = {
  26535. ProgressEvent
  26536. }
  26537. /***/ }),
  26538. /***/ 9054:
  26539. /***/ ((module) => {
  26540. "use strict";
  26541. module.exports = {
  26542. kState: Symbol('FileReader state'),
  26543. kResult: Symbol('FileReader result'),
  26544. kError: Symbol('FileReader error'),
  26545. kLastProgressEventFired: Symbol('FileReader last progress event fired timestamp'),
  26546. kEvents: Symbol('FileReader events'),
  26547. kAborted: Symbol('FileReader aborted')
  26548. }
  26549. /***/ }),
  26550. /***/ 7530:
  26551. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  26552. "use strict";
  26553. const {
  26554. kState,
  26555. kError,
  26556. kResult,
  26557. kAborted,
  26558. kLastProgressEventFired
  26559. } = __nccwpck_require__(9054)
  26560. const { ProgressEvent } = __nccwpck_require__(5504)
  26561. const { getEncoding } = __nccwpck_require__(4854)
  26562. const { DOMException } = __nccwpck_require__(1037)
  26563. const { serializeAMimeType, parseMIMEType } = __nccwpck_require__(685)
  26564. const { types } = __nccwpck_require__(3837)
  26565. const { StringDecoder } = __nccwpck_require__(1576)
  26566. const { btoa } = __nccwpck_require__(4300)
  26567. /** @type {PropertyDescriptor} */
  26568. const staticPropertyDescriptors = {
  26569. enumerable: true,
  26570. writable: false,
  26571. configurable: false
  26572. }
  26573. /**
  26574. * @see https://w3c.github.io/FileAPI/#readOperation
  26575. * @param {import('./filereader').FileReader} fr
  26576. * @param {import('buffer').Blob} blob
  26577. * @param {string} type
  26578. * @param {string?} encodingName
  26579. */
  26580. function readOperation (fr, blob, type, encodingName) {
  26581. // 1. If fr’s state is "loading", throw an InvalidStateError
  26582. // DOMException.
  26583. if (fr[kState] === 'loading') {
  26584. throw new DOMException('Invalid state', 'InvalidStateError')
  26585. }
  26586. // 2. Set fr’s state to "loading".
  26587. fr[kState] = 'loading'
  26588. // 3. Set fr’s result to null.
  26589. fr[kResult] = null
  26590. // 4. Set fr’s error to null.
  26591. fr[kError] = null
  26592. // 5. Let stream be the result of calling get stream on blob.
  26593. /** @type {import('stream/web').ReadableStream} */
  26594. const stream = blob.stream()
  26595. // 6. Let reader be the result of getting a reader from stream.
  26596. const reader = stream.getReader()
  26597. // 7. Let bytes be an empty byte sequence.
  26598. /** @type {Uint8Array[]} */
  26599. const bytes = []
  26600. // 8. Let chunkPromise be the result of reading a chunk from
  26601. // stream with reader.
  26602. let chunkPromise = reader.read()
  26603. // 9. Let isFirstChunk be true.
  26604. let isFirstChunk = true
  26605. // 10. In parallel, while true:
  26606. // Note: "In parallel" just means non-blocking
  26607. // Note 2: readOperation itself cannot be async as double
  26608. // reading the body would then reject the promise, instead
  26609. // of throwing an error.
  26610. ;(async () => {
  26611. while (!fr[kAborted]) {
  26612. // 1. Wait for chunkPromise to be fulfilled or rejected.
  26613. try {
  26614. const { done, value } = await chunkPromise
  26615. // 2. If chunkPromise is fulfilled, and isFirstChunk is
  26616. // true, queue a task to fire a progress event called
  26617. // loadstart at fr.
  26618. if (isFirstChunk && !fr[kAborted]) {
  26619. queueMicrotask(() => {
  26620. fireAProgressEvent('loadstart', fr)
  26621. })
  26622. }
  26623. // 3. Set isFirstChunk to false.
  26624. isFirstChunk = false
  26625. // 4. If chunkPromise is fulfilled with an object whose
  26626. // done property is false and whose value property is
  26627. // a Uint8Array object, run these steps:
  26628. if (!done && types.isUint8Array(value)) {
  26629. // 1. Let bs be the byte sequence represented by the
  26630. // Uint8Array object.
  26631. // 2. Append bs to bytes.
  26632. bytes.push(value)
  26633. // 3. If roughly 50ms have passed since these steps
  26634. // were last invoked, queue a task to fire a
  26635. // progress event called progress at fr.
  26636. if (
  26637. (
  26638. fr[kLastProgressEventFired] === undefined ||
  26639. Date.now() - fr[kLastProgressEventFired] >= 50
  26640. ) &&
  26641. !fr[kAborted]
  26642. ) {
  26643. fr[kLastProgressEventFired] = Date.now()
  26644. queueMicrotask(() => {
  26645. fireAProgressEvent('progress', fr)
  26646. })
  26647. }
  26648. // 4. Set chunkPromise to the result of reading a
  26649. // chunk from stream with reader.
  26650. chunkPromise = reader.read()
  26651. } else if (done) {
  26652. // 5. Otherwise, if chunkPromise is fulfilled with an
  26653. // object whose done property is true, queue a task
  26654. // to run the following steps and abort this algorithm:
  26655. queueMicrotask(() => {
  26656. // 1. Set fr’s state to "done".
  26657. fr[kState] = 'done'
  26658. // 2. Let result be the result of package data given
  26659. // bytes, type, blob’s type, and encodingName.
  26660. try {
  26661. const result = packageData(bytes, type, blob.type, encodingName)
  26662. // 4. Else:
  26663. if (fr[kAborted]) {
  26664. return
  26665. }
  26666. // 1. Set fr’s result to result.
  26667. fr[kResult] = result
  26668. // 2. Fire a progress event called load at the fr.
  26669. fireAProgressEvent('load', fr)
  26670. } catch (error) {
  26671. // 3. If package data threw an exception error:
  26672. // 1. Set fr’s error to error.
  26673. fr[kError] = error
  26674. // 2. Fire a progress event called error at fr.
  26675. fireAProgressEvent('error', fr)
  26676. }
  26677. // 5. If fr’s state is not "loading", fire a progress
  26678. // event called loadend at the fr.
  26679. if (fr[kState] !== 'loading') {
  26680. fireAProgressEvent('loadend', fr)
  26681. }
  26682. })
  26683. break
  26684. }
  26685. } catch (error) {
  26686. if (fr[kAborted]) {
  26687. return
  26688. }
  26689. // 6. Otherwise, if chunkPromise is rejected with an
  26690. // error error, queue a task to run the following
  26691. // steps and abort this algorithm:
  26692. queueMicrotask(() => {
  26693. // 1. Set fr’s state to "done".
  26694. fr[kState] = 'done'
  26695. // 2. Set fr’s error to error.
  26696. fr[kError] = error
  26697. // 3. Fire a progress event called error at fr.
  26698. fireAProgressEvent('error', fr)
  26699. // 4. If fr’s state is not "loading", fire a progress
  26700. // event called loadend at fr.
  26701. if (fr[kState] !== 'loading') {
  26702. fireAProgressEvent('loadend', fr)
  26703. }
  26704. })
  26705. break
  26706. }
  26707. }
  26708. })()
  26709. }
  26710. /**
  26711. * @see https://w3c.github.io/FileAPI/#fire-a-progress-event
  26712. * @see https://dom.spec.whatwg.org/#concept-event-fire
  26713. * @param {string} e The name of the event
  26714. * @param {import('./filereader').FileReader} reader
  26715. */
  26716. function fireAProgressEvent (e, reader) {
  26717. // The progress event e does not bubble. e.bubbles must be false
  26718. // The progress event e is NOT cancelable. e.cancelable must be false
  26719. const event = new ProgressEvent(e, {
  26720. bubbles: false,
  26721. cancelable: false
  26722. })
  26723. reader.dispatchEvent(event)
  26724. }
  26725. /**
  26726. * @see https://w3c.github.io/FileAPI/#blob-package-data
  26727. * @param {Uint8Array[]} bytes
  26728. * @param {string} type
  26729. * @param {string?} mimeType
  26730. * @param {string?} encodingName
  26731. */
  26732. function packageData (bytes, type, mimeType, encodingName) {
  26733. // 1. A Blob has an associated package data algorithm, given
  26734. // bytes, a type, a optional mimeType, and a optional
  26735. // encodingName, which switches on type and runs the
  26736. // associated steps:
  26737. switch (type) {
  26738. case 'DataURL': {
  26739. // 1. Return bytes as a DataURL [RFC2397] subject to
  26740. // the considerations below:
  26741. // * Use mimeType as part of the Data URL if it is
  26742. // available in keeping with the Data URL
  26743. // specification [RFC2397].
  26744. // * If mimeType is not available return a Data URL
  26745. // without a media-type. [RFC2397].
  26746. // https://datatracker.ietf.org/doc/html/rfc2397#section-3
  26747. // dataurl := "data:" [ mediatype ] [ ";base64" ] "," data
  26748. // mediatype := [ type "/" subtype ] *( ";" parameter )
  26749. // data := *urlchar
  26750. // parameter := attribute "=" value
  26751. let dataURL = 'data:'
  26752. const parsed = parseMIMEType(mimeType || 'application/octet-stream')
  26753. if (parsed !== 'failure') {
  26754. dataURL += serializeAMimeType(parsed)
  26755. }
  26756. dataURL += ';base64,'
  26757. const decoder = new StringDecoder('latin1')
  26758. for (const chunk of bytes) {
  26759. dataURL += btoa(decoder.write(chunk))
  26760. }
  26761. dataURL += btoa(decoder.end())
  26762. return dataURL
  26763. }
  26764. case 'Text': {
  26765. // 1. Let encoding be failure
  26766. let encoding = 'failure'
  26767. // 2. If the encodingName is present, set encoding to the
  26768. // result of getting an encoding from encodingName.
  26769. if (encodingName) {
  26770. encoding = getEncoding(encodingName)
  26771. }
  26772. // 3. If encoding is failure, and mimeType is present:
  26773. if (encoding === 'failure' && mimeType) {
  26774. // 1. Let type be the result of parse a MIME type
  26775. // given mimeType.
  26776. const type = parseMIMEType(mimeType)
  26777. // 2. If type is not failure, set encoding to the result
  26778. // of getting an encoding from type’s parameters["charset"].
  26779. if (type !== 'failure') {
  26780. encoding = getEncoding(type.parameters.get('charset'))
  26781. }
  26782. }
  26783. // 4. If encoding is failure, then set encoding to UTF-8.
  26784. if (encoding === 'failure') {
  26785. encoding = 'UTF-8'
  26786. }
  26787. // 5. Decode bytes using fallback encoding encoding, and
  26788. // return the result.
  26789. return decode(bytes, encoding)
  26790. }
  26791. case 'ArrayBuffer': {
  26792. // Return a new ArrayBuffer whose contents are bytes.
  26793. const sequence = combineByteSequences(bytes)
  26794. return sequence.buffer
  26795. }
  26796. case 'BinaryString': {
  26797. // Return bytes as a binary string, in which every byte
  26798. // is represented by a code unit of equal value [0..255].
  26799. let binaryString = ''
  26800. const decoder = new StringDecoder('latin1')
  26801. for (const chunk of bytes) {
  26802. binaryString += decoder.write(chunk)
  26803. }
  26804. binaryString += decoder.end()
  26805. return binaryString
  26806. }
  26807. }
  26808. }
  26809. /**
  26810. * @see https://encoding.spec.whatwg.org/#decode
  26811. * @param {Uint8Array[]} ioQueue
  26812. * @param {string} encoding
  26813. */
  26814. function decode (ioQueue, encoding) {
  26815. const bytes = combineByteSequences(ioQueue)
  26816. // 1. Let BOMEncoding be the result of BOM sniffing ioQueue.
  26817. const BOMEncoding = BOMSniffing(bytes)
  26818. let slice = 0
  26819. // 2. If BOMEncoding is non-null:
  26820. if (BOMEncoding !== null) {
  26821. // 1. Set encoding to BOMEncoding.
  26822. encoding = BOMEncoding
  26823. // 2. Read three bytes from ioQueue, if BOMEncoding is
  26824. // UTF-8; otherwise read two bytes.
  26825. // (Do nothing with those bytes.)
  26826. slice = BOMEncoding === 'UTF-8' ? 3 : 2
  26827. }
  26828. // 3. Process a queue with an instance of encoding’s
  26829. // decoder, ioQueue, output, and "replacement".
  26830. // 4. Return output.
  26831. const sliced = bytes.slice(slice)
  26832. return new TextDecoder(encoding).decode(sliced)
  26833. }
  26834. /**
  26835. * @see https://encoding.spec.whatwg.org/#bom-sniff
  26836. * @param {Uint8Array} ioQueue
  26837. */
  26838. function BOMSniffing (ioQueue) {
  26839. // 1. Let BOM be the result of peeking 3 bytes from ioQueue,
  26840. // converted to a byte sequence.
  26841. const [a, b, c] = ioQueue
  26842. // 2. For each of the rows in the table below, starting with
  26843. // the first one and going down, if BOM starts with the
  26844. // bytes given in the first column, then return the
  26845. // encoding given in the cell in the second column of that
  26846. // row. Otherwise, return null.
  26847. if (a === 0xEF && b === 0xBB && c === 0xBF) {
  26848. return 'UTF-8'
  26849. } else if (a === 0xFE && b === 0xFF) {
  26850. return 'UTF-16BE'
  26851. } else if (a === 0xFF && b === 0xFE) {
  26852. return 'UTF-16LE'
  26853. }
  26854. return null
  26855. }
  26856. /**
  26857. * @param {Uint8Array[]} sequences
  26858. */
  26859. function combineByteSequences (sequences) {
  26860. const size = sequences.reduce((a, b) => {
  26861. return a + b.byteLength
  26862. }, 0)
  26863. let offset = 0
  26864. return sequences.reduce((a, b) => {
  26865. a.set(b, offset)
  26866. offset += b.byteLength
  26867. return a
  26868. }, new Uint8Array(size))
  26869. }
  26870. module.exports = {
  26871. staticPropertyDescriptors,
  26872. readOperation,
  26873. fireAProgressEvent
  26874. }
  26875. /***/ }),
  26876. /***/ 1892:
  26877. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  26878. "use strict";
  26879. // We include a version number for the Dispatcher API. In case of breaking changes,
  26880. // this version number must be increased to avoid conflicts.
  26881. const globalDispatcher = Symbol.for('undici.globalDispatcher.1')
  26882. const { InvalidArgumentError } = __nccwpck_require__(8045)
  26883. const Agent = __nccwpck_require__(7890)
  26884. if (getGlobalDispatcher() === undefined) {
  26885. setGlobalDispatcher(new Agent())
  26886. }
  26887. function setGlobalDispatcher (agent) {
  26888. if (!agent || typeof agent.dispatch !== 'function') {
  26889. throw new InvalidArgumentError('Argument agent must implement Agent')
  26890. }
  26891. Object.defineProperty(globalThis, globalDispatcher, {
  26892. value: agent,
  26893. writable: true,
  26894. enumerable: false,
  26895. configurable: false
  26896. })
  26897. }
  26898. function getGlobalDispatcher () {
  26899. return globalThis[globalDispatcher]
  26900. }
  26901. module.exports = {
  26902. setGlobalDispatcher,
  26903. getGlobalDispatcher
  26904. }
  26905. /***/ }),
  26906. /***/ 6930:
  26907. /***/ ((module) => {
  26908. "use strict";
  26909. module.exports = class DecoratorHandler {
  26910. constructor (handler) {
  26911. this.handler = handler
  26912. }
  26913. onConnect (...args) {
  26914. return this.handler.onConnect(...args)
  26915. }
  26916. onError (...args) {
  26917. return this.handler.onError(...args)
  26918. }
  26919. onUpgrade (...args) {
  26920. return this.handler.onUpgrade(...args)
  26921. }
  26922. onHeaders (...args) {
  26923. return this.handler.onHeaders(...args)
  26924. }
  26925. onData (...args) {
  26926. return this.handler.onData(...args)
  26927. }
  26928. onComplete (...args) {
  26929. return this.handler.onComplete(...args)
  26930. }
  26931. onBodySent (...args) {
  26932. return this.handler.onBodySent(...args)
  26933. }
  26934. }
  26935. /***/ }),
  26936. /***/ 2860:
  26937. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  26938. "use strict";
  26939. const util = __nccwpck_require__(3983)
  26940. const { kBodyUsed } = __nccwpck_require__(2785)
  26941. const assert = __nccwpck_require__(9491)
  26942. const { InvalidArgumentError } = __nccwpck_require__(8045)
  26943. const EE = __nccwpck_require__(2361)
  26944. const redirectableStatusCodes = [300, 301, 302, 303, 307, 308]
  26945. const kBody = Symbol('body')
  26946. class BodyAsyncIterable {
  26947. constructor (body) {
  26948. this[kBody] = body
  26949. this[kBodyUsed] = false
  26950. }
  26951. async * [Symbol.asyncIterator] () {
  26952. assert(!this[kBodyUsed], 'disturbed')
  26953. this[kBodyUsed] = true
  26954. yield * this[kBody]
  26955. }
  26956. }
  26957. class RedirectHandler {
  26958. constructor (dispatch, maxRedirections, opts, handler) {
  26959. if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) {
  26960. throw new InvalidArgumentError('maxRedirections must be a positive number')
  26961. }
  26962. util.validateHandler(handler, opts.method, opts.upgrade)
  26963. this.dispatch = dispatch
  26964. this.location = null
  26965. this.abort = null
  26966. this.opts = { ...opts, maxRedirections: 0 } // opts must be a copy
  26967. this.maxRedirections = maxRedirections
  26968. this.handler = handler
  26969. this.history = []
  26970. if (util.isStream(this.opts.body)) {
  26971. // TODO (fix): Provide some way for the user to cache the file to e.g. /tmp
  26972. // so that it can be dispatched again?
  26973. // TODO (fix): Do we need 100-expect support to provide a way to do this properly?
  26974. if (util.bodyLength(this.opts.body) === 0) {
  26975. this.opts.body
  26976. .on('data', function () {
  26977. assert(false)
  26978. })
  26979. }
  26980. if (typeof this.opts.body.readableDidRead !== 'boolean') {
  26981. this.opts.body[kBodyUsed] = false
  26982. EE.prototype.on.call(this.opts.body, 'data', function () {
  26983. this[kBodyUsed] = true
  26984. })
  26985. }
  26986. } else if (this.opts.body && typeof this.opts.body.pipeTo === 'function') {
  26987. // TODO (fix): We can't access ReadableStream internal state
  26988. // to determine whether or not it has been disturbed. This is just
  26989. // a workaround.
  26990. this.opts.body = new BodyAsyncIterable(this.opts.body)
  26991. } else if (
  26992. this.opts.body &&
  26993. typeof this.opts.body !== 'string' &&
  26994. !ArrayBuffer.isView(this.opts.body) &&
  26995. util.isIterable(this.opts.body)
  26996. ) {
  26997. // TODO: Should we allow re-using iterable if !this.opts.idempotent
  26998. // or through some other flag?
  26999. this.opts.body = new BodyAsyncIterable(this.opts.body)
  27000. }
  27001. }
  27002. onConnect (abort) {
  27003. this.abort = abort
  27004. this.handler.onConnect(abort, { history: this.history })
  27005. }
  27006. onUpgrade (statusCode, headers, socket) {
  27007. this.handler.onUpgrade(statusCode, headers, socket)
  27008. }
  27009. onError (error) {
  27010. this.handler.onError(error)
  27011. }
  27012. onHeaders (statusCode, headers, resume, statusText) {
  27013. this.location = this.history.length >= this.maxRedirections || util.isDisturbed(this.opts.body)
  27014. ? null
  27015. : parseLocation(statusCode, headers)
  27016. if (this.opts.origin) {
  27017. this.history.push(new URL(this.opts.path, this.opts.origin))
  27018. }
  27019. if (!this.location) {
  27020. return this.handler.onHeaders(statusCode, headers, resume, statusText)
  27021. }
  27022. const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)))
  27023. const path = search ? `${pathname}${search}` : pathname
  27024. // Remove headers referring to the original URL.
  27025. // By default it is Host only, unless it's a 303 (see below), which removes also all Content-* headers.
  27026. // https://tools.ietf.org/html/rfc7231#section-6.4
  27027. this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin)
  27028. this.opts.path = path
  27029. this.opts.origin = origin
  27030. this.opts.maxRedirections = 0
  27031. this.opts.query = null
  27032. // https://tools.ietf.org/html/rfc7231#section-6.4.4
  27033. // In case of HTTP 303, always replace method to be either HEAD or GET
  27034. if (statusCode === 303 && this.opts.method !== 'HEAD') {
  27035. this.opts.method = 'GET'
  27036. this.opts.body = null
  27037. }
  27038. }
  27039. onData (chunk) {
  27040. if (this.location) {
  27041. /*
  27042. https://tools.ietf.org/html/rfc7231#section-6.4
  27043. TLDR: undici always ignores 3xx response bodies.
  27044. Redirection is used to serve the requested resource from another URL, so it is assumes that
  27045. no body is generated (and thus can be ignored). Even though generating a body is not prohibited.
  27046. For status 301, 302, 303, 307 and 308 (the latter from RFC 7238), the specs mention that the body usually
  27047. (which means it's optional and not mandated) contain just an hyperlink to the value of
  27048. the Location response header, so the body can be ignored safely.
  27049. For status 300, which is "Multiple Choices", the spec mentions both generating a Location
  27050. response header AND a response body with the other possible location to follow.
  27051. Since the spec explicitily chooses not to specify a format for such body and leave it to
  27052. servers and browsers implementors, we ignore the body as there is no specified way to eventually parse it.
  27053. */
  27054. } else {
  27055. return this.handler.onData(chunk)
  27056. }
  27057. }
  27058. onComplete (trailers) {
  27059. if (this.location) {
  27060. /*
  27061. https://tools.ietf.org/html/rfc7231#section-6.4
  27062. TLDR: undici always ignores 3xx response trailers as they are not expected in case of redirections
  27063. and neither are useful if present.
  27064. See comment on onData method above for more detailed informations.
  27065. */
  27066. this.location = null
  27067. this.abort = null
  27068. this.dispatch(this.opts, this)
  27069. } else {
  27070. this.handler.onComplete(trailers)
  27071. }
  27072. }
  27073. onBodySent (chunk) {
  27074. if (this.handler.onBodySent) {
  27075. this.handler.onBodySent(chunk)
  27076. }
  27077. }
  27078. }
  27079. function parseLocation (statusCode, headers) {
  27080. if (redirectableStatusCodes.indexOf(statusCode) === -1) {
  27081. return null
  27082. }
  27083. for (let i = 0; i < headers.length; i += 2) {
  27084. if (headers[i].toString().toLowerCase() === 'location') {
  27085. return headers[i + 1]
  27086. }
  27087. }
  27088. }
  27089. // https://tools.ietf.org/html/rfc7231#section-6.4.4
  27090. function shouldRemoveHeader (header, removeContent, unknownOrigin) {
  27091. if (header.length === 4) {
  27092. return util.headerNameToString(header) === 'host'
  27093. }
  27094. if (removeContent && util.headerNameToString(header).startsWith('content-')) {
  27095. return true
  27096. }
  27097. if (unknownOrigin && (header.length === 13 || header.length === 6 || header.length === 19)) {
  27098. const name = util.headerNameToString(header)
  27099. return name === 'authorization' || name === 'cookie' || name === 'proxy-authorization'
  27100. }
  27101. return false
  27102. }
  27103. // https://tools.ietf.org/html/rfc7231#section-6.4
  27104. function cleanRequestHeaders (headers, removeContent, unknownOrigin) {
  27105. const ret = []
  27106. if (Array.isArray(headers)) {
  27107. for (let i = 0; i < headers.length; i += 2) {
  27108. if (!shouldRemoveHeader(headers[i], removeContent, unknownOrigin)) {
  27109. ret.push(headers[i], headers[i + 1])
  27110. }
  27111. }
  27112. } else if (headers && typeof headers === 'object') {
  27113. for (const key of Object.keys(headers)) {
  27114. if (!shouldRemoveHeader(key, removeContent, unknownOrigin)) {
  27115. ret.push(key, headers[key])
  27116. }
  27117. }
  27118. } else {
  27119. assert(headers == null, 'headers must be an object or an array')
  27120. }
  27121. return ret
  27122. }
  27123. module.exports = RedirectHandler
  27124. /***/ }),
  27125. /***/ 2286:
  27126. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27127. const assert = __nccwpck_require__(9491)
  27128. const { kRetryHandlerDefaultRetry } = __nccwpck_require__(2785)
  27129. const { RequestRetryError } = __nccwpck_require__(8045)
  27130. const { isDisturbed, parseHeaders, parseRangeHeader } = __nccwpck_require__(3983)
  27131. function calculateRetryAfterHeader (retryAfter) {
  27132. const current = Date.now()
  27133. const diff = new Date(retryAfter).getTime() - current
  27134. return diff
  27135. }
  27136. class RetryHandler {
  27137. constructor (opts, handlers) {
  27138. const { retryOptions, ...dispatchOpts } = opts
  27139. const {
  27140. // Retry scoped
  27141. retry: retryFn,
  27142. maxRetries,
  27143. maxTimeout,
  27144. minTimeout,
  27145. timeoutFactor,
  27146. // Response scoped
  27147. methods,
  27148. errorCodes,
  27149. retryAfter,
  27150. statusCodes
  27151. } = retryOptions ?? {}
  27152. this.dispatch = handlers.dispatch
  27153. this.handler = handlers.handler
  27154. this.opts = dispatchOpts
  27155. this.abort = null
  27156. this.aborted = false
  27157. this.retryOpts = {
  27158. retry: retryFn ?? RetryHandler[kRetryHandlerDefaultRetry],
  27159. retryAfter: retryAfter ?? true,
  27160. maxTimeout: maxTimeout ?? 30 * 1000, // 30s,
  27161. timeout: minTimeout ?? 500, // .5s
  27162. timeoutFactor: timeoutFactor ?? 2,
  27163. maxRetries: maxRetries ?? 5,
  27164. // What errors we should retry
  27165. methods: methods ?? ['GET', 'HEAD', 'OPTIONS', 'PUT', 'DELETE', 'TRACE'],
  27166. // Indicates which errors to retry
  27167. statusCodes: statusCodes ?? [500, 502, 503, 504, 429],
  27168. // List of errors to retry
  27169. errorCodes: errorCodes ?? [
  27170. 'ECONNRESET',
  27171. 'ECONNREFUSED',
  27172. 'ENOTFOUND',
  27173. 'ENETDOWN',
  27174. 'ENETUNREACH',
  27175. 'EHOSTDOWN',
  27176. 'EHOSTUNREACH',
  27177. 'EPIPE'
  27178. ]
  27179. }
  27180. this.retryCount = 0
  27181. this.start = 0
  27182. this.end = null
  27183. this.etag = null
  27184. this.resume = null
  27185. // Handle possible onConnect duplication
  27186. this.handler.onConnect(reason => {
  27187. this.aborted = true
  27188. if (this.abort) {
  27189. this.abort(reason)
  27190. } else {
  27191. this.reason = reason
  27192. }
  27193. })
  27194. }
  27195. onRequestSent () {
  27196. if (this.handler.onRequestSent) {
  27197. this.handler.onRequestSent()
  27198. }
  27199. }
  27200. onUpgrade (statusCode, headers, socket) {
  27201. if (this.handler.onUpgrade) {
  27202. this.handler.onUpgrade(statusCode, headers, socket)
  27203. }
  27204. }
  27205. onConnect (abort) {
  27206. if (this.aborted) {
  27207. abort(this.reason)
  27208. } else {
  27209. this.abort = abort
  27210. }
  27211. }
  27212. onBodySent (chunk) {
  27213. if (this.handler.onBodySent) return this.handler.onBodySent(chunk)
  27214. }
  27215. static [kRetryHandlerDefaultRetry] (err, { state, opts }, cb) {
  27216. const { statusCode, code, headers } = err
  27217. const { method, retryOptions } = opts
  27218. const {
  27219. maxRetries,
  27220. timeout,
  27221. maxTimeout,
  27222. timeoutFactor,
  27223. statusCodes,
  27224. errorCodes,
  27225. methods
  27226. } = retryOptions
  27227. let { counter, currentTimeout } = state
  27228. currentTimeout =
  27229. currentTimeout != null && currentTimeout > 0 ? currentTimeout : timeout
  27230. // Any code that is not a Undici's originated and allowed to retry
  27231. if (
  27232. code &&
  27233. code !== 'UND_ERR_REQ_RETRY' &&
  27234. code !== 'UND_ERR_SOCKET' &&
  27235. !errorCodes.includes(code)
  27236. ) {
  27237. cb(err)
  27238. return
  27239. }
  27240. // If a set of method are provided and the current method is not in the list
  27241. if (Array.isArray(methods) && !methods.includes(method)) {
  27242. cb(err)
  27243. return
  27244. }
  27245. // If a set of status code are provided and the current status code is not in the list
  27246. if (
  27247. statusCode != null &&
  27248. Array.isArray(statusCodes) &&
  27249. !statusCodes.includes(statusCode)
  27250. ) {
  27251. cb(err)
  27252. return
  27253. }
  27254. // If we reached the max number of retries
  27255. if (counter > maxRetries) {
  27256. cb(err)
  27257. return
  27258. }
  27259. let retryAfterHeader = headers != null && headers['retry-after']
  27260. if (retryAfterHeader) {
  27261. retryAfterHeader = Number(retryAfterHeader)
  27262. retryAfterHeader = isNaN(retryAfterHeader)
  27263. ? calculateRetryAfterHeader(retryAfterHeader)
  27264. : retryAfterHeader * 1e3 // Retry-After is in seconds
  27265. }
  27266. const retryTimeout =
  27267. retryAfterHeader > 0
  27268. ? Math.min(retryAfterHeader, maxTimeout)
  27269. : Math.min(currentTimeout * timeoutFactor ** counter, maxTimeout)
  27270. state.currentTimeout = retryTimeout
  27271. setTimeout(() => cb(null), retryTimeout)
  27272. }
  27273. onHeaders (statusCode, rawHeaders, resume, statusMessage) {
  27274. const headers = parseHeaders(rawHeaders)
  27275. this.retryCount += 1
  27276. if (statusCode >= 300) {
  27277. this.abort(
  27278. new RequestRetryError('Request failed', statusCode, {
  27279. headers,
  27280. count: this.retryCount
  27281. })
  27282. )
  27283. return false
  27284. }
  27285. // Checkpoint for resume from where we left it
  27286. if (this.resume != null) {
  27287. this.resume = null
  27288. if (statusCode !== 206) {
  27289. return true
  27290. }
  27291. const contentRange = parseRangeHeader(headers['content-range'])
  27292. // If no content range
  27293. if (!contentRange) {
  27294. this.abort(
  27295. new RequestRetryError('Content-Range mismatch', statusCode, {
  27296. headers,
  27297. count: this.retryCount
  27298. })
  27299. )
  27300. return false
  27301. }
  27302. // Let's start with a weak etag check
  27303. if (this.etag != null && this.etag !== headers.etag) {
  27304. this.abort(
  27305. new RequestRetryError('ETag mismatch', statusCode, {
  27306. headers,
  27307. count: this.retryCount
  27308. })
  27309. )
  27310. return false
  27311. }
  27312. const { start, size, end = size } = contentRange
  27313. assert(this.start === start, 'content-range mismatch')
  27314. assert(this.end == null || this.end === end, 'content-range mismatch')
  27315. this.resume = resume
  27316. return true
  27317. }
  27318. if (this.end == null) {
  27319. if (statusCode === 206) {
  27320. // First time we receive 206
  27321. const range = parseRangeHeader(headers['content-range'])
  27322. if (range == null) {
  27323. return this.handler.onHeaders(
  27324. statusCode,
  27325. rawHeaders,
  27326. resume,
  27327. statusMessage
  27328. )
  27329. }
  27330. const { start, size, end = size } = range
  27331. assert(
  27332. start != null && Number.isFinite(start) && this.start !== start,
  27333. 'content-range mismatch'
  27334. )
  27335. assert(Number.isFinite(start))
  27336. assert(
  27337. end != null && Number.isFinite(end) && this.end !== end,
  27338. 'invalid content-length'
  27339. )
  27340. this.start = start
  27341. this.end = end
  27342. }
  27343. // We make our best to checkpoint the body for further range headers
  27344. if (this.end == null) {
  27345. const contentLength = headers['content-length']
  27346. this.end = contentLength != null ? Number(contentLength) : null
  27347. }
  27348. assert(Number.isFinite(this.start))
  27349. assert(
  27350. this.end == null || Number.isFinite(this.end),
  27351. 'invalid content-length'
  27352. )
  27353. this.resume = resume
  27354. this.etag = headers.etag != null ? headers.etag : null
  27355. return this.handler.onHeaders(
  27356. statusCode,
  27357. rawHeaders,
  27358. resume,
  27359. statusMessage
  27360. )
  27361. }
  27362. const err = new RequestRetryError('Request failed', statusCode, {
  27363. headers,
  27364. count: this.retryCount
  27365. })
  27366. this.abort(err)
  27367. return false
  27368. }
  27369. onData (chunk) {
  27370. this.start += chunk.length
  27371. return this.handler.onData(chunk)
  27372. }
  27373. onComplete (rawTrailers) {
  27374. this.retryCount = 0
  27375. return this.handler.onComplete(rawTrailers)
  27376. }
  27377. onError (err) {
  27378. if (this.aborted || isDisturbed(this.opts.body)) {
  27379. return this.handler.onError(err)
  27380. }
  27381. this.retryOpts.retry(
  27382. err,
  27383. {
  27384. state: { counter: this.retryCount++, currentTimeout: this.retryAfter },
  27385. opts: { retryOptions: this.retryOpts, ...this.opts }
  27386. },
  27387. onRetry.bind(this)
  27388. )
  27389. function onRetry (err) {
  27390. if (err != null || this.aborted || isDisturbed(this.opts.body)) {
  27391. return this.handler.onError(err)
  27392. }
  27393. if (this.start !== 0) {
  27394. this.opts = {
  27395. ...this.opts,
  27396. headers: {
  27397. ...this.opts.headers,
  27398. range: `bytes=${this.start}-${this.end ?? ''}`
  27399. }
  27400. }
  27401. }
  27402. try {
  27403. this.dispatch(this.opts, this)
  27404. } catch (err) {
  27405. this.handler.onError(err)
  27406. }
  27407. }
  27408. }
  27409. }
  27410. module.exports = RetryHandler
  27411. /***/ }),
  27412. /***/ 8861:
  27413. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27414. "use strict";
  27415. const RedirectHandler = __nccwpck_require__(2860)
  27416. function createRedirectInterceptor ({ maxRedirections: defaultMaxRedirections }) {
  27417. return (dispatch) => {
  27418. return function Intercept (opts, handler) {
  27419. const { maxRedirections = defaultMaxRedirections } = opts
  27420. if (!maxRedirections) {
  27421. return dispatch(opts, handler)
  27422. }
  27423. const redirectHandler = new RedirectHandler(dispatch, maxRedirections, opts, handler)
  27424. opts = { ...opts, maxRedirections: 0 } // Stop sub dispatcher from also redirecting.
  27425. return dispatch(opts, redirectHandler)
  27426. }
  27427. }
  27428. }
  27429. module.exports = createRedirectInterceptor
  27430. /***/ }),
  27431. /***/ 953:
  27432. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  27433. "use strict";
  27434. Object.defineProperty(exports, "__esModule", ({ value: true }));
  27435. 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;
  27436. const utils_1 = __nccwpck_require__(1891);
  27437. // C headers
  27438. var ERROR;
  27439. (function (ERROR) {
  27440. ERROR[ERROR["OK"] = 0] = "OK";
  27441. ERROR[ERROR["INTERNAL"] = 1] = "INTERNAL";
  27442. ERROR[ERROR["STRICT"] = 2] = "STRICT";
  27443. ERROR[ERROR["LF_EXPECTED"] = 3] = "LF_EXPECTED";
  27444. ERROR[ERROR["UNEXPECTED_CONTENT_LENGTH"] = 4] = "UNEXPECTED_CONTENT_LENGTH";
  27445. ERROR[ERROR["CLOSED_CONNECTION"] = 5] = "CLOSED_CONNECTION";
  27446. ERROR[ERROR["INVALID_METHOD"] = 6] = "INVALID_METHOD";
  27447. ERROR[ERROR["INVALID_URL"] = 7] = "INVALID_URL";
  27448. ERROR[ERROR["INVALID_CONSTANT"] = 8] = "INVALID_CONSTANT";
  27449. ERROR[ERROR["INVALID_VERSION"] = 9] = "INVALID_VERSION";
  27450. ERROR[ERROR["INVALID_HEADER_TOKEN"] = 10] = "INVALID_HEADER_TOKEN";
  27451. ERROR[ERROR["INVALID_CONTENT_LENGTH"] = 11] = "INVALID_CONTENT_LENGTH";
  27452. ERROR[ERROR["INVALID_CHUNK_SIZE"] = 12] = "INVALID_CHUNK_SIZE";
  27453. ERROR[ERROR["INVALID_STATUS"] = 13] = "INVALID_STATUS";
  27454. ERROR[ERROR["INVALID_EOF_STATE"] = 14] = "INVALID_EOF_STATE";
  27455. ERROR[ERROR["INVALID_TRANSFER_ENCODING"] = 15] = "INVALID_TRANSFER_ENCODING";
  27456. ERROR[ERROR["CB_MESSAGE_BEGIN"] = 16] = "CB_MESSAGE_BEGIN";
  27457. ERROR[ERROR["CB_HEADERS_COMPLETE"] = 17] = "CB_HEADERS_COMPLETE";
  27458. ERROR[ERROR["CB_MESSAGE_COMPLETE"] = 18] = "CB_MESSAGE_COMPLETE";
  27459. ERROR[ERROR["CB_CHUNK_HEADER"] = 19] = "CB_CHUNK_HEADER";
  27460. ERROR[ERROR["CB_CHUNK_COMPLETE"] = 20] = "CB_CHUNK_COMPLETE";
  27461. ERROR[ERROR["PAUSED"] = 21] = "PAUSED";
  27462. ERROR[ERROR["PAUSED_UPGRADE"] = 22] = "PAUSED_UPGRADE";
  27463. ERROR[ERROR["PAUSED_H2_UPGRADE"] = 23] = "PAUSED_H2_UPGRADE";
  27464. ERROR[ERROR["USER"] = 24] = "USER";
  27465. })(ERROR = exports.ERROR || (exports.ERROR = {}));
  27466. var TYPE;
  27467. (function (TYPE) {
  27468. TYPE[TYPE["BOTH"] = 0] = "BOTH";
  27469. TYPE[TYPE["REQUEST"] = 1] = "REQUEST";
  27470. TYPE[TYPE["RESPONSE"] = 2] = "RESPONSE";
  27471. })(TYPE = exports.TYPE || (exports.TYPE = {}));
  27472. var FLAGS;
  27473. (function (FLAGS) {
  27474. FLAGS[FLAGS["CONNECTION_KEEP_ALIVE"] = 1] = "CONNECTION_KEEP_ALIVE";
  27475. FLAGS[FLAGS["CONNECTION_CLOSE"] = 2] = "CONNECTION_CLOSE";
  27476. FLAGS[FLAGS["CONNECTION_UPGRADE"] = 4] = "CONNECTION_UPGRADE";
  27477. FLAGS[FLAGS["CHUNKED"] = 8] = "CHUNKED";
  27478. FLAGS[FLAGS["UPGRADE"] = 16] = "UPGRADE";
  27479. FLAGS[FLAGS["CONTENT_LENGTH"] = 32] = "CONTENT_LENGTH";
  27480. FLAGS[FLAGS["SKIPBODY"] = 64] = "SKIPBODY";
  27481. FLAGS[FLAGS["TRAILING"] = 128] = "TRAILING";
  27482. // 1 << 8 is unused
  27483. FLAGS[FLAGS["TRANSFER_ENCODING"] = 512] = "TRANSFER_ENCODING";
  27484. })(FLAGS = exports.FLAGS || (exports.FLAGS = {}));
  27485. var LENIENT_FLAGS;
  27486. (function (LENIENT_FLAGS) {
  27487. LENIENT_FLAGS[LENIENT_FLAGS["HEADERS"] = 1] = "HEADERS";
  27488. LENIENT_FLAGS[LENIENT_FLAGS["CHUNKED_LENGTH"] = 2] = "CHUNKED_LENGTH";
  27489. LENIENT_FLAGS[LENIENT_FLAGS["KEEP_ALIVE"] = 4] = "KEEP_ALIVE";
  27490. })(LENIENT_FLAGS = exports.LENIENT_FLAGS || (exports.LENIENT_FLAGS = {}));
  27491. var METHODS;
  27492. (function (METHODS) {
  27493. METHODS[METHODS["DELETE"] = 0] = "DELETE";
  27494. METHODS[METHODS["GET"] = 1] = "GET";
  27495. METHODS[METHODS["HEAD"] = 2] = "HEAD";
  27496. METHODS[METHODS["POST"] = 3] = "POST";
  27497. METHODS[METHODS["PUT"] = 4] = "PUT";
  27498. /* pathological */
  27499. METHODS[METHODS["CONNECT"] = 5] = "CONNECT";
  27500. METHODS[METHODS["OPTIONS"] = 6] = "OPTIONS";
  27501. METHODS[METHODS["TRACE"] = 7] = "TRACE";
  27502. /* WebDAV */
  27503. METHODS[METHODS["COPY"] = 8] = "COPY";
  27504. METHODS[METHODS["LOCK"] = 9] = "LOCK";
  27505. METHODS[METHODS["MKCOL"] = 10] = "MKCOL";
  27506. METHODS[METHODS["MOVE"] = 11] = "MOVE";
  27507. METHODS[METHODS["PROPFIND"] = 12] = "PROPFIND";
  27508. METHODS[METHODS["PROPPATCH"] = 13] = "PROPPATCH";
  27509. METHODS[METHODS["SEARCH"] = 14] = "SEARCH";
  27510. METHODS[METHODS["UNLOCK"] = 15] = "UNLOCK";
  27511. METHODS[METHODS["BIND"] = 16] = "BIND";
  27512. METHODS[METHODS["REBIND"] = 17] = "REBIND";
  27513. METHODS[METHODS["UNBIND"] = 18] = "UNBIND";
  27514. METHODS[METHODS["ACL"] = 19] = "ACL";
  27515. /* subversion */
  27516. METHODS[METHODS["REPORT"] = 20] = "REPORT";
  27517. METHODS[METHODS["MKACTIVITY"] = 21] = "MKACTIVITY";
  27518. METHODS[METHODS["CHECKOUT"] = 22] = "CHECKOUT";
  27519. METHODS[METHODS["MERGE"] = 23] = "MERGE";
  27520. /* upnp */
  27521. METHODS[METHODS["M-SEARCH"] = 24] = "M-SEARCH";
  27522. METHODS[METHODS["NOTIFY"] = 25] = "NOTIFY";
  27523. METHODS[METHODS["SUBSCRIBE"] = 26] = "SUBSCRIBE";
  27524. METHODS[METHODS["UNSUBSCRIBE"] = 27] = "UNSUBSCRIBE";
  27525. /* RFC-5789 */
  27526. METHODS[METHODS["PATCH"] = 28] = "PATCH";
  27527. METHODS[METHODS["PURGE"] = 29] = "PURGE";
  27528. /* CalDAV */
  27529. METHODS[METHODS["MKCALENDAR"] = 30] = "MKCALENDAR";
  27530. /* RFC-2068, section 19.6.1.2 */
  27531. METHODS[METHODS["LINK"] = 31] = "LINK";
  27532. METHODS[METHODS["UNLINK"] = 32] = "UNLINK";
  27533. /* icecast */
  27534. METHODS[METHODS["SOURCE"] = 33] = "SOURCE";
  27535. /* RFC-7540, section 11.6 */
  27536. METHODS[METHODS["PRI"] = 34] = "PRI";
  27537. /* RFC-2326 RTSP */
  27538. METHODS[METHODS["DESCRIBE"] = 35] = "DESCRIBE";
  27539. METHODS[METHODS["ANNOUNCE"] = 36] = "ANNOUNCE";
  27540. METHODS[METHODS["SETUP"] = 37] = "SETUP";
  27541. METHODS[METHODS["PLAY"] = 38] = "PLAY";
  27542. METHODS[METHODS["PAUSE"] = 39] = "PAUSE";
  27543. METHODS[METHODS["TEARDOWN"] = 40] = "TEARDOWN";
  27544. METHODS[METHODS["GET_PARAMETER"] = 41] = "GET_PARAMETER";
  27545. METHODS[METHODS["SET_PARAMETER"] = 42] = "SET_PARAMETER";
  27546. METHODS[METHODS["REDIRECT"] = 43] = "REDIRECT";
  27547. METHODS[METHODS["RECORD"] = 44] = "RECORD";
  27548. /* RAOP */
  27549. METHODS[METHODS["FLUSH"] = 45] = "FLUSH";
  27550. })(METHODS = exports.METHODS || (exports.METHODS = {}));
  27551. exports.METHODS_HTTP = [
  27552. METHODS.DELETE,
  27553. METHODS.GET,
  27554. METHODS.HEAD,
  27555. METHODS.POST,
  27556. METHODS.PUT,
  27557. METHODS.CONNECT,
  27558. METHODS.OPTIONS,
  27559. METHODS.TRACE,
  27560. METHODS.COPY,
  27561. METHODS.LOCK,
  27562. METHODS.MKCOL,
  27563. METHODS.MOVE,
  27564. METHODS.PROPFIND,
  27565. METHODS.PROPPATCH,
  27566. METHODS.SEARCH,
  27567. METHODS.UNLOCK,
  27568. METHODS.BIND,
  27569. METHODS.REBIND,
  27570. METHODS.UNBIND,
  27571. METHODS.ACL,
  27572. METHODS.REPORT,
  27573. METHODS.MKACTIVITY,
  27574. METHODS.CHECKOUT,
  27575. METHODS.MERGE,
  27576. METHODS['M-SEARCH'],
  27577. METHODS.NOTIFY,
  27578. METHODS.SUBSCRIBE,
  27579. METHODS.UNSUBSCRIBE,
  27580. METHODS.PATCH,
  27581. METHODS.PURGE,
  27582. METHODS.MKCALENDAR,
  27583. METHODS.LINK,
  27584. METHODS.UNLINK,
  27585. METHODS.PRI,
  27586. // TODO(indutny): should we allow it with HTTP?
  27587. METHODS.SOURCE,
  27588. ];
  27589. exports.METHODS_ICE = [
  27590. METHODS.SOURCE,
  27591. ];
  27592. exports.METHODS_RTSP = [
  27593. METHODS.OPTIONS,
  27594. METHODS.DESCRIBE,
  27595. METHODS.ANNOUNCE,
  27596. METHODS.SETUP,
  27597. METHODS.PLAY,
  27598. METHODS.PAUSE,
  27599. METHODS.TEARDOWN,
  27600. METHODS.GET_PARAMETER,
  27601. METHODS.SET_PARAMETER,
  27602. METHODS.REDIRECT,
  27603. METHODS.RECORD,
  27604. METHODS.FLUSH,
  27605. // For AirPlay
  27606. METHODS.GET,
  27607. METHODS.POST,
  27608. ];
  27609. exports.METHOD_MAP = utils_1.enumToMap(METHODS);
  27610. exports.H_METHOD_MAP = {};
  27611. Object.keys(exports.METHOD_MAP).forEach((key) => {
  27612. if (/^H/.test(key)) {
  27613. exports.H_METHOD_MAP[key] = exports.METHOD_MAP[key];
  27614. }
  27615. });
  27616. var FINISH;
  27617. (function (FINISH) {
  27618. FINISH[FINISH["SAFE"] = 0] = "SAFE";
  27619. FINISH[FINISH["SAFE_WITH_CB"] = 1] = "SAFE_WITH_CB";
  27620. FINISH[FINISH["UNSAFE"] = 2] = "UNSAFE";
  27621. })(FINISH = exports.FINISH || (exports.FINISH = {}));
  27622. exports.ALPHA = [];
  27623. for (let i = 'A'.charCodeAt(0); i <= 'Z'.charCodeAt(0); i++) {
  27624. // Upper case
  27625. exports.ALPHA.push(String.fromCharCode(i));
  27626. // Lower case
  27627. exports.ALPHA.push(String.fromCharCode(i + 0x20));
  27628. }
  27629. exports.NUM_MAP = {
  27630. 0: 0, 1: 1, 2: 2, 3: 3, 4: 4,
  27631. 5: 5, 6: 6, 7: 7, 8: 8, 9: 9,
  27632. };
  27633. exports.HEX_MAP = {
  27634. 0: 0, 1: 1, 2: 2, 3: 3, 4: 4,
  27635. 5: 5, 6: 6, 7: 7, 8: 8, 9: 9,
  27636. A: 0XA, B: 0XB, C: 0XC, D: 0XD, E: 0XE, F: 0XF,
  27637. a: 0xa, b: 0xb, c: 0xc, d: 0xd, e: 0xe, f: 0xf,
  27638. };
  27639. exports.NUM = [
  27640. '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
  27641. ];
  27642. exports.ALPHANUM = exports.ALPHA.concat(exports.NUM);
  27643. exports.MARK = ['-', '_', '.', '!', '~', '*', '\'', '(', ')'];
  27644. exports.USERINFO_CHARS = exports.ALPHANUM
  27645. .concat(exports.MARK)
  27646. .concat(['%', ';', ':', '&', '=', '+', '$', ',']);
  27647. // TODO(indutny): use RFC
  27648. exports.STRICT_URL_CHAR = [
  27649. '!', '"', '$', '%', '&', '\'',
  27650. '(', ')', '*', '+', ',', '-', '.', '/',
  27651. ':', ';', '<', '=', '>',
  27652. '@', '[', '\\', ']', '^', '_',
  27653. '`',
  27654. '{', '|', '}', '~',
  27655. ].concat(exports.ALPHANUM);
  27656. exports.URL_CHAR = exports.STRICT_URL_CHAR
  27657. .concat(['\t', '\f']);
  27658. // All characters with 0x80 bit set to 1
  27659. for (let i = 0x80; i <= 0xff; i++) {
  27660. exports.URL_CHAR.push(i);
  27661. }
  27662. exports.HEX = exports.NUM.concat(['a', 'b', 'c', 'd', 'e', 'f', 'A', 'B', 'C', 'D', 'E', 'F']);
  27663. /* Tokens as defined by rfc 2616. Also lowercases them.
  27664. * token = 1*<any CHAR except CTLs or separators>
  27665. * separators = "(" | ")" | "<" | ">" | "@"
  27666. * | "," | ";" | ":" | "\" | <">
  27667. * | "/" | "[" | "]" | "?" | "="
  27668. * | "{" | "}" | SP | HT
  27669. */
  27670. exports.STRICT_TOKEN = [
  27671. '!', '#', '$', '%', '&', '\'',
  27672. '*', '+', '-', '.',
  27673. '^', '_', '`',
  27674. '|', '~',
  27675. ].concat(exports.ALPHANUM);
  27676. exports.TOKEN = exports.STRICT_TOKEN.concat([' ']);
  27677. /*
  27678. * Verify that a char is a valid visible (printable) US-ASCII
  27679. * character or %x80-FF
  27680. */
  27681. exports.HEADER_CHARS = ['\t'];
  27682. for (let i = 32; i <= 255; i++) {
  27683. if (i !== 127) {
  27684. exports.HEADER_CHARS.push(i);
  27685. }
  27686. }
  27687. // ',' = \x44
  27688. exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS.filter((c) => c !== 44);
  27689. exports.MAJOR = exports.NUM_MAP;
  27690. exports.MINOR = exports.MAJOR;
  27691. var HEADER_STATE;
  27692. (function (HEADER_STATE) {
  27693. HEADER_STATE[HEADER_STATE["GENERAL"] = 0] = "GENERAL";
  27694. HEADER_STATE[HEADER_STATE["CONNECTION"] = 1] = "CONNECTION";
  27695. HEADER_STATE[HEADER_STATE["CONTENT_LENGTH"] = 2] = "CONTENT_LENGTH";
  27696. HEADER_STATE[HEADER_STATE["TRANSFER_ENCODING"] = 3] = "TRANSFER_ENCODING";
  27697. HEADER_STATE[HEADER_STATE["UPGRADE"] = 4] = "UPGRADE";
  27698. HEADER_STATE[HEADER_STATE["CONNECTION_KEEP_ALIVE"] = 5] = "CONNECTION_KEEP_ALIVE";
  27699. HEADER_STATE[HEADER_STATE["CONNECTION_CLOSE"] = 6] = "CONNECTION_CLOSE";
  27700. HEADER_STATE[HEADER_STATE["CONNECTION_UPGRADE"] = 7] = "CONNECTION_UPGRADE";
  27701. HEADER_STATE[HEADER_STATE["TRANSFER_ENCODING_CHUNKED"] = 8] = "TRANSFER_ENCODING_CHUNKED";
  27702. })(HEADER_STATE = exports.HEADER_STATE || (exports.HEADER_STATE = {}));
  27703. exports.SPECIAL_HEADERS = {
  27704. 'connection': HEADER_STATE.CONNECTION,
  27705. 'content-length': HEADER_STATE.CONTENT_LENGTH,
  27706. 'proxy-connection': HEADER_STATE.CONNECTION,
  27707. 'transfer-encoding': HEADER_STATE.TRANSFER_ENCODING,
  27708. 'upgrade': HEADER_STATE.UPGRADE,
  27709. };
  27710. //# sourceMappingURL=constants.js.map
  27711. /***/ }),
  27712. /***/ 1145:
  27713. /***/ ((module) => {
  27714. module.exports = 'AGFzbQEAAAABMAhgAX8Bf2ADf39/AX9gBH9/f38Bf2AAAGADf39/AGABfwBgAn9/AGAGf39/f39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQACA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAA0ZFAwMEAAAFAAAAAAAABQEFAAUFBQAABgAAAAAGBgYGAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAAABAQcAAAUFAwABBAUBcAESEgUDAQACBggBfwFBgNQECwfRBSIGbWVtb3J5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wCC0EAIQEgAC8BMCICQQFxRQ0BC0EBIQEgAC0AKEEBRg0AIAAvATJB//8DcSIAQZx/akHkAEkNACAAQcwBRg0AIABBsAJGDQAgAkHAAHENAEEAIQEgAkGIBHFBgARGDQAgAkEocUEARyEBCyABC1kAIABBGGpCADcDACAAQgA3AwAgAEE4akIANwMAIABBMGpCADcDACAAQShqQgA3AwAgAEEgakIANwMAIABBEGpCADcDACAAQQhqQgA3AwAgAEHdATYCHEEAC3sBAX8CQCAAKAIMIgMNAAJAIAAoAgRFDQAgACABNgIECwJAIAAgASACEMSAgIAAIgMNACAAKAIMDwsgACADNgIcQQAhAyAAKAIEIgFFDQAgACABIAIgACgCCBGBgICAAAAiAUUNACAAIAI2AhQgACABNgIMIAEhAwsgAwvk8wEDDn8DfgR/I4CAgIAAQRBrIgMkgICAgAAgASEEIAEhBSABIQYgASEHIAEhCCABIQkgASEKIAEhCyABIQwgASENIAEhDiABIQ8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgACgCHCIQQX9qDt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ASEQDCcLQZ4BIRAMJgtBnwEhEAwlC0GgASEQDCQLQaEBIRAMIwtBogEhEAwiC0GjASEQDCELQaQBIRAMIAtBpQEhEAwfC0GmASEQDB4LQacBIRAMHQtBqAEhEAwcC0GpASEQDBsLQaoBIRAMGgtBqwEhEAwZC0GsASEQDBgLQa0BIRAMFwtBrgEhEAwWC0EBIRAMFQtBrwEhEAwUC0GwASEQDBMLQbEBIRAMEgtBswEhEAwRC0GyASEQDBALQbQBIRAMDwtBtQEhEAwOC0G2ASEQDA0LQbcBIRAMDAtBuAEhEAwLC0G5ASEQDAoLQboBIRAMCQtBuwEhEAwIC0HGASEQDAcLQbwBIRAMBgtBvQEhEAwFC0G+ASEQDAQLQb8BIRAMAwtBwAEhEAwCC0HCASEQDAELQcEBIRALA0ACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQ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MSQsgAEHSADYCHCAAIAE2AhQgACAQNgIMQQAhEAyuAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMSQsgAEHTADYCHCAAIAE2AhQgACAQNgIMQQAhEAytAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMTQsgAEHlADYCHCAAIAE2AhQgACAQNgIMQQAhEAysAQsgAEEANgIcIAAgATYCFCAAQdyIgIAANgIQIABBBzYCDEEAIRAMqwELIBBBP0cNASABQQFqIQELQQUhEAyQAQtBACEQIABBADYCHCAAIAE2AhQgAEH9koCAADYCECAAQQc2AgwMqAELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEILIABB0gA2AhwgACABNgIUIAAgEDYCDEEAIRAMpwELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEILIABB0wA2AhwgACABNgIUIAAgEDYCDEEAIRAMpgELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEYLIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMpQELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDD8LIABB0gA2AhwgACAUNgIUIAAgATYCDEEAIRAMpAELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDD8LIABB0wA2AhwgACAUNgIUIAAgATYCDEEAIRAMowELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDEMLIABB5QA2AhwgACAUNgIUIAAgATYCDEEAIRAMogELIABBADYCHCAAIBQ2AhQgAEHDj4CAADYCECAAQQc2AgxBACEQDKEBCyAAQQA2AhwgACABNgIUIABBw4+AgAA2AhAgAEEHNgIMQQAhEAygAQtBACEQIABBADYCHCAAIBQ2AhQgAEGMnICAADYCECAAQQc2AgwMnwELIABBADYCHCAAIBQ2AhQgAEGMnICAADYCECAAQQc2AgxBACEQDJ4BCyAAQQA2Ah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IAE2AgwgASEDCyADC+TzAQMOfwN+BH8jgICAgABBEGsiAySAgICAACABIQQgASEFIAEhBiABIQcgASEIIAEhCSABIQogASELIAEhDCABIQ0gASEOIAEhDwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAAKAIcIhBBf2oO3QHaAQHZAQIDBAUGBwgJCgsMDQ7YAQ8Q1wEREtYBExQVFhcYGRob4AHfARwdHtUBHyAhIiMkJdQBJicoKSorLNMB0gEtLtEB0AEvMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUbbAUdISUrPAc4BS80BTMwBTU5PUFFSU1RVVldYWVpbXF1eX2BhYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ent8fX5/gAGBAYIBgwGEAYUBhgGHAYgBiQGKAYsBjAGNAY4BjwGQAZEBkgGTAZQBlQGWAZcBmAGZAZoBmwGcAZ0BngGfAaABoQGiAaMBpAGlAaYBpwGoAakBqgGrAawBrQGuAa8BsAGxAbIBswG0AbUBtgG3AcsBygG4AckBuQHIAboBuwG8Ab0B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AQtBwQEhEAsDQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJA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AIAFBAWohAUEQIRAM1AMLQQchEAzsAwsgAEIAIAApAyAiESACIAEiEGutIhJ9IhMgEyARVhs3AyAgESASViIURQ3lAUEIIRAM6wMLAkAgASIBIAJGDQAgAEGJgICAADYCCCAAIAE2AgQgASEBQRQhEAzSAwtBCSEQDOoDCyABIQEgACkDIFAN5AEgASEBDPICCwJAIAEiASACRw0AQQshEAzpAwsgACABQQFqIgEgAhC2gICAACIQDeUBIAEhAQzyAgsgACABIgEgAhC4gICAACIQDeUBIAEhAQzyAgsgACABIgEgAhC4gICAACIQDeYBIAEhAQwNCyAAIAEiASACELqAgIAAIhAN5wEgASEBDPACCwJAIAEiASACRw0AQQ8hEAzlAwsgAS0AACIQQTtGDQggEEENRw3oASABQQFqIQEM7wILIAAgASIBIAIQuoCAgAAiEA3oASABIQEM8gILA0ACQCABLQAAQfC1gIAAai0AACIQQQFGDQAgEEECRw3rASAAKAIEIRAgAEEANgIEIAAgECABQQFqIgEQuYCAgAAiEA3qASABIQEM9AILIAFBAWoiASACRw0AC0ESIRAM4gMLIAAgASIBIAIQuoCAgAAiEA3pASABIQEMCgsgASIBIAJHDQZBGyEQDOADCwJAIAEiASACRw0AQRYhEAzgAwsgAEGKgICAADYCCCAAIAE2AgQgACABIAIQuICAgAAiEA3qASABIQFBICEQDMYDCwJAIAEiASACRg0AA0ACQCABLQAAQfC3gIAAai0AACIQQQJGDQACQCAQQX9qDgTlAewBAOsB7AELIAFBAWohAUEIIRAMyAMLIAFBAWoiASACRw0AC0EVIRAM3wMLQRUhEAzeAwsDQAJAIAEtAABB8LmAgABqLQAAIhBBAkYNACAQQX9qDgTeAewB4AHrAewBCyABQQFqIgEgAkcNAAtBGCEQDN0DCwJAIAEiASACRg0AIABBi4CAgAA2AgggACABNgIEIAEhAUEHIRAMxAMLQRkhEAzcAwsgAUEBaiEBDAILAkAgASIUIAJHDQBBGiEQDNsDCyAUIQECQCAULQAAQXNqDhTdAu4C7gLuAu4C7gLuAu4C7gLuAu4C7gLuAu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QCAQQQZLDQBBASAQdEHKAHFFDQAgASEBDFULQQAhECAAQQA2AhwgACABNgIUIABB94mAgAA2AhAgAEEINgIMDLUBCyAQQRVGDXEgAEEANgIcIAAgATYCFCAAQbmNgIAANgIQIABBGjYCDEEAIRAMtAELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDFQLIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMswELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDE0LIABB0gA2AhwgACABNgIUIAAgEDYCDEEAIRAMsgELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDE0LIABB0wA2AhwgACABNgIUIAAgEDYCDEEAIRAMsQELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDFELIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMsAELIABBADYCHCAAIAE2AhQgAEHGioCAADYCECAAQQc2AgxBACEQDK8BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxJCyAAQdIANgIcIAAgATYCFCAAIBA2AgxBACEQDK4BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxJCyAAQdMANgIcIAAgATYCFCAAIBA2AgxBACEQDK0BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxNCyAAQeUANgIcIAAgATYCFCAAIBA2AgxBACEQDKwBCyAAQQA2AhwgACABNgIUIABB3IiAgAA2AhAgAEEHNgIMQQAhEAyrAQsgEEE/Rw0BIAFBAWohAQtBBSEQDJABC0EAIRAgAEEANgIcIAAgATYCFCAAQf2SgIAANgIQIABBBzYCDAyoAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMQgsgAEHSADYCHCAAIAE2AhQgACAQNgIMQQAhEAynAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEM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AAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAEAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAgAAAAACAAAAAAAAAAAAAAAAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE5PVU5DRUVDS09VVE5FQ1RFVEVDUklCRUxVU0hFVEVBRFNFQVJDSFJHRUNUSVZJVFlMRU5EQVJWRU9USUZZUFRJT05TQ0hTRUFZU1RBVENIR0VPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFSFRUUC9BRFRQLw=='
  27719. /***/ }),
  27720. /***/ 1891:
  27721. /***/ ((__unused_webpack_module, exports) => {
  27722. "use strict";
  27723. Object.defineProperty(exports, "__esModule", ({ value: true }));
  27724. exports.enumToMap = void 0;
  27725. function enumToMap(obj) {
  27726. const res = {};
  27727. Object.keys(obj).forEach((key) => {
  27728. const value = obj[key];
  27729. if (typeof value === 'number') {
  27730. res[key] = value;
  27731. }
  27732. });
  27733. return res;
  27734. }
  27735. exports.enumToMap = enumToMap;
  27736. //# sourceMappingURL=utils.js.map
  27737. /***/ }),
  27738. /***/ 6771:
  27739. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27740. "use strict";
  27741. const { kClients } = __nccwpck_require__(2785)
  27742. const Agent = __nccwpck_require__(7890)
  27743. const {
  27744. kAgent,
  27745. kMockAgentSet,
  27746. kMockAgentGet,
  27747. kDispatches,
  27748. kIsMockActive,
  27749. kNetConnect,
  27750. kGetNetConnect,
  27751. kOptions,
  27752. kFactory
  27753. } = __nccwpck_require__(4347)
  27754. const MockClient = __nccwpck_require__(8687)
  27755. const MockPool = __nccwpck_require__(6193)
  27756. const { matchValue, buildMockOptions } = __nccwpck_require__(9323)
  27757. const { InvalidArgumentError, UndiciError } = __nccwpck_require__(8045)
  27758. const Dispatcher = __nccwpck_require__(412)
  27759. const Pluralizer = __nccwpck_require__(8891)
  27760. const PendingInterceptorsFormatter = __nccwpck_require__(6823)
  27761. class FakeWeakRef {
  27762. constructor (value) {
  27763. this.value = value
  27764. }
  27765. deref () {
  27766. return this.value
  27767. }
  27768. }
  27769. class MockAgent extends Dispatcher {
  27770. constructor (opts) {
  27771. super(opts)
  27772. this[kNetConnect] = true
  27773. this[kIsMockActive] = true
  27774. // Instantiate Agent and encapsulate
  27775. if ((opts && opts.agent && typeof opts.agent.dispatch !== 'function')) {
  27776. throw new InvalidArgumentError('Argument opts.agent must implement Agent')
  27777. }
  27778. const agent = opts && opts.agent ? opts.agent : new Agent(opts)
  27779. this[kAgent] = agent
  27780. this[kClients] = agent[kClients]
  27781. this[kOptions] = buildMockOptions(opts)
  27782. }
  27783. get (origin) {
  27784. let dispatcher = this[kMockAgentGet](origin)
  27785. if (!dispatcher) {
  27786. dispatcher = this[kFactory](origin)
  27787. this[kMockAgentSet](origin, dispatcher)
  27788. }
  27789. return dispatcher
  27790. }
  27791. dispatch (opts, handler) {
  27792. // Call MockAgent.get to perform additional setup before dispatching as normal
  27793. this.get(opts.origin)
  27794. return this[kAgent].dispatch(opts, handler)
  27795. }
  27796. async close () {
  27797. await this[kAgent].close()
  27798. this[kClients].clear()
  27799. }
  27800. deactivate () {
  27801. this[kIsMockActive] = false
  27802. }
  27803. activate () {
  27804. this[kIsMockActive] = true
  27805. }
  27806. enableNetConnect (matcher) {
  27807. if (typeof matcher === 'string' || typeof matcher === 'function' || matcher instanceof RegExp) {
  27808. if (Array.isArray(this[kNetConnect])) {
  27809. this[kNetConnect].push(matcher)
  27810. } else {
  27811. this[kNetConnect] = [matcher]
  27812. }
  27813. } else if (typeof matcher === 'undefined') {
  27814. this[kNetConnect] = true
  27815. } else {
  27816. throw new InvalidArgumentError('Unsupported matcher. Must be one of String|Function|RegExp.')
  27817. }
  27818. }
  27819. disableNetConnect () {
  27820. this[kNetConnect] = false
  27821. }
  27822. // This is required to bypass issues caused by using global symbols - see:
  27823. // https://github.com/nodejs/undici/issues/1447
  27824. get isMockActive () {
  27825. return this[kIsMockActive]
  27826. }
  27827. [kMockAgentSet] (origin, dispatcher) {
  27828. this[kClients].set(origin, new FakeWeakRef(dispatcher))
  27829. }
  27830. [kFactory] (origin) {
  27831. const mockOptions = Object.assign({ agent: this }, this[kOptions])
  27832. return this[kOptions] && this[kOptions].connections === 1
  27833. ? new MockClient(origin, mockOptions)
  27834. : new MockPool(origin, mockOptions)
  27835. }
  27836. [kMockAgentGet] (origin) {
  27837. // First check if we can immediately find it
  27838. const ref = this[kClients].get(origin)
  27839. if (ref) {
  27840. return ref.deref()
  27841. }
  27842. // If the origin is not a string create a dummy parent pool and return to user
  27843. if (typeof origin !== 'string') {
  27844. const dispatcher = this[kFactory]('http://localhost:9999')
  27845. this[kMockAgentSet](origin, dispatcher)
  27846. return dispatcher
  27847. }
  27848. // If we match, create a pool and assign the same dispatches
  27849. for (const [keyMatcher, nonExplicitRef] of Array.from(this[kClients])) {
  27850. const nonExplicitDispatcher = nonExplicitRef.deref()
  27851. if (nonExplicitDispatcher && typeof keyMatcher !== 'string' && matchValue(keyMatcher, origin)) {
  27852. const dispatcher = this[kFactory](origin)
  27853. this[kMockAgentSet](origin, dispatcher)
  27854. dispatcher[kDispatches] = nonExplicitDispatcher[kDispatches]
  27855. return dispatcher
  27856. }
  27857. }
  27858. }
  27859. [kGetNetConnect] () {
  27860. return this[kNetConnect]
  27861. }
  27862. pendingInterceptors () {
  27863. const mockAgentClients = this[kClients]
  27864. return Array.from(mockAgentClients.entries())
  27865. .flatMap(([origin, scope]) => scope.deref()[kDispatches].map(dispatch => ({ ...dispatch, origin })))
  27866. .filter(({ pending }) => pending)
  27867. }
  27868. assertNoPendingInterceptors ({ pendingInterceptorsFormatter = new PendingInterceptorsFormatter() } = {}) {
  27869. const pending = this.pendingInterceptors()
  27870. if (pending.length === 0) {
  27871. return
  27872. }
  27873. const pluralizer = new Pluralizer('interceptor', 'interceptors').pluralize(pending.length)
  27874. throw new UndiciError(`
  27875. ${pluralizer.count} ${pluralizer.noun} ${pluralizer.is} pending:
  27876. ${pendingInterceptorsFormatter.format(pending)}
  27877. `.trim())
  27878. }
  27879. }
  27880. module.exports = MockAgent
  27881. /***/ }),
  27882. /***/ 8687:
  27883. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27884. "use strict";
  27885. const { promisify } = __nccwpck_require__(3837)
  27886. const Client = __nccwpck_require__(3598)
  27887. const { buildMockDispatch } = __nccwpck_require__(9323)
  27888. const {
  27889. kDispatches,
  27890. kMockAgent,
  27891. kClose,
  27892. kOriginalClose,
  27893. kOrigin,
  27894. kOriginalDispatch,
  27895. kConnected
  27896. } = __nccwpck_require__(4347)
  27897. const { MockInterceptor } = __nccwpck_require__(410)
  27898. const Symbols = __nccwpck_require__(2785)
  27899. const { InvalidArgumentError } = __nccwpck_require__(8045)
  27900. /**
  27901. * MockClient provides an API that extends the Client to influence the mockDispatches.
  27902. */
  27903. class MockClient extends Client {
  27904. constructor (origin, opts) {
  27905. super(origin, opts)
  27906. if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') {
  27907. throw new InvalidArgumentError('Argument opts.agent must implement Agent')
  27908. }
  27909. this[kMockAgent] = opts.agent
  27910. this[kOrigin] = origin
  27911. this[kDispatches] = []
  27912. this[kConnected] = 1
  27913. this[kOriginalDispatch] = this.dispatch
  27914. this[kOriginalClose] = this.close.bind(this)
  27915. this.dispatch = buildMockDispatch.call(this)
  27916. this.close = this[kClose]
  27917. }
  27918. get [Symbols.kConnected] () {
  27919. return this[kConnected]
  27920. }
  27921. /**
  27922. * Sets up the base interceptor for mocking replies from undici.
  27923. */
  27924. intercept (opts) {
  27925. return new MockInterceptor(opts, this[kDispatches])
  27926. }
  27927. async [kClose] () {
  27928. await promisify(this[kOriginalClose])()
  27929. this[kConnected] = 0
  27930. this[kMockAgent][Symbols.kClients].delete(this[kOrigin])
  27931. }
  27932. }
  27933. module.exports = MockClient
  27934. /***/ }),
  27935. /***/ 888:
  27936. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27937. "use strict";
  27938. const { UndiciError } = __nccwpck_require__(8045)
  27939. class MockNotMatchedError extends UndiciError {
  27940. constructor (message) {
  27941. super(message)
  27942. Error.captureStackTrace(this, MockNotMatchedError)
  27943. this.name = 'MockNotMatchedError'
  27944. this.message = message || 'The request does not match any registered mock dispatches'
  27945. this.code = 'UND_MOCK_ERR_MOCK_NOT_MATCHED'
  27946. }
  27947. }
  27948. module.exports = {
  27949. MockNotMatchedError
  27950. }
  27951. /***/ }),
  27952. /***/ 410:
  27953. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27954. "use strict";
  27955. const { getResponseData, buildKey, addMockDispatch } = __nccwpck_require__(9323)
  27956. const {
  27957. kDispatches,
  27958. kDispatchKey,
  27959. kDefaultHeaders,
  27960. kDefaultTrailers,
  27961. kContentLength,
  27962. kMockDispatch
  27963. } = __nccwpck_require__(4347)
  27964. const { InvalidArgumentError } = __nccwpck_require__(8045)
  27965. const { buildURL } = __nccwpck_require__(3983)
  27966. /**
  27967. * Defines the scope API for an interceptor reply
  27968. */
  27969. class MockScope {
  27970. constructor (mockDispatch) {
  27971. this[kMockDispatch] = mockDispatch
  27972. }
  27973. /**
  27974. * Delay a reply by a set amount in ms.
  27975. */
  27976. delay (waitInMs) {
  27977. if (typeof waitInMs !== 'number' || !Number.isInteger(waitInMs) || waitInMs <= 0) {
  27978. throw new InvalidArgumentError('waitInMs must be a valid integer > 0')
  27979. }
  27980. this[kMockDispatch].delay = waitInMs
  27981. return this
  27982. }
  27983. /**
  27984. * For a defined reply, never mark as consumed.
  27985. */
  27986. persist () {
  27987. this[kMockDispatch].persist = true
  27988. return this
  27989. }
  27990. /**
  27991. * Allow one to define a reply for a set amount of matching requests.
  27992. */
  27993. times (repeatTimes) {
  27994. if (typeof repeatTimes !== 'number' || !Number.isInteger(repeatTimes) || repeatTimes <= 0) {
  27995. throw new InvalidArgumentError('repeatTimes must be a valid integer > 0')
  27996. }
  27997. this[kMockDispatch].times = repeatTimes
  27998. return this
  27999. }
  28000. }
  28001. /**
  28002. * Defines an interceptor for a Mock
  28003. */
  28004. class MockInterceptor {
  28005. constructor (opts, mockDispatches) {
  28006. if (typeof opts !== 'object') {
  28007. throw new InvalidArgumentError('opts must be an object')
  28008. }
  28009. if (typeof opts.path === 'undefined') {
  28010. throw new InvalidArgumentError('opts.path must be defined')
  28011. }
  28012. if (typeof opts.method === 'undefined') {
  28013. opts.method = 'GET'
  28014. }
  28015. // See https://github.com/nodejs/undici/issues/1245
  28016. // As per RFC 3986, clients are not supposed to send URI
  28017. // fragments to servers when they retrieve a document,
  28018. if (typeof opts.path === 'string') {
  28019. if (opts.query) {
  28020. opts.path = buildURL(opts.path, opts.query)
  28021. } else {
  28022. // Matches https://github.com/nodejs/undici/blob/main/lib/fetch/index.js#L1811
  28023. const parsedURL = new URL(opts.path, 'data://')
  28024. opts.path = parsedURL.pathname + parsedURL.search
  28025. }
  28026. }
  28027. if (typeof opts.method === 'string') {
  28028. opts.method = opts.method.toUpperCase()
  28029. }
  28030. this[kDispatchKey] = buildKey(opts)
  28031. this[kDispatches] = mockDispatches
  28032. this[kDefaultHeaders] = {}
  28033. this[kDefaultTrailers] = {}
  28034. this[kContentLength] = false
  28035. }
  28036. createMockScopeDispatchData (statusCode, data, responseOptions = {}) {
  28037. const responseData = getResponseData(data)
  28038. const contentLength = this[kContentLength] ? { 'content-length': responseData.length } : {}
  28039. const headers = { ...this[kDefaultHeaders], ...contentLength, ...responseOptions.headers }
  28040. const trailers = { ...this[kDefaultTrailers], ...responseOptions.trailers }
  28041. return { statusCode, data, headers, trailers }
  28042. }
  28043. validateReplyParameters (statusCode, data, responseOptions) {
  28044. if (typeof statusCode === 'undefined') {
  28045. throw new InvalidArgumentError('statusCode must be defined')
  28046. }
  28047. if (typeof data === 'undefined') {
  28048. throw new InvalidArgumentError('data must be defined')
  28049. }
  28050. if (typeof responseOptions !== 'object') {
  28051. throw new InvalidArgumentError('responseOptions must be an object')
  28052. }
  28053. }
  28054. /**
  28055. * Mock an undici request with a defined reply.
  28056. */
  28057. reply (replyData) {
  28058. // Values of reply aren't available right now as they
  28059. // can only be available when the reply callback is invoked.
  28060. if (typeof replyData === 'function') {
  28061. // We'll first wrap the provided callback in another function,
  28062. // this function will properly resolve the data from the callback
  28063. // when invoked.
  28064. const wrappedDefaultsCallback = (opts) => {
  28065. // Our reply options callback contains the parameter for statusCode, data and options.
  28066. const resolvedData = replyData(opts)
  28067. // Check if it is in the right format
  28068. if (typeof resolvedData !== 'object') {
  28069. throw new InvalidArgumentError('reply options callback must return an object')
  28070. }
  28071. const { statusCode, data = '', responseOptions = {} } = resolvedData
  28072. this.validateReplyParameters(statusCode, data, responseOptions)
  28073. // Since the values can be obtained immediately we return them
  28074. // from this higher order function that will be resolved later.
  28075. return {
  28076. ...this.createMockScopeDispatchData(statusCode, data, responseOptions)
  28077. }
  28078. }
  28079. // Add usual dispatch data, but this time set the data parameter to function that will eventually provide data.
  28080. const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], wrappedDefaultsCallback)
  28081. return new MockScope(newMockDispatch)
  28082. }
  28083. // We can have either one or three parameters, if we get here,
  28084. // we should have 1-3 parameters. So we spread the arguments of
  28085. // this function to obtain the parameters, since replyData will always
  28086. // just be the statusCode.
  28087. const [statusCode, data = '', responseOptions = {}] = [...arguments]
  28088. this.validateReplyParameters(statusCode, data, responseOptions)
  28089. // Send in-already provided data like usual
  28090. const dispatchData = this.createMockScopeDispatchData(statusCode, data, responseOptions)
  28091. const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], dispatchData)
  28092. return new MockScope(newMockDispatch)
  28093. }
  28094. /**
  28095. * Mock an undici request with a defined error.
  28096. */
  28097. replyWithError (error) {
  28098. if (typeof error === 'undefined') {
  28099. throw new InvalidArgumentError('error must be defined')
  28100. }
  28101. const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error })
  28102. return new MockScope(newMockDispatch)
  28103. }
  28104. /**
  28105. * Set default reply headers on the interceptor for subsequent replies
  28106. */
  28107. defaultReplyHeaders (headers) {
  28108. if (typeof headers === 'undefined') {
  28109. throw new InvalidArgumentError('headers must be defined')
  28110. }
  28111. this[kDefaultHeaders] = headers
  28112. return this
  28113. }
  28114. /**
  28115. * Set default reply trailers on the interceptor for subsequent replies
  28116. */
  28117. defaultReplyTrailers (trailers) {
  28118. if (typeof trailers === 'undefined') {
  28119. throw new InvalidArgumentError('trailers must be defined')
  28120. }
  28121. this[kDefaultTrailers] = trailers
  28122. return this
  28123. }
  28124. /**
  28125. * Set reply content length header for replies on the interceptor
  28126. */
  28127. replyContentLength () {
  28128. this[kContentLength] = true
  28129. return this
  28130. }
  28131. }
  28132. module.exports.MockInterceptor = MockInterceptor
  28133. module.exports.MockScope = MockScope
  28134. /***/ }),
  28135. /***/ 6193:
  28136. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28137. "use strict";
  28138. const { promisify } = __nccwpck_require__(3837)
  28139. const Pool = __nccwpck_require__(4634)
  28140. const { buildMockDispatch } = __nccwpck_require__(9323)
  28141. const {
  28142. kDispatches,
  28143. kMockAgent,
  28144. kClose,
  28145. kOriginalClose,
  28146. kOrigin,
  28147. kOriginalDispatch,
  28148. kConnected
  28149. } = __nccwpck_require__(4347)
  28150. const { MockInterceptor } = __nccwpck_require__(410)
  28151. const Symbols = __nccwpck_require__(2785)
  28152. const { InvalidArgumentError } = __nccwpck_require__(8045)
  28153. /**
  28154. * MockPool provides an API that extends the Pool to influence the mockDispatches.
  28155. */
  28156. class MockPool extends Pool {
  28157. constructor (origin, opts) {
  28158. super(origin, opts)
  28159. if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') {
  28160. throw new InvalidArgumentError('Argument opts.agent must implement Agent')
  28161. }
  28162. this[kMockAgent] = opts.agent
  28163. this[kOrigin] = origin
  28164. this[kDispatches] = []
  28165. this[kConnected] = 1
  28166. this[kOriginalDispatch] = this.dispatch
  28167. this[kOriginalClose] = this.close.bind(this)
  28168. this.dispatch = buildMockDispatch.call(this)
  28169. this.close = this[kClose]
  28170. }
  28171. get [Symbols.kConnected] () {
  28172. return this[kConnected]
  28173. }
  28174. /**
  28175. * Sets up the base interceptor for mocking replies from undici.
  28176. */
  28177. intercept (opts) {
  28178. return new MockInterceptor(opts, this[kDispatches])
  28179. }
  28180. async [kClose] () {
  28181. await promisify(this[kOriginalClose])()
  28182. this[kConnected] = 0
  28183. this[kMockAgent][Symbols.kClients].delete(this[kOrigin])
  28184. }
  28185. }
  28186. module.exports = MockPool
  28187. /***/ }),
  28188. /***/ 4347:
  28189. /***/ ((module) => {
  28190. "use strict";
  28191. module.exports = {
  28192. kAgent: Symbol('agent'),
  28193. kOptions: Symbol('options'),
  28194. kFactory: Symbol('factory'),
  28195. kDispatches: Symbol('dispatches'),
  28196. kDispatchKey: Symbol('dispatch key'),
  28197. kDefaultHeaders: Symbol('default headers'),
  28198. kDefaultTrailers: Symbol('default trailers'),
  28199. kContentLength: Symbol('content length'),
  28200. kMockAgent: Symbol('mock agent'),
  28201. kMockAgentSet: Symbol('mock agent set'),
  28202. kMockAgentGet: Symbol('mock agent get'),
  28203. kMockDispatch: Symbol('mock dispatch'),
  28204. kClose: Symbol('close'),
  28205. kOriginalClose: Symbol('original agent close'),
  28206. kOrigin: Symbol('origin'),
  28207. kIsMockActive: Symbol('is mock active'),
  28208. kNetConnect: Symbol('net connect'),
  28209. kGetNetConnect: Symbol('get net connect'),
  28210. kConnected: Symbol('connected')
  28211. }
  28212. /***/ }),
  28213. /***/ 9323:
  28214. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28215. "use strict";
  28216. const { MockNotMatchedError } = __nccwpck_require__(888)
  28217. const {
  28218. kDispatches,
  28219. kMockAgent,
  28220. kOriginalDispatch,
  28221. kOrigin,
  28222. kGetNetConnect
  28223. } = __nccwpck_require__(4347)
  28224. const { buildURL, nop } = __nccwpck_require__(3983)
  28225. const { STATUS_CODES } = __nccwpck_require__(3685)
  28226. const {
  28227. types: {
  28228. isPromise
  28229. }
  28230. } = __nccwpck_require__(3837)
  28231. function matchValue (match, value) {
  28232. if (typeof match === 'string') {
  28233. return match === value
  28234. }
  28235. if (match instanceof RegExp) {
  28236. return match.test(value)
  28237. }
  28238. if (typeof match === 'function') {
  28239. return match(value) === true
  28240. }
  28241. return false
  28242. }
  28243. function lowerCaseEntries (headers) {
  28244. return Object.fromEntries(
  28245. Object.entries(headers).map(([headerName, headerValue]) => {
  28246. return [headerName.toLocaleLowerCase(), headerValue]
  28247. })
  28248. )
  28249. }
  28250. /**
  28251. * @param {import('../../index').Headers|string[]|Record<string, string>} headers
  28252. * @param {string} key
  28253. */
  28254. function getHeaderByName (headers, key) {
  28255. if (Array.isArray(headers)) {
  28256. for (let i = 0; i < headers.length; i += 2) {
  28257. if (headers[i].toLocaleLowerCase() === key.toLocaleLowerCase()) {
  28258. return headers[i + 1]
  28259. }
  28260. }
  28261. return undefined
  28262. } else if (typeof headers.get === 'function') {
  28263. return headers.get(key)
  28264. } else {
  28265. return lowerCaseEntries(headers)[key.toLocaleLowerCase()]
  28266. }
  28267. }
  28268. /** @param {string[]} headers */
  28269. function buildHeadersFromArray (headers) { // fetch HeadersList
  28270. const clone = headers.slice()
  28271. const entries = []
  28272. for (let index = 0; index < clone.length; index += 2) {
  28273. entries.push([clone[index], clone[index + 1]])
  28274. }
  28275. return Object.fromEntries(entries)
  28276. }
  28277. function matchHeaders (mockDispatch, headers) {
  28278. if (typeof mockDispatch.headers === 'function') {
  28279. if (Array.isArray(headers)) { // fetch HeadersList
  28280. headers = buildHeadersFromArray(headers)
  28281. }
  28282. return mockDispatch.headers(headers ? lowerCaseEntries(headers) : {})
  28283. }
  28284. if (typeof mockDispatch.headers === 'undefined') {
  28285. return true
  28286. }
  28287. if (typeof headers !== 'object' || typeof mockDispatch.headers !== 'object') {
  28288. return false
  28289. }
  28290. for (const [matchHeaderName, matchHeaderValue] of Object.entries(mockDispatch.headers)) {
  28291. const headerValue = getHeaderByName(headers, matchHeaderName)
  28292. if (!matchValue(matchHeaderValue, headerValue)) {
  28293. return false
  28294. }
  28295. }
  28296. return true
  28297. }
  28298. function safeUrl (path) {
  28299. if (typeof path !== 'string') {
  28300. return path
  28301. }
  28302. const pathSegments = path.split('?')
  28303. if (pathSegments.length !== 2) {
  28304. return path
  28305. }
  28306. const qp = new URLSearchParams(pathSegments.pop())
  28307. qp.sort()
  28308. return [...pathSegments, qp.toString()].join('?')
  28309. }
  28310. function matchKey (mockDispatch, { path, method, body, headers }) {
  28311. const pathMatch = matchValue(mockDispatch.path, path)
  28312. const methodMatch = matchValue(mockDispatch.method, method)
  28313. const bodyMatch = typeof mockDispatch.body !== 'undefined' ? matchValue(mockDispatch.body, body) : true
  28314. const headersMatch = matchHeaders(mockDispatch, headers)
  28315. return pathMatch && methodMatch && bodyMatch && headersMatch
  28316. }
  28317. function getResponseData (data) {
  28318. if (Buffer.isBuffer(data)) {
  28319. return data
  28320. } else if (typeof data === 'object') {
  28321. return JSON.stringify(data)
  28322. } else {
  28323. return data.toString()
  28324. }
  28325. }
  28326. function getMockDispatch (mockDispatches, key) {
  28327. const basePath = key.query ? buildURL(key.path, key.query) : key.path
  28328. const resolvedPath = typeof basePath === 'string' ? safeUrl(basePath) : basePath
  28329. // Match path
  28330. let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path }) => matchValue(safeUrl(path), resolvedPath))
  28331. if (matchedMockDispatches.length === 0) {
  28332. throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`)
  28333. }
  28334. // Match method
  28335. matchedMockDispatches = matchedMockDispatches.filter(({ method }) => matchValue(method, key.method))
  28336. if (matchedMockDispatches.length === 0) {
  28337. throw new MockNotMatchedError(`Mock dispatch not matched for method '${key.method}'`)
  28338. }
  28339. // Match body
  28340. matchedMockDispatches = matchedMockDispatches.filter(({ body }) => typeof body !== 'undefined' ? matchValue(body, key.body) : true)
  28341. if (matchedMockDispatches.length === 0) {
  28342. throw new MockNotMatchedError(`Mock dispatch not matched for body '${key.body}'`)
  28343. }
  28344. // Match headers
  28345. matchedMockDispatches = matchedMockDispatches.filter((mockDispatch) => matchHeaders(mockDispatch, key.headers))
  28346. if (matchedMockDispatches.length === 0) {
  28347. throw new MockNotMatchedError(`Mock dispatch not matched for headers '${typeof key.headers === 'object' ? JSON.stringify(key.headers) : key.headers}'`)
  28348. }
  28349. return matchedMockDispatches[0]
  28350. }
  28351. function addMockDispatch (mockDispatches, key, data) {
  28352. const baseData = { timesInvoked: 0, times: 1, persist: false, consumed: false }
  28353. const replyData = typeof data === 'function' ? { callback: data } : { ...data }
  28354. const newMockDispatch = { ...baseData, ...key, pending: true, data: { error: null, ...replyData } }
  28355. mockDispatches.push(newMockDispatch)
  28356. return newMockDispatch
  28357. }
  28358. function deleteMockDispatch (mockDispatches, key) {
  28359. const index = mockDispatches.findIndex(dispatch => {
  28360. if (!dispatch.consumed) {
  28361. return false
  28362. }
  28363. return matchKey(dispatch, key)
  28364. })
  28365. if (index !== -1) {
  28366. mockDispatches.splice(index, 1)
  28367. }
  28368. }
  28369. function buildKey (opts) {
  28370. const { path, method, body, headers, query } = opts
  28371. return {
  28372. path,
  28373. method,
  28374. body,
  28375. headers,
  28376. query
  28377. }
  28378. }
  28379. function generateKeyValues (data) {
  28380. return Object.entries(data).reduce((keyValuePairs, [key, value]) => [
  28381. ...keyValuePairs,
  28382. Buffer.from(`${key}`),
  28383. Array.isArray(value) ? value.map(x => Buffer.from(`${x}`)) : Buffer.from(`${value}`)
  28384. ], [])
  28385. }
  28386. /**
  28387. * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
  28388. * @param {number} statusCode
  28389. */
  28390. function getStatusText (statusCode) {
  28391. return STATUS_CODES[statusCode] || 'unknown'
  28392. }
  28393. async function getResponse (body) {
  28394. const buffers = []
  28395. for await (const data of body) {
  28396. buffers.push(data)
  28397. }
  28398. return Buffer.concat(buffers).toString('utf8')
  28399. }
  28400. /**
  28401. * Mock dispatch function used to simulate undici dispatches
  28402. */
  28403. function mockDispatch (opts, handler) {
  28404. // Get mock dispatch from built key
  28405. const key = buildKey(opts)
  28406. const mockDispatch = getMockDispatch(this[kDispatches], key)
  28407. mockDispatch.timesInvoked++
  28408. // Here's where we resolve a callback if a callback is present for the dispatch data.
  28409. if (mockDispatch.data.callback) {
  28410. mockDispatch.data = { ...mockDispatch.data, ...mockDispatch.data.callback(opts) }
  28411. }
  28412. // Parse mockDispatch data
  28413. const { data: { statusCode, data, headers, trailers, error }, delay, persist } = mockDispatch
  28414. const { timesInvoked, times } = mockDispatch
  28415. // If it's used up and not persistent, mark as consumed
  28416. mockDispatch.consumed = !persist && timesInvoked >= times
  28417. mockDispatch.pending = timesInvoked < times
  28418. // If specified, trigger dispatch error
  28419. if (error !== null) {
  28420. deleteMockDispatch(this[kDispatches], key)
  28421. handler.onError(error)
  28422. return true
  28423. }
  28424. // Handle the request with a delay if necessary
  28425. if (typeof delay === 'number' && delay > 0) {
  28426. setTimeout(() => {
  28427. handleReply(this[kDispatches])
  28428. }, delay)
  28429. } else {
  28430. handleReply(this[kDispatches])
  28431. }
  28432. function handleReply (mockDispatches, _data = data) {
  28433. // fetch's HeadersList is a 1D string array
  28434. const optsHeaders = Array.isArray(opts.headers)
  28435. ? buildHeadersFromArray(opts.headers)
  28436. : opts.headers
  28437. const body = typeof _data === 'function'
  28438. ? _data({ ...opts, headers: optsHeaders })
  28439. : _data
  28440. // util.types.isPromise is likely needed for jest.
  28441. if (isPromise(body)) {
  28442. // If handleReply is asynchronous, throwing an error
  28443. // in the callback will reject the promise, rather than
  28444. // synchronously throw the error, which breaks some tests.
  28445. // Rather, we wait for the callback to resolve if it is a
  28446. // promise, and then re-run handleReply with the new body.
  28447. body.then((newData) => handleReply(mockDispatches, newData))
  28448. return
  28449. }
  28450. const responseData = getResponseData(body)
  28451. const responseHeaders = generateKeyValues(headers)
  28452. const responseTrailers = generateKeyValues(trailers)
  28453. handler.abort = nop
  28454. handler.onHeaders(statusCode, responseHeaders, resume, getStatusText(statusCode))
  28455. handler.onData(Buffer.from(responseData))
  28456. handler.onComplete(responseTrailers)
  28457. deleteMockDispatch(mockDispatches, key)
  28458. }
  28459. function resume () {}
  28460. return true
  28461. }
  28462. function buildMockDispatch () {
  28463. const agent = this[kMockAgent]
  28464. const origin = this[kOrigin]
  28465. const originalDispatch = this[kOriginalDispatch]
  28466. return function dispatch (opts, handler) {
  28467. if (agent.isMockActive) {
  28468. try {
  28469. mockDispatch.call(this, opts, handler)
  28470. } catch (error) {
  28471. if (error instanceof MockNotMatchedError) {
  28472. const netConnect = agent[kGetNetConnect]()
  28473. if (netConnect === false) {
  28474. throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`)
  28475. }
  28476. if (checkNetConnect(netConnect, origin)) {
  28477. originalDispatch.call(this, opts, handler)
  28478. } else {
  28479. throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`)
  28480. }
  28481. } else {
  28482. throw error
  28483. }
  28484. }
  28485. } else {
  28486. originalDispatch.call(this, opts, handler)
  28487. }
  28488. }
  28489. }
  28490. function checkNetConnect (netConnect, origin) {
  28491. const url = new URL(origin)
  28492. if (netConnect === true) {
  28493. return true
  28494. } else if (Array.isArray(netConnect) && netConnect.some((matcher) => matchValue(matcher, url.host))) {
  28495. return true
  28496. }
  28497. return false
  28498. }
  28499. function buildMockOptions (opts) {
  28500. if (opts) {
  28501. const { agent, ...mockOptions } = opts
  28502. return mockOptions
  28503. }
  28504. }
  28505. module.exports = {
  28506. getResponseData,
  28507. getMockDispatch,
  28508. addMockDispatch,
  28509. deleteMockDispatch,
  28510. buildKey,
  28511. generateKeyValues,
  28512. matchValue,
  28513. getResponse,
  28514. getStatusText,
  28515. mockDispatch,
  28516. buildMockDispatch,
  28517. checkNetConnect,
  28518. buildMockOptions,
  28519. getHeaderByName
  28520. }
  28521. /***/ }),
  28522. /***/ 6823:
  28523. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28524. "use strict";
  28525. const { Transform } = __nccwpck_require__(2781)
  28526. const { Console } = __nccwpck_require__(6206)
  28527. /**
  28528. * Gets the output of `console.table(…)` as a string.
  28529. */
  28530. module.exports = class PendingInterceptorsFormatter {
  28531. constructor ({ disableColors } = {}) {
  28532. this.transform = new Transform({
  28533. transform (chunk, _enc, cb) {
  28534. cb(null, chunk)
  28535. }
  28536. })
  28537. this.logger = new Console({
  28538. stdout: this.transform,
  28539. inspectOptions: {
  28540. colors: !disableColors && !process.env.CI
  28541. }
  28542. })
  28543. }
  28544. format (pendingInterceptors) {
  28545. const withPrettyHeaders = pendingInterceptors.map(
  28546. ({ method, path, data: { statusCode }, persist, times, timesInvoked, origin }) => ({
  28547. Method: method,
  28548. Origin: origin,
  28549. Path: path,
  28550. 'Status code': statusCode,
  28551. Persistent: persist ? '✅' : '❌',
  28552. Invocations: timesInvoked,
  28553. Remaining: persist ? Infinity : times - timesInvoked
  28554. }))
  28555. this.logger.table(withPrettyHeaders)
  28556. return this.transform.read().toString()
  28557. }
  28558. }
  28559. /***/ }),
  28560. /***/ 8891:
  28561. /***/ ((module) => {
  28562. "use strict";
  28563. const singulars = {
  28564. pronoun: 'it',
  28565. is: 'is',
  28566. was: 'was',
  28567. this: 'this'
  28568. }
  28569. const plurals = {
  28570. pronoun: 'they',
  28571. is: 'are',
  28572. was: 'were',
  28573. this: 'these'
  28574. }
  28575. module.exports = class Pluralizer {
  28576. constructor (singular, plural) {
  28577. this.singular = singular
  28578. this.plural = plural
  28579. }
  28580. pluralize (count) {
  28581. const one = count === 1
  28582. const keys = one ? singulars : plurals
  28583. const noun = one ? this.singular : this.plural
  28584. return { ...keys, count, noun }
  28585. }
  28586. }
  28587. /***/ }),
  28588. /***/ 8266:
  28589. /***/ ((module) => {
  28590. "use strict";
  28591. /* eslint-disable */
  28592. // Extracted from node/lib/internal/fixed_queue.js
  28593. // Currently optimal queue size, tested on V8 6.0 - 6.6. Must be power of two.
  28594. const kSize = 2048;
  28595. const kMask = kSize - 1;
  28596. // The FixedQueue is implemented as a singly-linked list of fixed-size
  28597. // circular buffers. It looks something like this:
  28598. //
  28599. // head tail
  28600. // | |
  28601. // v v
  28602. // +-----------+ <-----\ +-----------+ <------\ +-----------+
  28603. // | [null] | \----- | next | \------- | next |
  28604. // +-----------+ +-----------+ +-----------+
  28605. // | item | <-- bottom | item | <-- bottom | [empty] |
  28606. // | item | | item | | [empty] |
  28607. // | item | | item | | [empty] |
  28608. // | item | | item | | [empty] |
  28609. // | item | | item | bottom --> | item |
  28610. // | item | | item | | item |
  28611. // | ... | | ... | | ... |
  28612. // | item | | item | | item |
  28613. // | item | | item | | item |
  28614. // | [empty] | <-- top | item | | item |
  28615. // | [empty] | | item | | item |
  28616. // | [empty] | | [empty] | <-- top top --> | [empty] |
  28617. // +-----------+ +-----------+ +-----------+
  28618. //
  28619. // Or, if there is only one circular buffer, it looks something
  28620. // like either of these:
  28621. //
  28622. // head tail head tail
  28623. // | | | |
  28624. // v v v v
  28625. // +-----------+ +-----------+
  28626. // | [null] | | [null] |
  28627. // +-----------+ +-----------+
  28628. // | [empty] | | item |
  28629. // | [empty] | | item |
  28630. // | item | <-- bottom top --> | [empty] |
  28631. // | item | | [empty] |
  28632. // | [empty] | <-- top bottom --> | item |
  28633. // | [empty] | | item |
  28634. // +-----------+ +-----------+
  28635. //
  28636. // Adding a value means moving `top` forward by one, removing means
  28637. // moving `bottom` forward by one. After reaching the end, the queue
  28638. // wraps around.
  28639. //
  28640. // When `top === bottom` the current queue is empty and when
  28641. // `top + 1 === bottom` it's full. This wastes a single space of storage
  28642. // but allows much quicker checks.
  28643. class FixedCircularBuffer {
  28644. constructor() {
  28645. this.bottom = 0;
  28646. this.top = 0;
  28647. this.list = new Array(kSize);
  28648. this.next = null;
  28649. }
  28650. isEmpty() {
  28651. return this.top === this.bottom;
  28652. }
  28653. isFull() {
  28654. return ((this.top + 1) & kMask) === this.bottom;
  28655. }
  28656. push(data) {
  28657. this.list[this.top] = data;
  28658. this.top = (this.top + 1) & kMask;
  28659. }
  28660. shift() {
  28661. const nextItem = this.list[this.bottom];
  28662. if (nextItem === undefined)
  28663. return null;
  28664. this.list[this.bottom] = undefined;
  28665. this.bottom = (this.bottom + 1) & kMask;
  28666. return nextItem;
  28667. }
  28668. }
  28669. module.exports = class FixedQueue {
  28670. constructor() {
  28671. this.head = this.tail = new FixedCircularBuffer();
  28672. }
  28673. isEmpty() {
  28674. return this.head.isEmpty();
  28675. }
  28676. push(data) {
  28677. if (this.head.isFull()) {
  28678. // Head is full: Creates a new queue, sets the old queue's `.next` to it,
  28679. // and sets it as the new main queue.
  28680. this.head = this.head.next = new FixedCircularBuffer();
  28681. }
  28682. this.head.push(data);
  28683. }
  28684. shift() {
  28685. const tail = this.tail;
  28686. const next = tail.shift();
  28687. if (tail.isEmpty() && tail.next !== null) {
  28688. // If there is another queue, it forms the new tail.
  28689. this.tail = tail.next;
  28690. }
  28691. return next;
  28692. }
  28693. };
  28694. /***/ }),
  28695. /***/ 3198:
  28696. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28697. "use strict";
  28698. const DispatcherBase = __nccwpck_require__(4839)
  28699. const FixedQueue = __nccwpck_require__(8266)
  28700. const { kConnected, kSize, kRunning, kPending, kQueued, kBusy, kFree, kUrl, kClose, kDestroy, kDispatch } = __nccwpck_require__(2785)
  28701. const PoolStats = __nccwpck_require__(9689)
  28702. const kClients = Symbol('clients')
  28703. const kNeedDrain = Symbol('needDrain')
  28704. const kQueue = Symbol('queue')
  28705. const kClosedResolve = Symbol('closed resolve')
  28706. const kOnDrain = Symbol('onDrain')
  28707. const kOnConnect = Symbol('onConnect')
  28708. const kOnDisconnect = Symbol('onDisconnect')
  28709. const kOnConnectionError = Symbol('onConnectionError')
  28710. const kGetDispatcher = Symbol('get dispatcher')
  28711. const kAddClient = Symbol('add client')
  28712. const kRemoveClient = Symbol('remove client')
  28713. const kStats = Symbol('stats')
  28714. class PoolBase extends DispatcherBase {
  28715. constructor () {
  28716. super()
  28717. this[kQueue] = new FixedQueue()
  28718. this[kClients] = []
  28719. this[kQueued] = 0
  28720. const pool = this
  28721. this[kOnDrain] = function onDrain (origin, targets) {
  28722. const queue = pool[kQueue]
  28723. let needDrain = false
  28724. while (!needDrain) {
  28725. const item = queue.shift()
  28726. if (!item) {
  28727. break
  28728. }
  28729. pool[kQueued]--
  28730. needDrain = !this.dispatch(item.opts, item.handler)
  28731. }
  28732. this[kNeedDrain] = needDrain
  28733. if (!this[kNeedDrain] && pool[kNeedDrain]) {
  28734. pool[kNeedDrain] = false
  28735. pool.emit('drain', origin, [pool, ...targets])
  28736. }
  28737. if (pool[kClosedResolve] && queue.isEmpty()) {
  28738. Promise
  28739. .all(pool[kClients].map(c => c.close()))
  28740. .then(pool[kClosedResolve])
  28741. }
  28742. }
  28743. this[kOnConnect] = (origin, targets) => {
  28744. pool.emit('connect', origin, [pool, ...targets])
  28745. }
  28746. this[kOnDisconnect] = (origin, targets, err) => {
  28747. pool.emit('disconnect', origin, [pool, ...targets], err)
  28748. }
  28749. this[kOnConnectionError] = (origin, targets, err) => {
  28750. pool.emit('connectionError', origin, [pool, ...targets], err)
  28751. }
  28752. this[kStats] = new PoolStats(this)
  28753. }
  28754. get [kBusy] () {
  28755. return this[kNeedDrain]
  28756. }
  28757. get [kConnected] () {
  28758. return this[kClients].filter(client => client[kConnected]).length
  28759. }
  28760. get [kFree] () {
  28761. return this[kClients].filter(client => client[kConnected] && !client[kNeedDrain]).length
  28762. }
  28763. get [kPending] () {
  28764. let ret = this[kQueued]
  28765. for (const { [kPending]: pending } of this[kClients]) {
  28766. ret += pending
  28767. }
  28768. return ret
  28769. }
  28770. get [kRunning] () {
  28771. let ret = 0
  28772. for (const { [kRunning]: running } of this[kClients]) {
  28773. ret += running
  28774. }
  28775. return ret
  28776. }
  28777. get [kSize] () {
  28778. let ret = this[kQueued]
  28779. for (const { [kSize]: size } of this[kClients]) {
  28780. ret += size
  28781. }
  28782. return ret
  28783. }
  28784. get stats () {
  28785. return this[kStats]
  28786. }
  28787. async [kClose] () {
  28788. if (this[kQueue].isEmpty()) {
  28789. return Promise.all(this[kClients].map(c => c.close()))
  28790. } else {
  28791. return new Promise((resolve) => {
  28792. this[kClosedResolve] = resolve
  28793. })
  28794. }
  28795. }
  28796. async [kDestroy] (err) {
  28797. while (true) {
  28798. const item = this[kQueue].shift()
  28799. if (!item) {
  28800. break
  28801. }
  28802. item.handler.onError(err)
  28803. }
  28804. return Promise.all(this[kClients].map(c => c.destroy(err)))
  28805. }
  28806. [kDispatch] (opts, handler) {
  28807. const dispatcher = this[kGetDispatcher]()
  28808. if (!dispatcher) {
  28809. this[kNeedDrain] = true
  28810. this[kQueue].push({ opts, handler })
  28811. this[kQueued]++
  28812. } else if (!dispatcher.dispatch(opts, handler)) {
  28813. dispatcher[kNeedDrain] = true
  28814. this[kNeedDrain] = !this[kGetDispatcher]()
  28815. }
  28816. return !this[kNeedDrain]
  28817. }
  28818. [kAddClient] (client) {
  28819. client
  28820. .on('drain', this[kOnDrain])
  28821. .on('connect', this[kOnConnect])
  28822. .on('disconnect', this[kOnDisconnect])
  28823. .on('connectionError', this[kOnConnectionError])
  28824. this[kClients].push(client)
  28825. if (this[kNeedDrain]) {
  28826. process.nextTick(() => {
  28827. if (this[kNeedDrain]) {
  28828. this[kOnDrain](client[kUrl], [this, client])
  28829. }
  28830. })
  28831. }
  28832. return this
  28833. }
  28834. [kRemoveClient] (client) {
  28835. client.close(() => {
  28836. const idx = this[kClients].indexOf(client)
  28837. if (idx !== -1) {
  28838. this[kClients].splice(idx, 1)
  28839. }
  28840. })
  28841. this[kNeedDrain] = this[kClients].some(dispatcher => (
  28842. !dispatcher[kNeedDrain] &&
  28843. dispatcher.closed !== true &&
  28844. dispatcher.destroyed !== true
  28845. ))
  28846. }
  28847. }
  28848. module.exports = {
  28849. PoolBase,
  28850. kClients,
  28851. kNeedDrain,
  28852. kAddClient,
  28853. kRemoveClient,
  28854. kGetDispatcher
  28855. }
  28856. /***/ }),
  28857. /***/ 9689:
  28858. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28859. const { kFree, kConnected, kPending, kQueued, kRunning, kSize } = __nccwpck_require__(2785)
  28860. const kPool = Symbol('pool')
  28861. class PoolStats {
  28862. constructor (pool) {
  28863. this[kPool] = pool
  28864. }
  28865. get connected () {
  28866. return this[kPool][kConnected]
  28867. }
  28868. get free () {
  28869. return this[kPool][kFree]
  28870. }
  28871. get pending () {
  28872. return this[kPool][kPending]
  28873. }
  28874. get queued () {
  28875. return this[kPool][kQueued]
  28876. }
  28877. get running () {
  28878. return this[kPool][kRunning]
  28879. }
  28880. get size () {
  28881. return this[kPool][kSize]
  28882. }
  28883. }
  28884. module.exports = PoolStats
  28885. /***/ }),
  28886. /***/ 4634:
  28887. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28888. "use strict";
  28889. const {
  28890. PoolBase,
  28891. kClients,
  28892. kNeedDrain,
  28893. kAddClient,
  28894. kGetDispatcher
  28895. } = __nccwpck_require__(3198)
  28896. const Client = __nccwpck_require__(3598)
  28897. const {
  28898. InvalidArgumentError
  28899. } = __nccwpck_require__(8045)
  28900. const util = __nccwpck_require__(3983)
  28901. const { kUrl, kInterceptors } = __nccwpck_require__(2785)
  28902. const buildConnector = __nccwpck_require__(2067)
  28903. const kOptions = Symbol('options')
  28904. const kConnections = Symbol('connections')
  28905. const kFactory = Symbol('factory')
  28906. function defaultFactory (origin, opts) {
  28907. return new Client(origin, opts)
  28908. }
  28909. class Pool extends PoolBase {
  28910. constructor (origin, {
  28911. connections,
  28912. factory = defaultFactory,
  28913. connect,
  28914. connectTimeout,
  28915. tls,
  28916. maxCachedSessions,
  28917. socketPath,
  28918. autoSelectFamily,
  28919. autoSelectFamilyAttemptTimeout,
  28920. allowH2,
  28921. ...options
  28922. } = {}) {
  28923. super()
  28924. if (connections != null && (!Number.isFinite(connections) || connections < 0)) {
  28925. throw new InvalidArgumentError('invalid connections')
  28926. }
  28927. if (typeof factory !== 'function') {
  28928. throw new InvalidArgumentError('factory must be a function.')
  28929. }
  28930. if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {
  28931. throw new InvalidArgumentError('connect must be a function or an object')
  28932. }
  28933. if (typeof connect !== 'function') {
  28934. connect = buildConnector({
  28935. ...tls,
  28936. maxCachedSessions,
  28937. allowH2,
  28938. socketPath,
  28939. timeout: connectTimeout,
  28940. ...(util.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined),
  28941. ...connect
  28942. })
  28943. }
  28944. this[kInterceptors] = options.interceptors && options.interceptors.Pool && Array.isArray(options.interceptors.Pool)
  28945. ? options.interceptors.Pool
  28946. : []
  28947. this[kConnections] = connections || null
  28948. this[kUrl] = util.parseOrigin(origin)
  28949. this[kOptions] = { ...util.deepClone(options), connect, allowH2 }
  28950. this[kOptions].interceptors = options.interceptors
  28951. ? { ...options.interceptors }
  28952. : undefined
  28953. this[kFactory] = factory
  28954. }
  28955. [kGetDispatcher] () {
  28956. let dispatcher = this[kClients].find(dispatcher => !dispatcher[kNeedDrain])
  28957. if (dispatcher) {
  28958. return dispatcher
  28959. }
  28960. if (!this[kConnections] || this[kClients].length < this[kConnections]) {
  28961. dispatcher = this[kFactory](this[kUrl], this[kOptions])
  28962. this[kAddClient](dispatcher)
  28963. }
  28964. return dispatcher
  28965. }
  28966. }
  28967. module.exports = Pool
  28968. /***/ }),
  28969. /***/ 7858:
  28970. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28971. "use strict";
  28972. const { kProxy, kClose, kDestroy, kInterceptors } = __nccwpck_require__(2785)
  28973. const { URL } = __nccwpck_require__(7310)
  28974. const Agent = __nccwpck_require__(7890)
  28975. const Pool = __nccwpck_require__(4634)
  28976. const DispatcherBase = __nccwpck_require__(4839)
  28977. const { InvalidArgumentError, RequestAbortedError } = __nccwpck_require__(8045)
  28978. const buildConnector = __nccwpck_require__(2067)
  28979. const kAgent = Symbol('proxy agent')
  28980. const kClient = Symbol('proxy client')
  28981. const kProxyHeaders = Symbol('proxy headers')
  28982. const kRequestTls = Symbol('request tls settings')
  28983. const kProxyTls = Symbol('proxy tls settings')
  28984. const kConnectEndpoint = Symbol('connect endpoint function')
  28985. function defaultProtocolPort (protocol) {
  28986. return protocol === 'https:' ? 443 : 80
  28987. }
  28988. function buildProxyOptions (opts) {
  28989. if (typeof opts === 'string') {
  28990. opts = { uri: opts }
  28991. }
  28992. if (!opts || !opts.uri) {
  28993. throw new InvalidArgumentError('Proxy opts.uri is mandatory')
  28994. }
  28995. return {
  28996. uri: opts.uri,
  28997. protocol: opts.protocol || 'https'
  28998. }
  28999. }
  29000. function defaultFactory (origin, opts) {
  29001. return new Pool(origin, opts)
  29002. }
  29003. class ProxyAgent extends DispatcherBase {
  29004. constructor (opts) {
  29005. super(opts)
  29006. this[kProxy] = buildProxyOptions(opts)
  29007. this[kAgent] = new Agent(opts)
  29008. this[kInterceptors] = opts.interceptors && opts.interceptors.ProxyAgent && Array.isArray(opts.interceptors.ProxyAgent)
  29009. ? opts.interceptors.ProxyAgent
  29010. : []
  29011. if (typeof opts === 'string') {
  29012. opts = { uri: opts }
  29013. }
  29014. if (!opts || !opts.uri) {
  29015. throw new InvalidArgumentError('Proxy opts.uri is mandatory')
  29016. }
  29017. const { clientFactory = defaultFactory } = opts
  29018. if (typeof clientFactory !== 'function') {
  29019. throw new InvalidArgumentError('Proxy opts.clientFactory must be a function.')
  29020. }
  29021. this[kRequestTls] = opts.requestTls
  29022. this[kProxyTls] = opts.proxyTls
  29023. this[kProxyHeaders] = opts.headers || {}
  29024. const resolvedUrl = new URL(opts.uri)
  29025. const { origin, port, host, username, password } = resolvedUrl
  29026. if (opts.auth && opts.token) {
  29027. throw new InvalidArgumentError('opts.auth cannot be used in combination with opts.token')
  29028. } else if (opts.auth) {
  29029. /* @deprecated in favour of opts.token */
  29030. this[kProxyHeaders]['proxy-authorization'] = `Basic ${opts.auth}`
  29031. } else if (opts.token) {
  29032. this[kProxyHeaders]['proxy-authorization'] = opts.token
  29033. } else if (username && password) {
  29034. this[kProxyHeaders]['proxy-authorization'] = `Basic ${Buffer.from(`${decodeURIComponent(username)}:${decodeURIComponent(password)}`).toString('base64')}`
  29035. }
  29036. const connect = buildConnector({ ...opts.proxyTls })
  29037. this[kConnectEndpoint] = buildConnector({ ...opts.requestTls })
  29038. this[kClient] = clientFactory(resolvedUrl, { connect })
  29039. this[kAgent] = new Agent({
  29040. ...opts,
  29041. connect: async (opts, callback) => {
  29042. let requestedHost = opts.host
  29043. if (!opts.port) {
  29044. requestedHost += `:${defaultProtocolPort(opts.protocol)}`
  29045. }
  29046. try {
  29047. const { socket, statusCode } = await this[kClient].connect({
  29048. origin,
  29049. port,
  29050. path: requestedHost,
  29051. signal: opts.signal,
  29052. headers: {
  29053. ...this[kProxyHeaders],
  29054. host
  29055. }
  29056. })
  29057. if (statusCode !== 200) {
  29058. socket.on('error', () => {}).destroy()
  29059. callback(new RequestAbortedError(`Proxy response (${statusCode}) !== 200 when HTTP Tunneling`))
  29060. }
  29061. if (opts.protocol !== 'https:') {
  29062. callback(null, socket)
  29063. return
  29064. }
  29065. let servername
  29066. if (this[kRequestTls]) {
  29067. servername = this[kRequestTls].servername
  29068. } else {
  29069. servername = opts.servername
  29070. }
  29071. this[kConnectEndpoint]({ ...opts, servername, httpSocket: socket }, callback)
  29072. } catch (err) {
  29073. callback(err)
  29074. }
  29075. }
  29076. })
  29077. }
  29078. dispatch (opts, handler) {
  29079. const { host } = new URL(opts.origin)
  29080. const headers = buildHeaders(opts.headers)
  29081. throwIfProxyAuthIsSent(headers)
  29082. return this[kAgent].dispatch(
  29083. {
  29084. ...opts,
  29085. headers: {
  29086. ...headers,
  29087. host
  29088. }
  29089. },
  29090. handler
  29091. )
  29092. }
  29093. async [kClose] () {
  29094. await this[kAgent].close()
  29095. await this[kClient].close()
  29096. }
  29097. async [kDestroy] () {
  29098. await this[kAgent].destroy()
  29099. await this[kClient].destroy()
  29100. }
  29101. }
  29102. /**
  29103. * @param {string[] | Record<string, string>} headers
  29104. * @returns {Record<string, string>}
  29105. */
  29106. function buildHeaders (headers) {
  29107. // When using undici.fetch, the headers list is stored
  29108. // as an array.
  29109. if (Array.isArray(headers)) {
  29110. /** @type {Record<string, string>} */
  29111. const headersPair = {}
  29112. for (let i = 0; i < headers.length; i += 2) {
  29113. headersPair[headers[i]] = headers[i + 1]
  29114. }
  29115. return headersPair
  29116. }
  29117. return headers
  29118. }
  29119. /**
  29120. * @param {Record<string, string>} headers
  29121. *
  29122. * Previous versions of ProxyAgent suggests the Proxy-Authorization in request headers
  29123. * Nevertheless, it was changed and to avoid a security vulnerability by end users
  29124. * this check was created.
  29125. * It should be removed in the next major version for performance reasons
  29126. */
  29127. function throwIfProxyAuthIsSent (headers) {
  29128. const existProxyAuth = headers && Object.keys(headers)
  29129. .find((key) => key.toLowerCase() === 'proxy-authorization')
  29130. if (existProxyAuth) {
  29131. throw new InvalidArgumentError('Proxy-Authorization should be sent in ProxyAgent constructor')
  29132. }
  29133. }
  29134. module.exports = ProxyAgent
  29135. /***/ }),
  29136. /***/ 9459:
  29137. /***/ ((module) => {
  29138. "use strict";
  29139. let fastNow = Date.now()
  29140. let fastNowTimeout
  29141. const fastTimers = []
  29142. function onTimeout () {
  29143. fastNow = Date.now()
  29144. let len = fastTimers.length
  29145. let idx = 0
  29146. while (idx < len) {
  29147. const timer = fastTimers[idx]
  29148. if (timer.state === 0) {
  29149. timer.state = fastNow + timer.delay
  29150. } else if (timer.state > 0 && fastNow >= timer.state) {
  29151. timer.state = -1
  29152. timer.callback(timer.opaque)
  29153. }
  29154. if (timer.state === -1) {
  29155. timer.state = -2
  29156. if (idx !== len - 1) {
  29157. fastTimers[idx] = fastTimers.pop()
  29158. } else {
  29159. fastTimers.pop()
  29160. }
  29161. len -= 1
  29162. } else {
  29163. idx += 1
  29164. }
  29165. }
  29166. if (fastTimers.length > 0) {
  29167. refreshTimeout()
  29168. }
  29169. }
  29170. function refreshTimeout () {
  29171. if (fastNowTimeout && fastNowTimeout.refresh) {
  29172. fastNowTimeout.refresh()
  29173. } else {
  29174. clearTimeout(fastNowTimeout)
  29175. fastNowTimeout = setTimeout(onTimeout, 1e3)
  29176. if (fastNowTimeout.unref) {
  29177. fastNowTimeout.unref()
  29178. }
  29179. }
  29180. }
  29181. class Timeout {
  29182. constructor (callback, delay, opaque) {
  29183. this.callback = callback
  29184. this.delay = delay
  29185. this.opaque = opaque
  29186. // -2 not in timer list
  29187. // -1 in timer list but inactive
  29188. // 0 in timer list waiting for time
  29189. // > 0 in timer list waiting for time to expire
  29190. this.state = -2
  29191. this.refresh()
  29192. }
  29193. refresh () {
  29194. if (this.state === -2) {
  29195. fastTimers.push(this)
  29196. if (!fastNowTimeout || fastTimers.length === 1) {
  29197. refreshTimeout()
  29198. }
  29199. }
  29200. this.state = 0
  29201. }
  29202. clear () {
  29203. this.state = -1
  29204. }
  29205. }
  29206. module.exports = {
  29207. setTimeout (callback, delay, opaque) {
  29208. return delay < 1e3
  29209. ? setTimeout(callback, delay, opaque)
  29210. : new Timeout(callback, delay, opaque)
  29211. },
  29212. clearTimeout (timeout) {
  29213. if (timeout instanceof Timeout) {
  29214. timeout.clear()
  29215. } else {
  29216. clearTimeout(timeout)
  29217. }
  29218. }
  29219. }
  29220. /***/ }),
  29221. /***/ 5354:
  29222. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  29223. "use strict";
  29224. const diagnosticsChannel = __nccwpck_require__(7643)
  29225. const { uid, states } = __nccwpck_require__(9188)
  29226. const {
  29227. kReadyState,
  29228. kSentClose,
  29229. kByteParser,
  29230. kReceivedClose
  29231. } = __nccwpck_require__(7578)
  29232. const { fireEvent, failWebsocketConnection } = __nccwpck_require__(5515)
  29233. const { CloseEvent } = __nccwpck_require__(2611)
  29234. const { makeRequest } = __nccwpck_require__(8359)
  29235. const { fetching } = __nccwpck_require__(4881)
  29236. const { Headers } = __nccwpck_require__(554)
  29237. const { getGlobalDispatcher } = __nccwpck_require__(1892)
  29238. const { kHeadersList } = __nccwpck_require__(2785)
  29239. const channels = {}
  29240. channels.open = diagnosticsChannel.channel('undici:websocket:open')
  29241. channels.close = diagnosticsChannel.channel('undici:websocket:close')
  29242. channels.socketError = diagnosticsChannel.channel('undici:websocket:socket_error')
  29243. /** @type {import('crypto')} */
  29244. let crypto
  29245. try {
  29246. crypto = __nccwpck_require__(6113)
  29247. } catch {
  29248. }
  29249. /**
  29250. * @see https://websockets.spec.whatwg.org/#concept-websocket-establish
  29251. * @param {URL} url
  29252. * @param {string|string[]} protocols
  29253. * @param {import('./websocket').WebSocket} ws
  29254. * @param {(response: any) => void} onEstablish
  29255. * @param {Partial<import('../../types/websocket').WebSocketInit>} options
  29256. */
  29257. function establishWebSocketConnection (url, protocols, ws, onEstablish, options) {
  29258. // 1. Let requestURL be a copy of url, with its scheme set to "http", if url’s
  29259. // scheme is "ws", and to "https" otherwise.
  29260. const requestURL = url
  29261. requestURL.protocol = url.protocol === 'ws:' ? 'http:' : 'https:'
  29262. // 2. Let request be a new request, whose URL is requestURL, client is client,
  29263. // service-workers mode is "none", referrer is "no-referrer", mode is
  29264. // "websocket", credentials mode is "include", cache mode is "no-store" ,
  29265. // and redirect mode is "error".
  29266. const request = makeRequest({
  29267. urlList: [requestURL],
  29268. serviceWorkers: 'none',
  29269. referrer: 'no-referrer',
  29270. mode: 'websocket',
  29271. credentials: 'include',
  29272. cache: 'no-store',
  29273. redirect: 'error'
  29274. })
  29275. // Note: undici extension, allow setting custom headers.
  29276. if (options.headers) {
  29277. const headersList = new Headers(options.headers)[kHeadersList]
  29278. request.headersList = headersList
  29279. }
  29280. // 3. Append (`Upgrade`, `websocket`) to request’s header list.
  29281. // 4. Append (`Connection`, `Upgrade`) to request’s header list.
  29282. // Note: both of these are handled by undici currently.
  29283. // https://github.com/nodejs/undici/blob/68c269c4144c446f3f1220951338daef4a6b5ec4/lib/client.js#L1397
  29284. // 5. Let keyValue be a nonce consisting of a randomly selected
  29285. // 16-byte value that has been forgiving-base64-encoded and
  29286. // isomorphic encoded.
  29287. const keyValue = crypto.randomBytes(16).toString('base64')
  29288. // 6. Append (`Sec-WebSocket-Key`, keyValue) to request’s
  29289. // header list.
  29290. request.headersList.append('sec-websocket-key', keyValue)
  29291. // 7. Append (`Sec-WebSocket-Version`, `13`) to request’s
  29292. // header list.
  29293. request.headersList.append('sec-websocket-version', '13')
  29294. // 8. For each protocol in protocols, combine
  29295. // (`Sec-WebSocket-Protocol`, protocol) in request’s header
  29296. // list.
  29297. for (const protocol of protocols) {
  29298. request.headersList.append('sec-websocket-protocol', protocol)
  29299. }
  29300. // 9. Let permessageDeflate be a user-agent defined
  29301. // "permessage-deflate" extension header value.
  29302. // https://github.com/mozilla/gecko-dev/blob/ce78234f5e653a5d3916813ff990f053510227bc/netwerk/protocol/websocket/WebSocketChannel.cpp#L2673
  29303. // TODO: enable once permessage-deflate is supported
  29304. const permessageDeflate = '' // 'permessage-deflate; 15'
  29305. // 10. Append (`Sec-WebSocket-Extensions`, permessageDeflate) to
  29306. // request’s header list.
  29307. // request.headersList.append('sec-websocket-extensions', permessageDeflate)
  29308. // 11. Fetch request with useParallelQueue set to true, and
  29309. // processResponse given response being these steps:
  29310. const controller = fetching({
  29311. request,
  29312. useParallelQueue: true,
  29313. dispatcher: options.dispatcher ?? getGlobalDispatcher(),
  29314. processResponse (response) {
  29315. // 1. If response is a network error or its status is not 101,
  29316. // fail the WebSocket connection.
  29317. if (response.type === 'error' || response.status !== 101) {
  29318. failWebsocketConnection(ws, 'Received network error or non-101 status code.')
  29319. return
  29320. }
  29321. // 2. If protocols is not the empty list and extracting header
  29322. // list values given `Sec-WebSocket-Protocol` and response’s
  29323. // header list results in null, failure, or the empty byte
  29324. // sequence, then fail the WebSocket connection.
  29325. if (protocols.length !== 0 && !response.headersList.get('Sec-WebSocket-Protocol')) {
  29326. failWebsocketConnection(ws, 'Server did not respond with sent protocols.')
  29327. return
  29328. }
  29329. // 3. Follow the requirements stated step 2 to step 6, inclusive,
  29330. // of the last set of steps in section 4.1 of The WebSocket
  29331. // Protocol to validate response. This either results in fail
  29332. // the WebSocket connection or the WebSocket connection is
  29333. // established.
  29334. // 2. If the response lacks an |Upgrade| header field or the |Upgrade|
  29335. // header field contains a value that is not an ASCII case-
  29336. // insensitive match for the value "websocket", the client MUST
  29337. // _Fail the WebSocket Connection_.
  29338. if (response.headersList.get('Upgrade')?.toLowerCase() !== 'websocket') {
  29339. failWebsocketConnection(ws, 'Server did not set Upgrade header to "websocket".')
  29340. return
  29341. }
  29342. // 3. If the response lacks a |Connection| header field or the
  29343. // |Connection| header field doesn't contain a token that is an
  29344. // ASCII case-insensitive match for the value "Upgrade", the client
  29345. // MUST _Fail the WebSocket Connection_.
  29346. if (response.headersList.get('Connection')?.toLowerCase() !== 'upgrade') {
  29347. failWebsocketConnection(ws, 'Server did not set Connection header to "upgrade".')
  29348. return
  29349. }
  29350. // 4. If the response lacks a |Sec-WebSocket-Accept| header field or
  29351. // the |Sec-WebSocket-Accept| contains a value other than the
  29352. // base64-encoded SHA-1 of the concatenation of the |Sec-WebSocket-
  29353. // Key| (as a string, not base64-decoded) with the string "258EAFA5-
  29354. // E914-47DA-95CA-C5AB0DC85B11" but ignoring any leading and
  29355. // trailing whitespace, the client MUST _Fail the WebSocket
  29356. // Connection_.
  29357. const secWSAccept = response.headersList.get('Sec-WebSocket-Accept')
  29358. const digest = crypto.createHash('sha1').update(keyValue + uid).digest('base64')
  29359. if (secWSAccept !== digest) {
  29360. failWebsocketConnection(ws, 'Incorrect hash received in Sec-WebSocket-Accept header.')
  29361. return
  29362. }
  29363. // 5. If the response includes a |Sec-WebSocket-Extensions| header
  29364. // field and this header field indicates the use of an extension
  29365. // that was not present in the client's handshake (the server has
  29366. // indicated an extension not requested by the client), the client
  29367. // MUST _Fail the WebSocket Connection_. (The parsing of this
  29368. // header field to determine which extensions are requested is
  29369. // discussed in Section 9.1.)
  29370. const secExtension = response.headersList.get('Sec-WebSocket-Extensions')
  29371. if (secExtension !== null && secExtension !== permessageDeflate) {
  29372. failWebsocketConnection(ws, 'Received different permessage-deflate than the one set.')
  29373. return
  29374. }
  29375. // 6. If the response includes a |Sec-WebSocket-Protocol| header field
  29376. // and this header field indicates the use of a subprotocol that was
  29377. // not present in the client's handshake (the server has indicated a
  29378. // subprotocol not requested by the client), the client MUST _Fail
  29379. // the WebSocket Connection_.
  29380. const secProtocol = response.headersList.get('Sec-WebSocket-Protocol')
  29381. if (secProtocol !== null && secProtocol !== request.headersList.get('Sec-WebSocket-Protocol')) {
  29382. failWebsocketConnection(ws, 'Protocol was not set in the opening handshake.')
  29383. return
  29384. }
  29385. response.socket.on('data', onSocketData)
  29386. response.socket.on('close', onSocketClose)
  29387. response.socket.on('error', onSocketError)
  29388. if (channels.open.hasSubscribers) {
  29389. channels.open.publish({
  29390. address: response.socket.address(),
  29391. protocol: secProtocol,
  29392. extensions: secExtension
  29393. })
  29394. }
  29395. onEstablish(response)
  29396. }
  29397. })
  29398. return controller
  29399. }
  29400. /**
  29401. * @param {Buffer} chunk
  29402. */
  29403. function onSocketData (chunk) {
  29404. if (!this.ws[kByteParser].write(chunk)) {
  29405. this.pause()
  29406. }
  29407. }
  29408. /**
  29409. * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol
  29410. * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.4
  29411. */
  29412. function onSocketClose () {
  29413. const { ws } = this
  29414. // If the TCP connection was closed after the
  29415. // WebSocket closing handshake was completed, the WebSocket connection
  29416. // is said to have been closed _cleanly_.
  29417. const wasClean = ws[kSentClose] && ws[kReceivedClose]
  29418. let code = 1005
  29419. let reason = ''
  29420. const result = ws[kByteParser].closingInfo
  29421. if (result) {
  29422. code = result.code ?? 1005
  29423. reason = result.reason
  29424. } else if (!ws[kSentClose]) {
  29425. // If _The WebSocket
  29426. // Connection is Closed_ and no Close control frame was received by the
  29427. // endpoint (such as could occur if the underlying transport connection
  29428. // is lost), _The WebSocket Connection Close Code_ is considered to be
  29429. // 1006.
  29430. code = 1006
  29431. }
  29432. // 1. Change the ready state to CLOSED (3).
  29433. ws[kReadyState] = states.CLOSED
  29434. // 2. If the user agent was required to fail the WebSocket
  29435. // connection, or if the WebSocket connection was closed
  29436. // after being flagged as full, fire an event named error
  29437. // at the WebSocket object.
  29438. // TODO
  29439. // 3. Fire an event named close at the WebSocket object,
  29440. // using CloseEvent, with the wasClean attribute
  29441. // initialized to true if the connection closed cleanly
  29442. // and false otherwise, the code attribute initialized to
  29443. // the WebSocket connection close code, and the reason
  29444. // attribute initialized to the result of applying UTF-8
  29445. // decode without BOM to the WebSocket connection close
  29446. // reason.
  29447. fireEvent('close', ws, CloseEvent, {
  29448. wasClean, code, reason
  29449. })
  29450. if (channels.close.hasSubscribers) {
  29451. channels.close.publish({
  29452. websocket: ws,
  29453. code,
  29454. reason
  29455. })
  29456. }
  29457. }
  29458. function onSocketError (error) {
  29459. const { ws } = this
  29460. ws[kReadyState] = states.CLOSING
  29461. if (channels.socketError.hasSubscribers) {
  29462. channels.socketError.publish(error)
  29463. }
  29464. this.destroy()
  29465. }
  29466. module.exports = {
  29467. establishWebSocketConnection
  29468. }
  29469. /***/ }),
  29470. /***/ 9188:
  29471. /***/ ((module) => {
  29472. "use strict";
  29473. // This is a Globally Unique Identifier unique used
  29474. // to validate that the endpoint accepts websocket
  29475. // connections.
  29476. // See https://www.rfc-editor.org/rfc/rfc6455.html#section-1.3
  29477. const uid = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'
  29478. /** @type {PropertyDescriptor} */
  29479. const staticPropertyDescriptors = {
  29480. enumerable: true,
  29481. writable: false,
  29482. configurable: false
  29483. }
  29484. const states = {
  29485. CONNECTING: 0,
  29486. OPEN: 1,
  29487. CLOSING: 2,
  29488. CLOSED: 3
  29489. }
  29490. const opcodes = {
  29491. CONTINUATION: 0x0,
  29492. TEXT: 0x1,
  29493. BINARY: 0x2,
  29494. CLOSE: 0x8,
  29495. PING: 0x9,
  29496. PONG: 0xA
  29497. }
  29498. const maxUnsigned16Bit = 2 ** 16 - 1 // 65535
  29499. const parserStates = {
  29500. INFO: 0,
  29501. PAYLOADLENGTH_16: 2,
  29502. PAYLOADLENGTH_64: 3,
  29503. READ_DATA: 4
  29504. }
  29505. const emptyBuffer = Buffer.allocUnsafe(0)
  29506. module.exports = {
  29507. uid,
  29508. staticPropertyDescriptors,
  29509. states,
  29510. opcodes,
  29511. maxUnsigned16Bit,
  29512. parserStates,
  29513. emptyBuffer
  29514. }
  29515. /***/ }),
  29516. /***/ 2611:
  29517. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  29518. "use strict";
  29519. const { webidl } = __nccwpck_require__(1744)
  29520. const { kEnumerableProperty } = __nccwpck_require__(3983)
  29521. const { MessagePort } = __nccwpck_require__(1267)
  29522. /**
  29523. * @see https://html.spec.whatwg.org/multipage/comms.html#messageevent
  29524. */
  29525. class MessageEvent extends Event {
  29526. #eventInit
  29527. constructor (type, eventInitDict = {}) {
  29528. webidl.argumentLengthCheck(arguments, 1, { header: 'MessageEvent constructor' })
  29529. type = webidl.converters.DOMString(type)
  29530. eventInitDict = webidl.converters.MessageEventInit(eventInitDict)
  29531. super(type, eventInitDict)
  29532. this.#eventInit = eventInitDict
  29533. }
  29534. get data () {
  29535. webidl.brandCheck(this, MessageEvent)
  29536. return this.#eventInit.data
  29537. }
  29538. get origin () {
  29539. webidl.brandCheck(this, MessageEvent)
  29540. return this.#eventInit.origin
  29541. }
  29542. get lastEventId () {
  29543. webidl.brandCheck(this, MessageEvent)
  29544. return this.#eventInit.lastEventId
  29545. }
  29546. get source () {
  29547. webidl.brandCheck(this, MessageEvent)
  29548. return this.#eventInit.source
  29549. }
  29550. get ports () {
  29551. webidl.brandCheck(this, MessageEvent)
  29552. if (!Object.isFrozen(this.#eventInit.ports)) {
  29553. Object.freeze(this.#eventInit.ports)
  29554. }
  29555. return this.#eventInit.ports
  29556. }
  29557. initMessageEvent (
  29558. type,
  29559. bubbles = false,
  29560. cancelable = false,
  29561. data = null,
  29562. origin = '',
  29563. lastEventId = '',
  29564. source = null,
  29565. ports = []
  29566. ) {
  29567. webidl.brandCheck(this, MessageEvent)
  29568. webidl.argumentLengthCheck(arguments, 1, { header: 'MessageEvent.initMessageEvent' })
  29569. return new MessageEvent(type, {
  29570. bubbles, cancelable, data, origin, lastEventId, source, ports
  29571. })
  29572. }
  29573. }
  29574. /**
  29575. * @see https://websockets.spec.whatwg.org/#the-closeevent-interface
  29576. */
  29577. class CloseEvent extends Event {
  29578. #eventInit
  29579. constructor (type, eventInitDict = {}) {
  29580. webidl.argumentLengthCheck(arguments, 1, { header: 'CloseEvent constructor' })
  29581. type = webidl.converters.DOMString(type)
  29582. eventInitDict = webidl.converters.CloseEventInit(eventInitDict)
  29583. super(type, eventInitDict)
  29584. this.#eventInit = eventInitDict
  29585. }
  29586. get wasClean () {
  29587. webidl.brandCheck(this, CloseEvent)
  29588. return this.#eventInit.wasClean
  29589. }
  29590. get code () {
  29591. webidl.brandCheck(this, CloseEvent)
  29592. return this.#eventInit.code
  29593. }
  29594. get reason () {
  29595. webidl.brandCheck(this, CloseEvent)
  29596. return this.#eventInit.reason
  29597. }
  29598. }
  29599. // https://html.spec.whatwg.org/multipage/webappapis.html#the-errorevent-interface
  29600. class ErrorEvent extends Event {
  29601. #eventInit
  29602. constructor (type, eventInitDict) {
  29603. webidl.argumentLengthCheck(arguments, 1, { header: 'ErrorEvent constructor' })
  29604. super(type, eventInitDict)
  29605. type = webidl.converters.DOMString(type)
  29606. eventInitDict = webidl.converters.ErrorEventInit(eventInitDict ?? {})
  29607. this.#eventInit = eventInitDict
  29608. }
  29609. get message () {
  29610. webidl.brandCheck(this, ErrorEvent)
  29611. return this.#eventInit.message
  29612. }
  29613. get filename () {
  29614. webidl.brandCheck(this, ErrorEvent)
  29615. return this.#eventInit.filename
  29616. }
  29617. get lineno () {
  29618. webidl.brandCheck(this, ErrorEvent)
  29619. return this.#eventInit.lineno
  29620. }
  29621. get colno () {
  29622. webidl.brandCheck(this, ErrorEvent)
  29623. return this.#eventInit.colno
  29624. }
  29625. get error () {
  29626. webidl.brandCheck(this, ErrorEvent)
  29627. return this.#eventInit.error
  29628. }
  29629. }
  29630. Object.defineProperties(MessageEvent.prototype, {
  29631. [Symbol.toStringTag]: {
  29632. value: 'MessageEvent',
  29633. configurable: true
  29634. },
  29635. data: kEnumerableProperty,
  29636. origin: kEnumerableProperty,
  29637. lastEventId: kEnumerableProperty,
  29638. source: kEnumerableProperty,
  29639. ports: kEnumerableProperty,
  29640. initMessageEvent: kEnumerableProperty
  29641. })
  29642. Object.defineProperties(CloseEvent.prototype, {
  29643. [Symbol.toStringTag]: {
  29644. value: 'CloseEvent',
  29645. configurable: true
  29646. },
  29647. reason: kEnumerableProperty,
  29648. code: kEnumerableProperty,
  29649. wasClean: kEnumerableProperty
  29650. })
  29651. Object.defineProperties(ErrorEvent.prototype, {
  29652. [Symbol.toStringTag]: {
  29653. value: 'ErrorEvent',
  29654. configurable: true
  29655. },
  29656. message: kEnumerableProperty,
  29657. filename: kEnumerableProperty,
  29658. lineno: kEnumerableProperty,
  29659. colno: kEnumerableProperty,
  29660. error: kEnumerableProperty
  29661. })
  29662. webidl.converters.MessagePort = webidl.interfaceConverter(MessagePort)
  29663. webidl.converters['sequence<MessagePort>'] = webidl.sequenceConverter(
  29664. webidl.converters.MessagePort
  29665. )
  29666. const eventInit = [
  29667. {
  29668. key: 'bubbles',
  29669. converter: webidl.converters.boolean,
  29670. defaultValue: false
  29671. },
  29672. {
  29673. key: 'cancelable',
  29674. converter: webidl.converters.boolean,
  29675. defaultValue: false
  29676. },
  29677. {
  29678. key: 'composed',
  29679. converter: webidl.converters.boolean,
  29680. defaultValue: false
  29681. }
  29682. ]
  29683. webidl.converters.MessageEventInit = webidl.dictionaryConverter([
  29684. ...eventInit,
  29685. {
  29686. key: 'data',
  29687. converter: webidl.converters.any,
  29688. defaultValue: null
  29689. },
  29690. {
  29691. key: 'origin',
  29692. converter: webidl.converters.USVString,
  29693. defaultValue: ''
  29694. },
  29695. {
  29696. key: 'lastEventId',
  29697. converter: webidl.converters.DOMString,
  29698. defaultValue: ''
  29699. },
  29700. {
  29701. key: 'source',
  29702. // Node doesn't implement WindowProxy or ServiceWorker, so the only
  29703. // valid value for source is a MessagePort.
  29704. converter: webidl.nullableConverter(webidl.converters.MessagePort),
  29705. defaultValue: null
  29706. },
  29707. {
  29708. key: 'ports',
  29709. converter: webidl.converters['sequence<MessagePort>'],
  29710. get defaultValue () {
  29711. return []
  29712. }
  29713. }
  29714. ])
  29715. webidl.converters.CloseEventInit = webidl.dictionaryConverter([
  29716. ...eventInit,
  29717. {
  29718. key: 'wasClean',
  29719. converter: webidl.converters.boolean,
  29720. defaultValue: false
  29721. },
  29722. {
  29723. key: 'code',
  29724. converter: webidl.converters['unsigned short'],
  29725. defaultValue: 0
  29726. },
  29727. {
  29728. key: 'reason',
  29729. converter: webidl.converters.USVString,
  29730. defaultValue: ''
  29731. }
  29732. ])
  29733. webidl.converters.ErrorEventInit = webidl.dictionaryConverter([
  29734. ...eventInit,
  29735. {
  29736. key: 'message',
  29737. converter: webidl.converters.DOMString,
  29738. defaultValue: ''
  29739. },
  29740. {
  29741. key: 'filename',
  29742. converter: webidl.converters.USVString,
  29743. defaultValue: ''
  29744. },
  29745. {
  29746. key: 'lineno',
  29747. converter: webidl.converters['unsigned long'],
  29748. defaultValue: 0
  29749. },
  29750. {
  29751. key: 'colno',
  29752. converter: webidl.converters['unsigned long'],
  29753. defaultValue: 0
  29754. },
  29755. {
  29756. key: 'error',
  29757. converter: webidl.converters.any
  29758. }
  29759. ])
  29760. module.exports = {
  29761. MessageEvent,
  29762. CloseEvent,
  29763. ErrorEvent
  29764. }
  29765. /***/ }),
  29766. /***/ 5444:
  29767. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  29768. "use strict";
  29769. const { maxUnsigned16Bit } = __nccwpck_require__(9188)
  29770. /** @type {import('crypto')} */
  29771. let crypto
  29772. try {
  29773. crypto = __nccwpck_require__(6113)
  29774. } catch {
  29775. }
  29776. class WebsocketFrameSend {
  29777. /**
  29778. * @param {Buffer|undefined} data
  29779. */
  29780. constructor (data) {
  29781. this.frameData = data
  29782. this.maskKey = crypto.randomBytes(4)
  29783. }
  29784. createFrame (opcode) {
  29785. const bodyLength = this.frameData?.byteLength ?? 0
  29786. /** @type {number} */
  29787. let payloadLength = bodyLength // 0-125
  29788. let offset = 6
  29789. if (bodyLength > maxUnsigned16Bit) {
  29790. offset += 8 // payload length is next 8 bytes
  29791. payloadLength = 127
  29792. } else if (bodyLength > 125) {
  29793. offset += 2 // payload length is next 2 bytes
  29794. payloadLength = 126
  29795. }
  29796. const buffer = Buffer.allocUnsafe(bodyLength + offset)
  29797. // Clear first 2 bytes, everything else is overwritten
  29798. buffer[0] = buffer[1] = 0
  29799. buffer[0] |= 0x80 // FIN
  29800. buffer[0] = (buffer[0] & 0xF0) + opcode // opcode
  29801. /*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> */
  29802. buffer[offset - 4] = this.maskKey[0]
  29803. buffer[offset - 3] = this.maskKey[1]
  29804. buffer[offset - 2] = this.maskKey[2]
  29805. buffer[offset - 1] = this.maskKey[3]
  29806. buffer[1] = payloadLength
  29807. if (payloadLength === 126) {
  29808. buffer.writeUInt16BE(bodyLength, 2)
  29809. } else if (payloadLength === 127) {
  29810. // Clear extended payload length
  29811. buffer[2] = buffer[3] = 0
  29812. buffer.writeUIntBE(bodyLength, 4, 6)
  29813. }
  29814. buffer[1] |= 0x80 // MASK
  29815. // mask body
  29816. for (let i = 0; i < bodyLength; i++) {
  29817. buffer[offset + i] = this.frameData[i] ^ this.maskKey[i % 4]
  29818. }
  29819. return buffer
  29820. }
  29821. }
  29822. module.exports = {
  29823. WebsocketFrameSend
  29824. }
  29825. /***/ }),
  29826. /***/ 1688:
  29827. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  29828. "use strict";
  29829. const { Writable } = __nccwpck_require__(2781)
  29830. const diagnosticsChannel = __nccwpck_require__(7643)
  29831. const { parserStates, opcodes, states, emptyBuffer } = __nccwpck_require__(9188)
  29832. const { kReadyState, kSentClose, kResponse, kReceivedClose } = __nccwpck_require__(7578)
  29833. const { isValidStatusCode, failWebsocketConnection, websocketMessageReceived } = __nccwpck_require__(5515)
  29834. const { WebsocketFrameSend } = __nccwpck_require__(5444)
  29835. // This code was influenced by ws released under the MIT license.
  29836. // Copyright (c) 2011 Einar Otto Stangvik <einaros@gmail.com>
  29837. // Copyright (c) 2013 Arnout Kazemier and contributors
  29838. // Copyright (c) 2016 Luigi Pinca and contributors
  29839. const channels = {}
  29840. channels.ping = diagnosticsChannel.channel('undici:websocket:ping')
  29841. channels.pong = diagnosticsChannel.channel('undici:websocket:pong')
  29842. class ByteParser extends Writable {
  29843. #buffers = []
  29844. #byteOffset = 0
  29845. #state = parserStates.INFO
  29846. #info = {}
  29847. #fragments = []
  29848. constructor (ws) {
  29849. super()
  29850. this.ws = ws
  29851. }
  29852. /**
  29853. * @param {Buffer} chunk
  29854. * @param {() => void} callback
  29855. */
  29856. _write (chunk, _, callback) {
  29857. this.#buffers.push(chunk)
  29858. this.#byteOffset += chunk.length
  29859. this.run(callback)
  29860. }
  29861. /**
  29862. * Runs whenever a new chunk is received.
  29863. * Callback is called whenever there are no more chunks buffering,
  29864. * or not enough bytes are buffered to parse.
  29865. */
  29866. run (callback) {
  29867. while (true) {
  29868. if (this.#state === parserStates.INFO) {
  29869. // If there aren't enough bytes to parse the payload length, etc.
  29870. if (this.#byteOffset < 2) {
  29871. return callback()
  29872. }
  29873. const buffer = this.consume(2)
  29874. this.#info.fin = (buffer[0] & 0x80) !== 0
  29875. this.#info.opcode = buffer[0] & 0x0F
  29876. // If we receive a fragmented message, we use the type of the first
  29877. // frame to parse the full message as binary/text, when it's terminated
  29878. this.#info.originalOpcode ??= this.#info.opcode
  29879. this.#info.fragmented = !this.#info.fin && this.#info.opcode !== opcodes.CONTINUATION
  29880. if (this.#info.fragmented && this.#info.opcode !== opcodes.BINARY && this.#info.opcode !== opcodes.TEXT) {
  29881. // Only text and binary frames can be fragmented
  29882. failWebsocketConnection(this.ws, 'Invalid frame type was fragmented.')
  29883. return
  29884. }
  29885. const payloadLength = buffer[1] & 0x7F
  29886. if (payloadLength <= 125) {
  29887. this.#info.payloadLength = payloadLength
  29888. this.#state = parserStates.READ_DATA
  29889. } else if (payloadLength === 126) {
  29890. this.#state = parserStates.PAYLOADLENGTH_16
  29891. } else if (payloadLength === 127) {
  29892. this.#state = parserStates.PAYLOADLENGTH_64
  29893. }
  29894. if (this.#info.fragmented && payloadLength > 125) {
  29895. // A fragmented frame can't be fragmented itself
  29896. failWebsocketConnection(this.ws, 'Fragmented frame exceeded 125 bytes.')
  29897. return
  29898. } else if (
  29899. (this.#info.opcode === opcodes.PING ||
  29900. this.#info.opcode === opcodes.PONG ||
  29901. this.#info.opcode === opcodes.CLOSE) &&
  29902. payloadLength > 125
  29903. ) {
  29904. // Control frames can have a payload length of 125 bytes MAX
  29905. failWebsocketConnection(this.ws, 'Payload length for control frame exceeded 125 bytes.')
  29906. return
  29907. } else if (this.#info.opcode === opcodes.CLOSE) {
  29908. if (payloadLength === 1) {
  29909. failWebsocketConnection(this.ws, 'Received close frame with a 1-byte body.')
  29910. return
  29911. }
  29912. const body = this.consume(payloadLength)
  29913. this.#info.closeInfo = this.parseCloseBody(false, body)
  29914. if (!this.ws[kSentClose]) {
  29915. // If an endpoint receives a Close frame and did not previously send a
  29916. // Close frame, the endpoint MUST send a Close frame in response. (When
  29917. // sending a Close frame in response, the endpoint typically echos the
  29918. // status code it received.)
  29919. const body = Buffer.allocUnsafe(2)
  29920. body.writeUInt16BE(this.#info.closeInfo.code, 0)
  29921. const closeFrame = new WebsocketFrameSend(body)
  29922. this.ws[kResponse].socket.write(
  29923. closeFrame.createFrame(opcodes.CLOSE),
  29924. (err) => {
  29925. if (!err) {
  29926. this.ws[kSentClose] = true
  29927. }
  29928. }
  29929. )
  29930. }
  29931. // Upon either sending or receiving a Close control frame, it is said
  29932. // that _The WebSocket Closing Handshake is Started_ and that the
  29933. // WebSocket connection is in the CLOSING state.
  29934. this.ws[kReadyState] = states.CLOSING
  29935. this.ws[kReceivedClose] = true
  29936. this.end()
  29937. return
  29938. } else if (this.#info.opcode === opcodes.PING) {
  29939. // Upon receipt of a Ping frame, an endpoint MUST send a Pong frame in
  29940. // response, unless it already received a Close frame.
  29941. // A Pong frame sent in response to a Ping frame must have identical
  29942. // "Application data"
  29943. const body = this.consume(payloadLength)
  29944. if (!this.ws[kReceivedClose]) {
  29945. const frame = new WebsocketFrameSend(body)
  29946. this.ws[kResponse].socket.write(frame.createFrame(opcodes.PONG))
  29947. if (channels.ping.hasSubscribers) {
  29948. channels.ping.publish({
  29949. payload: body
  29950. })
  29951. }
  29952. }
  29953. this.#state = parserStates.INFO
  29954. if (this.#byteOffset > 0) {
  29955. continue
  29956. } else {
  29957. callback()
  29958. return
  29959. }
  29960. } else if (this.#info.opcode === opcodes.PONG) {
  29961. // A Pong frame MAY be sent unsolicited. This serves as a
  29962. // unidirectional heartbeat. A response to an unsolicited Pong frame is
  29963. // not expected.
  29964. const body = this.consume(payloadLength)
  29965. if (channels.pong.hasSubscribers) {
  29966. channels.pong.publish({
  29967. payload: body
  29968. })
  29969. }
  29970. if (this.#byteOffset > 0) {
  29971. continue
  29972. } else {
  29973. callback()
  29974. return
  29975. }
  29976. }
  29977. } else if (this.#state === parserStates.PAYLOADLENGTH_16) {
  29978. if (this.#byteOffset < 2) {
  29979. return callback()
  29980. }
  29981. const buffer = this.consume(2)
  29982. this.#info.payloadLength = buffer.readUInt16BE(0)
  29983. this.#state = parserStates.READ_DATA
  29984. } else if (this.#state === parserStates.PAYLOADLENGTH_64) {
  29985. if (this.#byteOffset < 8) {
  29986. return callback()
  29987. }
  29988. const buffer = this.consume(8)
  29989. const upper = buffer.readUInt32BE(0)
  29990. // 2^31 is the maxinimum bytes an arraybuffer can contain
  29991. // on 32-bit systems. Although, on 64-bit systems, this is
  29992. // 2^53-1 bytes.
  29993. // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Invalid_array_length
  29994. // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/common/globals.h;drc=1946212ac0100668f14eb9e2843bdd846e510a1e;bpv=1;bpt=1;l=1275
  29995. // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/objects/js-array-buffer.h;l=34;drc=1946212ac0100668f14eb9e2843bdd846e510a1e
  29996. if (upper > 2 ** 31 - 1) {
  29997. failWebsocketConnection(this.ws, 'Received payload length > 2^31 bytes.')
  29998. return
  29999. }
  30000. const lower = buffer.readUInt32BE(4)
  30001. this.#info.payloadLength = (upper << 8) + lower
  30002. this.#state = parserStates.READ_DATA
  30003. } else if (this.#state === parserStates.READ_DATA) {
  30004. if (this.#byteOffset < this.#info.payloadLength) {
  30005. // If there is still more data in this chunk that needs to be read
  30006. return callback()
  30007. } else if (this.#byteOffset >= this.#info.payloadLength) {
  30008. // If the server sent multiple frames in a single chunk
  30009. const body = this.consume(this.#info.payloadLength)
  30010. this.#fragments.push(body)
  30011. // If the frame is unfragmented, or a fragmented frame was terminated,
  30012. // a message was received
  30013. if (!this.#info.fragmented || (this.#info.fin && this.#info.opcode === opcodes.CONTINUATION)) {
  30014. const fullMessage = Buffer.concat(this.#fragments)
  30015. websocketMessageReceived(this.ws, this.#info.originalOpcode, fullMessage)
  30016. this.#info = {}
  30017. this.#fragments.length = 0
  30018. }
  30019. this.#state = parserStates.INFO
  30020. }
  30021. }
  30022. if (this.#byteOffset > 0) {
  30023. continue
  30024. } else {
  30025. callback()
  30026. break
  30027. }
  30028. }
  30029. }
  30030. /**
  30031. * Take n bytes from the buffered Buffers
  30032. * @param {number} n
  30033. * @returns {Buffer|null}
  30034. */
  30035. consume (n) {
  30036. if (n > this.#byteOffset) {
  30037. return null
  30038. } else if (n === 0) {
  30039. return emptyBuffer
  30040. }
  30041. if (this.#buffers[0].length === n) {
  30042. this.#byteOffset -= this.#buffers[0].length
  30043. return this.#buffers.shift()
  30044. }
  30045. const buffer = Buffer.allocUnsafe(n)
  30046. let offset = 0
  30047. while (offset !== n) {
  30048. const next = this.#buffers[0]
  30049. const { length } = next
  30050. if (length + offset === n) {
  30051. buffer.set(this.#buffers.shift(), offset)
  30052. break
  30053. } else if (length + offset > n) {
  30054. buffer.set(next.subarray(0, n - offset), offset)
  30055. this.#buffers[0] = next.subarray(n - offset)
  30056. break
  30057. } else {
  30058. buffer.set(this.#buffers.shift(), offset)
  30059. offset += next.length
  30060. }
  30061. }
  30062. this.#byteOffset -= n
  30063. return buffer
  30064. }
  30065. parseCloseBody (onlyCode, data) {
  30066. // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.5
  30067. /** @type {number|undefined} */
  30068. let code
  30069. if (data.length >= 2) {
  30070. // _The WebSocket Connection Close Code_ is
  30071. // defined as the status code (Section 7.4) contained in the first Close
  30072. // control frame received by the application
  30073. code = data.readUInt16BE(0)
  30074. }
  30075. if (onlyCode) {
  30076. if (!isValidStatusCode(code)) {
  30077. return null
  30078. }
  30079. return { code }
  30080. }
  30081. // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.6
  30082. /** @type {Buffer} */
  30083. let reason = data.subarray(2)
  30084. // Remove BOM
  30085. if (reason[0] === 0xEF && reason[1] === 0xBB && reason[2] === 0xBF) {
  30086. reason = reason.subarray(3)
  30087. }
  30088. if (code !== undefined && !isValidStatusCode(code)) {
  30089. return null
  30090. }
  30091. try {
  30092. // TODO: optimize this
  30093. reason = new TextDecoder('utf-8', { fatal: true }).decode(reason)
  30094. } catch {
  30095. return null
  30096. }
  30097. return { code, reason }
  30098. }
  30099. get closingInfo () {
  30100. return this.#info.closeInfo
  30101. }
  30102. }
  30103. module.exports = {
  30104. ByteParser
  30105. }
  30106. /***/ }),
  30107. /***/ 7578:
  30108. /***/ ((module) => {
  30109. "use strict";
  30110. module.exports = {
  30111. kWebSocketURL: Symbol('url'),
  30112. kReadyState: Symbol('ready state'),
  30113. kController: Symbol('controller'),
  30114. kResponse: Symbol('response'),
  30115. kBinaryType: Symbol('binary type'),
  30116. kSentClose: Symbol('sent close'),
  30117. kReceivedClose: Symbol('received close'),
  30118. kByteParser: Symbol('byte parser')
  30119. }
  30120. /***/ }),
  30121. /***/ 5515:
  30122. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  30123. "use strict";
  30124. const { kReadyState, kController, kResponse, kBinaryType, kWebSocketURL } = __nccwpck_require__(7578)
  30125. const { states, opcodes } = __nccwpck_require__(9188)
  30126. const { MessageEvent, ErrorEvent } = __nccwpck_require__(2611)
  30127. /* globals Blob */
  30128. /**
  30129. * @param {import('./websocket').WebSocket} ws
  30130. */
  30131. function isEstablished (ws) {
  30132. // If the server's response is validated as provided for above, it is
  30133. // said that _The WebSocket Connection is Established_ and that the
  30134. // WebSocket Connection is in the OPEN state.
  30135. return ws[kReadyState] === states.OPEN
  30136. }
  30137. /**
  30138. * @param {import('./websocket').WebSocket} ws
  30139. */
  30140. function isClosing (ws) {
  30141. // Upon either sending or receiving a Close control frame, it is said
  30142. // that _The WebSocket Closing Handshake is Started_ and that the
  30143. // WebSocket connection is in the CLOSING state.
  30144. return ws[kReadyState] === states.CLOSING
  30145. }
  30146. /**
  30147. * @param {import('./websocket').WebSocket} ws
  30148. */
  30149. function isClosed (ws) {
  30150. return ws[kReadyState] === states.CLOSED
  30151. }
  30152. /**
  30153. * @see https://dom.spec.whatwg.org/#concept-event-fire
  30154. * @param {string} e
  30155. * @param {EventTarget} target
  30156. * @param {EventInit | undefined} eventInitDict
  30157. */
  30158. function fireEvent (e, target, eventConstructor = Event, eventInitDict) {
  30159. // 1. If eventConstructor is not given, then let eventConstructor be Event.
  30160. // 2. Let event be the result of creating an event given eventConstructor,
  30161. // in the relevant realm of target.
  30162. // 3. Initialize event’s type attribute to e.
  30163. const event = new eventConstructor(e, eventInitDict) // eslint-disable-line new-cap
  30164. // 4. Initialize any other IDL attributes of event as described in the
  30165. // invocation of this algorithm.
  30166. // 5. Return the result of dispatching event at target, with legacy target
  30167. // override flag set if set.
  30168. target.dispatchEvent(event)
  30169. }
  30170. /**
  30171. * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol
  30172. * @param {import('./websocket').WebSocket} ws
  30173. * @param {number} type Opcode
  30174. * @param {Buffer} data application data
  30175. */
  30176. function websocketMessageReceived (ws, type, data) {
  30177. // 1. If ready state is not OPEN (1), then return.
  30178. if (ws[kReadyState] !== states.OPEN) {
  30179. return
  30180. }
  30181. // 2. Let dataForEvent be determined by switching on type and binary type:
  30182. let dataForEvent
  30183. if (type === opcodes.TEXT) {
  30184. // -> type indicates that the data is Text
  30185. // a new DOMString containing data
  30186. try {
  30187. dataForEvent = new TextDecoder('utf-8', { fatal: true }).decode(data)
  30188. } catch {
  30189. failWebsocketConnection(ws, 'Received invalid UTF-8 in text frame.')
  30190. return
  30191. }
  30192. } else if (type === opcodes.BINARY) {
  30193. if (ws[kBinaryType] === 'blob') {
  30194. // -> type indicates that the data is Binary and binary type is "blob"
  30195. // a new Blob object, created in the relevant Realm of the WebSocket
  30196. // object, that represents data as its raw data
  30197. dataForEvent = new Blob([data])
  30198. } else {
  30199. // -> type indicates that the data is Binary and binary type is "arraybuffer"
  30200. // a new ArrayBuffer object, created in the relevant Realm of the
  30201. // WebSocket object, whose contents are data
  30202. dataForEvent = new Uint8Array(data).buffer
  30203. }
  30204. }
  30205. // 3. Fire an event named message at the WebSocket object, using MessageEvent,
  30206. // with the origin attribute initialized to the serialization of the WebSocket
  30207. // object’s url's origin, and the data attribute initialized to dataForEvent.
  30208. fireEvent('message', ws, MessageEvent, {
  30209. origin: ws[kWebSocketURL].origin,
  30210. data: dataForEvent
  30211. })
  30212. }
  30213. /**
  30214. * @see https://datatracker.ietf.org/doc/html/rfc6455
  30215. * @see https://datatracker.ietf.org/doc/html/rfc2616
  30216. * @see https://bugs.chromium.org/p/chromium/issues/detail?id=398407
  30217. * @param {string} protocol
  30218. */
  30219. function isValidSubprotocol (protocol) {
  30220. // If present, this value indicates one
  30221. // or more comma-separated subprotocol the client wishes to speak,
  30222. // ordered by preference. The elements that comprise this value
  30223. // MUST be non-empty strings with characters in the range U+0021 to
  30224. // U+007E not including separator characters as defined in
  30225. // [RFC2616] and MUST all be unique strings.
  30226. if (protocol.length === 0) {
  30227. return false
  30228. }
  30229. for (const char of protocol) {
  30230. const code = char.charCodeAt(0)
  30231. if (
  30232. code < 0x21 ||
  30233. code > 0x7E ||
  30234. char === '(' ||
  30235. char === ')' ||
  30236. char === '<' ||
  30237. char === '>' ||
  30238. char === '@' ||
  30239. char === ',' ||
  30240. char === ';' ||
  30241. char === ':' ||
  30242. char === '\\' ||
  30243. char === '"' ||
  30244. char === '/' ||
  30245. char === '[' ||
  30246. char === ']' ||
  30247. char === '?' ||
  30248. char === '=' ||
  30249. char === '{' ||
  30250. char === '}' ||
  30251. code === 32 || // SP
  30252. code === 9 // HT
  30253. ) {
  30254. return false
  30255. }
  30256. }
  30257. return true
  30258. }
  30259. /**
  30260. * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7-4
  30261. * @param {number} code
  30262. */
  30263. function isValidStatusCode (code) {
  30264. if (code >= 1000 && code < 1015) {
  30265. return (
  30266. code !== 1004 && // reserved
  30267. code !== 1005 && // "MUST NOT be set as a status code"
  30268. code !== 1006 // "MUST NOT be set as a status code"
  30269. )
  30270. }
  30271. return code >= 3000 && code <= 4999
  30272. }
  30273. /**
  30274. * @param {import('./websocket').WebSocket} ws
  30275. * @param {string|undefined} reason
  30276. */
  30277. function failWebsocketConnection (ws, reason) {
  30278. const { [kController]: controller, [kResponse]: response } = ws
  30279. controller.abort()
  30280. if (response?.socket && !response.socket.destroyed) {
  30281. response.socket.destroy()
  30282. }
  30283. if (reason) {
  30284. fireEvent('error', ws, ErrorEvent, {
  30285. error: new Error(reason)
  30286. })
  30287. }
  30288. }
  30289. module.exports = {
  30290. isEstablished,
  30291. isClosing,
  30292. isClosed,
  30293. fireEvent,
  30294. isValidSubprotocol,
  30295. isValidStatusCode,
  30296. failWebsocketConnection,
  30297. websocketMessageReceived
  30298. }
  30299. /***/ }),
  30300. /***/ 4284:
  30301. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  30302. "use strict";
  30303. const { webidl } = __nccwpck_require__(1744)
  30304. const { DOMException } = __nccwpck_require__(1037)
  30305. const { URLSerializer } = __nccwpck_require__(685)
  30306. const { getGlobalOrigin } = __nccwpck_require__(1246)
  30307. const { staticPropertyDescriptors, states, opcodes, emptyBuffer } = __nccwpck_require__(9188)
  30308. const {
  30309. kWebSocketURL,
  30310. kReadyState,
  30311. kController,
  30312. kBinaryType,
  30313. kResponse,
  30314. kSentClose,
  30315. kByteParser
  30316. } = __nccwpck_require__(7578)
  30317. const { isEstablished, isClosing, isValidSubprotocol, failWebsocketConnection, fireEvent } = __nccwpck_require__(5515)
  30318. const { establishWebSocketConnection } = __nccwpck_require__(5354)
  30319. const { WebsocketFrameSend } = __nccwpck_require__(5444)
  30320. const { ByteParser } = __nccwpck_require__(1688)
  30321. const { kEnumerableProperty, isBlobLike } = __nccwpck_require__(3983)
  30322. const { getGlobalDispatcher } = __nccwpck_require__(1892)
  30323. const { types } = __nccwpck_require__(3837)
  30324. let experimentalWarned = false
  30325. // https://websockets.spec.whatwg.org/#interface-definition
  30326. class WebSocket extends EventTarget {
  30327. #events = {
  30328. open: null,
  30329. error: null,
  30330. close: null,
  30331. message: null
  30332. }
  30333. #bufferedAmount = 0
  30334. #protocol = ''
  30335. #extensions = ''
  30336. /**
  30337. * @param {string} url
  30338. * @param {string|string[]} protocols
  30339. */
  30340. constructor (url, protocols = []) {
  30341. super()
  30342. webidl.argumentLengthCheck(arguments, 1, { header: 'WebSocket constructor' })
  30343. if (!experimentalWarned) {
  30344. experimentalWarned = true
  30345. process.emitWarning('WebSockets are experimental, expect them to change at any time.', {
  30346. code: 'UNDICI-WS'
  30347. })
  30348. }
  30349. const options = webidl.converters['DOMString or sequence<DOMString> or WebSocketInit'](protocols)
  30350. url = webidl.converters.USVString(url)
  30351. protocols = options.protocols
  30352. // 1. Let baseURL be this's relevant settings object's API base URL.
  30353. const baseURL = getGlobalOrigin()
  30354. // 1. Let urlRecord be the result of applying the URL parser to url with baseURL.
  30355. let urlRecord
  30356. try {
  30357. urlRecord = new URL(url, baseURL)
  30358. } catch (e) {
  30359. // 3. If urlRecord is failure, then throw a "SyntaxError" DOMException.
  30360. throw new DOMException(e, 'SyntaxError')
  30361. }
  30362. // 4. If urlRecord’s scheme is "http", then set urlRecord’s scheme to "ws".
  30363. if (urlRecord.protocol === 'http:') {
  30364. urlRecord.protocol = 'ws:'
  30365. } else if (urlRecord.protocol === 'https:') {
  30366. // 5. Otherwise, if urlRecord’s scheme is "https", set urlRecord’s scheme to "wss".
  30367. urlRecord.protocol = 'wss:'
  30368. }
  30369. // 6. If urlRecord’s scheme is not "ws" or "wss", then throw a "SyntaxError" DOMException.
  30370. if (urlRecord.protocol !== 'ws:' && urlRecord.protocol !== 'wss:') {
  30371. throw new DOMException(
  30372. `Expected a ws: or wss: protocol, got ${urlRecord.protocol}`,
  30373. 'SyntaxError'
  30374. )
  30375. }
  30376. // 7. If urlRecord’s fragment is non-null, then throw a "SyntaxError"
  30377. // DOMException.
  30378. if (urlRecord.hash || urlRecord.href.endsWith('#')) {
  30379. throw new DOMException('Got fragment', 'SyntaxError')
  30380. }
  30381. // 8. If protocols is a string, set protocols to a sequence consisting
  30382. // of just that string.
  30383. if (typeof protocols === 'string') {
  30384. protocols = [protocols]
  30385. }
  30386. // 9. If any of the values in protocols occur more than once or otherwise
  30387. // fail to match the requirements for elements that comprise the value
  30388. // of `Sec-WebSocket-Protocol` fields as defined by The WebSocket
  30389. // protocol, then throw a "SyntaxError" DOMException.
  30390. if (protocols.length !== new Set(protocols.map(p => p.toLowerCase())).size) {
  30391. throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError')
  30392. }
  30393. if (protocols.length > 0 && !protocols.every(p => isValidSubprotocol(p))) {
  30394. throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError')
  30395. }
  30396. // 10. Set this's url to urlRecord.
  30397. this[kWebSocketURL] = new URL(urlRecord.href)
  30398. // 11. Let client be this's relevant settings object.
  30399. // 12. Run this step in parallel:
  30400. // 1. Establish a WebSocket connection given urlRecord, protocols,
  30401. // and client.
  30402. this[kController] = establishWebSocketConnection(
  30403. urlRecord,
  30404. protocols,
  30405. this,
  30406. (response) => this.#onConnectionEstablished(response),
  30407. options
  30408. )
  30409. // Each WebSocket object has an associated ready state, which is a
  30410. // number representing the state of the connection. Initially it must
  30411. // be CONNECTING (0).
  30412. this[kReadyState] = WebSocket.CONNECTING
  30413. // The extensions attribute must initially return the empty string.
  30414. // The protocol attribute must initially return the empty string.
  30415. // Each WebSocket object has an associated binary type, which is a
  30416. // BinaryType. Initially it must be "blob".
  30417. this[kBinaryType] = 'blob'
  30418. }
  30419. /**
  30420. * @see https://websockets.spec.whatwg.org/#dom-websocket-close
  30421. * @param {number|undefined} code
  30422. * @param {string|undefined} reason
  30423. */
  30424. close (code = undefined, reason = undefined) {
  30425. webidl.brandCheck(this, WebSocket)
  30426. if (code !== undefined) {
  30427. code = webidl.converters['unsigned short'](code, { clamp: true })
  30428. }
  30429. if (reason !== undefined) {
  30430. reason = webidl.converters.USVString(reason)
  30431. }
  30432. // 1. If code is present, but is neither an integer equal to 1000 nor an
  30433. // integer in the range 3000 to 4999, inclusive, throw an
  30434. // "InvalidAccessError" DOMException.
  30435. if (code !== undefined) {
  30436. if (code !== 1000 && (code < 3000 || code > 4999)) {
  30437. throw new DOMException('invalid code', 'InvalidAccessError')
  30438. }
  30439. }
  30440. let reasonByteLength = 0
  30441. // 2. If reason is present, then run these substeps:
  30442. if (reason !== undefined) {
  30443. // 1. Let reasonBytes be the result of encoding reason.
  30444. // 2. If reasonBytes is longer than 123 bytes, then throw a
  30445. // "SyntaxError" DOMException.
  30446. reasonByteLength = Buffer.byteLength(reason)
  30447. if (reasonByteLength > 123) {
  30448. throw new DOMException(
  30449. `Reason must be less than 123 bytes; received ${reasonByteLength}`,
  30450. 'SyntaxError'
  30451. )
  30452. }
  30453. }
  30454. // 3. Run the first matching steps from the following list:
  30455. if (this[kReadyState] === WebSocket.CLOSING || this[kReadyState] === WebSocket.CLOSED) {
  30456. // If this's ready state is CLOSING (2) or CLOSED (3)
  30457. // Do nothing.
  30458. } else if (!isEstablished(this)) {
  30459. // If the WebSocket connection is not yet established
  30460. // Fail the WebSocket connection and set this's ready state
  30461. // to CLOSING (2).
  30462. failWebsocketConnection(this, 'Connection was closed before it was established.')
  30463. this[kReadyState] = WebSocket.CLOSING
  30464. } else if (!isClosing(this)) {
  30465. // If the WebSocket closing handshake has not yet been started
  30466. // Start the WebSocket closing handshake and set this's ready
  30467. // state to CLOSING (2).
  30468. // - If neither code nor reason is present, the WebSocket Close
  30469. // message must not have a body.
  30470. // - If code is present, then the status code to use in the
  30471. // WebSocket Close message must be the integer given by code.
  30472. // - If reason is also present, then reasonBytes must be
  30473. // provided in the Close message after the status code.
  30474. const frame = new WebsocketFrameSend()
  30475. // If neither code nor reason is present, the WebSocket Close
  30476. // message must not have a body.
  30477. // If code is present, then the status code to use in the
  30478. // WebSocket Close message must be the integer given by code.
  30479. if (code !== undefined && reason === undefined) {
  30480. frame.frameData = Buffer.allocUnsafe(2)
  30481. frame.frameData.writeUInt16BE(code, 0)
  30482. } else if (code !== undefined && reason !== undefined) {
  30483. // If reason is also present, then reasonBytes must be
  30484. // provided in the Close message after the status code.
  30485. frame.frameData = Buffer.allocUnsafe(2 + reasonByteLength)
  30486. frame.frameData.writeUInt16BE(code, 0)
  30487. // the body MAY contain UTF-8-encoded data with value /reason/
  30488. frame.frameData.write(reason, 2, 'utf-8')
  30489. } else {
  30490. frame.frameData = emptyBuffer
  30491. }
  30492. /** @type {import('stream').Duplex} */
  30493. const socket = this[kResponse].socket
  30494. socket.write(frame.createFrame(opcodes.CLOSE), (err) => {
  30495. if (!err) {
  30496. this[kSentClose] = true
  30497. }
  30498. })
  30499. // Upon either sending or receiving a Close control frame, it is said
  30500. // that _The WebSocket Closing Handshake is Started_ and that the
  30501. // WebSocket connection is in the CLOSING state.
  30502. this[kReadyState] = states.CLOSING
  30503. } else {
  30504. // Otherwise
  30505. // Set this's ready state to CLOSING (2).
  30506. this[kReadyState] = WebSocket.CLOSING
  30507. }
  30508. }
  30509. /**
  30510. * @see https://websockets.spec.whatwg.org/#dom-websocket-send
  30511. * @param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data
  30512. */
  30513. send (data) {
  30514. webidl.brandCheck(this, WebSocket)
  30515. webidl.argumentLengthCheck(arguments, 1, { header: 'WebSocket.send' })
  30516. data = webidl.converters.WebSocketSendData(data)
  30517. // 1. If this's ready state is CONNECTING, then throw an
  30518. // "InvalidStateError" DOMException.
  30519. if (this[kReadyState] === WebSocket.CONNECTING) {
  30520. throw new DOMException('Sent before connected.', 'InvalidStateError')
  30521. }
  30522. // 2. Run the appropriate set of steps from the following list:
  30523. // https://datatracker.ietf.org/doc/html/rfc6455#section-6.1
  30524. // https://datatracker.ietf.org/doc/html/rfc6455#section-5.2
  30525. if (!isEstablished(this) || isClosing(this)) {
  30526. return
  30527. }
  30528. /** @type {import('stream').Duplex} */
  30529. const socket = this[kResponse].socket
  30530. // If data is a string
  30531. if (typeof data === 'string') {
  30532. // If the WebSocket connection is established and the WebSocket
  30533. // closing handshake has not yet started, then the user agent
  30534. // must send a WebSocket Message comprised of the data argument
  30535. // using a text frame opcode; if the data cannot be sent, e.g.
  30536. // because it would need to be buffered but the buffer is full,
  30537. // the user agent must flag the WebSocket as full and then close
  30538. // the WebSocket connection. Any invocation of this method with a
  30539. // string argument that does not throw an exception must increase
  30540. // the bufferedAmount attribute by the number of bytes needed to
  30541. // express the argument as UTF-8.
  30542. const value = Buffer.from(data)
  30543. const frame = new WebsocketFrameSend(value)
  30544. const buffer = frame.createFrame(opcodes.TEXT)
  30545. this.#bufferedAmount += value.byteLength
  30546. socket.write(buffer, () => {
  30547. this.#bufferedAmount -= value.byteLength
  30548. })
  30549. } else if (types.isArrayBuffer(data)) {
  30550. // If the WebSocket connection is established, and the WebSocket
  30551. // closing handshake has not yet started, then the user agent must
  30552. // send a WebSocket Message comprised of data using a binary frame
  30553. // opcode; if the data cannot be sent, e.g. because it would need
  30554. // to be buffered but the buffer is full, the user agent must flag
  30555. // the WebSocket as full and then close the WebSocket connection.
  30556. // The data to be sent is the data stored in the buffer described
  30557. // by the ArrayBuffer object. Any invocation of this method with an
  30558. // ArrayBuffer argument that does not throw an exception must
  30559. // increase the bufferedAmount attribute by the length of the
  30560. // ArrayBuffer in bytes.
  30561. const value = Buffer.from(data)
  30562. const frame = new WebsocketFrameSend(value)
  30563. const buffer = frame.createFrame(opcodes.BINARY)
  30564. this.#bufferedAmount += value.byteLength
  30565. socket.write(buffer, () => {
  30566. this.#bufferedAmount -= value.byteLength
  30567. })
  30568. } else if (ArrayBuffer.isView(data)) {
  30569. // If the WebSocket connection is established, and the WebSocket
  30570. // closing handshake has not yet started, then the user agent must
  30571. // send a WebSocket Message comprised of data using a binary frame
  30572. // opcode; if the data cannot be sent, e.g. because it would need to
  30573. // be buffered but the buffer is full, the user agent must flag the
  30574. // WebSocket as full and then close the WebSocket connection. The
  30575. // data to be sent is the data stored in the section of the buffer
  30576. // described by the ArrayBuffer object that data references. Any
  30577. // invocation of this method with this kind of argument that does
  30578. // not throw an exception must increase the bufferedAmount attribute
  30579. // by the length of data’s buffer in bytes.
  30580. const ab = Buffer.from(data, data.byteOffset, data.byteLength)
  30581. const frame = new WebsocketFrameSend(ab)
  30582. const buffer = frame.createFrame(opcodes.BINARY)
  30583. this.#bufferedAmount += ab.byteLength
  30584. socket.write(buffer, () => {
  30585. this.#bufferedAmount -= ab.byteLength
  30586. })
  30587. } else if (isBlobLike(data)) {
  30588. // If the WebSocket connection is established, and the WebSocket
  30589. // closing handshake has not yet started, then the user agent must
  30590. // send a WebSocket Message comprised of data using a binary frame
  30591. // opcode; if the data cannot be sent, e.g. because it would need to
  30592. // be buffered but the buffer is full, the user agent must flag the
  30593. // WebSocket as full and then close the WebSocket connection. The data
  30594. // to be sent is the raw data represented by the Blob object. Any
  30595. // invocation of this method with a Blob argument that does not throw
  30596. // an exception must increase the bufferedAmount attribute by the size
  30597. // of the Blob object’s raw data, in bytes.
  30598. const frame = new WebsocketFrameSend()
  30599. data.arrayBuffer().then((ab) => {
  30600. const value = Buffer.from(ab)
  30601. frame.frameData = value
  30602. const buffer = frame.createFrame(opcodes.BINARY)
  30603. this.#bufferedAmount += value.byteLength
  30604. socket.write(buffer, () => {
  30605. this.#bufferedAmount -= value.byteLength
  30606. })
  30607. })
  30608. }
  30609. }
  30610. get readyState () {
  30611. webidl.brandCheck(this, WebSocket)
  30612. // The readyState getter steps are to return this's ready state.
  30613. return this[kReadyState]
  30614. }
  30615. get bufferedAmount () {
  30616. webidl.brandCheck(this, WebSocket)
  30617. return this.#bufferedAmount
  30618. }
  30619. get url () {
  30620. webidl.brandCheck(this, WebSocket)
  30621. // The url getter steps are to return this's url, serialized.
  30622. return URLSerializer(this[kWebSocketURL])
  30623. }
  30624. get extensions () {
  30625. webidl.brandCheck(this, WebSocket)
  30626. return this.#extensions
  30627. }
  30628. get protocol () {
  30629. webidl.brandCheck(this, WebSocket)
  30630. return this.#protocol
  30631. }
  30632. get onopen () {
  30633. webidl.brandCheck(this, WebSocket)
  30634. return this.#events.open
  30635. }
  30636. set onopen (fn) {
  30637. webidl.brandCheck(this, WebSocket)
  30638. if (this.#events.open) {
  30639. this.removeEventListener('open', this.#events.open)
  30640. }
  30641. if (typeof fn === 'function') {
  30642. this.#events.open = fn
  30643. this.addEventListener('open', fn)
  30644. } else {
  30645. this.#events.open = null
  30646. }
  30647. }
  30648. get onerror () {
  30649. webidl.brandCheck(this, WebSocket)
  30650. return this.#events.error
  30651. }
  30652. set onerror (fn) {
  30653. webidl.brandCheck(this, WebSocket)
  30654. if (this.#events.error) {
  30655. this.removeEventListener('error', this.#events.error)
  30656. }
  30657. if (typeof fn === 'function') {
  30658. this.#events.error = fn
  30659. this.addEventListener('error', fn)
  30660. } else {
  30661. this.#events.error = null
  30662. }
  30663. }
  30664. get onclose () {
  30665. webidl.brandCheck(this, WebSocket)
  30666. return this.#events.close
  30667. }
  30668. set onclose (fn) {
  30669. webidl.brandCheck(this, WebSocket)
  30670. if (this.#events.close) {
  30671. this.removeEventListener('close', this.#events.close)
  30672. }
  30673. if (typeof fn === 'function') {
  30674. this.#events.close = fn
  30675. this.addEventListener('close', fn)
  30676. } else {
  30677. this.#events.close = null
  30678. }
  30679. }
  30680. get onmessage () {
  30681. webidl.brandCheck(this, WebSocket)
  30682. return this.#events.message
  30683. }
  30684. set onmessage (fn) {
  30685. webidl.brandCheck(this, WebSocket)
  30686. if (this.#events.message) {
  30687. this.removeEventListener('message', this.#events.message)
  30688. }
  30689. if (typeof fn === 'function') {
  30690. this.#events.message = fn
  30691. this.addEventListener('message', fn)
  30692. } else {
  30693. this.#events.message = null
  30694. }
  30695. }
  30696. get binaryType () {
  30697. webidl.brandCheck(this, WebSocket)
  30698. return this[kBinaryType]
  30699. }
  30700. set binaryType (type) {
  30701. webidl.brandCheck(this, WebSocket)
  30702. if (type !== 'blob' && type !== 'arraybuffer') {
  30703. this[kBinaryType] = 'blob'
  30704. } else {
  30705. this[kBinaryType] = type
  30706. }
  30707. }
  30708. /**
  30709. * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol
  30710. */
  30711. #onConnectionEstablished (response) {
  30712. // processResponse is called when the "response’s header list has been received and initialized."
  30713. // once this happens, the connection is open
  30714. this[kResponse] = response
  30715. const parser = new ByteParser(this)
  30716. parser.on('drain', function onParserDrain () {
  30717. this.ws[kResponse].socket.resume()
  30718. })
  30719. response.socket.ws = this
  30720. this[kByteParser] = parser
  30721. // 1. Change the ready state to OPEN (1).
  30722. this[kReadyState] = states.OPEN
  30723. // 2. Change the extensions attribute’s value to the extensions in use, if
  30724. // it is not the null value.
  30725. // https://datatracker.ietf.org/doc/html/rfc6455#section-9.1
  30726. const extensions = response.headersList.get('sec-websocket-extensions')
  30727. if (extensions !== null) {
  30728. this.#extensions = extensions
  30729. }
  30730. // 3. Change the protocol attribute’s value to the subprotocol in use, if
  30731. // it is not the null value.
  30732. // https://datatracker.ietf.org/doc/html/rfc6455#section-1.9
  30733. const protocol = response.headersList.get('sec-websocket-protocol')
  30734. if (protocol !== null) {
  30735. this.#protocol = protocol
  30736. }
  30737. // 4. Fire an event named open at the WebSocket object.
  30738. fireEvent('open', this)
  30739. }
  30740. }
  30741. // https://websockets.spec.whatwg.org/#dom-websocket-connecting
  30742. WebSocket.CONNECTING = WebSocket.prototype.CONNECTING = states.CONNECTING
  30743. // https://websockets.spec.whatwg.org/#dom-websocket-open
  30744. WebSocket.OPEN = WebSocket.prototype.OPEN = states.OPEN
  30745. // https://websockets.spec.whatwg.org/#dom-websocket-closing
  30746. WebSocket.CLOSING = WebSocket.prototype.CLOSING = states.CLOSING
  30747. // https://websockets.spec.whatwg.org/#dom-websocket-closed
  30748. WebSocket.CLOSED = WebSocket.prototype.CLOSED = states.CLOSED
  30749. Object.defineProperties(WebSocket.prototype, {
  30750. CONNECTING: staticPropertyDescriptors,
  30751. OPEN: staticPropertyDescriptors,
  30752. CLOSING: staticPropertyDescriptors,
  30753. CLOSED: staticPropertyDescriptors,
  30754. url: kEnumerableProperty,
  30755. readyState: kEnumerableProperty,
  30756. bufferedAmount: kEnumerableProperty,
  30757. onopen: kEnumerableProperty,
  30758. onerror: kEnumerableProperty,
  30759. onclose: kEnumerableProperty,
  30760. close: kEnumerableProperty,
  30761. onmessage: kEnumerableProperty,
  30762. binaryType: kEnumerableProperty,
  30763. send: kEnumerableProperty,
  30764. extensions: kEnumerableProperty,
  30765. protocol: kEnumerableProperty,
  30766. [Symbol.toStringTag]: {
  30767. value: 'WebSocket',
  30768. writable: false,
  30769. enumerable: false,
  30770. configurable: true
  30771. }
  30772. })
  30773. Object.defineProperties(WebSocket, {
  30774. CONNECTING: staticPropertyDescriptors,
  30775. OPEN: staticPropertyDescriptors,
  30776. CLOSING: staticPropertyDescriptors,
  30777. CLOSED: staticPropertyDescriptors
  30778. })
  30779. webidl.converters['sequence<DOMString>'] = webidl.sequenceConverter(
  30780. webidl.converters.DOMString
  30781. )
  30782. webidl.converters['DOMString or sequence<DOMString>'] = function (V) {
  30783. if (webidl.util.Type(V) === 'Object' && Symbol.iterator in V) {
  30784. return webidl.converters['sequence<DOMString>'](V)
  30785. }
  30786. return webidl.converters.DOMString(V)
  30787. }
  30788. // This implements the propsal made in https://github.com/whatwg/websockets/issues/42
  30789. webidl.converters.WebSocketInit = webidl.dictionaryConverter([
  30790. {
  30791. key: 'protocols',
  30792. converter: webidl.converters['DOMString or sequence<DOMString>'],
  30793. get defaultValue () {
  30794. return []
  30795. }
  30796. },
  30797. {
  30798. key: 'dispatcher',
  30799. converter: (V) => V,
  30800. get defaultValue () {
  30801. return getGlobalDispatcher()
  30802. }
  30803. },
  30804. {
  30805. key: 'headers',
  30806. converter: webidl.nullableConverter(webidl.converters.HeadersInit)
  30807. }
  30808. ])
  30809. webidl.converters['DOMString or sequence<DOMString> or WebSocketInit'] = function (V) {
  30810. if (webidl.util.Type(V) === 'Object' && !(Symbol.iterator in V)) {
  30811. return webidl.converters.WebSocketInit(V)
  30812. }
  30813. return { protocols: webidl.converters['DOMString or sequence<DOMString>'](V) }
  30814. }
  30815. webidl.converters.WebSocketSendData = function (V) {
  30816. if (webidl.util.Type(V) === 'Object') {
  30817. if (isBlobLike(V)) {
  30818. return webidl.converters.Blob(V, { strict: false })
  30819. }
  30820. if (ArrayBuffer.isView(V) || types.isAnyArrayBuffer(V)) {
  30821. return webidl.converters.BufferSource(V)
  30822. }
  30823. }
  30824. return webidl.converters.USVString(V)
  30825. }
  30826. module.exports = {
  30827. WebSocket
  30828. }
  30829. /***/ }),
  30830. /***/ 5030:
  30831. /***/ ((__unused_webpack_module, exports) => {
  30832. "use strict";
  30833. Object.defineProperty(exports, "__esModule", ({ value: true }));
  30834. function getUserAgent() {
  30835. if (typeof navigator === "object" && "userAgent" in navigator) {
  30836. return navigator.userAgent;
  30837. }
  30838. if (typeof process === "object" && process.version !== undefined) {
  30839. return `Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`;
  30840. }
  30841. return "<environment undetectable>";
  30842. }
  30843. exports.getUserAgent = getUserAgent;
  30844. //# sourceMappingURL=index.js.map
  30845. /***/ }),
  30846. /***/ 5840:
  30847. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  30848. "use strict";
  30849. Object.defineProperty(exports, "__esModule", ({
  30850. value: true
  30851. }));
  30852. Object.defineProperty(exports, "NIL", ({
  30853. enumerable: true,
  30854. get: function () {
  30855. return _nil.default;
  30856. }
  30857. }));
  30858. Object.defineProperty(exports, "parse", ({
  30859. enumerable: true,
  30860. get: function () {
  30861. return _parse.default;
  30862. }
  30863. }));
  30864. Object.defineProperty(exports, "stringify", ({
  30865. enumerable: true,
  30866. get: function () {
  30867. return _stringify.default;
  30868. }
  30869. }));
  30870. Object.defineProperty(exports, "v1", ({
  30871. enumerable: true,
  30872. get: function () {
  30873. return _v.default;
  30874. }
  30875. }));
  30876. Object.defineProperty(exports, "v3", ({
  30877. enumerable: true,
  30878. get: function () {
  30879. return _v2.default;
  30880. }
  30881. }));
  30882. Object.defineProperty(exports, "v4", ({
  30883. enumerable: true,
  30884. get: function () {
  30885. return _v3.default;
  30886. }
  30887. }));
  30888. Object.defineProperty(exports, "v5", ({
  30889. enumerable: true,
  30890. get: function () {
  30891. return _v4.default;
  30892. }
  30893. }));
  30894. Object.defineProperty(exports, "validate", ({
  30895. enumerable: true,
  30896. get: function () {
  30897. return _validate.default;
  30898. }
  30899. }));
  30900. Object.defineProperty(exports, "version", ({
  30901. enumerable: true,
  30902. get: function () {
  30903. return _version.default;
  30904. }
  30905. }));
  30906. var _v = _interopRequireDefault(__nccwpck_require__(8628));
  30907. var _v2 = _interopRequireDefault(__nccwpck_require__(6409));
  30908. var _v3 = _interopRequireDefault(__nccwpck_require__(5122));
  30909. var _v4 = _interopRequireDefault(__nccwpck_require__(9120));
  30910. var _nil = _interopRequireDefault(__nccwpck_require__(5332));
  30911. var _version = _interopRequireDefault(__nccwpck_require__(2414));
  30912. var _validate = _interopRequireDefault(__nccwpck_require__(6900));
  30913. var _stringify = _interopRequireDefault(__nccwpck_require__(8950));
  30914. var _parse = _interopRequireDefault(__nccwpck_require__(2746));
  30915. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  30916. /***/ }),
  30917. /***/ 4569:
  30918. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  30919. "use strict";
  30920. Object.defineProperty(exports, "__esModule", ({
  30921. value: true
  30922. }));
  30923. exports["default"] = void 0;
  30924. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  30925. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  30926. function md5(bytes) {
  30927. if (Array.isArray(bytes)) {
  30928. bytes = Buffer.from(bytes);
  30929. } else if (typeof bytes === 'string') {
  30930. bytes = Buffer.from(bytes, 'utf8');
  30931. }
  30932. return _crypto.default.createHash('md5').update(bytes).digest();
  30933. }
  30934. var _default = md5;
  30935. exports["default"] = _default;
  30936. /***/ }),
  30937. /***/ 2054:
  30938. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  30939. "use strict";
  30940. Object.defineProperty(exports, "__esModule", ({
  30941. value: true
  30942. }));
  30943. exports["default"] = void 0;
  30944. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  30945. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  30946. var _default = {
  30947. randomUUID: _crypto.default.randomUUID
  30948. };
  30949. exports["default"] = _default;
  30950. /***/ }),
  30951. /***/ 5332:
  30952. /***/ ((__unused_webpack_module, exports) => {
  30953. "use strict";
  30954. Object.defineProperty(exports, "__esModule", ({
  30955. value: true
  30956. }));
  30957. exports["default"] = void 0;
  30958. var _default = '00000000-0000-0000-0000-000000000000';
  30959. exports["default"] = _default;
  30960. /***/ }),
  30961. /***/ 2746:
  30962. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  30963. "use strict";
  30964. Object.defineProperty(exports, "__esModule", ({
  30965. value: true
  30966. }));
  30967. exports["default"] = void 0;
  30968. var _validate = _interopRequireDefault(__nccwpck_require__(6900));
  30969. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  30970. function parse(uuid) {
  30971. if (!(0, _validate.default)(uuid)) {
  30972. throw TypeError('Invalid UUID');
  30973. }
  30974. let v;
  30975. const arr = new Uint8Array(16); // Parse ########-....-....-....-............
  30976. arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;
  30977. arr[1] = v >>> 16 & 0xff;
  30978. arr[2] = v >>> 8 & 0xff;
  30979. arr[3] = v & 0xff; // Parse ........-####-....-....-............
  30980. arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;
  30981. arr[5] = v & 0xff; // Parse ........-....-####-....-............
  30982. arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;
  30983. arr[7] = v & 0xff; // Parse ........-....-....-####-............
  30984. arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;
  30985. arr[9] = v & 0xff; // Parse ........-....-....-....-############
  30986. // (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes)
  30987. arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;
  30988. arr[11] = v / 0x100000000 & 0xff;
  30989. arr[12] = v >>> 24 & 0xff;
  30990. arr[13] = v >>> 16 & 0xff;
  30991. arr[14] = v >>> 8 & 0xff;
  30992. arr[15] = v & 0xff;
  30993. return arr;
  30994. }
  30995. var _default = parse;
  30996. exports["default"] = _default;
  30997. /***/ }),
  30998. /***/ 814:
  30999. /***/ ((__unused_webpack_module, exports) => {
  31000. "use strict";
  31001. Object.defineProperty(exports, "__esModule", ({
  31002. value: true
  31003. }));
  31004. exports["default"] = void 0;
  31005. 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;
  31006. exports["default"] = _default;
  31007. /***/ }),
  31008. /***/ 807:
  31009. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31010. "use strict";
  31011. Object.defineProperty(exports, "__esModule", ({
  31012. value: true
  31013. }));
  31014. exports["default"] = rng;
  31015. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  31016. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31017. const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate
  31018. let poolPtr = rnds8Pool.length;
  31019. function rng() {
  31020. if (poolPtr > rnds8Pool.length - 16) {
  31021. _crypto.default.randomFillSync(rnds8Pool);
  31022. poolPtr = 0;
  31023. }
  31024. return rnds8Pool.slice(poolPtr, poolPtr += 16);
  31025. }
  31026. /***/ }),
  31027. /***/ 5274:
  31028. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31029. "use strict";
  31030. Object.defineProperty(exports, "__esModule", ({
  31031. value: true
  31032. }));
  31033. exports["default"] = void 0;
  31034. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  31035. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31036. function sha1(bytes) {
  31037. if (Array.isArray(bytes)) {
  31038. bytes = Buffer.from(bytes);
  31039. } else if (typeof bytes === 'string') {
  31040. bytes = Buffer.from(bytes, 'utf8');
  31041. }
  31042. return _crypto.default.createHash('sha1').update(bytes).digest();
  31043. }
  31044. var _default = sha1;
  31045. exports["default"] = _default;
  31046. /***/ }),
  31047. /***/ 8950:
  31048. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31049. "use strict";
  31050. Object.defineProperty(exports, "__esModule", ({
  31051. value: true
  31052. }));
  31053. exports["default"] = void 0;
  31054. exports.unsafeStringify = unsafeStringify;
  31055. var _validate = _interopRequireDefault(__nccwpck_require__(6900));
  31056. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31057. /**
  31058. * Convert array of 16 byte values to UUID string format of the form:
  31059. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  31060. */
  31061. const byteToHex = [];
  31062. for (let i = 0; i < 256; ++i) {
  31063. byteToHex.push((i + 0x100).toString(16).slice(1));
  31064. }
  31065. function unsafeStringify(arr, offset = 0) {
  31066. // Note: Be careful editing this code! It's been tuned for performance
  31067. // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
  31068. 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]];
  31069. }
  31070. function stringify(arr, offset = 0) {
  31071. const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one
  31072. // of the following:
  31073. // - One or more input array values don't map to a hex octet (leading to
  31074. // "undefined" in the uuid)
  31075. // - Invalid input values for the RFC `version` or `variant` fields
  31076. if (!(0, _validate.default)(uuid)) {
  31077. throw TypeError('Stringified UUID is invalid');
  31078. }
  31079. return uuid;
  31080. }
  31081. var _default = stringify;
  31082. exports["default"] = _default;
  31083. /***/ }),
  31084. /***/ 8628:
  31085. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31086. "use strict";
  31087. Object.defineProperty(exports, "__esModule", ({
  31088. value: true
  31089. }));
  31090. exports["default"] = void 0;
  31091. var _rng = _interopRequireDefault(__nccwpck_require__(807));
  31092. var _stringify = __nccwpck_require__(8950);
  31093. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31094. // **`v1()` - Generate time-based UUID**
  31095. //
  31096. // Inspired by https://github.com/LiosK/UUID.js
  31097. // and http://docs.python.org/library/uuid.html
  31098. let _nodeId;
  31099. let _clockseq; // Previous uuid creation time
  31100. let _lastMSecs = 0;
  31101. let _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details
  31102. function v1(options, buf, offset) {
  31103. let i = buf && offset || 0;
  31104. const b = buf || new Array(16);
  31105. options = options || {};
  31106. let node = options.node || _nodeId;
  31107. let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not
  31108. // specified. We do this lazily to minimize issues related to insufficient
  31109. // system entropy. See #189
  31110. if (node == null || clockseq == null) {
  31111. const seedBytes = options.random || (options.rng || _rng.default)();
  31112. if (node == null) {
  31113. // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
  31114. node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];
  31115. }
  31116. if (clockseq == null) {
  31117. // Per 4.2.2, randomize (14 bit) clockseq
  31118. clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
  31119. }
  31120. } // UUID timestamps are 100 nano-second units since the Gregorian epoch,
  31121. // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
  31122. // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
  31123. // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
  31124. let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock
  31125. // cycle to simulate higher resolution clock
  31126. let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)
  31127. const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression
  31128. if (dt < 0 && options.clockseq === undefined) {
  31129. clockseq = clockseq + 1 & 0x3fff;
  31130. } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
  31131. // time interval
  31132. if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
  31133. nsecs = 0;
  31134. } // Per 4.2.1.2 Throw error if too many uuids are requested
  31135. if (nsecs >= 10000) {
  31136. throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");
  31137. }
  31138. _lastMSecs = msecs;
  31139. _lastNSecs = nsecs;
  31140. _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
  31141. msecs += 12219292800000; // `time_low`
  31142. const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
  31143. b[i++] = tl >>> 24 & 0xff;
  31144. b[i++] = tl >>> 16 & 0xff;
  31145. b[i++] = tl >>> 8 & 0xff;
  31146. b[i++] = tl & 0xff; // `time_mid`
  31147. const tmh = msecs / 0x100000000 * 10000 & 0xfffffff;
  31148. b[i++] = tmh >>> 8 & 0xff;
  31149. b[i++] = tmh & 0xff; // `time_high_and_version`
  31150. b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
  31151. b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
  31152. b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`
  31153. b[i++] = clockseq & 0xff; // `node`
  31154. for (let n = 0; n < 6; ++n) {
  31155. b[i + n] = node[n];
  31156. }
  31157. return buf || (0, _stringify.unsafeStringify)(b);
  31158. }
  31159. var _default = v1;
  31160. exports["default"] = _default;
  31161. /***/ }),
  31162. /***/ 6409:
  31163. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31164. "use strict";
  31165. Object.defineProperty(exports, "__esModule", ({
  31166. value: true
  31167. }));
  31168. exports["default"] = void 0;
  31169. var _v = _interopRequireDefault(__nccwpck_require__(5998));
  31170. var _md = _interopRequireDefault(__nccwpck_require__(4569));
  31171. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31172. const v3 = (0, _v.default)('v3', 0x30, _md.default);
  31173. var _default = v3;
  31174. exports["default"] = _default;
  31175. /***/ }),
  31176. /***/ 5998:
  31177. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31178. "use strict";
  31179. Object.defineProperty(exports, "__esModule", ({
  31180. value: true
  31181. }));
  31182. exports.URL = exports.DNS = void 0;
  31183. exports["default"] = v35;
  31184. var _stringify = __nccwpck_require__(8950);
  31185. var _parse = _interopRequireDefault(__nccwpck_require__(2746));
  31186. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31187. function stringToBytes(str) {
  31188. str = unescape(encodeURIComponent(str)); // UTF8 escape
  31189. const bytes = [];
  31190. for (let i = 0; i < str.length; ++i) {
  31191. bytes.push(str.charCodeAt(i));
  31192. }
  31193. return bytes;
  31194. }
  31195. const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
  31196. exports.DNS = DNS;
  31197. const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';
  31198. exports.URL = URL;
  31199. function v35(name, version, hashfunc) {
  31200. function generateUUID(value, namespace, buf, offset) {
  31201. var _namespace;
  31202. if (typeof value === 'string') {
  31203. value = stringToBytes(value);
  31204. }
  31205. if (typeof namespace === 'string') {
  31206. namespace = (0, _parse.default)(namespace);
  31207. }
  31208. if (((_namespace = namespace) === null || _namespace === void 0 ? void 0 : _namespace.length) !== 16) {
  31209. throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');
  31210. } // Compute hash of namespace and value, Per 4.3
  31211. // Future: Use spread syntax when supported on all platforms, e.g. `bytes =
  31212. // hashfunc([...namespace, ... value])`
  31213. let bytes = new Uint8Array(16 + value.length);
  31214. bytes.set(namespace);
  31215. bytes.set(value, namespace.length);
  31216. bytes = hashfunc(bytes);
  31217. bytes[6] = bytes[6] & 0x0f | version;
  31218. bytes[8] = bytes[8] & 0x3f | 0x80;
  31219. if (buf) {
  31220. offset = offset || 0;
  31221. for (let i = 0; i < 16; ++i) {
  31222. buf[offset + i] = bytes[i];
  31223. }
  31224. return buf;
  31225. }
  31226. return (0, _stringify.unsafeStringify)(bytes);
  31227. } // Function#name is not settable on some platforms (#270)
  31228. try {
  31229. generateUUID.name = name; // eslint-disable-next-line no-empty
  31230. } catch (err) {} // For CommonJS default export support
  31231. generateUUID.DNS = DNS;
  31232. generateUUID.URL = URL;
  31233. return generateUUID;
  31234. }
  31235. /***/ }),
  31236. /***/ 5122:
  31237. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31238. "use strict";
  31239. Object.defineProperty(exports, "__esModule", ({
  31240. value: true
  31241. }));
  31242. exports["default"] = void 0;
  31243. var _native = _interopRequireDefault(__nccwpck_require__(2054));
  31244. var _rng = _interopRequireDefault(__nccwpck_require__(807));
  31245. var _stringify = __nccwpck_require__(8950);
  31246. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31247. function v4(options, buf, offset) {
  31248. if (_native.default.randomUUID && !buf && !options) {
  31249. return _native.default.randomUUID();
  31250. }
  31251. options = options || {};
  31252. const rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  31253. rnds[6] = rnds[6] & 0x0f | 0x40;
  31254. rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
  31255. if (buf) {
  31256. offset = offset || 0;
  31257. for (let i = 0; i < 16; ++i) {
  31258. buf[offset + i] = rnds[i];
  31259. }
  31260. return buf;
  31261. }
  31262. return (0, _stringify.unsafeStringify)(rnds);
  31263. }
  31264. var _default = v4;
  31265. exports["default"] = _default;
  31266. /***/ }),
  31267. /***/ 9120:
  31268. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31269. "use strict";
  31270. Object.defineProperty(exports, "__esModule", ({
  31271. value: true
  31272. }));
  31273. exports["default"] = void 0;
  31274. var _v = _interopRequireDefault(__nccwpck_require__(5998));
  31275. var _sha = _interopRequireDefault(__nccwpck_require__(5274));
  31276. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31277. const v5 = (0, _v.default)('v5', 0x50, _sha.default);
  31278. var _default = v5;
  31279. exports["default"] = _default;
  31280. /***/ }),
  31281. /***/ 6900:
  31282. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31283. "use strict";
  31284. Object.defineProperty(exports, "__esModule", ({
  31285. value: true
  31286. }));
  31287. exports["default"] = void 0;
  31288. var _regex = _interopRequireDefault(__nccwpck_require__(814));
  31289. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31290. function validate(uuid) {
  31291. return typeof uuid === 'string' && _regex.default.test(uuid);
  31292. }
  31293. var _default = validate;
  31294. exports["default"] = _default;
  31295. /***/ }),
  31296. /***/ 2414:
  31297. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31298. "use strict";
  31299. Object.defineProperty(exports, "__esModule", ({
  31300. value: true
  31301. }));
  31302. exports["default"] = void 0;
  31303. var _validate = _interopRequireDefault(__nccwpck_require__(6900));
  31304. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31305. function version(uuid) {
  31306. if (!(0, _validate.default)(uuid)) {
  31307. throw TypeError('Invalid UUID');
  31308. }
  31309. return parseInt(uuid.slice(14, 15), 16);
  31310. }
  31311. var _default = version;
  31312. exports["default"] = _default;
  31313. /***/ }),
  31314. /***/ 2940:
  31315. /***/ ((module) => {
  31316. // Returns a wrapper function that returns a wrapped callback
  31317. // The wrapper function should do some stuff, and return a
  31318. // presumably different callback function.
  31319. // This makes sure that own properties are retained, so that
  31320. // decorations and such are not lost along the way.
  31321. module.exports = wrappy
  31322. function wrappy (fn, cb) {
  31323. if (fn && cb) return wrappy(fn)(cb)
  31324. if (typeof fn !== 'function')
  31325. throw new TypeError('need wrapper function')
  31326. Object.keys(fn).forEach(function (k) {
  31327. wrapper[k] = fn[k]
  31328. })
  31329. return wrapper
  31330. function wrapper() {
  31331. var args = new Array(arguments.length)
  31332. for (var i = 0; i < args.length; i++) {
  31333. args[i] = arguments[i]
  31334. }
  31335. var ret = fn.apply(this, args)
  31336. var cb = args[args.length-1]
  31337. if (typeof ret === 'function' && ret !== cb) {
  31338. Object.keys(cb).forEach(function (k) {
  31339. ret[k] = cb[k]
  31340. })
  31341. }
  31342. return ret
  31343. }
  31344. }
  31345. /***/ }),
  31346. /***/ 9491:
  31347. /***/ ((module) => {
  31348. "use strict";
  31349. module.exports = require("assert");
  31350. /***/ }),
  31351. /***/ 852:
  31352. /***/ ((module) => {
  31353. "use strict";
  31354. module.exports = require("async_hooks");
  31355. /***/ }),
  31356. /***/ 4300:
  31357. /***/ ((module) => {
  31358. "use strict";
  31359. module.exports = require("buffer");
  31360. /***/ }),
  31361. /***/ 2081:
  31362. /***/ ((module) => {
  31363. "use strict";
  31364. module.exports = require("child_process");
  31365. /***/ }),
  31366. /***/ 6206:
  31367. /***/ ((module) => {
  31368. "use strict";
  31369. module.exports = require("console");
  31370. /***/ }),
  31371. /***/ 6113:
  31372. /***/ ((module) => {
  31373. "use strict";
  31374. module.exports = require("crypto");
  31375. /***/ }),
  31376. /***/ 7643:
  31377. /***/ ((module) => {
  31378. "use strict";
  31379. module.exports = require("diagnostics_channel");
  31380. /***/ }),
  31381. /***/ 2361:
  31382. /***/ ((module) => {
  31383. "use strict";
  31384. module.exports = require("events");
  31385. /***/ }),
  31386. /***/ 7147:
  31387. /***/ ((module) => {
  31388. "use strict";
  31389. module.exports = require("fs");
  31390. /***/ }),
  31391. /***/ 3685:
  31392. /***/ ((module) => {
  31393. "use strict";
  31394. module.exports = require("http");
  31395. /***/ }),
  31396. /***/ 5158:
  31397. /***/ ((module) => {
  31398. "use strict";
  31399. module.exports = require("http2");
  31400. /***/ }),
  31401. /***/ 5687:
  31402. /***/ ((module) => {
  31403. "use strict";
  31404. module.exports = require("https");
  31405. /***/ }),
  31406. /***/ 1808:
  31407. /***/ ((module) => {
  31408. "use strict";
  31409. module.exports = require("net");
  31410. /***/ }),
  31411. /***/ 5673:
  31412. /***/ ((module) => {
  31413. "use strict";
  31414. module.exports = require("node:events");
  31415. /***/ }),
  31416. /***/ 4492:
  31417. /***/ ((module) => {
  31418. "use strict";
  31419. module.exports = require("node:stream");
  31420. /***/ }),
  31421. /***/ 7261:
  31422. /***/ ((module) => {
  31423. "use strict";
  31424. module.exports = require("node:util");
  31425. /***/ }),
  31426. /***/ 2037:
  31427. /***/ ((module) => {
  31428. "use strict";
  31429. module.exports = require("os");
  31430. /***/ }),
  31431. /***/ 1017:
  31432. /***/ ((module) => {
  31433. "use strict";
  31434. module.exports = require("path");
  31435. /***/ }),
  31436. /***/ 4074:
  31437. /***/ ((module) => {
  31438. "use strict";
  31439. module.exports = require("perf_hooks");
  31440. /***/ }),
  31441. /***/ 3477:
  31442. /***/ ((module) => {
  31443. "use strict";
  31444. module.exports = require("querystring");
  31445. /***/ }),
  31446. /***/ 2781:
  31447. /***/ ((module) => {
  31448. "use strict";
  31449. module.exports = require("stream");
  31450. /***/ }),
  31451. /***/ 5356:
  31452. /***/ ((module) => {
  31453. "use strict";
  31454. module.exports = require("stream/web");
  31455. /***/ }),
  31456. /***/ 1576:
  31457. /***/ ((module) => {
  31458. "use strict";
  31459. module.exports = require("string_decoder");
  31460. /***/ }),
  31461. /***/ 9512:
  31462. /***/ ((module) => {
  31463. "use strict";
  31464. module.exports = require("timers");
  31465. /***/ }),
  31466. /***/ 4404:
  31467. /***/ ((module) => {
  31468. "use strict";
  31469. module.exports = require("tls");
  31470. /***/ }),
  31471. /***/ 7310:
  31472. /***/ ((module) => {
  31473. "use strict";
  31474. module.exports = require("url");
  31475. /***/ }),
  31476. /***/ 3837:
  31477. /***/ ((module) => {
  31478. "use strict";
  31479. module.exports = require("util");
  31480. /***/ }),
  31481. /***/ 9830:
  31482. /***/ ((module) => {
  31483. "use strict";
  31484. module.exports = require("util/types");
  31485. /***/ }),
  31486. /***/ 1267:
  31487. /***/ ((module) => {
  31488. "use strict";
  31489. module.exports = require("worker_threads");
  31490. /***/ }),
  31491. /***/ 9796:
  31492. /***/ ((module) => {
  31493. "use strict";
  31494. module.exports = require("zlib");
  31495. /***/ }),
  31496. /***/ 2960:
  31497. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  31498. "use strict";
  31499. const WritableStream = (__nccwpck_require__(4492).Writable)
  31500. const inherits = (__nccwpck_require__(7261).inherits)
  31501. const StreamSearch = __nccwpck_require__(1142)
  31502. const PartStream = __nccwpck_require__(1620)
  31503. const HeaderParser = __nccwpck_require__(2032)
  31504. const DASH = 45
  31505. const B_ONEDASH = Buffer.from('-')
  31506. const B_CRLF = Buffer.from('\r\n')
  31507. const EMPTY_FN = function () {}
  31508. function Dicer (cfg) {
  31509. if (!(this instanceof Dicer)) { return new Dicer(cfg) }
  31510. WritableStream.call(this, cfg)
  31511. if (!cfg || (!cfg.headerFirst && typeof cfg.boundary !== 'string')) { throw new TypeError('Boundary required') }
  31512. if (typeof cfg.boundary === 'string') { this.setBoundary(cfg.boundary) } else { this._bparser = undefined }
  31513. this._headerFirst = cfg.headerFirst
  31514. this._dashes = 0
  31515. this._parts = 0
  31516. this._finished = false
  31517. this._realFinish = false
  31518. this._isPreamble = true
  31519. this._justMatched = false
  31520. this._firstWrite = true
  31521. this._inHeader = true
  31522. this._part = undefined
  31523. this._cb = undefined
  31524. this._ignoreData = false
  31525. this._partOpts = { highWaterMark: cfg.partHwm }
  31526. this._pause = false
  31527. const self = this
  31528. this._hparser = new HeaderParser(cfg)
  31529. this._hparser.on('header', function (header) {
  31530. self._inHeader = false
  31531. self._part.emit('header', header)
  31532. })
  31533. }
  31534. inherits(Dicer, WritableStream)
  31535. Dicer.prototype.emit = function (ev) {
  31536. if (ev === 'finish' && !this._realFinish) {
  31537. if (!this._finished) {
  31538. const self = this
  31539. process.nextTick(function () {
  31540. self.emit('error', new Error('Unexpected end of multipart data'))
  31541. if (self._part && !self._ignoreData) {
  31542. const type = (self._isPreamble ? 'Preamble' : 'Part')
  31543. self._part.emit('error', new Error(type + ' terminated early due to unexpected end of multipart data'))
  31544. self._part.push(null)
  31545. process.nextTick(function () {
  31546. self._realFinish = true
  31547. self.emit('finish')
  31548. self._realFinish = false
  31549. })
  31550. return
  31551. }
  31552. self._realFinish = true
  31553. self.emit('finish')
  31554. self._realFinish = false
  31555. })
  31556. }
  31557. } else { WritableStream.prototype.emit.apply(this, arguments) }
  31558. }
  31559. Dicer.prototype._write = function (data, encoding, cb) {
  31560. // ignore unexpected data (e.g. extra trailer data after finished)
  31561. if (!this._hparser && !this._bparser) { return cb() }
  31562. if (this._headerFirst && this._isPreamble) {
  31563. if (!this._part) {
  31564. this._part = new PartStream(this._partOpts)
  31565. if (this.listenerCount('preamble') !== 0) { this.emit('preamble', this._part) } else { this._ignore() }
  31566. }
  31567. const r = this._hparser.push(data)
  31568. if (!this._inHeader && r !== undefined && r < data.length) { data = data.slice(r) } else { return cb() }
  31569. }
  31570. // allows for "easier" testing
  31571. if (this._firstWrite) {
  31572. this._bparser.push(B_CRLF)
  31573. this._firstWrite = false
  31574. }
  31575. this._bparser.push(data)
  31576. if (this._pause) { this._cb = cb } else { cb() }
  31577. }
  31578. Dicer.prototype.reset = function () {
  31579. this._part = undefined
  31580. this._bparser = undefined
  31581. this._hparser = undefined
  31582. }
  31583. Dicer.prototype.setBoundary = function (boundary) {
  31584. const self = this
  31585. this._bparser = new StreamSearch('\r\n--' + boundary)
  31586. this._bparser.on('info', function (isMatch, data, start, end) {
  31587. self._oninfo(isMatch, data, start, end)
  31588. })
  31589. }
  31590. Dicer.prototype._ignore = function () {
  31591. if (this._part && !this._ignoreData) {
  31592. this._ignoreData = true
  31593. this._part.on('error', EMPTY_FN)
  31594. // we must perform some kind of read on the stream even though we are
  31595. // ignoring the data, otherwise node's Readable stream will not emit 'end'
  31596. // after pushing null to the stream
  31597. this._part.resume()
  31598. }
  31599. }
  31600. Dicer.prototype._oninfo = function (isMatch, data, start, end) {
  31601. let buf; const self = this; let i = 0; let r; let shouldWriteMore = true
  31602. if (!this._part && this._justMatched && data) {
  31603. while (this._dashes < 2 && (start + i) < end) {
  31604. if (data[start + i] === DASH) {
  31605. ++i
  31606. ++this._dashes
  31607. } else {
  31608. if (this._dashes) { buf = B_ONEDASH }
  31609. this._dashes = 0
  31610. break
  31611. }
  31612. }
  31613. if (this._dashes === 2) {
  31614. if ((start + i) < end && this.listenerCount('trailer') !== 0) { this.emit('trailer', data.slice(start + i, end)) }
  31615. this.reset()
  31616. this._finished = true
  31617. // no more parts will be added
  31618. if (self._parts === 0) {
  31619. self._realFinish = true
  31620. self.emit('finish')
  31621. self._realFinish = false
  31622. }
  31623. }
  31624. if (this._dashes) { return }
  31625. }
  31626. if (this._justMatched) { this._justMatched = false }
  31627. if (!this._part) {
  31628. this._part = new PartStream(this._partOpts)
  31629. this._part._read = function (n) {
  31630. self._unpause()
  31631. }
  31632. if (this._isPreamble && this.listenerCount('preamble') !== 0) {
  31633. this.emit('preamble', this._part)
  31634. } else if (this._isPreamble !== true && this.listenerCount('part') !== 0) {
  31635. this.emit('part', this._part)
  31636. } else {
  31637. this._ignore()
  31638. }
  31639. if (!this._isPreamble) { this._inHeader = true }
  31640. }
  31641. if (data && start < end && !this._ignoreData) {
  31642. if (this._isPreamble || !this._inHeader) {
  31643. if (buf) { shouldWriteMore = this._part.push(buf) }
  31644. shouldWriteMore = this._part.push(data.slice(start, end))
  31645. if (!shouldWriteMore) { this._pause = true }
  31646. } else if (!this._isPreamble && this._inHeader) {
  31647. if (buf) { this._hparser.push(buf) }
  31648. r = this._hparser.push(data.slice(start, end))
  31649. if (!this._inHeader && r !== undefined && r < end) { this._oninfo(false, data, start + r, end) }
  31650. }
  31651. }
  31652. if (isMatch) {
  31653. this._hparser.reset()
  31654. if (this._isPreamble) { this._isPreamble = false } else {
  31655. if (start !== end) {
  31656. ++this._parts
  31657. this._part.on('end', function () {
  31658. if (--self._parts === 0) {
  31659. if (self._finished) {
  31660. self._realFinish = true
  31661. self.emit('finish')
  31662. self._realFinish = false
  31663. } else {
  31664. self._unpause()
  31665. }
  31666. }
  31667. })
  31668. }
  31669. }
  31670. this._part.push(null)
  31671. this._part = undefined
  31672. this._ignoreData = false
  31673. this._justMatched = true
  31674. this._dashes = 0
  31675. }
  31676. }
  31677. Dicer.prototype._unpause = function () {
  31678. if (!this._pause) { return }
  31679. this._pause = false
  31680. if (this._cb) {
  31681. const cb = this._cb
  31682. this._cb = undefined
  31683. cb()
  31684. }
  31685. }
  31686. module.exports = Dicer
  31687. /***/ }),
  31688. /***/ 2032:
  31689. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  31690. "use strict";
  31691. const EventEmitter = (__nccwpck_require__(5673).EventEmitter)
  31692. const inherits = (__nccwpck_require__(7261).inherits)
  31693. const getLimit = __nccwpck_require__(1467)
  31694. const StreamSearch = __nccwpck_require__(1142)
  31695. const B_DCRLF = Buffer.from('\r\n\r\n')
  31696. const RE_CRLF = /\r\n/g
  31697. const RE_HDR = /^([^:]+):[ \t]?([\x00-\xFF]+)?$/ // eslint-disable-line no-control-regex
  31698. function HeaderParser (cfg) {
  31699. EventEmitter.call(this)
  31700. cfg = cfg || {}
  31701. const self = this
  31702. this.nread = 0
  31703. this.maxed = false
  31704. this.npairs = 0
  31705. this.maxHeaderPairs = getLimit(cfg, 'maxHeaderPairs', 2000)
  31706. this.maxHeaderSize = getLimit(cfg, 'maxHeaderSize', 80 * 1024)
  31707. this.buffer = ''
  31708. this.header = {}
  31709. this.finished = false
  31710. this.ss = new StreamSearch(B_DCRLF)
  31711. this.ss.on('info', function (isMatch, data, start, end) {
  31712. if (data && !self.maxed) {
  31713. if (self.nread + end - start >= self.maxHeaderSize) {
  31714. end = self.maxHeaderSize - self.nread + start
  31715. self.nread = self.maxHeaderSize
  31716. self.maxed = true
  31717. } else { self.nread += (end - start) }
  31718. self.buffer += data.toString('binary', start, end)
  31719. }
  31720. if (isMatch) { self._finish() }
  31721. })
  31722. }
  31723. inherits(HeaderParser, EventEmitter)
  31724. HeaderParser.prototype.push = function (data) {
  31725. const r = this.ss.push(data)
  31726. if (this.finished) { return r }
  31727. }
  31728. HeaderParser.prototype.reset = function () {
  31729. this.finished = false
  31730. this.buffer = ''
  31731. this.header = {}
  31732. this.ss.reset()
  31733. }
  31734. HeaderParser.prototype._finish = function () {
  31735. if (this.buffer) { this._parseHeader() }
  31736. this.ss.matches = this.ss.maxMatches
  31737. const header = this.header
  31738. this.header = {}
  31739. this.buffer = ''
  31740. this.finished = true
  31741. this.nread = this.npairs = 0
  31742. this.maxed = false
  31743. this.emit('header', header)
  31744. }
  31745. HeaderParser.prototype._parseHeader = function () {
  31746. if (this.npairs === this.maxHeaderPairs) { return }
  31747. const lines = this.buffer.split(RE_CRLF)
  31748. const len = lines.length
  31749. let m, h
  31750. for (var i = 0; i < len; ++i) { // eslint-disable-line no-var
  31751. if (lines[i].length === 0) { continue }
  31752. if (lines[i][0] === '\t' || lines[i][0] === ' ') {
  31753. // folded header content
  31754. // RFC2822 says to just remove the CRLF and not the whitespace following
  31755. // it, so we follow the RFC and include the leading whitespace ...
  31756. if (h) {
  31757. this.header[h][this.header[h].length - 1] += lines[i]
  31758. continue
  31759. }
  31760. }
  31761. const posColon = lines[i].indexOf(':')
  31762. if (
  31763. posColon === -1 ||
  31764. posColon === 0
  31765. ) {
  31766. return
  31767. }
  31768. m = RE_HDR.exec(lines[i])
  31769. h = m[1].toLowerCase()
  31770. this.header[h] = this.header[h] || []
  31771. this.header[h].push((m[2] || ''))
  31772. if (++this.npairs === this.maxHeaderPairs) { break }
  31773. }
  31774. }
  31775. module.exports = HeaderParser
  31776. /***/ }),
  31777. /***/ 1620:
  31778. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  31779. "use strict";
  31780. const inherits = (__nccwpck_require__(7261).inherits)
  31781. const ReadableStream = (__nccwpck_require__(4492).Readable)
  31782. function PartStream (opts) {
  31783. ReadableStream.call(this, opts)
  31784. }
  31785. inherits(PartStream, ReadableStream)
  31786. PartStream.prototype._read = function (n) {}
  31787. module.exports = PartStream
  31788. /***/ }),
  31789. /***/ 1142:
  31790. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  31791. "use strict";
  31792. /**
  31793. * Copyright Brian White. All rights reserved.
  31794. *
  31795. * @see https://github.com/mscdex/streamsearch
  31796. *
  31797. * Permission is hereby granted, free of charge, to any person obtaining a copy
  31798. * of this software and associated documentation files (the "Software"), to
  31799. * deal in the Software without restriction, including without limitation the
  31800. * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  31801. * sell copies of the Software, and to permit persons to whom the Software is
  31802. * furnished to do so, subject to the following conditions:
  31803. *
  31804. * The above copyright notice and this permission notice shall be included in
  31805. * all copies or substantial portions of the Software.
  31806. *
  31807. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  31808. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  31809. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  31810. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  31811. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  31812. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  31813. * IN THE SOFTWARE.
  31814. *
  31815. * Based heavily on the Streaming Boyer-Moore-Horspool C++ implementation
  31816. * by Hongli Lai at: https://github.com/FooBarWidget/boyer-moore-horspool
  31817. */
  31818. const EventEmitter = (__nccwpck_require__(5673).EventEmitter)
  31819. const inherits = (__nccwpck_require__(7261).inherits)
  31820. function SBMH (needle) {
  31821. if (typeof needle === 'string') {
  31822. needle = Buffer.from(needle)
  31823. }
  31824. if (!Buffer.isBuffer(needle)) {
  31825. throw new TypeError('The needle has to be a String or a Buffer.')
  31826. }
  31827. const needleLength = needle.length
  31828. if (needleLength === 0) {
  31829. throw new Error('The needle cannot be an empty String/Buffer.')
  31830. }
  31831. if (needleLength > 256) {
  31832. throw new Error('The needle cannot have a length bigger than 256.')
  31833. }
  31834. this.maxMatches = Infinity
  31835. this.matches = 0
  31836. this._occ = new Array(256)
  31837. .fill(needleLength) // Initialize occurrence table.
  31838. this._lookbehind_size = 0
  31839. this._needle = needle
  31840. this._bufpos = 0
  31841. this._lookbehind = Buffer.alloc(needleLength)
  31842. // Populate occurrence table with analysis of the needle,
  31843. // ignoring last letter.
  31844. for (var i = 0; i < needleLength - 1; ++i) { // eslint-disable-line no-var
  31845. this._occ[needle[i]] = needleLength - 1 - i
  31846. }
  31847. }
  31848. inherits(SBMH, EventEmitter)
  31849. SBMH.prototype.reset = function () {
  31850. this._lookbehind_size = 0
  31851. this.matches = 0
  31852. this._bufpos = 0
  31853. }
  31854. SBMH.prototype.push = function (chunk, pos) {
  31855. if (!Buffer.isBuffer(chunk)) {
  31856. chunk = Buffer.from(chunk, 'binary')
  31857. }
  31858. const chlen = chunk.length
  31859. this._bufpos = pos || 0
  31860. let r
  31861. while (r !== chlen && this.matches < this.maxMatches) { r = this._sbmh_feed(chunk) }
  31862. return r
  31863. }
  31864. SBMH.prototype._sbmh_feed = function (data) {
  31865. const len = data.length
  31866. const needle = this._needle
  31867. const needleLength = needle.length
  31868. const lastNeedleChar = needle[needleLength - 1]
  31869. // Positive: points to a position in `data`
  31870. // pos == 3 points to data[3]
  31871. // Negative: points to a position in the lookbehind buffer
  31872. // pos == -2 points to lookbehind[lookbehind_size - 2]
  31873. let pos = -this._lookbehind_size
  31874. let ch
  31875. if (pos < 0) {
  31876. // Lookbehind buffer is not empty. Perform Boyer-Moore-Horspool
  31877. // search with character lookup code that considers both the
  31878. // lookbehind buffer and the current round's haystack data.
  31879. //
  31880. // Loop until
  31881. // there is a match.
  31882. // or until
  31883. // we've moved past the position that requires the
  31884. // lookbehind buffer. In this case we switch to the
  31885. // optimized loop.
  31886. // or until
  31887. // the character to look at lies outside the haystack.
  31888. while (pos < 0 && pos <= len - needleLength) {
  31889. ch = this._sbmh_lookup_char(data, pos + needleLength - 1)
  31890. if (
  31891. ch === lastNeedleChar &&
  31892. this._sbmh_memcmp(data, pos, needleLength - 1)
  31893. ) {
  31894. this._lookbehind_size = 0
  31895. ++this.matches
  31896. this.emit('info', true)
  31897. return (this._bufpos = pos + needleLength)
  31898. }
  31899. pos += this._occ[ch]
  31900. }
  31901. // No match.
  31902. if (pos < 0) {
  31903. // There's too few data for Boyer-Moore-Horspool to run,
  31904. // so let's use a different algorithm to skip as much as
  31905. // we can.
  31906. // Forward pos until
  31907. // the trailing part of lookbehind + data
  31908. // looks like the beginning of the needle
  31909. // or until
  31910. // pos == 0
  31911. while (pos < 0 && !this._sbmh_memcmp(data, pos, len - pos)) { ++pos }
  31912. }
  31913. if (pos >= 0) {
  31914. // Discard lookbehind buffer.
  31915. this.emit('info', false, this._lookbehind, 0, this._lookbehind_size)
  31916. this._lookbehind_size = 0
  31917. } else {
  31918. // Cut off part of the lookbehind buffer that has
  31919. // been processed and append the entire haystack
  31920. // into it.
  31921. const bytesToCutOff = this._lookbehind_size + pos
  31922. if (bytesToCutOff > 0) {
  31923. // The cut off data is guaranteed not to contain the needle.
  31924. this.emit('info', false, this._lookbehind, 0, bytesToCutOff)
  31925. }
  31926. this._lookbehind.copy(this._lookbehind, 0, bytesToCutOff,
  31927. this._lookbehind_size - bytesToCutOff)
  31928. this._lookbehind_size -= bytesToCutOff
  31929. data.copy(this._lookbehind, this._lookbehind_size)
  31930. this._lookbehind_size += len
  31931. this._bufpos = len
  31932. return len
  31933. }
  31934. }
  31935. pos += (pos >= 0) * this._bufpos
  31936. // Lookbehind buffer is now empty. We only need to check if the
  31937. // needle is in the haystack.
  31938. if (data.indexOf(needle, pos) !== -1) {
  31939. pos = data.indexOf(needle, pos)
  31940. ++this.matches
  31941. if (pos > 0) { this.emit('info', true, data, this._bufpos, pos) } else { this.emit('info', true) }
  31942. return (this._bufpos = pos + needleLength)
  31943. } else {
  31944. pos = len - needleLength
  31945. }
  31946. // There was no match. If there's trailing haystack data that we cannot
  31947. // match yet using the Boyer-Moore-Horspool algorithm (because the trailing
  31948. // data is less than the needle size) then match using a modified
  31949. // algorithm that starts matching from the beginning instead of the end.
  31950. // Whatever trailing data is left after running this algorithm is added to
  31951. // the lookbehind buffer.
  31952. while (
  31953. pos < len &&
  31954. (
  31955. data[pos] !== needle[0] ||
  31956. (
  31957. (Buffer.compare(
  31958. data.subarray(pos, pos + len - pos),
  31959. needle.subarray(0, len - pos)
  31960. ) !== 0)
  31961. )
  31962. )
  31963. ) {
  31964. ++pos
  31965. }
  31966. if (pos < len) {
  31967. data.copy(this._lookbehind, 0, pos, pos + (len - pos))
  31968. this._lookbehind_size = len - pos
  31969. }
  31970. // Everything until pos is guaranteed not to contain needle data.
  31971. if (pos > 0) { this.emit('info', false, data, this._bufpos, pos < len ? pos : len) }
  31972. this._bufpos = len
  31973. return len
  31974. }
  31975. SBMH.prototype._sbmh_lookup_char = function (data, pos) {
  31976. return (pos < 0)
  31977. ? this._lookbehind[this._lookbehind_size + pos]
  31978. : data[pos]
  31979. }
  31980. SBMH.prototype._sbmh_memcmp = function (data, pos, len) {
  31981. for (var i = 0; i < len; ++i) { // eslint-disable-line no-var
  31982. if (this._sbmh_lookup_char(data, pos + i) !== this._needle[i]) { return false }
  31983. }
  31984. return true
  31985. }
  31986. module.exports = SBMH
  31987. /***/ }),
  31988. /***/ 727:
  31989. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  31990. "use strict";
  31991. const WritableStream = (__nccwpck_require__(4492).Writable)
  31992. const { inherits } = __nccwpck_require__(7261)
  31993. const Dicer = __nccwpck_require__(2960)
  31994. const MultipartParser = __nccwpck_require__(2183)
  31995. const UrlencodedParser = __nccwpck_require__(8306)
  31996. const parseParams = __nccwpck_require__(1854)
  31997. function Busboy (opts) {
  31998. if (!(this instanceof Busboy)) { return new Busboy(opts) }
  31999. if (typeof opts !== 'object') {
  32000. throw new TypeError('Busboy expected an options-Object.')
  32001. }
  32002. if (typeof opts.headers !== 'object') {
  32003. throw new TypeError('Busboy expected an options-Object with headers-attribute.')
  32004. }
  32005. if (typeof opts.headers['content-type'] !== 'string') {
  32006. throw new TypeError('Missing Content-Type-header.')
  32007. }
  32008. const {
  32009. headers,
  32010. ...streamOptions
  32011. } = opts
  32012. this.opts = {
  32013. autoDestroy: false,
  32014. ...streamOptions
  32015. }
  32016. WritableStream.call(this, this.opts)
  32017. this._done = false
  32018. this._parser = this.getParserByHeaders(headers)
  32019. this._finished = false
  32020. }
  32021. inherits(Busboy, WritableStream)
  32022. Busboy.prototype.emit = function (ev) {
  32023. if (ev === 'finish') {
  32024. if (!this._done) {
  32025. this._parser?.end()
  32026. return
  32027. } else if (this._finished) {
  32028. return
  32029. }
  32030. this._finished = true
  32031. }
  32032. WritableStream.prototype.emit.apply(this, arguments)
  32033. }
  32034. Busboy.prototype.getParserByHeaders = function (headers) {
  32035. const parsed = parseParams(headers['content-type'])
  32036. const cfg = {
  32037. defCharset: this.opts.defCharset,
  32038. fileHwm: this.opts.fileHwm,
  32039. headers,
  32040. highWaterMark: this.opts.highWaterMark,
  32041. isPartAFile: this.opts.isPartAFile,
  32042. limits: this.opts.limits,
  32043. parsedConType: parsed,
  32044. preservePath: this.opts.preservePath
  32045. }
  32046. if (MultipartParser.detect.test(parsed[0])) {
  32047. return new MultipartParser(this, cfg)
  32048. }
  32049. if (UrlencodedParser.detect.test(parsed[0])) {
  32050. return new UrlencodedParser(this, cfg)
  32051. }
  32052. throw new Error('Unsupported Content-Type.')
  32053. }
  32054. Busboy.prototype._write = function (chunk, encoding, cb) {
  32055. this._parser.write(chunk, cb)
  32056. }
  32057. module.exports = Busboy
  32058. module.exports["default"] = Busboy
  32059. module.exports.Busboy = Busboy
  32060. module.exports.Dicer = Dicer
  32061. /***/ }),
  32062. /***/ 2183:
  32063. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  32064. "use strict";
  32065. // TODO:
  32066. // * support 1 nested multipart level
  32067. // (see second multipart example here:
  32068. // http://www.w3.org/TR/html401/interact/forms.html#didx-multipartform-data)
  32069. // * support limits.fieldNameSize
  32070. // -- this will require modifications to utils.parseParams
  32071. const { Readable } = __nccwpck_require__(4492)
  32072. const { inherits } = __nccwpck_require__(7261)
  32073. const Dicer = __nccwpck_require__(2960)
  32074. const parseParams = __nccwpck_require__(1854)
  32075. const decodeText = __nccwpck_require__(4619)
  32076. const basename = __nccwpck_require__(8647)
  32077. const getLimit = __nccwpck_require__(1467)
  32078. const RE_BOUNDARY = /^boundary$/i
  32079. const RE_FIELD = /^form-data$/i
  32080. const RE_CHARSET = /^charset$/i
  32081. const RE_FILENAME = /^filename$/i
  32082. const RE_NAME = /^name$/i
  32083. Multipart.detect = /^multipart\/form-data/i
  32084. function Multipart (boy, cfg) {
  32085. let i
  32086. let len
  32087. const self = this
  32088. let boundary
  32089. const limits = cfg.limits
  32090. const isPartAFile = cfg.isPartAFile || ((fieldName, contentType, fileName) => (contentType === 'application/octet-stream' || fileName !== undefined))
  32091. const parsedConType = cfg.parsedConType || []
  32092. const defCharset = cfg.defCharset || 'utf8'
  32093. const preservePath = cfg.preservePath
  32094. const fileOpts = { highWaterMark: cfg.fileHwm }
  32095. for (i = 0, len = parsedConType.length; i < len; ++i) {
  32096. if (Array.isArray(parsedConType[i]) &&
  32097. RE_BOUNDARY.test(parsedConType[i][0])) {
  32098. boundary = parsedConType[i][1]
  32099. break
  32100. }
  32101. }
  32102. function checkFinished () {
  32103. if (nends === 0 && finished && !boy._done) {
  32104. finished = false
  32105. self.end()
  32106. }
  32107. }
  32108. if (typeof boundary !== 'string') { throw new Error('Multipart: Boundary not found') }
  32109. const fieldSizeLimit = getLimit(limits, 'fieldSize', 1 * 1024 * 1024)
  32110. const fileSizeLimit = getLimit(limits, 'fileSize', Infinity)
  32111. const filesLimit = getLimit(limits, 'files', Infinity)
  32112. const fieldsLimit = getLimit(limits, 'fields', Infinity)
  32113. const partsLimit = getLimit(limits, 'parts', Infinity)
  32114. const headerPairsLimit = getLimit(limits, 'headerPairs', 2000)
  32115. const headerSizeLimit = getLimit(limits, 'headerSize', 80 * 1024)
  32116. let nfiles = 0
  32117. let nfields = 0
  32118. let nends = 0
  32119. let curFile
  32120. let curField
  32121. let finished = false
  32122. this._needDrain = false
  32123. this._pause = false
  32124. this._cb = undefined
  32125. this._nparts = 0
  32126. this._boy = boy
  32127. const parserCfg = {
  32128. boundary,
  32129. maxHeaderPairs: headerPairsLimit,
  32130. maxHeaderSize: headerSizeLimit,
  32131. partHwm: fileOpts.highWaterMark,
  32132. highWaterMark: cfg.highWaterMark
  32133. }
  32134. this.parser = new Dicer(parserCfg)
  32135. this.parser.on('drain', function () {
  32136. self._needDrain = false
  32137. if (self._cb && !self._pause) {
  32138. const cb = self._cb
  32139. self._cb = undefined
  32140. cb()
  32141. }
  32142. }).on('part', function onPart (part) {
  32143. if (++self._nparts > partsLimit) {
  32144. self.parser.removeListener('part', onPart)
  32145. self.parser.on('part', skipPart)
  32146. boy.hitPartsLimit = true
  32147. boy.emit('partsLimit')
  32148. return skipPart(part)
  32149. }
  32150. // hack because streams2 _always_ doesn't emit 'end' until nextTick, so let
  32151. // us emit 'end' early since we know the part has ended if we are already
  32152. // seeing the next part
  32153. if (curField) {
  32154. const field = curField
  32155. field.emit('end')
  32156. field.removeAllListeners('end')
  32157. }
  32158. part.on('header', function (header) {
  32159. let contype
  32160. let fieldname
  32161. let parsed
  32162. let charset
  32163. let encoding
  32164. let filename
  32165. let nsize = 0
  32166. if (header['content-type']) {
  32167. parsed = parseParams(header['content-type'][0])
  32168. if (parsed[0]) {
  32169. contype = parsed[0].toLowerCase()
  32170. for (i = 0, len = parsed.length; i < len; ++i) {
  32171. if (RE_CHARSET.test(parsed[i][0])) {
  32172. charset = parsed[i][1].toLowerCase()
  32173. break
  32174. }
  32175. }
  32176. }
  32177. }
  32178. if (contype === undefined) { contype = 'text/plain' }
  32179. if (charset === undefined) { charset = defCharset }
  32180. if (header['content-disposition']) {
  32181. parsed = parseParams(header['content-disposition'][0])
  32182. if (!RE_FIELD.test(parsed[0])) { return skipPart(part) }
  32183. for (i = 0, len = parsed.length; i < len; ++i) {
  32184. if (RE_NAME.test(parsed[i][0])) {
  32185. fieldname = parsed[i][1]
  32186. } else if (RE_FILENAME.test(parsed[i][0])) {
  32187. filename = parsed[i][1]
  32188. if (!preservePath) { filename = basename(filename) }
  32189. }
  32190. }
  32191. } else { return skipPart(part) }
  32192. if (header['content-transfer-encoding']) { encoding = header['content-transfer-encoding'][0].toLowerCase() } else { encoding = '7bit' }
  32193. let onData,
  32194. onEnd
  32195. if (isPartAFile(fieldname, contype, filename)) {
  32196. // file/binary field
  32197. if (nfiles === filesLimit) {
  32198. if (!boy.hitFilesLimit) {
  32199. boy.hitFilesLimit = true
  32200. boy.emit('filesLimit')
  32201. }
  32202. return skipPart(part)
  32203. }
  32204. ++nfiles
  32205. if (boy.listenerCount('file') === 0) {
  32206. self.parser._ignore()
  32207. return
  32208. }
  32209. ++nends
  32210. const file = new FileStream(fileOpts)
  32211. curFile = file
  32212. file.on('end', function () {
  32213. --nends
  32214. self._pause = false
  32215. checkFinished()
  32216. if (self._cb && !self._needDrain) {
  32217. const cb = self._cb
  32218. self._cb = undefined
  32219. cb()
  32220. }
  32221. })
  32222. file._read = function (n) {
  32223. if (!self._pause) { return }
  32224. self._pause = false
  32225. if (self._cb && !self._needDrain) {
  32226. const cb = self._cb
  32227. self._cb = undefined
  32228. cb()
  32229. }
  32230. }
  32231. boy.emit('file', fieldname, file, filename, encoding, contype)
  32232. onData = function (data) {
  32233. if ((nsize += data.length) > fileSizeLimit) {
  32234. const extralen = fileSizeLimit - nsize + data.length
  32235. if (extralen > 0) { file.push(data.slice(0, extralen)) }
  32236. file.truncated = true
  32237. file.bytesRead = fileSizeLimit
  32238. part.removeAllListeners('data')
  32239. file.emit('limit')
  32240. return
  32241. } else if (!file.push(data)) { self._pause = true }
  32242. file.bytesRead = nsize
  32243. }
  32244. onEnd = function () {
  32245. curFile = undefined
  32246. file.push(null)
  32247. }
  32248. } else {
  32249. // non-file field
  32250. if (nfields === fieldsLimit) {
  32251. if (!boy.hitFieldsLimit) {
  32252. boy.hitFieldsLimit = true
  32253. boy.emit('fieldsLimit')
  32254. }
  32255. return skipPart(part)
  32256. }
  32257. ++nfields
  32258. ++nends
  32259. let buffer = ''
  32260. let truncated = false
  32261. curField = part
  32262. onData = function (data) {
  32263. if ((nsize += data.length) > fieldSizeLimit) {
  32264. const extralen = (fieldSizeLimit - (nsize - data.length))
  32265. buffer += data.toString('binary', 0, extralen)
  32266. truncated = true
  32267. part.removeAllListeners('data')
  32268. } else { buffer += data.toString('binary') }
  32269. }
  32270. onEnd = function () {
  32271. curField = undefined
  32272. if (buffer.length) { buffer = decodeText(buffer, 'binary', charset) }
  32273. boy.emit('field', fieldname, buffer, false, truncated, encoding, contype)
  32274. --nends
  32275. checkFinished()
  32276. }
  32277. }
  32278. /* As of node@2efe4ab761666 (v0.10.29+/v0.11.14+), busboy had become
  32279. broken. Streams2/streams3 is a huge black box of confusion, but
  32280. somehow overriding the sync state seems to fix things again (and still
  32281. seems to work for previous node versions).
  32282. */
  32283. part._readableState.sync = false
  32284. part.on('data', onData)
  32285. part.on('end', onEnd)
  32286. }).on('error', function (err) {
  32287. if (curFile) { curFile.emit('error', err) }
  32288. })
  32289. }).on('error', function (err) {
  32290. boy.emit('error', err)
  32291. }).on('finish', function () {
  32292. finished = true
  32293. checkFinished()
  32294. })
  32295. }
  32296. Multipart.prototype.write = function (chunk, cb) {
  32297. const r = this.parser.write(chunk)
  32298. if (r && !this._pause) {
  32299. cb()
  32300. } else {
  32301. this._needDrain = !r
  32302. this._cb = cb
  32303. }
  32304. }
  32305. Multipart.prototype.end = function () {
  32306. const self = this
  32307. if (self.parser.writable) {
  32308. self.parser.end()
  32309. } else if (!self._boy._done) {
  32310. process.nextTick(function () {
  32311. self._boy._done = true
  32312. self._boy.emit('finish')
  32313. })
  32314. }
  32315. }
  32316. function skipPart (part) {
  32317. part.resume()
  32318. }
  32319. function FileStream (opts) {
  32320. Readable.call(this, opts)
  32321. this.bytesRead = 0
  32322. this.truncated = false
  32323. }
  32324. inherits(FileStream, Readable)
  32325. FileStream.prototype._read = function (n) {}
  32326. module.exports = Multipart
  32327. /***/ }),
  32328. /***/ 8306:
  32329. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  32330. "use strict";
  32331. const Decoder = __nccwpck_require__(7100)
  32332. const decodeText = __nccwpck_require__(4619)
  32333. const getLimit = __nccwpck_require__(1467)
  32334. const RE_CHARSET = /^charset$/i
  32335. UrlEncoded.detect = /^application\/x-www-form-urlencoded/i
  32336. function UrlEncoded (boy, cfg) {
  32337. const limits = cfg.limits
  32338. const parsedConType = cfg.parsedConType
  32339. this.boy = boy
  32340. this.fieldSizeLimit = getLimit(limits, 'fieldSize', 1 * 1024 * 1024)
  32341. this.fieldNameSizeLimit = getLimit(limits, 'fieldNameSize', 100)
  32342. this.fieldsLimit = getLimit(limits, 'fields', Infinity)
  32343. let charset
  32344. for (var i = 0, len = parsedConType.length; i < len; ++i) { // eslint-disable-line no-var
  32345. if (Array.isArray(parsedConType[i]) &&
  32346. RE_CHARSET.test(parsedConType[i][0])) {
  32347. charset = parsedConType[i][1].toLowerCase()
  32348. break
  32349. }
  32350. }
  32351. if (charset === undefined) { charset = cfg.defCharset || 'utf8' }
  32352. this.decoder = new Decoder()
  32353. this.charset = charset
  32354. this._fields = 0
  32355. this._state = 'key'
  32356. this._checkingBytes = true
  32357. this._bytesKey = 0
  32358. this._bytesVal = 0
  32359. this._key = ''
  32360. this._val = ''
  32361. this._keyTrunc = false
  32362. this._valTrunc = false
  32363. this._hitLimit = false
  32364. }
  32365. UrlEncoded.prototype.write = function (data, cb) {
  32366. if (this._fields === this.fieldsLimit) {
  32367. if (!this.boy.hitFieldsLimit) {
  32368. this.boy.hitFieldsLimit = true
  32369. this.boy.emit('fieldsLimit')
  32370. }
  32371. return cb()
  32372. }
  32373. let idxeq; let idxamp; let i; let p = 0; const len = data.length
  32374. while (p < len) {
  32375. if (this._state === 'key') {
  32376. idxeq = idxamp = undefined
  32377. for (i = p; i < len; ++i) {
  32378. if (!this._checkingBytes) { ++p }
  32379. if (data[i] === 0x3D/* = */) {
  32380. idxeq = i
  32381. break
  32382. } else if (data[i] === 0x26/* & */) {
  32383. idxamp = i
  32384. break
  32385. }
  32386. if (this._checkingBytes && this._bytesKey === this.fieldNameSizeLimit) {
  32387. this._hitLimit = true
  32388. break
  32389. } else if (this._checkingBytes) { ++this._bytesKey }
  32390. }
  32391. if (idxeq !== undefined) {
  32392. // key with assignment
  32393. if (idxeq > p) { this._key += this.decoder.write(data.toString('binary', p, idxeq)) }
  32394. this._state = 'val'
  32395. this._hitLimit = false
  32396. this._checkingBytes = true
  32397. this._val = ''
  32398. this._bytesVal = 0
  32399. this._valTrunc = false
  32400. this.decoder.reset()
  32401. p = idxeq + 1
  32402. } else if (idxamp !== undefined) {
  32403. // key with no assignment
  32404. ++this._fields
  32405. let key; const keyTrunc = this._keyTrunc
  32406. if (idxamp > p) { key = (this._key += this.decoder.write(data.toString('binary', p, idxamp))) } else { key = this._key }
  32407. this._hitLimit = false
  32408. this._checkingBytes = true
  32409. this._key = ''
  32410. this._bytesKey = 0
  32411. this._keyTrunc = false
  32412. this.decoder.reset()
  32413. if (key.length) {
  32414. this.boy.emit('field', decodeText(key, 'binary', this.charset),
  32415. '',
  32416. keyTrunc,
  32417. false)
  32418. }
  32419. p = idxamp + 1
  32420. if (this._fields === this.fieldsLimit) { return cb() }
  32421. } else if (this._hitLimit) {
  32422. // we may not have hit the actual limit if there are encoded bytes...
  32423. if (i > p) { this._key += this.decoder.write(data.toString('binary', p, i)) }
  32424. p = i
  32425. if ((this._bytesKey = this._key.length) === this.fieldNameSizeLimit) {
  32426. // yep, we actually did hit the limit
  32427. this._checkingBytes = false
  32428. this._keyTrunc = true
  32429. }
  32430. } else {
  32431. if (p < len) { this._key += this.decoder.write(data.toString('binary', p)) }
  32432. p = len
  32433. }
  32434. } else {
  32435. idxamp = undefined
  32436. for (i = p; i < len; ++i) {
  32437. if (!this._checkingBytes) { ++p }
  32438. if (data[i] === 0x26/* & */) {
  32439. idxamp = i
  32440. break
  32441. }
  32442. if (this._checkingBytes && this._bytesVal === this.fieldSizeLimit) {
  32443. this._hitLimit = true
  32444. break
  32445. } else if (this._checkingBytes) { ++this._bytesVal }
  32446. }
  32447. if (idxamp !== undefined) {
  32448. ++this._fields
  32449. if (idxamp > p) { this._val += this.decoder.write(data.toString('binary', p, idxamp)) }
  32450. this.boy.emit('field', decodeText(this._key, 'binary', this.charset),
  32451. decodeText(this._val, 'binary', this.charset),
  32452. this._keyTrunc,
  32453. this._valTrunc)
  32454. this._state = 'key'
  32455. this._hitLimit = false
  32456. this._checkingBytes = true
  32457. this._key = ''
  32458. this._bytesKey = 0
  32459. this._keyTrunc = false
  32460. this.decoder.reset()
  32461. p = idxamp + 1
  32462. if (this._fields === this.fieldsLimit) { return cb() }
  32463. } else if (this._hitLimit) {
  32464. // we may not have hit the actual limit if there are encoded bytes...
  32465. if (i > p) { this._val += this.decoder.write(data.toString('binary', p, i)) }
  32466. p = i
  32467. if ((this._val === '' && this.fieldSizeLimit === 0) ||
  32468. (this._bytesVal = this._val.length) === this.fieldSizeLimit) {
  32469. // yep, we actually did hit the limit
  32470. this._checkingBytes = false
  32471. this._valTrunc = true
  32472. }
  32473. } else {
  32474. if (p < len) { this._val += this.decoder.write(data.toString('binary', p)) }
  32475. p = len
  32476. }
  32477. }
  32478. }
  32479. cb()
  32480. }
  32481. UrlEncoded.prototype.end = function () {
  32482. if (this.boy._done) { return }
  32483. if (this._state === 'key' && this._key.length > 0) {
  32484. this.boy.emit('field', decodeText(this._key, 'binary', this.charset),
  32485. '',
  32486. this._keyTrunc,
  32487. false)
  32488. } else if (this._state === 'val') {
  32489. this.boy.emit('field', decodeText(this._key, 'binary', this.charset),
  32490. decodeText(this._val, 'binary', this.charset),
  32491. this._keyTrunc,
  32492. this._valTrunc)
  32493. }
  32494. this.boy._done = true
  32495. this.boy.emit('finish')
  32496. }
  32497. module.exports = UrlEncoded
  32498. /***/ }),
  32499. /***/ 7100:
  32500. /***/ ((module) => {
  32501. "use strict";
  32502. const RE_PLUS = /\+/g
  32503. const HEX = [
  32504. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32505. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32506. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32507. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
  32508. 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32509. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32510. 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32511. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
  32512. ]
  32513. function Decoder () {
  32514. this.buffer = undefined
  32515. }
  32516. Decoder.prototype.write = function (str) {
  32517. // Replace '+' with ' ' before decoding
  32518. str = str.replace(RE_PLUS, ' ')
  32519. let res = ''
  32520. let i = 0; let p = 0; const len = str.length
  32521. for (; i < len; ++i) {
  32522. if (this.buffer !== undefined) {
  32523. if (!HEX[str.charCodeAt(i)]) {
  32524. res += '%' + this.buffer
  32525. this.buffer = undefined
  32526. --i // retry character
  32527. } else {
  32528. this.buffer += str[i]
  32529. ++p
  32530. if (this.buffer.length === 2) {
  32531. res += String.fromCharCode(parseInt(this.buffer, 16))
  32532. this.buffer = undefined
  32533. }
  32534. }
  32535. } else if (str[i] === '%') {
  32536. if (i > p) {
  32537. res += str.substring(p, i)
  32538. p = i
  32539. }
  32540. this.buffer = ''
  32541. ++p
  32542. }
  32543. }
  32544. if (p < len && this.buffer === undefined) { res += str.substring(p) }
  32545. return res
  32546. }
  32547. Decoder.prototype.reset = function () {
  32548. this.buffer = undefined
  32549. }
  32550. module.exports = Decoder
  32551. /***/ }),
  32552. /***/ 8647:
  32553. /***/ ((module) => {
  32554. "use strict";
  32555. module.exports = function basename (path) {
  32556. if (typeof path !== 'string') { return '' }
  32557. for (var i = path.length - 1; i >= 0; --i) { // eslint-disable-line no-var
  32558. switch (path.charCodeAt(i)) {
  32559. case 0x2F: // '/'
  32560. case 0x5C: // '\'
  32561. path = path.slice(i + 1)
  32562. return (path === '..' || path === '.' ? '' : path)
  32563. }
  32564. }
  32565. return (path === '..' || path === '.' ? '' : path)
  32566. }
  32567. /***/ }),
  32568. /***/ 4619:
  32569. /***/ (function(module) {
  32570. "use strict";
  32571. // Node has always utf-8
  32572. const utf8Decoder = new TextDecoder('utf-8')
  32573. const textDecoders = new Map([
  32574. ['utf-8', utf8Decoder],
  32575. ['utf8', utf8Decoder]
  32576. ])
  32577. function getDecoder (charset) {
  32578. let lc
  32579. while (true) {
  32580. switch (charset) {
  32581. case 'utf-8':
  32582. case 'utf8':
  32583. return decoders.utf8
  32584. case 'latin1':
  32585. case 'ascii': // TODO: Make these a separate, strict decoder?
  32586. case 'us-ascii':
  32587. case 'iso-8859-1':
  32588. case 'iso8859-1':
  32589. case 'iso88591':
  32590. case 'iso_8859-1':
  32591. case 'windows-1252':
  32592. case 'iso_8859-1:1987':
  32593. case 'cp1252':
  32594. case 'x-cp1252':
  32595. return decoders.latin1
  32596. case 'utf16le':
  32597. case 'utf-16le':
  32598. case 'ucs2':
  32599. case 'ucs-2':
  32600. return decoders.utf16le
  32601. case 'base64':
  32602. return decoders.base64
  32603. default:
  32604. if (lc === undefined) {
  32605. lc = true
  32606. charset = charset.toLowerCase()
  32607. continue
  32608. }
  32609. return decoders.other.bind(charset)
  32610. }
  32611. }
  32612. }
  32613. const decoders = {
  32614. utf8: (data, sourceEncoding) => {
  32615. if (data.length === 0) {
  32616. return ''
  32617. }
  32618. if (typeof data === 'string') {
  32619. data = Buffer.from(data, sourceEncoding)
  32620. }
  32621. return data.utf8Slice(0, data.length)
  32622. },
  32623. latin1: (data, sourceEncoding) => {
  32624. if (data.length === 0) {
  32625. return ''
  32626. }
  32627. if (typeof data === 'string') {
  32628. return data
  32629. }
  32630. return data.latin1Slice(0, data.length)
  32631. },
  32632. utf16le: (data, sourceEncoding) => {
  32633. if (data.length === 0) {
  32634. return ''
  32635. }
  32636. if (typeof data === 'string') {
  32637. data = Buffer.from(data, sourceEncoding)
  32638. }
  32639. return data.ucs2Slice(0, data.length)
  32640. },
  32641. base64: (data, sourceEncoding) => {
  32642. if (data.length === 0) {
  32643. return ''
  32644. }
  32645. if (typeof data === 'string') {
  32646. data = Buffer.from(data, sourceEncoding)
  32647. }
  32648. return data.base64Slice(0, data.length)
  32649. },
  32650. other: (data, sourceEncoding) => {
  32651. if (data.length === 0) {
  32652. return ''
  32653. }
  32654. if (typeof data === 'string') {
  32655. data = Buffer.from(data, sourceEncoding)
  32656. }
  32657. if (textDecoders.has(this.toString())) {
  32658. try {
  32659. return textDecoders.get(this).decode(data)
  32660. } catch {}
  32661. }
  32662. return typeof data === 'string'
  32663. ? data
  32664. : data.toString()
  32665. }
  32666. }
  32667. function decodeText (text, sourceEncoding, destEncoding) {
  32668. if (text) {
  32669. return getDecoder(destEncoding)(text, sourceEncoding)
  32670. }
  32671. return text
  32672. }
  32673. module.exports = decodeText
  32674. /***/ }),
  32675. /***/ 1467:
  32676. /***/ ((module) => {
  32677. "use strict";
  32678. module.exports = function getLimit (limits, name, defaultLimit) {
  32679. if (
  32680. !limits ||
  32681. limits[name] === undefined ||
  32682. limits[name] === null
  32683. ) { return defaultLimit }
  32684. if (
  32685. typeof limits[name] !== 'number' ||
  32686. isNaN(limits[name])
  32687. ) { throw new TypeError('Limit ' + name + ' is not a valid number') }
  32688. return limits[name]
  32689. }
  32690. /***/ }),
  32691. /***/ 1854:
  32692. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  32693. "use strict";
  32694. /* eslint-disable object-property-newline */
  32695. const decodeText = __nccwpck_require__(4619)
  32696. const RE_ENCODED = /%[a-fA-F0-9][a-fA-F0-9]/g
  32697. const EncodedLookup = {
  32698. '%00': '\x00', '%01': '\x01', '%02': '\x02', '%03': '\x03', '%04': '\x04',
  32699. '%05': '\x05', '%06': '\x06', '%07': '\x07', '%08': '\x08', '%09': '\x09',
  32700. '%0a': '\x0a', '%0A': '\x0a', '%0b': '\x0b', '%0B': '\x0b', '%0c': '\x0c',
  32701. '%0C': '\x0c', '%0d': '\x0d', '%0D': '\x0d', '%0e': '\x0e', '%0E': '\x0e',
  32702. '%0f': '\x0f', '%0F': '\x0f', '%10': '\x10', '%11': '\x11', '%12': '\x12',
  32703. '%13': '\x13', '%14': '\x14', '%15': '\x15', '%16': '\x16', '%17': '\x17',
  32704. '%18': '\x18', '%19': '\x19', '%1a': '\x1a', '%1A': '\x1a', '%1b': '\x1b',
  32705. '%1B': '\x1b', '%1c': '\x1c', '%1C': '\x1c', '%1d': '\x1d', '%1D': '\x1d',
  32706. '%1e': '\x1e', '%1E': '\x1e', '%1f': '\x1f', '%1F': '\x1f', '%20': '\x20',
  32707. '%21': '\x21', '%22': '\x22', '%23': '\x23', '%24': '\x24', '%25': '\x25',
  32708. '%26': '\x26', '%27': '\x27', '%28': '\x28', '%29': '\x29', '%2a': '\x2a',
  32709. '%2A': '\x2a', '%2b': '\x2b', '%2B': '\x2b', '%2c': '\x2c', '%2C': '\x2c',
  32710. '%2d': '\x2d', '%2D': '\x2d', '%2e': '\x2e', '%2E': '\x2e', '%2f': '\x2f',
  32711. '%2F': '\x2f', '%30': '\x30', '%31': '\x31', '%32': '\x32', '%33': '\x33',
  32712. '%34': '\x34', '%35': '\x35', '%36': '\x36', '%37': '\x37', '%38': '\x38',
  32713. '%39': '\x39', '%3a': '\x3a', '%3A': '\x3a', '%3b': '\x3b', '%3B': '\x3b',
  32714. '%3c': '\x3c', '%3C': '\x3c', '%3d': '\x3d', '%3D': '\x3d', '%3e': '\x3e',
  32715. '%3E': '\x3e', '%3f': '\x3f', '%3F': '\x3f', '%40': '\x40', '%41': '\x41',
  32716. '%42': '\x42', '%43': '\x43', '%44': '\x44', '%45': '\x45', '%46': '\x46',
  32717. '%47': '\x47', '%48': '\x48', '%49': '\x49', '%4a': '\x4a', '%4A': '\x4a',
  32718. '%4b': '\x4b', '%4B': '\x4b', '%4c': '\x4c', '%4C': '\x4c', '%4d': '\x4d',
  32719. '%4D': '\x4d', '%4e': '\x4e', '%4E': '\x4e', '%4f': '\x4f', '%4F': '\x4f',
  32720. '%50': '\x50', '%51': '\x51', '%52': '\x52', '%53': '\x53', '%54': '\x54',
  32721. '%55': '\x55', '%56': '\x56', '%57': '\x57', '%58': '\x58', '%59': '\x59',
  32722. '%5a': '\x5a', '%5A': '\x5a', '%5b': '\x5b', '%5B': '\x5b', '%5c': '\x5c',
  32723. '%5C': '\x5c', '%5d': '\x5d', '%5D': '\x5d', '%5e': '\x5e', '%5E': '\x5e',
  32724. '%5f': '\x5f', '%5F': '\x5f', '%60': '\x60', '%61': '\x61', '%62': '\x62',
  32725. '%63': '\x63', '%64': '\x64', '%65': '\x65', '%66': '\x66', '%67': '\x67',
  32726. '%68': '\x68', '%69': '\x69', '%6a': '\x6a', '%6A': '\x6a', '%6b': '\x6b',
  32727. '%6B': '\x6b', '%6c': '\x6c', '%6C': '\x6c', '%6d': '\x6d', '%6D': '\x6d',
  32728. '%6e': '\x6e', '%6E': '\x6e', '%6f': '\x6f', '%6F': '\x6f', '%70': '\x70',
  32729. '%71': '\x71', '%72': '\x72', '%73': '\x73', '%74': '\x74', '%75': '\x75',
  32730. '%76': '\x76', '%77': '\x77', '%78': '\x78', '%79': '\x79', '%7a': '\x7a',
  32731. '%7A': '\x7a', '%7b': '\x7b', '%7B': '\x7b', '%7c': '\x7c', '%7C': '\x7c',
  32732. '%7d': '\x7d', '%7D': '\x7d', '%7e': '\x7e', '%7E': '\x7e', '%7f': '\x7f',
  32733. '%7F': '\x7f', '%80': '\x80', '%81': '\x81', '%82': '\x82', '%83': '\x83',
  32734. '%84': '\x84', '%85': '\x85', '%86': '\x86', '%87': '\x87', '%88': '\x88',
  32735. '%89': '\x89', '%8a': '\x8a', '%8A': '\x8a', '%8b': '\x8b', '%8B': '\x8b',
  32736. '%8c': '\x8c', '%8C': '\x8c', '%8d': '\x8d', '%8D': '\x8d', '%8e': '\x8e',
  32737. '%8E': '\x8e', '%8f': '\x8f', '%8F': '\x8f', '%90': '\x90', '%91': '\x91',
  32738. '%92': '\x92', '%93': '\x93', '%94': '\x94', '%95': '\x95', '%96': '\x96',
  32739. '%97': '\x97', '%98': '\x98', '%99': '\x99', '%9a': '\x9a', '%9A': '\x9a',
  32740. '%9b': '\x9b', '%9B': '\x9b', '%9c': '\x9c', '%9C': '\x9c', '%9d': '\x9d',
  32741. '%9D': '\x9d', '%9e': '\x9e', '%9E': '\x9e', '%9f': '\x9f', '%9F': '\x9f',
  32742. '%a0': '\xa0', '%A0': '\xa0', '%a1': '\xa1', '%A1': '\xa1', '%a2': '\xa2',
  32743. '%A2': '\xa2', '%a3': '\xa3', '%A3': '\xa3', '%a4': '\xa4', '%A4': '\xa4',
  32744. '%a5': '\xa5', '%A5': '\xa5', '%a6': '\xa6', '%A6': '\xa6', '%a7': '\xa7',
  32745. '%A7': '\xa7', '%a8': '\xa8', '%A8': '\xa8', '%a9': '\xa9', '%A9': '\xa9',
  32746. '%aa': '\xaa', '%Aa': '\xaa', '%aA': '\xaa', '%AA': '\xaa', '%ab': '\xab',
  32747. '%Ab': '\xab', '%aB': '\xab', '%AB': '\xab', '%ac': '\xac', '%Ac': '\xac',
  32748. '%aC': '\xac', '%AC': '\xac', '%ad': '\xad', '%Ad': '\xad', '%aD': '\xad',
  32749. '%AD': '\xad', '%ae': '\xae', '%Ae': '\xae', '%aE': '\xae', '%AE': '\xae',
  32750. '%af': '\xaf', '%Af': '\xaf', '%aF': '\xaf', '%AF': '\xaf', '%b0': '\xb0',
  32751. '%B0': '\xb0', '%b1': '\xb1', '%B1': '\xb1', '%b2': '\xb2', '%B2': '\xb2',
  32752. '%b3': '\xb3', '%B3': '\xb3', '%b4': '\xb4', '%B4': '\xb4', '%b5': '\xb5',
  32753. '%B5': '\xb5', '%b6': '\xb6', '%B6': '\xb6', '%b7': '\xb7', '%B7': '\xb7',
  32754. '%b8': '\xb8', '%B8': '\xb8', '%b9': '\xb9', '%B9': '\xb9', '%ba': '\xba',
  32755. '%Ba': '\xba', '%bA': '\xba', '%BA': '\xba', '%bb': '\xbb', '%Bb': '\xbb',
  32756. '%bB': '\xbb', '%BB': '\xbb', '%bc': '\xbc', '%Bc': '\xbc', '%bC': '\xbc',
  32757. '%BC': '\xbc', '%bd': '\xbd', '%Bd': '\xbd', '%bD': '\xbd', '%BD': '\xbd',
  32758. '%be': '\xbe', '%Be': '\xbe', '%bE': '\xbe', '%BE': '\xbe', '%bf': '\xbf',
  32759. '%Bf': '\xbf', '%bF': '\xbf', '%BF': '\xbf', '%c0': '\xc0', '%C0': '\xc0',
  32760. '%c1': '\xc1', '%C1': '\xc1', '%c2': '\xc2', '%C2': '\xc2', '%c3': '\xc3',
  32761. '%C3': '\xc3', '%c4': '\xc4', '%C4': '\xc4', '%c5': '\xc5', '%C5': '\xc5',
  32762. '%c6': '\xc6', '%C6': '\xc6', '%c7': '\xc7', '%C7': '\xc7', '%c8': '\xc8',
  32763. '%C8': '\xc8', '%c9': '\xc9', '%C9': '\xc9', '%ca': '\xca', '%Ca': '\xca',
  32764. '%cA': '\xca', '%CA': '\xca', '%cb': '\xcb', '%Cb': '\xcb', '%cB': '\xcb',
  32765. '%CB': '\xcb', '%cc': '\xcc', '%Cc': '\xcc', '%cC': '\xcc', '%CC': '\xcc',
  32766. '%cd': '\xcd', '%Cd': '\xcd', '%cD': '\xcd', '%CD': '\xcd', '%ce': '\xce',
  32767. '%Ce': '\xce', '%cE': '\xce', '%CE': '\xce', '%cf': '\xcf', '%Cf': '\xcf',
  32768. '%cF': '\xcf', '%CF': '\xcf', '%d0': '\xd0', '%D0': '\xd0', '%d1': '\xd1',
  32769. '%D1': '\xd1', '%d2': '\xd2', '%D2': '\xd2', '%d3': '\xd3', '%D3': '\xd3',
  32770. '%d4': '\xd4', '%D4': '\xd4', '%d5': '\xd5', '%D5': '\xd5', '%d6': '\xd6',
  32771. '%D6': '\xd6', '%d7': '\xd7', '%D7': '\xd7', '%d8': '\xd8', '%D8': '\xd8',
  32772. '%d9': '\xd9', '%D9': '\xd9', '%da': '\xda', '%Da': '\xda', '%dA': '\xda',
  32773. '%DA': '\xda', '%db': '\xdb', '%Db': '\xdb', '%dB': '\xdb', '%DB': '\xdb',
  32774. '%dc': '\xdc', '%Dc': '\xdc', '%dC': '\xdc', '%DC': '\xdc', '%dd': '\xdd',
  32775. '%Dd': '\xdd', '%dD': '\xdd', '%DD': '\xdd', '%de': '\xde', '%De': '\xde',
  32776. '%dE': '\xde', '%DE': '\xde', '%df': '\xdf', '%Df': '\xdf', '%dF': '\xdf',
  32777. '%DF': '\xdf', '%e0': '\xe0', '%E0': '\xe0', '%e1': '\xe1', '%E1': '\xe1',
  32778. '%e2': '\xe2', '%E2': '\xe2', '%e3': '\xe3', '%E3': '\xe3', '%e4': '\xe4',
  32779. '%E4': '\xe4', '%e5': '\xe5', '%E5': '\xe5', '%e6': '\xe6', '%E6': '\xe6',
  32780. '%e7': '\xe7', '%E7': '\xe7', '%e8': '\xe8', '%E8': '\xe8', '%e9': '\xe9',
  32781. '%E9': '\xe9', '%ea': '\xea', '%Ea': '\xea', '%eA': '\xea', '%EA': '\xea',
  32782. '%eb': '\xeb', '%Eb': '\xeb', '%eB': '\xeb', '%EB': '\xeb', '%ec': '\xec',
  32783. '%Ec': '\xec', '%eC': '\xec', '%EC': '\xec', '%ed': '\xed', '%Ed': '\xed',
  32784. '%eD': '\xed', '%ED': '\xed', '%ee': '\xee', '%Ee': '\xee', '%eE': '\xee',
  32785. '%EE': '\xee', '%ef': '\xef', '%Ef': '\xef', '%eF': '\xef', '%EF': '\xef',
  32786. '%f0': '\xf0', '%F0': '\xf0', '%f1': '\xf1', '%F1': '\xf1', '%f2': '\xf2',
  32787. '%F2': '\xf2', '%f3': '\xf3', '%F3': '\xf3', '%f4': '\xf4', '%F4': '\xf4',
  32788. '%f5': '\xf5', '%F5': '\xf5', '%f6': '\xf6', '%F6': '\xf6', '%f7': '\xf7',
  32789. '%F7': '\xf7', '%f8': '\xf8', '%F8': '\xf8', '%f9': '\xf9', '%F9': '\xf9',
  32790. '%fa': '\xfa', '%Fa': '\xfa', '%fA': '\xfa', '%FA': '\xfa', '%fb': '\xfb',
  32791. '%Fb': '\xfb', '%fB': '\xfb', '%FB': '\xfb', '%fc': '\xfc', '%Fc': '\xfc',
  32792. '%fC': '\xfc', '%FC': '\xfc', '%fd': '\xfd', '%Fd': '\xfd', '%fD': '\xfd',
  32793. '%FD': '\xfd', '%fe': '\xfe', '%Fe': '\xfe', '%fE': '\xfe', '%FE': '\xfe',
  32794. '%ff': '\xff', '%Ff': '\xff', '%fF': '\xff', '%FF': '\xff'
  32795. }
  32796. function encodedReplacer (match) {
  32797. return EncodedLookup[match]
  32798. }
  32799. const STATE_KEY = 0
  32800. const STATE_VALUE = 1
  32801. const STATE_CHARSET = 2
  32802. const STATE_LANG = 3
  32803. function parseParams (str) {
  32804. const res = []
  32805. let state = STATE_KEY
  32806. let charset = ''
  32807. let inquote = false
  32808. let escaping = false
  32809. let p = 0
  32810. let tmp = ''
  32811. const len = str.length
  32812. for (var i = 0; i < len; ++i) { // eslint-disable-line no-var
  32813. const char = str[i]
  32814. if (char === '\\' && inquote) {
  32815. if (escaping) { escaping = false } else {
  32816. escaping = true
  32817. continue
  32818. }
  32819. } else if (char === '"') {
  32820. if (!escaping) {
  32821. if (inquote) {
  32822. inquote = false
  32823. state = STATE_KEY
  32824. } else { inquote = true }
  32825. continue
  32826. } else { escaping = false }
  32827. } else {
  32828. if (escaping && inquote) { tmp += '\\' }
  32829. escaping = false
  32830. if ((state === STATE_CHARSET || state === STATE_LANG) && char === "'") {
  32831. if (state === STATE_CHARSET) {
  32832. state = STATE_LANG
  32833. charset = tmp.substring(1)
  32834. } else { state = STATE_VALUE }
  32835. tmp = ''
  32836. continue
  32837. } else if (state === STATE_KEY &&
  32838. (char === '*' || char === '=') &&
  32839. res.length) {
  32840. state = char === '*'
  32841. ? STATE_CHARSET
  32842. : STATE_VALUE
  32843. res[p] = [tmp, undefined]
  32844. tmp = ''
  32845. continue
  32846. } else if (!inquote && char === ';') {
  32847. state = STATE_KEY
  32848. if (charset) {
  32849. if (tmp.length) {
  32850. tmp = decodeText(tmp.replace(RE_ENCODED, encodedReplacer),
  32851. 'binary',
  32852. charset)
  32853. }
  32854. charset = ''
  32855. } else if (tmp.length) {
  32856. tmp = decodeText(tmp, 'binary', 'utf8')
  32857. }
  32858. if (res[p] === undefined) { res[p] = tmp } else { res[p][1] = tmp }
  32859. tmp = ''
  32860. ++p
  32861. continue
  32862. } else if (!inquote && (char === ' ' || char === '\t')) { continue }
  32863. }
  32864. tmp += char
  32865. }
  32866. if (charset && tmp.length) {
  32867. tmp = decodeText(tmp.replace(RE_ENCODED, encodedReplacer),
  32868. 'binary',
  32869. charset)
  32870. } else if (tmp) {
  32871. tmp = decodeText(tmp, 'binary', 'utf8')
  32872. }
  32873. if (res[p] === undefined) {
  32874. if (tmp) { res[p] = tmp }
  32875. } else { res[p][1] = tmp }
  32876. return res
  32877. }
  32878. module.exports = parseParams
  32879. /***/ })
  32880. /******/ });
  32881. /************************************************************************/
  32882. /******/ // The module cache
  32883. /******/ var __webpack_module_cache__ = {};
  32884. /******/
  32885. /******/ // The require function
  32886. /******/ function __nccwpck_require__(moduleId) {
  32887. /******/ // Check if module is in cache
  32888. /******/ var cachedModule = __webpack_module_cache__[moduleId];
  32889. /******/ if (cachedModule !== undefined) {
  32890. /******/ return cachedModule.exports;
  32891. /******/ }
  32892. /******/ // Create a new module (and put it into the cache)
  32893. /******/ var module = __webpack_module_cache__[moduleId] = {
  32894. /******/ // no module.id needed
  32895. /******/ // no module.loaded needed
  32896. /******/ exports: {}
  32897. /******/ };
  32898. /******/
  32899. /******/ // Execute the module function
  32900. /******/ var threw = true;
  32901. /******/ try {
  32902. /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __nccwpck_require__);
  32903. /******/ threw = false;
  32904. /******/ } finally {
  32905. /******/ if(threw) delete __webpack_module_cache__[moduleId];
  32906. /******/ }
  32907. /******/
  32908. /******/ // Return the exports of the module
  32909. /******/ return module.exports;
  32910. /******/ }
  32911. /******/
  32912. /************************************************************************/
  32913. /******/ /* webpack/runtime/compat */
  32914. /******/
  32915. /******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/";
  32916. /******/
  32917. /************************************************************************/
  32918. /******/
  32919. /******/ // startup
  32920. /******/ // Load entry module and return exports
  32921. /******/ // This entry module is referenced by other modules so it can't be inlined
  32922. /******/ var __webpack_exports__ = __nccwpck_require__(3109);
  32923. /******/ module.exports = __webpack_exports__;
  32924. /******/
  32925. /******/ })()
  32926. ;