2
0

index.js 1.3 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682
  1. /******/ (() => { // webpackBootstrap
  2. /******/ var __webpack_modules__ = ({
  3. /***/ 7219:
  4. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  5. "use strict";
  6. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  7. if (k2 === undefined) k2 = k;
  8. var desc = Object.getOwnPropertyDescriptor(m, k);
  9. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  10. desc = { enumerable: true, get: function() { return m[k]; } };
  11. }
  12. Object.defineProperty(o, k2, desc);
  13. }) : (function(o, m, k, k2) {
  14. if (k2 === undefined) k2 = k;
  15. o[k2] = m[k];
  16. }));
  17. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  18. Object.defineProperty(o, "default", { enumerable: true, value: v });
  19. }) : function(o, v) {
  20. o["default"] = v;
  21. });
  22. var __importStar = (this && this.__importStar) || function (mod) {
  23. if (mod && mod.__esModule) return mod;
  24. var result = {};
  25. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  26. __setModuleDefault(result, mod);
  27. return result;
  28. };
  29. Object.defineProperty(exports, "__esModule", ({ value: true }));
  30. exports.directoryExistsSync = directoryExistsSync;
  31. exports.existsSync = existsSync;
  32. exports.fileExistsSync = fileExistsSync;
  33. const fs = __importStar(__nccwpck_require__(7147));
  34. function directoryExistsSync(path, required) {
  35. var _a;
  36. if (!path) {
  37. throw new Error("Arg 'path' must not be empty");
  38. }
  39. let stats;
  40. try {
  41. stats = fs.statSync(path);
  42. }
  43. catch (error) {
  44. if ((error === null || error === void 0 ? void 0 : error.code) === 'ENOENT') {
  45. if (!required) {
  46. return false;
  47. }
  48. throw new Error(`Directory '${path}' does not exist`);
  49. }
  50. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error}`);
  51. }
  52. if (stats.isDirectory()) {
  53. return true;
  54. }
  55. else if (!required) {
  56. return false;
  57. }
  58. throw new Error(`Directory '${path}' does not exist`);
  59. }
  60. function existsSync(path) {
  61. var _a;
  62. if (!path) {
  63. throw new Error("Arg 'path' must not be empty");
  64. }
  65. try {
  66. fs.statSync(path);
  67. }
  68. catch (error) {
  69. if ((error === null || error === void 0 ? void 0 : error.code) === 'ENOENT') {
  70. return false;
  71. }
  72. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error}`);
  73. }
  74. return true;
  75. }
  76. function fileExistsSync(path) {
  77. var _a;
  78. if (!path) {
  79. throw new Error("Arg 'path' must not be empty");
  80. }
  81. let stats;
  82. try {
  83. stats = fs.statSync(path);
  84. }
  85. catch (error) {
  86. if ((error === null || error === void 0 ? void 0 : error.code) === 'ENOENT') {
  87. return false;
  88. }
  89. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error}`);
  90. }
  91. if (!stats.isDirectory()) {
  92. return true;
  93. }
  94. return false;
  95. }
  96. /***/ }),
  97. /***/ 2565:
  98. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  99. "use strict";
  100. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  101. if (k2 === undefined) k2 = k;
  102. var desc = Object.getOwnPropertyDescriptor(m, k);
  103. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  104. desc = { enumerable: true, get: function() { return m[k]; } };
  105. }
  106. Object.defineProperty(o, k2, desc);
  107. }) : (function(o, m, k, k2) {
  108. if (k2 === undefined) k2 = k;
  109. o[k2] = m[k];
  110. }));
  111. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  112. Object.defineProperty(o, "default", { enumerable: true, value: v });
  113. }) : function(o, v) {
  114. o["default"] = v;
  115. });
  116. var __importStar = (this && this.__importStar) || function (mod) {
  117. if (mod && mod.__esModule) return mod;
  118. var result = {};
  119. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  120. __setModuleDefault(result, mod);
  121. return result;
  122. };
  123. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  124. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  125. return new (P || (P = Promise))(function (resolve, reject) {
  126. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  127. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  128. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  129. step((generator = generator.apply(thisArg, _arguments || [])).next());
  130. });
  131. };
  132. Object.defineProperty(exports, "__esModule", ({ value: true }));
  133. exports.createAuthHelper = createAuthHelper;
  134. const assert = __importStar(__nccwpck_require__(9491));
  135. const core = __importStar(__nccwpck_require__(2186));
  136. const exec = __importStar(__nccwpck_require__(1514));
  137. const fs = __importStar(__nccwpck_require__(7147));
  138. const io = __importStar(__nccwpck_require__(7436));
  139. const os = __importStar(__nccwpck_require__(2037));
  140. const path = __importStar(__nccwpck_require__(1017));
  141. const regexpHelper = __importStar(__nccwpck_require__(3120));
  142. const stateHelper = __importStar(__nccwpck_require__(4866));
  143. const urlHelper = __importStar(__nccwpck_require__(9437));
  144. const uuid_1 = __nccwpck_require__(5840);
  145. const IS_WINDOWS = process.platform === 'win32';
  146. const SSH_COMMAND_KEY = 'core.sshCommand';
  147. function createAuthHelper(git, settings) {
  148. return new GitAuthHelper(git, settings);
  149. }
  150. class GitAuthHelper {
  151. constructor(gitCommandManager, gitSourceSettings) {
  152. this.insteadOfValues = [];
  153. this.sshCommand = '';
  154. this.sshKeyPath = '';
  155. this.sshKnownHostsPath = '';
  156. this.temporaryHomePath = '';
  157. this.credentialsConfigPath = ''; // Path to separate credentials config file in RUNNER_TEMP
  158. this.git = gitCommandManager;
  159. this.settings = gitSourceSettings || {};
  160. // Token auth header
  161. const serverUrl = urlHelper.getServerUrl(this.settings.githubServerUrl);
  162. this.tokenConfigKey = `http.${serverUrl.origin}/.extraheader`; // "origin" is SCHEME://HOSTNAME[:PORT]
  163. const basicCredential = Buffer.from(`x-access-token:${this.settings.authToken}`, 'utf8').toString('base64');
  164. core.setSecret(basicCredential);
  165. this.tokenPlaceholderConfigValue = `AUTHORIZATION: basic ***`;
  166. this.tokenConfigValue = `AUTHORIZATION: basic ${basicCredential}`;
  167. // Instead of SSH URL
  168. this.insteadOfKey = `url.${serverUrl.origin}/.insteadOf`; // "origin" is SCHEME://HOSTNAME[:PORT]
  169. this.insteadOfValues.push(`git@${serverUrl.hostname}:`);
  170. if (this.settings.workflowOrganizationId) {
  171. this.insteadOfValues.push(`org-${this.settings.workflowOrganizationId}@github.com:`);
  172. }
  173. }
  174. configureAuth() {
  175. return __awaiter(this, void 0, void 0, function* () {
  176. // Remove possible previous values
  177. yield this.removeAuth();
  178. // Configure new values
  179. yield this.configureSsh();
  180. yield this.configureToken();
  181. });
  182. }
  183. configureTempGlobalConfig() {
  184. return __awaiter(this, void 0, void 0, function* () {
  185. var _a;
  186. // Already setup global config
  187. if (((_a = this.temporaryHomePath) === null || _a === void 0 ? void 0 : _a.length) > 0) {
  188. return path.join(this.temporaryHomePath, '.gitconfig');
  189. }
  190. // Create a temp home directory
  191. const runnerTemp = process.env['RUNNER_TEMP'] || '';
  192. assert.ok(runnerTemp, 'RUNNER_TEMP is not defined');
  193. const uniqueId = (0, uuid_1.v4)();
  194. this.temporaryHomePath = path.join(runnerTemp, uniqueId);
  195. yield fs.promises.mkdir(this.temporaryHomePath, { recursive: true });
  196. // Copy the global git config
  197. const gitConfigPath = path.join(process.env['HOME'] || os.homedir(), '.gitconfig');
  198. const newGitConfigPath = path.join(this.temporaryHomePath, '.gitconfig');
  199. let configExists = false;
  200. try {
  201. yield fs.promises.stat(gitConfigPath);
  202. configExists = true;
  203. }
  204. catch (err) {
  205. if ((err === null || err === void 0 ? void 0 : err.code) !== 'ENOENT') {
  206. throw err;
  207. }
  208. }
  209. if (configExists) {
  210. core.info(`Copying '${gitConfigPath}' to '${newGitConfigPath}'`);
  211. yield io.cp(gitConfigPath, newGitConfigPath);
  212. }
  213. else {
  214. yield fs.promises.writeFile(newGitConfigPath, '');
  215. }
  216. // Override HOME
  217. core.info(`Temporarily overriding HOME='${this.temporaryHomePath}' before making global git config changes`);
  218. this.git.setEnvironmentVariable('HOME', this.temporaryHomePath);
  219. return newGitConfigPath;
  220. });
  221. }
  222. configureGlobalAuth() {
  223. return __awaiter(this, void 0, void 0, function* () {
  224. // 'configureTempGlobalConfig' noops if already set, just returns the path
  225. yield this.configureTempGlobalConfig();
  226. try {
  227. // Configure the token
  228. yield this.configureToken(true);
  229. // Configure HTTPS instead of SSH
  230. yield this.git.tryConfigUnset(this.insteadOfKey, true);
  231. if (!this.settings.sshKey) {
  232. for (const insteadOfValue of this.insteadOfValues) {
  233. yield this.git.config(this.insteadOfKey, insteadOfValue, true, // globalConfig?
  234. true // add?
  235. );
  236. }
  237. }
  238. }
  239. catch (err) {
  240. // Unset in case somehow written to the real global config
  241. core.info('Encountered an error when attempting to configure token. Attempting unconfigure.');
  242. yield this.git.tryConfigUnset(this.tokenConfigKey, true);
  243. throw err;
  244. }
  245. });
  246. }
  247. configureSubmoduleAuth() {
  248. return __awaiter(this, void 0, void 0, function* () {
  249. // Remove possible previous HTTPS instead of SSH
  250. yield this.removeSubmoduleGitConfig(this.insteadOfKey);
  251. if (this.settings.persistCredentials) {
  252. // Get the credentials config file path in RUNNER_TEMP
  253. const credentialsConfigPath = this.getCredentialsConfigPath();
  254. // Container credentials config path
  255. const containerCredentialsPath = path.posix.join('/github/runner_temp', path.basename(credentialsConfigPath));
  256. // Get submodule config file paths.
  257. const configPaths = yield this.git.getSubmoduleConfigPaths(this.settings.nestedSubmodules);
  258. // For each submodule, configure includeIf entries pointing to the shared credentials file.
  259. // Configure both host and container paths to support Docker container actions.
  260. for (const configPath of configPaths) {
  261. // Submodule Git directory
  262. let submoduleGitDir = path.dirname(configPath); // The config file is at .git/modules/submodule-name/config
  263. submoduleGitDir = submoduleGitDir.replace(/\\/g, '/'); // Use forward slashes, even on Windows
  264. // Configure host includeIf
  265. yield this.git.config(`includeIf.gitdir:${submoduleGitDir}.path`, credentialsConfigPath, false, // globalConfig?
  266. false, // add?
  267. configPath);
  268. // Container submodule git directory
  269. const githubWorkspace = process.env['GITHUB_WORKSPACE'];
  270. assert.ok(githubWorkspace, 'GITHUB_WORKSPACE is not defined');
  271. let relativeSubmoduleGitDir = path.relative(githubWorkspace, submoduleGitDir);
  272. relativeSubmoduleGitDir = relativeSubmoduleGitDir.replace(/\\/g, '/'); // Use forward slashes, even on Windows
  273. const containerSubmoduleGitDir = path.posix.join('/github/workspace', relativeSubmoduleGitDir);
  274. // Configure container includeIf
  275. yield this.git.config(`includeIf.gitdir:${containerSubmoduleGitDir}.path`, containerCredentialsPath, false, // globalConfig?
  276. false, // add?
  277. configPath);
  278. }
  279. if (this.settings.sshKey) {
  280. // Configure core.sshCommand
  281. yield this.git.submoduleForeach(`git config --local '${SSH_COMMAND_KEY}' '${this.sshCommand}'`, this.settings.nestedSubmodules);
  282. }
  283. else {
  284. // Configure HTTPS instead of SSH
  285. for (const insteadOfValue of this.insteadOfValues) {
  286. yield this.git.submoduleForeach(`git config --local --add '${this.insteadOfKey}' '${insteadOfValue}'`, this.settings.nestedSubmodules);
  287. }
  288. }
  289. }
  290. });
  291. }
  292. removeAuth() {
  293. return __awaiter(this, void 0, void 0, function* () {
  294. yield this.removeSsh();
  295. yield this.removeToken();
  296. });
  297. }
  298. removeGlobalConfig() {
  299. return __awaiter(this, void 0, void 0, function* () {
  300. var _a;
  301. if (((_a = this.temporaryHomePath) === null || _a === void 0 ? void 0 : _a.length) > 0) {
  302. core.debug(`Unsetting HOME override`);
  303. this.git.removeEnvironmentVariable('HOME');
  304. yield io.rmRF(this.temporaryHomePath);
  305. }
  306. });
  307. }
  308. /**
  309. * Configures SSH authentication by writing the SSH key and known hosts,
  310. * and setting up the GIT_SSH_COMMAND environment variable.
  311. */
  312. configureSsh() {
  313. return __awaiter(this, void 0, void 0, function* () {
  314. if (!this.settings.sshKey) {
  315. return;
  316. }
  317. // Write key
  318. const runnerTemp = process.env['RUNNER_TEMP'] || '';
  319. assert.ok(runnerTemp, 'RUNNER_TEMP is not defined');
  320. const uniqueId = (0, uuid_1.v4)();
  321. this.sshKeyPath = path.join(runnerTemp, uniqueId);
  322. stateHelper.setSshKeyPath(this.sshKeyPath);
  323. yield fs.promises.mkdir(runnerTemp, { recursive: true });
  324. yield fs.promises.writeFile(this.sshKeyPath, this.settings.sshKey.trim() + '\n', { mode: 0o600 });
  325. // Remove inherited permissions on Windows
  326. if (IS_WINDOWS) {
  327. const icacls = yield io.which('icacls.exe');
  328. yield exec.exec(`"${icacls}" "${this.sshKeyPath}" /grant:r "${process.env['USERDOMAIN']}\\${process.env['USERNAME']}:F"`);
  329. yield exec.exec(`"${icacls}" "${this.sshKeyPath}" /inheritance:r`);
  330. }
  331. // Write known hosts
  332. const userKnownHostsPath = path.join(os.homedir(), '.ssh', 'known_hosts');
  333. let userKnownHosts = '';
  334. try {
  335. userKnownHosts = (yield fs.promises.readFile(userKnownHostsPath)).toString();
  336. }
  337. catch (err) {
  338. if ((err === null || err === void 0 ? void 0 : err.code) !== 'ENOENT') {
  339. throw err;
  340. }
  341. }
  342. let knownHosts = '';
  343. if (userKnownHosts) {
  344. knownHosts += `# Begin from ${userKnownHostsPath}\n${userKnownHosts}\n# End from ${userKnownHostsPath}\n`;
  345. }
  346. if (this.settings.sshKnownHosts) {
  347. knownHosts += `# Begin from input known hosts\n${this.settings.sshKnownHosts}\n# end from input known hosts\n`;
  348. }
  349. knownHosts += `# Begin implicitly added github.com\ngithub.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCj7ndNxQowgcQnjshcLrqPEiiphnt+VTTvDP6mHBL9j1aNUkY4Ue1gvwnGLVlOhGeYrnZaMgRK6+PKCUXaDbC7qtbW8gIkhL7aGCsOr/C56SJMy/BCZfxd1nWzAOxSDPgVsmerOBYfNqltV9/hWCqBywINIR+5dIg6JTJ72pcEpEjcYgXkE2YEFXV1JHnsKgbLWNlhScqb2UmyRkQyytRLtL+38TGxkxCflmO+5Z8CSSNY7GidjMIZ7Q4zMjA2n1nGrlTDkzwDCsw+wqFPGQA179cnfGWOWRVruj16z6XyvxvjJwbz0wQZ75XK5tKSb7FNyeIEs4TT4jk+S4dhPeAUC5y+bDYirYgM4GC7uEnztnZyaVWQ7B381AK4Qdrwt51ZqExKbQpTUNn+EjqoTwvqNj4kqx5QUCI0ThS/YkOxJCXmPUWZbhjpCg56i+2aB6CmK2JGhn57K5mj0MNdBXA4/WnwH6XoPWJzK5Nyu2zB3nAZp+S5hpQs+p1vN1/wsjk=\n# End implicitly added github.com\n`;
  350. this.sshKnownHostsPath = path.join(runnerTemp, `${uniqueId}_known_hosts`);
  351. stateHelper.setSshKnownHostsPath(this.sshKnownHostsPath);
  352. yield fs.promises.writeFile(this.sshKnownHostsPath, knownHosts);
  353. // Configure GIT_SSH_COMMAND
  354. const sshPath = yield io.which('ssh', true);
  355. this.sshCommand = `"${sshPath}" -i "$RUNNER_TEMP/${path.basename(this.sshKeyPath)}"`;
  356. if (this.settings.sshStrict) {
  357. this.sshCommand += ' -o StrictHostKeyChecking=yes -o CheckHostIP=no';
  358. }
  359. this.sshCommand += ` -o "UserKnownHostsFile=$RUNNER_TEMP/${path.basename(this.sshKnownHostsPath)}"`;
  360. core.info(`Temporarily overriding GIT_SSH_COMMAND=${this.sshCommand}`);
  361. this.git.setEnvironmentVariable('GIT_SSH_COMMAND', this.sshCommand);
  362. // Configure core.sshCommand
  363. if (this.settings.persistCredentials) {
  364. yield this.git.config(SSH_COMMAND_KEY, this.sshCommand);
  365. }
  366. });
  367. }
  368. /**
  369. * Configures token-based authentication by creating a credentials config file
  370. * and setting up includeIf entries to reference it.
  371. * @param globalConfig Whether to configure global config instead of local
  372. */
  373. configureToken(globalConfig) {
  374. return __awaiter(this, void 0, void 0, function* () {
  375. // Get the credentials config file path in RUNNER_TEMP
  376. const credentialsConfigPath = this.getCredentialsConfigPath();
  377. // Write placeholder to the separate credentials config file using git config.
  378. // This approach avoids the credential being captured by process creation audit events,
  379. // which are commonly logged. For more information, refer to
  380. // https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/manage/component-updates/command-line-process-auditing
  381. yield this.git.config(this.tokenConfigKey, this.tokenPlaceholderConfigValue, false, // globalConfig?
  382. false, // add?
  383. credentialsConfigPath);
  384. // Replace the placeholder in the credentials config file
  385. let content = (yield fs.promises.readFile(credentialsConfigPath)).toString();
  386. const placeholderIndex = content.indexOf(this.tokenPlaceholderConfigValue);
  387. if (placeholderIndex < 0 ||
  388. placeholderIndex != content.lastIndexOf(this.tokenPlaceholderConfigValue)) {
  389. throw new Error(`Unable to replace auth placeholder in ${credentialsConfigPath}`);
  390. }
  391. assert.ok(this.tokenConfigValue, 'tokenConfigValue is not defined');
  392. content = content.replace(this.tokenPlaceholderConfigValue, this.tokenConfigValue);
  393. yield fs.promises.writeFile(credentialsConfigPath, content);
  394. // Add include or includeIf to reference the credentials config
  395. if (globalConfig) {
  396. // Global config file is temporary
  397. yield this.git.config('include.path', credentialsConfigPath, true // globalConfig?
  398. );
  399. }
  400. else {
  401. // Host git directory
  402. let gitDir = path.join(this.git.getWorkingDirectory(), '.git');
  403. gitDir = gitDir.replace(/\\/g, '/'); // Use forward slashes, even on Windows
  404. // Configure host includeIf
  405. const hostIncludeKey = `includeIf.gitdir:${gitDir}.path`;
  406. yield this.git.config(hostIncludeKey, credentialsConfigPath);
  407. // Configure host includeIf for worktrees
  408. const hostWorktreeIncludeKey = `includeIf.gitdir:${gitDir}/worktrees/*.path`;
  409. yield this.git.config(hostWorktreeIncludeKey, credentialsConfigPath);
  410. // Container git directory
  411. const workingDirectory = this.git.getWorkingDirectory();
  412. const githubWorkspace = process.env['GITHUB_WORKSPACE'];
  413. assert.ok(githubWorkspace, 'GITHUB_WORKSPACE is not defined');
  414. let relativePath = path.relative(githubWorkspace, workingDirectory);
  415. relativePath = relativePath.replace(/\\/g, '/'); // Use forward slashes, even on Windows
  416. const containerGitDir = path.posix.join('/github/workspace', relativePath, '.git');
  417. // Container credentials config path
  418. const containerCredentialsPath = path.posix.join('/github/runner_temp', path.basename(credentialsConfigPath));
  419. // Configure container includeIf
  420. const containerIncludeKey = `includeIf.gitdir:${containerGitDir}.path`;
  421. yield this.git.config(containerIncludeKey, containerCredentialsPath);
  422. // Configure container includeIf for worktrees
  423. const containerWorktreeIncludeKey = `includeIf.gitdir:${containerGitDir}/worktrees/*.path`;
  424. yield this.git.config(containerWorktreeIncludeKey, containerCredentialsPath);
  425. }
  426. });
  427. }
  428. /**
  429. * Gets or creates the path to the credentials config file in RUNNER_TEMP.
  430. * @returns The absolute path to the credentials config file
  431. */
  432. getCredentialsConfigPath() {
  433. if (this.credentialsConfigPath) {
  434. return this.credentialsConfigPath;
  435. }
  436. const runnerTemp = process.env['RUNNER_TEMP'] || '';
  437. assert.ok(runnerTemp, 'RUNNER_TEMP is not defined');
  438. // Create a unique filename for this checkout instance
  439. const configFileName = `git-credentials-${(0, uuid_1.v4)()}.config`;
  440. this.credentialsConfigPath = path.join(runnerTemp, configFileName);
  441. core.debug(`Credentials config path: ${this.credentialsConfigPath}`);
  442. return this.credentialsConfigPath;
  443. }
  444. /**
  445. * Removes SSH authentication configuration by cleaning up SSH keys,
  446. * known hosts files, and SSH command configurations.
  447. */
  448. removeSsh() {
  449. return __awaiter(this, void 0, void 0, function* () {
  450. var _a, _b;
  451. // SSH key
  452. const keyPath = this.sshKeyPath || stateHelper.SshKeyPath;
  453. if (keyPath) {
  454. try {
  455. core.info(`Removing SSH key '${keyPath}'`);
  456. yield io.rmRF(keyPath);
  457. }
  458. catch (err) {
  459. core.debug(`${(_a = err === null || err === void 0 ? void 0 : err.message) !== null && _a !== void 0 ? _a : err}`);
  460. core.warning(`Failed to remove SSH key '${keyPath}'`);
  461. }
  462. }
  463. // SSH known hosts
  464. const knownHostsPath = this.sshKnownHostsPath || stateHelper.SshKnownHostsPath;
  465. if (knownHostsPath) {
  466. try {
  467. core.info(`Removing SSH known hosts '${knownHostsPath}'`);
  468. yield io.rmRF(knownHostsPath);
  469. }
  470. catch (err) {
  471. core.debug(`${(_b = err === null || err === void 0 ? void 0 : err.message) !== null && _b !== void 0 ? _b : err}`);
  472. core.warning(`Failed to remove SSH known hosts '${knownHostsPath}'`);
  473. }
  474. }
  475. // SSH command
  476. core.info('Removing SSH command configuration');
  477. yield this.removeGitConfig(SSH_COMMAND_KEY);
  478. yield this.removeSubmoduleGitConfig(SSH_COMMAND_KEY);
  479. });
  480. }
  481. /**
  482. * Removes token-based authentication by cleaning up HTTP headers,
  483. * includeIf entries, and credentials config files.
  484. */
  485. removeToken() {
  486. return __awaiter(this, void 0, void 0, function* () {
  487. var _a;
  488. // Remove HTTP extra header
  489. core.info('Removing HTTP extra header');
  490. yield this.removeGitConfig(this.tokenConfigKey);
  491. yield this.removeSubmoduleGitConfig(this.tokenConfigKey);
  492. // Collect credentials config paths that need to be removed
  493. const credentialsPaths = new Set();
  494. // Remove includeIf entries that point to git-credentials-*.config files
  495. core.info('Removing includeIf entries pointing to credentials config files');
  496. const mainCredentialsPaths = yield this.removeIncludeIfCredentials();
  497. mainCredentialsPaths.forEach(path => credentialsPaths.add(path));
  498. // Remove submodule includeIf entries that point to git-credentials-*.config files
  499. const submoduleConfigPaths = yield this.git.getSubmoduleConfigPaths(true);
  500. for (const configPath of submoduleConfigPaths) {
  501. const submoduleCredentialsPaths = yield this.removeIncludeIfCredentials(configPath);
  502. submoduleCredentialsPaths.forEach(path => credentialsPaths.add(path));
  503. }
  504. // Remove credentials config files
  505. for (const credentialsPath of credentialsPaths) {
  506. // Only remove credentials config files if they are under RUNNER_TEMP
  507. const runnerTemp = process.env['RUNNER_TEMP'];
  508. assert.ok(runnerTemp, 'RUNNER_TEMP is not defined');
  509. if (credentialsPath.startsWith(runnerTemp)) {
  510. try {
  511. core.info(`Removing credentials config '${credentialsPath}'`);
  512. yield io.rmRF(credentialsPath);
  513. }
  514. catch (err) {
  515. core.debug(`${(_a = err === null || err === void 0 ? void 0 : err.message) !== null && _a !== void 0 ? _a : err}`);
  516. core.warning(`Failed to remove credentials config '${credentialsPath}'`);
  517. }
  518. }
  519. else {
  520. core.debug(`Skipping removal of credentials config '${credentialsPath}' - not under RUNNER_TEMP`);
  521. }
  522. }
  523. });
  524. }
  525. /**
  526. * Removes a git config key from the local repository config.
  527. * @param configKey The git config key to remove
  528. */
  529. removeGitConfig(configKey) {
  530. return __awaiter(this, void 0, void 0, function* () {
  531. if ((yield this.git.configExists(configKey)) &&
  532. !(yield this.git.tryConfigUnset(configKey))) {
  533. // Load the config contents
  534. core.warning(`Failed to remove '${configKey}' from the git config`);
  535. }
  536. });
  537. }
  538. /**
  539. * Removes a git config key from all submodule configs.
  540. * @param configKey The git config key to remove
  541. */
  542. removeSubmoduleGitConfig(configKey) {
  543. return __awaiter(this, void 0, void 0, function* () {
  544. const pattern = regexpHelper.escape(configKey);
  545. yield this.git.submoduleForeach(
  546. // Wrap the pipeline in quotes to make sure it's handled properly by submoduleForeach, rather than just the first part of the pipeline.
  547. `sh -c "git config --local --name-only --get-regexp '${pattern}' && git config --local --unset-all '${configKey}' || :"`, true);
  548. });
  549. }
  550. /**
  551. * Removes includeIf entries that point to git-credentials-*.config files.
  552. * @param configPath Optional path to a specific git config file to operate on
  553. * @returns Array of unique credentials config file paths that were found and removed
  554. */
  555. removeIncludeIfCredentials(configPath) {
  556. return __awaiter(this, void 0, void 0, function* () {
  557. const credentialsPaths = new Set();
  558. try {
  559. // Get all includeIf.gitdir keys
  560. const keys = yield this.git.tryGetConfigKeys('^includeIf\\.gitdir:', false, // globalConfig?
  561. configPath);
  562. for (const key of keys) {
  563. // Get all values for this key
  564. const values = yield this.git.tryGetConfigValues(key, false, // globalConfig?
  565. configPath);
  566. if (values.length > 0) {
  567. // Remove only values that match git-credentials-<uuid>.config pattern
  568. for (const value of values) {
  569. if (this.testCredentialsConfigPath(value)) {
  570. credentialsPaths.add(value);
  571. yield this.git.tryConfigUnsetValue(key, value, false, configPath);
  572. }
  573. }
  574. }
  575. }
  576. }
  577. catch (err) {
  578. // Ignore errors - this is cleanup code
  579. if (configPath) {
  580. core.debug(`Error during includeIf cleanup for ${configPath}: ${err}`);
  581. }
  582. else {
  583. core.debug(`Error during includeIf cleanup: ${err}`);
  584. }
  585. }
  586. return Array.from(credentialsPaths);
  587. });
  588. }
  589. /**
  590. * Tests if a path matches the git-credentials-*.config pattern.
  591. * @param path The path to test
  592. * @returns True if the path matches the credentials config pattern
  593. */
  594. testCredentialsConfigPath(path) {
  595. return /git-credentials-[0-9a-f-]+\.config$/i.test(path);
  596. }
  597. }
  598. /***/ }),
  599. /***/ 738:
  600. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  601. "use strict";
  602. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  603. if (k2 === undefined) k2 = k;
  604. var desc = Object.getOwnPropertyDescriptor(m, k);
  605. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  606. desc = { enumerable: true, get: function() { return m[k]; } };
  607. }
  608. Object.defineProperty(o, k2, desc);
  609. }) : (function(o, m, k, k2) {
  610. if (k2 === undefined) k2 = k;
  611. o[k2] = m[k];
  612. }));
  613. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  614. Object.defineProperty(o, "default", { enumerable: true, value: v });
  615. }) : function(o, v) {
  616. o["default"] = v;
  617. });
  618. var __importStar = (this && this.__importStar) || function (mod) {
  619. if (mod && mod.__esModule) return mod;
  620. var result = {};
  621. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  622. __setModuleDefault(result, mod);
  623. return result;
  624. };
  625. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  626. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  627. return new (P || (P = Promise))(function (resolve, reject) {
  628. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  629. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  630. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  631. step((generator = generator.apply(thisArg, _arguments || [])).next());
  632. });
  633. };
  634. Object.defineProperty(exports, "__esModule", ({ value: true }));
  635. exports.MinimumGitSparseCheckoutVersion = exports.MinimumGitVersion = void 0;
  636. exports.createCommandManager = createCommandManager;
  637. const core = __importStar(__nccwpck_require__(2186));
  638. const exec = __importStar(__nccwpck_require__(1514));
  639. const fs = __importStar(__nccwpck_require__(7147));
  640. const fshelper = __importStar(__nccwpck_require__(7219));
  641. const io = __importStar(__nccwpck_require__(7436));
  642. const path = __importStar(__nccwpck_require__(1017));
  643. const regexpHelper = __importStar(__nccwpck_require__(3120));
  644. const retryHelper = __importStar(__nccwpck_require__(2155));
  645. const git_version_1 = __nccwpck_require__(3142);
  646. // Auth header not supported before 2.9
  647. // Wire protocol v2 not supported before 2.18
  648. // sparse-checkout not [well-]supported before 2.28 (see https://github.com/actions/checkout/issues/1386)
  649. exports.MinimumGitVersion = new git_version_1.GitVersion('2.18');
  650. exports.MinimumGitSparseCheckoutVersion = new git_version_1.GitVersion('2.28');
  651. function createCommandManager(workingDirectory, lfs, doSparseCheckout) {
  652. return __awaiter(this, void 0, void 0, function* () {
  653. return yield GitCommandManager.createCommandManager(workingDirectory, lfs, doSparseCheckout);
  654. });
  655. }
  656. class GitCommandManager {
  657. // Private constructor; use createCommandManager()
  658. constructor() {
  659. this.gitEnv = {
  660. GIT_TERMINAL_PROMPT: '0', // Disable git prompt
  661. GCM_INTERACTIVE: 'Never' // Disable prompting for git credential manager
  662. };
  663. this.gitPath = '';
  664. this.lfs = false;
  665. this.doSparseCheckout = false;
  666. this.workingDirectory = '';
  667. this.gitVersion = new git_version_1.GitVersion();
  668. }
  669. branchDelete(remote, branch) {
  670. return __awaiter(this, void 0, void 0, function* () {
  671. const args = ['branch', '--delete', '--force'];
  672. if (remote) {
  673. args.push('--remote');
  674. }
  675. args.push(branch);
  676. yield this.execGit(args);
  677. });
  678. }
  679. branchExists(remote, pattern) {
  680. return __awaiter(this, void 0, void 0, function* () {
  681. const args = ['branch', '--list'];
  682. if (remote) {
  683. args.push('--remote');
  684. }
  685. args.push(pattern);
  686. const output = yield this.execGit(args);
  687. return !!output.stdout.trim();
  688. });
  689. }
  690. branchList(remote) {
  691. return __awaiter(this, void 0, void 0, function* () {
  692. const result = [];
  693. // Note, this implementation uses "rev-parse --symbolic-full-name" because the output from
  694. // "branch --list" is more difficult when in a detached HEAD state.
  695. // TODO(https://github.com/actions/checkout/issues/786): this implementation uses
  696. // "rev-parse --symbolic-full-name" because there is a bug
  697. // in Git 2.18 that causes "rev-parse --symbolic" to output symbolic full names. When
  698. // 2.18 is no longer supported, we can switch back to --symbolic.
  699. const args = ['rev-parse', '--symbolic-full-name'];
  700. if (remote) {
  701. args.push('--remotes=origin');
  702. }
  703. else {
  704. args.push('--branches');
  705. }
  706. const stderr = [];
  707. const errline = [];
  708. const stdout = [];
  709. const stdline = [];
  710. const listeners = {
  711. stderr: (data) => {
  712. stderr.push(data.toString());
  713. },
  714. errline: (data) => {
  715. errline.push(data.toString());
  716. },
  717. stdout: (data) => {
  718. stdout.push(data.toString());
  719. },
  720. stdline: (data) => {
  721. stdline.push(data.toString());
  722. }
  723. };
  724. // Suppress the output in order to avoid flooding annotations with innocuous errors.
  725. yield this.execGit(args, false, true, listeners);
  726. core.debug(`stderr callback is: ${stderr}`);
  727. core.debug(`errline callback is: ${errline}`);
  728. core.debug(`stdout callback is: ${stdout}`);
  729. core.debug(`stdline callback is: ${stdline}`);
  730. for (let branch of stdline) {
  731. branch = branch.trim();
  732. if (!branch) {
  733. continue;
  734. }
  735. if (branch.startsWith('refs/heads/')) {
  736. branch = branch.substring('refs/heads/'.length);
  737. }
  738. else if (branch.startsWith('refs/remotes/')) {
  739. branch = branch.substring('refs/remotes/'.length);
  740. }
  741. result.push(branch);
  742. }
  743. return result;
  744. });
  745. }
  746. disableSparseCheckout() {
  747. return __awaiter(this, void 0, void 0, function* () {
  748. yield this.execGit(['sparse-checkout', 'disable']);
  749. // Disabling 'sparse-checkout` leaves behind an undesirable side-effect in config (even in a pristine environment).
  750. yield this.tryConfigUnset('extensions.worktreeConfig', false);
  751. });
  752. }
  753. sparseCheckout(sparseCheckout) {
  754. return __awaiter(this, void 0, void 0, function* () {
  755. yield this.execGit(['sparse-checkout', 'set', ...sparseCheckout]);
  756. });
  757. }
  758. sparseCheckoutNonConeMode(sparseCheckout) {
  759. return __awaiter(this, void 0, void 0, function* () {
  760. yield this.execGit(['config', 'core.sparseCheckout', 'true']);
  761. const output = yield this.execGit([
  762. 'rev-parse',
  763. '--git-path',
  764. 'info/sparse-checkout'
  765. ]);
  766. const sparseCheckoutPath = path.join(this.workingDirectory, output.stdout.trimRight());
  767. yield fs.promises.appendFile(sparseCheckoutPath, `\n${sparseCheckout.join('\n')}\n`);
  768. });
  769. }
  770. checkout(ref, startPoint) {
  771. return __awaiter(this, void 0, void 0, function* () {
  772. const args = ['checkout', '--progress', '--force'];
  773. if (startPoint) {
  774. args.push('-B', ref, startPoint);
  775. }
  776. else {
  777. args.push(ref);
  778. }
  779. yield this.execGit(args);
  780. });
  781. }
  782. checkoutDetach() {
  783. return __awaiter(this, void 0, void 0, function* () {
  784. const args = ['checkout', '--detach'];
  785. yield this.execGit(args);
  786. });
  787. }
  788. config(configKey, configValue, globalConfig, add, configFile) {
  789. return __awaiter(this, void 0, void 0, function* () {
  790. const args = ['config'];
  791. if (configFile) {
  792. args.push('--file', configFile);
  793. }
  794. else {
  795. args.push(globalConfig ? '--global' : '--local');
  796. }
  797. if (add) {
  798. args.push('--add');
  799. }
  800. args.push(...[configKey, configValue]);
  801. yield this.execGit(args);
  802. });
  803. }
  804. configExists(configKey, globalConfig) {
  805. return __awaiter(this, void 0, void 0, function* () {
  806. const pattern = regexpHelper.escape(configKey);
  807. const output = yield this.execGit([
  808. 'config',
  809. globalConfig ? '--global' : '--local',
  810. '--name-only',
  811. '--get-regexp',
  812. pattern
  813. ], true);
  814. return output.exitCode === 0;
  815. });
  816. }
  817. fetch(refSpec, options) {
  818. return __awaiter(this, void 0, void 0, function* () {
  819. const args = ['-c', 'protocol.version=2', 'fetch'];
  820. // Always use --no-tags for explicit control over tag fetching
  821. // Tags are fetched explicitly via refspec when needed
  822. args.push('--no-tags');
  823. args.push('--prune', '--no-recurse-submodules');
  824. if (options.showProgress) {
  825. args.push('--progress');
  826. }
  827. if (options.filter) {
  828. args.push(`--filter=${options.filter}`);
  829. }
  830. if (options.fetchDepth && options.fetchDepth > 0) {
  831. args.push(`--depth=${options.fetchDepth}`);
  832. }
  833. else if (fshelper.fileExistsSync(path.join(this.workingDirectory, '.git', 'shallow'))) {
  834. args.push('--unshallow');
  835. }
  836. args.push('origin');
  837. for (const arg of refSpec) {
  838. args.push(arg);
  839. }
  840. const that = this;
  841. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  842. yield that.execGit(args);
  843. }));
  844. });
  845. }
  846. getDefaultBranch(repositoryUrl) {
  847. return __awaiter(this, void 0, void 0, function* () {
  848. let output;
  849. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  850. output = yield this.execGit([
  851. 'ls-remote',
  852. '--quiet',
  853. '--exit-code',
  854. '--symref',
  855. repositoryUrl,
  856. 'HEAD'
  857. ]);
  858. }));
  859. if (output) {
  860. // Satisfy compiler, will always be set
  861. for (let line of output.stdout.trim().split('\n')) {
  862. line = line.trim();
  863. if (line.startsWith('ref:') || line.endsWith('HEAD')) {
  864. return line
  865. .substr('ref:'.length, line.length - 'ref:'.length - 'HEAD'.length)
  866. .trim();
  867. }
  868. }
  869. }
  870. throw new Error('Unexpected output when retrieving default branch');
  871. });
  872. }
  873. getSubmoduleConfigPaths(recursive) {
  874. return __awaiter(this, void 0, void 0, function* () {
  875. // Get submodule config file paths.
  876. // Use `--show-origin` to get the config file path for each submodule.
  877. const output = yield this.submoduleForeach(`git config --local --show-origin --name-only --get-regexp remote.origin.url`, recursive);
  878. // Extract config file paths from the output (lines starting with "file:").
  879. const configPaths = output.match(/(?<=(^|\n)file:)[^\t]+(?=\tremote\.origin\.url)/g) || [];
  880. return configPaths;
  881. });
  882. }
  883. getWorkingDirectory() {
  884. return this.workingDirectory;
  885. }
  886. init(objectFormat) {
  887. return __awaiter(this, void 0, void 0, function* () {
  888. const args = ['init'];
  889. if (objectFormat === 'sha256') {
  890. args.push('--object-format=sha256');
  891. }
  892. args.push(this.workingDirectory);
  893. yield this.execGit(args);
  894. });
  895. }
  896. isDetached() {
  897. return __awaiter(this, void 0, void 0, function* () {
  898. // Note, "branch --show-current" would be simpler but isn't available until Git 2.22
  899. const output = yield this.execGit(['rev-parse', '--symbolic-full-name', '--verify', '--quiet', 'HEAD'], true);
  900. return !output.stdout.trim().startsWith('refs/heads/');
  901. });
  902. }
  903. lfsFetch(ref) {
  904. return __awaiter(this, void 0, void 0, function* () {
  905. const args = ['lfs', 'fetch', 'origin', ref];
  906. const that = this;
  907. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  908. yield that.execGit(args);
  909. }));
  910. });
  911. }
  912. lfsInstall() {
  913. return __awaiter(this, void 0, void 0, function* () {
  914. yield this.execGit(['lfs', 'install', '--local']);
  915. });
  916. }
  917. log1(format) {
  918. return __awaiter(this, void 0, void 0, function* () {
  919. const args = format ? ['log', '-1', format] : ['log', '-1'];
  920. const silent = format ? false : true;
  921. const output = yield this.execGit(args, false, silent);
  922. return output.stdout;
  923. });
  924. }
  925. remoteAdd(remoteName, remoteUrl) {
  926. return __awaiter(this, void 0, void 0, function* () {
  927. yield this.execGit(['remote', 'add', remoteName, remoteUrl]);
  928. });
  929. }
  930. removeEnvironmentVariable(name) {
  931. delete this.gitEnv[name];
  932. }
  933. /**
  934. * Resolves a ref to a SHA. For a branch or lightweight tag, the commit SHA is returned.
  935. * For an annotated tag, the tag SHA is returned.
  936. * @param {string} ref For example: 'refs/heads/main' or '/refs/tags/v1'
  937. * @returns {Promise<string>}
  938. */
  939. revParse(ref) {
  940. return __awaiter(this, void 0, void 0, function* () {
  941. const output = yield this.execGit(['rev-parse', ref]);
  942. return output.stdout.trim();
  943. });
  944. }
  945. setEnvironmentVariable(name, value) {
  946. this.gitEnv[name] = value;
  947. }
  948. shaExists(sha) {
  949. return __awaiter(this, void 0, void 0, function* () {
  950. const args = ['rev-parse', '--verify', '--quiet', `${sha}^{object}`];
  951. const output = yield this.execGit(args, true);
  952. return output.exitCode === 0;
  953. });
  954. }
  955. submoduleForeach(command, recursive) {
  956. return __awaiter(this, void 0, void 0, function* () {
  957. const args = ['submodule', 'foreach'];
  958. if (recursive) {
  959. args.push('--recursive');
  960. }
  961. args.push(command);
  962. const output = yield this.execGit(args);
  963. return output.stdout;
  964. });
  965. }
  966. submoduleSync(recursive) {
  967. return __awaiter(this, void 0, void 0, function* () {
  968. const args = ['submodule', 'sync'];
  969. if (recursive) {
  970. args.push('--recursive');
  971. }
  972. yield this.execGit(args);
  973. });
  974. }
  975. submoduleUpdate(fetchDepth, recursive) {
  976. return __awaiter(this, void 0, void 0, function* () {
  977. const args = ['-c', 'protocol.version=2'];
  978. args.push('submodule', 'update', '--init', '--force');
  979. if (fetchDepth > 0) {
  980. args.push(`--depth=${fetchDepth}`);
  981. }
  982. if (recursive) {
  983. args.push('--recursive');
  984. }
  985. yield this.execGit(args);
  986. });
  987. }
  988. submoduleStatus() {
  989. return __awaiter(this, void 0, void 0, function* () {
  990. const output = yield this.execGit(['submodule', 'status'], true);
  991. core.debug(output.stdout);
  992. return output.exitCode === 0;
  993. });
  994. }
  995. tagExists(pattern) {
  996. return __awaiter(this, void 0, void 0, function* () {
  997. const output = yield this.execGit(['tag', '--list', pattern]);
  998. return !!output.stdout.trim();
  999. });
  1000. }
  1001. tryClean() {
  1002. return __awaiter(this, void 0, void 0, function* () {
  1003. const output = yield this.execGit(['clean', '-ffdx'], true);
  1004. return output.exitCode === 0;
  1005. });
  1006. }
  1007. tryConfigUnset(configKey, globalConfig) {
  1008. return __awaiter(this, void 0, void 0, function* () {
  1009. const output = yield this.execGit([
  1010. 'config',
  1011. globalConfig ? '--global' : '--local',
  1012. '--unset-all',
  1013. configKey
  1014. ], true);
  1015. return output.exitCode === 0;
  1016. });
  1017. }
  1018. tryConfigUnsetValue(configKey, configValue, globalConfig, configFile) {
  1019. return __awaiter(this, void 0, void 0, function* () {
  1020. const args = ['config'];
  1021. if (configFile) {
  1022. args.push('--file', configFile);
  1023. }
  1024. else {
  1025. args.push(globalConfig ? '--global' : '--local');
  1026. }
  1027. args.push('--unset', configKey, configValue);
  1028. const output = yield this.execGit(args, true);
  1029. return output.exitCode === 0;
  1030. });
  1031. }
  1032. tryDisableAutomaticGarbageCollection() {
  1033. return __awaiter(this, void 0, void 0, function* () {
  1034. const output = yield this.execGit(['config', '--local', 'gc.auto', '0'], true);
  1035. return output.exitCode === 0;
  1036. });
  1037. }
  1038. tryGetFetchUrl() {
  1039. return __awaiter(this, void 0, void 0, function* () {
  1040. const output = yield this.execGit(['config', '--local', '--get', 'remote.origin.url'], true);
  1041. if (output.exitCode !== 0) {
  1042. return '';
  1043. }
  1044. const stdout = output.stdout.trim();
  1045. if (stdout.includes('\n')) {
  1046. return '';
  1047. }
  1048. return stdout;
  1049. });
  1050. }
  1051. tryGetConfigValues(configKey, globalConfig, configFile) {
  1052. return __awaiter(this, void 0, void 0, function* () {
  1053. const args = ['config'];
  1054. if (configFile) {
  1055. args.push('--file', configFile);
  1056. }
  1057. else {
  1058. args.push(globalConfig ? '--global' : '--local');
  1059. }
  1060. args.push('--get-all', configKey);
  1061. const output = yield this.execGit(args, true);
  1062. if (output.exitCode !== 0) {
  1063. return [];
  1064. }
  1065. return output.stdout
  1066. .trim()
  1067. .split('\n')
  1068. .filter(value => value.trim());
  1069. });
  1070. }
  1071. tryGetConfigKeys(pattern, globalConfig, configFile) {
  1072. return __awaiter(this, void 0, void 0, function* () {
  1073. const args = ['config'];
  1074. if (configFile) {
  1075. args.push('--file', configFile);
  1076. }
  1077. else {
  1078. args.push(globalConfig ? '--global' : '--local');
  1079. }
  1080. args.push('--name-only', '--get-regexp', pattern);
  1081. const output = yield this.execGit(args, true);
  1082. if (output.exitCode !== 0) {
  1083. return [];
  1084. }
  1085. return output.stdout
  1086. .trim()
  1087. .split('\n')
  1088. .filter(key => key.trim());
  1089. });
  1090. }
  1091. tryReset() {
  1092. return __awaiter(this, void 0, void 0, function* () {
  1093. const output = yield this.execGit(['reset', '--hard', 'HEAD'], true);
  1094. return output.exitCode === 0;
  1095. });
  1096. }
  1097. version() {
  1098. return __awaiter(this, void 0, void 0, function* () {
  1099. return this.gitVersion;
  1100. });
  1101. }
  1102. static createCommandManager(workingDirectory, lfs, doSparseCheckout) {
  1103. return __awaiter(this, void 0, void 0, function* () {
  1104. const result = new GitCommandManager();
  1105. yield result.initializeCommandManager(workingDirectory, lfs, doSparseCheckout);
  1106. return result;
  1107. });
  1108. }
  1109. execGit(args_1) {
  1110. return __awaiter(this, arguments, void 0, function* (args, allowAllExitCodes = false, silent = false, customListeners = {}) {
  1111. fshelper.directoryExistsSync(this.workingDirectory, true);
  1112. const result = new GitOutput();
  1113. const env = {};
  1114. for (const key of Object.keys(process.env)) {
  1115. env[key] = process.env[key];
  1116. }
  1117. for (const key of Object.keys(this.gitEnv)) {
  1118. env[key] = this.gitEnv[key];
  1119. }
  1120. const defaultListener = {
  1121. stdout: (data) => {
  1122. stdout.push(data.toString());
  1123. }
  1124. };
  1125. const mergedListeners = Object.assign(Object.assign({}, defaultListener), customListeners);
  1126. const stdout = [];
  1127. const options = {
  1128. cwd: this.workingDirectory,
  1129. env,
  1130. silent,
  1131. ignoreReturnCode: allowAllExitCodes,
  1132. listeners: mergedListeners
  1133. };
  1134. result.exitCode = yield exec.exec(`"${this.gitPath}"`, args, options);
  1135. result.stdout = stdout.join('');
  1136. core.debug(result.exitCode.toString());
  1137. core.debug(result.stdout);
  1138. return result;
  1139. });
  1140. }
  1141. initializeCommandManager(workingDirectory, lfs, doSparseCheckout) {
  1142. return __awaiter(this, void 0, void 0, function* () {
  1143. this.workingDirectory = workingDirectory;
  1144. // Git-lfs will try to pull down assets if any of the local/user/system setting exist.
  1145. // If the user didn't enable `LFS` in their pipeline definition, disable LFS fetch/checkout.
  1146. this.lfs = lfs;
  1147. if (!this.lfs) {
  1148. this.gitEnv['GIT_LFS_SKIP_SMUDGE'] = '1';
  1149. }
  1150. this.gitPath = yield io.which('git', true);
  1151. // Git version
  1152. core.debug('Getting git version');
  1153. this.gitVersion = new git_version_1.GitVersion();
  1154. let gitOutput = yield this.execGit(['version']);
  1155. let stdout = gitOutput.stdout.trim();
  1156. if (!stdout.includes('\n')) {
  1157. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  1158. if (match) {
  1159. this.gitVersion = new git_version_1.GitVersion(match[0]);
  1160. }
  1161. }
  1162. if (!this.gitVersion.isValid()) {
  1163. throw new Error('Unable to determine git version');
  1164. }
  1165. // Minimum git version
  1166. if (!this.gitVersion.checkMinimum(exports.MinimumGitVersion)) {
  1167. throw new Error(`Minimum required git version is ${exports.MinimumGitVersion}. Your git ('${this.gitPath}') is ${this.gitVersion}`);
  1168. }
  1169. if (this.lfs) {
  1170. // Git-lfs version
  1171. core.debug('Getting git-lfs version');
  1172. let gitLfsVersion = new git_version_1.GitVersion();
  1173. const gitLfsPath = yield io.which('git-lfs', true);
  1174. gitOutput = yield this.execGit(['lfs', 'version']);
  1175. stdout = gitOutput.stdout.trim();
  1176. if (!stdout.includes('\n')) {
  1177. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  1178. if (match) {
  1179. gitLfsVersion = new git_version_1.GitVersion(match[0]);
  1180. }
  1181. }
  1182. if (!gitLfsVersion.isValid()) {
  1183. throw new Error('Unable to determine git-lfs version');
  1184. }
  1185. // Minimum git-lfs version
  1186. // Note:
  1187. // - Auth header not supported before 2.1
  1188. const minimumGitLfsVersion = new git_version_1.GitVersion('2.1');
  1189. if (!gitLfsVersion.checkMinimum(minimumGitLfsVersion)) {
  1190. throw new Error(`Minimum required git-lfs version is ${minimumGitLfsVersion}. Your git-lfs ('${gitLfsPath}') is ${gitLfsVersion}`);
  1191. }
  1192. }
  1193. this.doSparseCheckout = doSparseCheckout;
  1194. if (this.doSparseCheckout) {
  1195. if (!this.gitVersion.checkMinimum(exports.MinimumGitSparseCheckoutVersion)) {
  1196. throw new Error(`Minimum Git version required for sparse checkout is ${exports.MinimumGitSparseCheckoutVersion}. Your git ('${this.gitPath}') is ${this.gitVersion}`);
  1197. }
  1198. }
  1199. // Set the user agent
  1200. let gitHttpUserAgent = `git/${this.gitVersion} (github-actions-checkout)`;
  1201. // Append orchestration ID if set
  1202. const orchId = process.env['ACTIONS_ORCHESTRATION_ID'];
  1203. if (orchId) {
  1204. // Sanitize the orchestration ID to ensure it contains only valid characters
  1205. // Valid characters: 0-9, a-z, _, -, .
  1206. const sanitizedId = orchId.replace(/[^a-z0-9_.-]/gi, '_');
  1207. if (sanitizedId) {
  1208. gitHttpUserAgent = `${gitHttpUserAgent} actions_orchestration_id/${sanitizedId}`;
  1209. }
  1210. }
  1211. core.debug(`Set git useragent to: ${gitHttpUserAgent}`);
  1212. this.gitEnv['GIT_HTTP_USER_AGENT'] = gitHttpUserAgent;
  1213. });
  1214. }
  1215. }
  1216. class GitOutput {
  1217. constructor() {
  1218. this.stdout = '';
  1219. this.exitCode = 0;
  1220. }
  1221. }
  1222. /***/ }),
  1223. /***/ 8609:
  1224. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  1225. "use strict";
  1226. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  1227. if (k2 === undefined) k2 = k;
  1228. var desc = Object.getOwnPropertyDescriptor(m, k);
  1229. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  1230. desc = { enumerable: true, get: function() { return m[k]; } };
  1231. }
  1232. Object.defineProperty(o, k2, desc);
  1233. }) : (function(o, m, k, k2) {
  1234. if (k2 === undefined) k2 = k;
  1235. o[k2] = m[k];
  1236. }));
  1237. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  1238. Object.defineProperty(o, "default", { enumerable: true, value: v });
  1239. }) : function(o, v) {
  1240. o["default"] = v;
  1241. });
  1242. var __importStar = (this && this.__importStar) || function (mod) {
  1243. if (mod && mod.__esModule) return mod;
  1244. var result = {};
  1245. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  1246. __setModuleDefault(result, mod);
  1247. return result;
  1248. };
  1249. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  1250. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  1251. return new (P || (P = Promise))(function (resolve, reject) {
  1252. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  1253. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  1254. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  1255. step((generator = generator.apply(thisArg, _arguments || [])).next());
  1256. });
  1257. };
  1258. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1259. exports.prepareExistingDirectory = prepareExistingDirectory;
  1260. const assert = __importStar(__nccwpck_require__(9491));
  1261. const core = __importStar(__nccwpck_require__(2186));
  1262. const fs = __importStar(__nccwpck_require__(7147));
  1263. const fsHelper = __importStar(__nccwpck_require__(7219));
  1264. const io = __importStar(__nccwpck_require__(7436));
  1265. const path = __importStar(__nccwpck_require__(1017));
  1266. function prepareExistingDirectory(git, repositoryPath, repositoryUrl, clean, ref) {
  1267. return __awaiter(this, void 0, void 0, function* () {
  1268. var _a;
  1269. assert.ok(repositoryPath, 'Expected repositoryPath to be defined');
  1270. assert.ok(repositoryUrl, 'Expected repositoryUrl to be defined');
  1271. // Indicates whether to delete the directory contents
  1272. let remove = false;
  1273. // Check whether using git or REST API
  1274. if (!git) {
  1275. remove = true;
  1276. }
  1277. // Fetch URL does not match
  1278. else if (!fsHelper.directoryExistsSync(path.join(repositoryPath, '.git')) ||
  1279. repositoryUrl !== (yield git.tryGetFetchUrl())) {
  1280. remove = true;
  1281. }
  1282. else {
  1283. // Delete any index.lock and shallow.lock left by a previously canceled run or crashed git process
  1284. const lockPaths = [
  1285. path.join(repositoryPath, '.git', 'index.lock'),
  1286. path.join(repositoryPath, '.git', 'shallow.lock')
  1287. ];
  1288. for (const lockPath of lockPaths) {
  1289. try {
  1290. yield io.rmRF(lockPath);
  1291. }
  1292. catch (error) {
  1293. core.debug(`Unable to delete '${lockPath}'. ${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error}`);
  1294. }
  1295. }
  1296. try {
  1297. core.startGroup('Removing previously created refs, to avoid conflicts');
  1298. // Checkout detached HEAD
  1299. if (!(yield git.isDetached())) {
  1300. yield git.checkoutDetach();
  1301. }
  1302. // Remove all refs/heads/*
  1303. let branches = yield git.branchList(false);
  1304. for (const branch of branches) {
  1305. yield git.branchDelete(false, branch);
  1306. }
  1307. // Remove any conflicting refs/remotes/origin/*
  1308. // Example 1: Consider ref is refs/heads/foo and previously fetched refs/remotes/origin/foo/bar
  1309. // Example 2: Consider ref is refs/heads/foo/bar and previously fetched refs/remotes/origin/foo
  1310. if (ref) {
  1311. ref = ref.startsWith('refs/') ? ref : `refs/heads/${ref}`;
  1312. if (ref.startsWith('refs/heads/')) {
  1313. const upperName1 = ref.toUpperCase().substr('REFS/HEADS/'.length);
  1314. const upperName1Slash = `${upperName1}/`;
  1315. branches = yield git.branchList(true);
  1316. for (const branch of branches) {
  1317. const upperName2 = branch.substr('origin/'.length).toUpperCase();
  1318. const upperName2Slash = `${upperName2}/`;
  1319. if (upperName1.startsWith(upperName2Slash) ||
  1320. upperName2.startsWith(upperName1Slash)) {
  1321. yield git.branchDelete(true, branch);
  1322. }
  1323. }
  1324. }
  1325. }
  1326. core.endGroup();
  1327. // Check for submodules and delete any existing files if submodules are present
  1328. if (!(yield git.submoduleStatus())) {
  1329. remove = true;
  1330. core.info('Bad Submodules found, removing existing files');
  1331. }
  1332. // Clean
  1333. if (clean) {
  1334. core.startGroup('Cleaning the repository');
  1335. if (!(yield git.tryClean())) {
  1336. 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}'.`);
  1337. remove = true;
  1338. }
  1339. else if (!(yield git.tryReset())) {
  1340. remove = true;
  1341. }
  1342. core.endGroup();
  1343. if (remove) {
  1344. core.warning(`Unable to clean or reset the repository. The repository will be recreated instead.`);
  1345. }
  1346. }
  1347. }
  1348. catch (error) {
  1349. core.warning(`Unable to prepare the existing repository. The repository will be recreated instead.`);
  1350. remove = true;
  1351. }
  1352. }
  1353. if (remove) {
  1354. // Delete the contents of the directory. Don't delete the directory itself
  1355. // since it might be the current working directory.
  1356. core.info(`Deleting the contents of '${repositoryPath}'`);
  1357. for (const file of yield fs.promises.readdir(repositoryPath)) {
  1358. yield io.rmRF(path.join(repositoryPath, file));
  1359. }
  1360. }
  1361. });
  1362. }
  1363. /***/ }),
  1364. /***/ 9210:
  1365. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  1366. "use strict";
  1367. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  1368. if (k2 === undefined) k2 = k;
  1369. var desc = Object.getOwnPropertyDescriptor(m, k);
  1370. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  1371. desc = { enumerable: true, get: function() { return m[k]; } };
  1372. }
  1373. Object.defineProperty(o, k2, desc);
  1374. }) : (function(o, m, k, k2) {
  1375. if (k2 === undefined) k2 = k;
  1376. o[k2] = m[k];
  1377. }));
  1378. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  1379. Object.defineProperty(o, "default", { enumerable: true, value: v });
  1380. }) : function(o, v) {
  1381. o["default"] = v;
  1382. });
  1383. var __importStar = (this && this.__importStar) || function (mod) {
  1384. if (mod && mod.__esModule) return mod;
  1385. var result = {};
  1386. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  1387. __setModuleDefault(result, mod);
  1388. return result;
  1389. };
  1390. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  1391. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  1392. return new (P || (P = Promise))(function (resolve, reject) {
  1393. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  1394. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  1395. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  1396. step((generator = generator.apply(thisArg, _arguments || [])).next());
  1397. });
  1398. };
  1399. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1400. exports.getSource = getSource;
  1401. exports.cleanup = cleanup;
  1402. const core = __importStar(__nccwpck_require__(2186));
  1403. const fsHelper = __importStar(__nccwpck_require__(7219));
  1404. const gitAuthHelper = __importStar(__nccwpck_require__(2565));
  1405. const gitCommandManager = __importStar(__nccwpck_require__(738));
  1406. const gitDirectoryHelper = __importStar(__nccwpck_require__(8609));
  1407. const githubApiHelper = __importStar(__nccwpck_require__(138));
  1408. const io = __importStar(__nccwpck_require__(7436));
  1409. const path = __importStar(__nccwpck_require__(1017));
  1410. const refHelper = __importStar(__nccwpck_require__(8601));
  1411. const stateHelper = __importStar(__nccwpck_require__(4866));
  1412. const urlHelper = __importStar(__nccwpck_require__(9437));
  1413. const git_command_manager_1 = __nccwpck_require__(738);
  1414. function getSource(settings) {
  1415. return __awaiter(this, void 0, void 0, function* () {
  1416. // Repository URL
  1417. core.info(`Syncing repository: ${settings.repositoryOwner}/${settings.repositoryName}`);
  1418. const repositoryUrl = urlHelper.getFetchUrl(settings);
  1419. // Remove conflicting file path
  1420. if (fsHelper.fileExistsSync(settings.repositoryPath)) {
  1421. yield io.rmRF(settings.repositoryPath);
  1422. }
  1423. // Create directory
  1424. let isExisting = true;
  1425. if (!fsHelper.directoryExistsSync(settings.repositoryPath)) {
  1426. isExisting = false;
  1427. yield io.mkdirP(settings.repositoryPath);
  1428. }
  1429. // Git command manager
  1430. core.startGroup('Getting Git version info');
  1431. const git = yield getGitCommandManager(settings);
  1432. core.endGroup();
  1433. let authHelper = null;
  1434. try {
  1435. if (git) {
  1436. authHelper = gitAuthHelper.createAuthHelper(git, settings);
  1437. if (settings.setSafeDirectory) {
  1438. // 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
  1439. // Otherwise all git commands we run in a container fail
  1440. yield authHelper.configureTempGlobalConfig();
  1441. core.info(`Adding repository directory to the temporary git global config as a safe directory`);
  1442. yield git
  1443. .config('safe.directory', settings.repositoryPath, true, true)
  1444. .catch(error => {
  1445. core.info(`Failed to initialize safe directory with error: ${error}`);
  1446. });
  1447. stateHelper.setSafeDirectory();
  1448. }
  1449. }
  1450. // Prepare existing directory, otherwise recreate
  1451. if (isExisting) {
  1452. yield gitDirectoryHelper.prepareExistingDirectory(git, settings.repositoryPath, repositoryUrl, settings.clean, settings.ref);
  1453. }
  1454. if (!git) {
  1455. // Downloading using REST API
  1456. core.info(`The repository will be downloaded using the GitHub REST API`);
  1457. core.info(`To create a local Git repository instead, add Git ${gitCommandManager.MinimumGitVersion} or higher to the PATH`);
  1458. if (settings.submodules) {
  1459. 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.`);
  1460. }
  1461. else if (settings.sshKey) {
  1462. 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.`);
  1463. }
  1464. yield githubApiHelper.downloadRepository(settings.authToken, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit, settings.repositoryPath, settings.githubServerUrl);
  1465. return;
  1466. }
  1467. // Save state for POST action
  1468. stateHelper.setRepositoryPath(settings.repositoryPath);
  1469. // Initialize the repository
  1470. if (!fsHelper.directoryExistsSync(path.join(settings.repositoryPath, '.git'))) {
  1471. core.startGroup('Determining repository object format');
  1472. const objectFormatResult = yield githubApiHelper.tryGetRepositoryObjectFormat(settings.authToken, settings.repositoryOwner, settings.repositoryName, settings.githubServerUrl, settings.commit);
  1473. const objectFormat = objectFormatResult.succeeded
  1474. ? objectFormatResult.format
  1475. : '';
  1476. if (objectFormat === 'sha256') {
  1477. core.info('Detected SHA-256 repository object format');
  1478. }
  1479. core.endGroup();
  1480. core.startGroup('Initializing the repository');
  1481. yield git.init(objectFormat);
  1482. yield git.remoteAdd('origin', repositoryUrl);
  1483. core.endGroup();
  1484. }
  1485. // Disable automatic garbage collection
  1486. core.startGroup('Disabling automatic garbage collection');
  1487. if (!(yield git.tryDisableAutomaticGarbageCollection())) {
  1488. core.warning(`Unable to turn off git automatic garbage collection. The git fetch operation may trigger garbage collection and cause a delay.`);
  1489. }
  1490. core.endGroup();
  1491. // If we didn't initialize it above, do it now
  1492. if (!authHelper) {
  1493. authHelper = gitAuthHelper.createAuthHelper(git, settings);
  1494. }
  1495. // Configure auth
  1496. core.startGroup('Setting up auth');
  1497. yield authHelper.configureAuth();
  1498. core.endGroup();
  1499. // Determine the default branch
  1500. if (!settings.ref && !settings.commit) {
  1501. core.startGroup('Determining the default branch');
  1502. if (settings.sshKey) {
  1503. settings.ref = yield git.getDefaultBranch(repositoryUrl);
  1504. }
  1505. else {
  1506. settings.ref = yield githubApiHelper.getDefaultBranch(settings.authToken, settings.repositoryOwner, settings.repositoryName, settings.githubServerUrl);
  1507. }
  1508. core.endGroup();
  1509. }
  1510. // LFS install
  1511. if (settings.lfs) {
  1512. yield git.lfsInstall();
  1513. }
  1514. // Fetch
  1515. core.startGroup('Fetching the repository');
  1516. const fetchOptions = {};
  1517. if (settings.filter) {
  1518. fetchOptions.filter = settings.filter;
  1519. }
  1520. else if (settings.sparseCheckout) {
  1521. fetchOptions.filter = 'blob:none';
  1522. }
  1523. if (settings.fetchDepth <= 0) {
  1524. // Fetch all branches and tags
  1525. let refSpec = refHelper.getRefSpecForAllHistory(settings.ref, settings.commit);
  1526. yield git.fetch(refSpec, fetchOptions);
  1527. // When all history is fetched, the ref we're interested in may have moved to a different
  1528. // commit (push or force push). If so, fetch again with a targeted refspec.
  1529. if (!(yield refHelper.testRef(git, settings.ref, settings.commit))) {
  1530. refSpec = refHelper.getRefSpec(settings.ref, settings.commit);
  1531. yield git.fetch(refSpec, fetchOptions);
  1532. // Verify the ref now matches. For branches, the targeted fetch above brings
  1533. // in the specific commit. For tags (fetched by ref), this will fail if
  1534. // the tag was moved after the workflow was triggered.
  1535. if (!(yield refHelper.testRef(git, settings.ref, settings.commit))) {
  1536. throw new Error(`The ref '${settings.ref}' does not point to the expected commit '${settings.commit}'. ` +
  1537. `The ref may have been updated after the workflow was triggered.`);
  1538. }
  1539. }
  1540. }
  1541. else {
  1542. fetchOptions.fetchDepth = settings.fetchDepth;
  1543. const refSpec = refHelper.getRefSpec(settings.ref, settings.commit, settings.fetchTags);
  1544. yield git.fetch(refSpec, fetchOptions);
  1545. // For tags, verify the ref still points to the expected commit.
  1546. // Tags are fetched by ref (not commit), so if a tag was moved after the
  1547. // workflow was triggered, we would silently check out the wrong commit.
  1548. if (!(yield refHelper.testRef(git, settings.ref, settings.commit))) {
  1549. throw new Error(`The ref '${settings.ref}' does not point to the expected commit '${settings.commit}'. ` +
  1550. `The ref may have been updated after the workflow was triggered.`);
  1551. }
  1552. }
  1553. core.endGroup();
  1554. // Checkout info
  1555. core.startGroup('Determining the checkout info');
  1556. const checkoutInfo = yield refHelper.getCheckoutInfo(git, settings.ref, settings.commit);
  1557. core.endGroup();
  1558. // LFS fetch
  1559. // Explicit lfs-fetch to avoid slow checkout (fetches one lfs object at a time).
  1560. // Explicit lfs fetch will fetch lfs objects in parallel.
  1561. // For sparse checkouts, let `checkout` fetch the needed objects lazily.
  1562. if (settings.lfs && !settings.sparseCheckout) {
  1563. core.startGroup('Fetching LFS objects');
  1564. yield git.lfsFetch(checkoutInfo.startPoint || checkoutInfo.ref);
  1565. core.endGroup();
  1566. }
  1567. // Sparse checkout
  1568. if (!settings.sparseCheckout) {
  1569. let gitVersion = yield git.version();
  1570. // no need to disable sparse-checkout if the installed git runtime doesn't even support it.
  1571. if (gitVersion.checkMinimum(git_command_manager_1.MinimumGitSparseCheckoutVersion)) {
  1572. yield git.disableSparseCheckout();
  1573. }
  1574. }
  1575. else {
  1576. core.startGroup('Setting up sparse checkout');
  1577. if (settings.sparseCheckoutConeMode) {
  1578. yield git.sparseCheckout(settings.sparseCheckout);
  1579. }
  1580. else {
  1581. yield git.sparseCheckoutNonConeMode(settings.sparseCheckout);
  1582. }
  1583. core.endGroup();
  1584. }
  1585. // Checkout
  1586. core.startGroup('Checking out the ref');
  1587. yield git.checkout(checkoutInfo.ref, checkoutInfo.startPoint);
  1588. core.endGroup();
  1589. // Submodules
  1590. if (settings.submodules) {
  1591. // Temporarily override global config
  1592. core.startGroup('Setting up auth for fetching submodules');
  1593. yield authHelper.configureGlobalAuth();
  1594. core.endGroup();
  1595. // Checkout submodules
  1596. core.startGroup('Fetching submodules');
  1597. yield git.submoduleSync(settings.nestedSubmodules);
  1598. yield git.submoduleUpdate(settings.fetchDepth, settings.nestedSubmodules);
  1599. yield git.submoduleForeach('git config --local gc.auto 0', settings.nestedSubmodules);
  1600. core.endGroup();
  1601. // Persist credentials
  1602. if (settings.persistCredentials) {
  1603. core.startGroup('Persisting credentials for submodules');
  1604. yield authHelper.configureSubmoduleAuth();
  1605. core.endGroup();
  1606. }
  1607. }
  1608. // Get commit information
  1609. const commitInfo = yield git.log1();
  1610. // Log commit sha
  1611. const commitSHA = yield git.log1('--format=%H');
  1612. core.setOutput('commit', commitSHA.trim());
  1613. // Check for incorrect pull request merge commit
  1614. yield refHelper.checkCommitInfo(settings.authToken, commitInfo, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit, settings.githubServerUrl);
  1615. }
  1616. finally {
  1617. // Remove auth
  1618. if (authHelper) {
  1619. if (!settings.persistCredentials) {
  1620. core.startGroup('Removing auth');
  1621. yield authHelper.removeAuth();
  1622. core.endGroup();
  1623. }
  1624. authHelper.removeGlobalConfig();
  1625. }
  1626. }
  1627. });
  1628. }
  1629. function cleanup(repositoryPath) {
  1630. return __awaiter(this, void 0, void 0, function* () {
  1631. // Repo exists?
  1632. if (!repositoryPath ||
  1633. !fsHelper.fileExistsSync(path.join(repositoryPath, '.git', 'config'))) {
  1634. return;
  1635. }
  1636. let git;
  1637. try {
  1638. git = yield gitCommandManager.createCommandManager(repositoryPath, false, false);
  1639. }
  1640. catch (_a) {
  1641. return;
  1642. }
  1643. // Remove auth
  1644. const authHelper = gitAuthHelper.createAuthHelper(git);
  1645. try {
  1646. if (stateHelper.PostSetSafeDirectory) {
  1647. // 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
  1648. // Otherwise all git commands we run in a container fail
  1649. yield authHelper.configureTempGlobalConfig();
  1650. core.info(`Adding repository directory to the temporary git global config as a safe directory`);
  1651. yield git
  1652. .config('safe.directory', repositoryPath, true, true)
  1653. .catch(error => {
  1654. core.info(`Failed to initialize safe directory with error: ${error}`);
  1655. });
  1656. }
  1657. yield authHelper.removeAuth();
  1658. }
  1659. finally {
  1660. yield authHelper.removeGlobalConfig();
  1661. }
  1662. });
  1663. }
  1664. function getGitCommandManager(settings) {
  1665. return __awaiter(this, void 0, void 0, function* () {
  1666. core.info(`Working directory is '${settings.repositoryPath}'`);
  1667. try {
  1668. return yield gitCommandManager.createCommandManager(settings.repositoryPath, settings.lfs, settings.sparseCheckout != null);
  1669. }
  1670. catch (err) {
  1671. // Git is required for LFS
  1672. if (settings.lfs) {
  1673. throw err;
  1674. }
  1675. // Otherwise fallback to REST API
  1676. return undefined;
  1677. }
  1678. });
  1679. }
  1680. /***/ }),
  1681. /***/ 3142:
  1682. /***/ ((__unused_webpack_module, exports) => {
  1683. "use strict";
  1684. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1685. exports.GitVersion = void 0;
  1686. class GitVersion {
  1687. /**
  1688. * Used for comparing the version of git and git-lfs against the minimum required version
  1689. * @param version the version string, e.g. 1.2 or 1.2.3
  1690. */
  1691. constructor(version) {
  1692. this.major = NaN;
  1693. this.minor = NaN;
  1694. this.patch = NaN;
  1695. if (version) {
  1696. const match = version.match(/^(\d+)\.(\d+)(\.(\d+))?$/);
  1697. if (match) {
  1698. this.major = Number(match[1]);
  1699. this.minor = Number(match[2]);
  1700. if (match[4]) {
  1701. this.patch = Number(match[4]);
  1702. }
  1703. }
  1704. }
  1705. }
  1706. /**
  1707. * Compares the instance against a minimum required version
  1708. * @param minimum Minimum version
  1709. */
  1710. checkMinimum(minimum) {
  1711. if (!minimum.isValid()) {
  1712. throw new Error('Arg minimum is not a valid version');
  1713. }
  1714. // Major is insufficient
  1715. if (this.major < minimum.major) {
  1716. return false;
  1717. }
  1718. // Major is equal
  1719. if (this.major === minimum.major) {
  1720. // Minor is insufficient
  1721. if (this.minor < minimum.minor) {
  1722. return false;
  1723. }
  1724. // Minor is equal
  1725. if (this.minor === minimum.minor) {
  1726. // Patch is insufficient
  1727. if (this.patch && this.patch < (minimum.patch || 0)) {
  1728. return false;
  1729. }
  1730. }
  1731. }
  1732. return true;
  1733. }
  1734. /**
  1735. * Indicates whether the instance was constructed from a valid version string
  1736. */
  1737. isValid() {
  1738. return !isNaN(this.major);
  1739. }
  1740. /**
  1741. * Returns the version as a string, e.g. 1.2 or 1.2.3
  1742. */
  1743. toString() {
  1744. let result = '';
  1745. if (this.isValid()) {
  1746. result = `${this.major}.${this.minor}`;
  1747. if (!isNaN(this.patch)) {
  1748. result += `.${this.patch}`;
  1749. }
  1750. }
  1751. return result;
  1752. }
  1753. }
  1754. exports.GitVersion = GitVersion;
  1755. /***/ }),
  1756. /***/ 138:
  1757. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  1758. "use strict";
  1759. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  1760. if (k2 === undefined) k2 = k;
  1761. var desc = Object.getOwnPropertyDescriptor(m, k);
  1762. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  1763. desc = { enumerable: true, get: function() { return m[k]; } };
  1764. }
  1765. Object.defineProperty(o, k2, desc);
  1766. }) : (function(o, m, k, k2) {
  1767. if (k2 === undefined) k2 = k;
  1768. o[k2] = m[k];
  1769. }));
  1770. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  1771. Object.defineProperty(o, "default", { enumerable: true, value: v });
  1772. }) : function(o, v) {
  1773. o["default"] = v;
  1774. });
  1775. var __importStar = (this && this.__importStar) || function (mod) {
  1776. if (mod && mod.__esModule) return mod;
  1777. var result = {};
  1778. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  1779. __setModuleDefault(result, mod);
  1780. return result;
  1781. };
  1782. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  1783. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  1784. return new (P || (P = Promise))(function (resolve, reject) {
  1785. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  1786. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  1787. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  1788. step((generator = generator.apply(thisArg, _arguments || [])).next());
  1789. });
  1790. };
  1791. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1792. exports.downloadRepository = downloadRepository;
  1793. exports.getDefaultBranch = getDefaultBranch;
  1794. exports.tryGetRepositoryObjectFormat = tryGetRepositoryObjectFormat;
  1795. const assert = __importStar(__nccwpck_require__(9491));
  1796. const core = __importStar(__nccwpck_require__(2186));
  1797. const fs = __importStar(__nccwpck_require__(7147));
  1798. const github = __importStar(__nccwpck_require__(5438));
  1799. const io = __importStar(__nccwpck_require__(7436));
  1800. const path = __importStar(__nccwpck_require__(1017));
  1801. const retryHelper = __importStar(__nccwpck_require__(2155));
  1802. const toolCache = __importStar(__nccwpck_require__(7784));
  1803. const uuid_1 = __nccwpck_require__(5840);
  1804. const url_helper_1 = __nccwpck_require__(9437);
  1805. const IS_WINDOWS = process.platform === 'win32';
  1806. function downloadRepository(authToken, owner, repo, ref, commit, repositoryPath, baseUrl) {
  1807. return __awaiter(this, void 0, void 0, function* () {
  1808. // Determine the default branch
  1809. if (!ref && !commit) {
  1810. core.info('Determining the default branch');
  1811. ref = yield getDefaultBranch(authToken, owner, repo, baseUrl);
  1812. }
  1813. // Download the archive
  1814. let archiveData = yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  1815. core.info('Downloading the archive');
  1816. return yield downloadArchive(authToken, owner, repo, ref, commit, baseUrl);
  1817. }));
  1818. // Write archive to disk
  1819. core.info('Writing archive to disk');
  1820. const uniqueId = (0, uuid_1.v4)();
  1821. const archivePath = IS_WINDOWS
  1822. ? path.join(repositoryPath, `${uniqueId}.zip`)
  1823. : path.join(repositoryPath, `${uniqueId}.tar.gz`);
  1824. yield fs.promises.writeFile(archivePath, archiveData);
  1825. archiveData = Buffer.from(''); // Free memory
  1826. // Extract archive
  1827. core.info('Extracting the archive');
  1828. const extractPath = path.join(repositoryPath, uniqueId);
  1829. yield io.mkdirP(extractPath);
  1830. if (IS_WINDOWS) {
  1831. yield toolCache.extractZip(archivePath, extractPath);
  1832. }
  1833. else {
  1834. yield toolCache.extractTar(archivePath, extractPath);
  1835. }
  1836. yield io.rmRF(archivePath);
  1837. // Determine the path of the repository content. The archive contains
  1838. // a top-level folder and the repository content is inside.
  1839. const archiveFileNames = yield fs.promises.readdir(extractPath);
  1840. assert.ok(archiveFileNames.length == 1, 'Expected exactly one directory inside archive');
  1841. const archiveVersion = archiveFileNames[0]; // The top-level folder name includes the short SHA
  1842. core.info(`Resolved version ${archiveVersion}`);
  1843. const tempRepositoryPath = path.join(extractPath, archiveVersion);
  1844. // Move the files
  1845. for (const fileName of yield fs.promises.readdir(tempRepositoryPath)) {
  1846. const sourcePath = path.join(tempRepositoryPath, fileName);
  1847. const targetPath = path.join(repositoryPath, fileName);
  1848. if (IS_WINDOWS) {
  1849. yield io.cp(sourcePath, targetPath, { recursive: true }); // Copy on Windows (Windows Defender may have a lock)
  1850. }
  1851. else {
  1852. yield io.mv(sourcePath, targetPath);
  1853. }
  1854. }
  1855. yield io.rmRF(extractPath);
  1856. });
  1857. }
  1858. /**
  1859. * Looks up the default branch name
  1860. */
  1861. function getDefaultBranch(authToken, owner, repo, baseUrl) {
  1862. return __awaiter(this, void 0, void 0, function* () {
  1863. return yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  1864. core.info('Retrieving the default branch name');
  1865. const octokit = github.getOctokit(authToken, {
  1866. baseUrl: (0, url_helper_1.getServerApiUrl)(baseUrl)
  1867. });
  1868. let result;
  1869. try {
  1870. // Get the default branch from the repo info
  1871. const response = yield octokit.rest.repos.get({ owner, repo });
  1872. result = response.data.default_branch;
  1873. assert.ok(result, 'default_branch cannot be empty');
  1874. }
  1875. catch (err) {
  1876. // Handle .wiki repo
  1877. if ((err === null || err === void 0 ? void 0 : err.status) === 404 &&
  1878. repo.toUpperCase().endsWith('.WIKI')) {
  1879. result = 'master';
  1880. }
  1881. // Otherwise error
  1882. else {
  1883. throw err;
  1884. }
  1885. }
  1886. // Print the default branch
  1887. core.info(`Default branch '${result}'`);
  1888. // Prefix with 'refs/heads'
  1889. if (!result.startsWith('refs/')) {
  1890. result = `refs/heads/${result}`;
  1891. }
  1892. return result;
  1893. }));
  1894. });
  1895. }
  1896. function tryGetRepositoryObjectFormat(authToken, owner, repo, baseUrl, commit) {
  1897. return __awaiter(this, void 0, void 0, function* () {
  1898. var _a;
  1899. const commitFormat = getObjectFormat(commit);
  1900. if (commitFormat) {
  1901. return { format: commitFormat, succeeded: true };
  1902. }
  1903. try {
  1904. const octokit = github.getOctokit(authToken, {
  1905. baseUrl: (0, url_helper_1.getServerApiUrl)(baseUrl)
  1906. });
  1907. const response = yield octokit.request('GET /repos/{owner}/{repo}/hash-algorithm', { owner, repo });
  1908. const hashAlgorithm = response.data.hash_algorithm;
  1909. if (hashAlgorithm === 'sha256' || hashAlgorithm === 'sha1') {
  1910. return { format: hashAlgorithm, succeeded: true };
  1911. }
  1912. core.debug('Unable to determine repository object format from hash-algorithm endpoint');
  1913. return { format: '', succeeded: false };
  1914. }
  1915. catch (err) {
  1916. core.debug(`Unable to determine repository object format from hash-algorithm endpoint: ${(_a = err === null || err === void 0 ? void 0 : err.message) !== null && _a !== void 0 ? _a : err}`);
  1917. return { format: '', succeeded: false };
  1918. }
  1919. });
  1920. }
  1921. function getObjectFormat(sha) {
  1922. if (/^[0-9a-fA-F]{64}$/.test(sha || '')) {
  1923. return 'sha256';
  1924. }
  1925. if (/^[0-9a-fA-F]{40}$/.test(sha || '')) {
  1926. return 'sha1';
  1927. }
  1928. return '';
  1929. }
  1930. function downloadArchive(authToken, owner, repo, ref, commit, baseUrl) {
  1931. return __awaiter(this, void 0, void 0, function* () {
  1932. const octokit = github.getOctokit(authToken, {
  1933. baseUrl: (0, url_helper_1.getServerApiUrl)(baseUrl)
  1934. });
  1935. const download = IS_WINDOWS
  1936. ? octokit.rest.repos.downloadZipballArchive
  1937. : octokit.rest.repos.downloadTarballArchive;
  1938. const response = yield download({
  1939. owner: owner,
  1940. repo: repo,
  1941. ref: commit || ref
  1942. });
  1943. return Buffer.from(response.data); // response.data is ArrayBuffer
  1944. });
  1945. }
  1946. /***/ }),
  1947. /***/ 5480:
  1948. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  1949. "use strict";
  1950. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  1951. if (k2 === undefined) k2 = k;
  1952. var desc = Object.getOwnPropertyDescriptor(m, k);
  1953. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  1954. desc = { enumerable: true, get: function() { return m[k]; } };
  1955. }
  1956. Object.defineProperty(o, k2, desc);
  1957. }) : (function(o, m, k, k2) {
  1958. if (k2 === undefined) k2 = k;
  1959. o[k2] = m[k];
  1960. }));
  1961. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  1962. Object.defineProperty(o, "default", { enumerable: true, value: v });
  1963. }) : function(o, v) {
  1964. o["default"] = v;
  1965. });
  1966. var __importStar = (this && this.__importStar) || function (mod) {
  1967. if (mod && mod.__esModule) return mod;
  1968. var result = {};
  1969. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  1970. __setModuleDefault(result, mod);
  1971. return result;
  1972. };
  1973. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  1974. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  1975. return new (P || (P = Promise))(function (resolve, reject) {
  1976. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  1977. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  1978. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  1979. step((generator = generator.apply(thisArg, _arguments || [])).next());
  1980. });
  1981. };
  1982. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1983. exports.getInputs = getInputs;
  1984. const core = __importStar(__nccwpck_require__(2186));
  1985. const fsHelper = __importStar(__nccwpck_require__(7219));
  1986. const github = __importStar(__nccwpck_require__(5438));
  1987. const path = __importStar(__nccwpck_require__(1017));
  1988. const unsafePrCheckoutHelper = __importStar(__nccwpck_require__(843));
  1989. const workflowContextHelper = __importStar(__nccwpck_require__(9568));
  1990. function getInputs() {
  1991. return __awaiter(this, void 0, void 0, function* () {
  1992. const result = {};
  1993. // GitHub workspace
  1994. let githubWorkspacePath = process.env['GITHUB_WORKSPACE'];
  1995. if (!githubWorkspacePath) {
  1996. throw new Error('GITHUB_WORKSPACE not defined');
  1997. }
  1998. githubWorkspacePath = path.resolve(githubWorkspacePath);
  1999. core.debug(`GITHUB_WORKSPACE = '${githubWorkspacePath}'`);
  2000. fsHelper.directoryExistsSync(githubWorkspacePath, true);
  2001. // Qualified repository
  2002. const qualifiedRepository = core.getInput('repository') ||
  2003. `${github.context.repo.owner}/${github.context.repo.repo}`;
  2004. core.debug(`qualified repository = '${qualifiedRepository}'`);
  2005. const splitRepository = qualifiedRepository.split('/');
  2006. if (splitRepository.length !== 2 ||
  2007. !splitRepository[0] ||
  2008. !splitRepository[1]) {
  2009. throw new Error(`Invalid repository '${qualifiedRepository}'. Expected format {owner}/{repo}.`);
  2010. }
  2011. result.repositoryOwner = splitRepository[0];
  2012. result.repositoryName = splitRepository[1];
  2013. // Repository path
  2014. result.repositoryPath = core.getInput('path') || '.';
  2015. result.repositoryPath = path.resolve(githubWorkspacePath, result.repositoryPath);
  2016. if (!(result.repositoryPath + path.sep).startsWith(githubWorkspacePath + path.sep)) {
  2017. throw new Error(`Repository path '${result.repositoryPath}' is not under '${githubWorkspacePath}'`);
  2018. }
  2019. // Workflow repository?
  2020. const isWorkflowRepository = qualifiedRepository.toUpperCase() ===
  2021. `${github.context.repo.owner}/${github.context.repo.repo}`.toUpperCase();
  2022. // Source branch, source version
  2023. result.ref = core.getInput('ref');
  2024. if (!result.ref) {
  2025. if (isWorkflowRepository) {
  2026. result.ref = github.context.ref;
  2027. result.commit = github.context.sha;
  2028. // Some events have an unqualifed ref. For example when a PR is merged (pull_request closed event),
  2029. // the ref is unqualifed like "main" instead of "refs/heads/main".
  2030. if (result.commit && result.ref && !result.ref.startsWith('refs/')) {
  2031. result.ref = `refs/heads/${result.ref}`;
  2032. }
  2033. }
  2034. }
  2035. // SHA?
  2036. else if (result.ref.match(/^(?:[0-9a-fA-F]{40}|[0-9a-fA-F]{64})$/)) {
  2037. result.commit = result.ref;
  2038. result.ref = '';
  2039. }
  2040. core.debug(`ref = '${result.ref}'`);
  2041. core.debug(`commit = '${result.commit}'`);
  2042. // Clean
  2043. result.clean = (core.getInput('clean') || 'true').toUpperCase() === 'TRUE';
  2044. core.debug(`clean = ${result.clean}`);
  2045. // Filter
  2046. const filter = core.getInput('filter');
  2047. if (filter) {
  2048. result.filter = filter;
  2049. }
  2050. core.debug(`filter = ${result.filter}`);
  2051. // Sparse checkout
  2052. const sparseCheckout = core.getMultilineInput('sparse-checkout');
  2053. if (sparseCheckout.length) {
  2054. result.sparseCheckout = sparseCheckout;
  2055. core.debug(`sparse checkout = ${result.sparseCheckout}`);
  2056. }
  2057. result.sparseCheckoutConeMode =
  2058. (core.getInput('sparse-checkout-cone-mode') || 'true').toUpperCase() ===
  2059. 'TRUE';
  2060. // Fetch depth
  2061. result.fetchDepth = Math.floor(Number(core.getInput('fetch-depth') || '1'));
  2062. if (isNaN(result.fetchDepth) || result.fetchDepth < 0) {
  2063. result.fetchDepth = 0;
  2064. }
  2065. core.debug(`fetch depth = ${result.fetchDepth}`);
  2066. // Fetch tags
  2067. result.fetchTags =
  2068. (core.getInput('fetch-tags') || 'false').toUpperCase() === 'TRUE';
  2069. core.debug(`fetch tags = ${result.fetchTags}`);
  2070. // Show fetch progress
  2071. result.showProgress =
  2072. (core.getInput('show-progress') || 'true').toUpperCase() === 'TRUE';
  2073. core.debug(`show progress = ${result.showProgress}`);
  2074. // LFS
  2075. result.lfs = (core.getInput('lfs') || 'false').toUpperCase() === 'TRUE';
  2076. core.debug(`lfs = ${result.lfs}`);
  2077. // Submodules
  2078. result.submodules = false;
  2079. result.nestedSubmodules = false;
  2080. const submodulesString = (core.getInput('submodules') || '').toUpperCase();
  2081. if (submodulesString == 'RECURSIVE') {
  2082. result.submodules = true;
  2083. result.nestedSubmodules = true;
  2084. }
  2085. else if (submodulesString == 'TRUE') {
  2086. result.submodules = true;
  2087. }
  2088. core.debug(`submodules = ${result.submodules}`);
  2089. core.debug(`recursive submodules = ${result.nestedSubmodules}`);
  2090. // Auth token
  2091. result.authToken = core.getInput('token', { required: true });
  2092. // SSH
  2093. result.sshKey = core.getInput('ssh-key');
  2094. result.sshKnownHosts = core.getInput('ssh-known-hosts');
  2095. result.sshStrict =
  2096. (core.getInput('ssh-strict') || 'true').toUpperCase() === 'TRUE';
  2097. result.sshUser = core.getInput('ssh-user');
  2098. // Persist credentials
  2099. result.persistCredentials =
  2100. (core.getInput('persist-credentials') || 'false').toUpperCase() === 'TRUE';
  2101. // Workflow organization ID
  2102. result.workflowOrganizationId =
  2103. yield workflowContextHelper.getOrganizationId();
  2104. // Set safe.directory in git global config.
  2105. result.setSafeDirectory =
  2106. (core.getInput('set-safe-directory') || 'true').toUpperCase() === 'TRUE';
  2107. // Determine the GitHub URL that the repository is being hosted from
  2108. result.githubServerUrl = core.getInput('github-server-url');
  2109. core.debug(`GitHub Host URL = ${result.githubServerUrl}`);
  2110. // Allow unsafe PR checkout (opt-in for pull_request_target / workflow_run fork PRs)
  2111. result.allowUnsafePrCheckout =
  2112. (core.getInput('allow-unsafe-pr-checkout') || 'false').toUpperCase() ===
  2113. 'TRUE';
  2114. core.debug(`allow unsafe PR checkout = ${result.allowUnsafePrCheckout}`);
  2115. // The default self-checkout (this repository with no explicit ref) always
  2116. // resolves to the trusted ref/commit GitHub set for the triggering event, so
  2117. // the fork-checkout guard only needs to run when the caller customized the
  2118. // repository or ref.
  2119. const isDefaultCheckout = isWorkflowRepository && !core.getInput('ref');
  2120. if (!isDefaultCheckout) {
  2121. unsafePrCheckoutHelper.assertSafePrCheckout({
  2122. qualifiedRepository,
  2123. ref: result.ref,
  2124. commit: result.commit,
  2125. allowUnsafePrCheckout: result.allowUnsafePrCheckout
  2126. });
  2127. }
  2128. return result;
  2129. });
  2130. }
  2131. /***/ }),
  2132. /***/ 3109:
  2133. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2134. "use strict";
  2135. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2136. if (k2 === undefined) k2 = k;
  2137. var desc = Object.getOwnPropertyDescriptor(m, k);
  2138. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2139. desc = { enumerable: true, get: function() { return m[k]; } };
  2140. }
  2141. Object.defineProperty(o, k2, desc);
  2142. }) : (function(o, m, k, k2) {
  2143. if (k2 === undefined) k2 = k;
  2144. o[k2] = m[k];
  2145. }));
  2146. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2147. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2148. }) : function(o, v) {
  2149. o["default"] = v;
  2150. });
  2151. var __importStar = (this && this.__importStar) || function (mod) {
  2152. if (mod && mod.__esModule) return mod;
  2153. var result = {};
  2154. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2155. __setModuleDefault(result, mod);
  2156. return result;
  2157. };
  2158. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2159. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2160. return new (P || (P = Promise))(function (resolve, reject) {
  2161. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2162. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2163. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2164. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2165. });
  2166. };
  2167. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2168. const core = __importStar(__nccwpck_require__(2186));
  2169. const coreCommand = __importStar(__nccwpck_require__(7351));
  2170. const gitSourceProvider = __importStar(__nccwpck_require__(9210));
  2171. const inputHelper = __importStar(__nccwpck_require__(5480));
  2172. const path = __importStar(__nccwpck_require__(1017));
  2173. const stateHelper = __importStar(__nccwpck_require__(4866));
  2174. function run() {
  2175. return __awaiter(this, void 0, void 0, function* () {
  2176. var _a;
  2177. try {
  2178. const sourceSettings = yield inputHelper.getInputs();
  2179. try {
  2180. // Register problem matcher
  2181. coreCommand.issueCommand('add-matcher', {}, path.join(__dirname, 'problem-matcher.json'));
  2182. // Get sources
  2183. yield gitSourceProvider.getSource(sourceSettings);
  2184. core.setOutput('ref', sourceSettings.ref);
  2185. }
  2186. finally {
  2187. // Unregister problem matcher
  2188. coreCommand.issueCommand('remove-matcher', { owner: 'checkout-git' }, '');
  2189. }
  2190. }
  2191. catch (error) {
  2192. core.setFailed(`${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error}`);
  2193. }
  2194. });
  2195. }
  2196. function cleanup() {
  2197. return __awaiter(this, void 0, void 0, function* () {
  2198. var _a;
  2199. try {
  2200. yield gitSourceProvider.cleanup(stateHelper.RepositoryPath);
  2201. }
  2202. catch (error) {
  2203. core.warning(`${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error}`);
  2204. }
  2205. });
  2206. }
  2207. // Main
  2208. if (!stateHelper.IsPost) {
  2209. run();
  2210. }
  2211. // Post
  2212. else {
  2213. cleanup();
  2214. }
  2215. /***/ }),
  2216. /***/ 8601:
  2217. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2218. "use strict";
  2219. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2220. if (k2 === undefined) k2 = k;
  2221. var desc = Object.getOwnPropertyDescriptor(m, k);
  2222. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2223. desc = { enumerable: true, get: function() { return m[k]; } };
  2224. }
  2225. Object.defineProperty(o, k2, desc);
  2226. }) : (function(o, m, k, k2) {
  2227. if (k2 === undefined) k2 = k;
  2228. o[k2] = m[k];
  2229. }));
  2230. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2231. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2232. }) : function(o, v) {
  2233. o["default"] = v;
  2234. });
  2235. var __importStar = (this && this.__importStar) || function (mod) {
  2236. if (mod && mod.__esModule) return mod;
  2237. var result = {};
  2238. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2239. __setModuleDefault(result, mod);
  2240. return result;
  2241. };
  2242. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2243. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2244. return new (P || (P = Promise))(function (resolve, reject) {
  2245. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2246. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2247. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2248. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2249. });
  2250. };
  2251. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2252. exports.tagsRefSpec = void 0;
  2253. exports.getCheckoutInfo = getCheckoutInfo;
  2254. exports.getRefSpecForAllHistory = getRefSpecForAllHistory;
  2255. exports.getRefSpec = getRefSpec;
  2256. exports.testRef = testRef;
  2257. exports.checkCommitInfo = checkCommitInfo;
  2258. exports.fromPayload = fromPayload;
  2259. const core = __importStar(__nccwpck_require__(2186));
  2260. const github = __importStar(__nccwpck_require__(5438));
  2261. const url_helper_1 = __nccwpck_require__(9437);
  2262. exports.tagsRefSpec = '+refs/tags/*:refs/tags/*';
  2263. function getCheckoutInfo(git, ref, commit) {
  2264. return __awaiter(this, void 0, void 0, function* () {
  2265. if (!git) {
  2266. throw new Error('Arg git cannot be empty');
  2267. }
  2268. if (!ref && !commit) {
  2269. throw new Error('Args ref and commit cannot both be empty');
  2270. }
  2271. const result = {};
  2272. const upperRef = (ref || '').toUpperCase();
  2273. // SHA only
  2274. if (!ref) {
  2275. result.ref = commit;
  2276. }
  2277. // refs/heads/
  2278. else if (upperRef.startsWith('REFS/HEADS/')) {
  2279. const branch = ref.substring('refs/heads/'.length);
  2280. result.ref = branch;
  2281. result.startPoint = `refs/remotes/origin/${branch}`;
  2282. }
  2283. // refs/pull/
  2284. else if (upperRef.startsWith('REFS/PULL/')) {
  2285. const branch = ref.substring('refs/pull/'.length);
  2286. result.ref = `refs/remotes/pull/${branch}`;
  2287. }
  2288. // refs/tags/
  2289. else if (upperRef.startsWith('REFS/TAGS/')) {
  2290. result.ref = ref;
  2291. }
  2292. // refs/
  2293. else if (upperRef.startsWith('REFS/')) {
  2294. result.ref = commit ? commit : ref;
  2295. }
  2296. // Unqualified ref, check for a matching branch or tag
  2297. else {
  2298. if (yield git.branchExists(true, `origin/${ref}`)) {
  2299. result.ref = ref;
  2300. result.startPoint = `refs/remotes/origin/${ref}`;
  2301. }
  2302. else if (yield git.tagExists(`${ref}`)) {
  2303. result.ref = `refs/tags/${ref}`;
  2304. }
  2305. else {
  2306. throw new Error(`A branch or tag with the name '${ref}' could not be found`);
  2307. }
  2308. }
  2309. return result;
  2310. });
  2311. }
  2312. function getRefSpecForAllHistory(ref, commit) {
  2313. const result = ['+refs/heads/*:refs/remotes/origin/*', exports.tagsRefSpec];
  2314. if (ref && ref.toUpperCase().startsWith('REFS/PULL/')) {
  2315. const branch = ref.substring('refs/pull/'.length);
  2316. result.push(`+${commit || ref}:refs/remotes/pull/${branch}`);
  2317. }
  2318. return result;
  2319. }
  2320. function getRefSpec(ref, commit, fetchTags) {
  2321. if (!ref && !commit) {
  2322. throw new Error('Args ref and commit cannot both be empty');
  2323. }
  2324. const upperRef = (ref || '').toUpperCase();
  2325. const result = [];
  2326. // When fetchTags is true, always include the tags refspec
  2327. if (fetchTags) {
  2328. result.push(exports.tagsRefSpec);
  2329. }
  2330. // SHA
  2331. if (commit) {
  2332. // refs/heads
  2333. if (upperRef.startsWith('REFS/HEADS/')) {
  2334. const branch = ref.substring('refs/heads/'.length);
  2335. result.push(`+${commit}:refs/remotes/origin/${branch}`);
  2336. }
  2337. // refs/pull/
  2338. else if (upperRef.startsWith('REFS/PULL/')) {
  2339. const branch = ref.substring('refs/pull/'.length);
  2340. result.push(`+${commit}:refs/remotes/pull/${branch}`);
  2341. }
  2342. // refs/tags/
  2343. else if (upperRef.startsWith('REFS/TAGS/')) {
  2344. if (!fetchTags) {
  2345. result.push(`+${ref}:${ref}`);
  2346. }
  2347. }
  2348. // Otherwise no destination ref
  2349. else {
  2350. result.push(commit);
  2351. }
  2352. }
  2353. // Unqualified ref, check for a matching branch or tag
  2354. else if (!upperRef.startsWith('REFS/')) {
  2355. result.push(`+refs/heads/${ref}*:refs/remotes/origin/${ref}*`);
  2356. if (!fetchTags) {
  2357. result.push(`+refs/tags/${ref}*:refs/tags/${ref}*`);
  2358. }
  2359. }
  2360. // refs/heads/
  2361. else if (upperRef.startsWith('REFS/HEADS/')) {
  2362. const branch = ref.substring('refs/heads/'.length);
  2363. result.push(`+${ref}:refs/remotes/origin/${branch}`);
  2364. }
  2365. // refs/pull/
  2366. else if (upperRef.startsWith('REFS/PULL/')) {
  2367. const branch = ref.substring('refs/pull/'.length);
  2368. result.push(`+${ref}:refs/remotes/pull/${branch}`);
  2369. }
  2370. // refs/tags/
  2371. else if (upperRef.startsWith('REFS/TAGS/')) {
  2372. if (!fetchTags) {
  2373. result.push(`+${ref}:${ref}`);
  2374. }
  2375. }
  2376. // Other refs
  2377. else {
  2378. result.push(`+${ref}:${ref}`);
  2379. }
  2380. return result;
  2381. }
  2382. /**
  2383. * Tests whether the initial fetch created the ref at the expected commit
  2384. */
  2385. function testRef(git, ref, commit) {
  2386. return __awaiter(this, void 0, void 0, function* () {
  2387. if (!git) {
  2388. throw new Error('Arg git cannot be empty');
  2389. }
  2390. if (!ref && !commit) {
  2391. throw new Error('Args ref and commit cannot both be empty');
  2392. }
  2393. // No SHA? Nothing to test
  2394. if (!commit) {
  2395. return true;
  2396. }
  2397. // SHA only?
  2398. else if (!ref) {
  2399. return yield git.shaExists(commit);
  2400. }
  2401. const upperRef = ref.toUpperCase();
  2402. // refs/heads/
  2403. if (upperRef.startsWith('REFS/HEADS/')) {
  2404. const branch = ref.substring('refs/heads/'.length);
  2405. return ((yield git.branchExists(true, `origin/${branch}`)) &&
  2406. commit === (yield git.revParse(`refs/remotes/origin/${branch}`)));
  2407. }
  2408. // refs/pull/
  2409. else if (upperRef.startsWith('REFS/PULL/')) {
  2410. // Assume matches because fetched using the commit
  2411. return true;
  2412. }
  2413. // refs/tags/
  2414. else if (upperRef.startsWith('REFS/TAGS/')) {
  2415. const tagName = ref.substring('refs/tags/'.length);
  2416. // Use ^{commit} to dereference annotated tags to their underlying commit
  2417. return ((yield git.tagExists(tagName)) &&
  2418. commit === (yield git.revParse(`${ref}^{commit}`)));
  2419. }
  2420. // Unexpected
  2421. else {
  2422. core.debug(`Unexpected ref format '${ref}' when testing ref info`);
  2423. return true;
  2424. }
  2425. });
  2426. }
  2427. function checkCommitInfo(token, commitInfo, repositoryOwner, repositoryName, ref, commit, baseUrl) {
  2428. return __awaiter(this, void 0, void 0, function* () {
  2429. var _a;
  2430. try {
  2431. // GHES?
  2432. if ((0, url_helper_1.isGhes)(baseUrl)) {
  2433. return;
  2434. }
  2435. // Auth token?
  2436. if (!token) {
  2437. return;
  2438. }
  2439. // Public PR synchronize, for workflow repo?
  2440. if (fromPayload('repository.private') !== false ||
  2441. github.context.eventName !== 'pull_request' ||
  2442. fromPayload('action') !== 'synchronize' ||
  2443. repositoryOwner !== github.context.repo.owner ||
  2444. repositoryName !== github.context.repo.repo ||
  2445. ref !== github.context.ref ||
  2446. !ref.startsWith('refs/pull/') ||
  2447. commit !== github.context.sha) {
  2448. return;
  2449. }
  2450. // Head SHA
  2451. const expectedHeadSha = fromPayload('after');
  2452. if (!expectedHeadSha) {
  2453. core.debug('Unable to determine head sha');
  2454. return;
  2455. }
  2456. // Base SHA
  2457. const expectedBaseSha = fromPayload('pull_request.base.sha');
  2458. if (!expectedBaseSha) {
  2459. core.debug('Unable to determine base sha');
  2460. return;
  2461. }
  2462. // Expected message?
  2463. const expectedMessage = `Merge ${expectedHeadSha} into ${expectedBaseSha}`;
  2464. if (commitInfo.indexOf(expectedMessage) >= 0) {
  2465. return;
  2466. }
  2467. // Extract details from message
  2468. const match = commitInfo.match(/Merge ([0-9a-f]{40}|[0-9a-f]{64}) into ([0-9a-f]{40}|[0-9a-f]{64})/);
  2469. if (!match) {
  2470. core.debug('Unexpected message format');
  2471. return;
  2472. }
  2473. // Post telemetry
  2474. const actualHeadSha = match[1];
  2475. if (actualHeadSha !== expectedHeadSha) {
  2476. core.debug(`Expected head sha ${expectedHeadSha}; actual head sha ${actualHeadSha}`);
  2477. const octokit = github.getOctokit(token, {
  2478. baseUrl: (0, url_helper_1.getServerApiUrl)(baseUrl),
  2479. 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})`
  2480. });
  2481. yield octokit.rest.repos.get({
  2482. owner: repositoryOwner,
  2483. repo: repositoryName
  2484. });
  2485. }
  2486. }
  2487. catch (err) {
  2488. core.debug(`Error when validating commit info: ${(_a = err === null || err === void 0 ? void 0 : err.stack) !== null && _a !== void 0 ? _a : err}`);
  2489. }
  2490. });
  2491. }
  2492. function fromPayload(path) {
  2493. return select(github.context.payload, path);
  2494. }
  2495. function select(obj, path) {
  2496. if (!obj) {
  2497. return undefined;
  2498. }
  2499. const i = path.indexOf('.');
  2500. if (i < 0) {
  2501. return obj[path];
  2502. }
  2503. const key = path.substr(0, i);
  2504. return select(obj[key], path.substr(i + 1));
  2505. }
  2506. /***/ }),
  2507. /***/ 3120:
  2508. /***/ ((__unused_webpack_module, exports) => {
  2509. "use strict";
  2510. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2511. exports.escape = escape;
  2512. function escape(value) {
  2513. return value.replace(/[^a-zA-Z0-9_]/g, x => {
  2514. return `\\${x}`;
  2515. });
  2516. }
  2517. /***/ }),
  2518. /***/ 2155:
  2519. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2520. "use strict";
  2521. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2522. if (k2 === undefined) k2 = k;
  2523. var desc = Object.getOwnPropertyDescriptor(m, k);
  2524. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2525. desc = { enumerable: true, get: function() { return m[k]; } };
  2526. }
  2527. Object.defineProperty(o, k2, desc);
  2528. }) : (function(o, m, k, k2) {
  2529. if (k2 === undefined) k2 = k;
  2530. o[k2] = m[k];
  2531. }));
  2532. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2533. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2534. }) : function(o, v) {
  2535. o["default"] = v;
  2536. });
  2537. var __importStar = (this && this.__importStar) || function (mod) {
  2538. if (mod && mod.__esModule) return mod;
  2539. var result = {};
  2540. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2541. __setModuleDefault(result, mod);
  2542. return result;
  2543. };
  2544. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2545. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2546. return new (P || (P = Promise))(function (resolve, reject) {
  2547. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2548. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2549. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2550. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2551. });
  2552. };
  2553. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2554. exports.RetryHelper = void 0;
  2555. exports.execute = execute;
  2556. const core = __importStar(__nccwpck_require__(2186));
  2557. const defaultMaxAttempts = 3;
  2558. const defaultMinSeconds = 10;
  2559. const defaultMaxSeconds = 20;
  2560. class RetryHelper {
  2561. constructor(maxAttempts = defaultMaxAttempts, minSeconds = defaultMinSeconds, maxSeconds = defaultMaxSeconds) {
  2562. this.maxAttempts = maxAttempts;
  2563. this.minSeconds = Math.floor(minSeconds);
  2564. this.maxSeconds = Math.floor(maxSeconds);
  2565. if (this.minSeconds > this.maxSeconds) {
  2566. throw new Error('min seconds should be less than or equal to max seconds');
  2567. }
  2568. }
  2569. execute(action) {
  2570. return __awaiter(this, void 0, void 0, function* () {
  2571. let attempt = 1;
  2572. while (attempt < this.maxAttempts) {
  2573. // Try
  2574. try {
  2575. return yield action();
  2576. }
  2577. catch (err) {
  2578. core.info(err === null || err === void 0 ? void 0 : err.message);
  2579. }
  2580. // Sleep
  2581. const seconds = this.getSleepAmount();
  2582. core.info(`Waiting ${seconds} seconds before trying again`);
  2583. yield this.sleep(seconds);
  2584. attempt++;
  2585. }
  2586. // Last attempt
  2587. return yield action();
  2588. });
  2589. }
  2590. getSleepAmount() {
  2591. return (Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) +
  2592. this.minSeconds);
  2593. }
  2594. sleep(seconds) {
  2595. return __awaiter(this, void 0, void 0, function* () {
  2596. return new Promise(resolve => setTimeout(resolve, seconds * 1000));
  2597. });
  2598. }
  2599. }
  2600. exports.RetryHelper = RetryHelper;
  2601. function execute(action) {
  2602. return __awaiter(this, void 0, void 0, function* () {
  2603. const retryHelper = new RetryHelper();
  2604. return yield retryHelper.execute(action);
  2605. });
  2606. }
  2607. /***/ }),
  2608. /***/ 4866:
  2609. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2610. "use strict";
  2611. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2612. if (k2 === undefined) k2 = k;
  2613. var desc = Object.getOwnPropertyDescriptor(m, k);
  2614. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2615. desc = { enumerable: true, get: function() { return m[k]; } };
  2616. }
  2617. Object.defineProperty(o, k2, desc);
  2618. }) : (function(o, m, k, k2) {
  2619. if (k2 === undefined) k2 = k;
  2620. o[k2] = m[k];
  2621. }));
  2622. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2623. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2624. }) : function(o, v) {
  2625. o["default"] = v;
  2626. });
  2627. var __importStar = (this && this.__importStar) || function (mod) {
  2628. if (mod && mod.__esModule) return mod;
  2629. var result = {};
  2630. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2631. __setModuleDefault(result, mod);
  2632. return result;
  2633. };
  2634. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2635. exports.SshKnownHostsPath = exports.SshKeyPath = exports.PostSetSafeDirectory = exports.RepositoryPath = exports.IsPost = void 0;
  2636. exports.setRepositoryPath = setRepositoryPath;
  2637. exports.setSshKeyPath = setSshKeyPath;
  2638. exports.setSshKnownHostsPath = setSshKnownHostsPath;
  2639. exports.setSafeDirectory = setSafeDirectory;
  2640. const core = __importStar(__nccwpck_require__(2186));
  2641. /**
  2642. * Indicates whether the POST action is running
  2643. */
  2644. exports.IsPost = !!core.getState('isPost');
  2645. /**
  2646. * The repository path for the POST action. The value is empty during the MAIN action.
  2647. */
  2648. exports.RepositoryPath = core.getState('repositoryPath');
  2649. /**
  2650. * The set-safe-directory for the POST action. The value is set if input: 'safe-directory' is set during the MAIN action.
  2651. */
  2652. exports.PostSetSafeDirectory = core.getState('setSafeDirectory') === 'true';
  2653. /**
  2654. * The SSH key path for the POST action. The value is empty during the MAIN action.
  2655. */
  2656. exports.SshKeyPath = core.getState('sshKeyPath');
  2657. /**
  2658. * The SSH known hosts path for the POST action. The value is empty during the MAIN action.
  2659. */
  2660. exports.SshKnownHostsPath = core.getState('sshKnownHostsPath');
  2661. /**
  2662. * Save the repository path so the POST action can retrieve the value.
  2663. */
  2664. function setRepositoryPath(repositoryPath) {
  2665. core.saveState('repositoryPath', repositoryPath);
  2666. }
  2667. /**
  2668. * Save the SSH key path so the POST action can retrieve the value.
  2669. */
  2670. function setSshKeyPath(sshKeyPath) {
  2671. core.saveState('sshKeyPath', sshKeyPath);
  2672. }
  2673. /**
  2674. * Save the SSH known hosts path so the POST action can retrieve the value.
  2675. */
  2676. function setSshKnownHostsPath(sshKnownHostsPath) {
  2677. core.saveState('sshKnownHostsPath', sshKnownHostsPath);
  2678. }
  2679. /**
  2680. * Save the set-safe-directory input so the POST action can retrieve the value.
  2681. */
  2682. function setSafeDirectory() {
  2683. core.saveState('setSafeDirectory', 'true');
  2684. }
  2685. // Publish a variable so that when the POST action runs, it can determine it should run the cleanup logic.
  2686. // This is necessary since we don't have a separate entry point.
  2687. if (!exports.IsPost) {
  2688. core.saveState('isPost', 'true');
  2689. }
  2690. /***/ }),
  2691. /***/ 843:
  2692. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2693. "use strict";
  2694. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2695. if (k2 === undefined) k2 = k;
  2696. var desc = Object.getOwnPropertyDescriptor(m, k);
  2697. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2698. desc = { enumerable: true, get: function() { return m[k]; } };
  2699. }
  2700. Object.defineProperty(o, k2, desc);
  2701. }) : (function(o, m, k, k2) {
  2702. if (k2 === undefined) k2 = k;
  2703. o[k2] = m[k];
  2704. }));
  2705. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2706. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2707. }) : function(o, v) {
  2708. o["default"] = v;
  2709. });
  2710. var __importStar = (this && this.__importStar) || function (mod) {
  2711. if (mod && mod.__esModule) return mod;
  2712. var result = {};
  2713. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2714. __setModuleDefault(result, mod);
  2715. return result;
  2716. };
  2717. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2718. exports.assertSafePrCheckout = assertSafePrCheckout;
  2719. const github = __importStar(__nccwpck_require__(5438));
  2720. const ref_helper_1 = __nccwpck_require__(8601);
  2721. const PR_REF_PATTERN = /^refs\/pull\/[0-9]+\/(?:head|merge)$/;
  2722. function assertSafePrCheckout(input) {
  2723. if (input.allowUnsafePrCheckout) {
  2724. return;
  2725. }
  2726. const eventName = github.context.eventName;
  2727. if (eventName !== 'pull_request_target' && eventName !== 'workflow_run') {
  2728. return;
  2729. }
  2730. const baseRepoId = (0, ref_helper_1.fromPayload)('repository.id');
  2731. if (typeof baseRepoId !== 'number') {
  2732. return;
  2733. }
  2734. let prHeadRepoId;
  2735. let prHeadRepoFullName;
  2736. const prShas = [];
  2737. if (eventName === 'pull_request_target') {
  2738. prHeadRepoId = (0, ref_helper_1.fromPayload)('pull_request.head.repo.id');
  2739. prHeadRepoFullName = (0, ref_helper_1.fromPayload)('pull_request.head.repo.full_name');
  2740. pushIfSha(prShas, (0, ref_helper_1.fromPayload)('pull_request.head.sha'));
  2741. pushIfSha(prShas, (0, ref_helper_1.fromPayload)('pull_request.merge_commit_sha'));
  2742. }
  2743. else {
  2744. const wrEvent = (0, ref_helper_1.fromPayload)('workflow_run.event');
  2745. if (typeof wrEvent !== 'string' || !wrEvent.startsWith('pull_request')) {
  2746. return;
  2747. }
  2748. prHeadRepoId = (0, ref_helper_1.fromPayload)('workflow_run.head_repository.id');
  2749. prHeadRepoFullName = (0, ref_helper_1.fromPayload)('workflow_run.head_repository.full_name');
  2750. pushIfSha(prShas, (0, ref_helper_1.fromPayload)('workflow_run.head_commit.id'));
  2751. // For `pull_request_target`-triggered workflow_run, `head_sha` is the base
  2752. // default branch SHA (not the PR head)
  2753. if (wrEvent !== 'pull_request_target') {
  2754. pushIfSha(prShas, (0, ref_helper_1.fromPayload)('workflow_run.head_sha'));
  2755. }
  2756. }
  2757. // (A) Fork PR?
  2758. if (typeof prHeadRepoId !== 'number' || prHeadRepoId === baseRepoId) {
  2759. return;
  2760. }
  2761. // (B) We cannot check for all fork PR refs so check to see
  2762. // if the resolved input points to the fork PR sha we have in the payload
  2763. const repositoryMatchesPrHead = typeof prHeadRepoFullName === 'string' &&
  2764. input.qualifiedRepository.toLowerCase() === prHeadRepoFullName.toLowerCase();
  2765. const refMatchesPullPattern = PR_REF_PATTERN.test(input.ref);
  2766. const commitMatchesPrHeadSha = !!input.commit && prShas.includes(input.commit.toLowerCase());
  2767. if (!repositoryMatchesPrHead &&
  2768. !refMatchesPullPattern &&
  2769. !commitMatchesPrHeadSha) {
  2770. return;
  2771. }
  2772. throw new Error(`Refusing to check out fork pull request code from a '${eventName}' workflow. ` +
  2773. `This workflow runs with the base repository's GITHUB_TOKEN, secrets, default-branch ` +
  2774. `cache scope, and runner access. Fetching and executing a fork's code in that trusted ` +
  2775. `context commonly leads to "pwn request" vulnerabilities. To opt in, review the risks ` +
  2776. `at https://gh.io/securely-using-pull_request_target and set 'allow-unsafe-pr-checkout: true' ` +
  2777. `on the actions/checkout step.`);
  2778. }
  2779. function pushIfSha(target, value) {
  2780. if (typeof value === 'string' && value.length > 0) {
  2781. target.push(value.toLowerCase());
  2782. }
  2783. }
  2784. /***/ }),
  2785. /***/ 9437:
  2786. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2787. "use strict";
  2788. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2789. if (k2 === undefined) k2 = k;
  2790. var desc = Object.getOwnPropertyDescriptor(m, k);
  2791. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2792. desc = { enumerable: true, get: function() { return m[k]; } };
  2793. }
  2794. Object.defineProperty(o, k2, desc);
  2795. }) : (function(o, m, k, k2) {
  2796. if (k2 === undefined) k2 = k;
  2797. o[k2] = m[k];
  2798. }));
  2799. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2800. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2801. }) : function(o, v) {
  2802. o["default"] = v;
  2803. });
  2804. var __importStar = (this && this.__importStar) || function (mod) {
  2805. if (mod && mod.__esModule) return mod;
  2806. var result = {};
  2807. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2808. __setModuleDefault(result, mod);
  2809. return result;
  2810. };
  2811. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2812. exports.getFetchUrl = getFetchUrl;
  2813. exports.getServerUrl = getServerUrl;
  2814. exports.getServerApiUrl = getServerApiUrl;
  2815. exports.isGhes = isGhes;
  2816. const assert = __importStar(__nccwpck_require__(9491));
  2817. const url_1 = __nccwpck_require__(7310);
  2818. function getFetchUrl(settings) {
  2819. assert.ok(settings.repositoryOwner, 'settings.repositoryOwner must be defined');
  2820. assert.ok(settings.repositoryName, 'settings.repositoryName must be defined');
  2821. const serviceUrl = getServerUrl(settings.githubServerUrl);
  2822. const encodedOwner = encodeURIComponent(settings.repositoryOwner);
  2823. const encodedName = encodeURIComponent(settings.repositoryName);
  2824. if (settings.sshKey) {
  2825. const user = settings.sshUser.length > 0 ? settings.sshUser : 'git';
  2826. return `${user}@${serviceUrl.hostname}:${encodedOwner}/${encodedName}.git`;
  2827. }
  2828. // "origin" is SCHEME://HOSTNAME[:PORT]
  2829. return `${serviceUrl.origin}/${encodedOwner}/${encodedName}`;
  2830. }
  2831. function getServerUrl(url) {
  2832. let resolvedUrl = process.env['GITHUB_SERVER_URL'] || 'https://github.com';
  2833. if (hasContent(url, WhitespaceMode.Trim)) {
  2834. resolvedUrl = url;
  2835. }
  2836. return new url_1.URL(resolvedUrl);
  2837. }
  2838. function getServerApiUrl(url) {
  2839. if (hasContent(url, WhitespaceMode.Trim)) {
  2840. let serverUrl = getServerUrl(url);
  2841. if (isGhes(url)) {
  2842. serverUrl.pathname = 'api/v3';
  2843. }
  2844. else {
  2845. serverUrl.hostname = 'api.' + serverUrl.hostname;
  2846. }
  2847. return pruneSuffix(serverUrl.toString(), '/');
  2848. }
  2849. return process.env['GITHUB_API_URL'] || 'https://api.github.com';
  2850. }
  2851. function isGhes(url) {
  2852. const ghUrl = new url_1.URL(url || process.env['GITHUB_SERVER_URL'] || 'https://github.com');
  2853. const hostname = ghUrl.hostname.trimEnd().toUpperCase();
  2854. const isGitHubHost = hostname === 'GITHUB.COM';
  2855. const isGitHubEnterpriseCloudHost = hostname.endsWith('.GHE.COM');
  2856. const isLocalHost = hostname.endsWith('.LOCALHOST');
  2857. return !isGitHubHost && !isGitHubEnterpriseCloudHost && !isLocalHost;
  2858. }
  2859. function pruneSuffix(text, suffix) {
  2860. if (hasContent(suffix, WhitespaceMode.Preserve) && (text === null || text === void 0 ? void 0 : text.endsWith(suffix))) {
  2861. return text.substring(0, text.length - suffix.length);
  2862. }
  2863. return text;
  2864. }
  2865. var WhitespaceMode;
  2866. (function (WhitespaceMode) {
  2867. WhitespaceMode[WhitespaceMode["Trim"] = 0] = "Trim";
  2868. WhitespaceMode[WhitespaceMode["Preserve"] = 1] = "Preserve";
  2869. })(WhitespaceMode || (WhitespaceMode = {}));
  2870. function hasContent(text, whitespaceMode) {
  2871. let refinedText = text !== null && text !== void 0 ? text : '';
  2872. if (whitespaceMode == WhitespaceMode.Trim) {
  2873. refinedText = refinedText.trim();
  2874. }
  2875. return refinedText.length > 0;
  2876. }
  2877. /***/ }),
  2878. /***/ 9568:
  2879. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2880. "use strict";
  2881. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2882. if (k2 === undefined) k2 = k;
  2883. var desc = Object.getOwnPropertyDescriptor(m, k);
  2884. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  2885. desc = { enumerable: true, get: function() { return m[k]; } };
  2886. }
  2887. Object.defineProperty(o, k2, desc);
  2888. }) : (function(o, m, k, k2) {
  2889. if (k2 === undefined) k2 = k;
  2890. o[k2] = m[k];
  2891. }));
  2892. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2893. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2894. }) : function(o, v) {
  2895. o["default"] = v;
  2896. });
  2897. var __importStar = (this && this.__importStar) || function (mod) {
  2898. if (mod && mod.__esModule) return mod;
  2899. var result = {};
  2900. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2901. __setModuleDefault(result, mod);
  2902. return result;
  2903. };
  2904. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2905. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2906. return new (P || (P = Promise))(function (resolve, reject) {
  2907. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2908. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2909. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2910. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2911. });
  2912. };
  2913. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2914. exports.getOrganizationId = getOrganizationId;
  2915. const core = __importStar(__nccwpck_require__(2186));
  2916. const fs = __importStar(__nccwpck_require__(7147));
  2917. /**
  2918. * Gets the organization ID of the running workflow or undefined if the value cannot be loaded from the GITHUB_EVENT_PATH
  2919. */
  2920. function getOrganizationId() {
  2921. return __awaiter(this, void 0, void 0, function* () {
  2922. var _a, _b;
  2923. try {
  2924. const eventPath = process.env.GITHUB_EVENT_PATH;
  2925. if (!eventPath) {
  2926. core.debug(`GITHUB_EVENT_PATH is not defined`);
  2927. return;
  2928. }
  2929. const content = yield fs.promises.readFile(eventPath, { encoding: 'utf8' });
  2930. const event = JSON.parse(content);
  2931. 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;
  2932. if (typeof id !== 'number') {
  2933. core.debug('Repository owner ID not found within GITHUB event info');
  2934. return;
  2935. }
  2936. return id;
  2937. }
  2938. catch (err) {
  2939. core.debug(`Unable to load organization ID from GITHUB_EVENT_PATH: ${err.message || err}`);
  2940. }
  2941. });
  2942. }
  2943. /***/ }),
  2944. /***/ 7351:
  2945. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  2946. "use strict";
  2947. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2948. if (k2 === undefined) k2 = k;
  2949. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  2950. }) : (function(o, m, k, k2) {
  2951. if (k2 === undefined) k2 = k;
  2952. o[k2] = m[k];
  2953. }));
  2954. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2955. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2956. }) : function(o, v) {
  2957. o["default"] = v;
  2958. });
  2959. var __importStar = (this && this.__importStar) || function (mod) {
  2960. if (mod && mod.__esModule) return mod;
  2961. var result = {};
  2962. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2963. __setModuleDefault(result, mod);
  2964. return result;
  2965. };
  2966. Object.defineProperty(exports, "__esModule", ({ value: true }));
  2967. exports.issue = exports.issueCommand = void 0;
  2968. const os = __importStar(__nccwpck_require__(2037));
  2969. const utils_1 = __nccwpck_require__(5278);
  2970. /**
  2971. * Commands
  2972. *
  2973. * Command Format:
  2974. * ::name key=value,key=value::message
  2975. *
  2976. * Examples:
  2977. * ::warning::This is the message
  2978. * ::set-env name=MY_VAR::some value
  2979. */
  2980. function issueCommand(command, properties, message) {
  2981. const cmd = new Command(command, properties, message);
  2982. process.stdout.write(cmd.toString() + os.EOL);
  2983. }
  2984. exports.issueCommand = issueCommand;
  2985. function issue(name, message = '') {
  2986. issueCommand(name, {}, message);
  2987. }
  2988. exports.issue = issue;
  2989. const CMD_STRING = '::';
  2990. class Command {
  2991. constructor(command, properties, message) {
  2992. if (!command) {
  2993. command = 'missing.command';
  2994. }
  2995. this.command = command;
  2996. this.properties = properties;
  2997. this.message = message;
  2998. }
  2999. toString() {
  3000. let cmdStr = CMD_STRING + this.command;
  3001. if (this.properties && Object.keys(this.properties).length > 0) {
  3002. cmdStr += ' ';
  3003. let first = true;
  3004. for (const key in this.properties) {
  3005. if (this.properties.hasOwnProperty(key)) {
  3006. const val = this.properties[key];
  3007. if (val) {
  3008. if (first) {
  3009. first = false;
  3010. }
  3011. else {
  3012. cmdStr += ',';
  3013. }
  3014. cmdStr += `${key}=${escapeProperty(val)}`;
  3015. }
  3016. }
  3017. }
  3018. }
  3019. cmdStr += `${CMD_STRING}${escapeData(this.message)}`;
  3020. return cmdStr;
  3021. }
  3022. }
  3023. function escapeData(s) {
  3024. return utils_1.toCommandValue(s)
  3025. .replace(/%/g, '%25')
  3026. .replace(/\r/g, '%0D')
  3027. .replace(/\n/g, '%0A');
  3028. }
  3029. function escapeProperty(s) {
  3030. return utils_1.toCommandValue(s)
  3031. .replace(/%/g, '%25')
  3032. .replace(/\r/g, '%0D')
  3033. .replace(/\n/g, '%0A')
  3034. .replace(/:/g, '%3A')
  3035. .replace(/,/g, '%2C');
  3036. }
  3037. //# sourceMappingURL=command.js.map
  3038. /***/ }),
  3039. /***/ 2186:
  3040. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  3041. "use strict";
  3042. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  3043. if (k2 === undefined) k2 = k;
  3044. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  3045. }) : (function(o, m, k, k2) {
  3046. if (k2 === undefined) k2 = k;
  3047. o[k2] = m[k];
  3048. }));
  3049. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  3050. Object.defineProperty(o, "default", { enumerable: true, value: v });
  3051. }) : function(o, v) {
  3052. o["default"] = v;
  3053. });
  3054. var __importStar = (this && this.__importStar) || function (mod) {
  3055. if (mod && mod.__esModule) return mod;
  3056. var result = {};
  3057. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  3058. __setModuleDefault(result, mod);
  3059. return result;
  3060. };
  3061. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  3062. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  3063. return new (P || (P = Promise))(function (resolve, reject) {
  3064. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  3065. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  3066. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  3067. step((generator = generator.apply(thisArg, _arguments || [])).next());
  3068. });
  3069. };
  3070. Object.defineProperty(exports, "__esModule", ({ value: true }));
  3071. 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;
  3072. const command_1 = __nccwpck_require__(7351);
  3073. const file_command_1 = __nccwpck_require__(717);
  3074. const utils_1 = __nccwpck_require__(5278);
  3075. const os = __importStar(__nccwpck_require__(2037));
  3076. const path = __importStar(__nccwpck_require__(1017));
  3077. const oidc_utils_1 = __nccwpck_require__(8041);
  3078. /**
  3079. * The code to exit an action
  3080. */
  3081. var ExitCode;
  3082. (function (ExitCode) {
  3083. /**
  3084. * A code indicating that the action was successful
  3085. */
  3086. ExitCode[ExitCode["Success"] = 0] = "Success";
  3087. /**
  3088. * A code indicating that the action was a failure
  3089. */
  3090. ExitCode[ExitCode["Failure"] = 1] = "Failure";
  3091. })(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
  3092. //-----------------------------------------------------------------------
  3093. // Variables
  3094. //-----------------------------------------------------------------------
  3095. /**
  3096. * Sets env variable for this action and future actions in the job
  3097. * @param name the name of the variable to set
  3098. * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify
  3099. */
  3100. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  3101. function exportVariable(name, val) {
  3102. const convertedVal = utils_1.toCommandValue(val);
  3103. process.env[name] = convertedVal;
  3104. const filePath = process.env['GITHUB_ENV'] || '';
  3105. if (filePath) {
  3106. return file_command_1.issueFileCommand('ENV', file_command_1.prepareKeyValueMessage(name, val));
  3107. }
  3108. command_1.issueCommand('set-env', { name }, convertedVal);
  3109. }
  3110. exports.exportVariable = exportVariable;
  3111. /**
  3112. * Registers a secret which will get masked from logs
  3113. * @param secret value of the secret
  3114. */
  3115. function setSecret(secret) {
  3116. command_1.issueCommand('add-mask', {}, secret);
  3117. }
  3118. exports.setSecret = setSecret;
  3119. /**
  3120. * Prepends inputPath to the PATH (for this action and future actions)
  3121. * @param inputPath
  3122. */
  3123. function addPath(inputPath) {
  3124. const filePath = process.env['GITHUB_PATH'] || '';
  3125. if (filePath) {
  3126. file_command_1.issueFileCommand('PATH', inputPath);
  3127. }
  3128. else {
  3129. command_1.issueCommand('add-path', {}, inputPath);
  3130. }
  3131. process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
  3132. }
  3133. exports.addPath = addPath;
  3134. /**
  3135. * Gets the value of an input.
  3136. * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed.
  3137. * Returns an empty string if the value is not defined.
  3138. *
  3139. * @param name name of the input to get
  3140. * @param options optional. See InputOptions.
  3141. * @returns string
  3142. */
  3143. function getInput(name, options) {
  3144. const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';
  3145. if (options && options.required && !val) {
  3146. throw new Error(`Input required and not supplied: ${name}`);
  3147. }
  3148. if (options && options.trimWhitespace === false) {
  3149. return val;
  3150. }
  3151. return val.trim();
  3152. }
  3153. exports.getInput = getInput;
  3154. /**
  3155. * Gets the values of an multiline input. Each value is also trimmed.
  3156. *
  3157. * @param name name of the input to get
  3158. * @param options optional. See InputOptions.
  3159. * @returns string[]
  3160. *
  3161. */
  3162. function getMultilineInput(name, options) {
  3163. const inputs = getInput(name, options)
  3164. .split('\n')
  3165. .filter(x => x !== '');
  3166. if (options && options.trimWhitespace === false) {
  3167. return inputs;
  3168. }
  3169. return inputs.map(input => input.trim());
  3170. }
  3171. exports.getMultilineInput = getMultilineInput;
  3172. /**
  3173. * Gets the input value of the boolean type in the YAML 1.2 "core schema" specification.
  3174. * Support boolean input list: `true | True | TRUE | false | False | FALSE` .
  3175. * The return value is also in boolean type.
  3176. * ref: https://yaml.org/spec/1.2/spec.html#id2804923
  3177. *
  3178. * @param name name of the input to get
  3179. * @param options optional. See InputOptions.
  3180. * @returns boolean
  3181. */
  3182. function getBooleanInput(name, options) {
  3183. const trueValue = ['true', 'True', 'TRUE'];
  3184. const falseValue = ['false', 'False', 'FALSE'];
  3185. const val = getInput(name, options);
  3186. if (trueValue.includes(val))
  3187. return true;
  3188. if (falseValue.includes(val))
  3189. return false;
  3190. throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${name}\n` +
  3191. `Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);
  3192. }
  3193. exports.getBooleanInput = getBooleanInput;
  3194. /**
  3195. * Sets the value of an output.
  3196. *
  3197. * @param name name of the output to set
  3198. * @param value value to store. Non-string values will be converted to a string via JSON.stringify
  3199. */
  3200. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  3201. function setOutput(name, value) {
  3202. const filePath = process.env['GITHUB_OUTPUT'] || '';
  3203. if (filePath) {
  3204. return file_command_1.issueFileCommand('OUTPUT', file_command_1.prepareKeyValueMessage(name, value));
  3205. }
  3206. process.stdout.write(os.EOL);
  3207. command_1.issueCommand('set-output', { name }, utils_1.toCommandValue(value));
  3208. }
  3209. exports.setOutput = setOutput;
  3210. /**
  3211. * Enables or disables the echoing of commands into stdout for the rest of the step.
  3212. * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.
  3213. *
  3214. */
  3215. function setCommandEcho(enabled) {
  3216. command_1.issue('echo', enabled ? 'on' : 'off');
  3217. }
  3218. exports.setCommandEcho = setCommandEcho;
  3219. //-----------------------------------------------------------------------
  3220. // Results
  3221. //-----------------------------------------------------------------------
  3222. /**
  3223. * Sets the action status to failed.
  3224. * When the action exits it will be with an exit code of 1
  3225. * @param message add error issue message
  3226. */
  3227. function setFailed(message) {
  3228. process.exitCode = ExitCode.Failure;
  3229. error(message);
  3230. }
  3231. exports.setFailed = setFailed;
  3232. //-----------------------------------------------------------------------
  3233. // Logging Commands
  3234. //-----------------------------------------------------------------------
  3235. /**
  3236. * Gets whether Actions Step Debug is on or not
  3237. */
  3238. function isDebug() {
  3239. return process.env['RUNNER_DEBUG'] === '1';
  3240. }
  3241. exports.isDebug = isDebug;
  3242. /**
  3243. * Writes debug message to user log
  3244. * @param message debug message
  3245. */
  3246. function debug(message) {
  3247. command_1.issueCommand('debug', {}, message);
  3248. }
  3249. exports.debug = debug;
  3250. /**
  3251. * Adds an error issue
  3252. * @param message error issue message. Errors will be converted to string via toString()
  3253. * @param properties optional properties to add to the annotation.
  3254. */
  3255. function error(message, properties = {}) {
  3256. command_1.issueCommand('error', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
  3257. }
  3258. exports.error = error;
  3259. /**
  3260. * Adds a warning issue
  3261. * @param message warning issue message. Errors will be converted to string via toString()
  3262. * @param properties optional properties to add to the annotation.
  3263. */
  3264. function warning(message, properties = {}) {
  3265. command_1.issueCommand('warning', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
  3266. }
  3267. exports.warning = warning;
  3268. /**
  3269. * Adds a notice issue
  3270. * @param message notice issue message. Errors will be converted to string via toString()
  3271. * @param properties optional properties to add to the annotation.
  3272. */
  3273. function notice(message, properties = {}) {
  3274. command_1.issueCommand('notice', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
  3275. }
  3276. exports.notice = notice;
  3277. /**
  3278. * Writes info to log with console.log.
  3279. * @param message info message
  3280. */
  3281. function info(message) {
  3282. process.stdout.write(message + os.EOL);
  3283. }
  3284. exports.info = info;
  3285. /**
  3286. * Begin an output group.
  3287. *
  3288. * Output until the next `groupEnd` will be foldable in this group
  3289. *
  3290. * @param name The name of the output group
  3291. */
  3292. function startGroup(name) {
  3293. command_1.issue('group', name);
  3294. }
  3295. exports.startGroup = startGroup;
  3296. /**
  3297. * End an output group.
  3298. */
  3299. function endGroup() {
  3300. command_1.issue('endgroup');
  3301. }
  3302. exports.endGroup = endGroup;
  3303. /**
  3304. * Wrap an asynchronous function call in a group.
  3305. *
  3306. * Returns the same type as the function itself.
  3307. *
  3308. * @param name The name of the group
  3309. * @param fn The function to wrap in the group
  3310. */
  3311. function group(name, fn) {
  3312. return __awaiter(this, void 0, void 0, function* () {
  3313. startGroup(name);
  3314. let result;
  3315. try {
  3316. result = yield fn();
  3317. }
  3318. finally {
  3319. endGroup();
  3320. }
  3321. return result;
  3322. });
  3323. }
  3324. exports.group = group;
  3325. //-----------------------------------------------------------------------
  3326. // Wrapper action state
  3327. //-----------------------------------------------------------------------
  3328. /**
  3329. * Saves state for current action, the state can only be retrieved by this action's post job execution.
  3330. *
  3331. * @param name name of the state to store
  3332. * @param value value to store. Non-string values will be converted to a string via JSON.stringify
  3333. */
  3334. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  3335. function saveState(name, value) {
  3336. const filePath = process.env['GITHUB_STATE'] || '';
  3337. if (filePath) {
  3338. return file_command_1.issueFileCommand('STATE', file_command_1.prepareKeyValueMessage(name, value));
  3339. }
  3340. command_1.issueCommand('save-state', { name }, utils_1.toCommandValue(value));
  3341. }
  3342. exports.saveState = saveState;
  3343. /**
  3344. * Gets the value of an state set by this action's main execution.
  3345. *
  3346. * @param name name of the state to get
  3347. * @returns string
  3348. */
  3349. function getState(name) {
  3350. return process.env[`STATE_${name}`] || '';
  3351. }
  3352. exports.getState = getState;
  3353. function getIDToken(aud) {
  3354. return __awaiter(this, void 0, void 0, function* () {
  3355. return yield oidc_utils_1.OidcClient.getIDToken(aud);
  3356. });
  3357. }
  3358. exports.getIDToken = getIDToken;
  3359. /**
  3360. * Summary exports
  3361. */
  3362. var summary_1 = __nccwpck_require__(1327);
  3363. Object.defineProperty(exports, "summary", ({ enumerable: true, get: function () { return summary_1.summary; } }));
  3364. /**
  3365. * @deprecated use core.summary
  3366. */
  3367. var summary_2 = __nccwpck_require__(1327);
  3368. Object.defineProperty(exports, "markdownSummary", ({ enumerable: true, get: function () { return summary_2.markdownSummary; } }));
  3369. /**
  3370. * Path exports
  3371. */
  3372. var path_utils_1 = __nccwpck_require__(2981);
  3373. Object.defineProperty(exports, "toPosixPath", ({ enumerable: true, get: function () { return path_utils_1.toPosixPath; } }));
  3374. Object.defineProperty(exports, "toWin32Path", ({ enumerable: true, get: function () { return path_utils_1.toWin32Path; } }));
  3375. Object.defineProperty(exports, "toPlatformPath", ({ enumerable: true, get: function () { return path_utils_1.toPlatformPath; } }));
  3376. //# sourceMappingURL=core.js.map
  3377. /***/ }),
  3378. /***/ 717:
  3379. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  3380. "use strict";
  3381. // For internal use, subject to change.
  3382. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  3383. if (k2 === undefined) k2 = k;
  3384. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  3385. }) : (function(o, m, k, k2) {
  3386. if (k2 === undefined) k2 = k;
  3387. o[k2] = m[k];
  3388. }));
  3389. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  3390. Object.defineProperty(o, "default", { enumerable: true, value: v });
  3391. }) : function(o, v) {
  3392. o["default"] = v;
  3393. });
  3394. var __importStar = (this && this.__importStar) || function (mod) {
  3395. if (mod && mod.__esModule) return mod;
  3396. var result = {};
  3397. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  3398. __setModuleDefault(result, mod);
  3399. return result;
  3400. };
  3401. Object.defineProperty(exports, "__esModule", ({ value: true }));
  3402. exports.prepareKeyValueMessage = exports.issueFileCommand = void 0;
  3403. // We use any as a valid input type
  3404. /* eslint-disable @typescript-eslint/no-explicit-any */
  3405. const fs = __importStar(__nccwpck_require__(7147));
  3406. const os = __importStar(__nccwpck_require__(2037));
  3407. const uuid_1 = __nccwpck_require__(8974);
  3408. const utils_1 = __nccwpck_require__(5278);
  3409. function issueFileCommand(command, message) {
  3410. const filePath = process.env[`GITHUB_${command}`];
  3411. if (!filePath) {
  3412. throw new Error(`Unable to find environment variable for file command ${command}`);
  3413. }
  3414. if (!fs.existsSync(filePath)) {
  3415. throw new Error(`Missing file at path: ${filePath}`);
  3416. }
  3417. fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {
  3418. encoding: 'utf8'
  3419. });
  3420. }
  3421. exports.issueFileCommand = issueFileCommand;
  3422. function prepareKeyValueMessage(key, value) {
  3423. const delimiter = `ghadelimiter_${uuid_1.v4()}`;
  3424. const convertedValue = utils_1.toCommandValue(value);
  3425. // These should realistically never happen, but just in case someone finds a
  3426. // way to exploit uuid generation let's not allow keys or values that contain
  3427. // the delimiter.
  3428. if (key.includes(delimiter)) {
  3429. throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`);
  3430. }
  3431. if (convertedValue.includes(delimiter)) {
  3432. throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`);
  3433. }
  3434. return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`;
  3435. }
  3436. exports.prepareKeyValueMessage = prepareKeyValueMessage;
  3437. //# sourceMappingURL=file-command.js.map
  3438. /***/ }),
  3439. /***/ 8041:
  3440. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  3441. "use strict";
  3442. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  3443. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  3444. return new (P || (P = Promise))(function (resolve, reject) {
  3445. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  3446. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  3447. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  3448. step((generator = generator.apply(thisArg, _arguments || [])).next());
  3449. });
  3450. };
  3451. Object.defineProperty(exports, "__esModule", ({ value: true }));
  3452. exports.OidcClient = void 0;
  3453. const http_client_1 = __nccwpck_require__(6255);
  3454. const auth_1 = __nccwpck_require__(5526);
  3455. const core_1 = __nccwpck_require__(2186);
  3456. class OidcClient {
  3457. static createHttpClient(allowRetry = true, maxRetry = 10) {
  3458. const requestOptions = {
  3459. allowRetries: allowRetry,
  3460. maxRetries: maxRetry
  3461. };
  3462. return new http_client_1.HttpClient('actions/oidc-client', [new auth_1.BearerCredentialHandler(OidcClient.getRequestToken())], requestOptions);
  3463. }
  3464. static getRequestToken() {
  3465. const token = process.env['ACTIONS_ID_TOKEN_REQUEST_TOKEN'];
  3466. if (!token) {
  3467. throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable');
  3468. }
  3469. return token;
  3470. }
  3471. static getIDTokenUrl() {
  3472. const runtimeUrl = process.env['ACTIONS_ID_TOKEN_REQUEST_URL'];
  3473. if (!runtimeUrl) {
  3474. throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable');
  3475. }
  3476. return runtimeUrl;
  3477. }
  3478. static getCall(id_token_url) {
  3479. var _a;
  3480. return __awaiter(this, void 0, void 0, function* () {
  3481. const httpclient = OidcClient.createHttpClient();
  3482. const res = yield httpclient
  3483. .getJson(id_token_url)
  3484. .catch(error => {
  3485. throw new Error(`Failed to get ID Token. \n
  3486. Error Code : ${error.statusCode}\n
  3487. Error Message: ${error.message}`);
  3488. });
  3489. const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value;
  3490. if (!id_token) {
  3491. throw new Error('Response json body do not have ID Token field');
  3492. }
  3493. return id_token;
  3494. });
  3495. }
  3496. static getIDToken(audience) {
  3497. return __awaiter(this, void 0, void 0, function* () {
  3498. try {
  3499. // New ID Token is requested from action service
  3500. let id_token_url = OidcClient.getIDTokenUrl();
  3501. if (audience) {
  3502. const encodedAudience = encodeURIComponent(audience);
  3503. id_token_url = `${id_token_url}&audience=${encodedAudience}`;
  3504. }
  3505. core_1.debug(`ID token url is ${id_token_url}`);
  3506. const id_token = yield OidcClient.getCall(id_token_url);
  3507. core_1.setSecret(id_token);
  3508. return id_token;
  3509. }
  3510. catch (error) {
  3511. throw new Error(`Error message: ${error.message}`);
  3512. }
  3513. });
  3514. }
  3515. }
  3516. exports.OidcClient = OidcClient;
  3517. //# sourceMappingURL=oidc-utils.js.map
  3518. /***/ }),
  3519. /***/ 2981:
  3520. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  3521. "use strict";
  3522. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  3523. if (k2 === undefined) k2 = k;
  3524. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  3525. }) : (function(o, m, k, k2) {
  3526. if (k2 === undefined) k2 = k;
  3527. o[k2] = m[k];
  3528. }));
  3529. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  3530. Object.defineProperty(o, "default", { enumerable: true, value: v });
  3531. }) : function(o, v) {
  3532. o["default"] = v;
  3533. });
  3534. var __importStar = (this && this.__importStar) || function (mod) {
  3535. if (mod && mod.__esModule) return mod;
  3536. var result = {};
  3537. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  3538. __setModuleDefault(result, mod);
  3539. return result;
  3540. };
  3541. Object.defineProperty(exports, "__esModule", ({ value: true }));
  3542. exports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = void 0;
  3543. const path = __importStar(__nccwpck_require__(1017));
  3544. /**
  3545. * toPosixPath converts the given path to the posix form. On Windows, \\ will be
  3546. * replaced with /.
  3547. *
  3548. * @param pth. Path to transform.
  3549. * @return string Posix path.
  3550. */
  3551. function toPosixPath(pth) {
  3552. return pth.replace(/[\\]/g, '/');
  3553. }
  3554. exports.toPosixPath = toPosixPath;
  3555. /**
  3556. * toWin32Path converts the given path to the win32 form. On Linux, / will be
  3557. * replaced with \\.
  3558. *
  3559. * @param pth. Path to transform.
  3560. * @return string Win32 path.
  3561. */
  3562. function toWin32Path(pth) {
  3563. return pth.replace(/[/]/g, '\\');
  3564. }
  3565. exports.toWin32Path = toWin32Path;
  3566. /**
  3567. * toPlatformPath converts the given path to a platform-specific path. It does
  3568. * this by replacing instances of / and \ with the platform-specific path
  3569. * separator.
  3570. *
  3571. * @param pth The path to platformize.
  3572. * @return string The platform-specific path.
  3573. */
  3574. function toPlatformPath(pth) {
  3575. return pth.replace(/[/\\]/g, path.sep);
  3576. }
  3577. exports.toPlatformPath = toPlatformPath;
  3578. //# sourceMappingURL=path-utils.js.map
  3579. /***/ }),
  3580. /***/ 1327:
  3581. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  3582. "use strict";
  3583. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  3584. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  3585. return new (P || (P = Promise))(function (resolve, reject) {
  3586. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  3587. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  3588. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  3589. step((generator = generator.apply(thisArg, _arguments || [])).next());
  3590. });
  3591. };
  3592. Object.defineProperty(exports, "__esModule", ({ value: true }));
  3593. exports.summary = exports.markdownSummary = exports.SUMMARY_DOCS_URL = exports.SUMMARY_ENV_VAR = void 0;
  3594. const os_1 = __nccwpck_require__(2037);
  3595. const fs_1 = __nccwpck_require__(7147);
  3596. const { access, appendFile, writeFile } = fs_1.promises;
  3597. exports.SUMMARY_ENV_VAR = 'GITHUB_STEP_SUMMARY';
  3598. exports.SUMMARY_DOCS_URL = 'https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary';
  3599. class Summary {
  3600. constructor() {
  3601. this._buffer = '';
  3602. }
  3603. /**
  3604. * Finds the summary file path from the environment, rejects if env var is not found or file does not exist
  3605. * Also checks r/w permissions.
  3606. *
  3607. * @returns step summary file path
  3608. */
  3609. filePath() {
  3610. return __awaiter(this, void 0, void 0, function* () {
  3611. if (this._filePath) {
  3612. return this._filePath;
  3613. }
  3614. const pathFromEnv = process.env[exports.SUMMARY_ENV_VAR];
  3615. if (!pathFromEnv) {
  3616. throw new Error(`Unable to find environment variable for $${exports.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);
  3617. }
  3618. try {
  3619. yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK);
  3620. }
  3621. catch (_a) {
  3622. throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`);
  3623. }
  3624. this._filePath = pathFromEnv;
  3625. return this._filePath;
  3626. });
  3627. }
  3628. /**
  3629. * Wraps content in an HTML tag, adding any HTML attributes
  3630. *
  3631. * @param {string} tag HTML tag to wrap
  3632. * @param {string | null} content content within the tag
  3633. * @param {[attribute: string]: string} attrs key-value list of HTML attributes to add
  3634. *
  3635. * @returns {string} content wrapped in HTML element
  3636. */
  3637. wrap(tag, content, attrs = {}) {
  3638. const htmlAttrs = Object.entries(attrs)
  3639. .map(([key, value]) => ` ${key}="${value}"`)
  3640. .join('');
  3641. if (!content) {
  3642. return `<${tag}${htmlAttrs}>`;
  3643. }
  3644. return `<${tag}${htmlAttrs}>${content}</${tag}>`;
  3645. }
  3646. /**
  3647. * Writes text in the buffer to the summary buffer file and empties buffer. Will append by default.
  3648. *
  3649. * @param {SummaryWriteOptions} [options] (optional) options for write operation
  3650. *
  3651. * @returns {Promise<Summary>} summary instance
  3652. */
  3653. write(options) {
  3654. return __awaiter(this, void 0, void 0, function* () {
  3655. const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite);
  3656. const filePath = yield this.filePath();
  3657. const writeFunc = overwrite ? writeFile : appendFile;
  3658. yield writeFunc(filePath, this._buffer, { encoding: 'utf8' });
  3659. return this.emptyBuffer();
  3660. });
  3661. }
  3662. /**
  3663. * Clears the summary buffer and wipes the summary file
  3664. *
  3665. * @returns {Summary} summary instance
  3666. */
  3667. clear() {
  3668. return __awaiter(this, void 0, void 0, function* () {
  3669. return this.emptyBuffer().write({ overwrite: true });
  3670. });
  3671. }
  3672. /**
  3673. * Returns the current summary buffer as a string
  3674. *
  3675. * @returns {string} string of summary buffer
  3676. */
  3677. stringify() {
  3678. return this._buffer;
  3679. }
  3680. /**
  3681. * If the summary buffer is empty
  3682. *
  3683. * @returns {boolen} true if the buffer is empty
  3684. */
  3685. isEmptyBuffer() {
  3686. return this._buffer.length === 0;
  3687. }
  3688. /**
  3689. * Resets the summary buffer without writing to summary file
  3690. *
  3691. * @returns {Summary} summary instance
  3692. */
  3693. emptyBuffer() {
  3694. this._buffer = '';
  3695. return this;
  3696. }
  3697. /**
  3698. * Adds raw text to the summary buffer
  3699. *
  3700. * @param {string} text content to add
  3701. * @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false)
  3702. *
  3703. * @returns {Summary} summary instance
  3704. */
  3705. addRaw(text, addEOL = false) {
  3706. this._buffer += text;
  3707. return addEOL ? this.addEOL() : this;
  3708. }
  3709. /**
  3710. * Adds the operating system-specific end-of-line marker to the buffer
  3711. *
  3712. * @returns {Summary} summary instance
  3713. */
  3714. addEOL() {
  3715. return this.addRaw(os_1.EOL);
  3716. }
  3717. /**
  3718. * Adds an HTML codeblock to the summary buffer
  3719. *
  3720. * @param {string} code content to render within fenced code block
  3721. * @param {string} lang (optional) language to syntax highlight code
  3722. *
  3723. * @returns {Summary} summary instance
  3724. */
  3725. addCodeBlock(code, lang) {
  3726. const attrs = Object.assign({}, (lang && { lang }));
  3727. const element = this.wrap('pre', this.wrap('code', code), attrs);
  3728. return this.addRaw(element).addEOL();
  3729. }
  3730. /**
  3731. * Adds an HTML list to the summary buffer
  3732. *
  3733. * @param {string[]} items list of items to render
  3734. * @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false)
  3735. *
  3736. * @returns {Summary} summary instance
  3737. */
  3738. addList(items, ordered = false) {
  3739. const tag = ordered ? 'ol' : 'ul';
  3740. const listItems = items.map(item => this.wrap('li', item)).join('');
  3741. const element = this.wrap(tag, listItems);
  3742. return this.addRaw(element).addEOL();
  3743. }
  3744. /**
  3745. * Adds an HTML table to the summary buffer
  3746. *
  3747. * @param {SummaryTableCell[]} rows table rows
  3748. *
  3749. * @returns {Summary} summary instance
  3750. */
  3751. addTable(rows) {
  3752. const tableBody = rows
  3753. .map(row => {
  3754. const cells = row
  3755. .map(cell => {
  3756. if (typeof cell === 'string') {
  3757. return this.wrap('td', cell);
  3758. }
  3759. const { header, data, colspan, rowspan } = cell;
  3760. const tag = header ? 'th' : 'td';
  3761. const attrs = Object.assign(Object.assign({}, (colspan && { colspan })), (rowspan && { rowspan }));
  3762. return this.wrap(tag, data, attrs);
  3763. })
  3764. .join('');
  3765. return this.wrap('tr', cells);
  3766. })
  3767. .join('');
  3768. const element = this.wrap('table', tableBody);
  3769. return this.addRaw(element).addEOL();
  3770. }
  3771. /**
  3772. * Adds a collapsable HTML details element to the summary buffer
  3773. *
  3774. * @param {string} label text for the closed state
  3775. * @param {string} content collapsable content
  3776. *
  3777. * @returns {Summary} summary instance
  3778. */
  3779. addDetails(label, content) {
  3780. const element = this.wrap('details', this.wrap('summary', label) + content);
  3781. return this.addRaw(element).addEOL();
  3782. }
  3783. /**
  3784. * Adds an HTML image tag to the summary buffer
  3785. *
  3786. * @param {string} src path to the image you to embed
  3787. * @param {string} alt text description of the image
  3788. * @param {SummaryImageOptions} options (optional) addition image attributes
  3789. *
  3790. * @returns {Summary} summary instance
  3791. */
  3792. addImage(src, alt, options) {
  3793. const { width, height } = options || {};
  3794. const attrs = Object.assign(Object.assign({}, (width && { width })), (height && { height }));
  3795. const element = this.wrap('img', null, Object.assign({ src, alt }, attrs));
  3796. return this.addRaw(element).addEOL();
  3797. }
  3798. /**
  3799. * Adds an HTML section heading element
  3800. *
  3801. * @param {string} text heading text
  3802. * @param {number | string} [level=1] (optional) the heading level, default: 1
  3803. *
  3804. * @returns {Summary} summary instance
  3805. */
  3806. addHeading(text, level) {
  3807. const tag = `h${level}`;
  3808. const allowedTag = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(tag)
  3809. ? tag
  3810. : 'h1';
  3811. const element = this.wrap(allowedTag, text);
  3812. return this.addRaw(element).addEOL();
  3813. }
  3814. /**
  3815. * Adds an HTML thematic break (<hr>) to the summary buffer
  3816. *
  3817. * @returns {Summary} summary instance
  3818. */
  3819. addSeparator() {
  3820. const element = this.wrap('hr', null);
  3821. return this.addRaw(element).addEOL();
  3822. }
  3823. /**
  3824. * Adds an HTML line break (<br>) to the summary buffer
  3825. *
  3826. * @returns {Summary} summary instance
  3827. */
  3828. addBreak() {
  3829. const element = this.wrap('br', null);
  3830. return this.addRaw(element).addEOL();
  3831. }
  3832. /**
  3833. * Adds an HTML blockquote to the summary buffer
  3834. *
  3835. * @param {string} text quote text
  3836. * @param {string} cite (optional) citation url
  3837. *
  3838. * @returns {Summary} summary instance
  3839. */
  3840. addQuote(text, cite) {
  3841. const attrs = Object.assign({}, (cite && { cite }));
  3842. const element = this.wrap('blockquote', text, attrs);
  3843. return this.addRaw(element).addEOL();
  3844. }
  3845. /**
  3846. * Adds an HTML anchor tag to the summary buffer
  3847. *
  3848. * @param {string} text link text/content
  3849. * @param {string} href hyperlink
  3850. *
  3851. * @returns {Summary} summary instance
  3852. */
  3853. addLink(text, href) {
  3854. const element = this.wrap('a', text, { href });
  3855. return this.addRaw(element).addEOL();
  3856. }
  3857. }
  3858. const _summary = new Summary();
  3859. /**
  3860. * @deprecated use `core.summary`
  3861. */
  3862. exports.markdownSummary = _summary;
  3863. exports.summary = _summary;
  3864. //# sourceMappingURL=summary.js.map
  3865. /***/ }),
  3866. /***/ 5278:
  3867. /***/ ((__unused_webpack_module, exports) => {
  3868. "use strict";
  3869. // We use any as a valid input type
  3870. /* eslint-disable @typescript-eslint/no-explicit-any */
  3871. Object.defineProperty(exports, "__esModule", ({ value: true }));
  3872. exports.toCommandProperties = exports.toCommandValue = void 0;
  3873. /**
  3874. * Sanitizes an input into a string so it can be passed into issueCommand safely
  3875. * @param input input to sanitize into a string
  3876. */
  3877. function toCommandValue(input) {
  3878. if (input === null || input === undefined) {
  3879. return '';
  3880. }
  3881. else if (typeof input === 'string' || input instanceof String) {
  3882. return input;
  3883. }
  3884. return JSON.stringify(input);
  3885. }
  3886. exports.toCommandValue = toCommandValue;
  3887. /**
  3888. *
  3889. * @param annotationProperties
  3890. * @returns The command properties to send with the actual annotation command
  3891. * See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646
  3892. */
  3893. function toCommandProperties(annotationProperties) {
  3894. if (!Object.keys(annotationProperties).length) {
  3895. return {};
  3896. }
  3897. return {
  3898. title: annotationProperties.title,
  3899. file: annotationProperties.file,
  3900. line: annotationProperties.startLine,
  3901. endLine: annotationProperties.endLine,
  3902. col: annotationProperties.startColumn,
  3903. endColumn: annotationProperties.endColumn
  3904. };
  3905. }
  3906. exports.toCommandProperties = toCommandProperties;
  3907. //# sourceMappingURL=utils.js.map
  3908. /***/ }),
  3909. /***/ 8974:
  3910. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3911. "use strict";
  3912. Object.defineProperty(exports, "__esModule", ({
  3913. value: true
  3914. }));
  3915. Object.defineProperty(exports, "v1", ({
  3916. enumerable: true,
  3917. get: function () {
  3918. return _v.default;
  3919. }
  3920. }));
  3921. Object.defineProperty(exports, "v3", ({
  3922. enumerable: true,
  3923. get: function () {
  3924. return _v2.default;
  3925. }
  3926. }));
  3927. Object.defineProperty(exports, "v4", ({
  3928. enumerable: true,
  3929. get: function () {
  3930. return _v3.default;
  3931. }
  3932. }));
  3933. Object.defineProperty(exports, "v5", ({
  3934. enumerable: true,
  3935. get: function () {
  3936. return _v4.default;
  3937. }
  3938. }));
  3939. Object.defineProperty(exports, "NIL", ({
  3940. enumerable: true,
  3941. get: function () {
  3942. return _nil.default;
  3943. }
  3944. }));
  3945. Object.defineProperty(exports, "version", ({
  3946. enumerable: true,
  3947. get: function () {
  3948. return _version.default;
  3949. }
  3950. }));
  3951. Object.defineProperty(exports, "validate", ({
  3952. enumerable: true,
  3953. get: function () {
  3954. return _validate.default;
  3955. }
  3956. }));
  3957. Object.defineProperty(exports, "stringify", ({
  3958. enumerable: true,
  3959. get: function () {
  3960. return _stringify.default;
  3961. }
  3962. }));
  3963. Object.defineProperty(exports, "parse", ({
  3964. enumerable: true,
  3965. get: function () {
  3966. return _parse.default;
  3967. }
  3968. }));
  3969. var _v = _interopRequireDefault(__nccwpck_require__(1595));
  3970. var _v2 = _interopRequireDefault(__nccwpck_require__(6993));
  3971. var _v3 = _interopRequireDefault(__nccwpck_require__(1472));
  3972. var _v4 = _interopRequireDefault(__nccwpck_require__(6217));
  3973. var _nil = _interopRequireDefault(__nccwpck_require__(2381));
  3974. var _version = _interopRequireDefault(__nccwpck_require__(427));
  3975. var _validate = _interopRequireDefault(__nccwpck_require__(2609));
  3976. var _stringify = _interopRequireDefault(__nccwpck_require__(1458));
  3977. var _parse = _interopRequireDefault(__nccwpck_require__(6385));
  3978. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3979. /***/ }),
  3980. /***/ 5842:
  3981. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  3982. "use strict";
  3983. Object.defineProperty(exports, "__esModule", ({
  3984. value: true
  3985. }));
  3986. exports["default"] = void 0;
  3987. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  3988. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3989. function md5(bytes) {
  3990. if (Array.isArray(bytes)) {
  3991. bytes = Buffer.from(bytes);
  3992. } else if (typeof bytes === 'string') {
  3993. bytes = Buffer.from(bytes, 'utf8');
  3994. }
  3995. return _crypto.default.createHash('md5').update(bytes).digest();
  3996. }
  3997. var _default = md5;
  3998. exports["default"] = _default;
  3999. /***/ }),
  4000. /***/ 2381:
  4001. /***/ ((__unused_webpack_module, exports) => {
  4002. "use strict";
  4003. Object.defineProperty(exports, "__esModule", ({
  4004. value: true
  4005. }));
  4006. exports["default"] = void 0;
  4007. var _default = '00000000-0000-0000-0000-000000000000';
  4008. exports["default"] = _default;
  4009. /***/ }),
  4010. /***/ 6385:
  4011. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  4012. "use strict";
  4013. Object.defineProperty(exports, "__esModule", ({
  4014. value: true
  4015. }));
  4016. exports["default"] = void 0;
  4017. var _validate = _interopRequireDefault(__nccwpck_require__(2609));
  4018. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4019. function parse(uuid) {
  4020. if (!(0, _validate.default)(uuid)) {
  4021. throw TypeError('Invalid UUID');
  4022. }
  4023. let v;
  4024. const arr = new Uint8Array(16); // Parse ########-....-....-....-............
  4025. arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;
  4026. arr[1] = v >>> 16 & 0xff;
  4027. arr[2] = v >>> 8 & 0xff;
  4028. arr[3] = v & 0xff; // Parse ........-####-....-....-............
  4029. arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;
  4030. arr[5] = v & 0xff; // Parse ........-....-####-....-............
  4031. arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;
  4032. arr[7] = v & 0xff; // Parse ........-....-....-####-............
  4033. arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;
  4034. arr[9] = v & 0xff; // Parse ........-....-....-....-############
  4035. // (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes)
  4036. arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;
  4037. arr[11] = v / 0x100000000 & 0xff;
  4038. arr[12] = v >>> 24 & 0xff;
  4039. arr[13] = v >>> 16 & 0xff;
  4040. arr[14] = v >>> 8 & 0xff;
  4041. arr[15] = v & 0xff;
  4042. return arr;
  4043. }
  4044. var _default = parse;
  4045. exports["default"] = _default;
  4046. /***/ }),
  4047. /***/ 6230:
  4048. /***/ ((__unused_webpack_module, exports) => {
  4049. "use strict";
  4050. Object.defineProperty(exports, "__esModule", ({
  4051. value: true
  4052. }));
  4053. exports["default"] = void 0;
  4054. 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;
  4055. exports["default"] = _default;
  4056. /***/ }),
  4057. /***/ 9784:
  4058. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  4059. "use strict";
  4060. Object.defineProperty(exports, "__esModule", ({
  4061. value: true
  4062. }));
  4063. exports["default"] = rng;
  4064. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  4065. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4066. const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate
  4067. let poolPtr = rnds8Pool.length;
  4068. function rng() {
  4069. if (poolPtr > rnds8Pool.length - 16) {
  4070. _crypto.default.randomFillSync(rnds8Pool);
  4071. poolPtr = 0;
  4072. }
  4073. return rnds8Pool.slice(poolPtr, poolPtr += 16);
  4074. }
  4075. /***/ }),
  4076. /***/ 8844:
  4077. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  4078. "use strict";
  4079. Object.defineProperty(exports, "__esModule", ({
  4080. value: true
  4081. }));
  4082. exports["default"] = void 0;
  4083. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  4084. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4085. function sha1(bytes) {
  4086. if (Array.isArray(bytes)) {
  4087. bytes = Buffer.from(bytes);
  4088. } else if (typeof bytes === 'string') {
  4089. bytes = Buffer.from(bytes, 'utf8');
  4090. }
  4091. return _crypto.default.createHash('sha1').update(bytes).digest();
  4092. }
  4093. var _default = sha1;
  4094. exports["default"] = _default;
  4095. /***/ }),
  4096. /***/ 1458:
  4097. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  4098. "use strict";
  4099. Object.defineProperty(exports, "__esModule", ({
  4100. value: true
  4101. }));
  4102. exports["default"] = void 0;
  4103. var _validate = _interopRequireDefault(__nccwpck_require__(2609));
  4104. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4105. /**
  4106. * Convert array of 16 byte values to UUID string format of the form:
  4107. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  4108. */
  4109. const byteToHex = [];
  4110. for (let i = 0; i < 256; ++i) {
  4111. byteToHex.push((i + 0x100).toString(16).substr(1));
  4112. }
  4113. function stringify(arr, offset = 0) {
  4114. // Note: Be careful editing this code! It's been tuned for performance
  4115. // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
  4116. 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
  4117. // of the following:
  4118. // - One or more input array values don't map to a hex octet (leading to
  4119. // "undefined" in the uuid)
  4120. // - Invalid input values for the RFC `version` or `variant` fields
  4121. if (!(0, _validate.default)(uuid)) {
  4122. throw TypeError('Stringified UUID is invalid');
  4123. }
  4124. return uuid;
  4125. }
  4126. var _default = stringify;
  4127. exports["default"] = _default;
  4128. /***/ }),
  4129. /***/ 1595:
  4130. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  4131. "use strict";
  4132. Object.defineProperty(exports, "__esModule", ({
  4133. value: true
  4134. }));
  4135. exports["default"] = void 0;
  4136. var _rng = _interopRequireDefault(__nccwpck_require__(9784));
  4137. var _stringify = _interopRequireDefault(__nccwpck_require__(1458));
  4138. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4139. // **`v1()` - Generate time-based UUID**
  4140. //
  4141. // Inspired by https://github.com/LiosK/UUID.js
  4142. // and http://docs.python.org/library/uuid.html
  4143. let _nodeId;
  4144. let _clockseq; // Previous uuid creation time
  4145. let _lastMSecs = 0;
  4146. let _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details
  4147. function v1(options, buf, offset) {
  4148. let i = buf && offset || 0;
  4149. const b = buf || new Array(16);
  4150. options = options || {};
  4151. let node = options.node || _nodeId;
  4152. let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not
  4153. // specified. We do this lazily to minimize issues related to insufficient
  4154. // system entropy. See #189
  4155. if (node == null || clockseq == null) {
  4156. const seedBytes = options.random || (options.rng || _rng.default)();
  4157. if (node == null) {
  4158. // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
  4159. node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];
  4160. }
  4161. if (clockseq == null) {
  4162. // Per 4.2.2, randomize (14 bit) clockseq
  4163. clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
  4164. }
  4165. } // UUID timestamps are 100 nano-second units since the Gregorian epoch,
  4166. // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
  4167. // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
  4168. // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
  4169. let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock
  4170. // cycle to simulate higher resolution clock
  4171. let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)
  4172. const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression
  4173. if (dt < 0 && options.clockseq === undefined) {
  4174. clockseq = clockseq + 1 & 0x3fff;
  4175. } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
  4176. // time interval
  4177. if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
  4178. nsecs = 0;
  4179. } // Per 4.2.1.2 Throw error if too many uuids are requested
  4180. if (nsecs >= 10000) {
  4181. throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");
  4182. }
  4183. _lastMSecs = msecs;
  4184. _lastNSecs = nsecs;
  4185. _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
  4186. msecs += 12219292800000; // `time_low`
  4187. const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
  4188. b[i++] = tl >>> 24 & 0xff;
  4189. b[i++] = tl >>> 16 & 0xff;
  4190. b[i++] = tl >>> 8 & 0xff;
  4191. b[i++] = tl & 0xff; // `time_mid`
  4192. const tmh = msecs / 0x100000000 * 10000 & 0xfffffff;
  4193. b[i++] = tmh >>> 8 & 0xff;
  4194. b[i++] = tmh & 0xff; // `time_high_and_version`
  4195. b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
  4196. b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
  4197. b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`
  4198. b[i++] = clockseq & 0xff; // `node`
  4199. for (let n = 0; n < 6; ++n) {
  4200. b[i + n] = node[n];
  4201. }
  4202. return buf || (0, _stringify.default)(b);
  4203. }
  4204. var _default = v1;
  4205. exports["default"] = _default;
  4206. /***/ }),
  4207. /***/ 6993:
  4208. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  4209. "use strict";
  4210. Object.defineProperty(exports, "__esModule", ({
  4211. value: true
  4212. }));
  4213. exports["default"] = void 0;
  4214. var _v = _interopRequireDefault(__nccwpck_require__(5920));
  4215. var _md = _interopRequireDefault(__nccwpck_require__(5842));
  4216. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4217. const v3 = (0, _v.default)('v3', 0x30, _md.default);
  4218. var _default = v3;
  4219. exports["default"] = _default;
  4220. /***/ }),
  4221. /***/ 5920:
  4222. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  4223. "use strict";
  4224. Object.defineProperty(exports, "__esModule", ({
  4225. value: true
  4226. }));
  4227. exports["default"] = _default;
  4228. exports.URL = exports.DNS = void 0;
  4229. var _stringify = _interopRequireDefault(__nccwpck_require__(1458));
  4230. var _parse = _interopRequireDefault(__nccwpck_require__(6385));
  4231. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4232. function stringToBytes(str) {
  4233. str = unescape(encodeURIComponent(str)); // UTF8 escape
  4234. const bytes = [];
  4235. for (let i = 0; i < str.length; ++i) {
  4236. bytes.push(str.charCodeAt(i));
  4237. }
  4238. return bytes;
  4239. }
  4240. const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
  4241. exports.DNS = DNS;
  4242. const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';
  4243. exports.URL = URL;
  4244. function _default(name, version, hashfunc) {
  4245. function generateUUID(value, namespace, buf, offset) {
  4246. if (typeof value === 'string') {
  4247. value = stringToBytes(value);
  4248. }
  4249. if (typeof namespace === 'string') {
  4250. namespace = (0, _parse.default)(namespace);
  4251. }
  4252. if (namespace.length !== 16) {
  4253. throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');
  4254. } // Compute hash of namespace and value, Per 4.3
  4255. // Future: Use spread syntax when supported on all platforms, e.g. `bytes =
  4256. // hashfunc([...namespace, ... value])`
  4257. let bytes = new Uint8Array(16 + value.length);
  4258. bytes.set(namespace);
  4259. bytes.set(value, namespace.length);
  4260. bytes = hashfunc(bytes);
  4261. bytes[6] = bytes[6] & 0x0f | version;
  4262. bytes[8] = bytes[8] & 0x3f | 0x80;
  4263. if (buf) {
  4264. offset = offset || 0;
  4265. for (let i = 0; i < 16; ++i) {
  4266. buf[offset + i] = bytes[i];
  4267. }
  4268. return buf;
  4269. }
  4270. return (0, _stringify.default)(bytes);
  4271. } // Function#name is not settable on some platforms (#270)
  4272. try {
  4273. generateUUID.name = name; // eslint-disable-next-line no-empty
  4274. } catch (err) {} // For CommonJS default export support
  4275. generateUUID.DNS = DNS;
  4276. generateUUID.URL = URL;
  4277. return generateUUID;
  4278. }
  4279. /***/ }),
  4280. /***/ 1472:
  4281. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  4282. "use strict";
  4283. Object.defineProperty(exports, "__esModule", ({
  4284. value: true
  4285. }));
  4286. exports["default"] = void 0;
  4287. var _rng = _interopRequireDefault(__nccwpck_require__(9784));
  4288. var _stringify = _interopRequireDefault(__nccwpck_require__(1458));
  4289. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4290. function v4(options, buf, offset) {
  4291. options = options || {};
  4292. const rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  4293. rnds[6] = rnds[6] & 0x0f | 0x40;
  4294. rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
  4295. if (buf) {
  4296. offset = offset || 0;
  4297. for (let i = 0; i < 16; ++i) {
  4298. buf[offset + i] = rnds[i];
  4299. }
  4300. return buf;
  4301. }
  4302. return (0, _stringify.default)(rnds);
  4303. }
  4304. var _default = v4;
  4305. exports["default"] = _default;
  4306. /***/ }),
  4307. /***/ 6217:
  4308. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  4309. "use strict";
  4310. Object.defineProperty(exports, "__esModule", ({
  4311. value: true
  4312. }));
  4313. exports["default"] = void 0;
  4314. var _v = _interopRequireDefault(__nccwpck_require__(5920));
  4315. var _sha = _interopRequireDefault(__nccwpck_require__(8844));
  4316. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4317. const v5 = (0, _v.default)('v5', 0x50, _sha.default);
  4318. var _default = v5;
  4319. exports["default"] = _default;
  4320. /***/ }),
  4321. /***/ 2609:
  4322. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  4323. "use strict";
  4324. Object.defineProperty(exports, "__esModule", ({
  4325. value: true
  4326. }));
  4327. exports["default"] = void 0;
  4328. var _regex = _interopRequireDefault(__nccwpck_require__(6230));
  4329. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4330. function validate(uuid) {
  4331. return typeof uuid === 'string' && _regex.default.test(uuid);
  4332. }
  4333. var _default = validate;
  4334. exports["default"] = _default;
  4335. /***/ }),
  4336. /***/ 427:
  4337. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  4338. "use strict";
  4339. Object.defineProperty(exports, "__esModule", ({
  4340. value: true
  4341. }));
  4342. exports["default"] = void 0;
  4343. var _validate = _interopRequireDefault(__nccwpck_require__(2609));
  4344. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4345. function version(uuid) {
  4346. if (!(0, _validate.default)(uuid)) {
  4347. throw TypeError('Invalid UUID');
  4348. }
  4349. return parseInt(uuid.substr(14, 1), 16);
  4350. }
  4351. var _default = version;
  4352. exports["default"] = _default;
  4353. /***/ }),
  4354. /***/ 1514:
  4355. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  4356. "use strict";
  4357. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  4358. if (k2 === undefined) k2 = k;
  4359. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  4360. }) : (function(o, m, k, k2) {
  4361. if (k2 === undefined) k2 = k;
  4362. o[k2] = m[k];
  4363. }));
  4364. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  4365. Object.defineProperty(o, "default", { enumerable: true, value: v });
  4366. }) : function(o, v) {
  4367. o["default"] = v;
  4368. });
  4369. var __importStar = (this && this.__importStar) || function (mod) {
  4370. if (mod && mod.__esModule) return mod;
  4371. var result = {};
  4372. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  4373. __setModuleDefault(result, mod);
  4374. return result;
  4375. };
  4376. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4377. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4378. return new (P || (P = Promise))(function (resolve, reject) {
  4379. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4380. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4381. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4382. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4383. });
  4384. };
  4385. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4386. exports.getExecOutput = exports.exec = void 0;
  4387. const string_decoder_1 = __nccwpck_require__(1576);
  4388. const tr = __importStar(__nccwpck_require__(8159));
  4389. /**
  4390. * Exec a command.
  4391. * Output will be streamed to the live console.
  4392. * Returns promise with return code
  4393. *
  4394. * @param commandLine command to execute (can include additional args). Must be correctly escaped.
  4395. * @param args optional arguments for tool. Escaping is handled by the lib.
  4396. * @param options optional exec options. See ExecOptions
  4397. * @returns Promise<number> exit code
  4398. */
  4399. function exec(commandLine, args, options) {
  4400. return __awaiter(this, void 0, void 0, function* () {
  4401. const commandArgs = tr.argStringToArray(commandLine);
  4402. if (commandArgs.length === 0) {
  4403. throw new Error(`Parameter 'commandLine' cannot be null or empty.`);
  4404. }
  4405. // Path to tool to execute should be first arg
  4406. const toolPath = commandArgs[0];
  4407. args = commandArgs.slice(1).concat(args || []);
  4408. const runner = new tr.ToolRunner(toolPath, args, options);
  4409. return runner.exec();
  4410. });
  4411. }
  4412. exports.exec = exec;
  4413. /**
  4414. * Exec a command and get the output.
  4415. * Output will be streamed to the live console.
  4416. * Returns promise with the exit code and collected stdout and stderr
  4417. *
  4418. * @param commandLine command to execute (can include additional args). Must be correctly escaped.
  4419. * @param args optional arguments for tool. Escaping is handled by the lib.
  4420. * @param options optional exec options. See ExecOptions
  4421. * @returns Promise<ExecOutput> exit code, stdout, and stderr
  4422. */
  4423. function getExecOutput(commandLine, args, options) {
  4424. var _a, _b;
  4425. return __awaiter(this, void 0, void 0, function* () {
  4426. let stdout = '';
  4427. let stderr = '';
  4428. //Using string decoder covers the case where a mult-byte character is split
  4429. const stdoutDecoder = new string_decoder_1.StringDecoder('utf8');
  4430. const stderrDecoder = new string_decoder_1.StringDecoder('utf8');
  4431. const originalStdoutListener = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.stdout;
  4432. const originalStdErrListener = (_b = options === null || options === void 0 ? void 0 : options.listeners) === null || _b === void 0 ? void 0 : _b.stderr;
  4433. const stdErrListener = (data) => {
  4434. stderr += stderrDecoder.write(data);
  4435. if (originalStdErrListener) {
  4436. originalStdErrListener(data);
  4437. }
  4438. };
  4439. const stdOutListener = (data) => {
  4440. stdout += stdoutDecoder.write(data);
  4441. if (originalStdoutListener) {
  4442. originalStdoutListener(data);
  4443. }
  4444. };
  4445. const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener });
  4446. const exitCode = yield exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners }));
  4447. //flush any remaining characters
  4448. stdout += stdoutDecoder.end();
  4449. stderr += stderrDecoder.end();
  4450. return {
  4451. exitCode,
  4452. stdout,
  4453. stderr
  4454. };
  4455. });
  4456. }
  4457. exports.getExecOutput = getExecOutput;
  4458. //# sourceMappingURL=exec.js.map
  4459. /***/ }),
  4460. /***/ 8159:
  4461. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  4462. "use strict";
  4463. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  4464. if (k2 === undefined) k2 = k;
  4465. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  4466. }) : (function(o, m, k, k2) {
  4467. if (k2 === undefined) k2 = k;
  4468. o[k2] = m[k];
  4469. }));
  4470. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  4471. Object.defineProperty(o, "default", { enumerable: true, value: v });
  4472. }) : function(o, v) {
  4473. o["default"] = v;
  4474. });
  4475. var __importStar = (this && this.__importStar) || function (mod) {
  4476. if (mod && mod.__esModule) return mod;
  4477. var result = {};
  4478. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  4479. __setModuleDefault(result, mod);
  4480. return result;
  4481. };
  4482. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4483. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4484. return new (P || (P = Promise))(function (resolve, reject) {
  4485. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4486. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4487. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4488. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4489. });
  4490. };
  4491. Object.defineProperty(exports, "__esModule", ({ value: true }));
  4492. exports.argStringToArray = exports.ToolRunner = void 0;
  4493. const os = __importStar(__nccwpck_require__(2037));
  4494. const events = __importStar(__nccwpck_require__(2361));
  4495. const child = __importStar(__nccwpck_require__(2081));
  4496. const path = __importStar(__nccwpck_require__(1017));
  4497. const io = __importStar(__nccwpck_require__(7436));
  4498. const ioUtil = __importStar(__nccwpck_require__(1962));
  4499. const timers_1 = __nccwpck_require__(9512);
  4500. /* eslint-disable @typescript-eslint/unbound-method */
  4501. const IS_WINDOWS = process.platform === 'win32';
  4502. /*
  4503. * Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way.
  4504. */
  4505. class ToolRunner extends events.EventEmitter {
  4506. constructor(toolPath, args, options) {
  4507. super();
  4508. if (!toolPath) {
  4509. throw new Error("Parameter 'toolPath' cannot be null or empty.");
  4510. }
  4511. this.toolPath = toolPath;
  4512. this.args = args || [];
  4513. this.options = options || {};
  4514. }
  4515. _debug(message) {
  4516. if (this.options.listeners && this.options.listeners.debug) {
  4517. this.options.listeners.debug(message);
  4518. }
  4519. }
  4520. _getCommandString(options, noPrefix) {
  4521. const toolPath = this._getSpawnFileName();
  4522. const args = this._getSpawnArgs(options);
  4523. let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool
  4524. if (IS_WINDOWS) {
  4525. // Windows + cmd file
  4526. if (this._isCmdFile()) {
  4527. cmd += toolPath;
  4528. for (const a of args) {
  4529. cmd += ` ${a}`;
  4530. }
  4531. }
  4532. // Windows + verbatim
  4533. else if (options.windowsVerbatimArguments) {
  4534. cmd += `"${toolPath}"`;
  4535. for (const a of args) {
  4536. cmd += ` ${a}`;
  4537. }
  4538. }
  4539. // Windows (regular)
  4540. else {
  4541. cmd += this._windowsQuoteCmdArg(toolPath);
  4542. for (const a of args) {
  4543. cmd += ` ${this._windowsQuoteCmdArg(a)}`;
  4544. }
  4545. }
  4546. }
  4547. else {
  4548. // OSX/Linux - this can likely be improved with some form of quoting.
  4549. // creating processes on Unix is fundamentally different than Windows.
  4550. // on Unix, execvp() takes an arg array.
  4551. cmd += toolPath;
  4552. for (const a of args) {
  4553. cmd += ` ${a}`;
  4554. }
  4555. }
  4556. return cmd;
  4557. }
  4558. _processLineBuffer(data, strBuffer, onLine) {
  4559. try {
  4560. let s = strBuffer + data.toString();
  4561. let n = s.indexOf(os.EOL);
  4562. while (n > -1) {
  4563. const line = s.substring(0, n);
  4564. onLine(line);
  4565. // the rest of the string ...
  4566. s = s.substring(n + os.EOL.length);
  4567. n = s.indexOf(os.EOL);
  4568. }
  4569. return s;
  4570. }
  4571. catch (err) {
  4572. // streaming lines to console is best effort. Don't fail a build.
  4573. this._debug(`error processing line. Failed with error ${err}`);
  4574. return '';
  4575. }
  4576. }
  4577. _getSpawnFileName() {
  4578. if (IS_WINDOWS) {
  4579. if (this._isCmdFile()) {
  4580. return process.env['COMSPEC'] || 'cmd.exe';
  4581. }
  4582. }
  4583. return this.toolPath;
  4584. }
  4585. _getSpawnArgs(options) {
  4586. if (IS_WINDOWS) {
  4587. if (this._isCmdFile()) {
  4588. let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`;
  4589. for (const a of this.args) {
  4590. argline += ' ';
  4591. argline += options.windowsVerbatimArguments
  4592. ? a
  4593. : this._windowsQuoteCmdArg(a);
  4594. }
  4595. argline += '"';
  4596. return [argline];
  4597. }
  4598. }
  4599. return this.args;
  4600. }
  4601. _endsWith(str, end) {
  4602. return str.endsWith(end);
  4603. }
  4604. _isCmdFile() {
  4605. const upperToolPath = this.toolPath.toUpperCase();
  4606. return (this._endsWith(upperToolPath, '.CMD') ||
  4607. this._endsWith(upperToolPath, '.BAT'));
  4608. }
  4609. _windowsQuoteCmdArg(arg) {
  4610. // for .exe, apply the normal quoting rules that libuv applies
  4611. if (!this._isCmdFile()) {
  4612. return this._uvQuoteCmdArg(arg);
  4613. }
  4614. // otherwise apply quoting rules specific to the cmd.exe command line parser.
  4615. // the libuv rules are generic and are not designed specifically for cmd.exe
  4616. // command line parser.
  4617. //
  4618. // for a detailed description of the cmd.exe command line parser, refer to
  4619. // http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912
  4620. // need quotes for empty arg
  4621. if (!arg) {
  4622. return '""';
  4623. }
  4624. // determine whether the arg needs to be quoted
  4625. const cmdSpecialChars = [
  4626. ' ',
  4627. '\t',
  4628. '&',
  4629. '(',
  4630. ')',
  4631. '[',
  4632. ']',
  4633. '{',
  4634. '}',
  4635. '^',
  4636. '=',
  4637. ';',
  4638. '!',
  4639. "'",
  4640. '+',
  4641. ',',
  4642. '`',
  4643. '~',
  4644. '|',
  4645. '<',
  4646. '>',
  4647. '"'
  4648. ];
  4649. let needsQuotes = false;
  4650. for (const char of arg) {
  4651. if (cmdSpecialChars.some(x => x === char)) {
  4652. needsQuotes = true;
  4653. break;
  4654. }
  4655. }
  4656. // short-circuit if quotes not needed
  4657. if (!needsQuotes) {
  4658. return arg;
  4659. }
  4660. // the following quoting rules are very similar to the rules that by libuv applies.
  4661. //
  4662. // 1) wrap the string in quotes
  4663. //
  4664. // 2) double-up quotes - i.e. " => ""
  4665. //
  4666. // this is different from the libuv quoting rules. libuv replaces " with \", which unfortunately
  4667. // doesn't work well with a cmd.exe command line.
  4668. //
  4669. // note, replacing " with "" also works well if the arg is passed to a downstream .NET console app.
  4670. // for example, the command line:
  4671. // foo.exe "myarg:""my val"""
  4672. // is parsed by a .NET console app into an arg array:
  4673. // [ "myarg:\"my val\"" ]
  4674. // which is the same end result when applying libuv quoting rules. although the actual
  4675. // command line from libuv quoting rules would look like:
  4676. // foo.exe "myarg:\"my val\""
  4677. //
  4678. // 3) double-up slashes that precede a quote,
  4679. // e.g. hello \world => "hello \world"
  4680. // hello\"world => "hello\\""world"
  4681. // hello\\"world => "hello\\\\""world"
  4682. // hello world\ => "hello world\\"
  4683. //
  4684. // technically this is not required for a cmd.exe command line, or the batch argument parser.
  4685. // the reasons for including this as a .cmd quoting rule are:
  4686. //
  4687. // a) this is optimized for the scenario where the argument is passed from the .cmd file to an
  4688. // external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule.
  4689. //
  4690. // b) it's what we've been doing previously (by deferring to node default behavior) and we
  4691. // haven't heard any complaints about that aspect.
  4692. //
  4693. // note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be
  4694. // escaped when used on the command line directly - even though within a .cmd file % can be escaped
  4695. // by using %%.
  4696. //
  4697. // the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts
  4698. // the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing.
  4699. //
  4700. // one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would
  4701. // often work, since it is unlikely that var^ would exist, and the ^ character is removed when the
  4702. // variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args
  4703. // to an external program.
  4704. //
  4705. // an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file.
  4706. // % can be escaped within a .cmd file.
  4707. let reverse = '"';
  4708. let quoteHit = true;
  4709. for (let i = arg.length; i > 0; i--) {
  4710. // walk the string in reverse
  4711. reverse += arg[i - 1];
  4712. if (quoteHit && arg[i - 1] === '\\') {
  4713. reverse += '\\'; // double the slash
  4714. }
  4715. else if (arg[i - 1] === '"') {
  4716. quoteHit = true;
  4717. reverse += '"'; // double the quote
  4718. }
  4719. else {
  4720. quoteHit = false;
  4721. }
  4722. }
  4723. reverse += '"';
  4724. return reverse
  4725. .split('')
  4726. .reverse()
  4727. .join('');
  4728. }
  4729. _uvQuoteCmdArg(arg) {
  4730. // Tool runner wraps child_process.spawn() and needs to apply the same quoting as
  4731. // Node in certain cases where the undocumented spawn option windowsVerbatimArguments
  4732. // is used.
  4733. //
  4734. // Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV,
  4735. // see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details),
  4736. // pasting copyright notice from Node within this function:
  4737. //
  4738. // Copyright Joyent, Inc. and other Node contributors. All rights reserved.
  4739. //
  4740. // Permission is hereby granted, free of charge, to any person obtaining a copy
  4741. // of this software and associated documentation files (the "Software"), to
  4742. // deal in the Software without restriction, including without limitation the
  4743. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  4744. // sell copies of the Software, and to permit persons to whom the Software is
  4745. // furnished to do so, subject to the following conditions:
  4746. //
  4747. // The above copyright notice and this permission notice shall be included in
  4748. // all copies or substantial portions of the Software.
  4749. //
  4750. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  4751. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  4752. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  4753. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  4754. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  4755. // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  4756. // IN THE SOFTWARE.
  4757. if (!arg) {
  4758. // Need double quotation for empty argument
  4759. return '""';
  4760. }
  4761. if (!arg.includes(' ') && !arg.includes('\t') && !arg.includes('"')) {
  4762. // No quotation needed
  4763. return arg;
  4764. }
  4765. if (!arg.includes('"') && !arg.includes('\\')) {
  4766. // No embedded double quotes or backslashes, so I can just wrap
  4767. // quote marks around the whole thing.
  4768. return `"${arg}"`;
  4769. }
  4770. // Expected input/output:
  4771. // input : hello"world
  4772. // output: "hello\"world"
  4773. // input : hello""world
  4774. // output: "hello\"\"world"
  4775. // input : hello\world
  4776. // output: hello\world
  4777. // input : hello\\world
  4778. // output: hello\\world
  4779. // input : hello\"world
  4780. // output: "hello\\\"world"
  4781. // input : hello\\"world
  4782. // output: "hello\\\\\"world"
  4783. // input : hello world\
  4784. // output: "hello world\\" - note the comment in libuv actually reads "hello world\"
  4785. // but it appears the comment is wrong, it should be "hello world\\"
  4786. let reverse = '"';
  4787. let quoteHit = true;
  4788. for (let i = arg.length; i > 0; i--) {
  4789. // walk the string in reverse
  4790. reverse += arg[i - 1];
  4791. if (quoteHit && arg[i - 1] === '\\') {
  4792. reverse += '\\';
  4793. }
  4794. else if (arg[i - 1] === '"') {
  4795. quoteHit = true;
  4796. reverse += '\\';
  4797. }
  4798. else {
  4799. quoteHit = false;
  4800. }
  4801. }
  4802. reverse += '"';
  4803. return reverse
  4804. .split('')
  4805. .reverse()
  4806. .join('');
  4807. }
  4808. _cloneExecOptions(options) {
  4809. options = options || {};
  4810. const result = {
  4811. cwd: options.cwd || process.cwd(),
  4812. env: options.env || process.env,
  4813. silent: options.silent || false,
  4814. windowsVerbatimArguments: options.windowsVerbatimArguments || false,
  4815. failOnStdErr: options.failOnStdErr || false,
  4816. ignoreReturnCode: options.ignoreReturnCode || false,
  4817. delay: options.delay || 10000
  4818. };
  4819. result.outStream = options.outStream || process.stdout;
  4820. result.errStream = options.errStream || process.stderr;
  4821. return result;
  4822. }
  4823. _getSpawnOptions(options, toolPath) {
  4824. options = options || {};
  4825. const result = {};
  4826. result.cwd = options.cwd;
  4827. result.env = options.env;
  4828. result['windowsVerbatimArguments'] =
  4829. options.windowsVerbatimArguments || this._isCmdFile();
  4830. if (options.windowsVerbatimArguments) {
  4831. result.argv0 = `"${toolPath}"`;
  4832. }
  4833. return result;
  4834. }
  4835. /**
  4836. * Exec a tool.
  4837. * Output will be streamed to the live console.
  4838. * Returns promise with return code
  4839. *
  4840. * @param tool path to tool to exec
  4841. * @param options optional exec options. See ExecOptions
  4842. * @returns number
  4843. */
  4844. exec() {
  4845. return __awaiter(this, void 0, void 0, function* () {
  4846. // root the tool path if it is unrooted and contains relative pathing
  4847. if (!ioUtil.isRooted(this.toolPath) &&
  4848. (this.toolPath.includes('/') ||
  4849. (IS_WINDOWS && this.toolPath.includes('\\')))) {
  4850. // prefer options.cwd if it is specified, however options.cwd may also need to be rooted
  4851. this.toolPath = path.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath);
  4852. }
  4853. // if the tool is only a file name, then resolve it from the PATH
  4854. // otherwise verify it exists (add extension on Windows if necessary)
  4855. this.toolPath = yield io.which(this.toolPath, true);
  4856. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  4857. this._debug(`exec tool: ${this.toolPath}`);
  4858. this._debug('arguments:');
  4859. for (const arg of this.args) {
  4860. this._debug(` ${arg}`);
  4861. }
  4862. const optionsNonNull = this._cloneExecOptions(this.options);
  4863. if (!optionsNonNull.silent && optionsNonNull.outStream) {
  4864. optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL);
  4865. }
  4866. const state = new ExecState(optionsNonNull, this.toolPath);
  4867. state.on('debug', (message) => {
  4868. this._debug(message);
  4869. });
  4870. if (this.options.cwd && !(yield ioUtil.exists(this.options.cwd))) {
  4871. return reject(new Error(`The cwd: ${this.options.cwd} does not exist!`));
  4872. }
  4873. const fileName = this._getSpawnFileName();
  4874. const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName));
  4875. let stdbuffer = '';
  4876. if (cp.stdout) {
  4877. cp.stdout.on('data', (data) => {
  4878. if (this.options.listeners && this.options.listeners.stdout) {
  4879. this.options.listeners.stdout(data);
  4880. }
  4881. if (!optionsNonNull.silent && optionsNonNull.outStream) {
  4882. optionsNonNull.outStream.write(data);
  4883. }
  4884. stdbuffer = this._processLineBuffer(data, stdbuffer, (line) => {
  4885. if (this.options.listeners && this.options.listeners.stdline) {
  4886. this.options.listeners.stdline(line);
  4887. }
  4888. });
  4889. });
  4890. }
  4891. let errbuffer = '';
  4892. if (cp.stderr) {
  4893. cp.stderr.on('data', (data) => {
  4894. state.processStderr = true;
  4895. if (this.options.listeners && this.options.listeners.stderr) {
  4896. this.options.listeners.stderr(data);
  4897. }
  4898. if (!optionsNonNull.silent &&
  4899. optionsNonNull.errStream &&
  4900. optionsNonNull.outStream) {
  4901. const s = optionsNonNull.failOnStdErr
  4902. ? optionsNonNull.errStream
  4903. : optionsNonNull.outStream;
  4904. s.write(data);
  4905. }
  4906. errbuffer = this._processLineBuffer(data, errbuffer, (line) => {
  4907. if (this.options.listeners && this.options.listeners.errline) {
  4908. this.options.listeners.errline(line);
  4909. }
  4910. });
  4911. });
  4912. }
  4913. cp.on('error', (err) => {
  4914. state.processError = err.message;
  4915. state.processExited = true;
  4916. state.processClosed = true;
  4917. state.CheckComplete();
  4918. });
  4919. cp.on('exit', (code) => {
  4920. state.processExitCode = code;
  4921. state.processExited = true;
  4922. this._debug(`Exit code ${code} received from tool '${this.toolPath}'`);
  4923. state.CheckComplete();
  4924. });
  4925. cp.on('close', (code) => {
  4926. state.processExitCode = code;
  4927. state.processExited = true;
  4928. state.processClosed = true;
  4929. this._debug(`STDIO streams have closed for tool '${this.toolPath}'`);
  4930. state.CheckComplete();
  4931. });
  4932. state.on('done', (error, exitCode) => {
  4933. if (stdbuffer.length > 0) {
  4934. this.emit('stdline', stdbuffer);
  4935. }
  4936. if (errbuffer.length > 0) {
  4937. this.emit('errline', errbuffer);
  4938. }
  4939. cp.removeAllListeners();
  4940. if (error) {
  4941. reject(error);
  4942. }
  4943. else {
  4944. resolve(exitCode);
  4945. }
  4946. });
  4947. if (this.options.input) {
  4948. if (!cp.stdin) {
  4949. throw new Error('child process missing stdin');
  4950. }
  4951. cp.stdin.end(this.options.input);
  4952. }
  4953. }));
  4954. });
  4955. }
  4956. }
  4957. exports.ToolRunner = ToolRunner;
  4958. /**
  4959. * Convert an arg string to an array of args. Handles escaping
  4960. *
  4961. * @param argString string of arguments
  4962. * @returns string[] array of arguments
  4963. */
  4964. function argStringToArray(argString) {
  4965. const args = [];
  4966. let inQuotes = false;
  4967. let escaped = false;
  4968. let arg = '';
  4969. function append(c) {
  4970. // we only escape double quotes.
  4971. if (escaped && c !== '"') {
  4972. arg += '\\';
  4973. }
  4974. arg += c;
  4975. escaped = false;
  4976. }
  4977. for (let i = 0; i < argString.length; i++) {
  4978. const c = argString.charAt(i);
  4979. if (c === '"') {
  4980. if (!escaped) {
  4981. inQuotes = !inQuotes;
  4982. }
  4983. else {
  4984. append(c);
  4985. }
  4986. continue;
  4987. }
  4988. if (c === '\\' && escaped) {
  4989. append(c);
  4990. continue;
  4991. }
  4992. if (c === '\\' && inQuotes) {
  4993. escaped = true;
  4994. continue;
  4995. }
  4996. if (c === ' ' && !inQuotes) {
  4997. if (arg.length > 0) {
  4998. args.push(arg);
  4999. arg = '';
  5000. }
  5001. continue;
  5002. }
  5003. append(c);
  5004. }
  5005. if (arg.length > 0) {
  5006. args.push(arg.trim());
  5007. }
  5008. return args;
  5009. }
  5010. exports.argStringToArray = argStringToArray;
  5011. class ExecState extends events.EventEmitter {
  5012. constructor(options, toolPath) {
  5013. super();
  5014. this.processClosed = false; // tracks whether the process has exited and stdio is closed
  5015. this.processError = '';
  5016. this.processExitCode = 0;
  5017. this.processExited = false; // tracks whether the process has exited
  5018. this.processStderr = false; // tracks whether stderr was written to
  5019. this.delay = 10000; // 10 seconds
  5020. this.done = false;
  5021. this.timeout = null;
  5022. if (!toolPath) {
  5023. throw new Error('toolPath must not be empty');
  5024. }
  5025. this.options = options;
  5026. this.toolPath = toolPath;
  5027. if (options.delay) {
  5028. this.delay = options.delay;
  5029. }
  5030. }
  5031. CheckComplete() {
  5032. if (this.done) {
  5033. return;
  5034. }
  5035. if (this.processClosed) {
  5036. this._setResult();
  5037. }
  5038. else if (this.processExited) {
  5039. this.timeout = timers_1.setTimeout(ExecState.HandleTimeout, this.delay, this);
  5040. }
  5041. }
  5042. _debug(message) {
  5043. this.emit('debug', message);
  5044. }
  5045. _setResult() {
  5046. // determine whether there is an error
  5047. let error;
  5048. if (this.processExited) {
  5049. if (this.processError) {
  5050. 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}`);
  5051. }
  5052. else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) {
  5053. error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`);
  5054. }
  5055. else if (this.processStderr && this.options.failOnStdErr) {
  5056. error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`);
  5057. }
  5058. }
  5059. // clear the timeout
  5060. if (this.timeout) {
  5061. clearTimeout(this.timeout);
  5062. this.timeout = null;
  5063. }
  5064. this.done = true;
  5065. this.emit('done', error, this.processExitCode);
  5066. }
  5067. static HandleTimeout(state) {
  5068. if (state.done) {
  5069. return;
  5070. }
  5071. if (!state.processClosed && state.processExited) {
  5072. const message = `The STDIO streams did not close within ${state.delay /
  5073. 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.`;
  5074. state._debug(message);
  5075. }
  5076. state._setResult();
  5077. }
  5078. }
  5079. //# sourceMappingURL=toolrunner.js.map
  5080. /***/ }),
  5081. /***/ 4087:
  5082. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  5083. "use strict";
  5084. Object.defineProperty(exports, "__esModule", ({ value: true }));
  5085. exports.Context = void 0;
  5086. const fs_1 = __nccwpck_require__(7147);
  5087. const os_1 = __nccwpck_require__(2037);
  5088. class Context {
  5089. /**
  5090. * Hydrate the context from the environment
  5091. */
  5092. constructor() {
  5093. var _a, _b, _c;
  5094. this.payload = {};
  5095. if (process.env.GITHUB_EVENT_PATH) {
  5096. if ((0, fs_1.existsSync)(process.env.GITHUB_EVENT_PATH)) {
  5097. this.payload = JSON.parse((0, fs_1.readFileSync)(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' }));
  5098. }
  5099. else {
  5100. const path = process.env.GITHUB_EVENT_PATH;
  5101. process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${os_1.EOL}`);
  5102. }
  5103. }
  5104. this.eventName = process.env.GITHUB_EVENT_NAME;
  5105. this.sha = process.env.GITHUB_SHA;
  5106. this.ref = process.env.GITHUB_REF;
  5107. this.workflow = process.env.GITHUB_WORKFLOW;
  5108. this.action = process.env.GITHUB_ACTION;
  5109. this.actor = process.env.GITHUB_ACTOR;
  5110. this.job = process.env.GITHUB_JOB;
  5111. this.runNumber = parseInt(process.env.GITHUB_RUN_NUMBER, 10);
  5112. this.runId = parseInt(process.env.GITHUB_RUN_ID, 10);
  5113. this.apiUrl = (_a = process.env.GITHUB_API_URL) !== null && _a !== void 0 ? _a : `https://api.github.com`;
  5114. this.serverUrl = (_b = process.env.GITHUB_SERVER_URL) !== null && _b !== void 0 ? _b : `https://github.com`;
  5115. this.graphqlUrl =
  5116. (_c = process.env.GITHUB_GRAPHQL_URL) !== null && _c !== void 0 ? _c : `https://api.github.com/graphql`;
  5117. }
  5118. get issue() {
  5119. const payload = this.payload;
  5120. return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pull_request || payload).number });
  5121. }
  5122. get repo() {
  5123. if (process.env.GITHUB_REPOSITORY) {
  5124. const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');
  5125. return { owner, repo };
  5126. }
  5127. if (this.payload.repository) {
  5128. return {
  5129. owner: this.payload.repository.owner.login,
  5130. repo: this.payload.repository.name
  5131. };
  5132. }
  5133. throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'");
  5134. }
  5135. }
  5136. exports.Context = Context;
  5137. //# sourceMappingURL=context.js.map
  5138. /***/ }),
  5139. /***/ 5438:
  5140. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  5141. "use strict";
  5142. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  5143. if (k2 === undefined) k2 = k;
  5144. var desc = Object.getOwnPropertyDescriptor(m, k);
  5145. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  5146. desc = { enumerable: true, get: function() { return m[k]; } };
  5147. }
  5148. Object.defineProperty(o, k2, desc);
  5149. }) : (function(o, m, k, k2) {
  5150. if (k2 === undefined) k2 = k;
  5151. o[k2] = m[k];
  5152. }));
  5153. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  5154. Object.defineProperty(o, "default", { enumerable: true, value: v });
  5155. }) : function(o, v) {
  5156. o["default"] = v;
  5157. });
  5158. var __importStar = (this && this.__importStar) || function (mod) {
  5159. if (mod && mod.__esModule) return mod;
  5160. var result = {};
  5161. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  5162. __setModuleDefault(result, mod);
  5163. return result;
  5164. };
  5165. Object.defineProperty(exports, "__esModule", ({ value: true }));
  5166. exports.getOctokit = exports.context = void 0;
  5167. const Context = __importStar(__nccwpck_require__(4087));
  5168. const utils_1 = __nccwpck_require__(3030);
  5169. exports.context = new Context.Context();
  5170. /**
  5171. * Returns a hydrated octokit ready to use for GitHub Actions
  5172. *
  5173. * @param token the repo PAT or GITHUB_TOKEN
  5174. * @param options other options to set
  5175. */
  5176. function getOctokit(token, options, ...additionalPlugins) {
  5177. const GitHubWithPlugins = utils_1.GitHub.plugin(...additionalPlugins);
  5178. return new GitHubWithPlugins((0, utils_1.getOctokitOptions)(token, options));
  5179. }
  5180. exports.getOctokit = getOctokit;
  5181. //# sourceMappingURL=github.js.map
  5182. /***/ }),
  5183. /***/ 7914:
  5184. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  5185. "use strict";
  5186. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  5187. if (k2 === undefined) k2 = k;
  5188. var desc = Object.getOwnPropertyDescriptor(m, k);
  5189. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  5190. desc = { enumerable: true, get: function() { return m[k]; } };
  5191. }
  5192. Object.defineProperty(o, k2, desc);
  5193. }) : (function(o, m, k, k2) {
  5194. if (k2 === undefined) k2 = k;
  5195. o[k2] = m[k];
  5196. }));
  5197. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  5198. Object.defineProperty(o, "default", { enumerable: true, value: v });
  5199. }) : function(o, v) {
  5200. o["default"] = v;
  5201. });
  5202. var __importStar = (this && this.__importStar) || function (mod) {
  5203. if (mod && mod.__esModule) return mod;
  5204. var result = {};
  5205. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  5206. __setModuleDefault(result, mod);
  5207. return result;
  5208. };
  5209. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  5210. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  5211. return new (P || (P = Promise))(function (resolve, reject) {
  5212. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5213. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  5214. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  5215. step((generator = generator.apply(thisArg, _arguments || [])).next());
  5216. });
  5217. };
  5218. Object.defineProperty(exports, "__esModule", ({ value: true }));
  5219. exports.getApiBaseUrl = exports.getProxyFetch = exports.getProxyAgentDispatcher = exports.getProxyAgent = exports.getAuthString = void 0;
  5220. const httpClient = __importStar(__nccwpck_require__(6255));
  5221. const undici_1 = __nccwpck_require__(1773);
  5222. function getAuthString(token, options) {
  5223. if (!token && !options.auth) {
  5224. throw new Error('Parameter token or opts.auth is required');
  5225. }
  5226. else if (token && options.auth) {
  5227. throw new Error('Parameters token and opts.auth may not both be specified');
  5228. }
  5229. return typeof options.auth === 'string' ? options.auth : `token ${token}`;
  5230. }
  5231. exports.getAuthString = getAuthString;
  5232. function getProxyAgent(destinationUrl) {
  5233. const hc = new httpClient.HttpClient();
  5234. return hc.getAgent(destinationUrl);
  5235. }
  5236. exports.getProxyAgent = getProxyAgent;
  5237. function getProxyAgentDispatcher(destinationUrl) {
  5238. const hc = new httpClient.HttpClient();
  5239. return hc.getAgentDispatcher(destinationUrl);
  5240. }
  5241. exports.getProxyAgentDispatcher = getProxyAgentDispatcher;
  5242. function getProxyFetch(destinationUrl) {
  5243. const httpDispatcher = getProxyAgentDispatcher(destinationUrl);
  5244. const proxyFetch = (url, opts) => __awaiter(this, void 0, void 0, function* () {
  5245. return (0, undici_1.fetch)(url, Object.assign(Object.assign({}, opts), { dispatcher: httpDispatcher }));
  5246. });
  5247. return proxyFetch;
  5248. }
  5249. exports.getProxyFetch = getProxyFetch;
  5250. function getApiBaseUrl() {
  5251. return process.env['GITHUB_API_URL'] || 'https://api.github.com';
  5252. }
  5253. exports.getApiBaseUrl = getApiBaseUrl;
  5254. //# sourceMappingURL=utils.js.map
  5255. /***/ }),
  5256. /***/ 3030:
  5257. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  5258. "use strict";
  5259. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  5260. if (k2 === undefined) k2 = k;
  5261. var desc = Object.getOwnPropertyDescriptor(m, k);
  5262. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  5263. desc = { enumerable: true, get: function() { return m[k]; } };
  5264. }
  5265. Object.defineProperty(o, k2, desc);
  5266. }) : (function(o, m, k, k2) {
  5267. if (k2 === undefined) k2 = k;
  5268. o[k2] = m[k];
  5269. }));
  5270. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  5271. Object.defineProperty(o, "default", { enumerable: true, value: v });
  5272. }) : function(o, v) {
  5273. o["default"] = v;
  5274. });
  5275. var __importStar = (this && this.__importStar) || function (mod) {
  5276. if (mod && mod.__esModule) return mod;
  5277. var result = {};
  5278. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  5279. __setModuleDefault(result, mod);
  5280. return result;
  5281. };
  5282. Object.defineProperty(exports, "__esModule", ({ value: true }));
  5283. exports.getOctokitOptions = exports.GitHub = exports.defaults = exports.context = void 0;
  5284. const Context = __importStar(__nccwpck_require__(4087));
  5285. const Utils = __importStar(__nccwpck_require__(7914));
  5286. // octokit + plugins
  5287. const core_1 = __nccwpck_require__(6762);
  5288. const plugin_rest_endpoint_methods_1 = __nccwpck_require__(3044);
  5289. const plugin_paginate_rest_1 = __nccwpck_require__(4193);
  5290. exports.context = new Context.Context();
  5291. const baseUrl = Utils.getApiBaseUrl();
  5292. exports.defaults = {
  5293. baseUrl,
  5294. request: {
  5295. agent: Utils.getProxyAgent(baseUrl),
  5296. fetch: Utils.getProxyFetch(baseUrl)
  5297. }
  5298. };
  5299. exports.GitHub = core_1.Octokit.plugin(plugin_rest_endpoint_methods_1.restEndpointMethods, plugin_paginate_rest_1.paginateRest).defaults(exports.defaults);
  5300. /**
  5301. * Convience function to correctly format Octokit Options to pass into the constructor.
  5302. *
  5303. * @param token the repo PAT or GITHUB_TOKEN
  5304. * @param options other options to set
  5305. */
  5306. function getOctokitOptions(token, options) {
  5307. const opts = Object.assign({}, options || {}); // Shallow clone - don't mutate the object provided by the caller
  5308. // Auth
  5309. const auth = Utils.getAuthString(token, opts);
  5310. if (auth) {
  5311. opts.auth = auth;
  5312. }
  5313. return opts;
  5314. }
  5315. exports.getOctokitOptions = getOctokitOptions;
  5316. //# sourceMappingURL=utils.js.map
  5317. /***/ }),
  5318. /***/ 5526:
  5319. /***/ (function(__unused_webpack_module, exports) {
  5320. "use strict";
  5321. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  5322. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  5323. return new (P || (P = Promise))(function (resolve, reject) {
  5324. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5325. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  5326. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  5327. step((generator = generator.apply(thisArg, _arguments || [])).next());
  5328. });
  5329. };
  5330. Object.defineProperty(exports, "__esModule", ({ value: true }));
  5331. exports.PersonalAccessTokenCredentialHandler = exports.BearerCredentialHandler = exports.BasicCredentialHandler = void 0;
  5332. class BasicCredentialHandler {
  5333. constructor(username, password) {
  5334. this.username = username;
  5335. this.password = password;
  5336. }
  5337. prepareRequest(options) {
  5338. if (!options.headers) {
  5339. throw Error('The request has no headers');
  5340. }
  5341. options.headers['Authorization'] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString('base64')}`;
  5342. }
  5343. // This handler cannot handle 401
  5344. canHandleAuthentication() {
  5345. return false;
  5346. }
  5347. handleAuthentication() {
  5348. return __awaiter(this, void 0, void 0, function* () {
  5349. throw new Error('not implemented');
  5350. });
  5351. }
  5352. }
  5353. exports.BasicCredentialHandler = BasicCredentialHandler;
  5354. class BearerCredentialHandler {
  5355. constructor(token) {
  5356. this.token = token;
  5357. }
  5358. // currently implements pre-authorization
  5359. // TODO: support preAuth = false where it hooks on 401
  5360. prepareRequest(options) {
  5361. if (!options.headers) {
  5362. throw Error('The request has no headers');
  5363. }
  5364. options.headers['Authorization'] = `Bearer ${this.token}`;
  5365. }
  5366. // This handler cannot handle 401
  5367. canHandleAuthentication() {
  5368. return false;
  5369. }
  5370. handleAuthentication() {
  5371. return __awaiter(this, void 0, void 0, function* () {
  5372. throw new Error('not implemented');
  5373. });
  5374. }
  5375. }
  5376. exports.BearerCredentialHandler = BearerCredentialHandler;
  5377. class PersonalAccessTokenCredentialHandler {
  5378. constructor(token) {
  5379. this.token = token;
  5380. }
  5381. // currently implements pre-authorization
  5382. // TODO: support preAuth = false where it hooks on 401
  5383. prepareRequest(options) {
  5384. if (!options.headers) {
  5385. throw Error('The request has no headers');
  5386. }
  5387. options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`;
  5388. }
  5389. // This handler cannot handle 401
  5390. canHandleAuthentication() {
  5391. return false;
  5392. }
  5393. handleAuthentication() {
  5394. return __awaiter(this, void 0, void 0, function* () {
  5395. throw new Error('not implemented');
  5396. });
  5397. }
  5398. }
  5399. exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler;
  5400. //# sourceMappingURL=auth.js.map
  5401. /***/ }),
  5402. /***/ 6255:
  5403. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  5404. "use strict";
  5405. /* eslint-disable @typescript-eslint/no-explicit-any */
  5406. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  5407. if (k2 === undefined) k2 = k;
  5408. var desc = Object.getOwnPropertyDescriptor(m, k);
  5409. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  5410. desc = { enumerable: true, get: function() { return m[k]; } };
  5411. }
  5412. Object.defineProperty(o, k2, desc);
  5413. }) : (function(o, m, k, k2) {
  5414. if (k2 === undefined) k2 = k;
  5415. o[k2] = m[k];
  5416. }));
  5417. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  5418. Object.defineProperty(o, "default", { enumerable: true, value: v });
  5419. }) : function(o, v) {
  5420. o["default"] = v;
  5421. });
  5422. var __importStar = (this && this.__importStar) || function (mod) {
  5423. if (mod && mod.__esModule) return mod;
  5424. var result = {};
  5425. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  5426. __setModuleDefault(result, mod);
  5427. return result;
  5428. };
  5429. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  5430. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  5431. return new (P || (P = Promise))(function (resolve, reject) {
  5432. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5433. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  5434. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  5435. step((generator = generator.apply(thisArg, _arguments || [])).next());
  5436. });
  5437. };
  5438. Object.defineProperty(exports, "__esModule", ({ value: true }));
  5439. exports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpClientError = exports.getProxyUrl = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0;
  5440. const http = __importStar(__nccwpck_require__(3685));
  5441. const https = __importStar(__nccwpck_require__(5687));
  5442. const pm = __importStar(__nccwpck_require__(9835));
  5443. const tunnel = __importStar(__nccwpck_require__(4294));
  5444. const undici_1 = __nccwpck_require__(1773);
  5445. var HttpCodes;
  5446. (function (HttpCodes) {
  5447. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  5448. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  5449. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  5450. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  5451. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  5452. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  5453. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  5454. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  5455. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  5456. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  5457. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  5458. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  5459. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  5460. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  5461. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  5462. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  5463. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  5464. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  5465. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  5466. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  5467. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  5468. HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests";
  5469. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  5470. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  5471. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  5472. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  5473. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  5474. })(HttpCodes || (exports.HttpCodes = HttpCodes = {}));
  5475. var Headers;
  5476. (function (Headers) {
  5477. Headers["Accept"] = "accept";
  5478. Headers["ContentType"] = "content-type";
  5479. })(Headers || (exports.Headers = Headers = {}));
  5480. var MediaTypes;
  5481. (function (MediaTypes) {
  5482. MediaTypes["ApplicationJson"] = "application/json";
  5483. })(MediaTypes || (exports.MediaTypes = MediaTypes = {}));
  5484. /**
  5485. * Returns the proxy URL, depending upon the supplied url and proxy environment variables.
  5486. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  5487. */
  5488. function getProxyUrl(serverUrl) {
  5489. const proxyUrl = pm.getProxyUrl(new URL(serverUrl));
  5490. return proxyUrl ? proxyUrl.href : '';
  5491. }
  5492. exports.getProxyUrl = getProxyUrl;
  5493. const HttpRedirectCodes = [
  5494. HttpCodes.MovedPermanently,
  5495. HttpCodes.ResourceMoved,
  5496. HttpCodes.SeeOther,
  5497. HttpCodes.TemporaryRedirect,
  5498. HttpCodes.PermanentRedirect
  5499. ];
  5500. const HttpResponseRetryCodes = [
  5501. HttpCodes.BadGateway,
  5502. HttpCodes.ServiceUnavailable,
  5503. HttpCodes.GatewayTimeout
  5504. ];
  5505. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  5506. const ExponentialBackoffCeiling = 10;
  5507. const ExponentialBackoffTimeSlice = 5;
  5508. class HttpClientError extends Error {
  5509. constructor(message, statusCode) {
  5510. super(message);
  5511. this.name = 'HttpClientError';
  5512. this.statusCode = statusCode;
  5513. Object.setPrototypeOf(this, HttpClientError.prototype);
  5514. }
  5515. }
  5516. exports.HttpClientError = HttpClientError;
  5517. class HttpClientResponse {
  5518. constructor(message) {
  5519. this.message = message;
  5520. }
  5521. readBody() {
  5522. return __awaiter(this, void 0, void 0, function* () {
  5523. return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
  5524. let output = Buffer.alloc(0);
  5525. this.message.on('data', (chunk) => {
  5526. output = Buffer.concat([output, chunk]);
  5527. });
  5528. this.message.on('end', () => {
  5529. resolve(output.toString());
  5530. });
  5531. }));
  5532. });
  5533. }
  5534. readBodyBuffer() {
  5535. return __awaiter(this, void 0, void 0, function* () {
  5536. return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
  5537. const chunks = [];
  5538. this.message.on('data', (chunk) => {
  5539. chunks.push(chunk);
  5540. });
  5541. this.message.on('end', () => {
  5542. resolve(Buffer.concat(chunks));
  5543. });
  5544. }));
  5545. });
  5546. }
  5547. }
  5548. exports.HttpClientResponse = HttpClientResponse;
  5549. function isHttps(requestUrl) {
  5550. const parsedUrl = new URL(requestUrl);
  5551. return parsedUrl.protocol === 'https:';
  5552. }
  5553. exports.isHttps = isHttps;
  5554. class HttpClient {
  5555. constructor(userAgent, handlers, requestOptions) {
  5556. this._ignoreSslError = false;
  5557. this._allowRedirects = true;
  5558. this._allowRedirectDowngrade = false;
  5559. this._maxRedirects = 50;
  5560. this._allowRetries = false;
  5561. this._maxRetries = 1;
  5562. this._keepAlive = false;
  5563. this._disposed = false;
  5564. this.userAgent = userAgent;
  5565. this.handlers = handlers || [];
  5566. this.requestOptions = requestOptions;
  5567. if (requestOptions) {
  5568. if (requestOptions.ignoreSslError != null) {
  5569. this._ignoreSslError = requestOptions.ignoreSslError;
  5570. }
  5571. this._socketTimeout = requestOptions.socketTimeout;
  5572. if (requestOptions.allowRedirects != null) {
  5573. this._allowRedirects = requestOptions.allowRedirects;
  5574. }
  5575. if (requestOptions.allowRedirectDowngrade != null) {
  5576. this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;
  5577. }
  5578. if (requestOptions.maxRedirects != null) {
  5579. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  5580. }
  5581. if (requestOptions.keepAlive != null) {
  5582. this._keepAlive = requestOptions.keepAlive;
  5583. }
  5584. if (requestOptions.allowRetries != null) {
  5585. this._allowRetries = requestOptions.allowRetries;
  5586. }
  5587. if (requestOptions.maxRetries != null) {
  5588. this._maxRetries = requestOptions.maxRetries;
  5589. }
  5590. }
  5591. }
  5592. options(requestUrl, additionalHeaders) {
  5593. return __awaiter(this, void 0, void 0, function* () {
  5594. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  5595. });
  5596. }
  5597. get(requestUrl, additionalHeaders) {
  5598. return __awaiter(this, void 0, void 0, function* () {
  5599. return this.request('GET', requestUrl, null, additionalHeaders || {});
  5600. });
  5601. }
  5602. del(requestUrl, additionalHeaders) {
  5603. return __awaiter(this, void 0, void 0, function* () {
  5604. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  5605. });
  5606. }
  5607. post(requestUrl, data, additionalHeaders) {
  5608. return __awaiter(this, void 0, void 0, function* () {
  5609. return this.request('POST', requestUrl, data, additionalHeaders || {});
  5610. });
  5611. }
  5612. patch(requestUrl, data, additionalHeaders) {
  5613. return __awaiter(this, void 0, void 0, function* () {
  5614. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  5615. });
  5616. }
  5617. put(requestUrl, data, additionalHeaders) {
  5618. return __awaiter(this, void 0, void 0, function* () {
  5619. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  5620. });
  5621. }
  5622. head(requestUrl, additionalHeaders) {
  5623. return __awaiter(this, void 0, void 0, function* () {
  5624. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  5625. });
  5626. }
  5627. sendStream(verb, requestUrl, stream, additionalHeaders) {
  5628. return __awaiter(this, void 0, void 0, function* () {
  5629. return this.request(verb, requestUrl, stream, additionalHeaders);
  5630. });
  5631. }
  5632. /**
  5633. * Gets a typed object from an endpoint
  5634. * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise
  5635. */
  5636. getJson(requestUrl, additionalHeaders = {}) {
  5637. return __awaiter(this, void 0, void 0, function* () {
  5638. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  5639. const res = yield this.get(requestUrl, additionalHeaders);
  5640. return this._processResponse(res, this.requestOptions);
  5641. });
  5642. }
  5643. postJson(requestUrl, obj, additionalHeaders = {}) {
  5644. return __awaiter(this, void 0, void 0, function* () {
  5645. const data = JSON.stringify(obj, null, 2);
  5646. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  5647. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  5648. const res = yield this.post(requestUrl, data, additionalHeaders);
  5649. return this._processResponse(res, this.requestOptions);
  5650. });
  5651. }
  5652. putJson(requestUrl, obj, additionalHeaders = {}) {
  5653. return __awaiter(this, void 0, void 0, function* () {
  5654. const data = JSON.stringify(obj, null, 2);
  5655. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  5656. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  5657. const res = yield this.put(requestUrl, data, additionalHeaders);
  5658. return this._processResponse(res, this.requestOptions);
  5659. });
  5660. }
  5661. patchJson(requestUrl, obj, additionalHeaders = {}) {
  5662. return __awaiter(this, void 0, void 0, function* () {
  5663. const data = JSON.stringify(obj, null, 2);
  5664. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  5665. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  5666. const res = yield this.patch(requestUrl, data, additionalHeaders);
  5667. return this._processResponse(res, this.requestOptions);
  5668. });
  5669. }
  5670. /**
  5671. * Makes a raw http request.
  5672. * All other methods such as get, post, patch, and request ultimately call this.
  5673. * Prefer get, del, post and patch
  5674. */
  5675. request(verb, requestUrl, data, headers) {
  5676. return __awaiter(this, void 0, void 0, function* () {
  5677. if (this._disposed) {
  5678. throw new Error('Client has already been disposed.');
  5679. }
  5680. const parsedUrl = new URL(requestUrl);
  5681. let info = this._prepareRequest(verb, parsedUrl, headers);
  5682. // Only perform retries on reads since writes may not be idempotent.
  5683. const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb)
  5684. ? this._maxRetries + 1
  5685. : 1;
  5686. let numTries = 0;
  5687. let response;
  5688. do {
  5689. response = yield this.requestRaw(info, data);
  5690. // Check if it's an authentication challenge
  5691. if (response &&
  5692. response.message &&
  5693. response.message.statusCode === HttpCodes.Unauthorized) {
  5694. let authenticationHandler;
  5695. for (const handler of this.handlers) {
  5696. if (handler.canHandleAuthentication(response)) {
  5697. authenticationHandler = handler;
  5698. break;
  5699. }
  5700. }
  5701. if (authenticationHandler) {
  5702. return authenticationHandler.handleAuthentication(this, info, data);
  5703. }
  5704. else {
  5705. // We have received an unauthorized response but have no handlers to handle it.
  5706. // Let the response return to the caller.
  5707. return response;
  5708. }
  5709. }
  5710. let redirectsRemaining = this._maxRedirects;
  5711. while (response.message.statusCode &&
  5712. HttpRedirectCodes.includes(response.message.statusCode) &&
  5713. this._allowRedirects &&
  5714. redirectsRemaining > 0) {
  5715. const redirectUrl = response.message.headers['location'];
  5716. if (!redirectUrl) {
  5717. // if there's no location to redirect to, we won't
  5718. break;
  5719. }
  5720. const parsedRedirectUrl = new URL(redirectUrl);
  5721. if (parsedUrl.protocol === 'https:' &&
  5722. parsedUrl.protocol !== parsedRedirectUrl.protocol &&
  5723. !this._allowRedirectDowngrade) {
  5724. 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.');
  5725. }
  5726. // we need to finish reading the response before reassigning response
  5727. // which will leak the open socket.
  5728. yield response.readBody();
  5729. // strip authorization header if redirected to a different hostname
  5730. if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {
  5731. for (const header in headers) {
  5732. // header names are case insensitive
  5733. if (header.toLowerCase() === 'authorization') {
  5734. delete headers[header];
  5735. }
  5736. }
  5737. }
  5738. // let's make the request with the new redirectUrl
  5739. info = this._prepareRequest(verb, parsedRedirectUrl, headers);
  5740. response = yield this.requestRaw(info, data);
  5741. redirectsRemaining--;
  5742. }
  5743. if (!response.message.statusCode ||
  5744. !HttpResponseRetryCodes.includes(response.message.statusCode)) {
  5745. // If not a retry code, return immediately instead of retrying
  5746. return response;
  5747. }
  5748. numTries += 1;
  5749. if (numTries < maxTries) {
  5750. yield response.readBody();
  5751. yield this._performExponentialBackoff(numTries);
  5752. }
  5753. } while (numTries < maxTries);
  5754. return response;
  5755. });
  5756. }
  5757. /**
  5758. * Needs to be called if keepAlive is set to true in request options.
  5759. */
  5760. dispose() {
  5761. if (this._agent) {
  5762. this._agent.destroy();
  5763. }
  5764. this._disposed = true;
  5765. }
  5766. /**
  5767. * Raw request.
  5768. * @param info
  5769. * @param data
  5770. */
  5771. requestRaw(info, data) {
  5772. return __awaiter(this, void 0, void 0, function* () {
  5773. return new Promise((resolve, reject) => {
  5774. function callbackForResult(err, res) {
  5775. if (err) {
  5776. reject(err);
  5777. }
  5778. else if (!res) {
  5779. // If `err` is not passed, then `res` must be passed.
  5780. reject(new Error('Unknown error'));
  5781. }
  5782. else {
  5783. resolve(res);
  5784. }
  5785. }
  5786. this.requestRawWithCallback(info, data, callbackForResult);
  5787. });
  5788. });
  5789. }
  5790. /**
  5791. * Raw request with callback.
  5792. * @param info
  5793. * @param data
  5794. * @param onResult
  5795. */
  5796. requestRawWithCallback(info, data, onResult) {
  5797. if (typeof data === 'string') {
  5798. if (!info.options.headers) {
  5799. info.options.headers = {};
  5800. }
  5801. info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');
  5802. }
  5803. let callbackCalled = false;
  5804. function handleResult(err, res) {
  5805. if (!callbackCalled) {
  5806. callbackCalled = true;
  5807. onResult(err, res);
  5808. }
  5809. }
  5810. const req = info.httpModule.request(info.options, (msg) => {
  5811. const res = new HttpClientResponse(msg);
  5812. handleResult(undefined, res);
  5813. });
  5814. let socket;
  5815. req.on('socket', sock => {
  5816. socket = sock;
  5817. });
  5818. // If we ever get disconnected, we want the socket to timeout eventually
  5819. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  5820. if (socket) {
  5821. socket.end();
  5822. }
  5823. handleResult(new Error(`Request timeout: ${info.options.path}`));
  5824. });
  5825. req.on('error', function (err) {
  5826. // err has statusCode property
  5827. // res should have headers
  5828. handleResult(err);
  5829. });
  5830. if (data && typeof data === 'string') {
  5831. req.write(data, 'utf8');
  5832. }
  5833. if (data && typeof data !== 'string') {
  5834. data.on('close', function () {
  5835. req.end();
  5836. });
  5837. data.pipe(req);
  5838. }
  5839. else {
  5840. req.end();
  5841. }
  5842. }
  5843. /**
  5844. * Gets an http agent. This function is useful when you need an http agent that handles
  5845. * routing through a proxy server - depending upon the url and proxy environment variables.
  5846. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  5847. */
  5848. getAgent(serverUrl) {
  5849. const parsedUrl = new URL(serverUrl);
  5850. return this._getAgent(parsedUrl);
  5851. }
  5852. getAgentDispatcher(serverUrl) {
  5853. const parsedUrl = new URL(serverUrl);
  5854. const proxyUrl = pm.getProxyUrl(parsedUrl);
  5855. const useProxy = proxyUrl && proxyUrl.hostname;
  5856. if (!useProxy) {
  5857. return;
  5858. }
  5859. return this._getProxyAgentDispatcher(parsedUrl, proxyUrl);
  5860. }
  5861. _prepareRequest(method, requestUrl, headers) {
  5862. const info = {};
  5863. info.parsedUrl = requestUrl;
  5864. const usingSsl = info.parsedUrl.protocol === 'https:';
  5865. info.httpModule = usingSsl ? https : http;
  5866. const defaultPort = usingSsl ? 443 : 80;
  5867. info.options = {};
  5868. info.options.host = info.parsedUrl.hostname;
  5869. info.options.port = info.parsedUrl.port
  5870. ? parseInt(info.parsedUrl.port)
  5871. : defaultPort;
  5872. info.options.path =
  5873. (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  5874. info.options.method = method;
  5875. info.options.headers = this._mergeHeaders(headers);
  5876. if (this.userAgent != null) {
  5877. info.options.headers['user-agent'] = this.userAgent;
  5878. }
  5879. info.options.agent = this._getAgent(info.parsedUrl);
  5880. // gives handlers an opportunity to participate
  5881. if (this.handlers) {
  5882. for (const handler of this.handlers) {
  5883. handler.prepareRequest(info.options);
  5884. }
  5885. }
  5886. return info;
  5887. }
  5888. _mergeHeaders(headers) {
  5889. if (this.requestOptions && this.requestOptions.headers) {
  5890. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {}));
  5891. }
  5892. return lowercaseKeys(headers || {});
  5893. }
  5894. _getExistingOrDefaultHeader(additionalHeaders, header, _default) {
  5895. let clientHeader;
  5896. if (this.requestOptions && this.requestOptions.headers) {
  5897. clientHeader = lowercaseKeys(this.requestOptions.headers)[header];
  5898. }
  5899. return additionalHeaders[header] || clientHeader || _default;
  5900. }
  5901. _getAgent(parsedUrl) {
  5902. let agent;
  5903. const proxyUrl = pm.getProxyUrl(parsedUrl);
  5904. const useProxy = proxyUrl && proxyUrl.hostname;
  5905. if (this._keepAlive && useProxy) {
  5906. agent = this._proxyAgent;
  5907. }
  5908. if (!useProxy) {
  5909. agent = this._agent;
  5910. }
  5911. // if agent is already assigned use that agent.
  5912. if (agent) {
  5913. return agent;
  5914. }
  5915. const usingSsl = parsedUrl.protocol === 'https:';
  5916. let maxSockets = 100;
  5917. if (this.requestOptions) {
  5918. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  5919. }
  5920. // This is `useProxy` again, but we need to check `proxyURl` directly for TypeScripts's flow analysis.
  5921. if (proxyUrl && proxyUrl.hostname) {
  5922. const agentOptions = {
  5923. maxSockets,
  5924. keepAlive: this._keepAlive,
  5925. proxy: Object.assign(Object.assign({}, ((proxyUrl.username || proxyUrl.password) && {
  5926. proxyAuth: `${proxyUrl.username}:${proxyUrl.password}`
  5927. })), { host: proxyUrl.hostname, port: proxyUrl.port })
  5928. };
  5929. let tunnelAgent;
  5930. const overHttps = proxyUrl.protocol === 'https:';
  5931. if (usingSsl) {
  5932. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  5933. }
  5934. else {
  5935. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  5936. }
  5937. agent = tunnelAgent(agentOptions);
  5938. this._proxyAgent = agent;
  5939. }
  5940. // if tunneling agent isn't assigned create a new agent
  5941. if (!agent) {
  5942. const options = { keepAlive: this._keepAlive, maxSockets };
  5943. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  5944. this._agent = agent;
  5945. }
  5946. if (usingSsl && this._ignoreSslError) {
  5947. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  5948. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  5949. // we have to cast it to any and change it directly
  5950. agent.options = Object.assign(agent.options || {}, {
  5951. rejectUnauthorized: false
  5952. });
  5953. }
  5954. return agent;
  5955. }
  5956. _getProxyAgentDispatcher(parsedUrl, proxyUrl) {
  5957. let proxyAgent;
  5958. if (this._keepAlive) {
  5959. proxyAgent = this._proxyAgentDispatcher;
  5960. }
  5961. // if agent is already assigned use that agent.
  5962. if (proxyAgent) {
  5963. return proxyAgent;
  5964. }
  5965. const usingSsl = parsedUrl.protocol === 'https:';
  5966. proxyAgent = new undici_1.ProxyAgent(Object.assign({ uri: proxyUrl.href, pipelining: !this._keepAlive ? 0 : 1 }, ((proxyUrl.username || proxyUrl.password) && {
  5967. token: `${proxyUrl.username}:${proxyUrl.password}`
  5968. })));
  5969. this._proxyAgentDispatcher = proxyAgent;
  5970. if (usingSsl && this._ignoreSslError) {
  5971. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  5972. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  5973. // we have to cast it to any and change it directly
  5974. proxyAgent.options = Object.assign(proxyAgent.options.requestTls || {}, {
  5975. rejectUnauthorized: false
  5976. });
  5977. }
  5978. return proxyAgent;
  5979. }
  5980. _performExponentialBackoff(retryNumber) {
  5981. return __awaiter(this, void 0, void 0, function* () {
  5982. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  5983. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  5984. return new Promise(resolve => setTimeout(() => resolve(), ms));
  5985. });
  5986. }
  5987. _processResponse(res, options) {
  5988. return __awaiter(this, void 0, void 0, function* () {
  5989. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  5990. const statusCode = res.message.statusCode || 0;
  5991. const response = {
  5992. statusCode,
  5993. result: null,
  5994. headers: {}
  5995. };
  5996. // not found leads to null obj returned
  5997. if (statusCode === HttpCodes.NotFound) {
  5998. resolve(response);
  5999. }
  6000. // get the result from the body
  6001. function dateTimeDeserializer(key, value) {
  6002. if (typeof value === 'string') {
  6003. const a = new Date(value);
  6004. if (!isNaN(a.valueOf())) {
  6005. return a;
  6006. }
  6007. }
  6008. return value;
  6009. }
  6010. let obj;
  6011. let contents;
  6012. try {
  6013. contents = yield res.readBody();
  6014. if (contents && contents.length > 0) {
  6015. if (options && options.deserializeDates) {
  6016. obj = JSON.parse(contents, dateTimeDeserializer);
  6017. }
  6018. else {
  6019. obj = JSON.parse(contents);
  6020. }
  6021. response.result = obj;
  6022. }
  6023. response.headers = res.message.headers;
  6024. }
  6025. catch (err) {
  6026. // Invalid resource (contents not json); leaving result obj null
  6027. }
  6028. // note that 3xx redirects are handled by the http layer.
  6029. if (statusCode > 299) {
  6030. let msg;
  6031. // if exception/error in body, attempt to get better error
  6032. if (obj && obj.message) {
  6033. msg = obj.message;
  6034. }
  6035. else if (contents && contents.length > 0) {
  6036. // it may be the case that the exception is in the body message as string
  6037. msg = contents;
  6038. }
  6039. else {
  6040. msg = `Failed request: (${statusCode})`;
  6041. }
  6042. const err = new HttpClientError(msg, statusCode);
  6043. err.result = response.result;
  6044. reject(err);
  6045. }
  6046. else {
  6047. resolve(response);
  6048. }
  6049. }));
  6050. });
  6051. }
  6052. }
  6053. exports.HttpClient = HttpClient;
  6054. const lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});
  6055. //# sourceMappingURL=index.js.map
  6056. /***/ }),
  6057. /***/ 9835:
  6058. /***/ ((__unused_webpack_module, exports) => {
  6059. "use strict";
  6060. Object.defineProperty(exports, "__esModule", ({ value: true }));
  6061. exports.checkBypass = exports.getProxyUrl = void 0;
  6062. function getProxyUrl(reqUrl) {
  6063. const usingSsl = reqUrl.protocol === 'https:';
  6064. if (checkBypass(reqUrl)) {
  6065. return undefined;
  6066. }
  6067. const proxyVar = (() => {
  6068. if (usingSsl) {
  6069. return process.env['https_proxy'] || process.env['HTTPS_PROXY'];
  6070. }
  6071. else {
  6072. return process.env['http_proxy'] || process.env['HTTP_PROXY'];
  6073. }
  6074. })();
  6075. if (proxyVar) {
  6076. try {
  6077. return new URL(proxyVar);
  6078. }
  6079. catch (_a) {
  6080. if (!proxyVar.startsWith('http://') && !proxyVar.startsWith('https://'))
  6081. return new URL(`http://${proxyVar}`);
  6082. }
  6083. }
  6084. else {
  6085. return undefined;
  6086. }
  6087. }
  6088. exports.getProxyUrl = getProxyUrl;
  6089. function checkBypass(reqUrl) {
  6090. if (!reqUrl.hostname) {
  6091. return false;
  6092. }
  6093. const reqHost = reqUrl.hostname;
  6094. if (isLoopbackAddress(reqHost)) {
  6095. return true;
  6096. }
  6097. const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';
  6098. if (!noProxy) {
  6099. return false;
  6100. }
  6101. // Determine the request port
  6102. let reqPort;
  6103. if (reqUrl.port) {
  6104. reqPort = Number(reqUrl.port);
  6105. }
  6106. else if (reqUrl.protocol === 'http:') {
  6107. reqPort = 80;
  6108. }
  6109. else if (reqUrl.protocol === 'https:') {
  6110. reqPort = 443;
  6111. }
  6112. // Format the request hostname and hostname with port
  6113. const upperReqHosts = [reqUrl.hostname.toUpperCase()];
  6114. if (typeof reqPort === 'number') {
  6115. upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);
  6116. }
  6117. // Compare request host against noproxy
  6118. for (const upperNoProxyItem of noProxy
  6119. .split(',')
  6120. .map(x => x.trim().toUpperCase())
  6121. .filter(x => x)) {
  6122. if (upperNoProxyItem === '*' ||
  6123. upperReqHosts.some(x => x === upperNoProxyItem ||
  6124. x.endsWith(`.${upperNoProxyItem}`) ||
  6125. (upperNoProxyItem.startsWith('.') &&
  6126. x.endsWith(`${upperNoProxyItem}`)))) {
  6127. return true;
  6128. }
  6129. }
  6130. return false;
  6131. }
  6132. exports.checkBypass = checkBypass;
  6133. function isLoopbackAddress(host) {
  6134. const hostLower = host.toLowerCase();
  6135. return (hostLower === 'localhost' ||
  6136. hostLower.startsWith('127.') ||
  6137. hostLower.startsWith('[::1]') ||
  6138. hostLower.startsWith('[0:0:0:0:0:0:0:1]'));
  6139. }
  6140. //# sourceMappingURL=proxy.js.map
  6141. /***/ }),
  6142. /***/ 1962:
  6143. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  6144. "use strict";
  6145. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  6146. if (k2 === undefined) k2 = k;
  6147. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  6148. }) : (function(o, m, k, k2) {
  6149. if (k2 === undefined) k2 = k;
  6150. o[k2] = m[k];
  6151. }));
  6152. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  6153. Object.defineProperty(o, "default", { enumerable: true, value: v });
  6154. }) : function(o, v) {
  6155. o["default"] = v;
  6156. });
  6157. var __importStar = (this && this.__importStar) || function (mod) {
  6158. if (mod && mod.__esModule) return mod;
  6159. var result = {};
  6160. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  6161. __setModuleDefault(result, mod);
  6162. return result;
  6163. };
  6164. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6165. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6166. return new (P || (P = Promise))(function (resolve, reject) {
  6167. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6168. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6169. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6170. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6171. });
  6172. };
  6173. var _a;
  6174. Object.defineProperty(exports, "__esModule", ({ value: true }));
  6175. 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;
  6176. const fs = __importStar(__nccwpck_require__(7147));
  6177. const path = __importStar(__nccwpck_require__(1017));
  6178. _a = fs.promises
  6179. // export const {open} = 'fs'
  6180. , 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;
  6181. // export const {open} = 'fs'
  6182. exports.IS_WINDOWS = process.platform === 'win32';
  6183. // See https://github.com/nodejs/node/blob/d0153aee367422d0858105abec186da4dff0a0c5/deps/uv/include/uv/win.h#L691
  6184. exports.UV_FS_O_EXLOCK = 0x10000000;
  6185. exports.READONLY = fs.constants.O_RDONLY;
  6186. function exists(fsPath) {
  6187. return __awaiter(this, void 0, void 0, function* () {
  6188. try {
  6189. yield exports.stat(fsPath);
  6190. }
  6191. catch (err) {
  6192. if (err.code === 'ENOENT') {
  6193. return false;
  6194. }
  6195. throw err;
  6196. }
  6197. return true;
  6198. });
  6199. }
  6200. exports.exists = exists;
  6201. function isDirectory(fsPath, useStat = false) {
  6202. return __awaiter(this, void 0, void 0, function* () {
  6203. const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath);
  6204. return stats.isDirectory();
  6205. });
  6206. }
  6207. exports.isDirectory = isDirectory;
  6208. /**
  6209. * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:
  6210. * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases).
  6211. */
  6212. function isRooted(p) {
  6213. p = normalizeSeparators(p);
  6214. if (!p) {
  6215. throw new Error('isRooted() parameter "p" cannot be empty');
  6216. }
  6217. if (exports.IS_WINDOWS) {
  6218. return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello
  6219. ); // e.g. C: or C:\hello
  6220. }
  6221. return p.startsWith('/');
  6222. }
  6223. exports.isRooted = isRooted;
  6224. /**
  6225. * Best effort attempt to determine whether a file exists and is executable.
  6226. * @param filePath file path to check
  6227. * @param extensions additional file extensions to try
  6228. * @return if file exists and is executable, returns the file path. otherwise empty string.
  6229. */
  6230. function tryGetExecutablePath(filePath, extensions) {
  6231. return __awaiter(this, void 0, void 0, function* () {
  6232. let stats = undefined;
  6233. try {
  6234. // test file exists
  6235. stats = yield exports.stat(filePath);
  6236. }
  6237. catch (err) {
  6238. if (err.code !== 'ENOENT') {
  6239. // eslint-disable-next-line no-console
  6240. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  6241. }
  6242. }
  6243. if (stats && stats.isFile()) {
  6244. if (exports.IS_WINDOWS) {
  6245. // on Windows, test for valid extension
  6246. const upperExt = path.extname(filePath).toUpperCase();
  6247. if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) {
  6248. return filePath;
  6249. }
  6250. }
  6251. else {
  6252. if (isUnixExecutable(stats)) {
  6253. return filePath;
  6254. }
  6255. }
  6256. }
  6257. // try each extension
  6258. const originalFilePath = filePath;
  6259. for (const extension of extensions) {
  6260. filePath = originalFilePath + extension;
  6261. stats = undefined;
  6262. try {
  6263. stats = yield exports.stat(filePath);
  6264. }
  6265. catch (err) {
  6266. if (err.code !== 'ENOENT') {
  6267. // eslint-disable-next-line no-console
  6268. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  6269. }
  6270. }
  6271. if (stats && stats.isFile()) {
  6272. if (exports.IS_WINDOWS) {
  6273. // preserve the case of the actual file (since an extension was appended)
  6274. try {
  6275. const directory = path.dirname(filePath);
  6276. const upperName = path.basename(filePath).toUpperCase();
  6277. for (const actualName of yield exports.readdir(directory)) {
  6278. if (upperName === actualName.toUpperCase()) {
  6279. filePath = path.join(directory, actualName);
  6280. break;
  6281. }
  6282. }
  6283. }
  6284. catch (err) {
  6285. // eslint-disable-next-line no-console
  6286. console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`);
  6287. }
  6288. return filePath;
  6289. }
  6290. else {
  6291. if (isUnixExecutable(stats)) {
  6292. return filePath;
  6293. }
  6294. }
  6295. }
  6296. }
  6297. return '';
  6298. });
  6299. }
  6300. exports.tryGetExecutablePath = tryGetExecutablePath;
  6301. function normalizeSeparators(p) {
  6302. p = p || '';
  6303. if (exports.IS_WINDOWS) {
  6304. // convert slashes on Windows
  6305. p = p.replace(/\//g, '\\');
  6306. // remove redundant slashes
  6307. return p.replace(/\\\\+/g, '\\');
  6308. }
  6309. // remove redundant slashes
  6310. return p.replace(/\/\/+/g, '/');
  6311. }
  6312. // on Mac/Linux, test the execute bit
  6313. // R W X R W X R W X
  6314. // 256 128 64 32 16 8 4 2 1
  6315. function isUnixExecutable(stats) {
  6316. return ((stats.mode & 1) > 0 ||
  6317. ((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||
  6318. ((stats.mode & 64) > 0 && stats.uid === process.getuid()));
  6319. }
  6320. // Get the path of cmd.exe in windows
  6321. function getCmdPath() {
  6322. var _a;
  6323. return (_a = process.env['COMSPEC']) !== null && _a !== void 0 ? _a : `cmd.exe`;
  6324. }
  6325. exports.getCmdPath = getCmdPath;
  6326. //# sourceMappingURL=io-util.js.map
  6327. /***/ }),
  6328. /***/ 7436:
  6329. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  6330. "use strict";
  6331. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  6332. if (k2 === undefined) k2 = k;
  6333. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  6334. }) : (function(o, m, k, k2) {
  6335. if (k2 === undefined) k2 = k;
  6336. o[k2] = m[k];
  6337. }));
  6338. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  6339. Object.defineProperty(o, "default", { enumerable: true, value: v });
  6340. }) : function(o, v) {
  6341. o["default"] = v;
  6342. });
  6343. var __importStar = (this && this.__importStar) || function (mod) {
  6344. if (mod && mod.__esModule) return mod;
  6345. var result = {};
  6346. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  6347. __setModuleDefault(result, mod);
  6348. return result;
  6349. };
  6350. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6351. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6352. return new (P || (P = Promise))(function (resolve, reject) {
  6353. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6354. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6355. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6356. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6357. });
  6358. };
  6359. Object.defineProperty(exports, "__esModule", ({ value: true }));
  6360. exports.findInPath = exports.which = exports.mkdirP = exports.rmRF = exports.mv = exports.cp = void 0;
  6361. const assert_1 = __nccwpck_require__(9491);
  6362. const path = __importStar(__nccwpck_require__(1017));
  6363. const ioUtil = __importStar(__nccwpck_require__(1962));
  6364. /**
  6365. * Copies a file or folder.
  6366. * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js
  6367. *
  6368. * @param source source path
  6369. * @param dest destination path
  6370. * @param options optional. See CopyOptions.
  6371. */
  6372. function cp(source, dest, options = {}) {
  6373. return __awaiter(this, void 0, void 0, function* () {
  6374. const { force, recursive, copySourceDirectory } = readCopyOptions(options);
  6375. const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null;
  6376. // Dest is an existing file, but not forcing
  6377. if (destStat && destStat.isFile() && !force) {
  6378. return;
  6379. }
  6380. // If dest is an existing directory, should copy inside.
  6381. const newDest = destStat && destStat.isDirectory() && copySourceDirectory
  6382. ? path.join(dest, path.basename(source))
  6383. : dest;
  6384. if (!(yield ioUtil.exists(source))) {
  6385. throw new Error(`no such file or directory: ${source}`);
  6386. }
  6387. const sourceStat = yield ioUtil.stat(source);
  6388. if (sourceStat.isDirectory()) {
  6389. if (!recursive) {
  6390. throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`);
  6391. }
  6392. else {
  6393. yield cpDirRecursive(source, newDest, 0, force);
  6394. }
  6395. }
  6396. else {
  6397. if (path.relative(source, newDest) === '') {
  6398. // a file cannot be copied to itself
  6399. throw new Error(`'${newDest}' and '${source}' are the same file`);
  6400. }
  6401. yield copyFile(source, newDest, force);
  6402. }
  6403. });
  6404. }
  6405. exports.cp = cp;
  6406. /**
  6407. * Moves a path.
  6408. *
  6409. * @param source source path
  6410. * @param dest destination path
  6411. * @param options optional. See MoveOptions.
  6412. */
  6413. function mv(source, dest, options = {}) {
  6414. return __awaiter(this, void 0, void 0, function* () {
  6415. if (yield ioUtil.exists(dest)) {
  6416. let destExists = true;
  6417. if (yield ioUtil.isDirectory(dest)) {
  6418. // If dest is directory copy src into dest
  6419. dest = path.join(dest, path.basename(source));
  6420. destExists = yield ioUtil.exists(dest);
  6421. }
  6422. if (destExists) {
  6423. if (options.force == null || options.force) {
  6424. yield rmRF(dest);
  6425. }
  6426. else {
  6427. throw new Error('Destination already exists');
  6428. }
  6429. }
  6430. }
  6431. yield mkdirP(path.dirname(dest));
  6432. yield ioUtil.rename(source, dest);
  6433. });
  6434. }
  6435. exports.mv = mv;
  6436. /**
  6437. * Remove a path recursively with force
  6438. *
  6439. * @param inputPath path to remove
  6440. */
  6441. function rmRF(inputPath) {
  6442. return __awaiter(this, void 0, void 0, function* () {
  6443. if (ioUtil.IS_WINDOWS) {
  6444. // Check for invalid characters
  6445. // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file
  6446. if (/[*"<>|]/.test(inputPath)) {
  6447. throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows');
  6448. }
  6449. }
  6450. try {
  6451. // note if path does not exist, error is silent
  6452. yield ioUtil.rm(inputPath, {
  6453. force: true,
  6454. maxRetries: 3,
  6455. recursive: true,
  6456. retryDelay: 300
  6457. });
  6458. }
  6459. catch (err) {
  6460. throw new Error(`File was unable to be removed ${err}`);
  6461. }
  6462. });
  6463. }
  6464. exports.rmRF = rmRF;
  6465. /**
  6466. * Make a directory. Creates the full path with folders in between
  6467. * Will throw if it fails
  6468. *
  6469. * @param fsPath path to create
  6470. * @returns Promise<void>
  6471. */
  6472. function mkdirP(fsPath) {
  6473. return __awaiter(this, void 0, void 0, function* () {
  6474. assert_1.ok(fsPath, 'a path argument must be provided');
  6475. yield ioUtil.mkdir(fsPath, { recursive: true });
  6476. });
  6477. }
  6478. exports.mkdirP = mkdirP;
  6479. /**
  6480. * Returns path of a tool had the tool actually been invoked. Resolves via paths.
  6481. * If you check and the tool does not exist, it will throw.
  6482. *
  6483. * @param tool name of the tool
  6484. * @param check whether to check if tool exists
  6485. * @returns Promise<string> path to tool
  6486. */
  6487. function which(tool, check) {
  6488. return __awaiter(this, void 0, void 0, function* () {
  6489. if (!tool) {
  6490. throw new Error("parameter 'tool' is required");
  6491. }
  6492. // recursive when check=true
  6493. if (check) {
  6494. const result = yield which(tool, false);
  6495. if (!result) {
  6496. if (ioUtil.IS_WINDOWS) {
  6497. 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.`);
  6498. }
  6499. else {
  6500. 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.`);
  6501. }
  6502. }
  6503. return result;
  6504. }
  6505. const matches = yield findInPath(tool);
  6506. if (matches && matches.length > 0) {
  6507. return matches[0];
  6508. }
  6509. return '';
  6510. });
  6511. }
  6512. exports.which = which;
  6513. /**
  6514. * Returns a list of all occurrences of the given tool on the system path.
  6515. *
  6516. * @returns Promise<string[]> the paths of the tool
  6517. */
  6518. function findInPath(tool) {
  6519. return __awaiter(this, void 0, void 0, function* () {
  6520. if (!tool) {
  6521. throw new Error("parameter 'tool' is required");
  6522. }
  6523. // build the list of extensions to try
  6524. const extensions = [];
  6525. if (ioUtil.IS_WINDOWS && process.env['PATHEXT']) {
  6526. for (const extension of process.env['PATHEXT'].split(path.delimiter)) {
  6527. if (extension) {
  6528. extensions.push(extension);
  6529. }
  6530. }
  6531. }
  6532. // if it's rooted, return it if exists. otherwise return empty.
  6533. if (ioUtil.isRooted(tool)) {
  6534. const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions);
  6535. if (filePath) {
  6536. return [filePath];
  6537. }
  6538. return [];
  6539. }
  6540. // if any path separators, return empty
  6541. if (tool.includes(path.sep)) {
  6542. return [];
  6543. }
  6544. // build the list of directories
  6545. //
  6546. // Note, technically "where" checks the current directory on Windows. From a toolkit perspective,
  6547. // it feels like we should not do this. Checking the current directory seems like more of a use
  6548. // case of a shell, and the which() function exposed by the toolkit should strive for consistency
  6549. // across platforms.
  6550. const directories = [];
  6551. if (process.env.PATH) {
  6552. for (const p of process.env.PATH.split(path.delimiter)) {
  6553. if (p) {
  6554. directories.push(p);
  6555. }
  6556. }
  6557. }
  6558. // find all matches
  6559. const matches = [];
  6560. for (const directory of directories) {
  6561. const filePath = yield ioUtil.tryGetExecutablePath(path.join(directory, tool), extensions);
  6562. if (filePath) {
  6563. matches.push(filePath);
  6564. }
  6565. }
  6566. return matches;
  6567. });
  6568. }
  6569. exports.findInPath = findInPath;
  6570. function readCopyOptions(options) {
  6571. const force = options.force == null ? true : options.force;
  6572. const recursive = Boolean(options.recursive);
  6573. const copySourceDirectory = options.copySourceDirectory == null
  6574. ? true
  6575. : Boolean(options.copySourceDirectory);
  6576. return { force, recursive, copySourceDirectory };
  6577. }
  6578. function cpDirRecursive(sourceDir, destDir, currentDepth, force) {
  6579. return __awaiter(this, void 0, void 0, function* () {
  6580. // Ensure there is not a run away recursive copy
  6581. if (currentDepth >= 255)
  6582. return;
  6583. currentDepth++;
  6584. yield mkdirP(destDir);
  6585. const files = yield ioUtil.readdir(sourceDir);
  6586. for (const fileName of files) {
  6587. const srcFile = `${sourceDir}/${fileName}`;
  6588. const destFile = `${destDir}/${fileName}`;
  6589. const srcFileStat = yield ioUtil.lstat(srcFile);
  6590. if (srcFileStat.isDirectory()) {
  6591. // Recurse
  6592. yield cpDirRecursive(srcFile, destFile, currentDepth, force);
  6593. }
  6594. else {
  6595. yield copyFile(srcFile, destFile, force);
  6596. }
  6597. }
  6598. // Change the mode for the newly created directory
  6599. yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode);
  6600. });
  6601. }
  6602. // Buffered file copy
  6603. function copyFile(srcFile, destFile, force) {
  6604. return __awaiter(this, void 0, void 0, function* () {
  6605. if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) {
  6606. // unlink/re-link it
  6607. try {
  6608. yield ioUtil.lstat(destFile);
  6609. yield ioUtil.unlink(destFile);
  6610. }
  6611. catch (e) {
  6612. // Try to override file permission
  6613. if (e.code === 'EPERM') {
  6614. yield ioUtil.chmod(destFile, '0666');
  6615. yield ioUtil.unlink(destFile);
  6616. }
  6617. // other errors = it doesn't exist, no work to do
  6618. }
  6619. // Copy over symlink
  6620. const symlinkFull = yield ioUtil.readlink(srcFile);
  6621. yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null);
  6622. }
  6623. else if (!(yield ioUtil.exists(destFile)) || force) {
  6624. yield ioUtil.copyFile(srcFile, destFile);
  6625. }
  6626. });
  6627. }
  6628. //# sourceMappingURL=io.js.map
  6629. /***/ }),
  6630. /***/ 2473:
  6631. /***/ (function(module, exports, __nccwpck_require__) {
  6632. "use strict";
  6633. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  6634. if (k2 === undefined) k2 = k;
  6635. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  6636. }) : (function(o, m, k, k2) {
  6637. if (k2 === undefined) k2 = k;
  6638. o[k2] = m[k];
  6639. }));
  6640. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  6641. Object.defineProperty(o, "default", { enumerable: true, value: v });
  6642. }) : function(o, v) {
  6643. o["default"] = v;
  6644. });
  6645. var __importStar = (this && this.__importStar) || function (mod) {
  6646. if (mod && mod.__esModule) return mod;
  6647. var result = {};
  6648. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  6649. __setModuleDefault(result, mod);
  6650. return result;
  6651. };
  6652. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6653. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6654. return new (P || (P = Promise))(function (resolve, reject) {
  6655. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6656. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6657. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6658. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6659. });
  6660. };
  6661. Object.defineProperty(exports, "__esModule", ({ value: true }));
  6662. exports._readLinuxVersionFile = exports._getOsVersion = exports._findMatch = void 0;
  6663. const semver = __importStar(__nccwpck_require__(5911));
  6664. const core_1 = __nccwpck_require__(2186);
  6665. // needs to be require for core node modules to be mocked
  6666. /* eslint @typescript-eslint/no-require-imports: 0 */
  6667. const os = __nccwpck_require__(2037);
  6668. const cp = __nccwpck_require__(2081);
  6669. const fs = __nccwpck_require__(7147);
  6670. function _findMatch(versionSpec, stable, candidates, archFilter) {
  6671. return __awaiter(this, void 0, void 0, function* () {
  6672. const platFilter = os.platform();
  6673. let result;
  6674. let match;
  6675. let file;
  6676. for (const candidate of candidates) {
  6677. const version = candidate.version;
  6678. core_1.debug(`check ${version} satisfies ${versionSpec}`);
  6679. if (semver.satisfies(version, versionSpec) &&
  6680. (!stable || candidate.stable === stable)) {
  6681. file = candidate.files.find(item => {
  6682. core_1.debug(`${item.arch}===${archFilter} && ${item.platform}===${platFilter}`);
  6683. let chk = item.arch === archFilter && item.platform === platFilter;
  6684. if (chk && item.platform_version) {
  6685. const osVersion = module.exports._getOsVersion();
  6686. if (osVersion === item.platform_version) {
  6687. chk = true;
  6688. }
  6689. else {
  6690. chk = semver.satisfies(osVersion, item.platform_version);
  6691. }
  6692. }
  6693. return chk;
  6694. });
  6695. if (file) {
  6696. core_1.debug(`matched ${candidate.version}`);
  6697. match = candidate;
  6698. break;
  6699. }
  6700. }
  6701. }
  6702. if (match && file) {
  6703. // clone since we're mutating the file list to be only the file that matches
  6704. result = Object.assign({}, match);
  6705. result.files = [file];
  6706. }
  6707. return result;
  6708. });
  6709. }
  6710. exports._findMatch = _findMatch;
  6711. function _getOsVersion() {
  6712. // TODO: add windows and other linux, arm variants
  6713. // right now filtering on version is only an ubuntu and macos scenario for tools we build for hosted (python)
  6714. const plat = os.platform();
  6715. let version = '';
  6716. if (plat === 'darwin') {
  6717. version = cp.execSync('sw_vers -productVersion').toString();
  6718. }
  6719. else if (plat === 'linux') {
  6720. // lsb_release process not in some containers, readfile
  6721. // Run cat /etc/lsb-release
  6722. // DISTRIB_ID=Ubuntu
  6723. // DISTRIB_RELEASE=18.04
  6724. // DISTRIB_CODENAME=bionic
  6725. // DISTRIB_DESCRIPTION="Ubuntu 18.04.4 LTS"
  6726. const lsbContents = module.exports._readLinuxVersionFile();
  6727. if (lsbContents) {
  6728. const lines = lsbContents.split('\n');
  6729. for (const line of lines) {
  6730. const parts = line.split('=');
  6731. if (parts.length === 2 &&
  6732. (parts[0].trim() === 'VERSION_ID' ||
  6733. parts[0].trim() === 'DISTRIB_RELEASE')) {
  6734. version = parts[1]
  6735. .trim()
  6736. .replace(/^"/, '')
  6737. .replace(/"$/, '');
  6738. break;
  6739. }
  6740. }
  6741. }
  6742. }
  6743. return version;
  6744. }
  6745. exports._getOsVersion = _getOsVersion;
  6746. function _readLinuxVersionFile() {
  6747. const lsbReleaseFile = '/etc/lsb-release';
  6748. const osReleaseFile = '/etc/os-release';
  6749. let contents = '';
  6750. if (fs.existsSync(lsbReleaseFile)) {
  6751. contents = fs.readFileSync(lsbReleaseFile).toString();
  6752. }
  6753. else if (fs.existsSync(osReleaseFile)) {
  6754. contents = fs.readFileSync(osReleaseFile).toString();
  6755. }
  6756. return contents;
  6757. }
  6758. exports._readLinuxVersionFile = _readLinuxVersionFile;
  6759. //# sourceMappingURL=manifest.js.map
  6760. /***/ }),
  6761. /***/ 8279:
  6762. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  6763. "use strict";
  6764. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  6765. if (k2 === undefined) k2 = k;
  6766. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  6767. }) : (function(o, m, k, k2) {
  6768. if (k2 === undefined) k2 = k;
  6769. o[k2] = m[k];
  6770. }));
  6771. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  6772. Object.defineProperty(o, "default", { enumerable: true, value: v });
  6773. }) : function(o, v) {
  6774. o["default"] = v;
  6775. });
  6776. var __importStar = (this && this.__importStar) || function (mod) {
  6777. if (mod && mod.__esModule) return mod;
  6778. var result = {};
  6779. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  6780. __setModuleDefault(result, mod);
  6781. return result;
  6782. };
  6783. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6784. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6785. return new (P || (P = Promise))(function (resolve, reject) {
  6786. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6787. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6788. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6789. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6790. });
  6791. };
  6792. Object.defineProperty(exports, "__esModule", ({ value: true }));
  6793. exports.RetryHelper = void 0;
  6794. const core = __importStar(__nccwpck_require__(2186));
  6795. /**
  6796. * Internal class for retries
  6797. */
  6798. class RetryHelper {
  6799. constructor(maxAttempts, minSeconds, maxSeconds) {
  6800. if (maxAttempts < 1) {
  6801. throw new Error('max attempts should be greater than or equal to 1');
  6802. }
  6803. this.maxAttempts = maxAttempts;
  6804. this.minSeconds = Math.floor(minSeconds);
  6805. this.maxSeconds = Math.floor(maxSeconds);
  6806. if (this.minSeconds > this.maxSeconds) {
  6807. throw new Error('min seconds should be less than or equal to max seconds');
  6808. }
  6809. }
  6810. execute(action, isRetryable) {
  6811. return __awaiter(this, void 0, void 0, function* () {
  6812. let attempt = 1;
  6813. while (attempt < this.maxAttempts) {
  6814. // Try
  6815. try {
  6816. return yield action();
  6817. }
  6818. catch (err) {
  6819. if (isRetryable && !isRetryable(err)) {
  6820. throw err;
  6821. }
  6822. core.info(err.message);
  6823. }
  6824. // Sleep
  6825. const seconds = this.getSleepAmount();
  6826. core.info(`Waiting ${seconds} seconds before trying again`);
  6827. yield this.sleep(seconds);
  6828. attempt++;
  6829. }
  6830. // Last attempt
  6831. return yield action();
  6832. });
  6833. }
  6834. getSleepAmount() {
  6835. return (Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) +
  6836. this.minSeconds);
  6837. }
  6838. sleep(seconds) {
  6839. return __awaiter(this, void 0, void 0, function* () {
  6840. return new Promise(resolve => setTimeout(resolve, seconds * 1000));
  6841. });
  6842. }
  6843. }
  6844. exports.RetryHelper = RetryHelper;
  6845. //# sourceMappingURL=retry-helper.js.map
  6846. /***/ }),
  6847. /***/ 7784:
  6848. /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
  6849. "use strict";
  6850. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  6851. if (k2 === undefined) k2 = k;
  6852. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  6853. }) : (function(o, m, k, k2) {
  6854. if (k2 === undefined) k2 = k;
  6855. o[k2] = m[k];
  6856. }));
  6857. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  6858. Object.defineProperty(o, "default", { enumerable: true, value: v });
  6859. }) : function(o, v) {
  6860. o["default"] = v;
  6861. });
  6862. var __importStar = (this && this.__importStar) || function (mod) {
  6863. if (mod && mod.__esModule) return mod;
  6864. var result = {};
  6865. if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  6866. __setModuleDefault(result, mod);
  6867. return result;
  6868. };
  6869. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6870. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6871. return new (P || (P = Promise))(function (resolve, reject) {
  6872. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6873. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6874. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6875. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6876. });
  6877. };
  6878. var __importDefault = (this && this.__importDefault) || function (mod) {
  6879. return (mod && mod.__esModule) ? mod : { "default": mod };
  6880. };
  6881. Object.defineProperty(exports, "__esModule", ({ value: true }));
  6882. 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;
  6883. const core = __importStar(__nccwpck_require__(2186));
  6884. const io = __importStar(__nccwpck_require__(7436));
  6885. const fs = __importStar(__nccwpck_require__(7147));
  6886. const mm = __importStar(__nccwpck_require__(2473));
  6887. const os = __importStar(__nccwpck_require__(2037));
  6888. const path = __importStar(__nccwpck_require__(1017));
  6889. const httpm = __importStar(__nccwpck_require__(6255));
  6890. const semver = __importStar(__nccwpck_require__(5911));
  6891. const stream = __importStar(__nccwpck_require__(2781));
  6892. const util = __importStar(__nccwpck_require__(3837));
  6893. const assert_1 = __nccwpck_require__(9491);
  6894. const v4_1 = __importDefault(__nccwpck_require__(7468));
  6895. const exec_1 = __nccwpck_require__(1514);
  6896. const retry_helper_1 = __nccwpck_require__(8279);
  6897. class HTTPError extends Error {
  6898. constructor(httpStatusCode) {
  6899. super(`Unexpected HTTP response: ${httpStatusCode}`);
  6900. this.httpStatusCode = httpStatusCode;
  6901. Object.setPrototypeOf(this, new.target.prototype);
  6902. }
  6903. }
  6904. exports.HTTPError = HTTPError;
  6905. const IS_WINDOWS = process.platform === 'win32';
  6906. const IS_MAC = process.platform === 'darwin';
  6907. const userAgent = 'actions/tool-cache';
  6908. /**
  6909. * Download a tool from an url and stream it into a file
  6910. *
  6911. * @param url url of tool to download
  6912. * @param dest path to download tool
  6913. * @param auth authorization header
  6914. * @param headers other headers
  6915. * @returns path to downloaded tool
  6916. */
  6917. function downloadTool(url, dest, auth, headers) {
  6918. return __awaiter(this, void 0, void 0, function* () {
  6919. dest = dest || path.join(_getTempDirectory(), v4_1.default());
  6920. yield io.mkdirP(path.dirname(dest));
  6921. core.debug(`Downloading ${url}`);
  6922. core.debug(`Destination ${dest}`);
  6923. const maxAttempts = 3;
  6924. const minSeconds = _getGlobal('TEST_DOWNLOAD_TOOL_RETRY_MIN_SECONDS', 10);
  6925. const maxSeconds = _getGlobal('TEST_DOWNLOAD_TOOL_RETRY_MAX_SECONDS', 20);
  6926. const retryHelper = new retry_helper_1.RetryHelper(maxAttempts, minSeconds, maxSeconds);
  6927. return yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  6928. return yield downloadToolAttempt(url, dest || '', auth, headers);
  6929. }), (err) => {
  6930. if (err instanceof HTTPError && err.httpStatusCode) {
  6931. // Don't retry anything less than 500, except 408 Request Timeout and 429 Too Many Requests
  6932. if (err.httpStatusCode < 500 &&
  6933. err.httpStatusCode !== 408 &&
  6934. err.httpStatusCode !== 429) {
  6935. return false;
  6936. }
  6937. }
  6938. // Otherwise retry
  6939. return true;
  6940. });
  6941. });
  6942. }
  6943. exports.downloadTool = downloadTool;
  6944. function downloadToolAttempt(url, dest, auth, headers) {
  6945. return __awaiter(this, void 0, void 0, function* () {
  6946. if (fs.existsSync(dest)) {
  6947. throw new Error(`Destination file path ${dest} already exists`);
  6948. }
  6949. // Get the response headers
  6950. const http = new httpm.HttpClient(userAgent, [], {
  6951. allowRetries: false
  6952. });
  6953. if (auth) {
  6954. core.debug('set auth');
  6955. if (headers === undefined) {
  6956. headers = {};
  6957. }
  6958. headers.authorization = auth;
  6959. }
  6960. const response = yield http.get(url, headers);
  6961. if (response.message.statusCode !== 200) {
  6962. const err = new HTTPError(response.message.statusCode);
  6963. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  6964. throw err;
  6965. }
  6966. // Download the response body
  6967. const pipeline = util.promisify(stream.pipeline);
  6968. const responseMessageFactory = _getGlobal('TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY', () => response.message);
  6969. const readStream = responseMessageFactory();
  6970. let succeeded = false;
  6971. try {
  6972. yield pipeline(readStream, fs.createWriteStream(dest));
  6973. core.debug('download complete');
  6974. succeeded = true;
  6975. return dest;
  6976. }
  6977. finally {
  6978. // Error, delete dest before retry
  6979. if (!succeeded) {
  6980. core.debug('download failed');
  6981. try {
  6982. yield io.rmRF(dest);
  6983. }
  6984. catch (err) {
  6985. core.debug(`Failed to delete '${dest}'. ${err.message}`);
  6986. }
  6987. }
  6988. }
  6989. });
  6990. }
  6991. /**
  6992. * Extract a .7z file
  6993. *
  6994. * @param file path to the .7z file
  6995. * @param dest destination directory. Optional.
  6996. * @param _7zPath path to 7zr.exe. Optional, for long path support. Most .7z archives do not have this
  6997. * problem. If your .7z archive contains very long paths, you can pass the path to 7zr.exe which will
  6998. * gracefully handle long paths. By default 7zdec.exe is used because it is a very small program and is
  6999. * bundled with the tool lib. However it does not support long paths. 7zr.exe is the reduced command line
  7000. * interface, it is smaller than the full command line interface, and it does support long paths. At the
  7001. * time of this writing, it is freely available from the LZMA SDK that is available on the 7zip website.
  7002. * Be sure to check the current license agreement. If 7zr.exe is bundled with your action, then the path
  7003. * to 7zr.exe can be pass to this function.
  7004. * @returns path to the destination directory
  7005. */
  7006. function extract7z(file, dest, _7zPath) {
  7007. return __awaiter(this, void 0, void 0, function* () {
  7008. assert_1.ok(IS_WINDOWS, 'extract7z() not supported on current OS');
  7009. assert_1.ok(file, 'parameter "file" is required');
  7010. dest = yield _createExtractFolder(dest);
  7011. const originalCwd = process.cwd();
  7012. process.chdir(dest);
  7013. if (_7zPath) {
  7014. try {
  7015. const logLevel = core.isDebug() ? '-bb1' : '-bb0';
  7016. const args = [
  7017. 'x',
  7018. logLevel,
  7019. '-bd',
  7020. '-sccUTF-8',
  7021. file
  7022. ];
  7023. const options = {
  7024. silent: true
  7025. };
  7026. yield exec_1.exec(`"${_7zPath}"`, args, options);
  7027. }
  7028. finally {
  7029. process.chdir(originalCwd);
  7030. }
  7031. }
  7032. else {
  7033. const escapedScript = path
  7034. .join(__dirname, '..', 'scripts', 'Invoke-7zdec.ps1')
  7035. .replace(/'/g, "''")
  7036. .replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  7037. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  7038. const escapedTarget = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  7039. const command = `& '${escapedScript}' -Source '${escapedFile}' -Target '${escapedTarget}'`;
  7040. const args = [
  7041. '-NoLogo',
  7042. '-Sta',
  7043. '-NoProfile',
  7044. '-NonInteractive',
  7045. '-ExecutionPolicy',
  7046. 'Unrestricted',
  7047. '-Command',
  7048. command
  7049. ];
  7050. const options = {
  7051. silent: true
  7052. };
  7053. try {
  7054. const powershellPath = yield io.which('powershell', true);
  7055. yield exec_1.exec(`"${powershellPath}"`, args, options);
  7056. }
  7057. finally {
  7058. process.chdir(originalCwd);
  7059. }
  7060. }
  7061. return dest;
  7062. });
  7063. }
  7064. exports.extract7z = extract7z;
  7065. /**
  7066. * Extract a compressed tar archive
  7067. *
  7068. * @param file path to the tar
  7069. * @param dest destination directory. Optional.
  7070. * @param flags flags for the tar command to use for extraction. Defaults to 'xz' (extracting gzipped tars). Optional.
  7071. * @returns path to the destination directory
  7072. */
  7073. function extractTar(file, dest, flags = 'xz') {
  7074. return __awaiter(this, void 0, void 0, function* () {
  7075. if (!file) {
  7076. throw new Error("parameter 'file' is required");
  7077. }
  7078. // Create dest
  7079. dest = yield _createExtractFolder(dest);
  7080. // Determine whether GNU tar
  7081. core.debug('Checking tar --version');
  7082. let versionOutput = '';
  7083. yield exec_1.exec('tar --version', [], {
  7084. ignoreReturnCode: true,
  7085. silent: true,
  7086. listeners: {
  7087. stdout: (data) => (versionOutput += data.toString()),
  7088. stderr: (data) => (versionOutput += data.toString())
  7089. }
  7090. });
  7091. core.debug(versionOutput.trim());
  7092. const isGnuTar = versionOutput.toUpperCase().includes('GNU TAR');
  7093. // Initialize args
  7094. let args;
  7095. if (flags instanceof Array) {
  7096. args = flags;
  7097. }
  7098. else {
  7099. args = [flags];
  7100. }
  7101. if (core.isDebug() && !flags.includes('v')) {
  7102. args.push('-v');
  7103. }
  7104. let destArg = dest;
  7105. let fileArg = file;
  7106. if (IS_WINDOWS && isGnuTar) {
  7107. args.push('--force-local');
  7108. destArg = dest.replace(/\\/g, '/');
  7109. // Technically only the dest needs to have `/` but for aesthetic consistency
  7110. // convert slashes in the file arg too.
  7111. fileArg = file.replace(/\\/g, '/');
  7112. }
  7113. if (isGnuTar) {
  7114. // Suppress warnings when using GNU tar to extract archives created by BSD tar
  7115. args.push('--warning=no-unknown-keyword');
  7116. args.push('--overwrite');
  7117. }
  7118. args.push('-C', destArg, '-f', fileArg);
  7119. yield exec_1.exec(`tar`, args);
  7120. return dest;
  7121. });
  7122. }
  7123. exports.extractTar = extractTar;
  7124. /**
  7125. * Extract a xar compatible archive
  7126. *
  7127. * @param file path to the archive
  7128. * @param dest destination directory. Optional.
  7129. * @param flags flags for the xar. Optional.
  7130. * @returns path to the destination directory
  7131. */
  7132. function extractXar(file, dest, flags = []) {
  7133. return __awaiter(this, void 0, void 0, function* () {
  7134. assert_1.ok(IS_MAC, 'extractXar() not supported on current OS');
  7135. assert_1.ok(file, 'parameter "file" is required');
  7136. dest = yield _createExtractFolder(dest);
  7137. let args;
  7138. if (flags instanceof Array) {
  7139. args = flags;
  7140. }
  7141. else {
  7142. args = [flags];
  7143. }
  7144. args.push('-x', '-C', dest, '-f', file);
  7145. if (core.isDebug()) {
  7146. args.push('-v');
  7147. }
  7148. const xarPath = yield io.which('xar', true);
  7149. yield exec_1.exec(`"${xarPath}"`, _unique(args));
  7150. return dest;
  7151. });
  7152. }
  7153. exports.extractXar = extractXar;
  7154. /**
  7155. * Extract a zip
  7156. *
  7157. * @param file path to the zip
  7158. * @param dest destination directory. Optional.
  7159. * @returns path to the destination directory
  7160. */
  7161. function extractZip(file, dest) {
  7162. return __awaiter(this, void 0, void 0, function* () {
  7163. if (!file) {
  7164. throw new Error("parameter 'file' is required");
  7165. }
  7166. dest = yield _createExtractFolder(dest);
  7167. if (IS_WINDOWS) {
  7168. yield extractZipWin(file, dest);
  7169. }
  7170. else {
  7171. yield extractZipNix(file, dest);
  7172. }
  7173. return dest;
  7174. });
  7175. }
  7176. exports.extractZip = extractZip;
  7177. function extractZipWin(file, dest) {
  7178. return __awaiter(this, void 0, void 0, function* () {
  7179. // build the powershell command
  7180. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  7181. const escapedDest = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  7182. const pwshPath = yield io.which('pwsh', false);
  7183. //To match the file overwrite behavior on nix systems, we use the overwrite = true flag for ExtractToDirectory
  7184. //and the -Force flag for Expand-Archive as a fallback
  7185. if (pwshPath) {
  7186. //attempt to use pwsh with ExtractToDirectory, if this fails attempt Expand-Archive
  7187. const pwshCommand = [
  7188. `$ErrorActionPreference = 'Stop' ;`,
  7189. `try { Add-Type -AssemblyName System.IO.Compression.ZipFile } catch { } ;`,
  7190. `try { [System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}', $true) }`,
  7191. `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 $_ } } ;`
  7192. ].join(' ');
  7193. const args = [
  7194. '-NoLogo',
  7195. '-NoProfile',
  7196. '-NonInteractive',
  7197. '-ExecutionPolicy',
  7198. 'Unrestricted',
  7199. '-Command',
  7200. pwshCommand
  7201. ];
  7202. core.debug(`Using pwsh at path: ${pwshPath}`);
  7203. yield exec_1.exec(`"${pwshPath}"`, args);
  7204. }
  7205. else {
  7206. const powershellCommand = [
  7207. `$ErrorActionPreference = 'Stop' ;`,
  7208. `try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ;`,
  7209. `if ((Get-Command -Name Expand-Archive -Module Microsoft.PowerShell.Archive -ErrorAction Ignore)) { Expand-Archive -LiteralPath '${escapedFile}' -DestinationPath '${escapedDest}' -Force }`,
  7210. `else {[System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}', $true) }`
  7211. ].join(' ');
  7212. const args = [
  7213. '-NoLogo',
  7214. '-Sta',
  7215. '-NoProfile',
  7216. '-NonInteractive',
  7217. '-ExecutionPolicy',
  7218. 'Unrestricted',
  7219. '-Command',
  7220. powershellCommand
  7221. ];
  7222. const powershellPath = yield io.which('powershell', true);
  7223. core.debug(`Using powershell at path: ${powershellPath}`);
  7224. yield exec_1.exec(`"${powershellPath}"`, args);
  7225. }
  7226. });
  7227. }
  7228. function extractZipNix(file, dest) {
  7229. return __awaiter(this, void 0, void 0, function* () {
  7230. const unzipPath = yield io.which('unzip', true);
  7231. const args = [file];
  7232. if (!core.isDebug()) {
  7233. args.unshift('-q');
  7234. }
  7235. args.unshift('-o'); //overwrite with -o, otherwise a prompt is shown which freezes the run
  7236. yield exec_1.exec(`"${unzipPath}"`, args, { cwd: dest });
  7237. });
  7238. }
  7239. /**
  7240. * Caches a directory and installs it into the tool cacheDir
  7241. *
  7242. * @param sourceDir the directory to cache into tools
  7243. * @param tool tool name
  7244. * @param version version of the tool. semver format
  7245. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  7246. */
  7247. function cacheDir(sourceDir, tool, version, arch) {
  7248. return __awaiter(this, void 0, void 0, function* () {
  7249. version = semver.clean(version) || version;
  7250. arch = arch || os.arch();
  7251. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  7252. core.debug(`source dir: ${sourceDir}`);
  7253. if (!fs.statSync(sourceDir).isDirectory()) {
  7254. throw new Error('sourceDir is not a directory');
  7255. }
  7256. // Create the tool dir
  7257. const destPath = yield _createToolPath(tool, version, arch);
  7258. // copy each child item. do not move. move can fail on Windows
  7259. // due to anti-virus software having an open handle on a file.
  7260. for (const itemName of fs.readdirSync(sourceDir)) {
  7261. const s = path.join(sourceDir, itemName);
  7262. yield io.cp(s, destPath, { recursive: true });
  7263. }
  7264. // write .complete
  7265. _completeToolPath(tool, version, arch);
  7266. return destPath;
  7267. });
  7268. }
  7269. exports.cacheDir = cacheDir;
  7270. /**
  7271. * Caches a downloaded file (GUID) and installs it
  7272. * into the tool cache with a given targetName
  7273. *
  7274. * @param sourceFile the file to cache into tools. Typically a result of downloadTool which is a guid.
  7275. * @param targetFile the name of the file name in the tools directory
  7276. * @param tool tool name
  7277. * @param version version of the tool. semver format
  7278. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  7279. */
  7280. function cacheFile(sourceFile, targetFile, tool, version, arch) {
  7281. return __awaiter(this, void 0, void 0, function* () {
  7282. version = semver.clean(version) || version;
  7283. arch = arch || os.arch();
  7284. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  7285. core.debug(`source file: ${sourceFile}`);
  7286. if (!fs.statSync(sourceFile).isFile()) {
  7287. throw new Error('sourceFile is not a file');
  7288. }
  7289. // create the tool dir
  7290. const destFolder = yield _createToolPath(tool, version, arch);
  7291. // copy instead of move. move can fail on Windows due to
  7292. // anti-virus software having an open handle on a file.
  7293. const destPath = path.join(destFolder, targetFile);
  7294. core.debug(`destination file ${destPath}`);
  7295. yield io.cp(sourceFile, destPath);
  7296. // write .complete
  7297. _completeToolPath(tool, version, arch);
  7298. return destFolder;
  7299. });
  7300. }
  7301. exports.cacheFile = cacheFile;
  7302. /**
  7303. * Finds the path to a tool version in the local installed tool cache
  7304. *
  7305. * @param toolName name of the tool
  7306. * @param versionSpec version of the tool
  7307. * @param arch optional arch. defaults to arch of computer
  7308. */
  7309. function find(toolName, versionSpec, arch) {
  7310. if (!toolName) {
  7311. throw new Error('toolName parameter is required');
  7312. }
  7313. if (!versionSpec) {
  7314. throw new Error('versionSpec parameter is required');
  7315. }
  7316. arch = arch || os.arch();
  7317. // attempt to resolve an explicit version
  7318. if (!isExplicitVersion(versionSpec)) {
  7319. const localVersions = findAllVersions(toolName, arch);
  7320. const match = evaluateVersions(localVersions, versionSpec);
  7321. versionSpec = match;
  7322. }
  7323. // check for the explicit version in the cache
  7324. let toolPath = '';
  7325. if (versionSpec) {
  7326. versionSpec = semver.clean(versionSpec) || '';
  7327. const cachePath = path.join(_getCacheDirectory(), toolName, versionSpec, arch);
  7328. core.debug(`checking cache: ${cachePath}`);
  7329. if (fs.existsSync(cachePath) && fs.existsSync(`${cachePath}.complete`)) {
  7330. core.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`);
  7331. toolPath = cachePath;
  7332. }
  7333. else {
  7334. core.debug('not found');
  7335. }
  7336. }
  7337. return toolPath;
  7338. }
  7339. exports.find = find;
  7340. /**
  7341. * Finds the paths to all versions of a tool that are installed in the local tool cache
  7342. *
  7343. * @param toolName name of the tool
  7344. * @param arch optional arch. defaults to arch of computer
  7345. */
  7346. function findAllVersions(toolName, arch) {
  7347. const versions = [];
  7348. arch = arch || os.arch();
  7349. const toolPath = path.join(_getCacheDirectory(), toolName);
  7350. if (fs.existsSync(toolPath)) {
  7351. const children = fs.readdirSync(toolPath);
  7352. for (const child of children) {
  7353. if (isExplicitVersion(child)) {
  7354. const fullPath = path.join(toolPath, child, arch || '');
  7355. if (fs.existsSync(fullPath) && fs.existsSync(`${fullPath}.complete`)) {
  7356. versions.push(child);
  7357. }
  7358. }
  7359. }
  7360. }
  7361. return versions;
  7362. }
  7363. exports.findAllVersions = findAllVersions;
  7364. function getManifestFromRepo(owner, repo, auth, branch = 'master') {
  7365. return __awaiter(this, void 0, void 0, function* () {
  7366. let releases = [];
  7367. const treeUrl = `https://api.github.com/repos/${owner}/${repo}/git/trees/${branch}`;
  7368. const http = new httpm.HttpClient('tool-cache');
  7369. const headers = {};
  7370. if (auth) {
  7371. core.debug('set auth');
  7372. headers.authorization = auth;
  7373. }
  7374. const response = yield http.getJson(treeUrl, headers);
  7375. if (!response.result) {
  7376. return releases;
  7377. }
  7378. let manifestUrl = '';
  7379. for (const item of response.result.tree) {
  7380. if (item.path === 'versions-manifest.json') {
  7381. manifestUrl = item.url;
  7382. break;
  7383. }
  7384. }
  7385. headers['accept'] = 'application/vnd.github.VERSION.raw';
  7386. let versionsRaw = yield (yield http.get(manifestUrl, headers)).readBody();
  7387. if (versionsRaw) {
  7388. // shouldn't be needed but protects against invalid json saved with BOM
  7389. versionsRaw = versionsRaw.replace(/^\uFEFF/, '');
  7390. try {
  7391. releases = JSON.parse(versionsRaw);
  7392. }
  7393. catch (_a) {
  7394. core.debug('Invalid json');
  7395. }
  7396. }
  7397. return releases;
  7398. });
  7399. }
  7400. exports.getManifestFromRepo = getManifestFromRepo;
  7401. function findFromManifest(versionSpec, stable, manifest, archFilter = os.arch()) {
  7402. return __awaiter(this, void 0, void 0, function* () {
  7403. // wrap the internal impl
  7404. const match = yield mm._findMatch(versionSpec, stable, manifest, archFilter);
  7405. return match;
  7406. });
  7407. }
  7408. exports.findFromManifest = findFromManifest;
  7409. function _createExtractFolder(dest) {
  7410. return __awaiter(this, void 0, void 0, function* () {
  7411. if (!dest) {
  7412. // create a temp dir
  7413. dest = path.join(_getTempDirectory(), v4_1.default());
  7414. }
  7415. yield io.mkdirP(dest);
  7416. return dest;
  7417. });
  7418. }
  7419. function _createToolPath(tool, version, arch) {
  7420. return __awaiter(this, void 0, void 0, function* () {
  7421. const folderPath = path.join(_getCacheDirectory(), tool, semver.clean(version) || version, arch || '');
  7422. core.debug(`destination ${folderPath}`);
  7423. const markerPath = `${folderPath}.complete`;
  7424. yield io.rmRF(folderPath);
  7425. yield io.rmRF(markerPath);
  7426. yield io.mkdirP(folderPath);
  7427. return folderPath;
  7428. });
  7429. }
  7430. function _completeToolPath(tool, version, arch) {
  7431. const folderPath = path.join(_getCacheDirectory(), tool, semver.clean(version) || version, arch || '');
  7432. const markerPath = `${folderPath}.complete`;
  7433. fs.writeFileSync(markerPath, '');
  7434. core.debug('finished caching tool');
  7435. }
  7436. /**
  7437. * Check if version string is explicit
  7438. *
  7439. * @param versionSpec version string to check
  7440. */
  7441. function isExplicitVersion(versionSpec) {
  7442. const c = semver.clean(versionSpec) || '';
  7443. core.debug(`isExplicit: ${c}`);
  7444. const valid = semver.valid(c) != null;
  7445. core.debug(`explicit? ${valid}`);
  7446. return valid;
  7447. }
  7448. exports.isExplicitVersion = isExplicitVersion;
  7449. /**
  7450. * Get the highest satisfiying semantic version in `versions` which satisfies `versionSpec`
  7451. *
  7452. * @param versions array of versions to evaluate
  7453. * @param versionSpec semantic version spec to satisfy
  7454. */
  7455. function evaluateVersions(versions, versionSpec) {
  7456. let version = '';
  7457. core.debug(`evaluating ${versions.length} versions`);
  7458. versions = versions.sort((a, b) => {
  7459. if (semver.gt(a, b)) {
  7460. return 1;
  7461. }
  7462. return -1;
  7463. });
  7464. for (let i = versions.length - 1; i >= 0; i--) {
  7465. const potential = versions[i];
  7466. const satisfied = semver.satisfies(potential, versionSpec);
  7467. if (satisfied) {
  7468. version = potential;
  7469. break;
  7470. }
  7471. }
  7472. if (version) {
  7473. core.debug(`matched: ${version}`);
  7474. }
  7475. else {
  7476. core.debug('match not found');
  7477. }
  7478. return version;
  7479. }
  7480. exports.evaluateVersions = evaluateVersions;
  7481. /**
  7482. * Gets RUNNER_TOOL_CACHE
  7483. */
  7484. function _getCacheDirectory() {
  7485. const cacheDirectory = process.env['RUNNER_TOOL_CACHE'] || '';
  7486. assert_1.ok(cacheDirectory, 'Expected RUNNER_TOOL_CACHE to be defined');
  7487. return cacheDirectory;
  7488. }
  7489. /**
  7490. * Gets RUNNER_TEMP
  7491. */
  7492. function _getTempDirectory() {
  7493. const tempDirectory = process.env['RUNNER_TEMP'] || '';
  7494. assert_1.ok(tempDirectory, 'Expected RUNNER_TEMP to be defined');
  7495. return tempDirectory;
  7496. }
  7497. /**
  7498. * Gets a global variable
  7499. */
  7500. function _getGlobal(key, defaultValue) {
  7501. /* eslint-disable @typescript-eslint/no-explicit-any */
  7502. const value = global[key];
  7503. /* eslint-enable @typescript-eslint/no-explicit-any */
  7504. return value !== undefined ? value : defaultValue;
  7505. }
  7506. /**
  7507. * Returns an array of unique values.
  7508. * @param values Values to make unique.
  7509. */
  7510. function _unique(values) {
  7511. return Array.from(new Set(values));
  7512. }
  7513. //# sourceMappingURL=tool-cache.js.map
  7514. /***/ }),
  7515. /***/ 7701:
  7516. /***/ ((module) => {
  7517. /**
  7518. * Convert array of 16 byte values to UUID string format of the form:
  7519. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  7520. */
  7521. var byteToHex = [];
  7522. for (var i = 0; i < 256; ++i) {
  7523. byteToHex[i] = (i + 0x100).toString(16).substr(1);
  7524. }
  7525. function bytesToUuid(buf, offset) {
  7526. var i = offset || 0;
  7527. var bth = byteToHex;
  7528. // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
  7529. return ([
  7530. bth[buf[i++]], bth[buf[i++]],
  7531. bth[buf[i++]], bth[buf[i++]], '-',
  7532. bth[buf[i++]], bth[buf[i++]], '-',
  7533. bth[buf[i++]], bth[buf[i++]], '-',
  7534. bth[buf[i++]], bth[buf[i++]], '-',
  7535. bth[buf[i++]], bth[buf[i++]],
  7536. bth[buf[i++]], bth[buf[i++]],
  7537. bth[buf[i++]], bth[buf[i++]]
  7538. ]).join('');
  7539. }
  7540. module.exports = bytesToUuid;
  7541. /***/ }),
  7542. /***/ 7269:
  7543. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  7544. // Unique ID creation requires a high quality random # generator. In node.js
  7545. // this is pretty straight-forward - we use the crypto API.
  7546. var crypto = __nccwpck_require__(6113);
  7547. module.exports = function nodeRNG() {
  7548. return crypto.randomBytes(16);
  7549. };
  7550. /***/ }),
  7551. /***/ 7468:
  7552. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  7553. var rng = __nccwpck_require__(7269);
  7554. var bytesToUuid = __nccwpck_require__(7701);
  7555. function v4(options, buf, offset) {
  7556. var i = buf && offset || 0;
  7557. if (typeof(options) == 'string') {
  7558. buf = options === 'binary' ? new Array(16) : null;
  7559. options = null;
  7560. }
  7561. options = options || {};
  7562. var rnds = options.random || (options.rng || rng)();
  7563. // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  7564. rnds[6] = (rnds[6] & 0x0f) | 0x40;
  7565. rnds[8] = (rnds[8] & 0x3f) | 0x80;
  7566. // Copy bytes to buffer, if provided
  7567. if (buf) {
  7568. for (var ii = 0; ii < 16; ++ii) {
  7569. buf[i + ii] = rnds[ii];
  7570. }
  7571. }
  7572. return buf || bytesToUuid(rnds);
  7573. }
  7574. module.exports = v4;
  7575. /***/ }),
  7576. /***/ 334:
  7577. /***/ ((module) => {
  7578. "use strict";
  7579. var __defProp = Object.defineProperty;
  7580. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  7581. var __getOwnPropNames = Object.getOwnPropertyNames;
  7582. var __hasOwnProp = Object.prototype.hasOwnProperty;
  7583. var __export = (target, all) => {
  7584. for (var name in all)
  7585. __defProp(target, name, { get: all[name], enumerable: true });
  7586. };
  7587. var __copyProps = (to, from, except, desc) => {
  7588. if (from && typeof from === "object" || typeof from === "function") {
  7589. for (let key of __getOwnPropNames(from))
  7590. if (!__hasOwnProp.call(to, key) && key !== except)
  7591. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  7592. }
  7593. return to;
  7594. };
  7595. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  7596. // pkg/dist-src/index.js
  7597. var dist_src_exports = {};
  7598. __export(dist_src_exports, {
  7599. createTokenAuth: () => createTokenAuth
  7600. });
  7601. module.exports = __toCommonJS(dist_src_exports);
  7602. // pkg/dist-src/auth.js
  7603. var REGEX_IS_INSTALLATION_LEGACY = /^v1\./;
  7604. var REGEX_IS_INSTALLATION = /^ghs_/;
  7605. var REGEX_IS_USER_TO_SERVER = /^ghu_/;
  7606. async function auth(token) {
  7607. const isApp = token.split(/\./).length === 3;
  7608. const isInstallation = REGEX_IS_INSTALLATION_LEGACY.test(token) || REGEX_IS_INSTALLATION.test(token);
  7609. const isUserToServer = REGEX_IS_USER_TO_SERVER.test(token);
  7610. const tokenType = isApp ? "app" : isInstallation ? "installation" : isUserToServer ? "user-to-server" : "oauth";
  7611. return {
  7612. type: "token",
  7613. token,
  7614. tokenType
  7615. };
  7616. }
  7617. // pkg/dist-src/with-authorization-prefix.js
  7618. function withAuthorizationPrefix(token) {
  7619. if (token.split(/\./).length === 3) {
  7620. return `bearer ${token}`;
  7621. }
  7622. return `token ${token}`;
  7623. }
  7624. // pkg/dist-src/hook.js
  7625. async function hook(token, request, route, parameters) {
  7626. const endpoint = request.endpoint.merge(
  7627. route,
  7628. parameters
  7629. );
  7630. endpoint.headers.authorization = withAuthorizationPrefix(token);
  7631. return request(endpoint);
  7632. }
  7633. // pkg/dist-src/index.js
  7634. var createTokenAuth = function createTokenAuth2(token) {
  7635. if (!token) {
  7636. throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");
  7637. }
  7638. if (typeof token !== "string") {
  7639. throw new Error(
  7640. "[@octokit/auth-token] Token passed to createTokenAuth is not a string"
  7641. );
  7642. }
  7643. token = token.replace(/^(token|bearer) +/i, "");
  7644. return Object.assign(auth.bind(null, token), {
  7645. hook: hook.bind(null, token)
  7646. });
  7647. };
  7648. // Annotate the CommonJS export names for ESM import in node:
  7649. 0 && (0);
  7650. /***/ }),
  7651. /***/ 6762:
  7652. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  7653. "use strict";
  7654. var __defProp = Object.defineProperty;
  7655. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  7656. var __getOwnPropNames = Object.getOwnPropertyNames;
  7657. var __hasOwnProp = Object.prototype.hasOwnProperty;
  7658. var __export = (target, all) => {
  7659. for (var name in all)
  7660. __defProp(target, name, { get: all[name], enumerable: true });
  7661. };
  7662. var __copyProps = (to, from, except, desc) => {
  7663. if (from && typeof from === "object" || typeof from === "function") {
  7664. for (let key of __getOwnPropNames(from))
  7665. if (!__hasOwnProp.call(to, key) && key !== except)
  7666. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  7667. }
  7668. return to;
  7669. };
  7670. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  7671. // pkg/dist-src/index.js
  7672. var dist_src_exports = {};
  7673. __export(dist_src_exports, {
  7674. Octokit: () => Octokit
  7675. });
  7676. module.exports = __toCommonJS(dist_src_exports);
  7677. var import_universal_user_agent = __nccwpck_require__(5030);
  7678. var import_before_after_hook = __nccwpck_require__(3682);
  7679. var import_request = __nccwpck_require__(6234);
  7680. var import_graphql = __nccwpck_require__(8467);
  7681. var import_auth_token = __nccwpck_require__(334);
  7682. // pkg/dist-src/version.js
  7683. var VERSION = "5.2.0";
  7684. // pkg/dist-src/index.js
  7685. var noop = () => {
  7686. };
  7687. var consoleWarn = console.warn.bind(console);
  7688. var consoleError = console.error.bind(console);
  7689. var userAgentTrail = `octokit-core.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`;
  7690. var Octokit = class {
  7691. static {
  7692. this.VERSION = VERSION;
  7693. }
  7694. static defaults(defaults) {
  7695. const OctokitWithDefaults = class extends this {
  7696. constructor(...args) {
  7697. const options = args[0] || {};
  7698. if (typeof defaults === "function") {
  7699. super(defaults(options));
  7700. return;
  7701. }
  7702. super(
  7703. Object.assign(
  7704. {},
  7705. defaults,
  7706. options,
  7707. options.userAgent && defaults.userAgent ? {
  7708. userAgent: `${options.userAgent} ${defaults.userAgent}`
  7709. } : null
  7710. )
  7711. );
  7712. }
  7713. };
  7714. return OctokitWithDefaults;
  7715. }
  7716. static {
  7717. this.plugins = [];
  7718. }
  7719. /**
  7720. * Attach a plugin (or many) to your Octokit instance.
  7721. *
  7722. * @example
  7723. * const API = Octokit.plugin(plugin1, plugin2, plugin3, ...)
  7724. */
  7725. static plugin(...newPlugins) {
  7726. const currentPlugins = this.plugins;
  7727. const NewOctokit = class extends this {
  7728. static {
  7729. this.plugins = currentPlugins.concat(
  7730. newPlugins.filter((plugin) => !currentPlugins.includes(plugin))
  7731. );
  7732. }
  7733. };
  7734. return NewOctokit;
  7735. }
  7736. constructor(options = {}) {
  7737. const hook = new import_before_after_hook.Collection();
  7738. const requestDefaults = {
  7739. baseUrl: import_request.request.endpoint.DEFAULTS.baseUrl,
  7740. headers: {},
  7741. request: Object.assign({}, options.request, {
  7742. // @ts-ignore internal usage only, no need to type
  7743. hook: hook.bind(null, "request")
  7744. }),
  7745. mediaType: {
  7746. previews: [],
  7747. format: ""
  7748. }
  7749. };
  7750. requestDefaults.headers["user-agent"] = options.userAgent ? `${options.userAgent} ${userAgentTrail}` : userAgentTrail;
  7751. if (options.baseUrl) {
  7752. requestDefaults.baseUrl = options.baseUrl;
  7753. }
  7754. if (options.previews) {
  7755. requestDefaults.mediaType.previews = options.previews;
  7756. }
  7757. if (options.timeZone) {
  7758. requestDefaults.headers["time-zone"] = options.timeZone;
  7759. }
  7760. this.request = import_request.request.defaults(requestDefaults);
  7761. this.graphql = (0, import_graphql.withCustomRequest)(this.request).defaults(requestDefaults);
  7762. this.log = Object.assign(
  7763. {
  7764. debug: noop,
  7765. info: noop,
  7766. warn: consoleWarn,
  7767. error: consoleError
  7768. },
  7769. options.log
  7770. );
  7771. this.hook = hook;
  7772. if (!options.authStrategy) {
  7773. if (!options.auth) {
  7774. this.auth = async () => ({
  7775. type: "unauthenticated"
  7776. });
  7777. } else {
  7778. const auth = (0, import_auth_token.createTokenAuth)(options.auth);
  7779. hook.wrap("request", auth.hook);
  7780. this.auth = auth;
  7781. }
  7782. } else {
  7783. const { authStrategy, ...otherOptions } = options;
  7784. const auth = authStrategy(
  7785. Object.assign(
  7786. {
  7787. request: this.request,
  7788. log: this.log,
  7789. // we pass the current octokit instance as well as its constructor options
  7790. // to allow for authentication strategies that return a new octokit instance
  7791. // that shares the same internal state as the current one. The original
  7792. // requirement for this was the "event-octokit" authentication strategy
  7793. // of https://github.com/probot/octokit-auth-probot.
  7794. octokit: this,
  7795. octokitOptions: otherOptions
  7796. },
  7797. options.auth
  7798. )
  7799. );
  7800. hook.wrap("request", auth.hook);
  7801. this.auth = auth;
  7802. }
  7803. const classConstructor = this.constructor;
  7804. for (let i = 0; i < classConstructor.plugins.length; ++i) {
  7805. Object.assign(this, classConstructor.plugins[i](this, options));
  7806. }
  7807. }
  7808. };
  7809. // Annotate the CommonJS export names for ESM import in node:
  7810. 0 && (0);
  7811. /***/ }),
  7812. /***/ 9440:
  7813. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  7814. "use strict";
  7815. var __defProp = Object.defineProperty;
  7816. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  7817. var __getOwnPropNames = Object.getOwnPropertyNames;
  7818. var __hasOwnProp = Object.prototype.hasOwnProperty;
  7819. var __export = (target, all) => {
  7820. for (var name in all)
  7821. __defProp(target, name, { get: all[name], enumerable: true });
  7822. };
  7823. var __copyProps = (to, from, except, desc) => {
  7824. if (from && typeof from === "object" || typeof from === "function") {
  7825. for (let key of __getOwnPropNames(from))
  7826. if (!__hasOwnProp.call(to, key) && key !== except)
  7827. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  7828. }
  7829. return to;
  7830. };
  7831. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  7832. // pkg/dist-src/index.js
  7833. var dist_src_exports = {};
  7834. __export(dist_src_exports, {
  7835. endpoint: () => endpoint
  7836. });
  7837. module.exports = __toCommonJS(dist_src_exports);
  7838. // pkg/dist-src/defaults.js
  7839. var import_universal_user_agent = __nccwpck_require__(5030);
  7840. // pkg/dist-src/version.js
  7841. var VERSION = "9.0.6";
  7842. // pkg/dist-src/defaults.js
  7843. var userAgent = `octokit-endpoint.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`;
  7844. var DEFAULTS = {
  7845. method: "GET",
  7846. baseUrl: "https://api.github.com",
  7847. headers: {
  7848. accept: "application/vnd.github.v3+json",
  7849. "user-agent": userAgent
  7850. },
  7851. mediaType: {
  7852. format: ""
  7853. }
  7854. };
  7855. // pkg/dist-src/util/lowercase-keys.js
  7856. function lowercaseKeys(object) {
  7857. if (!object) {
  7858. return {};
  7859. }
  7860. return Object.keys(object).reduce((newObj, key) => {
  7861. newObj[key.toLowerCase()] = object[key];
  7862. return newObj;
  7863. }, {});
  7864. }
  7865. // pkg/dist-src/util/is-plain-object.js
  7866. function isPlainObject(value) {
  7867. if (typeof value !== "object" || value === null)
  7868. return false;
  7869. if (Object.prototype.toString.call(value) !== "[object Object]")
  7870. return false;
  7871. const proto = Object.getPrototypeOf(value);
  7872. if (proto === null)
  7873. return true;
  7874. const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
  7875. return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
  7876. }
  7877. // pkg/dist-src/util/merge-deep.js
  7878. function mergeDeep(defaults, options) {
  7879. const result = Object.assign({}, defaults);
  7880. Object.keys(options).forEach((key) => {
  7881. if (isPlainObject(options[key])) {
  7882. if (!(key in defaults))
  7883. Object.assign(result, { [key]: options[key] });
  7884. else
  7885. result[key] = mergeDeep(defaults[key], options[key]);
  7886. } else {
  7887. Object.assign(result, { [key]: options[key] });
  7888. }
  7889. });
  7890. return result;
  7891. }
  7892. // pkg/dist-src/util/remove-undefined-properties.js
  7893. function removeUndefinedProperties(obj) {
  7894. for (const key in obj) {
  7895. if (obj[key] === void 0) {
  7896. delete obj[key];
  7897. }
  7898. }
  7899. return obj;
  7900. }
  7901. // pkg/dist-src/merge.js
  7902. function merge(defaults, route, options) {
  7903. if (typeof route === "string") {
  7904. let [method, url] = route.split(" ");
  7905. options = Object.assign(url ? { method, url } : { url: method }, options);
  7906. } else {
  7907. options = Object.assign({}, route);
  7908. }
  7909. options.headers = lowercaseKeys(options.headers);
  7910. removeUndefinedProperties(options);
  7911. removeUndefinedProperties(options.headers);
  7912. const mergedOptions = mergeDeep(defaults || {}, options);
  7913. if (options.url === "/graphql") {
  7914. if (defaults && defaults.mediaType.previews?.length) {
  7915. mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(
  7916. (preview) => !mergedOptions.mediaType.previews.includes(preview)
  7917. ).concat(mergedOptions.mediaType.previews);
  7918. }
  7919. mergedOptions.mediaType.previews = (mergedOptions.mediaType.previews || []).map((preview) => preview.replace(/-preview/, ""));
  7920. }
  7921. return mergedOptions;
  7922. }
  7923. // pkg/dist-src/util/add-query-parameters.js
  7924. function addQueryParameters(url, parameters) {
  7925. const separator = /\?/.test(url) ? "&" : "?";
  7926. const names = Object.keys(parameters);
  7927. if (names.length === 0) {
  7928. return url;
  7929. }
  7930. return url + separator + names.map((name) => {
  7931. if (name === "q") {
  7932. return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+");
  7933. }
  7934. return `${name}=${encodeURIComponent(parameters[name])}`;
  7935. }).join("&");
  7936. }
  7937. // pkg/dist-src/util/extract-url-variable-names.js
  7938. var urlVariableRegex = /\{[^{}}]+\}/g;
  7939. function removeNonChars(variableName) {
  7940. return variableName.replace(/(?:^\W+)|(?:(?<!\W)\W+$)/g, "").split(/,/);
  7941. }
  7942. function extractUrlVariableNames(url) {
  7943. const matches = url.match(urlVariableRegex);
  7944. if (!matches) {
  7945. return [];
  7946. }
  7947. return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
  7948. }
  7949. // pkg/dist-src/util/omit.js
  7950. function omit(object, keysToOmit) {
  7951. const result = { __proto__: null };
  7952. for (const key of Object.keys(object)) {
  7953. if (keysToOmit.indexOf(key) === -1) {
  7954. result[key] = object[key];
  7955. }
  7956. }
  7957. return result;
  7958. }
  7959. // pkg/dist-src/util/url-template.js
  7960. function encodeReserved(str) {
  7961. return str.split(/(%[0-9A-Fa-f]{2})/g).map(function(part) {
  7962. if (!/%[0-9A-Fa-f]/.test(part)) {
  7963. part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]");
  7964. }
  7965. return part;
  7966. }).join("");
  7967. }
  7968. function encodeUnreserved(str) {
  7969. return encodeURIComponent(str).replace(/[!'()*]/g, function(c) {
  7970. return "%" + c.charCodeAt(0).toString(16).toUpperCase();
  7971. });
  7972. }
  7973. function encodeValue(operator, value, key) {
  7974. value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value);
  7975. if (key) {
  7976. return encodeUnreserved(key) + "=" + value;
  7977. } else {
  7978. return value;
  7979. }
  7980. }
  7981. function isDefined(value) {
  7982. return value !== void 0 && value !== null;
  7983. }
  7984. function isKeyOperator(operator) {
  7985. return operator === ";" || operator === "&" || operator === "?";
  7986. }
  7987. function getValues(context, operator, key, modifier) {
  7988. var value = context[key], result = [];
  7989. if (isDefined(value) && value !== "") {
  7990. if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
  7991. value = value.toString();
  7992. if (modifier && modifier !== "*") {
  7993. value = value.substring(0, parseInt(modifier, 10));
  7994. }
  7995. result.push(
  7996. encodeValue(operator, value, isKeyOperator(operator) ? key : "")
  7997. );
  7998. } else {
  7999. if (modifier === "*") {
  8000. if (Array.isArray(value)) {
  8001. value.filter(isDefined).forEach(function(value2) {
  8002. result.push(
  8003. encodeValue(operator, value2, isKeyOperator(operator) ? key : "")
  8004. );
  8005. });
  8006. } else {
  8007. Object.keys(value).forEach(function(k) {
  8008. if (isDefined(value[k])) {
  8009. result.push(encodeValue(operator, value[k], k));
  8010. }
  8011. });
  8012. }
  8013. } else {
  8014. const tmp = [];
  8015. if (Array.isArray(value)) {
  8016. value.filter(isDefined).forEach(function(value2) {
  8017. tmp.push(encodeValue(operator, value2));
  8018. });
  8019. } else {
  8020. Object.keys(value).forEach(function(k) {
  8021. if (isDefined(value[k])) {
  8022. tmp.push(encodeUnreserved(k));
  8023. tmp.push(encodeValue(operator, value[k].toString()));
  8024. }
  8025. });
  8026. }
  8027. if (isKeyOperator(operator)) {
  8028. result.push(encodeUnreserved(key) + "=" + tmp.join(","));
  8029. } else if (tmp.length !== 0) {
  8030. result.push(tmp.join(","));
  8031. }
  8032. }
  8033. }
  8034. } else {
  8035. if (operator === ";") {
  8036. if (isDefined(value)) {
  8037. result.push(encodeUnreserved(key));
  8038. }
  8039. } else if (value === "" && (operator === "&" || operator === "?")) {
  8040. result.push(encodeUnreserved(key) + "=");
  8041. } else if (value === "") {
  8042. result.push("");
  8043. }
  8044. }
  8045. return result;
  8046. }
  8047. function parseUrl(template) {
  8048. return {
  8049. expand: expand.bind(null, template)
  8050. };
  8051. }
  8052. function expand(template, context) {
  8053. var operators = ["+", "#", ".", "/", ";", "?", "&"];
  8054. template = template.replace(
  8055. /\{([^\{\}]+)\}|([^\{\}]+)/g,
  8056. function(_, expression, literal) {
  8057. if (expression) {
  8058. let operator = "";
  8059. const values = [];
  8060. if (operators.indexOf(expression.charAt(0)) !== -1) {
  8061. operator = expression.charAt(0);
  8062. expression = expression.substr(1);
  8063. }
  8064. expression.split(/,/g).forEach(function(variable) {
  8065. var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
  8066. values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
  8067. });
  8068. if (operator && operator !== "+") {
  8069. var separator = ",";
  8070. if (operator === "?") {
  8071. separator = "&";
  8072. } else if (operator !== "#") {
  8073. separator = operator;
  8074. }
  8075. return (values.length !== 0 ? operator : "") + values.join(separator);
  8076. } else {
  8077. return values.join(",");
  8078. }
  8079. } else {
  8080. return encodeReserved(literal);
  8081. }
  8082. }
  8083. );
  8084. if (template === "/") {
  8085. return template;
  8086. } else {
  8087. return template.replace(/\/$/, "");
  8088. }
  8089. }
  8090. // pkg/dist-src/parse.js
  8091. function parse(options) {
  8092. let method = options.method.toUpperCase();
  8093. let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{$1}");
  8094. let headers = Object.assign({}, options.headers);
  8095. let body;
  8096. let parameters = omit(options, [
  8097. "method",
  8098. "baseUrl",
  8099. "url",
  8100. "headers",
  8101. "request",
  8102. "mediaType"
  8103. ]);
  8104. const urlVariableNames = extractUrlVariableNames(url);
  8105. url = parseUrl(url).expand(parameters);
  8106. if (!/^http/.test(url)) {
  8107. url = options.baseUrl + url;
  8108. }
  8109. const omittedParameters = Object.keys(options).filter((option) => urlVariableNames.includes(option)).concat("baseUrl");
  8110. const remainingParameters = omit(parameters, omittedParameters);
  8111. const isBinaryRequest = /application\/octet-stream/i.test(headers.accept);
  8112. if (!isBinaryRequest) {
  8113. if (options.mediaType.format) {
  8114. headers.accept = headers.accept.split(/,/).map(
  8115. (format) => format.replace(
  8116. /application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,
  8117. `application/vnd$1$2.${options.mediaType.format}`
  8118. )
  8119. ).join(",");
  8120. }
  8121. if (url.endsWith("/graphql")) {
  8122. if (options.mediaType.previews?.length) {
  8123. const previewsFromAcceptHeader = headers.accept.match(/(?<![\w-])[\w-]+(?=-preview)/g) || [];
  8124. headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map((preview) => {
  8125. const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json";
  8126. return `application/vnd.github.${preview}-preview${format}`;
  8127. }).join(",");
  8128. }
  8129. }
  8130. }
  8131. if (["GET", "HEAD"].includes(method)) {
  8132. url = addQueryParameters(url, remainingParameters);
  8133. } else {
  8134. if ("data" in remainingParameters) {
  8135. body = remainingParameters.data;
  8136. } else {
  8137. if (Object.keys(remainingParameters).length) {
  8138. body = remainingParameters;
  8139. }
  8140. }
  8141. }
  8142. if (!headers["content-type"] && typeof body !== "undefined") {
  8143. headers["content-type"] = "application/json; charset=utf-8";
  8144. }
  8145. if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") {
  8146. body = "";
  8147. }
  8148. return Object.assign(
  8149. { method, url, headers },
  8150. typeof body !== "undefined" ? { body } : null,
  8151. options.request ? { request: options.request } : null
  8152. );
  8153. }
  8154. // pkg/dist-src/endpoint-with-defaults.js
  8155. function endpointWithDefaults(defaults, route, options) {
  8156. return parse(merge(defaults, route, options));
  8157. }
  8158. // pkg/dist-src/with-defaults.js
  8159. function withDefaults(oldDefaults, newDefaults) {
  8160. const DEFAULTS2 = merge(oldDefaults, newDefaults);
  8161. const endpoint2 = endpointWithDefaults.bind(null, DEFAULTS2);
  8162. return Object.assign(endpoint2, {
  8163. DEFAULTS: DEFAULTS2,
  8164. defaults: withDefaults.bind(null, DEFAULTS2),
  8165. merge: merge.bind(null, DEFAULTS2),
  8166. parse
  8167. });
  8168. }
  8169. // pkg/dist-src/index.js
  8170. var endpoint = withDefaults(null, DEFAULTS);
  8171. // Annotate the CommonJS export names for ESM import in node:
  8172. 0 && (0);
  8173. /***/ }),
  8174. /***/ 8467:
  8175. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  8176. "use strict";
  8177. var __defProp = Object.defineProperty;
  8178. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  8179. var __getOwnPropNames = Object.getOwnPropertyNames;
  8180. var __hasOwnProp = Object.prototype.hasOwnProperty;
  8181. var __export = (target, all) => {
  8182. for (var name in all)
  8183. __defProp(target, name, { get: all[name], enumerable: true });
  8184. };
  8185. var __copyProps = (to, from, except, desc) => {
  8186. if (from && typeof from === "object" || typeof from === "function") {
  8187. for (let key of __getOwnPropNames(from))
  8188. if (!__hasOwnProp.call(to, key) && key !== except)
  8189. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  8190. }
  8191. return to;
  8192. };
  8193. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  8194. // pkg/dist-src/index.js
  8195. var dist_src_exports = {};
  8196. __export(dist_src_exports, {
  8197. GraphqlResponseError: () => GraphqlResponseError,
  8198. graphql: () => graphql2,
  8199. withCustomRequest: () => withCustomRequest
  8200. });
  8201. module.exports = __toCommonJS(dist_src_exports);
  8202. var import_request3 = __nccwpck_require__(6234);
  8203. var import_universal_user_agent = __nccwpck_require__(5030);
  8204. // pkg/dist-src/version.js
  8205. var VERSION = "7.1.0";
  8206. // pkg/dist-src/with-defaults.js
  8207. var import_request2 = __nccwpck_require__(6234);
  8208. // pkg/dist-src/graphql.js
  8209. var import_request = __nccwpck_require__(6234);
  8210. // pkg/dist-src/error.js
  8211. function _buildMessageForResponseErrors(data) {
  8212. return `Request failed due to following response errors:
  8213. ` + data.errors.map((e) => ` - ${e.message}`).join("\n");
  8214. }
  8215. var GraphqlResponseError = class extends Error {
  8216. constructor(request2, headers, response) {
  8217. super(_buildMessageForResponseErrors(response));
  8218. this.request = request2;
  8219. this.headers = headers;
  8220. this.response = response;
  8221. this.name = "GraphqlResponseError";
  8222. this.errors = response.errors;
  8223. this.data = response.data;
  8224. if (Error.captureStackTrace) {
  8225. Error.captureStackTrace(this, this.constructor);
  8226. }
  8227. }
  8228. };
  8229. // pkg/dist-src/graphql.js
  8230. var NON_VARIABLE_OPTIONS = [
  8231. "method",
  8232. "baseUrl",
  8233. "url",
  8234. "headers",
  8235. "request",
  8236. "query",
  8237. "mediaType"
  8238. ];
  8239. var FORBIDDEN_VARIABLE_OPTIONS = ["query", "method", "url"];
  8240. var GHES_V3_SUFFIX_REGEX = /\/api\/v3\/?$/;
  8241. function graphql(request2, query, options) {
  8242. if (options) {
  8243. if (typeof query === "string" && "query" in options) {
  8244. return Promise.reject(
  8245. new Error(`[@octokit/graphql] "query" cannot be used as variable name`)
  8246. );
  8247. }
  8248. for (const key in options) {
  8249. if (!FORBIDDEN_VARIABLE_OPTIONS.includes(key))
  8250. continue;
  8251. return Promise.reject(
  8252. new Error(
  8253. `[@octokit/graphql] "${key}" cannot be used as variable name`
  8254. )
  8255. );
  8256. }
  8257. }
  8258. const parsedOptions = typeof query === "string" ? Object.assign({ query }, options) : query;
  8259. const requestOptions = Object.keys(
  8260. parsedOptions
  8261. ).reduce((result, key) => {
  8262. if (NON_VARIABLE_OPTIONS.includes(key)) {
  8263. result[key] = parsedOptions[key];
  8264. return result;
  8265. }
  8266. if (!result.variables) {
  8267. result.variables = {};
  8268. }
  8269. result.variables[key] = parsedOptions[key];
  8270. return result;
  8271. }, {});
  8272. const baseUrl = parsedOptions.baseUrl || request2.endpoint.DEFAULTS.baseUrl;
  8273. if (GHES_V3_SUFFIX_REGEX.test(baseUrl)) {
  8274. requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX, "/api/graphql");
  8275. }
  8276. return request2(requestOptions).then((response) => {
  8277. if (response.data.errors) {
  8278. const headers = {};
  8279. for (const key of Object.keys(response.headers)) {
  8280. headers[key] = response.headers[key];
  8281. }
  8282. throw new GraphqlResponseError(
  8283. requestOptions,
  8284. headers,
  8285. response.data
  8286. );
  8287. }
  8288. return response.data.data;
  8289. });
  8290. }
  8291. // pkg/dist-src/with-defaults.js
  8292. function withDefaults(request2, newDefaults) {
  8293. const newRequest = request2.defaults(newDefaults);
  8294. const newApi = (query, options) => {
  8295. return graphql(newRequest, query, options);
  8296. };
  8297. return Object.assign(newApi, {
  8298. defaults: withDefaults.bind(null, newRequest),
  8299. endpoint: newRequest.endpoint
  8300. });
  8301. }
  8302. // pkg/dist-src/index.js
  8303. var graphql2 = withDefaults(import_request3.request, {
  8304. headers: {
  8305. "user-agent": `octokit-graphql.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`
  8306. },
  8307. method: "POST",
  8308. url: "/graphql"
  8309. });
  8310. function withCustomRequest(customRequest) {
  8311. return withDefaults(customRequest, {
  8312. method: "POST",
  8313. url: "/graphql"
  8314. });
  8315. }
  8316. // Annotate the CommonJS export names for ESM import in node:
  8317. 0 && (0);
  8318. /***/ }),
  8319. /***/ 4193:
  8320. /***/ ((module) => {
  8321. "use strict";
  8322. var __defProp = Object.defineProperty;
  8323. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  8324. var __getOwnPropNames = Object.getOwnPropertyNames;
  8325. var __hasOwnProp = Object.prototype.hasOwnProperty;
  8326. var __export = (target, all) => {
  8327. for (var name in all)
  8328. __defProp(target, name, { get: all[name], enumerable: true });
  8329. };
  8330. var __copyProps = (to, from, except, desc) => {
  8331. if (from && typeof from === "object" || typeof from === "function") {
  8332. for (let key of __getOwnPropNames(from))
  8333. if (!__hasOwnProp.call(to, key) && key !== except)
  8334. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  8335. }
  8336. return to;
  8337. };
  8338. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  8339. // pkg/dist-src/index.js
  8340. var dist_src_exports = {};
  8341. __export(dist_src_exports, {
  8342. composePaginateRest: () => composePaginateRest,
  8343. isPaginatingEndpoint: () => isPaginatingEndpoint,
  8344. paginateRest: () => paginateRest,
  8345. paginatingEndpoints: () => paginatingEndpoints
  8346. });
  8347. module.exports = __toCommonJS(dist_src_exports);
  8348. // pkg/dist-src/version.js
  8349. var VERSION = "9.2.2";
  8350. // pkg/dist-src/normalize-paginated-list-response.js
  8351. function normalizePaginatedListResponse(response) {
  8352. if (!response.data) {
  8353. return {
  8354. ...response,
  8355. data: []
  8356. };
  8357. }
  8358. const responseNeedsNormalization = "total_count" in response.data && !("url" in response.data);
  8359. if (!responseNeedsNormalization)
  8360. return response;
  8361. const incompleteResults = response.data.incomplete_results;
  8362. const repositorySelection = response.data.repository_selection;
  8363. const totalCount = response.data.total_count;
  8364. delete response.data.incomplete_results;
  8365. delete response.data.repository_selection;
  8366. delete response.data.total_count;
  8367. const namespaceKey = Object.keys(response.data)[0];
  8368. const data = response.data[namespaceKey];
  8369. response.data = data;
  8370. if (typeof incompleteResults !== "undefined") {
  8371. response.data.incomplete_results = incompleteResults;
  8372. }
  8373. if (typeof repositorySelection !== "undefined") {
  8374. response.data.repository_selection = repositorySelection;
  8375. }
  8376. response.data.total_count = totalCount;
  8377. return response;
  8378. }
  8379. // pkg/dist-src/iterator.js
  8380. function iterator(octokit, route, parameters) {
  8381. const options = typeof route === "function" ? route.endpoint(parameters) : octokit.request.endpoint(route, parameters);
  8382. const requestMethod = typeof route === "function" ? route : octokit.request;
  8383. const method = options.method;
  8384. const headers = options.headers;
  8385. let url = options.url;
  8386. return {
  8387. [Symbol.asyncIterator]: () => ({
  8388. async next() {
  8389. if (!url)
  8390. return { done: true };
  8391. try {
  8392. const response = await requestMethod({ method, url, headers });
  8393. const normalizedResponse = normalizePaginatedListResponse(response);
  8394. url = ((normalizedResponse.headers.link || "").match(
  8395. /<([^<>]+)>;\s*rel="next"/
  8396. ) || [])[1];
  8397. return { value: normalizedResponse };
  8398. } catch (error) {
  8399. if (error.status !== 409)
  8400. throw error;
  8401. url = "";
  8402. return {
  8403. value: {
  8404. status: 200,
  8405. headers: {},
  8406. data: []
  8407. }
  8408. };
  8409. }
  8410. }
  8411. })
  8412. };
  8413. }
  8414. // pkg/dist-src/paginate.js
  8415. function paginate(octokit, route, parameters, mapFn) {
  8416. if (typeof parameters === "function") {
  8417. mapFn = parameters;
  8418. parameters = void 0;
  8419. }
  8420. return gather(
  8421. octokit,
  8422. [],
  8423. iterator(octokit, route, parameters)[Symbol.asyncIterator](),
  8424. mapFn
  8425. );
  8426. }
  8427. function gather(octokit, results, iterator2, mapFn) {
  8428. return iterator2.next().then((result) => {
  8429. if (result.done) {
  8430. return results;
  8431. }
  8432. let earlyExit = false;
  8433. function done() {
  8434. earlyExit = true;
  8435. }
  8436. results = results.concat(
  8437. mapFn ? mapFn(result.value, done) : result.value.data
  8438. );
  8439. if (earlyExit) {
  8440. return results;
  8441. }
  8442. return gather(octokit, results, iterator2, mapFn);
  8443. });
  8444. }
  8445. // pkg/dist-src/compose-paginate.js
  8446. var composePaginateRest = Object.assign(paginate, {
  8447. iterator
  8448. });
  8449. // pkg/dist-src/generated/paginating-endpoints.js
  8450. var paginatingEndpoints = [
  8451. "GET /advisories",
  8452. "GET /app/hook/deliveries",
  8453. "GET /app/installation-requests",
  8454. "GET /app/installations",
  8455. "GET /assignments/{assignment_id}/accepted_assignments",
  8456. "GET /classrooms",
  8457. "GET /classrooms/{classroom_id}/assignments",
  8458. "GET /enterprises/{enterprise}/dependabot/alerts",
  8459. "GET /enterprises/{enterprise}/secret-scanning/alerts",
  8460. "GET /events",
  8461. "GET /gists",
  8462. "GET /gists/public",
  8463. "GET /gists/starred",
  8464. "GET /gists/{gist_id}/comments",
  8465. "GET /gists/{gist_id}/commits",
  8466. "GET /gists/{gist_id}/forks",
  8467. "GET /installation/repositories",
  8468. "GET /issues",
  8469. "GET /licenses",
  8470. "GET /marketplace_listing/plans",
  8471. "GET /marketplace_listing/plans/{plan_id}/accounts",
  8472. "GET /marketplace_listing/stubbed/plans",
  8473. "GET /marketplace_listing/stubbed/plans/{plan_id}/accounts",
  8474. "GET /networks/{owner}/{repo}/events",
  8475. "GET /notifications",
  8476. "GET /organizations",
  8477. "GET /orgs/{org}/actions/cache/usage-by-repository",
  8478. "GET /orgs/{org}/actions/permissions/repositories",
  8479. "GET /orgs/{org}/actions/runners",
  8480. "GET /orgs/{org}/actions/secrets",
  8481. "GET /orgs/{org}/actions/secrets/{secret_name}/repositories",
  8482. "GET /orgs/{org}/actions/variables",
  8483. "GET /orgs/{org}/actions/variables/{name}/repositories",
  8484. "GET /orgs/{org}/blocks",
  8485. "GET /orgs/{org}/code-scanning/alerts",
  8486. "GET /orgs/{org}/codespaces",
  8487. "GET /orgs/{org}/codespaces/secrets",
  8488. "GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories",
  8489. "GET /orgs/{org}/copilot/billing/seats",
  8490. "GET /orgs/{org}/dependabot/alerts",
  8491. "GET /orgs/{org}/dependabot/secrets",
  8492. "GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories",
  8493. "GET /orgs/{org}/events",
  8494. "GET /orgs/{org}/failed_invitations",
  8495. "GET /orgs/{org}/hooks",
  8496. "GET /orgs/{org}/hooks/{hook_id}/deliveries",
  8497. "GET /orgs/{org}/installations",
  8498. "GET /orgs/{org}/invitations",
  8499. "GET /orgs/{org}/invitations/{invitation_id}/teams",
  8500. "GET /orgs/{org}/issues",
  8501. "GET /orgs/{org}/members",
  8502. "GET /orgs/{org}/members/{username}/codespaces",
  8503. "GET /orgs/{org}/migrations",
  8504. "GET /orgs/{org}/migrations/{migration_id}/repositories",
  8505. "GET /orgs/{org}/organization-roles/{role_id}/teams",
  8506. "GET /orgs/{org}/organization-roles/{role_id}/users",
  8507. "GET /orgs/{org}/outside_collaborators",
  8508. "GET /orgs/{org}/packages",
  8509. "GET /orgs/{org}/packages/{package_type}/{package_name}/versions",
  8510. "GET /orgs/{org}/personal-access-token-requests",
  8511. "GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories",
  8512. "GET /orgs/{org}/personal-access-tokens",
  8513. "GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories",
  8514. "GET /orgs/{org}/projects",
  8515. "GET /orgs/{org}/properties/values",
  8516. "GET /orgs/{org}/public_members",
  8517. "GET /orgs/{org}/repos",
  8518. "GET /orgs/{org}/rulesets",
  8519. "GET /orgs/{org}/rulesets/rule-suites",
  8520. "GET /orgs/{org}/secret-scanning/alerts",
  8521. "GET /orgs/{org}/security-advisories",
  8522. "GET /orgs/{org}/teams",
  8523. "GET /orgs/{org}/teams/{team_slug}/discussions",
  8524. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments",
  8525. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions",
  8526. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions",
  8527. "GET /orgs/{org}/teams/{team_slug}/invitations",
  8528. "GET /orgs/{org}/teams/{team_slug}/members",
  8529. "GET /orgs/{org}/teams/{team_slug}/projects",
  8530. "GET /orgs/{org}/teams/{team_slug}/repos",
  8531. "GET /orgs/{org}/teams/{team_slug}/teams",
  8532. "GET /projects/columns/{column_id}/cards",
  8533. "GET /projects/{project_id}/collaborators",
  8534. "GET /projects/{project_id}/columns",
  8535. "GET /repos/{owner}/{repo}/actions/artifacts",
  8536. "GET /repos/{owner}/{repo}/actions/caches",
  8537. "GET /repos/{owner}/{repo}/actions/organization-secrets",
  8538. "GET /repos/{owner}/{repo}/actions/organization-variables",
  8539. "GET /repos/{owner}/{repo}/actions/runners",
  8540. "GET /repos/{owner}/{repo}/actions/runs",
  8541. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts",
  8542. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs",
  8543. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs",
  8544. "GET /repos/{owner}/{repo}/actions/secrets",
  8545. "GET /repos/{owner}/{repo}/actions/variables",
  8546. "GET /repos/{owner}/{repo}/actions/workflows",
  8547. "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs",
  8548. "GET /repos/{owner}/{repo}/activity",
  8549. "GET /repos/{owner}/{repo}/assignees",
  8550. "GET /repos/{owner}/{repo}/branches",
  8551. "GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations",
  8552. "GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs",
  8553. "GET /repos/{owner}/{repo}/code-scanning/alerts",
  8554. "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances",
  8555. "GET /repos/{owner}/{repo}/code-scanning/analyses",
  8556. "GET /repos/{owner}/{repo}/codespaces",
  8557. "GET /repos/{owner}/{repo}/codespaces/devcontainers",
  8558. "GET /repos/{owner}/{repo}/codespaces/secrets",
  8559. "GET /repos/{owner}/{repo}/collaborators",
  8560. "GET /repos/{owner}/{repo}/comments",
  8561. "GET /repos/{owner}/{repo}/comments/{comment_id}/reactions",
  8562. "GET /repos/{owner}/{repo}/commits",
  8563. "GET /repos/{owner}/{repo}/commits/{commit_sha}/comments",
  8564. "GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls",
  8565. "GET /repos/{owner}/{repo}/commits/{ref}/check-runs",
  8566. "GET /repos/{owner}/{repo}/commits/{ref}/check-suites",
  8567. "GET /repos/{owner}/{repo}/commits/{ref}/status",
  8568. "GET /repos/{owner}/{repo}/commits/{ref}/statuses",
  8569. "GET /repos/{owner}/{repo}/contributors",
  8570. "GET /repos/{owner}/{repo}/dependabot/alerts",
  8571. "GET /repos/{owner}/{repo}/dependabot/secrets",
  8572. "GET /repos/{owner}/{repo}/deployments",
  8573. "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses",
  8574. "GET /repos/{owner}/{repo}/environments",
  8575. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies",
  8576. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps",
  8577. "GET /repos/{owner}/{repo}/events",
  8578. "GET /repos/{owner}/{repo}/forks",
  8579. "GET /repos/{owner}/{repo}/hooks",
  8580. "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries",
  8581. "GET /repos/{owner}/{repo}/invitations",
  8582. "GET /repos/{owner}/{repo}/issues",
  8583. "GET /repos/{owner}/{repo}/issues/comments",
  8584. "GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions",
  8585. "GET /repos/{owner}/{repo}/issues/events",
  8586. "GET /repos/{owner}/{repo}/issues/{issue_number}/comments",
  8587. "GET /repos/{owner}/{repo}/issues/{issue_number}/events",
  8588. "GET /repos/{owner}/{repo}/issues/{issue_number}/labels",
  8589. "GET /repos/{owner}/{repo}/issues/{issue_number}/reactions",
  8590. "GET /repos/{owner}/{repo}/issues/{issue_number}/timeline",
  8591. "GET /repos/{owner}/{repo}/keys",
  8592. "GET /repos/{owner}/{repo}/labels",
  8593. "GET /repos/{owner}/{repo}/milestones",
  8594. "GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels",
  8595. "GET /repos/{owner}/{repo}/notifications",
  8596. "GET /repos/{owner}/{repo}/pages/builds",
  8597. "GET /repos/{owner}/{repo}/projects",
  8598. "GET /repos/{owner}/{repo}/pulls",
  8599. "GET /repos/{owner}/{repo}/pulls/comments",
  8600. "GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions",
  8601. "GET /repos/{owner}/{repo}/pulls/{pull_number}/comments",
  8602. "GET /repos/{owner}/{repo}/pulls/{pull_number}/commits",
  8603. "GET /repos/{owner}/{repo}/pulls/{pull_number}/files",
  8604. "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews",
  8605. "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments",
  8606. "GET /repos/{owner}/{repo}/releases",
  8607. "GET /repos/{owner}/{repo}/releases/{release_id}/assets",
  8608. "GET /repos/{owner}/{repo}/releases/{release_id}/reactions",
  8609. "GET /repos/{owner}/{repo}/rules/branches/{branch}",
  8610. "GET /repos/{owner}/{repo}/rulesets",
  8611. "GET /repos/{owner}/{repo}/rulesets/rule-suites",
  8612. "GET /repos/{owner}/{repo}/secret-scanning/alerts",
  8613. "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations",
  8614. "GET /repos/{owner}/{repo}/security-advisories",
  8615. "GET /repos/{owner}/{repo}/stargazers",
  8616. "GET /repos/{owner}/{repo}/subscribers",
  8617. "GET /repos/{owner}/{repo}/tags",
  8618. "GET /repos/{owner}/{repo}/teams",
  8619. "GET /repos/{owner}/{repo}/topics",
  8620. "GET /repositories",
  8621. "GET /repositories/{repository_id}/environments/{environment_name}/secrets",
  8622. "GET /repositories/{repository_id}/environments/{environment_name}/variables",
  8623. "GET /search/code",
  8624. "GET /search/commits",
  8625. "GET /search/issues",
  8626. "GET /search/labels",
  8627. "GET /search/repositories",
  8628. "GET /search/topics",
  8629. "GET /search/users",
  8630. "GET /teams/{team_id}/discussions",
  8631. "GET /teams/{team_id}/discussions/{discussion_number}/comments",
  8632. "GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions",
  8633. "GET /teams/{team_id}/discussions/{discussion_number}/reactions",
  8634. "GET /teams/{team_id}/invitations",
  8635. "GET /teams/{team_id}/members",
  8636. "GET /teams/{team_id}/projects",
  8637. "GET /teams/{team_id}/repos",
  8638. "GET /teams/{team_id}/teams",
  8639. "GET /user/blocks",
  8640. "GET /user/codespaces",
  8641. "GET /user/codespaces/secrets",
  8642. "GET /user/emails",
  8643. "GET /user/followers",
  8644. "GET /user/following",
  8645. "GET /user/gpg_keys",
  8646. "GET /user/installations",
  8647. "GET /user/installations/{installation_id}/repositories",
  8648. "GET /user/issues",
  8649. "GET /user/keys",
  8650. "GET /user/marketplace_purchases",
  8651. "GET /user/marketplace_purchases/stubbed",
  8652. "GET /user/memberships/orgs",
  8653. "GET /user/migrations",
  8654. "GET /user/migrations/{migration_id}/repositories",
  8655. "GET /user/orgs",
  8656. "GET /user/packages",
  8657. "GET /user/packages/{package_type}/{package_name}/versions",
  8658. "GET /user/public_emails",
  8659. "GET /user/repos",
  8660. "GET /user/repository_invitations",
  8661. "GET /user/social_accounts",
  8662. "GET /user/ssh_signing_keys",
  8663. "GET /user/starred",
  8664. "GET /user/subscriptions",
  8665. "GET /user/teams",
  8666. "GET /users",
  8667. "GET /users/{username}/events",
  8668. "GET /users/{username}/events/orgs/{org}",
  8669. "GET /users/{username}/events/public",
  8670. "GET /users/{username}/followers",
  8671. "GET /users/{username}/following",
  8672. "GET /users/{username}/gists",
  8673. "GET /users/{username}/gpg_keys",
  8674. "GET /users/{username}/keys",
  8675. "GET /users/{username}/orgs",
  8676. "GET /users/{username}/packages",
  8677. "GET /users/{username}/projects",
  8678. "GET /users/{username}/received_events",
  8679. "GET /users/{username}/received_events/public",
  8680. "GET /users/{username}/repos",
  8681. "GET /users/{username}/social_accounts",
  8682. "GET /users/{username}/ssh_signing_keys",
  8683. "GET /users/{username}/starred",
  8684. "GET /users/{username}/subscriptions"
  8685. ];
  8686. // pkg/dist-src/paginating-endpoints.js
  8687. function isPaginatingEndpoint(arg) {
  8688. if (typeof arg === "string") {
  8689. return paginatingEndpoints.includes(arg);
  8690. } else {
  8691. return false;
  8692. }
  8693. }
  8694. // pkg/dist-src/index.js
  8695. function paginateRest(octokit) {
  8696. return {
  8697. paginate: Object.assign(paginate.bind(null, octokit), {
  8698. iterator: iterator.bind(null, octokit)
  8699. })
  8700. };
  8701. }
  8702. paginateRest.VERSION = VERSION;
  8703. // Annotate the CommonJS export names for ESM import in node:
  8704. 0 && (0);
  8705. /***/ }),
  8706. /***/ 3044:
  8707. /***/ ((module) => {
  8708. "use strict";
  8709. var __defProp = Object.defineProperty;
  8710. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  8711. var __getOwnPropNames = Object.getOwnPropertyNames;
  8712. var __hasOwnProp = Object.prototype.hasOwnProperty;
  8713. var __export = (target, all) => {
  8714. for (var name in all)
  8715. __defProp(target, name, { get: all[name], enumerable: true });
  8716. };
  8717. var __copyProps = (to, from, except, desc) => {
  8718. if (from && typeof from === "object" || typeof from === "function") {
  8719. for (let key of __getOwnPropNames(from))
  8720. if (!__hasOwnProp.call(to, key) && key !== except)
  8721. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  8722. }
  8723. return to;
  8724. };
  8725. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  8726. // pkg/dist-src/index.js
  8727. var dist_src_exports = {};
  8728. __export(dist_src_exports, {
  8729. legacyRestEndpointMethods: () => legacyRestEndpointMethods,
  8730. restEndpointMethods: () => restEndpointMethods
  8731. });
  8732. module.exports = __toCommonJS(dist_src_exports);
  8733. // pkg/dist-src/version.js
  8734. var VERSION = "10.4.1";
  8735. // pkg/dist-src/generated/endpoints.js
  8736. var Endpoints = {
  8737. actions: {
  8738. addCustomLabelsToSelfHostedRunnerForOrg: [
  8739. "POST /orgs/{org}/actions/runners/{runner_id}/labels"
  8740. ],
  8741. addCustomLabelsToSelfHostedRunnerForRepo: [
  8742. "POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
  8743. ],
  8744. addSelectedRepoToOrgSecret: [
  8745. "PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"
  8746. ],
  8747. addSelectedRepoToOrgVariable: [
  8748. "PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"
  8749. ],
  8750. approveWorkflowRun: [
  8751. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve"
  8752. ],
  8753. cancelWorkflowRun: [
  8754. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel"
  8755. ],
  8756. createEnvironmentVariable: [
  8757. "POST /repositories/{repository_id}/environments/{environment_name}/variables"
  8758. ],
  8759. createOrUpdateEnvironmentSecret: [
  8760. "PUT /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"
  8761. ],
  8762. createOrUpdateOrgSecret: ["PUT /orgs/{org}/actions/secrets/{secret_name}"],
  8763. createOrUpdateRepoSecret: [
  8764. "PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}"
  8765. ],
  8766. createOrgVariable: ["POST /orgs/{org}/actions/variables"],
  8767. createRegistrationTokenForOrg: [
  8768. "POST /orgs/{org}/actions/runners/registration-token"
  8769. ],
  8770. createRegistrationTokenForRepo: [
  8771. "POST /repos/{owner}/{repo}/actions/runners/registration-token"
  8772. ],
  8773. createRemoveTokenForOrg: ["POST /orgs/{org}/actions/runners/remove-token"],
  8774. createRemoveTokenForRepo: [
  8775. "POST /repos/{owner}/{repo}/actions/runners/remove-token"
  8776. ],
  8777. createRepoVariable: ["POST /repos/{owner}/{repo}/actions/variables"],
  8778. createWorkflowDispatch: [
  8779. "POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches"
  8780. ],
  8781. deleteActionsCacheById: [
  8782. "DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}"
  8783. ],
  8784. deleteActionsCacheByKey: [
  8785. "DELETE /repos/{owner}/{repo}/actions/caches{?key,ref}"
  8786. ],
  8787. deleteArtifact: [
  8788. "DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"
  8789. ],
  8790. deleteEnvironmentSecret: [
  8791. "DELETE /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"
  8792. ],
  8793. deleteEnvironmentVariable: [
  8794. "DELETE /repositories/{repository_id}/environments/{environment_name}/variables/{name}"
  8795. ],
  8796. deleteOrgSecret: ["DELETE /orgs/{org}/actions/secrets/{secret_name}"],
  8797. deleteOrgVariable: ["DELETE /orgs/{org}/actions/variables/{name}"],
  8798. deleteRepoSecret: [
  8799. "DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}"
  8800. ],
  8801. deleteRepoVariable: [
  8802. "DELETE /repos/{owner}/{repo}/actions/variables/{name}"
  8803. ],
  8804. deleteSelfHostedRunnerFromOrg: [
  8805. "DELETE /orgs/{org}/actions/runners/{runner_id}"
  8806. ],
  8807. deleteSelfHostedRunnerFromRepo: [
  8808. "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}"
  8809. ],
  8810. deleteWorkflowRun: ["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}"],
  8811. deleteWorkflowRunLogs: [
  8812. "DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs"
  8813. ],
  8814. disableSelectedRepositoryGithubActionsOrganization: [
  8815. "DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}"
  8816. ],
  8817. disableWorkflow: [
  8818. "PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable"
  8819. ],
  8820. downloadArtifact: [
  8821. "GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}"
  8822. ],
  8823. downloadJobLogsForWorkflowRun: [
  8824. "GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs"
  8825. ],
  8826. downloadWorkflowRunAttemptLogs: [
  8827. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs"
  8828. ],
  8829. downloadWorkflowRunLogs: [
  8830. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs"
  8831. ],
  8832. enableSelectedRepositoryGithubActionsOrganization: [
  8833. "PUT /orgs/{org}/actions/permissions/repositories/{repository_id}"
  8834. ],
  8835. enableWorkflow: [
  8836. "PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable"
  8837. ],
  8838. forceCancelWorkflowRun: [
  8839. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/force-cancel"
  8840. ],
  8841. generateRunnerJitconfigForOrg: [
  8842. "POST /orgs/{org}/actions/runners/generate-jitconfig"
  8843. ],
  8844. generateRunnerJitconfigForRepo: [
  8845. "POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig"
  8846. ],
  8847. getActionsCacheList: ["GET /repos/{owner}/{repo}/actions/caches"],
  8848. getActionsCacheUsage: ["GET /repos/{owner}/{repo}/actions/cache/usage"],
  8849. getActionsCacheUsageByRepoForOrg: [
  8850. "GET /orgs/{org}/actions/cache/usage-by-repository"
  8851. ],
  8852. getActionsCacheUsageForOrg: ["GET /orgs/{org}/actions/cache/usage"],
  8853. getAllowedActionsOrganization: [
  8854. "GET /orgs/{org}/actions/permissions/selected-actions"
  8855. ],
  8856. getAllowedActionsRepository: [
  8857. "GET /repos/{owner}/{repo}/actions/permissions/selected-actions"
  8858. ],
  8859. getArtifact: ["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"],
  8860. getCustomOidcSubClaimForRepo: [
  8861. "GET /repos/{owner}/{repo}/actions/oidc/customization/sub"
  8862. ],
  8863. getEnvironmentPublicKey: [
  8864. "GET /repositories/{repository_id}/environments/{environment_name}/secrets/public-key"
  8865. ],
  8866. getEnvironmentSecret: [
  8867. "GET /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"
  8868. ],
  8869. getEnvironmentVariable: [
  8870. "GET /repositories/{repository_id}/environments/{environment_name}/variables/{name}"
  8871. ],
  8872. getGithubActionsDefaultWorkflowPermissionsOrganization: [
  8873. "GET /orgs/{org}/actions/permissions/workflow"
  8874. ],
  8875. getGithubActionsDefaultWorkflowPermissionsRepository: [
  8876. "GET /repos/{owner}/{repo}/actions/permissions/workflow"
  8877. ],
  8878. getGithubActionsPermissionsOrganization: [
  8879. "GET /orgs/{org}/actions/permissions"
  8880. ],
  8881. getGithubActionsPermissionsRepository: [
  8882. "GET /repos/{owner}/{repo}/actions/permissions"
  8883. ],
  8884. getJobForWorkflowRun: ["GET /repos/{owner}/{repo}/actions/jobs/{job_id}"],
  8885. getOrgPublicKey: ["GET /orgs/{org}/actions/secrets/public-key"],
  8886. getOrgSecret: ["GET /orgs/{org}/actions/secrets/{secret_name}"],
  8887. getOrgVariable: ["GET /orgs/{org}/actions/variables/{name}"],
  8888. getPendingDeploymentsForRun: [
  8889. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"
  8890. ],
  8891. getRepoPermissions: [
  8892. "GET /repos/{owner}/{repo}/actions/permissions",
  8893. {},
  8894. { renamed: ["actions", "getGithubActionsPermissionsRepository"] }
  8895. ],
  8896. getRepoPublicKey: ["GET /repos/{owner}/{repo}/actions/secrets/public-key"],
  8897. getRepoSecret: ["GET /repos/{owner}/{repo}/actions/secrets/{secret_name}"],
  8898. getRepoVariable: ["GET /repos/{owner}/{repo}/actions/variables/{name}"],
  8899. getReviewsForRun: [
  8900. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals"
  8901. ],
  8902. getSelfHostedRunnerForOrg: ["GET /orgs/{org}/actions/runners/{runner_id}"],
  8903. getSelfHostedRunnerForRepo: [
  8904. "GET /repos/{owner}/{repo}/actions/runners/{runner_id}"
  8905. ],
  8906. getWorkflow: ["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}"],
  8907. getWorkflowAccessToRepository: [
  8908. "GET /repos/{owner}/{repo}/actions/permissions/access"
  8909. ],
  8910. getWorkflowRun: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}"],
  8911. getWorkflowRunAttempt: [
  8912. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}"
  8913. ],
  8914. getWorkflowRunUsage: [
  8915. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing"
  8916. ],
  8917. getWorkflowUsage: [
  8918. "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing"
  8919. ],
  8920. listArtifactsForRepo: ["GET /repos/{owner}/{repo}/actions/artifacts"],
  8921. listEnvironmentSecrets: [
  8922. "GET /repositories/{repository_id}/environments/{environment_name}/secrets"
  8923. ],
  8924. listEnvironmentVariables: [
  8925. "GET /repositories/{repository_id}/environments/{environment_name}/variables"
  8926. ],
  8927. listJobsForWorkflowRun: [
  8928. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs"
  8929. ],
  8930. listJobsForWorkflowRunAttempt: [
  8931. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs"
  8932. ],
  8933. listLabelsForSelfHostedRunnerForOrg: [
  8934. "GET /orgs/{org}/actions/runners/{runner_id}/labels"
  8935. ],
  8936. listLabelsForSelfHostedRunnerForRepo: [
  8937. "GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
  8938. ],
  8939. listOrgSecrets: ["GET /orgs/{org}/actions/secrets"],
  8940. listOrgVariables: ["GET /orgs/{org}/actions/variables"],
  8941. listRepoOrganizationSecrets: [
  8942. "GET /repos/{owner}/{repo}/actions/organization-secrets"
  8943. ],
  8944. listRepoOrganizationVariables: [
  8945. "GET /repos/{owner}/{repo}/actions/organization-variables"
  8946. ],
  8947. listRepoSecrets: ["GET /repos/{owner}/{repo}/actions/secrets"],
  8948. listRepoVariables: ["GET /repos/{owner}/{repo}/actions/variables"],
  8949. listRepoWorkflows: ["GET /repos/{owner}/{repo}/actions/workflows"],
  8950. listRunnerApplicationsForOrg: ["GET /orgs/{org}/actions/runners/downloads"],
  8951. listRunnerApplicationsForRepo: [
  8952. "GET /repos/{owner}/{repo}/actions/runners/downloads"
  8953. ],
  8954. listSelectedReposForOrgSecret: [
  8955. "GET /orgs/{org}/actions/secrets/{secret_name}/repositories"
  8956. ],
  8957. listSelectedReposForOrgVariable: [
  8958. "GET /orgs/{org}/actions/variables/{name}/repositories"
  8959. ],
  8960. listSelectedRepositoriesEnabledGithubActionsOrganization: [
  8961. "GET /orgs/{org}/actions/permissions/repositories"
  8962. ],
  8963. listSelfHostedRunnersForOrg: ["GET /orgs/{org}/actions/runners"],
  8964. listSelfHostedRunnersForRepo: ["GET /repos/{owner}/{repo}/actions/runners"],
  8965. listWorkflowRunArtifacts: [
  8966. "GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts"
  8967. ],
  8968. listWorkflowRuns: [
  8969. "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs"
  8970. ],
  8971. listWorkflowRunsForRepo: ["GET /repos/{owner}/{repo}/actions/runs"],
  8972. reRunJobForWorkflowRun: [
  8973. "POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun"
  8974. ],
  8975. reRunWorkflow: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun"],
  8976. reRunWorkflowFailedJobs: [
  8977. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs"
  8978. ],
  8979. removeAllCustomLabelsFromSelfHostedRunnerForOrg: [
  8980. "DELETE /orgs/{org}/actions/runners/{runner_id}/labels"
  8981. ],
  8982. removeAllCustomLabelsFromSelfHostedRunnerForRepo: [
  8983. "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
  8984. ],
  8985. removeCustomLabelFromSelfHostedRunnerForOrg: [
  8986. "DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}"
  8987. ],
  8988. removeCustomLabelFromSelfHostedRunnerForRepo: [
  8989. "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name}"
  8990. ],
  8991. removeSelectedRepoFromOrgSecret: [
  8992. "DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"
  8993. ],
  8994. removeSelectedRepoFromOrgVariable: [
  8995. "DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"
  8996. ],
  8997. reviewCustomGatesForRun: [
  8998. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule"
  8999. ],
  9000. reviewPendingDeploymentsForRun: [
  9001. "POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"
  9002. ],
  9003. setAllowedActionsOrganization: [
  9004. "PUT /orgs/{org}/actions/permissions/selected-actions"
  9005. ],
  9006. setAllowedActionsRepository: [
  9007. "PUT /repos/{owner}/{repo}/actions/permissions/selected-actions"
  9008. ],
  9009. setCustomLabelsForSelfHostedRunnerForOrg: [
  9010. "PUT /orgs/{org}/actions/runners/{runner_id}/labels"
  9011. ],
  9012. setCustomLabelsForSelfHostedRunnerForRepo: [
  9013. "PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"
  9014. ],
  9015. setCustomOidcSubClaimForRepo: [
  9016. "PUT /repos/{owner}/{repo}/actions/oidc/customization/sub"
  9017. ],
  9018. setGithubActionsDefaultWorkflowPermissionsOrganization: [
  9019. "PUT /orgs/{org}/actions/permissions/workflow"
  9020. ],
  9021. setGithubActionsDefaultWorkflowPermissionsRepository: [
  9022. "PUT /repos/{owner}/{repo}/actions/permissions/workflow"
  9023. ],
  9024. setGithubActionsPermissionsOrganization: [
  9025. "PUT /orgs/{org}/actions/permissions"
  9026. ],
  9027. setGithubActionsPermissionsRepository: [
  9028. "PUT /repos/{owner}/{repo}/actions/permissions"
  9029. ],
  9030. setSelectedReposForOrgSecret: [
  9031. "PUT /orgs/{org}/actions/secrets/{secret_name}/repositories"
  9032. ],
  9033. setSelectedReposForOrgVariable: [
  9034. "PUT /orgs/{org}/actions/variables/{name}/repositories"
  9035. ],
  9036. setSelectedRepositoriesEnabledGithubActionsOrganization: [
  9037. "PUT /orgs/{org}/actions/permissions/repositories"
  9038. ],
  9039. setWorkflowAccessToRepository: [
  9040. "PUT /repos/{owner}/{repo}/actions/permissions/access"
  9041. ],
  9042. updateEnvironmentVariable: [
  9043. "PATCH /repositories/{repository_id}/environments/{environment_name}/variables/{name}"
  9044. ],
  9045. updateOrgVariable: ["PATCH /orgs/{org}/actions/variables/{name}"],
  9046. updateRepoVariable: [
  9047. "PATCH /repos/{owner}/{repo}/actions/variables/{name}"
  9048. ]
  9049. },
  9050. activity: {
  9051. checkRepoIsStarredByAuthenticatedUser: ["GET /user/starred/{owner}/{repo}"],
  9052. deleteRepoSubscription: ["DELETE /repos/{owner}/{repo}/subscription"],
  9053. deleteThreadSubscription: [
  9054. "DELETE /notifications/threads/{thread_id}/subscription"
  9055. ],
  9056. getFeeds: ["GET /feeds"],
  9057. getRepoSubscription: ["GET /repos/{owner}/{repo}/subscription"],
  9058. getThread: ["GET /notifications/threads/{thread_id}"],
  9059. getThreadSubscriptionForAuthenticatedUser: [
  9060. "GET /notifications/threads/{thread_id}/subscription"
  9061. ],
  9062. listEventsForAuthenticatedUser: ["GET /users/{username}/events"],
  9063. listNotificationsForAuthenticatedUser: ["GET /notifications"],
  9064. listOrgEventsForAuthenticatedUser: [
  9065. "GET /users/{username}/events/orgs/{org}"
  9066. ],
  9067. listPublicEvents: ["GET /events"],
  9068. listPublicEventsForRepoNetwork: ["GET /networks/{owner}/{repo}/events"],
  9069. listPublicEventsForUser: ["GET /users/{username}/events/public"],
  9070. listPublicOrgEvents: ["GET /orgs/{org}/events"],
  9071. listReceivedEventsForUser: ["GET /users/{username}/received_events"],
  9072. listReceivedPublicEventsForUser: [
  9073. "GET /users/{username}/received_events/public"
  9074. ],
  9075. listRepoEvents: ["GET /repos/{owner}/{repo}/events"],
  9076. listRepoNotificationsForAuthenticatedUser: [
  9077. "GET /repos/{owner}/{repo}/notifications"
  9078. ],
  9079. listReposStarredByAuthenticatedUser: ["GET /user/starred"],
  9080. listReposStarredByUser: ["GET /users/{username}/starred"],
  9081. listReposWatchedByUser: ["GET /users/{username}/subscriptions"],
  9082. listStargazersForRepo: ["GET /repos/{owner}/{repo}/stargazers"],
  9083. listWatchedReposForAuthenticatedUser: ["GET /user/subscriptions"],
  9084. listWatchersForRepo: ["GET /repos/{owner}/{repo}/subscribers"],
  9085. markNotificationsAsRead: ["PUT /notifications"],
  9086. markRepoNotificationsAsRead: ["PUT /repos/{owner}/{repo}/notifications"],
  9087. markThreadAsDone: ["DELETE /notifications/threads/{thread_id}"],
  9088. markThreadAsRead: ["PATCH /notifications/threads/{thread_id}"],
  9089. setRepoSubscription: ["PUT /repos/{owner}/{repo}/subscription"],
  9090. setThreadSubscription: [
  9091. "PUT /notifications/threads/{thread_id}/subscription"
  9092. ],
  9093. starRepoForAuthenticatedUser: ["PUT /user/starred/{owner}/{repo}"],
  9094. unstarRepoForAuthenticatedUser: ["DELETE /user/starred/{owner}/{repo}"]
  9095. },
  9096. apps: {
  9097. addRepoToInstallation: [
  9098. "PUT /user/installations/{installation_id}/repositories/{repository_id}",
  9099. {},
  9100. { renamed: ["apps", "addRepoToInstallationForAuthenticatedUser"] }
  9101. ],
  9102. addRepoToInstallationForAuthenticatedUser: [
  9103. "PUT /user/installations/{installation_id}/repositories/{repository_id}"
  9104. ],
  9105. checkToken: ["POST /applications/{client_id}/token"],
  9106. createFromManifest: ["POST /app-manifests/{code}/conversions"],
  9107. createInstallationAccessToken: [
  9108. "POST /app/installations/{installation_id}/access_tokens"
  9109. ],
  9110. deleteAuthorization: ["DELETE /applications/{client_id}/grant"],
  9111. deleteInstallation: ["DELETE /app/installations/{installation_id}"],
  9112. deleteToken: ["DELETE /applications/{client_id}/token"],
  9113. getAuthenticated: ["GET /app"],
  9114. getBySlug: ["GET /apps/{app_slug}"],
  9115. getInstallation: ["GET /app/installations/{installation_id}"],
  9116. getOrgInstallation: ["GET /orgs/{org}/installation"],
  9117. getRepoInstallation: ["GET /repos/{owner}/{repo}/installation"],
  9118. getSubscriptionPlanForAccount: [
  9119. "GET /marketplace_listing/accounts/{account_id}"
  9120. ],
  9121. getSubscriptionPlanForAccountStubbed: [
  9122. "GET /marketplace_listing/stubbed/accounts/{account_id}"
  9123. ],
  9124. getUserInstallation: ["GET /users/{username}/installation"],
  9125. getWebhookConfigForApp: ["GET /app/hook/config"],
  9126. getWebhookDelivery: ["GET /app/hook/deliveries/{delivery_id}"],
  9127. listAccountsForPlan: ["GET /marketplace_listing/plans/{plan_id}/accounts"],
  9128. listAccountsForPlanStubbed: [
  9129. "GET /marketplace_listing/stubbed/plans/{plan_id}/accounts"
  9130. ],
  9131. listInstallationReposForAuthenticatedUser: [
  9132. "GET /user/installations/{installation_id}/repositories"
  9133. ],
  9134. listInstallationRequestsForAuthenticatedApp: [
  9135. "GET /app/installation-requests"
  9136. ],
  9137. listInstallations: ["GET /app/installations"],
  9138. listInstallationsForAuthenticatedUser: ["GET /user/installations"],
  9139. listPlans: ["GET /marketplace_listing/plans"],
  9140. listPlansStubbed: ["GET /marketplace_listing/stubbed/plans"],
  9141. listReposAccessibleToInstallation: ["GET /installation/repositories"],
  9142. listSubscriptionsForAuthenticatedUser: ["GET /user/marketplace_purchases"],
  9143. listSubscriptionsForAuthenticatedUserStubbed: [
  9144. "GET /user/marketplace_purchases/stubbed"
  9145. ],
  9146. listWebhookDeliveries: ["GET /app/hook/deliveries"],
  9147. redeliverWebhookDelivery: [
  9148. "POST /app/hook/deliveries/{delivery_id}/attempts"
  9149. ],
  9150. removeRepoFromInstallation: [
  9151. "DELETE /user/installations/{installation_id}/repositories/{repository_id}",
  9152. {},
  9153. { renamed: ["apps", "removeRepoFromInstallationForAuthenticatedUser"] }
  9154. ],
  9155. removeRepoFromInstallationForAuthenticatedUser: [
  9156. "DELETE /user/installations/{installation_id}/repositories/{repository_id}"
  9157. ],
  9158. resetToken: ["PATCH /applications/{client_id}/token"],
  9159. revokeInstallationAccessToken: ["DELETE /installation/token"],
  9160. scopeToken: ["POST /applications/{client_id}/token/scoped"],
  9161. suspendInstallation: ["PUT /app/installations/{installation_id}/suspended"],
  9162. unsuspendInstallation: [
  9163. "DELETE /app/installations/{installation_id}/suspended"
  9164. ],
  9165. updateWebhookConfigForApp: ["PATCH /app/hook/config"]
  9166. },
  9167. billing: {
  9168. getGithubActionsBillingOrg: ["GET /orgs/{org}/settings/billing/actions"],
  9169. getGithubActionsBillingUser: [
  9170. "GET /users/{username}/settings/billing/actions"
  9171. ],
  9172. getGithubPackagesBillingOrg: ["GET /orgs/{org}/settings/billing/packages"],
  9173. getGithubPackagesBillingUser: [
  9174. "GET /users/{username}/settings/billing/packages"
  9175. ],
  9176. getSharedStorageBillingOrg: [
  9177. "GET /orgs/{org}/settings/billing/shared-storage"
  9178. ],
  9179. getSharedStorageBillingUser: [
  9180. "GET /users/{username}/settings/billing/shared-storage"
  9181. ]
  9182. },
  9183. checks: {
  9184. create: ["POST /repos/{owner}/{repo}/check-runs"],
  9185. createSuite: ["POST /repos/{owner}/{repo}/check-suites"],
  9186. get: ["GET /repos/{owner}/{repo}/check-runs/{check_run_id}"],
  9187. getSuite: ["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}"],
  9188. listAnnotations: [
  9189. "GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations"
  9190. ],
  9191. listForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-runs"],
  9192. listForSuite: [
  9193. "GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs"
  9194. ],
  9195. listSuitesForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-suites"],
  9196. rerequestRun: [
  9197. "POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest"
  9198. ],
  9199. rerequestSuite: [
  9200. "POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest"
  9201. ],
  9202. setSuitesPreferences: [
  9203. "PATCH /repos/{owner}/{repo}/check-suites/preferences"
  9204. ],
  9205. update: ["PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}"]
  9206. },
  9207. codeScanning: {
  9208. deleteAnalysis: [
  9209. "DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}"
  9210. ],
  9211. getAlert: [
  9212. "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}",
  9213. {},
  9214. { renamedParameters: { alert_id: "alert_number" } }
  9215. ],
  9216. getAnalysis: [
  9217. "GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}"
  9218. ],
  9219. getCodeqlDatabase: [
  9220. "GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}"
  9221. ],
  9222. getDefaultSetup: ["GET /repos/{owner}/{repo}/code-scanning/default-setup"],
  9223. getSarif: ["GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}"],
  9224. listAlertInstances: [
  9225. "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances"
  9226. ],
  9227. listAlertsForOrg: ["GET /orgs/{org}/code-scanning/alerts"],
  9228. listAlertsForRepo: ["GET /repos/{owner}/{repo}/code-scanning/alerts"],
  9229. listAlertsInstances: [
  9230. "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances",
  9231. {},
  9232. { renamed: ["codeScanning", "listAlertInstances"] }
  9233. ],
  9234. listCodeqlDatabases: [
  9235. "GET /repos/{owner}/{repo}/code-scanning/codeql/databases"
  9236. ],
  9237. listRecentAnalyses: ["GET /repos/{owner}/{repo}/code-scanning/analyses"],
  9238. updateAlert: [
  9239. "PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}"
  9240. ],
  9241. updateDefaultSetup: [
  9242. "PATCH /repos/{owner}/{repo}/code-scanning/default-setup"
  9243. ],
  9244. uploadSarif: ["POST /repos/{owner}/{repo}/code-scanning/sarifs"]
  9245. },
  9246. codesOfConduct: {
  9247. getAllCodesOfConduct: ["GET /codes_of_conduct"],
  9248. getConductCode: ["GET /codes_of_conduct/{key}"]
  9249. },
  9250. codespaces: {
  9251. addRepositoryForSecretForAuthenticatedUser: [
  9252. "PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"
  9253. ],
  9254. addSelectedRepoToOrgSecret: [
  9255. "PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"
  9256. ],
  9257. checkPermissionsForDevcontainer: [
  9258. "GET /repos/{owner}/{repo}/codespaces/permissions_check"
  9259. ],
  9260. codespaceMachinesForAuthenticatedUser: [
  9261. "GET /user/codespaces/{codespace_name}/machines"
  9262. ],
  9263. createForAuthenticatedUser: ["POST /user/codespaces"],
  9264. createOrUpdateOrgSecret: [
  9265. "PUT /orgs/{org}/codespaces/secrets/{secret_name}"
  9266. ],
  9267. createOrUpdateRepoSecret: [
  9268. "PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"
  9269. ],
  9270. createOrUpdateSecretForAuthenticatedUser: [
  9271. "PUT /user/codespaces/secrets/{secret_name}"
  9272. ],
  9273. createWithPrForAuthenticatedUser: [
  9274. "POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces"
  9275. ],
  9276. createWithRepoForAuthenticatedUser: [
  9277. "POST /repos/{owner}/{repo}/codespaces"
  9278. ],
  9279. deleteForAuthenticatedUser: ["DELETE /user/codespaces/{codespace_name}"],
  9280. deleteFromOrganization: [
  9281. "DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name}"
  9282. ],
  9283. deleteOrgSecret: ["DELETE /orgs/{org}/codespaces/secrets/{secret_name}"],
  9284. deleteRepoSecret: [
  9285. "DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"
  9286. ],
  9287. deleteSecretForAuthenticatedUser: [
  9288. "DELETE /user/codespaces/secrets/{secret_name}"
  9289. ],
  9290. exportForAuthenticatedUser: [
  9291. "POST /user/codespaces/{codespace_name}/exports"
  9292. ],
  9293. getCodespacesForUserInOrg: [
  9294. "GET /orgs/{org}/members/{username}/codespaces"
  9295. ],
  9296. getExportDetailsForAuthenticatedUser: [
  9297. "GET /user/codespaces/{codespace_name}/exports/{export_id}"
  9298. ],
  9299. getForAuthenticatedUser: ["GET /user/codespaces/{codespace_name}"],
  9300. getOrgPublicKey: ["GET /orgs/{org}/codespaces/secrets/public-key"],
  9301. getOrgSecret: ["GET /orgs/{org}/codespaces/secrets/{secret_name}"],
  9302. getPublicKeyForAuthenticatedUser: [
  9303. "GET /user/codespaces/secrets/public-key"
  9304. ],
  9305. getRepoPublicKey: [
  9306. "GET /repos/{owner}/{repo}/codespaces/secrets/public-key"
  9307. ],
  9308. getRepoSecret: [
  9309. "GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"
  9310. ],
  9311. getSecretForAuthenticatedUser: [
  9312. "GET /user/codespaces/secrets/{secret_name}"
  9313. ],
  9314. listDevcontainersInRepositoryForAuthenticatedUser: [
  9315. "GET /repos/{owner}/{repo}/codespaces/devcontainers"
  9316. ],
  9317. listForAuthenticatedUser: ["GET /user/codespaces"],
  9318. listInOrganization: [
  9319. "GET /orgs/{org}/codespaces",
  9320. {},
  9321. { renamedParameters: { org_id: "org" } }
  9322. ],
  9323. listInRepositoryForAuthenticatedUser: [
  9324. "GET /repos/{owner}/{repo}/codespaces"
  9325. ],
  9326. listOrgSecrets: ["GET /orgs/{org}/codespaces/secrets"],
  9327. listRepoSecrets: ["GET /repos/{owner}/{repo}/codespaces/secrets"],
  9328. listRepositoriesForSecretForAuthenticatedUser: [
  9329. "GET /user/codespaces/secrets/{secret_name}/repositories"
  9330. ],
  9331. listSecretsForAuthenticatedUser: ["GET /user/codespaces/secrets"],
  9332. listSelectedReposForOrgSecret: [
  9333. "GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories"
  9334. ],
  9335. preFlightWithRepoForAuthenticatedUser: [
  9336. "GET /repos/{owner}/{repo}/codespaces/new"
  9337. ],
  9338. publishForAuthenticatedUser: [
  9339. "POST /user/codespaces/{codespace_name}/publish"
  9340. ],
  9341. removeRepositoryForSecretForAuthenticatedUser: [
  9342. "DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"
  9343. ],
  9344. removeSelectedRepoFromOrgSecret: [
  9345. "DELETE /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"
  9346. ],
  9347. repoMachinesForAuthenticatedUser: [
  9348. "GET /repos/{owner}/{repo}/codespaces/machines"
  9349. ],
  9350. setRepositoriesForSecretForAuthenticatedUser: [
  9351. "PUT /user/codespaces/secrets/{secret_name}/repositories"
  9352. ],
  9353. setSelectedReposForOrgSecret: [
  9354. "PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories"
  9355. ],
  9356. startForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/start"],
  9357. stopForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/stop"],
  9358. stopInOrganization: [
  9359. "POST /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop"
  9360. ],
  9361. updateForAuthenticatedUser: ["PATCH /user/codespaces/{codespace_name}"]
  9362. },
  9363. copilot: {
  9364. addCopilotSeatsForTeams: [
  9365. "POST /orgs/{org}/copilot/billing/selected_teams"
  9366. ],
  9367. addCopilotSeatsForUsers: [
  9368. "POST /orgs/{org}/copilot/billing/selected_users"
  9369. ],
  9370. cancelCopilotSeatAssignmentForTeams: [
  9371. "DELETE /orgs/{org}/copilot/billing/selected_teams"
  9372. ],
  9373. cancelCopilotSeatAssignmentForUsers: [
  9374. "DELETE /orgs/{org}/copilot/billing/selected_users"
  9375. ],
  9376. getCopilotOrganizationDetails: ["GET /orgs/{org}/copilot/billing"],
  9377. getCopilotSeatDetailsForUser: [
  9378. "GET /orgs/{org}/members/{username}/copilot"
  9379. ],
  9380. listCopilotSeats: ["GET /orgs/{org}/copilot/billing/seats"]
  9381. },
  9382. dependabot: {
  9383. addSelectedRepoToOrgSecret: [
  9384. "PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"
  9385. ],
  9386. createOrUpdateOrgSecret: [
  9387. "PUT /orgs/{org}/dependabot/secrets/{secret_name}"
  9388. ],
  9389. createOrUpdateRepoSecret: [
  9390. "PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"
  9391. ],
  9392. deleteOrgSecret: ["DELETE /orgs/{org}/dependabot/secrets/{secret_name}"],
  9393. deleteRepoSecret: [
  9394. "DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"
  9395. ],
  9396. getAlert: ["GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"],
  9397. getOrgPublicKey: ["GET /orgs/{org}/dependabot/secrets/public-key"],
  9398. getOrgSecret: ["GET /orgs/{org}/dependabot/secrets/{secret_name}"],
  9399. getRepoPublicKey: [
  9400. "GET /repos/{owner}/{repo}/dependabot/secrets/public-key"
  9401. ],
  9402. getRepoSecret: [
  9403. "GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"
  9404. ],
  9405. listAlertsForEnterprise: [
  9406. "GET /enterprises/{enterprise}/dependabot/alerts"
  9407. ],
  9408. listAlertsForOrg: ["GET /orgs/{org}/dependabot/alerts"],
  9409. listAlertsForRepo: ["GET /repos/{owner}/{repo}/dependabot/alerts"],
  9410. listOrgSecrets: ["GET /orgs/{org}/dependabot/secrets"],
  9411. listRepoSecrets: ["GET /repos/{owner}/{repo}/dependabot/secrets"],
  9412. listSelectedReposForOrgSecret: [
  9413. "GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories"
  9414. ],
  9415. removeSelectedRepoFromOrgSecret: [
  9416. "DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"
  9417. ],
  9418. setSelectedReposForOrgSecret: [
  9419. "PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories"
  9420. ],
  9421. updateAlert: [
  9422. "PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"
  9423. ]
  9424. },
  9425. dependencyGraph: {
  9426. createRepositorySnapshot: [
  9427. "POST /repos/{owner}/{repo}/dependency-graph/snapshots"
  9428. ],
  9429. diffRange: [
  9430. "GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead}"
  9431. ],
  9432. exportSbom: ["GET /repos/{owner}/{repo}/dependency-graph/sbom"]
  9433. },
  9434. emojis: { get: ["GET /emojis"] },
  9435. gists: {
  9436. checkIsStarred: ["GET /gists/{gist_id}/star"],
  9437. create: ["POST /gists"],
  9438. createComment: ["POST /gists/{gist_id}/comments"],
  9439. delete: ["DELETE /gists/{gist_id}"],
  9440. deleteComment: ["DELETE /gists/{gist_id}/comments/{comment_id}"],
  9441. fork: ["POST /gists/{gist_id}/forks"],
  9442. get: ["GET /gists/{gist_id}"],
  9443. getComment: ["GET /gists/{gist_id}/comments/{comment_id}"],
  9444. getRevision: ["GET /gists/{gist_id}/{sha}"],
  9445. list: ["GET /gists"],
  9446. listComments: ["GET /gists/{gist_id}/comments"],
  9447. listCommits: ["GET /gists/{gist_id}/commits"],
  9448. listForUser: ["GET /users/{username}/gists"],
  9449. listForks: ["GET /gists/{gist_id}/forks"],
  9450. listPublic: ["GET /gists/public"],
  9451. listStarred: ["GET /gists/starred"],
  9452. star: ["PUT /gists/{gist_id}/star"],
  9453. unstar: ["DELETE /gists/{gist_id}/star"],
  9454. update: ["PATCH /gists/{gist_id}"],
  9455. updateComment: ["PATCH /gists/{gist_id}/comments/{comment_id}"]
  9456. },
  9457. git: {
  9458. createBlob: ["POST /repos/{owner}/{repo}/git/blobs"],
  9459. createCommit: ["POST /repos/{owner}/{repo}/git/commits"],
  9460. createRef: ["POST /repos/{owner}/{repo}/git/refs"],
  9461. createTag: ["POST /repos/{owner}/{repo}/git/tags"],
  9462. createTree: ["POST /repos/{owner}/{repo}/git/trees"],
  9463. deleteRef: ["DELETE /repos/{owner}/{repo}/git/refs/{ref}"],
  9464. getBlob: ["GET /repos/{owner}/{repo}/git/blobs/{file_sha}"],
  9465. getCommit: ["GET /repos/{owner}/{repo}/git/commits/{commit_sha}"],
  9466. getRef: ["GET /repos/{owner}/{repo}/git/ref/{ref}"],
  9467. getTag: ["GET /repos/{owner}/{repo}/git/tags/{tag_sha}"],
  9468. getTree: ["GET /repos/{owner}/{repo}/git/trees/{tree_sha}"],
  9469. listMatchingRefs: ["GET /repos/{owner}/{repo}/git/matching-refs/{ref}"],
  9470. updateRef: ["PATCH /repos/{owner}/{repo}/git/refs/{ref}"]
  9471. },
  9472. gitignore: {
  9473. getAllTemplates: ["GET /gitignore/templates"],
  9474. getTemplate: ["GET /gitignore/templates/{name}"]
  9475. },
  9476. interactions: {
  9477. getRestrictionsForAuthenticatedUser: ["GET /user/interaction-limits"],
  9478. getRestrictionsForOrg: ["GET /orgs/{org}/interaction-limits"],
  9479. getRestrictionsForRepo: ["GET /repos/{owner}/{repo}/interaction-limits"],
  9480. getRestrictionsForYourPublicRepos: [
  9481. "GET /user/interaction-limits",
  9482. {},
  9483. { renamed: ["interactions", "getRestrictionsForAuthenticatedUser"] }
  9484. ],
  9485. removeRestrictionsForAuthenticatedUser: ["DELETE /user/interaction-limits"],
  9486. removeRestrictionsForOrg: ["DELETE /orgs/{org}/interaction-limits"],
  9487. removeRestrictionsForRepo: [
  9488. "DELETE /repos/{owner}/{repo}/interaction-limits"
  9489. ],
  9490. removeRestrictionsForYourPublicRepos: [
  9491. "DELETE /user/interaction-limits",
  9492. {},
  9493. { renamed: ["interactions", "removeRestrictionsForAuthenticatedUser"] }
  9494. ],
  9495. setRestrictionsForAuthenticatedUser: ["PUT /user/interaction-limits"],
  9496. setRestrictionsForOrg: ["PUT /orgs/{org}/interaction-limits"],
  9497. setRestrictionsForRepo: ["PUT /repos/{owner}/{repo}/interaction-limits"],
  9498. setRestrictionsForYourPublicRepos: [
  9499. "PUT /user/interaction-limits",
  9500. {},
  9501. { renamed: ["interactions", "setRestrictionsForAuthenticatedUser"] }
  9502. ]
  9503. },
  9504. issues: {
  9505. addAssignees: [
  9506. "POST /repos/{owner}/{repo}/issues/{issue_number}/assignees"
  9507. ],
  9508. addLabels: ["POST /repos/{owner}/{repo}/issues/{issue_number}/labels"],
  9509. checkUserCanBeAssigned: ["GET /repos/{owner}/{repo}/assignees/{assignee}"],
  9510. checkUserCanBeAssignedToIssue: [
  9511. "GET /repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}"
  9512. ],
  9513. create: ["POST /repos/{owner}/{repo}/issues"],
  9514. createComment: [
  9515. "POST /repos/{owner}/{repo}/issues/{issue_number}/comments"
  9516. ],
  9517. createLabel: ["POST /repos/{owner}/{repo}/labels"],
  9518. createMilestone: ["POST /repos/{owner}/{repo}/milestones"],
  9519. deleteComment: [
  9520. "DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}"
  9521. ],
  9522. deleteLabel: ["DELETE /repos/{owner}/{repo}/labels/{name}"],
  9523. deleteMilestone: [
  9524. "DELETE /repos/{owner}/{repo}/milestones/{milestone_number}"
  9525. ],
  9526. get: ["GET /repos/{owner}/{repo}/issues/{issue_number}"],
  9527. getComment: ["GET /repos/{owner}/{repo}/issues/comments/{comment_id}"],
  9528. getEvent: ["GET /repos/{owner}/{repo}/issues/events/{event_id}"],
  9529. getLabel: ["GET /repos/{owner}/{repo}/labels/{name}"],
  9530. getMilestone: ["GET /repos/{owner}/{repo}/milestones/{milestone_number}"],
  9531. list: ["GET /issues"],
  9532. listAssignees: ["GET /repos/{owner}/{repo}/assignees"],
  9533. listComments: ["GET /repos/{owner}/{repo}/issues/{issue_number}/comments"],
  9534. listCommentsForRepo: ["GET /repos/{owner}/{repo}/issues/comments"],
  9535. listEvents: ["GET /repos/{owner}/{repo}/issues/{issue_number}/events"],
  9536. listEventsForRepo: ["GET /repos/{owner}/{repo}/issues/events"],
  9537. listEventsForTimeline: [
  9538. "GET /repos/{owner}/{repo}/issues/{issue_number}/timeline"
  9539. ],
  9540. listForAuthenticatedUser: ["GET /user/issues"],
  9541. listForOrg: ["GET /orgs/{org}/issues"],
  9542. listForRepo: ["GET /repos/{owner}/{repo}/issues"],
  9543. listLabelsForMilestone: [
  9544. "GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels"
  9545. ],
  9546. listLabelsForRepo: ["GET /repos/{owner}/{repo}/labels"],
  9547. listLabelsOnIssue: [
  9548. "GET /repos/{owner}/{repo}/issues/{issue_number}/labels"
  9549. ],
  9550. listMilestones: ["GET /repos/{owner}/{repo}/milestones"],
  9551. lock: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/lock"],
  9552. removeAllLabels: [
  9553. "DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels"
  9554. ],
  9555. removeAssignees: [
  9556. "DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees"
  9557. ],
  9558. removeLabel: [
  9559. "DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}"
  9560. ],
  9561. setLabels: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/labels"],
  9562. unlock: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock"],
  9563. update: ["PATCH /repos/{owner}/{repo}/issues/{issue_number}"],
  9564. updateComment: ["PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}"],
  9565. updateLabel: ["PATCH /repos/{owner}/{repo}/labels/{name}"],
  9566. updateMilestone: [
  9567. "PATCH /repos/{owner}/{repo}/milestones/{milestone_number}"
  9568. ]
  9569. },
  9570. licenses: {
  9571. get: ["GET /licenses/{license}"],
  9572. getAllCommonlyUsed: ["GET /licenses"],
  9573. getForRepo: ["GET /repos/{owner}/{repo}/license"]
  9574. },
  9575. markdown: {
  9576. render: ["POST /markdown"],
  9577. renderRaw: [
  9578. "POST /markdown/raw",
  9579. { headers: { "content-type": "text/plain; charset=utf-8" } }
  9580. ]
  9581. },
  9582. meta: {
  9583. get: ["GET /meta"],
  9584. getAllVersions: ["GET /versions"],
  9585. getOctocat: ["GET /octocat"],
  9586. getZen: ["GET /zen"],
  9587. root: ["GET /"]
  9588. },
  9589. migrations: {
  9590. cancelImport: [
  9591. "DELETE /repos/{owner}/{repo}/import",
  9592. {},
  9593. {
  9594. deprecated: "octokit.rest.migrations.cancelImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#cancel-an-import"
  9595. }
  9596. ],
  9597. deleteArchiveForAuthenticatedUser: [
  9598. "DELETE /user/migrations/{migration_id}/archive"
  9599. ],
  9600. deleteArchiveForOrg: [
  9601. "DELETE /orgs/{org}/migrations/{migration_id}/archive"
  9602. ],
  9603. downloadArchiveForOrg: [
  9604. "GET /orgs/{org}/migrations/{migration_id}/archive"
  9605. ],
  9606. getArchiveForAuthenticatedUser: [
  9607. "GET /user/migrations/{migration_id}/archive"
  9608. ],
  9609. getCommitAuthors: [
  9610. "GET /repos/{owner}/{repo}/import/authors",
  9611. {},
  9612. {
  9613. deprecated: "octokit.rest.migrations.getCommitAuthors() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-commit-authors"
  9614. }
  9615. ],
  9616. getImportStatus: [
  9617. "GET /repos/{owner}/{repo}/import",
  9618. {},
  9619. {
  9620. deprecated: "octokit.rest.migrations.getImportStatus() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-an-import-status"
  9621. }
  9622. ],
  9623. getLargeFiles: [
  9624. "GET /repos/{owner}/{repo}/import/large_files",
  9625. {},
  9626. {
  9627. deprecated: "octokit.rest.migrations.getLargeFiles() is deprecated, see https://docs.github.com/rest/migrations/source-imports#get-large-files"
  9628. }
  9629. ],
  9630. getStatusForAuthenticatedUser: ["GET /user/migrations/{migration_id}"],
  9631. getStatusForOrg: ["GET /orgs/{org}/migrations/{migration_id}"],
  9632. listForAuthenticatedUser: ["GET /user/migrations"],
  9633. listForOrg: ["GET /orgs/{org}/migrations"],
  9634. listReposForAuthenticatedUser: [
  9635. "GET /user/migrations/{migration_id}/repositories"
  9636. ],
  9637. listReposForOrg: ["GET /orgs/{org}/migrations/{migration_id}/repositories"],
  9638. listReposForUser: [
  9639. "GET /user/migrations/{migration_id}/repositories",
  9640. {},
  9641. { renamed: ["migrations", "listReposForAuthenticatedUser"] }
  9642. ],
  9643. mapCommitAuthor: [
  9644. "PATCH /repos/{owner}/{repo}/import/authors/{author_id}",
  9645. {},
  9646. {
  9647. deprecated: "octokit.rest.migrations.mapCommitAuthor() is deprecated, see https://docs.github.com/rest/migrations/source-imports#map-a-commit-author"
  9648. }
  9649. ],
  9650. setLfsPreference: [
  9651. "PATCH /repos/{owner}/{repo}/import/lfs",
  9652. {},
  9653. {
  9654. deprecated: "octokit.rest.migrations.setLfsPreference() is deprecated, see https://docs.github.com/rest/migrations/source-imports#update-git-lfs-preference"
  9655. }
  9656. ],
  9657. startForAuthenticatedUser: ["POST /user/migrations"],
  9658. startForOrg: ["POST /orgs/{org}/migrations"],
  9659. startImport: [
  9660. "PUT /repos/{owner}/{repo}/import",
  9661. {},
  9662. {
  9663. deprecated: "octokit.rest.migrations.startImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#start-an-import"
  9664. }
  9665. ],
  9666. unlockRepoForAuthenticatedUser: [
  9667. "DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock"
  9668. ],
  9669. unlockRepoForOrg: [
  9670. "DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock"
  9671. ],
  9672. updateImport: [
  9673. "PATCH /repos/{owner}/{repo}/import",
  9674. {},
  9675. {
  9676. deprecated: "octokit.rest.migrations.updateImport() is deprecated, see https://docs.github.com/rest/migrations/source-imports#update-an-import"
  9677. }
  9678. ]
  9679. },
  9680. oidc: {
  9681. getOidcCustomSubTemplateForOrg: [
  9682. "GET /orgs/{org}/actions/oidc/customization/sub"
  9683. ],
  9684. updateOidcCustomSubTemplateForOrg: [
  9685. "PUT /orgs/{org}/actions/oidc/customization/sub"
  9686. ]
  9687. },
  9688. orgs: {
  9689. addSecurityManagerTeam: [
  9690. "PUT /orgs/{org}/security-managers/teams/{team_slug}"
  9691. ],
  9692. assignTeamToOrgRole: [
  9693. "PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"
  9694. ],
  9695. assignUserToOrgRole: [
  9696. "PUT /orgs/{org}/organization-roles/users/{username}/{role_id}"
  9697. ],
  9698. blockUser: ["PUT /orgs/{org}/blocks/{username}"],
  9699. cancelInvitation: ["DELETE /orgs/{org}/invitations/{invitation_id}"],
  9700. checkBlockedUser: ["GET /orgs/{org}/blocks/{username}"],
  9701. checkMembershipForUser: ["GET /orgs/{org}/members/{username}"],
  9702. checkPublicMembershipForUser: ["GET /orgs/{org}/public_members/{username}"],
  9703. convertMemberToOutsideCollaborator: [
  9704. "PUT /orgs/{org}/outside_collaborators/{username}"
  9705. ],
  9706. createCustomOrganizationRole: ["POST /orgs/{org}/organization-roles"],
  9707. createInvitation: ["POST /orgs/{org}/invitations"],
  9708. createOrUpdateCustomProperties: ["PATCH /orgs/{org}/properties/schema"],
  9709. createOrUpdateCustomPropertiesValuesForRepos: [
  9710. "PATCH /orgs/{org}/properties/values"
  9711. ],
  9712. createOrUpdateCustomProperty: [
  9713. "PUT /orgs/{org}/properties/schema/{custom_property_name}"
  9714. ],
  9715. createWebhook: ["POST /orgs/{org}/hooks"],
  9716. delete: ["DELETE /orgs/{org}"],
  9717. deleteCustomOrganizationRole: [
  9718. "DELETE /orgs/{org}/organization-roles/{role_id}"
  9719. ],
  9720. deleteWebhook: ["DELETE /orgs/{org}/hooks/{hook_id}"],
  9721. enableOrDisableSecurityProductOnAllOrgRepos: [
  9722. "POST /orgs/{org}/{security_product}/{enablement}"
  9723. ],
  9724. get: ["GET /orgs/{org}"],
  9725. getAllCustomProperties: ["GET /orgs/{org}/properties/schema"],
  9726. getCustomProperty: [
  9727. "GET /orgs/{org}/properties/schema/{custom_property_name}"
  9728. ],
  9729. getMembershipForAuthenticatedUser: ["GET /user/memberships/orgs/{org}"],
  9730. getMembershipForUser: ["GET /orgs/{org}/memberships/{username}"],
  9731. getOrgRole: ["GET /orgs/{org}/organization-roles/{role_id}"],
  9732. getWebhook: ["GET /orgs/{org}/hooks/{hook_id}"],
  9733. getWebhookConfigForOrg: ["GET /orgs/{org}/hooks/{hook_id}/config"],
  9734. getWebhookDelivery: [
  9735. "GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}"
  9736. ],
  9737. list: ["GET /organizations"],
  9738. listAppInstallations: ["GET /orgs/{org}/installations"],
  9739. listBlockedUsers: ["GET /orgs/{org}/blocks"],
  9740. listCustomPropertiesValuesForRepos: ["GET /orgs/{org}/properties/values"],
  9741. listFailedInvitations: ["GET /orgs/{org}/failed_invitations"],
  9742. listForAuthenticatedUser: ["GET /user/orgs"],
  9743. listForUser: ["GET /users/{username}/orgs"],
  9744. listInvitationTeams: ["GET /orgs/{org}/invitations/{invitation_id}/teams"],
  9745. listMembers: ["GET /orgs/{org}/members"],
  9746. listMembershipsForAuthenticatedUser: ["GET /user/memberships/orgs"],
  9747. listOrgRoleTeams: ["GET /orgs/{org}/organization-roles/{role_id}/teams"],
  9748. listOrgRoleUsers: ["GET /orgs/{org}/organization-roles/{role_id}/users"],
  9749. listOrgRoles: ["GET /orgs/{org}/organization-roles"],
  9750. listOrganizationFineGrainedPermissions: [
  9751. "GET /orgs/{org}/organization-fine-grained-permissions"
  9752. ],
  9753. listOutsideCollaborators: ["GET /orgs/{org}/outside_collaborators"],
  9754. listPatGrantRepositories: [
  9755. "GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories"
  9756. ],
  9757. listPatGrantRequestRepositories: [
  9758. "GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories"
  9759. ],
  9760. listPatGrantRequests: ["GET /orgs/{org}/personal-access-token-requests"],
  9761. listPatGrants: ["GET /orgs/{org}/personal-access-tokens"],
  9762. listPendingInvitations: ["GET /orgs/{org}/invitations"],
  9763. listPublicMembers: ["GET /orgs/{org}/public_members"],
  9764. listSecurityManagerTeams: ["GET /orgs/{org}/security-managers"],
  9765. listWebhookDeliveries: ["GET /orgs/{org}/hooks/{hook_id}/deliveries"],
  9766. listWebhooks: ["GET /orgs/{org}/hooks"],
  9767. patchCustomOrganizationRole: [
  9768. "PATCH /orgs/{org}/organization-roles/{role_id}"
  9769. ],
  9770. pingWebhook: ["POST /orgs/{org}/hooks/{hook_id}/pings"],
  9771. redeliverWebhookDelivery: [
  9772. "POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"
  9773. ],
  9774. removeCustomProperty: [
  9775. "DELETE /orgs/{org}/properties/schema/{custom_property_name}"
  9776. ],
  9777. removeMember: ["DELETE /orgs/{org}/members/{username}"],
  9778. removeMembershipForUser: ["DELETE /orgs/{org}/memberships/{username}"],
  9779. removeOutsideCollaborator: [
  9780. "DELETE /orgs/{org}/outside_collaborators/{username}"
  9781. ],
  9782. removePublicMembershipForAuthenticatedUser: [
  9783. "DELETE /orgs/{org}/public_members/{username}"
  9784. ],
  9785. removeSecurityManagerTeam: [
  9786. "DELETE /orgs/{org}/security-managers/teams/{team_slug}"
  9787. ],
  9788. reviewPatGrantRequest: [
  9789. "POST /orgs/{org}/personal-access-token-requests/{pat_request_id}"
  9790. ],
  9791. reviewPatGrantRequestsInBulk: [
  9792. "POST /orgs/{org}/personal-access-token-requests"
  9793. ],
  9794. revokeAllOrgRolesTeam: [
  9795. "DELETE /orgs/{org}/organization-roles/teams/{team_slug}"
  9796. ],
  9797. revokeAllOrgRolesUser: [
  9798. "DELETE /orgs/{org}/organization-roles/users/{username}"
  9799. ],
  9800. revokeOrgRoleTeam: [
  9801. "DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"
  9802. ],
  9803. revokeOrgRoleUser: [
  9804. "DELETE /orgs/{org}/organization-roles/users/{username}/{role_id}"
  9805. ],
  9806. setMembershipForUser: ["PUT /orgs/{org}/memberships/{username}"],
  9807. setPublicMembershipForAuthenticatedUser: [
  9808. "PUT /orgs/{org}/public_members/{username}"
  9809. ],
  9810. unblockUser: ["DELETE /orgs/{org}/blocks/{username}"],
  9811. update: ["PATCH /orgs/{org}"],
  9812. updateMembershipForAuthenticatedUser: [
  9813. "PATCH /user/memberships/orgs/{org}"
  9814. ],
  9815. updatePatAccess: ["POST /orgs/{org}/personal-access-tokens/{pat_id}"],
  9816. updatePatAccesses: ["POST /orgs/{org}/personal-access-tokens"],
  9817. updateWebhook: ["PATCH /orgs/{org}/hooks/{hook_id}"],
  9818. updateWebhookConfigForOrg: ["PATCH /orgs/{org}/hooks/{hook_id}/config"]
  9819. },
  9820. packages: {
  9821. deletePackageForAuthenticatedUser: [
  9822. "DELETE /user/packages/{package_type}/{package_name}"
  9823. ],
  9824. deletePackageForOrg: [
  9825. "DELETE /orgs/{org}/packages/{package_type}/{package_name}"
  9826. ],
  9827. deletePackageForUser: [
  9828. "DELETE /users/{username}/packages/{package_type}/{package_name}"
  9829. ],
  9830. deletePackageVersionForAuthenticatedUser: [
  9831. "DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9832. ],
  9833. deletePackageVersionForOrg: [
  9834. "DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9835. ],
  9836. deletePackageVersionForUser: [
  9837. "DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9838. ],
  9839. getAllPackageVersionsForAPackageOwnedByAnOrg: [
  9840. "GET /orgs/{org}/packages/{package_type}/{package_name}/versions",
  9841. {},
  9842. { renamed: ["packages", "getAllPackageVersionsForPackageOwnedByOrg"] }
  9843. ],
  9844. getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser: [
  9845. "GET /user/packages/{package_type}/{package_name}/versions",
  9846. {},
  9847. {
  9848. renamed: [
  9849. "packages",
  9850. "getAllPackageVersionsForPackageOwnedByAuthenticatedUser"
  9851. ]
  9852. }
  9853. ],
  9854. getAllPackageVersionsForPackageOwnedByAuthenticatedUser: [
  9855. "GET /user/packages/{package_type}/{package_name}/versions"
  9856. ],
  9857. getAllPackageVersionsForPackageOwnedByOrg: [
  9858. "GET /orgs/{org}/packages/{package_type}/{package_name}/versions"
  9859. ],
  9860. getAllPackageVersionsForPackageOwnedByUser: [
  9861. "GET /users/{username}/packages/{package_type}/{package_name}/versions"
  9862. ],
  9863. getPackageForAuthenticatedUser: [
  9864. "GET /user/packages/{package_type}/{package_name}"
  9865. ],
  9866. getPackageForOrganization: [
  9867. "GET /orgs/{org}/packages/{package_type}/{package_name}"
  9868. ],
  9869. getPackageForUser: [
  9870. "GET /users/{username}/packages/{package_type}/{package_name}"
  9871. ],
  9872. getPackageVersionForAuthenticatedUser: [
  9873. "GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9874. ],
  9875. getPackageVersionForOrganization: [
  9876. "GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9877. ],
  9878. getPackageVersionForUser: [
  9879. "GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"
  9880. ],
  9881. listDockerMigrationConflictingPackagesForAuthenticatedUser: [
  9882. "GET /user/docker/conflicts"
  9883. ],
  9884. listDockerMigrationConflictingPackagesForOrganization: [
  9885. "GET /orgs/{org}/docker/conflicts"
  9886. ],
  9887. listDockerMigrationConflictingPackagesForUser: [
  9888. "GET /users/{username}/docker/conflicts"
  9889. ],
  9890. listPackagesForAuthenticatedUser: ["GET /user/packages"],
  9891. listPackagesForOrganization: ["GET /orgs/{org}/packages"],
  9892. listPackagesForUser: ["GET /users/{username}/packages"],
  9893. restorePackageForAuthenticatedUser: [
  9894. "POST /user/packages/{package_type}/{package_name}/restore{?token}"
  9895. ],
  9896. restorePackageForOrg: [
  9897. "POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}"
  9898. ],
  9899. restorePackageForUser: [
  9900. "POST /users/{username}/packages/{package_type}/{package_name}/restore{?token}"
  9901. ],
  9902. restorePackageVersionForAuthenticatedUser: [
  9903. "POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"
  9904. ],
  9905. restorePackageVersionForOrg: [
  9906. "POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"
  9907. ],
  9908. restorePackageVersionForUser: [
  9909. "POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"
  9910. ]
  9911. },
  9912. projects: {
  9913. addCollaborator: ["PUT /projects/{project_id}/collaborators/{username}"],
  9914. createCard: ["POST /projects/columns/{column_id}/cards"],
  9915. createColumn: ["POST /projects/{project_id}/columns"],
  9916. createForAuthenticatedUser: ["POST /user/projects"],
  9917. createForOrg: ["POST /orgs/{org}/projects"],
  9918. createForRepo: ["POST /repos/{owner}/{repo}/projects"],
  9919. delete: ["DELETE /projects/{project_id}"],
  9920. deleteCard: ["DELETE /projects/columns/cards/{card_id}"],
  9921. deleteColumn: ["DELETE /projects/columns/{column_id}"],
  9922. get: ["GET /projects/{project_id}"],
  9923. getCard: ["GET /projects/columns/cards/{card_id}"],
  9924. getColumn: ["GET /projects/columns/{column_id}"],
  9925. getPermissionForUser: [
  9926. "GET /projects/{project_id}/collaborators/{username}/permission"
  9927. ],
  9928. listCards: ["GET /projects/columns/{column_id}/cards"],
  9929. listCollaborators: ["GET /projects/{project_id}/collaborators"],
  9930. listColumns: ["GET /projects/{project_id}/columns"],
  9931. listForOrg: ["GET /orgs/{org}/projects"],
  9932. listForRepo: ["GET /repos/{owner}/{repo}/projects"],
  9933. listForUser: ["GET /users/{username}/projects"],
  9934. moveCard: ["POST /projects/columns/cards/{card_id}/moves"],
  9935. moveColumn: ["POST /projects/columns/{column_id}/moves"],
  9936. removeCollaborator: [
  9937. "DELETE /projects/{project_id}/collaborators/{username}"
  9938. ],
  9939. update: ["PATCH /projects/{project_id}"],
  9940. updateCard: ["PATCH /projects/columns/cards/{card_id}"],
  9941. updateColumn: ["PATCH /projects/columns/{column_id}"]
  9942. },
  9943. pulls: {
  9944. checkIfMerged: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/merge"],
  9945. create: ["POST /repos/{owner}/{repo}/pulls"],
  9946. createReplyForReviewComment: [
  9947. "POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies"
  9948. ],
  9949. createReview: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],
  9950. createReviewComment: [
  9951. "POST /repos/{owner}/{repo}/pulls/{pull_number}/comments"
  9952. ],
  9953. deletePendingReview: [
  9954. "DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"
  9955. ],
  9956. deleteReviewComment: [
  9957. "DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}"
  9958. ],
  9959. dismissReview: [
  9960. "PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals"
  9961. ],
  9962. get: ["GET /repos/{owner}/{repo}/pulls/{pull_number}"],
  9963. getReview: [
  9964. "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"
  9965. ],
  9966. getReviewComment: ["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}"],
  9967. list: ["GET /repos/{owner}/{repo}/pulls"],
  9968. listCommentsForReview: [
  9969. "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments"
  9970. ],
  9971. listCommits: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/commits"],
  9972. listFiles: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/files"],
  9973. listRequestedReviewers: [
  9974. "GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"
  9975. ],
  9976. listReviewComments: [
  9977. "GET /repos/{owner}/{repo}/pulls/{pull_number}/comments"
  9978. ],
  9979. listReviewCommentsForRepo: ["GET /repos/{owner}/{repo}/pulls/comments"],
  9980. listReviews: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],
  9981. merge: ["PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge"],
  9982. removeRequestedReviewers: [
  9983. "DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"
  9984. ],
  9985. requestReviewers: [
  9986. "POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"
  9987. ],
  9988. submitReview: [
  9989. "POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events"
  9990. ],
  9991. update: ["PATCH /repos/{owner}/{repo}/pulls/{pull_number}"],
  9992. updateBranch: [
  9993. "PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch"
  9994. ],
  9995. updateReview: [
  9996. "PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"
  9997. ],
  9998. updateReviewComment: [
  9999. "PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}"
  10000. ]
  10001. },
  10002. rateLimit: { get: ["GET /rate_limit"] },
  10003. reactions: {
  10004. createForCommitComment: [
  10005. "POST /repos/{owner}/{repo}/comments/{comment_id}/reactions"
  10006. ],
  10007. createForIssue: [
  10008. "POST /repos/{owner}/{repo}/issues/{issue_number}/reactions"
  10009. ],
  10010. createForIssueComment: [
  10011. "POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"
  10012. ],
  10013. createForPullRequestReviewComment: [
  10014. "POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"
  10015. ],
  10016. createForRelease: [
  10017. "POST /repos/{owner}/{repo}/releases/{release_id}/reactions"
  10018. ],
  10019. createForTeamDiscussionCommentInOrg: [
  10020. "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"
  10021. ],
  10022. createForTeamDiscussionInOrg: [
  10023. "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"
  10024. ],
  10025. deleteForCommitComment: [
  10026. "DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}"
  10027. ],
  10028. deleteForIssue: [
  10029. "DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}"
  10030. ],
  10031. deleteForIssueComment: [
  10032. "DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}"
  10033. ],
  10034. deleteForPullRequestComment: [
  10035. "DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}"
  10036. ],
  10037. deleteForRelease: [
  10038. "DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}"
  10039. ],
  10040. deleteForTeamDiscussion: [
  10041. "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}"
  10042. ],
  10043. deleteForTeamDiscussionComment: [
  10044. "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}"
  10045. ],
  10046. listForCommitComment: [
  10047. "GET /repos/{owner}/{repo}/comments/{comment_id}/reactions"
  10048. ],
  10049. listForIssue: ["GET /repos/{owner}/{repo}/issues/{issue_number}/reactions"],
  10050. listForIssueComment: [
  10051. "GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"
  10052. ],
  10053. listForPullRequestReviewComment: [
  10054. "GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"
  10055. ],
  10056. listForRelease: [
  10057. "GET /repos/{owner}/{repo}/releases/{release_id}/reactions"
  10058. ],
  10059. listForTeamDiscussionCommentInOrg: [
  10060. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"
  10061. ],
  10062. listForTeamDiscussionInOrg: [
  10063. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"
  10064. ]
  10065. },
  10066. repos: {
  10067. acceptInvitation: [
  10068. "PATCH /user/repository_invitations/{invitation_id}",
  10069. {},
  10070. { renamed: ["repos", "acceptInvitationForAuthenticatedUser"] }
  10071. ],
  10072. acceptInvitationForAuthenticatedUser: [
  10073. "PATCH /user/repository_invitations/{invitation_id}"
  10074. ],
  10075. addAppAccessRestrictions: [
  10076. "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",
  10077. {},
  10078. { mapToData: "apps" }
  10079. ],
  10080. addCollaborator: ["PUT /repos/{owner}/{repo}/collaborators/{username}"],
  10081. addStatusCheckContexts: [
  10082. "POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",
  10083. {},
  10084. { mapToData: "contexts" }
  10085. ],
  10086. addTeamAccessRestrictions: [
  10087. "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",
  10088. {},
  10089. { mapToData: "teams" }
  10090. ],
  10091. addUserAccessRestrictions: [
  10092. "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",
  10093. {},
  10094. { mapToData: "users" }
  10095. ],
  10096. cancelPagesDeployment: [
  10097. "POST /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}/cancel"
  10098. ],
  10099. checkAutomatedSecurityFixes: [
  10100. "GET /repos/{owner}/{repo}/automated-security-fixes"
  10101. ],
  10102. checkCollaborator: ["GET /repos/{owner}/{repo}/collaborators/{username}"],
  10103. checkVulnerabilityAlerts: [
  10104. "GET /repos/{owner}/{repo}/vulnerability-alerts"
  10105. ],
  10106. codeownersErrors: ["GET /repos/{owner}/{repo}/codeowners/errors"],
  10107. compareCommits: ["GET /repos/{owner}/{repo}/compare/{base}...{head}"],
  10108. compareCommitsWithBasehead: [
  10109. "GET /repos/{owner}/{repo}/compare/{basehead}"
  10110. ],
  10111. createAutolink: ["POST /repos/{owner}/{repo}/autolinks"],
  10112. createCommitComment: [
  10113. "POST /repos/{owner}/{repo}/commits/{commit_sha}/comments"
  10114. ],
  10115. createCommitSignatureProtection: [
  10116. "POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
  10117. ],
  10118. createCommitStatus: ["POST /repos/{owner}/{repo}/statuses/{sha}"],
  10119. createDeployKey: ["POST /repos/{owner}/{repo}/keys"],
  10120. createDeployment: ["POST /repos/{owner}/{repo}/deployments"],
  10121. createDeploymentBranchPolicy: [
  10122. "POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"
  10123. ],
  10124. createDeploymentProtectionRule: [
  10125. "POST /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"
  10126. ],
  10127. createDeploymentStatus: [
  10128. "POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"
  10129. ],
  10130. createDispatchEvent: ["POST /repos/{owner}/{repo}/dispatches"],
  10131. createForAuthenticatedUser: ["POST /user/repos"],
  10132. createFork: ["POST /repos/{owner}/{repo}/forks"],
  10133. createInOrg: ["POST /orgs/{org}/repos"],
  10134. createOrUpdateCustomPropertiesValues: [
  10135. "PATCH /repos/{owner}/{repo}/properties/values"
  10136. ],
  10137. createOrUpdateEnvironment: [
  10138. "PUT /repos/{owner}/{repo}/environments/{environment_name}"
  10139. ],
  10140. createOrUpdateFileContents: ["PUT /repos/{owner}/{repo}/contents/{path}"],
  10141. createOrgRuleset: ["POST /orgs/{org}/rulesets"],
  10142. createPagesDeployment: ["POST /repos/{owner}/{repo}/pages/deployments"],
  10143. createPagesSite: ["POST /repos/{owner}/{repo}/pages"],
  10144. createRelease: ["POST /repos/{owner}/{repo}/releases"],
  10145. createRepoRuleset: ["POST /repos/{owner}/{repo}/rulesets"],
  10146. createTagProtection: ["POST /repos/{owner}/{repo}/tags/protection"],
  10147. createUsingTemplate: [
  10148. "POST /repos/{template_owner}/{template_repo}/generate"
  10149. ],
  10150. createWebhook: ["POST /repos/{owner}/{repo}/hooks"],
  10151. declineInvitation: [
  10152. "DELETE /user/repository_invitations/{invitation_id}",
  10153. {},
  10154. { renamed: ["repos", "declineInvitationForAuthenticatedUser"] }
  10155. ],
  10156. declineInvitationForAuthenticatedUser: [
  10157. "DELETE /user/repository_invitations/{invitation_id}"
  10158. ],
  10159. delete: ["DELETE /repos/{owner}/{repo}"],
  10160. deleteAccessRestrictions: [
  10161. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"
  10162. ],
  10163. deleteAdminBranchProtection: [
  10164. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"
  10165. ],
  10166. deleteAnEnvironment: [
  10167. "DELETE /repos/{owner}/{repo}/environments/{environment_name}"
  10168. ],
  10169. deleteAutolink: ["DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}"],
  10170. deleteBranchProtection: [
  10171. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection"
  10172. ],
  10173. deleteCommitComment: ["DELETE /repos/{owner}/{repo}/comments/{comment_id}"],
  10174. deleteCommitSignatureProtection: [
  10175. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
  10176. ],
  10177. deleteDeployKey: ["DELETE /repos/{owner}/{repo}/keys/{key_id}"],
  10178. deleteDeployment: [
  10179. "DELETE /repos/{owner}/{repo}/deployments/{deployment_id}"
  10180. ],
  10181. deleteDeploymentBranchPolicy: [
  10182. "DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
  10183. ],
  10184. deleteFile: ["DELETE /repos/{owner}/{repo}/contents/{path}"],
  10185. deleteInvitation: [
  10186. "DELETE /repos/{owner}/{repo}/invitations/{invitation_id}"
  10187. ],
  10188. deleteOrgRuleset: ["DELETE /orgs/{org}/rulesets/{ruleset_id}"],
  10189. deletePagesSite: ["DELETE /repos/{owner}/{repo}/pages"],
  10190. deletePullRequestReviewProtection: [
  10191. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
  10192. ],
  10193. deleteRelease: ["DELETE /repos/{owner}/{repo}/releases/{release_id}"],
  10194. deleteReleaseAsset: [
  10195. "DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}"
  10196. ],
  10197. deleteRepoRuleset: ["DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id}"],
  10198. deleteTagProtection: [
  10199. "DELETE /repos/{owner}/{repo}/tags/protection/{tag_protection_id}"
  10200. ],
  10201. deleteWebhook: ["DELETE /repos/{owner}/{repo}/hooks/{hook_id}"],
  10202. disableAutomatedSecurityFixes: [
  10203. "DELETE /repos/{owner}/{repo}/automated-security-fixes"
  10204. ],
  10205. disableDeploymentProtectionRule: [
  10206. "DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"
  10207. ],
  10208. disablePrivateVulnerabilityReporting: [
  10209. "DELETE /repos/{owner}/{repo}/private-vulnerability-reporting"
  10210. ],
  10211. disableVulnerabilityAlerts: [
  10212. "DELETE /repos/{owner}/{repo}/vulnerability-alerts"
  10213. ],
  10214. downloadArchive: [
  10215. "GET /repos/{owner}/{repo}/zipball/{ref}",
  10216. {},
  10217. { renamed: ["repos", "downloadZipballArchive"] }
  10218. ],
  10219. downloadTarballArchive: ["GET /repos/{owner}/{repo}/tarball/{ref}"],
  10220. downloadZipballArchive: ["GET /repos/{owner}/{repo}/zipball/{ref}"],
  10221. enableAutomatedSecurityFixes: [
  10222. "PUT /repos/{owner}/{repo}/automated-security-fixes"
  10223. ],
  10224. enablePrivateVulnerabilityReporting: [
  10225. "PUT /repos/{owner}/{repo}/private-vulnerability-reporting"
  10226. ],
  10227. enableVulnerabilityAlerts: [
  10228. "PUT /repos/{owner}/{repo}/vulnerability-alerts"
  10229. ],
  10230. generateReleaseNotes: [
  10231. "POST /repos/{owner}/{repo}/releases/generate-notes"
  10232. ],
  10233. get: ["GET /repos/{owner}/{repo}"],
  10234. getAccessRestrictions: [
  10235. "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"
  10236. ],
  10237. getAdminBranchProtection: [
  10238. "GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"
  10239. ],
  10240. getAllDeploymentProtectionRules: [
  10241. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"
  10242. ],
  10243. getAllEnvironments: ["GET /repos/{owner}/{repo}/environments"],
  10244. getAllStatusCheckContexts: [
  10245. "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"
  10246. ],
  10247. getAllTopics: ["GET /repos/{owner}/{repo}/topics"],
  10248. getAppsWithAccessToProtectedBranch: [
  10249. "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"
  10250. ],
  10251. getAutolink: ["GET /repos/{owner}/{repo}/autolinks/{autolink_id}"],
  10252. getBranch: ["GET /repos/{owner}/{repo}/branches/{branch}"],
  10253. getBranchProtection: [
  10254. "GET /repos/{owner}/{repo}/branches/{branch}/protection"
  10255. ],
  10256. getBranchRules: ["GET /repos/{owner}/{repo}/rules/branches/{branch}"],
  10257. getClones: ["GET /repos/{owner}/{repo}/traffic/clones"],
  10258. getCodeFrequencyStats: ["GET /repos/{owner}/{repo}/stats/code_frequency"],
  10259. getCollaboratorPermissionLevel: [
  10260. "GET /repos/{owner}/{repo}/collaborators/{username}/permission"
  10261. ],
  10262. getCombinedStatusForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/status"],
  10263. getCommit: ["GET /repos/{owner}/{repo}/commits/{ref}"],
  10264. getCommitActivityStats: ["GET /repos/{owner}/{repo}/stats/commit_activity"],
  10265. getCommitComment: ["GET /repos/{owner}/{repo}/comments/{comment_id}"],
  10266. getCommitSignatureProtection: [
  10267. "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
  10268. ],
  10269. getCommunityProfileMetrics: ["GET /repos/{owner}/{repo}/community/profile"],
  10270. getContent: ["GET /repos/{owner}/{repo}/contents/{path}"],
  10271. getContributorsStats: ["GET /repos/{owner}/{repo}/stats/contributors"],
  10272. getCustomDeploymentProtectionRule: [
  10273. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"
  10274. ],
  10275. getCustomPropertiesValues: ["GET /repos/{owner}/{repo}/properties/values"],
  10276. getDeployKey: ["GET /repos/{owner}/{repo}/keys/{key_id}"],
  10277. getDeployment: ["GET /repos/{owner}/{repo}/deployments/{deployment_id}"],
  10278. getDeploymentBranchPolicy: [
  10279. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
  10280. ],
  10281. getDeploymentStatus: [
  10282. "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}"
  10283. ],
  10284. getEnvironment: [
  10285. "GET /repos/{owner}/{repo}/environments/{environment_name}"
  10286. ],
  10287. getLatestPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/latest"],
  10288. getLatestRelease: ["GET /repos/{owner}/{repo}/releases/latest"],
  10289. getOrgRuleSuite: ["GET /orgs/{org}/rulesets/rule-suites/{rule_suite_id}"],
  10290. getOrgRuleSuites: ["GET /orgs/{org}/rulesets/rule-suites"],
  10291. getOrgRuleset: ["GET /orgs/{org}/rulesets/{ruleset_id}"],
  10292. getOrgRulesets: ["GET /orgs/{org}/rulesets"],
  10293. getPages: ["GET /repos/{owner}/{repo}/pages"],
  10294. getPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/{build_id}"],
  10295. getPagesDeployment: [
  10296. "GET /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}"
  10297. ],
  10298. getPagesHealthCheck: ["GET /repos/{owner}/{repo}/pages/health"],
  10299. getParticipationStats: ["GET /repos/{owner}/{repo}/stats/participation"],
  10300. getPullRequestReviewProtection: [
  10301. "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
  10302. ],
  10303. getPunchCardStats: ["GET /repos/{owner}/{repo}/stats/punch_card"],
  10304. getReadme: ["GET /repos/{owner}/{repo}/readme"],
  10305. getReadmeInDirectory: ["GET /repos/{owner}/{repo}/readme/{dir}"],
  10306. getRelease: ["GET /repos/{owner}/{repo}/releases/{release_id}"],
  10307. getReleaseAsset: ["GET /repos/{owner}/{repo}/releases/assets/{asset_id}"],
  10308. getReleaseByTag: ["GET /repos/{owner}/{repo}/releases/tags/{tag}"],
  10309. getRepoRuleSuite: [
  10310. "GET /repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}"
  10311. ],
  10312. getRepoRuleSuites: ["GET /repos/{owner}/{repo}/rulesets/rule-suites"],
  10313. getRepoRuleset: ["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}"],
  10314. getRepoRulesets: ["GET /repos/{owner}/{repo}/rulesets"],
  10315. getStatusChecksProtection: [
  10316. "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
  10317. ],
  10318. getTeamsWithAccessToProtectedBranch: [
  10319. "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams"
  10320. ],
  10321. getTopPaths: ["GET /repos/{owner}/{repo}/traffic/popular/paths"],
  10322. getTopReferrers: ["GET /repos/{owner}/{repo}/traffic/popular/referrers"],
  10323. getUsersWithAccessToProtectedBranch: [
  10324. "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users"
  10325. ],
  10326. getViews: ["GET /repos/{owner}/{repo}/traffic/views"],
  10327. getWebhook: ["GET /repos/{owner}/{repo}/hooks/{hook_id}"],
  10328. getWebhookConfigForRepo: [
  10329. "GET /repos/{owner}/{repo}/hooks/{hook_id}/config"
  10330. ],
  10331. getWebhookDelivery: [
  10332. "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}"
  10333. ],
  10334. listActivities: ["GET /repos/{owner}/{repo}/activity"],
  10335. listAutolinks: ["GET /repos/{owner}/{repo}/autolinks"],
  10336. listBranches: ["GET /repos/{owner}/{repo}/branches"],
  10337. listBranchesForHeadCommit: [
  10338. "GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head"
  10339. ],
  10340. listCollaborators: ["GET /repos/{owner}/{repo}/collaborators"],
  10341. listCommentsForCommit: [
  10342. "GET /repos/{owner}/{repo}/commits/{commit_sha}/comments"
  10343. ],
  10344. listCommitCommentsForRepo: ["GET /repos/{owner}/{repo}/comments"],
  10345. listCommitStatusesForRef: [
  10346. "GET /repos/{owner}/{repo}/commits/{ref}/statuses"
  10347. ],
  10348. listCommits: ["GET /repos/{owner}/{repo}/commits"],
  10349. listContributors: ["GET /repos/{owner}/{repo}/contributors"],
  10350. listCustomDeploymentRuleIntegrations: [
  10351. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps"
  10352. ],
  10353. listDeployKeys: ["GET /repos/{owner}/{repo}/keys"],
  10354. listDeploymentBranchPolicies: [
  10355. "GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"
  10356. ],
  10357. listDeploymentStatuses: [
  10358. "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"
  10359. ],
  10360. listDeployments: ["GET /repos/{owner}/{repo}/deployments"],
  10361. listForAuthenticatedUser: ["GET /user/repos"],
  10362. listForOrg: ["GET /orgs/{org}/repos"],
  10363. listForUser: ["GET /users/{username}/repos"],
  10364. listForks: ["GET /repos/{owner}/{repo}/forks"],
  10365. listInvitations: ["GET /repos/{owner}/{repo}/invitations"],
  10366. listInvitationsForAuthenticatedUser: ["GET /user/repository_invitations"],
  10367. listLanguages: ["GET /repos/{owner}/{repo}/languages"],
  10368. listPagesBuilds: ["GET /repos/{owner}/{repo}/pages/builds"],
  10369. listPublic: ["GET /repositories"],
  10370. listPullRequestsAssociatedWithCommit: [
  10371. "GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls"
  10372. ],
  10373. listReleaseAssets: [
  10374. "GET /repos/{owner}/{repo}/releases/{release_id}/assets"
  10375. ],
  10376. listReleases: ["GET /repos/{owner}/{repo}/releases"],
  10377. listTagProtection: ["GET /repos/{owner}/{repo}/tags/protection"],
  10378. listTags: ["GET /repos/{owner}/{repo}/tags"],
  10379. listTeams: ["GET /repos/{owner}/{repo}/teams"],
  10380. listWebhookDeliveries: [
  10381. "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries"
  10382. ],
  10383. listWebhooks: ["GET /repos/{owner}/{repo}/hooks"],
  10384. merge: ["POST /repos/{owner}/{repo}/merges"],
  10385. mergeUpstream: ["POST /repos/{owner}/{repo}/merge-upstream"],
  10386. pingWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/pings"],
  10387. redeliverWebhookDelivery: [
  10388. "POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"
  10389. ],
  10390. removeAppAccessRestrictions: [
  10391. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",
  10392. {},
  10393. { mapToData: "apps" }
  10394. ],
  10395. removeCollaborator: [
  10396. "DELETE /repos/{owner}/{repo}/collaborators/{username}"
  10397. ],
  10398. removeStatusCheckContexts: [
  10399. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",
  10400. {},
  10401. { mapToData: "contexts" }
  10402. ],
  10403. removeStatusCheckProtection: [
  10404. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
  10405. ],
  10406. removeTeamAccessRestrictions: [
  10407. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",
  10408. {},
  10409. { mapToData: "teams" }
  10410. ],
  10411. removeUserAccessRestrictions: [
  10412. "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",
  10413. {},
  10414. { mapToData: "users" }
  10415. ],
  10416. renameBranch: ["POST /repos/{owner}/{repo}/branches/{branch}/rename"],
  10417. replaceAllTopics: ["PUT /repos/{owner}/{repo}/topics"],
  10418. requestPagesBuild: ["POST /repos/{owner}/{repo}/pages/builds"],
  10419. setAdminBranchProtection: [
  10420. "POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"
  10421. ],
  10422. setAppAccessRestrictions: [
  10423. "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",
  10424. {},
  10425. { mapToData: "apps" }
  10426. ],
  10427. setStatusCheckContexts: [
  10428. "PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",
  10429. {},
  10430. { mapToData: "contexts" }
  10431. ],
  10432. setTeamAccessRestrictions: [
  10433. "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",
  10434. {},
  10435. { mapToData: "teams" }
  10436. ],
  10437. setUserAccessRestrictions: [
  10438. "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",
  10439. {},
  10440. { mapToData: "users" }
  10441. ],
  10442. testPushWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/tests"],
  10443. transfer: ["POST /repos/{owner}/{repo}/transfer"],
  10444. update: ["PATCH /repos/{owner}/{repo}"],
  10445. updateBranchProtection: [
  10446. "PUT /repos/{owner}/{repo}/branches/{branch}/protection"
  10447. ],
  10448. updateCommitComment: ["PATCH /repos/{owner}/{repo}/comments/{comment_id}"],
  10449. updateDeploymentBranchPolicy: [
  10450. "PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
  10451. ],
  10452. updateInformationAboutPagesSite: ["PUT /repos/{owner}/{repo}/pages"],
  10453. updateInvitation: [
  10454. "PATCH /repos/{owner}/{repo}/invitations/{invitation_id}"
  10455. ],
  10456. updateOrgRuleset: ["PUT /orgs/{org}/rulesets/{ruleset_id}"],
  10457. updatePullRequestReviewProtection: [
  10458. "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
  10459. ],
  10460. updateRelease: ["PATCH /repos/{owner}/{repo}/releases/{release_id}"],
  10461. updateReleaseAsset: [
  10462. "PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}"
  10463. ],
  10464. updateRepoRuleset: ["PUT /repos/{owner}/{repo}/rulesets/{ruleset_id}"],
  10465. updateStatusCheckPotection: [
  10466. "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks",
  10467. {},
  10468. { renamed: ["repos", "updateStatusCheckProtection"] }
  10469. ],
  10470. updateStatusCheckProtection: [
  10471. "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
  10472. ],
  10473. updateWebhook: ["PATCH /repos/{owner}/{repo}/hooks/{hook_id}"],
  10474. updateWebhookConfigForRepo: [
  10475. "PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config"
  10476. ],
  10477. uploadReleaseAsset: [
  10478. "POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}",
  10479. { baseUrl: "https://uploads.github.com" }
  10480. ]
  10481. },
  10482. search: {
  10483. code: ["GET /search/code"],
  10484. commits: ["GET /search/commits"],
  10485. issuesAndPullRequests: ["GET /search/issues"],
  10486. labels: ["GET /search/labels"],
  10487. repos: ["GET /search/repositories"],
  10488. topics: ["GET /search/topics"],
  10489. users: ["GET /search/users"]
  10490. },
  10491. secretScanning: {
  10492. getAlert: [
  10493. "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"
  10494. ],
  10495. listAlertsForEnterprise: [
  10496. "GET /enterprises/{enterprise}/secret-scanning/alerts"
  10497. ],
  10498. listAlertsForOrg: ["GET /orgs/{org}/secret-scanning/alerts"],
  10499. listAlertsForRepo: ["GET /repos/{owner}/{repo}/secret-scanning/alerts"],
  10500. listLocationsForAlert: [
  10501. "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations"
  10502. ],
  10503. updateAlert: [
  10504. "PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"
  10505. ]
  10506. },
  10507. securityAdvisories: {
  10508. createFork: [
  10509. "POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/forks"
  10510. ],
  10511. createPrivateVulnerabilityReport: [
  10512. "POST /repos/{owner}/{repo}/security-advisories/reports"
  10513. ],
  10514. createRepositoryAdvisory: [
  10515. "POST /repos/{owner}/{repo}/security-advisories"
  10516. ],
  10517. createRepositoryAdvisoryCveRequest: [
  10518. "POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/cve"
  10519. ],
  10520. getGlobalAdvisory: ["GET /advisories/{ghsa_id}"],
  10521. getRepositoryAdvisory: [
  10522. "GET /repos/{owner}/{repo}/security-advisories/{ghsa_id}"
  10523. ],
  10524. listGlobalAdvisories: ["GET /advisories"],
  10525. listOrgRepositoryAdvisories: ["GET /orgs/{org}/security-advisories"],
  10526. listRepositoryAdvisories: ["GET /repos/{owner}/{repo}/security-advisories"],
  10527. updateRepositoryAdvisory: [
  10528. "PATCH /repos/{owner}/{repo}/security-advisories/{ghsa_id}"
  10529. ]
  10530. },
  10531. teams: {
  10532. addOrUpdateMembershipForUserInOrg: [
  10533. "PUT /orgs/{org}/teams/{team_slug}/memberships/{username}"
  10534. ],
  10535. addOrUpdateProjectPermissionsInOrg: [
  10536. "PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}"
  10537. ],
  10538. addOrUpdateRepoPermissionsInOrg: [
  10539. "PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
  10540. ],
  10541. checkPermissionsForProjectInOrg: [
  10542. "GET /orgs/{org}/teams/{team_slug}/projects/{project_id}"
  10543. ],
  10544. checkPermissionsForRepoInOrg: [
  10545. "GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
  10546. ],
  10547. create: ["POST /orgs/{org}/teams"],
  10548. createDiscussionCommentInOrg: [
  10549. "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"
  10550. ],
  10551. createDiscussionInOrg: ["POST /orgs/{org}/teams/{team_slug}/discussions"],
  10552. deleteDiscussionCommentInOrg: [
  10553. "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"
  10554. ],
  10555. deleteDiscussionInOrg: [
  10556. "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"
  10557. ],
  10558. deleteInOrg: ["DELETE /orgs/{org}/teams/{team_slug}"],
  10559. getByName: ["GET /orgs/{org}/teams/{team_slug}"],
  10560. getDiscussionCommentInOrg: [
  10561. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"
  10562. ],
  10563. getDiscussionInOrg: [
  10564. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"
  10565. ],
  10566. getMembershipForUserInOrg: [
  10567. "GET /orgs/{org}/teams/{team_slug}/memberships/{username}"
  10568. ],
  10569. list: ["GET /orgs/{org}/teams"],
  10570. listChildInOrg: ["GET /orgs/{org}/teams/{team_slug}/teams"],
  10571. listDiscussionCommentsInOrg: [
  10572. "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"
  10573. ],
  10574. listDiscussionsInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions"],
  10575. listForAuthenticatedUser: ["GET /user/teams"],
  10576. listMembersInOrg: ["GET /orgs/{org}/teams/{team_slug}/members"],
  10577. listPendingInvitationsInOrg: [
  10578. "GET /orgs/{org}/teams/{team_slug}/invitations"
  10579. ],
  10580. listProjectsInOrg: ["GET /orgs/{org}/teams/{team_slug}/projects"],
  10581. listReposInOrg: ["GET /orgs/{org}/teams/{team_slug}/repos"],
  10582. removeMembershipForUserInOrg: [
  10583. "DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}"
  10584. ],
  10585. removeProjectInOrg: [
  10586. "DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}"
  10587. ],
  10588. removeRepoInOrg: [
  10589. "DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
  10590. ],
  10591. updateDiscussionCommentInOrg: [
  10592. "PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"
  10593. ],
  10594. updateDiscussionInOrg: [
  10595. "PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"
  10596. ],
  10597. updateInOrg: ["PATCH /orgs/{org}/teams/{team_slug}"]
  10598. },
  10599. users: {
  10600. addEmailForAuthenticated: [
  10601. "POST /user/emails",
  10602. {},
  10603. { renamed: ["users", "addEmailForAuthenticatedUser"] }
  10604. ],
  10605. addEmailForAuthenticatedUser: ["POST /user/emails"],
  10606. addSocialAccountForAuthenticatedUser: ["POST /user/social_accounts"],
  10607. block: ["PUT /user/blocks/{username}"],
  10608. checkBlocked: ["GET /user/blocks/{username}"],
  10609. checkFollowingForUser: ["GET /users/{username}/following/{target_user}"],
  10610. checkPersonIsFollowedByAuthenticated: ["GET /user/following/{username}"],
  10611. createGpgKeyForAuthenticated: [
  10612. "POST /user/gpg_keys",
  10613. {},
  10614. { renamed: ["users", "createGpgKeyForAuthenticatedUser"] }
  10615. ],
  10616. createGpgKeyForAuthenticatedUser: ["POST /user/gpg_keys"],
  10617. createPublicSshKeyForAuthenticated: [
  10618. "POST /user/keys",
  10619. {},
  10620. { renamed: ["users", "createPublicSshKeyForAuthenticatedUser"] }
  10621. ],
  10622. createPublicSshKeyForAuthenticatedUser: ["POST /user/keys"],
  10623. createSshSigningKeyForAuthenticatedUser: ["POST /user/ssh_signing_keys"],
  10624. deleteEmailForAuthenticated: [
  10625. "DELETE /user/emails",
  10626. {},
  10627. { renamed: ["users", "deleteEmailForAuthenticatedUser"] }
  10628. ],
  10629. deleteEmailForAuthenticatedUser: ["DELETE /user/emails"],
  10630. deleteGpgKeyForAuthenticated: [
  10631. "DELETE /user/gpg_keys/{gpg_key_id}",
  10632. {},
  10633. { renamed: ["users", "deleteGpgKeyForAuthenticatedUser"] }
  10634. ],
  10635. deleteGpgKeyForAuthenticatedUser: ["DELETE /user/gpg_keys/{gpg_key_id}"],
  10636. deletePublicSshKeyForAuthenticated: [
  10637. "DELETE /user/keys/{key_id}",
  10638. {},
  10639. { renamed: ["users", "deletePublicSshKeyForAuthenticatedUser"] }
  10640. ],
  10641. deletePublicSshKeyForAuthenticatedUser: ["DELETE /user/keys/{key_id}"],
  10642. deleteSocialAccountForAuthenticatedUser: ["DELETE /user/social_accounts"],
  10643. deleteSshSigningKeyForAuthenticatedUser: [
  10644. "DELETE /user/ssh_signing_keys/{ssh_signing_key_id}"
  10645. ],
  10646. follow: ["PUT /user/following/{username}"],
  10647. getAuthenticated: ["GET /user"],
  10648. getByUsername: ["GET /users/{username}"],
  10649. getContextForUser: ["GET /users/{username}/hovercard"],
  10650. getGpgKeyForAuthenticated: [
  10651. "GET /user/gpg_keys/{gpg_key_id}",
  10652. {},
  10653. { renamed: ["users", "getGpgKeyForAuthenticatedUser"] }
  10654. ],
  10655. getGpgKeyForAuthenticatedUser: ["GET /user/gpg_keys/{gpg_key_id}"],
  10656. getPublicSshKeyForAuthenticated: [
  10657. "GET /user/keys/{key_id}",
  10658. {},
  10659. { renamed: ["users", "getPublicSshKeyForAuthenticatedUser"] }
  10660. ],
  10661. getPublicSshKeyForAuthenticatedUser: ["GET /user/keys/{key_id}"],
  10662. getSshSigningKeyForAuthenticatedUser: [
  10663. "GET /user/ssh_signing_keys/{ssh_signing_key_id}"
  10664. ],
  10665. list: ["GET /users"],
  10666. listBlockedByAuthenticated: [
  10667. "GET /user/blocks",
  10668. {},
  10669. { renamed: ["users", "listBlockedByAuthenticatedUser"] }
  10670. ],
  10671. listBlockedByAuthenticatedUser: ["GET /user/blocks"],
  10672. listEmailsForAuthenticated: [
  10673. "GET /user/emails",
  10674. {},
  10675. { renamed: ["users", "listEmailsForAuthenticatedUser"] }
  10676. ],
  10677. listEmailsForAuthenticatedUser: ["GET /user/emails"],
  10678. listFollowedByAuthenticated: [
  10679. "GET /user/following",
  10680. {},
  10681. { renamed: ["users", "listFollowedByAuthenticatedUser"] }
  10682. ],
  10683. listFollowedByAuthenticatedUser: ["GET /user/following"],
  10684. listFollowersForAuthenticatedUser: ["GET /user/followers"],
  10685. listFollowersForUser: ["GET /users/{username}/followers"],
  10686. listFollowingForUser: ["GET /users/{username}/following"],
  10687. listGpgKeysForAuthenticated: [
  10688. "GET /user/gpg_keys",
  10689. {},
  10690. { renamed: ["users", "listGpgKeysForAuthenticatedUser"] }
  10691. ],
  10692. listGpgKeysForAuthenticatedUser: ["GET /user/gpg_keys"],
  10693. listGpgKeysForUser: ["GET /users/{username}/gpg_keys"],
  10694. listPublicEmailsForAuthenticated: [
  10695. "GET /user/public_emails",
  10696. {},
  10697. { renamed: ["users", "listPublicEmailsForAuthenticatedUser"] }
  10698. ],
  10699. listPublicEmailsForAuthenticatedUser: ["GET /user/public_emails"],
  10700. listPublicKeysForUser: ["GET /users/{username}/keys"],
  10701. listPublicSshKeysForAuthenticated: [
  10702. "GET /user/keys",
  10703. {},
  10704. { renamed: ["users", "listPublicSshKeysForAuthenticatedUser"] }
  10705. ],
  10706. listPublicSshKeysForAuthenticatedUser: ["GET /user/keys"],
  10707. listSocialAccountsForAuthenticatedUser: ["GET /user/social_accounts"],
  10708. listSocialAccountsForUser: ["GET /users/{username}/social_accounts"],
  10709. listSshSigningKeysForAuthenticatedUser: ["GET /user/ssh_signing_keys"],
  10710. listSshSigningKeysForUser: ["GET /users/{username}/ssh_signing_keys"],
  10711. setPrimaryEmailVisibilityForAuthenticated: [
  10712. "PATCH /user/email/visibility",
  10713. {},
  10714. { renamed: ["users", "setPrimaryEmailVisibilityForAuthenticatedUser"] }
  10715. ],
  10716. setPrimaryEmailVisibilityForAuthenticatedUser: [
  10717. "PATCH /user/email/visibility"
  10718. ],
  10719. unblock: ["DELETE /user/blocks/{username}"],
  10720. unfollow: ["DELETE /user/following/{username}"],
  10721. updateAuthenticated: ["PATCH /user"]
  10722. }
  10723. };
  10724. var endpoints_default = Endpoints;
  10725. // pkg/dist-src/endpoints-to-methods.js
  10726. var endpointMethodsMap = /* @__PURE__ */ new Map();
  10727. for (const [scope, endpoints] of Object.entries(endpoints_default)) {
  10728. for (const [methodName, endpoint] of Object.entries(endpoints)) {
  10729. const [route, defaults, decorations] = endpoint;
  10730. const [method, url] = route.split(/ /);
  10731. const endpointDefaults = Object.assign(
  10732. {
  10733. method,
  10734. url
  10735. },
  10736. defaults
  10737. );
  10738. if (!endpointMethodsMap.has(scope)) {
  10739. endpointMethodsMap.set(scope, /* @__PURE__ */ new Map());
  10740. }
  10741. endpointMethodsMap.get(scope).set(methodName, {
  10742. scope,
  10743. methodName,
  10744. endpointDefaults,
  10745. decorations
  10746. });
  10747. }
  10748. }
  10749. var handler = {
  10750. has({ scope }, methodName) {
  10751. return endpointMethodsMap.get(scope).has(methodName);
  10752. },
  10753. getOwnPropertyDescriptor(target, methodName) {
  10754. return {
  10755. value: this.get(target, methodName),
  10756. // ensures method is in the cache
  10757. configurable: true,
  10758. writable: true,
  10759. enumerable: true
  10760. };
  10761. },
  10762. defineProperty(target, methodName, descriptor) {
  10763. Object.defineProperty(target.cache, methodName, descriptor);
  10764. return true;
  10765. },
  10766. deleteProperty(target, methodName) {
  10767. delete target.cache[methodName];
  10768. return true;
  10769. },
  10770. ownKeys({ scope }) {
  10771. return [...endpointMethodsMap.get(scope).keys()];
  10772. },
  10773. set(target, methodName, value) {
  10774. return target.cache[methodName] = value;
  10775. },
  10776. get({ octokit, scope, cache }, methodName) {
  10777. if (cache[methodName]) {
  10778. return cache[methodName];
  10779. }
  10780. const method = endpointMethodsMap.get(scope).get(methodName);
  10781. if (!method) {
  10782. return void 0;
  10783. }
  10784. const { endpointDefaults, decorations } = method;
  10785. if (decorations) {
  10786. cache[methodName] = decorate(
  10787. octokit,
  10788. scope,
  10789. methodName,
  10790. endpointDefaults,
  10791. decorations
  10792. );
  10793. } else {
  10794. cache[methodName] = octokit.request.defaults(endpointDefaults);
  10795. }
  10796. return cache[methodName];
  10797. }
  10798. };
  10799. function endpointsToMethods(octokit) {
  10800. const newMethods = {};
  10801. for (const scope of endpointMethodsMap.keys()) {
  10802. newMethods[scope] = new Proxy({ octokit, scope, cache: {} }, handler);
  10803. }
  10804. return newMethods;
  10805. }
  10806. function decorate(octokit, scope, methodName, defaults, decorations) {
  10807. const requestWithDefaults = octokit.request.defaults(defaults);
  10808. function withDecorations(...args) {
  10809. let options = requestWithDefaults.endpoint.merge(...args);
  10810. if (decorations.mapToData) {
  10811. options = Object.assign({}, options, {
  10812. data: options[decorations.mapToData],
  10813. [decorations.mapToData]: void 0
  10814. });
  10815. return requestWithDefaults(options);
  10816. }
  10817. if (decorations.renamed) {
  10818. const [newScope, newMethodName] = decorations.renamed;
  10819. octokit.log.warn(
  10820. `octokit.${scope}.${methodName}() has been renamed to octokit.${newScope}.${newMethodName}()`
  10821. );
  10822. }
  10823. if (decorations.deprecated) {
  10824. octokit.log.warn(decorations.deprecated);
  10825. }
  10826. if (decorations.renamedParameters) {
  10827. const options2 = requestWithDefaults.endpoint.merge(...args);
  10828. for (const [name, alias] of Object.entries(
  10829. decorations.renamedParameters
  10830. )) {
  10831. if (name in options2) {
  10832. octokit.log.warn(
  10833. `"${name}" parameter is deprecated for "octokit.${scope}.${methodName}()". Use "${alias}" instead`
  10834. );
  10835. if (!(alias in options2)) {
  10836. options2[alias] = options2[name];
  10837. }
  10838. delete options2[name];
  10839. }
  10840. }
  10841. return requestWithDefaults(options2);
  10842. }
  10843. return requestWithDefaults(...args);
  10844. }
  10845. return Object.assign(withDecorations, requestWithDefaults);
  10846. }
  10847. // pkg/dist-src/index.js
  10848. function restEndpointMethods(octokit) {
  10849. const api = endpointsToMethods(octokit);
  10850. return {
  10851. rest: api
  10852. };
  10853. }
  10854. restEndpointMethods.VERSION = VERSION;
  10855. function legacyRestEndpointMethods(octokit) {
  10856. const api = endpointsToMethods(octokit);
  10857. return {
  10858. ...api,
  10859. rest: api
  10860. };
  10861. }
  10862. legacyRestEndpointMethods.VERSION = VERSION;
  10863. // Annotate the CommonJS export names for ESM import in node:
  10864. 0 && (0);
  10865. /***/ }),
  10866. /***/ 537:
  10867. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  10868. "use strict";
  10869. var __create = Object.create;
  10870. var __defProp = Object.defineProperty;
  10871. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  10872. var __getOwnPropNames = Object.getOwnPropertyNames;
  10873. var __getProtoOf = Object.getPrototypeOf;
  10874. var __hasOwnProp = Object.prototype.hasOwnProperty;
  10875. var __export = (target, all) => {
  10876. for (var name in all)
  10877. __defProp(target, name, { get: all[name], enumerable: true });
  10878. };
  10879. var __copyProps = (to, from, except, desc) => {
  10880. if (from && typeof from === "object" || typeof from === "function") {
  10881. for (let key of __getOwnPropNames(from))
  10882. if (!__hasOwnProp.call(to, key) && key !== except)
  10883. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  10884. }
  10885. return to;
  10886. };
  10887. var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  10888. // If the importer is in node compatibility mode or this is not an ESM
  10889. // file that has been converted to a CommonJS file using a Babel-
  10890. // compatible transform (i.e. "__esModule" has not been set), then set
  10891. // "default" to the CommonJS "module.exports" for node compatibility.
  10892. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  10893. mod
  10894. ));
  10895. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  10896. // pkg/dist-src/index.js
  10897. var dist_src_exports = {};
  10898. __export(dist_src_exports, {
  10899. RequestError: () => RequestError
  10900. });
  10901. module.exports = __toCommonJS(dist_src_exports);
  10902. var import_deprecation = __nccwpck_require__(8932);
  10903. var import_once = __toESM(__nccwpck_require__(1223));
  10904. var logOnceCode = (0, import_once.default)((deprecation) => console.warn(deprecation));
  10905. var logOnceHeaders = (0, import_once.default)((deprecation) => console.warn(deprecation));
  10906. var RequestError = class extends Error {
  10907. constructor(message, statusCode, options) {
  10908. super(message);
  10909. if (Error.captureStackTrace) {
  10910. Error.captureStackTrace(this, this.constructor);
  10911. }
  10912. this.name = "HttpError";
  10913. this.status = statusCode;
  10914. let headers;
  10915. if ("headers" in options && typeof options.headers !== "undefined") {
  10916. headers = options.headers;
  10917. }
  10918. if ("response" in options) {
  10919. this.response = options.response;
  10920. headers = options.response.headers;
  10921. }
  10922. const requestCopy = Object.assign({}, options.request);
  10923. if (options.request.headers.authorization) {
  10924. requestCopy.headers = Object.assign({}, options.request.headers, {
  10925. authorization: options.request.headers.authorization.replace(
  10926. /(?<! ) .*$/,
  10927. " [REDACTED]"
  10928. )
  10929. });
  10930. }
  10931. requestCopy.url = requestCopy.url.replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]").replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
  10932. this.request = requestCopy;
  10933. Object.defineProperty(this, "code", {
  10934. get() {
  10935. logOnceCode(
  10936. new import_deprecation.Deprecation(
  10937. "[@octokit/request-error] `error.code` is deprecated, use `error.status`."
  10938. )
  10939. );
  10940. return statusCode;
  10941. }
  10942. });
  10943. Object.defineProperty(this, "headers", {
  10944. get() {
  10945. logOnceHeaders(
  10946. new import_deprecation.Deprecation(
  10947. "[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`."
  10948. )
  10949. );
  10950. return headers || {};
  10951. }
  10952. });
  10953. }
  10954. };
  10955. // Annotate the CommonJS export names for ESM import in node:
  10956. 0 && (0);
  10957. /***/ }),
  10958. /***/ 6234:
  10959. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  10960. "use strict";
  10961. var __defProp = Object.defineProperty;
  10962. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  10963. var __getOwnPropNames = Object.getOwnPropertyNames;
  10964. var __hasOwnProp = Object.prototype.hasOwnProperty;
  10965. var __export = (target, all) => {
  10966. for (var name in all)
  10967. __defProp(target, name, { get: all[name], enumerable: true });
  10968. };
  10969. var __copyProps = (to, from, except, desc) => {
  10970. if (from && typeof from === "object" || typeof from === "function") {
  10971. for (let key of __getOwnPropNames(from))
  10972. if (!__hasOwnProp.call(to, key) && key !== except)
  10973. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  10974. }
  10975. return to;
  10976. };
  10977. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  10978. // pkg/dist-src/index.js
  10979. var dist_src_exports = {};
  10980. __export(dist_src_exports, {
  10981. request: () => request
  10982. });
  10983. module.exports = __toCommonJS(dist_src_exports);
  10984. var import_endpoint = __nccwpck_require__(9440);
  10985. var import_universal_user_agent = __nccwpck_require__(5030);
  10986. // pkg/dist-src/version.js
  10987. var VERSION = "8.4.1";
  10988. // pkg/dist-src/is-plain-object.js
  10989. function isPlainObject(value) {
  10990. if (typeof value !== "object" || value === null)
  10991. return false;
  10992. if (Object.prototype.toString.call(value) !== "[object Object]")
  10993. return false;
  10994. const proto = Object.getPrototypeOf(value);
  10995. if (proto === null)
  10996. return true;
  10997. const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
  10998. return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
  10999. }
  11000. // pkg/dist-src/fetch-wrapper.js
  11001. var import_request_error = __nccwpck_require__(537);
  11002. // pkg/dist-src/get-buffer-response.js
  11003. function getBufferResponse(response) {
  11004. return response.arrayBuffer();
  11005. }
  11006. // pkg/dist-src/fetch-wrapper.js
  11007. function fetchWrapper(requestOptions) {
  11008. var _a, _b, _c, _d;
  11009. const log = requestOptions.request && requestOptions.request.log ? requestOptions.request.log : console;
  11010. const parseSuccessResponseBody = ((_a = requestOptions.request) == null ? void 0 : _a.parseSuccessResponseBody) !== false;
  11011. if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {
  11012. requestOptions.body = JSON.stringify(requestOptions.body);
  11013. }
  11014. let headers = {};
  11015. let status;
  11016. let url;
  11017. let { fetch } = globalThis;
  11018. if ((_b = requestOptions.request) == null ? void 0 : _b.fetch) {
  11019. fetch = requestOptions.request.fetch;
  11020. }
  11021. if (!fetch) {
  11022. throw new Error(
  11023. "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"
  11024. );
  11025. }
  11026. return fetch(requestOptions.url, {
  11027. method: requestOptions.method,
  11028. body: requestOptions.body,
  11029. redirect: (_c = requestOptions.request) == null ? void 0 : _c.redirect,
  11030. headers: requestOptions.headers,
  11031. signal: (_d = requestOptions.request) == null ? void 0 : _d.signal,
  11032. // duplex must be set if request.body is ReadableStream or Async Iterables.
  11033. // See https://fetch.spec.whatwg.org/#dom-requestinit-duplex.
  11034. ...requestOptions.body && { duplex: "half" }
  11035. }).then(async (response) => {
  11036. url = response.url;
  11037. status = response.status;
  11038. for (const keyAndValue of response.headers) {
  11039. headers[keyAndValue[0]] = keyAndValue[1];
  11040. }
  11041. if ("deprecation" in headers) {
  11042. const matches = headers.link && headers.link.match(/<([^<>]+)>; rel="deprecation"/);
  11043. const deprecationLink = matches && matches.pop();
  11044. log.warn(
  11045. `[@octokit/request] "${requestOptions.method} ${requestOptions.url}" is deprecated. It is scheduled to be removed on ${headers.sunset}${deprecationLink ? `. See ${deprecationLink}` : ""}`
  11046. );
  11047. }
  11048. if (status === 204 || status === 205) {
  11049. return;
  11050. }
  11051. if (requestOptions.method === "HEAD") {
  11052. if (status < 400) {
  11053. return;
  11054. }
  11055. throw new import_request_error.RequestError(response.statusText, status, {
  11056. response: {
  11057. url,
  11058. status,
  11059. headers,
  11060. data: void 0
  11061. },
  11062. request: requestOptions
  11063. });
  11064. }
  11065. if (status === 304) {
  11066. throw new import_request_error.RequestError("Not modified", status, {
  11067. response: {
  11068. url,
  11069. status,
  11070. headers,
  11071. data: await getResponseData(response)
  11072. },
  11073. request: requestOptions
  11074. });
  11075. }
  11076. if (status >= 400) {
  11077. const data = await getResponseData(response);
  11078. const error = new import_request_error.RequestError(toErrorMessage(data), status, {
  11079. response: {
  11080. url,
  11081. status,
  11082. headers,
  11083. data
  11084. },
  11085. request: requestOptions
  11086. });
  11087. throw error;
  11088. }
  11089. return parseSuccessResponseBody ? await getResponseData(response) : response.body;
  11090. }).then((data) => {
  11091. return {
  11092. status,
  11093. url,
  11094. headers,
  11095. data
  11096. };
  11097. }).catch((error) => {
  11098. if (error instanceof import_request_error.RequestError)
  11099. throw error;
  11100. else if (error.name === "AbortError")
  11101. throw error;
  11102. let message = error.message;
  11103. if (error.name === "TypeError" && "cause" in error) {
  11104. if (error.cause instanceof Error) {
  11105. message = error.cause.message;
  11106. } else if (typeof error.cause === "string") {
  11107. message = error.cause;
  11108. }
  11109. }
  11110. throw new import_request_error.RequestError(message, 500, {
  11111. request: requestOptions
  11112. });
  11113. });
  11114. }
  11115. async function getResponseData(response) {
  11116. const contentType = response.headers.get("content-type");
  11117. if (/application\/json/.test(contentType)) {
  11118. return response.json().catch(() => response.text()).catch(() => "");
  11119. }
  11120. if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) {
  11121. return response.text();
  11122. }
  11123. return getBufferResponse(response);
  11124. }
  11125. function toErrorMessage(data) {
  11126. if (typeof data === "string")
  11127. return data;
  11128. let suffix;
  11129. if ("documentation_url" in data) {
  11130. suffix = ` - ${data.documentation_url}`;
  11131. } else {
  11132. suffix = "";
  11133. }
  11134. if ("message" in data) {
  11135. if (Array.isArray(data.errors)) {
  11136. return `${data.message}: ${data.errors.map(JSON.stringify).join(", ")}${suffix}`;
  11137. }
  11138. return `${data.message}${suffix}`;
  11139. }
  11140. return `Unknown error: ${JSON.stringify(data)}`;
  11141. }
  11142. // pkg/dist-src/with-defaults.js
  11143. function withDefaults(oldEndpoint, newDefaults) {
  11144. const endpoint2 = oldEndpoint.defaults(newDefaults);
  11145. const newApi = function(route, parameters) {
  11146. const endpointOptions = endpoint2.merge(route, parameters);
  11147. if (!endpointOptions.request || !endpointOptions.request.hook) {
  11148. return fetchWrapper(endpoint2.parse(endpointOptions));
  11149. }
  11150. const request2 = (route2, parameters2) => {
  11151. return fetchWrapper(
  11152. endpoint2.parse(endpoint2.merge(route2, parameters2))
  11153. );
  11154. };
  11155. Object.assign(request2, {
  11156. endpoint: endpoint2,
  11157. defaults: withDefaults.bind(null, endpoint2)
  11158. });
  11159. return endpointOptions.request.hook(request2, endpointOptions);
  11160. };
  11161. return Object.assign(newApi, {
  11162. endpoint: endpoint2,
  11163. defaults: withDefaults.bind(null, endpoint2)
  11164. });
  11165. }
  11166. // pkg/dist-src/index.js
  11167. var request = withDefaults(import_endpoint.endpoint, {
  11168. headers: {
  11169. "user-agent": `octokit-request.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`
  11170. }
  11171. });
  11172. // Annotate the CommonJS export names for ESM import in node:
  11173. 0 && (0);
  11174. /***/ }),
  11175. /***/ 3682:
  11176. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  11177. var register = __nccwpck_require__(4670);
  11178. var addHook = __nccwpck_require__(5549);
  11179. var removeHook = __nccwpck_require__(6819);
  11180. // bind with array of arguments: https://stackoverflow.com/a/21792913
  11181. var bind = Function.bind;
  11182. var bindable = bind.bind(bind);
  11183. function bindApi(hook, state, name) {
  11184. var removeHookRef = bindable(removeHook, null).apply(
  11185. null,
  11186. name ? [state, name] : [state]
  11187. );
  11188. hook.api = { remove: removeHookRef };
  11189. hook.remove = removeHookRef;
  11190. ["before", "error", "after", "wrap"].forEach(function (kind) {
  11191. var args = name ? [state, kind, name] : [state, kind];
  11192. hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args);
  11193. });
  11194. }
  11195. function HookSingular() {
  11196. var singularHookName = "h";
  11197. var singularHookState = {
  11198. registry: {},
  11199. };
  11200. var singularHook = register.bind(null, singularHookState, singularHookName);
  11201. bindApi(singularHook, singularHookState, singularHookName);
  11202. return singularHook;
  11203. }
  11204. function HookCollection() {
  11205. var state = {
  11206. registry: {},
  11207. };
  11208. var hook = register.bind(null, state);
  11209. bindApi(hook, state);
  11210. return hook;
  11211. }
  11212. var collectionHookDeprecationMessageDisplayed = false;
  11213. function Hook() {
  11214. if (!collectionHookDeprecationMessageDisplayed) {
  11215. console.warn(
  11216. '[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4'
  11217. );
  11218. collectionHookDeprecationMessageDisplayed = true;
  11219. }
  11220. return HookCollection();
  11221. }
  11222. Hook.Singular = HookSingular.bind();
  11223. Hook.Collection = HookCollection.bind();
  11224. module.exports = Hook;
  11225. // expose constructors as a named property for TypeScript
  11226. module.exports.Hook = Hook;
  11227. module.exports.Singular = Hook.Singular;
  11228. module.exports.Collection = Hook.Collection;
  11229. /***/ }),
  11230. /***/ 5549:
  11231. /***/ ((module) => {
  11232. module.exports = addHook;
  11233. function addHook(state, kind, name, hook) {
  11234. var orig = hook;
  11235. if (!state.registry[name]) {
  11236. state.registry[name] = [];
  11237. }
  11238. if (kind === "before") {
  11239. hook = function (method, options) {
  11240. return Promise.resolve()
  11241. .then(orig.bind(null, options))
  11242. .then(method.bind(null, options));
  11243. };
  11244. }
  11245. if (kind === "after") {
  11246. hook = function (method, options) {
  11247. var result;
  11248. return Promise.resolve()
  11249. .then(method.bind(null, options))
  11250. .then(function (result_) {
  11251. result = result_;
  11252. return orig(result, options);
  11253. })
  11254. .then(function () {
  11255. return result;
  11256. });
  11257. };
  11258. }
  11259. if (kind === "error") {
  11260. hook = function (method, options) {
  11261. return Promise.resolve()
  11262. .then(method.bind(null, options))
  11263. .catch(function (error) {
  11264. return orig(error, options);
  11265. });
  11266. };
  11267. }
  11268. state.registry[name].push({
  11269. hook: hook,
  11270. orig: orig,
  11271. });
  11272. }
  11273. /***/ }),
  11274. /***/ 4670:
  11275. /***/ ((module) => {
  11276. module.exports = register;
  11277. function register(state, name, method, options) {
  11278. if (typeof method !== "function") {
  11279. throw new Error("method for before hook must be a function");
  11280. }
  11281. if (!options) {
  11282. options = {};
  11283. }
  11284. if (Array.isArray(name)) {
  11285. return name.reverse().reduce(function (callback, name) {
  11286. return register.bind(null, state, name, callback, options);
  11287. }, method)();
  11288. }
  11289. return Promise.resolve().then(function () {
  11290. if (!state.registry[name]) {
  11291. return method(options);
  11292. }
  11293. return state.registry[name].reduce(function (method, registered) {
  11294. return registered.hook.bind(null, method, options);
  11295. }, method)();
  11296. });
  11297. }
  11298. /***/ }),
  11299. /***/ 6819:
  11300. /***/ ((module) => {
  11301. module.exports = removeHook;
  11302. function removeHook(state, name, method) {
  11303. if (!state.registry[name]) {
  11304. return;
  11305. }
  11306. var index = state.registry[name]
  11307. .map(function (registered) {
  11308. return registered.orig;
  11309. })
  11310. .indexOf(method);
  11311. if (index === -1) {
  11312. return;
  11313. }
  11314. state.registry[name].splice(index, 1);
  11315. }
  11316. /***/ }),
  11317. /***/ 8932:
  11318. /***/ ((__unused_webpack_module, exports) => {
  11319. "use strict";
  11320. Object.defineProperty(exports, "__esModule", ({ value: true }));
  11321. class Deprecation extends Error {
  11322. constructor(message) {
  11323. super(message); // Maintains proper stack trace (only available on V8)
  11324. /* istanbul ignore next */
  11325. if (Error.captureStackTrace) {
  11326. Error.captureStackTrace(this, this.constructor);
  11327. }
  11328. this.name = 'Deprecation';
  11329. }
  11330. }
  11331. exports.Deprecation = Deprecation;
  11332. /***/ }),
  11333. /***/ 1223:
  11334. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  11335. var wrappy = __nccwpck_require__(2940)
  11336. module.exports = wrappy(once)
  11337. module.exports.strict = wrappy(onceStrict)
  11338. once.proto = once(function () {
  11339. Object.defineProperty(Function.prototype, 'once', {
  11340. value: function () {
  11341. return once(this)
  11342. },
  11343. configurable: true
  11344. })
  11345. Object.defineProperty(Function.prototype, 'onceStrict', {
  11346. value: function () {
  11347. return onceStrict(this)
  11348. },
  11349. configurable: true
  11350. })
  11351. })
  11352. function once (fn) {
  11353. var f = function () {
  11354. if (f.called) return f.value
  11355. f.called = true
  11356. return f.value = fn.apply(this, arguments)
  11357. }
  11358. f.called = false
  11359. return f
  11360. }
  11361. function onceStrict (fn) {
  11362. var f = function () {
  11363. if (f.called)
  11364. throw new Error(f.onceError)
  11365. f.called = true
  11366. return f.value = fn.apply(this, arguments)
  11367. }
  11368. var name = fn.name || 'Function wrapped with `once`'
  11369. f.onceError = name + " shouldn't be called more than once"
  11370. f.called = false
  11371. return f
  11372. }
  11373. /***/ }),
  11374. /***/ 5911:
  11375. /***/ ((module, exports) => {
  11376. exports = module.exports = SemVer
  11377. var debug
  11378. /* istanbul ignore next */
  11379. if (typeof process === 'object' &&
  11380. process.env &&
  11381. process.env.NODE_DEBUG &&
  11382. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  11383. debug = function () {
  11384. var args = Array.prototype.slice.call(arguments, 0)
  11385. args.unshift('SEMVER')
  11386. console.log.apply(console, args)
  11387. }
  11388. } else {
  11389. debug = function () {}
  11390. }
  11391. // Note: this is the semver.org version of the spec that it implements
  11392. // Not necessarily the package version of this code.
  11393. exports.SEMVER_SPEC_VERSION = '2.0.0'
  11394. var MAX_LENGTH = 256
  11395. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  11396. /* istanbul ignore next */ 9007199254740991
  11397. // Max safe segment length for coercion.
  11398. var MAX_SAFE_COMPONENT_LENGTH = 16
  11399. var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6
  11400. // The actual regexps go on exports.re
  11401. var re = exports.re = []
  11402. var safeRe = exports.safeRe = []
  11403. var src = exports.src = []
  11404. var t = exports.tokens = {}
  11405. var R = 0
  11406. function tok (n) {
  11407. t[n] = R++
  11408. }
  11409. var LETTERDASHNUMBER = '[a-zA-Z0-9-]'
  11410. // Replace some greedy regex tokens to prevent regex dos issues. These regex are
  11411. // used internally via the safeRe object since all inputs in this library get
  11412. // normalized first to trim and collapse all extra whitespace. The original
  11413. // regexes are exported for userland consumption and lower level usage. A
  11414. // future breaking change could export the safer regex only with a note that
  11415. // all input should have extra whitespace removed.
  11416. var safeRegexReplacements = [
  11417. ['\\s', 1],
  11418. ['\\d', MAX_LENGTH],
  11419. [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH],
  11420. ]
  11421. function makeSafeRe (value) {
  11422. for (var i = 0; i < safeRegexReplacements.length; i++) {
  11423. var token = safeRegexReplacements[i][0]
  11424. var max = safeRegexReplacements[i][1]
  11425. value = value
  11426. .split(token + '*').join(token + '{0,' + max + '}')
  11427. .split(token + '+').join(token + '{1,' + max + '}')
  11428. }
  11429. return value
  11430. }
  11431. // The following Regular Expressions can be used for tokenizing,
  11432. // validating, and parsing SemVer version strings.
  11433. // ## Numeric Identifier
  11434. // A single `0`, or a non-zero digit followed by zero or more digits.
  11435. tok('NUMERICIDENTIFIER')
  11436. src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  11437. tok('NUMERICIDENTIFIERLOOSE')
  11438. src[t.NUMERICIDENTIFIERLOOSE] = '\\d+'
  11439. // ## Non-numeric Identifier
  11440. // Zero or more digits, followed by a letter or hyphen, and then zero or
  11441. // more letters, digits, or hyphens.
  11442. tok('NONNUMERICIDENTIFIER')
  11443. src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-]' + LETTERDASHNUMBER + '*'
  11444. // ## Main Version
  11445. // Three dot-separated numeric identifiers.
  11446. tok('MAINVERSION')
  11447. src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  11448. '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  11449. '(' + src[t.NUMERICIDENTIFIER] + ')'
  11450. tok('MAINVERSIONLOOSE')
  11451. src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  11452. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  11453. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')'
  11454. // ## Pre-release Version Identifier
  11455. // A numeric identifier, or a non-numeric identifier.
  11456. tok('PRERELEASEIDENTIFIER')
  11457. src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] +
  11458. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  11459. tok('PRERELEASEIDENTIFIERLOOSE')
  11460. src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] +
  11461. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  11462. // ## Pre-release Version
  11463. // Hyphen, followed by one or more dot-separated pre-release version
  11464. // identifiers.
  11465. tok('PRERELEASE')
  11466. src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] +
  11467. '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))'
  11468. tok('PRERELEASELOOSE')
  11469. src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] +
  11470. '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))'
  11471. // ## Build Metadata Identifier
  11472. // Any combination of digits, letters, or hyphens.
  11473. tok('BUILDIDENTIFIER')
  11474. src[t.BUILDIDENTIFIER] = LETTERDASHNUMBER + '+'
  11475. // ## Build Metadata
  11476. // Plus sign, followed by one or more period-separated build metadata
  11477. // identifiers.
  11478. tok('BUILD')
  11479. src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] +
  11480. '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))'
  11481. // ## Full Version String
  11482. // A main version, followed optionally by a pre-release version and
  11483. // build metadata.
  11484. // Note that the only major, minor, patch, and pre-release sections of
  11485. // the version string are capturing groups. The build metadata is not a
  11486. // capturing group, because it should not ever be used in version
  11487. // comparison.
  11488. tok('FULL')
  11489. tok('FULLPLAIN')
  11490. src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] +
  11491. src[t.PRERELEASE] + '?' +
  11492. src[t.BUILD] + '?'
  11493. src[t.FULL] = '^' + src[t.FULLPLAIN] + '$'
  11494. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  11495. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  11496. // common in the npm registry.
  11497. tok('LOOSEPLAIN')
  11498. src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] +
  11499. src[t.PRERELEASELOOSE] + '?' +
  11500. src[t.BUILD] + '?'
  11501. tok('LOOSE')
  11502. src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$'
  11503. tok('GTLT')
  11504. src[t.GTLT] = '((?:<|>)?=?)'
  11505. // Something like "2.*" or "1.2.x".
  11506. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  11507. // Only the first item is strictly required.
  11508. tok('XRANGEIDENTIFIERLOOSE')
  11509. src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  11510. tok('XRANGEIDENTIFIER')
  11511. src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*'
  11512. tok('XRANGEPLAIN')
  11513. src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' +
  11514. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  11515. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  11516. '(?:' + src[t.PRERELEASE] + ')?' +
  11517. src[t.BUILD] + '?' +
  11518. ')?)?'
  11519. tok('XRANGEPLAINLOOSE')
  11520. src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  11521. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  11522. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  11523. '(?:' + src[t.PRERELEASELOOSE] + ')?' +
  11524. src[t.BUILD] + '?' +
  11525. ')?)?'
  11526. tok('XRANGE')
  11527. src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$'
  11528. tok('XRANGELOOSE')
  11529. src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$'
  11530. // Coercion.
  11531. // Extract anything that could conceivably be a part of a valid semver
  11532. tok('COERCE')
  11533. src[t.COERCE] = '(^|[^\\d])' +
  11534. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  11535. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  11536. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  11537. '(?:$|[^\\d])'
  11538. tok('COERCERTL')
  11539. re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g')
  11540. safeRe[t.COERCERTL] = new RegExp(makeSafeRe(src[t.COERCE]), 'g')
  11541. // Tilde ranges.
  11542. // Meaning is "reasonably at or greater than"
  11543. tok('LONETILDE')
  11544. src[t.LONETILDE] = '(?:~>?)'
  11545. tok('TILDETRIM')
  11546. src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+'
  11547. re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g')
  11548. safeRe[t.TILDETRIM] = new RegExp(makeSafeRe(src[t.TILDETRIM]), 'g')
  11549. var tildeTrimReplace = '$1~'
  11550. tok('TILDE')
  11551. src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$'
  11552. tok('TILDELOOSE')
  11553. src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$'
  11554. // Caret ranges.
  11555. // Meaning is "at least and backwards compatible with"
  11556. tok('LONECARET')
  11557. src[t.LONECARET] = '(?:\\^)'
  11558. tok('CARETTRIM')
  11559. src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+'
  11560. re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g')
  11561. safeRe[t.CARETTRIM] = new RegExp(makeSafeRe(src[t.CARETTRIM]), 'g')
  11562. var caretTrimReplace = '$1^'
  11563. tok('CARET')
  11564. src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$'
  11565. tok('CARETLOOSE')
  11566. src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$'
  11567. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  11568. tok('COMPARATORLOOSE')
  11569. src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$'
  11570. tok('COMPARATOR')
  11571. src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$'
  11572. // An expression to strip any whitespace between the gtlt and the thing
  11573. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  11574. tok('COMPARATORTRIM')
  11575. src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] +
  11576. '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')'
  11577. // this one has to use the /g flag
  11578. re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g')
  11579. safeRe[t.COMPARATORTRIM] = new RegExp(makeSafeRe(src[t.COMPARATORTRIM]), 'g')
  11580. var comparatorTrimReplace = '$1$2$3'
  11581. // Something like `1.2.3 - 1.2.4`
  11582. // Note that these all use the loose form, because they'll be
  11583. // checked against either the strict or loose comparator form
  11584. // later.
  11585. tok('HYPHENRANGE')
  11586. src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' +
  11587. '\\s+-\\s+' +
  11588. '(' + src[t.XRANGEPLAIN] + ')' +
  11589. '\\s*$'
  11590. tok('HYPHENRANGELOOSE')
  11591. src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' +
  11592. '\\s+-\\s+' +
  11593. '(' + src[t.XRANGEPLAINLOOSE] + ')' +
  11594. '\\s*$'
  11595. // Star ranges basically just allow anything at all.
  11596. tok('STAR')
  11597. src[t.STAR] = '(<|>)?=?\\s*\\*'
  11598. // Compile to actual regexp objects.
  11599. // All are flag-free, unless they were created above with a flag.
  11600. for (var i = 0; i < R; i++) {
  11601. debug(i, src[i])
  11602. if (!re[i]) {
  11603. re[i] = new RegExp(src[i])
  11604. // Replace all greedy whitespace to prevent regex dos issues. These regex are
  11605. // used internally via the safeRe object since all inputs in this library get
  11606. // normalized first to trim and collapse all extra whitespace. The original
  11607. // regexes are exported for userland consumption and lower level usage. A
  11608. // future breaking change could export the safer regex only with a note that
  11609. // all input should have extra whitespace removed.
  11610. safeRe[i] = new RegExp(makeSafeRe(src[i]))
  11611. }
  11612. }
  11613. exports.parse = parse
  11614. function parse (version, options) {
  11615. if (!options || typeof options !== 'object') {
  11616. options = {
  11617. loose: !!options,
  11618. includePrerelease: false
  11619. }
  11620. }
  11621. if (version instanceof SemVer) {
  11622. return version
  11623. }
  11624. if (typeof version !== 'string') {
  11625. return null
  11626. }
  11627. if (version.length > MAX_LENGTH) {
  11628. return null
  11629. }
  11630. var r = options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL]
  11631. if (!r.test(version)) {
  11632. return null
  11633. }
  11634. try {
  11635. return new SemVer(version, options)
  11636. } catch (er) {
  11637. return null
  11638. }
  11639. }
  11640. exports.valid = valid
  11641. function valid (version, options) {
  11642. var v = parse(version, options)
  11643. return v ? v.version : null
  11644. }
  11645. exports.clean = clean
  11646. function clean (version, options) {
  11647. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  11648. return s ? s.version : null
  11649. }
  11650. exports.SemVer = SemVer
  11651. function SemVer (version, options) {
  11652. if (!options || typeof options !== 'object') {
  11653. options = {
  11654. loose: !!options,
  11655. includePrerelease: false
  11656. }
  11657. }
  11658. if (version instanceof SemVer) {
  11659. if (version.loose === options.loose) {
  11660. return version
  11661. } else {
  11662. version = version.version
  11663. }
  11664. } else if (typeof version !== 'string') {
  11665. throw new TypeError('Invalid Version: ' + version)
  11666. }
  11667. if (version.length > MAX_LENGTH) {
  11668. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  11669. }
  11670. if (!(this instanceof SemVer)) {
  11671. return new SemVer(version, options)
  11672. }
  11673. debug('SemVer', version, options)
  11674. this.options = options
  11675. this.loose = !!options.loose
  11676. var m = version.trim().match(options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL])
  11677. if (!m) {
  11678. throw new TypeError('Invalid Version: ' + version)
  11679. }
  11680. this.raw = version
  11681. // these are actually numbers
  11682. this.major = +m[1]
  11683. this.minor = +m[2]
  11684. this.patch = +m[3]
  11685. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  11686. throw new TypeError('Invalid major version')
  11687. }
  11688. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  11689. throw new TypeError('Invalid minor version')
  11690. }
  11691. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  11692. throw new TypeError('Invalid patch version')
  11693. }
  11694. // numberify any prerelease numeric ids
  11695. if (!m[4]) {
  11696. this.prerelease = []
  11697. } else {
  11698. this.prerelease = m[4].split('.').map(function (id) {
  11699. if (/^[0-9]+$/.test(id)) {
  11700. var num = +id
  11701. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  11702. return num
  11703. }
  11704. }
  11705. return id
  11706. })
  11707. }
  11708. this.build = m[5] ? m[5].split('.') : []
  11709. this.format()
  11710. }
  11711. SemVer.prototype.format = function () {
  11712. this.version = this.major + '.' + this.minor + '.' + this.patch
  11713. if (this.prerelease.length) {
  11714. this.version += '-' + this.prerelease.join('.')
  11715. }
  11716. return this.version
  11717. }
  11718. SemVer.prototype.toString = function () {
  11719. return this.version
  11720. }
  11721. SemVer.prototype.compare = function (other) {
  11722. debug('SemVer.compare', this.version, this.options, other)
  11723. if (!(other instanceof SemVer)) {
  11724. other = new SemVer(other, this.options)
  11725. }
  11726. return this.compareMain(other) || this.comparePre(other)
  11727. }
  11728. SemVer.prototype.compareMain = function (other) {
  11729. if (!(other instanceof SemVer)) {
  11730. other = new SemVer(other, this.options)
  11731. }
  11732. return compareIdentifiers(this.major, other.major) ||
  11733. compareIdentifiers(this.minor, other.minor) ||
  11734. compareIdentifiers(this.patch, other.patch)
  11735. }
  11736. SemVer.prototype.comparePre = function (other) {
  11737. if (!(other instanceof SemVer)) {
  11738. other = new SemVer(other, this.options)
  11739. }
  11740. // NOT having a prerelease is > having one
  11741. if (this.prerelease.length && !other.prerelease.length) {
  11742. return -1
  11743. } else if (!this.prerelease.length && other.prerelease.length) {
  11744. return 1
  11745. } else if (!this.prerelease.length && !other.prerelease.length) {
  11746. return 0
  11747. }
  11748. var i = 0
  11749. do {
  11750. var a = this.prerelease[i]
  11751. var b = other.prerelease[i]
  11752. debug('prerelease compare', i, a, b)
  11753. if (a === undefined && b === undefined) {
  11754. return 0
  11755. } else if (b === undefined) {
  11756. return 1
  11757. } else if (a === undefined) {
  11758. return -1
  11759. } else if (a === b) {
  11760. continue
  11761. } else {
  11762. return compareIdentifiers(a, b)
  11763. }
  11764. } while (++i)
  11765. }
  11766. SemVer.prototype.compareBuild = function (other) {
  11767. if (!(other instanceof SemVer)) {
  11768. other = new SemVer(other, this.options)
  11769. }
  11770. var i = 0
  11771. do {
  11772. var a = this.build[i]
  11773. var b = other.build[i]
  11774. debug('prerelease compare', i, a, b)
  11775. if (a === undefined && b === undefined) {
  11776. return 0
  11777. } else if (b === undefined) {
  11778. return 1
  11779. } else if (a === undefined) {
  11780. return -1
  11781. } else if (a === b) {
  11782. continue
  11783. } else {
  11784. return compareIdentifiers(a, b)
  11785. }
  11786. } while (++i)
  11787. }
  11788. // preminor will bump the version up to the next minor release, and immediately
  11789. // down to pre-release. premajor and prepatch work the same way.
  11790. SemVer.prototype.inc = function (release, identifier) {
  11791. switch (release) {
  11792. case 'premajor':
  11793. this.prerelease.length = 0
  11794. this.patch = 0
  11795. this.minor = 0
  11796. this.major++
  11797. this.inc('pre', identifier)
  11798. break
  11799. case 'preminor':
  11800. this.prerelease.length = 0
  11801. this.patch = 0
  11802. this.minor++
  11803. this.inc('pre', identifier)
  11804. break
  11805. case 'prepatch':
  11806. // If this is already a prerelease, it will bump to the next version
  11807. // drop any prereleases that might already exist, since they are not
  11808. // relevant at this point.
  11809. this.prerelease.length = 0
  11810. this.inc('patch', identifier)
  11811. this.inc('pre', identifier)
  11812. break
  11813. // If the input is a non-prerelease version, this acts the same as
  11814. // prepatch.
  11815. case 'prerelease':
  11816. if (this.prerelease.length === 0) {
  11817. this.inc('patch', identifier)
  11818. }
  11819. this.inc('pre', identifier)
  11820. break
  11821. case 'major':
  11822. // If this is a pre-major version, bump up to the same major version.
  11823. // Otherwise increment major.
  11824. // 1.0.0-5 bumps to 1.0.0
  11825. // 1.1.0 bumps to 2.0.0
  11826. if (this.minor !== 0 ||
  11827. this.patch !== 0 ||
  11828. this.prerelease.length === 0) {
  11829. this.major++
  11830. }
  11831. this.minor = 0
  11832. this.patch = 0
  11833. this.prerelease = []
  11834. break
  11835. case 'minor':
  11836. // If this is a pre-minor version, bump up to the same minor version.
  11837. // Otherwise increment minor.
  11838. // 1.2.0-5 bumps to 1.2.0
  11839. // 1.2.1 bumps to 1.3.0
  11840. if (this.patch !== 0 || this.prerelease.length === 0) {
  11841. this.minor++
  11842. }
  11843. this.patch = 0
  11844. this.prerelease = []
  11845. break
  11846. case 'patch':
  11847. // If this is not a pre-release version, it will increment the patch.
  11848. // If it is a pre-release it will bump up to the same patch version.
  11849. // 1.2.0-5 patches to 1.2.0
  11850. // 1.2.0 patches to 1.2.1
  11851. if (this.prerelease.length === 0) {
  11852. this.patch++
  11853. }
  11854. this.prerelease = []
  11855. break
  11856. // This probably shouldn't be used publicly.
  11857. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  11858. case 'pre':
  11859. if (this.prerelease.length === 0) {
  11860. this.prerelease = [0]
  11861. } else {
  11862. var i = this.prerelease.length
  11863. while (--i >= 0) {
  11864. if (typeof this.prerelease[i] === 'number') {
  11865. this.prerelease[i]++
  11866. i = -2
  11867. }
  11868. }
  11869. if (i === -1) {
  11870. // didn't increment anything
  11871. this.prerelease.push(0)
  11872. }
  11873. }
  11874. if (identifier) {
  11875. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  11876. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  11877. if (this.prerelease[0] === identifier) {
  11878. if (isNaN(this.prerelease[1])) {
  11879. this.prerelease = [identifier, 0]
  11880. }
  11881. } else {
  11882. this.prerelease = [identifier, 0]
  11883. }
  11884. }
  11885. break
  11886. default:
  11887. throw new Error('invalid increment argument: ' + release)
  11888. }
  11889. this.format()
  11890. this.raw = this.version
  11891. return this
  11892. }
  11893. exports.inc = inc
  11894. function inc (version, release, loose, identifier) {
  11895. if (typeof (loose) === 'string') {
  11896. identifier = loose
  11897. loose = undefined
  11898. }
  11899. try {
  11900. return new SemVer(version, loose).inc(release, identifier).version
  11901. } catch (er) {
  11902. return null
  11903. }
  11904. }
  11905. exports.diff = diff
  11906. function diff (version1, version2) {
  11907. if (eq(version1, version2)) {
  11908. return null
  11909. } else {
  11910. var v1 = parse(version1)
  11911. var v2 = parse(version2)
  11912. var prefix = ''
  11913. if (v1.prerelease.length || v2.prerelease.length) {
  11914. prefix = 'pre'
  11915. var defaultResult = 'prerelease'
  11916. }
  11917. for (var key in v1) {
  11918. if (key === 'major' || key === 'minor' || key === 'patch') {
  11919. if (v1[key] !== v2[key]) {
  11920. return prefix + key
  11921. }
  11922. }
  11923. }
  11924. return defaultResult // may be undefined
  11925. }
  11926. }
  11927. exports.compareIdentifiers = compareIdentifiers
  11928. var numeric = /^[0-9]+$/
  11929. function compareIdentifiers (a, b) {
  11930. var anum = numeric.test(a)
  11931. var bnum = numeric.test(b)
  11932. if (anum && bnum) {
  11933. a = +a
  11934. b = +b
  11935. }
  11936. return a === b ? 0
  11937. : (anum && !bnum) ? -1
  11938. : (bnum && !anum) ? 1
  11939. : a < b ? -1
  11940. : 1
  11941. }
  11942. exports.rcompareIdentifiers = rcompareIdentifiers
  11943. function rcompareIdentifiers (a, b) {
  11944. return compareIdentifiers(b, a)
  11945. }
  11946. exports.major = major
  11947. function major (a, loose) {
  11948. return new SemVer(a, loose).major
  11949. }
  11950. exports.minor = minor
  11951. function minor (a, loose) {
  11952. return new SemVer(a, loose).minor
  11953. }
  11954. exports.patch = patch
  11955. function patch (a, loose) {
  11956. return new SemVer(a, loose).patch
  11957. }
  11958. exports.compare = compare
  11959. function compare (a, b, loose) {
  11960. return new SemVer(a, loose).compare(new SemVer(b, loose))
  11961. }
  11962. exports.compareLoose = compareLoose
  11963. function compareLoose (a, b) {
  11964. return compare(a, b, true)
  11965. }
  11966. exports.compareBuild = compareBuild
  11967. function compareBuild (a, b, loose) {
  11968. var versionA = new SemVer(a, loose)
  11969. var versionB = new SemVer(b, loose)
  11970. return versionA.compare(versionB) || versionA.compareBuild(versionB)
  11971. }
  11972. exports.rcompare = rcompare
  11973. function rcompare (a, b, loose) {
  11974. return compare(b, a, loose)
  11975. }
  11976. exports.sort = sort
  11977. function sort (list, loose) {
  11978. return list.sort(function (a, b) {
  11979. return exports.compareBuild(a, b, loose)
  11980. })
  11981. }
  11982. exports.rsort = rsort
  11983. function rsort (list, loose) {
  11984. return list.sort(function (a, b) {
  11985. return exports.compareBuild(b, a, loose)
  11986. })
  11987. }
  11988. exports.gt = gt
  11989. function gt (a, b, loose) {
  11990. return compare(a, b, loose) > 0
  11991. }
  11992. exports.lt = lt
  11993. function lt (a, b, loose) {
  11994. return compare(a, b, loose) < 0
  11995. }
  11996. exports.eq = eq
  11997. function eq (a, b, loose) {
  11998. return compare(a, b, loose) === 0
  11999. }
  12000. exports.neq = neq
  12001. function neq (a, b, loose) {
  12002. return compare(a, b, loose) !== 0
  12003. }
  12004. exports.gte = gte
  12005. function gte (a, b, loose) {
  12006. return compare(a, b, loose) >= 0
  12007. }
  12008. exports.lte = lte
  12009. function lte (a, b, loose) {
  12010. return compare(a, b, loose) <= 0
  12011. }
  12012. exports.cmp = cmp
  12013. function cmp (a, op, b, loose) {
  12014. switch (op) {
  12015. case '===':
  12016. if (typeof a === 'object')
  12017. a = a.version
  12018. if (typeof b === 'object')
  12019. b = b.version
  12020. return a === b
  12021. case '!==':
  12022. if (typeof a === 'object')
  12023. a = a.version
  12024. if (typeof b === 'object')
  12025. b = b.version
  12026. return a !== b
  12027. case '':
  12028. case '=':
  12029. case '==':
  12030. return eq(a, b, loose)
  12031. case '!=':
  12032. return neq(a, b, loose)
  12033. case '>':
  12034. return gt(a, b, loose)
  12035. case '>=':
  12036. return gte(a, b, loose)
  12037. case '<':
  12038. return lt(a, b, loose)
  12039. case '<=':
  12040. return lte(a, b, loose)
  12041. default:
  12042. throw new TypeError('Invalid operator: ' + op)
  12043. }
  12044. }
  12045. exports.Comparator = Comparator
  12046. function Comparator (comp, options) {
  12047. if (!options || typeof options !== 'object') {
  12048. options = {
  12049. loose: !!options,
  12050. includePrerelease: false
  12051. }
  12052. }
  12053. if (comp instanceof Comparator) {
  12054. if (comp.loose === !!options.loose) {
  12055. return comp
  12056. } else {
  12057. comp = comp.value
  12058. }
  12059. }
  12060. if (!(this instanceof Comparator)) {
  12061. return new Comparator(comp, options)
  12062. }
  12063. comp = comp.trim().split(/\s+/).join(' ')
  12064. debug('comparator', comp, options)
  12065. this.options = options
  12066. this.loose = !!options.loose
  12067. this.parse(comp)
  12068. if (this.semver === ANY) {
  12069. this.value = ''
  12070. } else {
  12071. this.value = this.operator + this.semver.version
  12072. }
  12073. debug('comp', this)
  12074. }
  12075. var ANY = {}
  12076. Comparator.prototype.parse = function (comp) {
  12077. var r = this.options.loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]
  12078. var m = comp.match(r)
  12079. if (!m) {
  12080. throw new TypeError('Invalid comparator: ' + comp)
  12081. }
  12082. this.operator = m[1] !== undefined ? m[1] : ''
  12083. if (this.operator === '=') {
  12084. this.operator = ''
  12085. }
  12086. // if it literally is just '>' or '' then allow anything.
  12087. if (!m[2]) {
  12088. this.semver = ANY
  12089. } else {
  12090. this.semver = new SemVer(m[2], this.options.loose)
  12091. }
  12092. }
  12093. Comparator.prototype.toString = function () {
  12094. return this.value
  12095. }
  12096. Comparator.prototype.test = function (version) {
  12097. debug('Comparator.test', version, this.options.loose)
  12098. if (this.semver === ANY || version === ANY) {
  12099. return true
  12100. }
  12101. if (typeof version === 'string') {
  12102. try {
  12103. version = new SemVer(version, this.options)
  12104. } catch (er) {
  12105. return false
  12106. }
  12107. }
  12108. return cmp(version, this.operator, this.semver, this.options)
  12109. }
  12110. Comparator.prototype.intersects = function (comp, options) {
  12111. if (!(comp instanceof Comparator)) {
  12112. throw new TypeError('a Comparator is required')
  12113. }
  12114. if (!options || typeof options !== 'object') {
  12115. options = {
  12116. loose: !!options,
  12117. includePrerelease: false
  12118. }
  12119. }
  12120. var rangeTmp
  12121. if (this.operator === '') {
  12122. if (this.value === '') {
  12123. return true
  12124. }
  12125. rangeTmp = new Range(comp.value, options)
  12126. return satisfies(this.value, rangeTmp, options)
  12127. } else if (comp.operator === '') {
  12128. if (comp.value === '') {
  12129. return true
  12130. }
  12131. rangeTmp = new Range(this.value, options)
  12132. return satisfies(comp.semver, rangeTmp, options)
  12133. }
  12134. var sameDirectionIncreasing =
  12135. (this.operator === '>=' || this.operator === '>') &&
  12136. (comp.operator === '>=' || comp.operator === '>')
  12137. var sameDirectionDecreasing =
  12138. (this.operator === '<=' || this.operator === '<') &&
  12139. (comp.operator === '<=' || comp.operator === '<')
  12140. var sameSemVer = this.semver.version === comp.semver.version
  12141. var differentDirectionsInclusive =
  12142. (this.operator === '>=' || this.operator === '<=') &&
  12143. (comp.operator === '>=' || comp.operator === '<=')
  12144. var oppositeDirectionsLessThan =
  12145. cmp(this.semver, '<', comp.semver, options) &&
  12146. ((this.operator === '>=' || this.operator === '>') &&
  12147. (comp.operator === '<=' || comp.operator === '<'))
  12148. var oppositeDirectionsGreaterThan =
  12149. cmp(this.semver, '>', comp.semver, options) &&
  12150. ((this.operator === '<=' || this.operator === '<') &&
  12151. (comp.operator === '>=' || comp.operator === '>'))
  12152. return sameDirectionIncreasing || sameDirectionDecreasing ||
  12153. (sameSemVer && differentDirectionsInclusive) ||
  12154. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  12155. }
  12156. exports.Range = Range
  12157. function Range (range, options) {
  12158. if (!options || typeof options !== 'object') {
  12159. options = {
  12160. loose: !!options,
  12161. includePrerelease: false
  12162. }
  12163. }
  12164. if (range instanceof Range) {
  12165. if (range.loose === !!options.loose &&
  12166. range.includePrerelease === !!options.includePrerelease) {
  12167. return range
  12168. } else {
  12169. return new Range(range.raw, options)
  12170. }
  12171. }
  12172. if (range instanceof Comparator) {
  12173. return new Range(range.value, options)
  12174. }
  12175. if (!(this instanceof Range)) {
  12176. return new Range(range, options)
  12177. }
  12178. this.options = options
  12179. this.loose = !!options.loose
  12180. this.includePrerelease = !!options.includePrerelease
  12181. // First reduce all whitespace as much as possible so we do not have to rely
  12182. // on potentially slow regexes like \s*. This is then stored and used for
  12183. // future error messages as well.
  12184. this.raw = range
  12185. .trim()
  12186. .split(/\s+/)
  12187. .join(' ')
  12188. // First, split based on boolean or ||
  12189. this.set = this.raw.split('||').map(function (range) {
  12190. return this.parseRange(range.trim())
  12191. }, this).filter(function (c) {
  12192. // throw out any that are not relevant for whatever reason
  12193. return c.length
  12194. })
  12195. if (!this.set.length) {
  12196. throw new TypeError('Invalid SemVer Range: ' + this.raw)
  12197. }
  12198. this.format()
  12199. }
  12200. Range.prototype.format = function () {
  12201. this.range = this.set.map(function (comps) {
  12202. return comps.join(' ').trim()
  12203. }).join('||').trim()
  12204. return this.range
  12205. }
  12206. Range.prototype.toString = function () {
  12207. return this.range
  12208. }
  12209. Range.prototype.parseRange = function (range) {
  12210. var loose = this.options.loose
  12211. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  12212. var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE]
  12213. range = range.replace(hr, hyphenReplace)
  12214. debug('hyphen replace', range)
  12215. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  12216. range = range.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace)
  12217. debug('comparator trim', range, safeRe[t.COMPARATORTRIM])
  12218. // `~ 1.2.3` => `~1.2.3`
  12219. range = range.replace(safeRe[t.TILDETRIM], tildeTrimReplace)
  12220. // `^ 1.2.3` => `^1.2.3`
  12221. range = range.replace(safeRe[t.CARETTRIM], caretTrimReplace)
  12222. // normalize spaces
  12223. range = range.split(/\s+/).join(' ')
  12224. // At this point, the range is completely trimmed and
  12225. // ready to be split into comparators.
  12226. var compRe = loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]
  12227. var set = range.split(' ').map(function (comp) {
  12228. return parseComparator(comp, this.options)
  12229. }, this).join(' ').split(/\s+/)
  12230. if (this.options.loose) {
  12231. // in loose mode, throw out any that are not valid comparators
  12232. set = set.filter(function (comp) {
  12233. return !!comp.match(compRe)
  12234. })
  12235. }
  12236. set = set.map(function (comp) {
  12237. return new Comparator(comp, this.options)
  12238. }, this)
  12239. return set
  12240. }
  12241. Range.prototype.intersects = function (range, options) {
  12242. if (!(range instanceof Range)) {
  12243. throw new TypeError('a Range is required')
  12244. }
  12245. return this.set.some(function (thisComparators) {
  12246. return (
  12247. isSatisfiable(thisComparators, options) &&
  12248. range.set.some(function (rangeComparators) {
  12249. return (
  12250. isSatisfiable(rangeComparators, options) &&
  12251. thisComparators.every(function (thisComparator) {
  12252. return rangeComparators.every(function (rangeComparator) {
  12253. return thisComparator.intersects(rangeComparator, options)
  12254. })
  12255. })
  12256. )
  12257. })
  12258. )
  12259. })
  12260. }
  12261. // take a set of comparators and determine whether there
  12262. // exists a version which can satisfy it
  12263. function isSatisfiable (comparators, options) {
  12264. var result = true
  12265. var remainingComparators = comparators.slice()
  12266. var testComparator = remainingComparators.pop()
  12267. while (result && remainingComparators.length) {
  12268. result = remainingComparators.every(function (otherComparator) {
  12269. return testComparator.intersects(otherComparator, options)
  12270. })
  12271. testComparator = remainingComparators.pop()
  12272. }
  12273. return result
  12274. }
  12275. // Mostly just for testing and legacy API reasons
  12276. exports.toComparators = toComparators
  12277. function toComparators (range, options) {
  12278. return new Range(range, options).set.map(function (comp) {
  12279. return comp.map(function (c) {
  12280. return c.value
  12281. }).join(' ').trim().split(' ')
  12282. })
  12283. }
  12284. // comprised of xranges, tildes, stars, and gtlt's at this point.
  12285. // already replaced the hyphen ranges
  12286. // turn into a set of JUST comparators.
  12287. function parseComparator (comp, options) {
  12288. debug('comp', comp, options)
  12289. comp = replaceCarets(comp, options)
  12290. debug('caret', comp)
  12291. comp = replaceTildes(comp, options)
  12292. debug('tildes', comp)
  12293. comp = replaceXRanges(comp, options)
  12294. debug('xrange', comp)
  12295. comp = replaceStars(comp, options)
  12296. debug('stars', comp)
  12297. return comp
  12298. }
  12299. function isX (id) {
  12300. return !id || id.toLowerCase() === 'x' || id === '*'
  12301. }
  12302. // ~, ~> --> * (any, kinda silly)
  12303. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  12304. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  12305. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  12306. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  12307. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  12308. function replaceTildes (comp, options) {
  12309. return comp.trim().split(/\s+/).map(function (comp) {
  12310. return replaceTilde(comp, options)
  12311. }).join(' ')
  12312. }
  12313. function replaceTilde (comp, options) {
  12314. var r = options.loose ? safeRe[t.TILDELOOSE] : safeRe[t.TILDE]
  12315. return comp.replace(r, function (_, M, m, p, pr) {
  12316. debug('tilde', comp, _, M, m, p, pr)
  12317. var ret
  12318. if (isX(M)) {
  12319. ret = ''
  12320. } else if (isX(m)) {
  12321. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  12322. } else if (isX(p)) {
  12323. // ~1.2 == >=1.2.0 <1.3.0
  12324. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  12325. } else if (pr) {
  12326. debug('replaceTilde pr', pr)
  12327. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  12328. ' <' + M + '.' + (+m + 1) + '.0'
  12329. } else {
  12330. // ~1.2.3 == >=1.2.3 <1.3.0
  12331. ret = '>=' + M + '.' + m + '.' + p +
  12332. ' <' + M + '.' + (+m + 1) + '.0'
  12333. }
  12334. debug('tilde return', ret)
  12335. return ret
  12336. })
  12337. }
  12338. // ^ --> * (any, kinda silly)
  12339. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  12340. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  12341. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  12342. // ^1.2.3 --> >=1.2.3 <2.0.0
  12343. // ^1.2.0 --> >=1.2.0 <2.0.0
  12344. function replaceCarets (comp, options) {
  12345. return comp.trim().split(/\s+/).map(function (comp) {
  12346. return replaceCaret(comp, options)
  12347. }).join(' ')
  12348. }
  12349. function replaceCaret (comp, options) {
  12350. debug('caret', comp, options)
  12351. var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[t.CARET]
  12352. return comp.replace(r, function (_, M, m, p, pr) {
  12353. debug('caret', comp, _, M, m, p, pr)
  12354. var ret
  12355. if (isX(M)) {
  12356. ret = ''
  12357. } else if (isX(m)) {
  12358. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  12359. } else if (isX(p)) {
  12360. if (M === '0') {
  12361. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  12362. } else {
  12363. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  12364. }
  12365. } else if (pr) {
  12366. debug('replaceCaret pr', pr)
  12367. if (M === '0') {
  12368. if (m === '0') {
  12369. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  12370. ' <' + M + '.' + m + '.' + (+p + 1)
  12371. } else {
  12372. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  12373. ' <' + M + '.' + (+m + 1) + '.0'
  12374. }
  12375. } else {
  12376. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  12377. ' <' + (+M + 1) + '.0.0'
  12378. }
  12379. } else {
  12380. debug('no pr')
  12381. if (M === '0') {
  12382. if (m === '0') {
  12383. ret = '>=' + M + '.' + m + '.' + p +
  12384. ' <' + M + '.' + m + '.' + (+p + 1)
  12385. } else {
  12386. ret = '>=' + M + '.' + m + '.' + p +
  12387. ' <' + M + '.' + (+m + 1) + '.0'
  12388. }
  12389. } else {
  12390. ret = '>=' + M + '.' + m + '.' + p +
  12391. ' <' + (+M + 1) + '.0.0'
  12392. }
  12393. }
  12394. debug('caret return', ret)
  12395. return ret
  12396. })
  12397. }
  12398. function replaceXRanges (comp, options) {
  12399. debug('replaceXRanges', comp, options)
  12400. return comp.split(/\s+/).map(function (comp) {
  12401. return replaceXRange(comp, options)
  12402. }).join(' ')
  12403. }
  12404. function replaceXRange (comp, options) {
  12405. comp = comp.trim()
  12406. var r = options.loose ? safeRe[t.XRANGELOOSE] : safeRe[t.XRANGE]
  12407. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  12408. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  12409. var xM = isX(M)
  12410. var xm = xM || isX(m)
  12411. var xp = xm || isX(p)
  12412. var anyX = xp
  12413. if (gtlt === '=' && anyX) {
  12414. gtlt = ''
  12415. }
  12416. // if we're including prereleases in the match, then we need
  12417. // to fix this to -0, the lowest possible prerelease value
  12418. pr = options.includePrerelease ? '-0' : ''
  12419. if (xM) {
  12420. if (gtlt === '>' || gtlt === '<') {
  12421. // nothing is allowed
  12422. ret = '<0.0.0-0'
  12423. } else {
  12424. // nothing is forbidden
  12425. ret = '*'
  12426. }
  12427. } else if (gtlt && anyX) {
  12428. // we know patch is an x, because we have any x at all.
  12429. // replace X with 0
  12430. if (xm) {
  12431. m = 0
  12432. }
  12433. p = 0
  12434. if (gtlt === '>') {
  12435. // >1 => >=2.0.0
  12436. // >1.2 => >=1.3.0
  12437. // >1.2.3 => >= 1.2.4
  12438. gtlt = '>='
  12439. if (xm) {
  12440. M = +M + 1
  12441. m = 0
  12442. p = 0
  12443. } else {
  12444. m = +m + 1
  12445. p = 0
  12446. }
  12447. } else if (gtlt === '<=') {
  12448. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  12449. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  12450. gtlt = '<'
  12451. if (xm) {
  12452. M = +M + 1
  12453. } else {
  12454. m = +m + 1
  12455. }
  12456. }
  12457. ret = gtlt + M + '.' + m + '.' + p + pr
  12458. } else if (xm) {
  12459. ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr
  12460. } else if (xp) {
  12461. ret = '>=' + M + '.' + m + '.0' + pr +
  12462. ' <' + M + '.' + (+m + 1) + '.0' + pr
  12463. }
  12464. debug('xRange return', ret)
  12465. return ret
  12466. })
  12467. }
  12468. // Because * is AND-ed with everything else in the comparator,
  12469. // and '' means "any version", just remove the *s entirely.
  12470. function replaceStars (comp, options) {
  12471. debug('replaceStars', comp, options)
  12472. // Looseness is ignored here. star is always as loose as it gets!
  12473. return comp.trim().replace(safeRe[t.STAR], '')
  12474. }
  12475. // This function is passed to string.replace(re[t.HYPHENRANGE])
  12476. // M, m, patch, prerelease, build
  12477. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  12478. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  12479. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  12480. function hyphenReplace ($0,
  12481. from, fM, fm, fp, fpr, fb,
  12482. to, tM, tm, tp, tpr, tb) {
  12483. if (isX(fM)) {
  12484. from = ''
  12485. } else if (isX(fm)) {
  12486. from = '>=' + fM + '.0.0'
  12487. } else if (isX(fp)) {
  12488. from = '>=' + fM + '.' + fm + '.0'
  12489. } else {
  12490. from = '>=' + from
  12491. }
  12492. if (isX(tM)) {
  12493. to = ''
  12494. } else if (isX(tm)) {
  12495. to = '<' + (+tM + 1) + '.0.0'
  12496. } else if (isX(tp)) {
  12497. to = '<' + tM + '.' + (+tm + 1) + '.0'
  12498. } else if (tpr) {
  12499. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  12500. } else {
  12501. to = '<=' + to
  12502. }
  12503. return (from + ' ' + to).trim()
  12504. }
  12505. // if ANY of the sets match ALL of its comparators, then pass
  12506. Range.prototype.test = function (version) {
  12507. if (!version) {
  12508. return false
  12509. }
  12510. if (typeof version === 'string') {
  12511. try {
  12512. version = new SemVer(version, this.options)
  12513. } catch (er) {
  12514. return false
  12515. }
  12516. }
  12517. for (var i = 0; i < this.set.length; i++) {
  12518. if (testSet(this.set[i], version, this.options)) {
  12519. return true
  12520. }
  12521. }
  12522. return false
  12523. }
  12524. function testSet (set, version, options) {
  12525. for (var i = 0; i < set.length; i++) {
  12526. if (!set[i].test(version)) {
  12527. return false
  12528. }
  12529. }
  12530. if (version.prerelease.length && !options.includePrerelease) {
  12531. // Find the set of versions that are allowed to have prereleases
  12532. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  12533. // That should allow `1.2.3-pr.2` to pass.
  12534. // However, `1.2.4-alpha.notready` should NOT be allowed,
  12535. // even though it's within the range set by the comparators.
  12536. for (i = 0; i < set.length; i++) {
  12537. debug(set[i].semver)
  12538. if (set[i].semver === ANY) {
  12539. continue
  12540. }
  12541. if (set[i].semver.prerelease.length > 0) {
  12542. var allowed = set[i].semver
  12543. if (allowed.major === version.major &&
  12544. allowed.minor === version.minor &&
  12545. allowed.patch === version.patch) {
  12546. return true
  12547. }
  12548. }
  12549. }
  12550. // Version has a -pre, but it's not one of the ones we like.
  12551. return false
  12552. }
  12553. return true
  12554. }
  12555. exports.satisfies = satisfies
  12556. function satisfies (version, range, options) {
  12557. try {
  12558. range = new Range(range, options)
  12559. } catch (er) {
  12560. return false
  12561. }
  12562. return range.test(version)
  12563. }
  12564. exports.maxSatisfying = maxSatisfying
  12565. function maxSatisfying (versions, range, options) {
  12566. var max = null
  12567. var maxSV = null
  12568. try {
  12569. var rangeObj = new Range(range, options)
  12570. } catch (er) {
  12571. return null
  12572. }
  12573. versions.forEach(function (v) {
  12574. if (rangeObj.test(v)) {
  12575. // satisfies(v, range, options)
  12576. if (!max || maxSV.compare(v) === -1) {
  12577. // compare(max, v, true)
  12578. max = v
  12579. maxSV = new SemVer(max, options)
  12580. }
  12581. }
  12582. })
  12583. return max
  12584. }
  12585. exports.minSatisfying = minSatisfying
  12586. function minSatisfying (versions, range, options) {
  12587. var min = null
  12588. var minSV = null
  12589. try {
  12590. var rangeObj = new Range(range, options)
  12591. } catch (er) {
  12592. return null
  12593. }
  12594. versions.forEach(function (v) {
  12595. if (rangeObj.test(v)) {
  12596. // satisfies(v, range, options)
  12597. if (!min || minSV.compare(v) === 1) {
  12598. // compare(min, v, true)
  12599. min = v
  12600. minSV = new SemVer(min, options)
  12601. }
  12602. }
  12603. })
  12604. return min
  12605. }
  12606. exports.minVersion = minVersion
  12607. function minVersion (range, loose) {
  12608. range = new Range(range, loose)
  12609. var minver = new SemVer('0.0.0')
  12610. if (range.test(minver)) {
  12611. return minver
  12612. }
  12613. minver = new SemVer('0.0.0-0')
  12614. if (range.test(minver)) {
  12615. return minver
  12616. }
  12617. minver = null
  12618. for (var i = 0; i < range.set.length; ++i) {
  12619. var comparators = range.set[i]
  12620. comparators.forEach(function (comparator) {
  12621. // Clone to avoid manipulating the comparator's semver object.
  12622. var compver = new SemVer(comparator.semver.version)
  12623. switch (comparator.operator) {
  12624. case '>':
  12625. if (compver.prerelease.length === 0) {
  12626. compver.patch++
  12627. } else {
  12628. compver.prerelease.push(0)
  12629. }
  12630. compver.raw = compver.format()
  12631. /* fallthrough */
  12632. case '':
  12633. case '>=':
  12634. if (!minver || gt(minver, compver)) {
  12635. minver = compver
  12636. }
  12637. break
  12638. case '<':
  12639. case '<=':
  12640. /* Ignore maximum versions */
  12641. break
  12642. /* istanbul ignore next */
  12643. default:
  12644. throw new Error('Unexpected operation: ' + comparator.operator)
  12645. }
  12646. })
  12647. }
  12648. if (minver && range.test(minver)) {
  12649. return minver
  12650. }
  12651. return null
  12652. }
  12653. exports.validRange = validRange
  12654. function validRange (range, options) {
  12655. try {
  12656. // Return '*' instead of '' so that truthiness works.
  12657. // This will throw if it's invalid anyway
  12658. return new Range(range, options).range || '*'
  12659. } catch (er) {
  12660. return null
  12661. }
  12662. }
  12663. // Determine if version is less than all the versions possible in the range
  12664. exports.ltr = ltr
  12665. function ltr (version, range, options) {
  12666. return outside(version, range, '<', options)
  12667. }
  12668. // Determine if version is greater than all the versions possible in the range.
  12669. exports.gtr = gtr
  12670. function gtr (version, range, options) {
  12671. return outside(version, range, '>', options)
  12672. }
  12673. exports.outside = outside
  12674. function outside (version, range, hilo, options) {
  12675. version = new SemVer(version, options)
  12676. range = new Range(range, options)
  12677. var gtfn, ltefn, ltfn, comp, ecomp
  12678. switch (hilo) {
  12679. case '>':
  12680. gtfn = gt
  12681. ltefn = lte
  12682. ltfn = lt
  12683. comp = '>'
  12684. ecomp = '>='
  12685. break
  12686. case '<':
  12687. gtfn = lt
  12688. ltefn = gte
  12689. ltfn = gt
  12690. comp = '<'
  12691. ecomp = '<='
  12692. break
  12693. default:
  12694. throw new TypeError('Must provide a hilo val of "<" or ">"')
  12695. }
  12696. // If it satisifes the range it is not outside
  12697. if (satisfies(version, range, options)) {
  12698. return false
  12699. }
  12700. // From now on, variable terms are as if we're in "gtr" mode.
  12701. // but note that everything is flipped for the "ltr" function.
  12702. for (var i = 0; i < range.set.length; ++i) {
  12703. var comparators = range.set[i]
  12704. var high = null
  12705. var low = null
  12706. comparators.forEach(function (comparator) {
  12707. if (comparator.semver === ANY) {
  12708. comparator = new Comparator('>=0.0.0')
  12709. }
  12710. high = high || comparator
  12711. low = low || comparator
  12712. if (gtfn(comparator.semver, high.semver, options)) {
  12713. high = comparator
  12714. } else if (ltfn(comparator.semver, low.semver, options)) {
  12715. low = comparator
  12716. }
  12717. })
  12718. // If the edge version comparator has a operator then our version
  12719. // isn't outside it
  12720. if (high.operator === comp || high.operator === ecomp) {
  12721. return false
  12722. }
  12723. // If the lowest version comparator has an operator and our version
  12724. // is less than it then it isn't higher than the range
  12725. if ((!low.operator || low.operator === comp) &&
  12726. ltefn(version, low.semver)) {
  12727. return false
  12728. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  12729. return false
  12730. }
  12731. }
  12732. return true
  12733. }
  12734. exports.prerelease = prerelease
  12735. function prerelease (version, options) {
  12736. var parsed = parse(version, options)
  12737. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  12738. }
  12739. exports.intersects = intersects
  12740. function intersects (r1, r2, options) {
  12741. r1 = new Range(r1, options)
  12742. r2 = new Range(r2, options)
  12743. return r1.intersects(r2)
  12744. }
  12745. exports.coerce = coerce
  12746. function coerce (version, options) {
  12747. if (version instanceof SemVer) {
  12748. return version
  12749. }
  12750. if (typeof version === 'number') {
  12751. version = String(version)
  12752. }
  12753. if (typeof version !== 'string') {
  12754. return null
  12755. }
  12756. options = options || {}
  12757. var match = null
  12758. if (!options.rtl) {
  12759. match = version.match(safeRe[t.COERCE])
  12760. } else {
  12761. // Find the right-most coercible string that does not share
  12762. // a terminus with a more left-ward coercible string.
  12763. // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
  12764. //
  12765. // Walk through the string checking with a /g regexp
  12766. // Manually set the index so as to pick up overlapping matches.
  12767. // Stop when we get a match that ends at the string end, since no
  12768. // coercible string can be more right-ward without the same terminus.
  12769. var next
  12770. while ((next = safeRe[t.COERCERTL].exec(version)) &&
  12771. (!match || match.index + match[0].length !== version.length)
  12772. ) {
  12773. if (!match ||
  12774. next.index + next[0].length !== match.index + match[0].length) {
  12775. match = next
  12776. }
  12777. safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length
  12778. }
  12779. // leave it in a clean state
  12780. safeRe[t.COERCERTL].lastIndex = -1
  12781. }
  12782. if (match === null) {
  12783. return null
  12784. }
  12785. return parse(match[2] +
  12786. '.' + (match[3] || '0') +
  12787. '.' + (match[4] || '0'), options)
  12788. }
  12789. /***/ }),
  12790. /***/ 4294:
  12791. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  12792. module.exports = __nccwpck_require__(4219);
  12793. /***/ }),
  12794. /***/ 4219:
  12795. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  12796. "use strict";
  12797. var net = __nccwpck_require__(1808);
  12798. var tls = __nccwpck_require__(4404);
  12799. var http = __nccwpck_require__(3685);
  12800. var https = __nccwpck_require__(5687);
  12801. var events = __nccwpck_require__(2361);
  12802. var assert = __nccwpck_require__(9491);
  12803. var util = __nccwpck_require__(3837);
  12804. exports.httpOverHttp = httpOverHttp;
  12805. exports.httpsOverHttp = httpsOverHttp;
  12806. exports.httpOverHttps = httpOverHttps;
  12807. exports.httpsOverHttps = httpsOverHttps;
  12808. function httpOverHttp(options) {
  12809. var agent = new TunnelingAgent(options);
  12810. agent.request = http.request;
  12811. return agent;
  12812. }
  12813. function httpsOverHttp(options) {
  12814. var agent = new TunnelingAgent(options);
  12815. agent.request = http.request;
  12816. agent.createSocket = createSecureSocket;
  12817. agent.defaultPort = 443;
  12818. return agent;
  12819. }
  12820. function httpOverHttps(options) {
  12821. var agent = new TunnelingAgent(options);
  12822. agent.request = https.request;
  12823. return agent;
  12824. }
  12825. function httpsOverHttps(options) {
  12826. var agent = new TunnelingAgent(options);
  12827. agent.request = https.request;
  12828. agent.createSocket = createSecureSocket;
  12829. agent.defaultPort = 443;
  12830. return agent;
  12831. }
  12832. function TunnelingAgent(options) {
  12833. var self = this;
  12834. self.options = options || {};
  12835. self.proxyOptions = self.options.proxy || {};
  12836. self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;
  12837. self.requests = [];
  12838. self.sockets = [];
  12839. self.on('free', function onFree(socket, host, port, localAddress) {
  12840. var options = toOptions(host, port, localAddress);
  12841. for (var i = 0, len = self.requests.length; i < len; ++i) {
  12842. var pending = self.requests[i];
  12843. if (pending.host === options.host && pending.port === options.port) {
  12844. // Detect the request to connect same origin server,
  12845. // reuse the connection.
  12846. self.requests.splice(i, 1);
  12847. pending.request.onSocket(socket);
  12848. return;
  12849. }
  12850. }
  12851. socket.destroy();
  12852. self.removeSocket(socket);
  12853. });
  12854. }
  12855. util.inherits(TunnelingAgent, events.EventEmitter);
  12856. TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {
  12857. var self = this;
  12858. var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));
  12859. if (self.sockets.length >= this.maxSockets) {
  12860. // We are over limit so we'll add it to the queue.
  12861. self.requests.push(options);
  12862. return;
  12863. }
  12864. // If we are under maxSockets create a new one.
  12865. self.createSocket(options, function(socket) {
  12866. socket.on('free', onFree);
  12867. socket.on('close', onCloseOrRemove);
  12868. socket.on('agentRemove', onCloseOrRemove);
  12869. req.onSocket(socket);
  12870. function onFree() {
  12871. self.emit('free', socket, options);
  12872. }
  12873. function onCloseOrRemove(err) {
  12874. self.removeSocket(socket);
  12875. socket.removeListener('free', onFree);
  12876. socket.removeListener('close', onCloseOrRemove);
  12877. socket.removeListener('agentRemove', onCloseOrRemove);
  12878. }
  12879. });
  12880. };
  12881. TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
  12882. var self = this;
  12883. var placeholder = {};
  12884. self.sockets.push(placeholder);
  12885. var connectOptions = mergeOptions({}, self.proxyOptions, {
  12886. method: 'CONNECT',
  12887. path: options.host + ':' + options.port,
  12888. agent: false,
  12889. headers: {
  12890. host: options.host + ':' + options.port
  12891. }
  12892. });
  12893. if (options.localAddress) {
  12894. connectOptions.localAddress = options.localAddress;
  12895. }
  12896. if (connectOptions.proxyAuth) {
  12897. connectOptions.headers = connectOptions.headers || {};
  12898. connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
  12899. new Buffer(connectOptions.proxyAuth).toString('base64');
  12900. }
  12901. debug('making CONNECT request');
  12902. var connectReq = self.request(connectOptions);
  12903. connectReq.useChunkedEncodingByDefault = false; // for v0.6
  12904. connectReq.once('response', onResponse); // for v0.6
  12905. connectReq.once('upgrade', onUpgrade); // for v0.6
  12906. connectReq.once('connect', onConnect); // for v0.7 or later
  12907. connectReq.once('error', onError);
  12908. connectReq.end();
  12909. function onResponse(res) {
  12910. // Very hacky. This is necessary to avoid http-parser leaks.
  12911. res.upgrade = true;
  12912. }
  12913. function onUpgrade(res, socket, head) {
  12914. // Hacky.
  12915. process.nextTick(function() {
  12916. onConnect(res, socket, head);
  12917. });
  12918. }
  12919. function onConnect(res, socket, head) {
  12920. connectReq.removeAllListeners();
  12921. socket.removeAllListeners();
  12922. if (res.statusCode !== 200) {
  12923. debug('tunneling socket could not be established, statusCode=%d',
  12924. res.statusCode);
  12925. socket.destroy();
  12926. var error = new Error('tunneling socket could not be established, ' +
  12927. 'statusCode=' + res.statusCode);
  12928. error.code = 'ECONNRESET';
  12929. options.request.emit('error', error);
  12930. self.removeSocket(placeholder);
  12931. return;
  12932. }
  12933. if (head.length > 0) {
  12934. debug('got illegal response body from proxy');
  12935. socket.destroy();
  12936. var error = new Error('got illegal response body from proxy');
  12937. error.code = 'ECONNRESET';
  12938. options.request.emit('error', error);
  12939. self.removeSocket(placeholder);
  12940. return;
  12941. }
  12942. debug('tunneling connection has established');
  12943. self.sockets[self.sockets.indexOf(placeholder)] = socket;
  12944. return cb(socket);
  12945. }
  12946. function onError(cause) {
  12947. connectReq.removeAllListeners();
  12948. debug('tunneling socket could not be established, cause=%s\n',
  12949. cause.message, cause.stack);
  12950. var error = new Error('tunneling socket could not be established, ' +
  12951. 'cause=' + cause.message);
  12952. error.code = 'ECONNRESET';
  12953. options.request.emit('error', error);
  12954. self.removeSocket(placeholder);
  12955. }
  12956. };
  12957. TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
  12958. var pos = this.sockets.indexOf(socket)
  12959. if (pos === -1) {
  12960. return;
  12961. }
  12962. this.sockets.splice(pos, 1);
  12963. var pending = this.requests.shift();
  12964. if (pending) {
  12965. // If we have pending requests and a socket gets closed a new one
  12966. // needs to be created to take over in the pool for the one that closed.
  12967. this.createSocket(pending, function(socket) {
  12968. pending.request.onSocket(socket);
  12969. });
  12970. }
  12971. };
  12972. function createSecureSocket(options, cb) {
  12973. var self = this;
  12974. TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
  12975. var hostHeader = options.request.getHeader('host');
  12976. var tlsOptions = mergeOptions({}, self.options, {
  12977. socket: socket,
  12978. servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host
  12979. });
  12980. // 0 is dummy port for v0.6
  12981. var secureSocket = tls.connect(0, tlsOptions);
  12982. self.sockets[self.sockets.indexOf(socket)] = secureSocket;
  12983. cb(secureSocket);
  12984. });
  12985. }
  12986. function toOptions(host, port, localAddress) {
  12987. if (typeof host === 'string') { // since v0.10
  12988. return {
  12989. host: host,
  12990. port: port,
  12991. localAddress: localAddress
  12992. };
  12993. }
  12994. return host; // for v0.11 or later
  12995. }
  12996. function mergeOptions(target) {
  12997. for (var i = 1, len = arguments.length; i < len; ++i) {
  12998. var overrides = arguments[i];
  12999. if (typeof overrides === 'object') {
  13000. var keys = Object.keys(overrides);
  13001. for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
  13002. var k = keys[j];
  13003. if (overrides[k] !== undefined) {
  13004. target[k] = overrides[k];
  13005. }
  13006. }
  13007. }
  13008. }
  13009. return target;
  13010. }
  13011. var debug;
  13012. if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
  13013. debug = function() {
  13014. var args = Array.prototype.slice.call(arguments);
  13015. if (typeof args[0] === 'string') {
  13016. args[0] = 'TUNNEL: ' + args[0];
  13017. } else {
  13018. args.unshift('TUNNEL:');
  13019. }
  13020. console.error.apply(console, args);
  13021. }
  13022. } else {
  13023. debug = function() {};
  13024. }
  13025. exports.debug = debug; // for test
  13026. /***/ }),
  13027. /***/ 1773:
  13028. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13029. "use strict";
  13030. const Client = __nccwpck_require__(3598)
  13031. const Dispatcher = __nccwpck_require__(412)
  13032. const errors = __nccwpck_require__(8045)
  13033. const Pool = __nccwpck_require__(4634)
  13034. const BalancedPool = __nccwpck_require__(7931)
  13035. const Agent = __nccwpck_require__(7890)
  13036. const util = __nccwpck_require__(3983)
  13037. const { InvalidArgumentError } = errors
  13038. const api = __nccwpck_require__(4059)
  13039. const buildConnector = __nccwpck_require__(2067)
  13040. const MockClient = __nccwpck_require__(8687)
  13041. const MockAgent = __nccwpck_require__(6771)
  13042. const MockPool = __nccwpck_require__(6193)
  13043. const mockErrors = __nccwpck_require__(888)
  13044. const ProxyAgent = __nccwpck_require__(7858)
  13045. const RetryHandler = __nccwpck_require__(2286)
  13046. const { getGlobalDispatcher, setGlobalDispatcher } = __nccwpck_require__(1892)
  13047. const DecoratorHandler = __nccwpck_require__(6930)
  13048. const RedirectHandler = __nccwpck_require__(2860)
  13049. const createRedirectInterceptor = __nccwpck_require__(8861)
  13050. let hasCrypto
  13051. try {
  13052. __nccwpck_require__(6113)
  13053. hasCrypto = true
  13054. } catch {
  13055. hasCrypto = false
  13056. }
  13057. Object.assign(Dispatcher.prototype, api)
  13058. module.exports.Dispatcher = Dispatcher
  13059. module.exports.Client = Client
  13060. module.exports.Pool = Pool
  13061. module.exports.BalancedPool = BalancedPool
  13062. module.exports.Agent = Agent
  13063. module.exports.ProxyAgent = ProxyAgent
  13064. module.exports.RetryHandler = RetryHandler
  13065. module.exports.DecoratorHandler = DecoratorHandler
  13066. module.exports.RedirectHandler = RedirectHandler
  13067. module.exports.createRedirectInterceptor = createRedirectInterceptor
  13068. module.exports.buildConnector = buildConnector
  13069. module.exports.errors = errors
  13070. function makeDispatcher (fn) {
  13071. return (url, opts, handler) => {
  13072. if (typeof opts === 'function') {
  13073. handler = opts
  13074. opts = null
  13075. }
  13076. if (!url || (typeof url !== 'string' && typeof url !== 'object' && !(url instanceof URL))) {
  13077. throw new InvalidArgumentError('invalid url')
  13078. }
  13079. if (opts != null && typeof opts !== 'object') {
  13080. throw new InvalidArgumentError('invalid opts')
  13081. }
  13082. if (opts && opts.path != null) {
  13083. if (typeof opts.path !== 'string') {
  13084. throw new InvalidArgumentError('invalid opts.path')
  13085. }
  13086. let path = opts.path
  13087. if (!opts.path.startsWith('/')) {
  13088. path = `/${path}`
  13089. }
  13090. url = new URL(util.parseOrigin(url).origin + path)
  13091. } else {
  13092. if (!opts) {
  13093. opts = typeof url === 'object' ? url : {}
  13094. }
  13095. url = util.parseURL(url)
  13096. }
  13097. const { agent, dispatcher = getGlobalDispatcher() } = opts
  13098. if (agent) {
  13099. throw new InvalidArgumentError('unsupported opts.agent. Did you mean opts.client?')
  13100. }
  13101. return fn.call(dispatcher, {
  13102. ...opts,
  13103. origin: url.origin,
  13104. path: url.search ? `${url.pathname}${url.search}` : url.pathname,
  13105. method: opts.method || (opts.body ? 'PUT' : 'GET')
  13106. }, handler)
  13107. }
  13108. }
  13109. module.exports.setGlobalDispatcher = setGlobalDispatcher
  13110. module.exports.getGlobalDispatcher = getGlobalDispatcher
  13111. if (util.nodeMajor > 16 || (util.nodeMajor === 16 && util.nodeMinor >= 8)) {
  13112. let fetchImpl = null
  13113. module.exports.fetch = async function fetch (resource) {
  13114. if (!fetchImpl) {
  13115. fetchImpl = (__nccwpck_require__(4881).fetch)
  13116. }
  13117. try {
  13118. return await fetchImpl(...arguments)
  13119. } catch (err) {
  13120. if (typeof err === 'object') {
  13121. Error.captureStackTrace(err, this)
  13122. }
  13123. throw err
  13124. }
  13125. }
  13126. module.exports.Headers = __nccwpck_require__(554).Headers
  13127. module.exports.Response = __nccwpck_require__(7823).Response
  13128. module.exports.Request = __nccwpck_require__(8359).Request
  13129. module.exports.FormData = __nccwpck_require__(2015).FormData
  13130. module.exports.File = __nccwpck_require__(8511).File
  13131. module.exports.FileReader = __nccwpck_require__(1446).FileReader
  13132. const { setGlobalOrigin, getGlobalOrigin } = __nccwpck_require__(1246)
  13133. module.exports.setGlobalOrigin = setGlobalOrigin
  13134. module.exports.getGlobalOrigin = getGlobalOrigin
  13135. const { CacheStorage } = __nccwpck_require__(7907)
  13136. const { kConstruct } = __nccwpck_require__(9174)
  13137. // Cache & CacheStorage are tightly coupled with fetch. Even if it may run
  13138. // in an older version of Node, it doesn't have any use without fetch.
  13139. module.exports.caches = new CacheStorage(kConstruct)
  13140. }
  13141. if (util.nodeMajor >= 16) {
  13142. const { deleteCookie, getCookies, getSetCookies, setCookie } = __nccwpck_require__(1724)
  13143. module.exports.deleteCookie = deleteCookie
  13144. module.exports.getCookies = getCookies
  13145. module.exports.getSetCookies = getSetCookies
  13146. module.exports.setCookie = setCookie
  13147. const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(685)
  13148. module.exports.parseMIMEType = parseMIMEType
  13149. module.exports.serializeAMimeType = serializeAMimeType
  13150. }
  13151. if (util.nodeMajor >= 18 && hasCrypto) {
  13152. const { WebSocket } = __nccwpck_require__(4284)
  13153. module.exports.WebSocket = WebSocket
  13154. }
  13155. module.exports.request = makeDispatcher(api.request)
  13156. module.exports.stream = makeDispatcher(api.stream)
  13157. module.exports.pipeline = makeDispatcher(api.pipeline)
  13158. module.exports.connect = makeDispatcher(api.connect)
  13159. module.exports.upgrade = makeDispatcher(api.upgrade)
  13160. module.exports.MockClient = MockClient
  13161. module.exports.MockPool = MockPool
  13162. module.exports.MockAgent = MockAgent
  13163. module.exports.mockErrors = mockErrors
  13164. /***/ }),
  13165. /***/ 7890:
  13166. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13167. "use strict";
  13168. const { InvalidArgumentError } = __nccwpck_require__(8045)
  13169. const { kClients, kRunning, kClose, kDestroy, kDispatch, kInterceptors } = __nccwpck_require__(2785)
  13170. const DispatcherBase = __nccwpck_require__(4839)
  13171. const Pool = __nccwpck_require__(4634)
  13172. const Client = __nccwpck_require__(3598)
  13173. const util = __nccwpck_require__(3983)
  13174. const createRedirectInterceptor = __nccwpck_require__(8861)
  13175. const { WeakRef, FinalizationRegistry } = __nccwpck_require__(6436)()
  13176. const kOnConnect = Symbol('onConnect')
  13177. const kOnDisconnect = Symbol('onDisconnect')
  13178. const kOnConnectionError = Symbol('onConnectionError')
  13179. const kMaxRedirections = Symbol('maxRedirections')
  13180. const kOnDrain = Symbol('onDrain')
  13181. const kFactory = Symbol('factory')
  13182. const kFinalizer = Symbol('finalizer')
  13183. const kOptions = Symbol('options')
  13184. function defaultFactory (origin, opts) {
  13185. return opts && opts.connections === 1
  13186. ? new Client(origin, opts)
  13187. : new Pool(origin, opts)
  13188. }
  13189. class Agent extends DispatcherBase {
  13190. constructor ({ factory = defaultFactory, maxRedirections = 0, connect, ...options } = {}) {
  13191. super()
  13192. if (typeof factory !== 'function') {
  13193. throw new InvalidArgumentError('factory must be a function.')
  13194. }
  13195. if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {
  13196. throw new InvalidArgumentError('connect must be a function or an object')
  13197. }
  13198. if (!Number.isInteger(maxRedirections) || maxRedirections < 0) {
  13199. throw new InvalidArgumentError('maxRedirections must be a positive number')
  13200. }
  13201. if (connect && typeof connect !== 'function') {
  13202. connect = { ...connect }
  13203. }
  13204. this[kInterceptors] = options.interceptors && options.interceptors.Agent && Array.isArray(options.interceptors.Agent)
  13205. ? options.interceptors.Agent
  13206. : [createRedirectInterceptor({ maxRedirections })]
  13207. this[kOptions] = { ...util.deepClone(options), connect }
  13208. this[kOptions].interceptors = options.interceptors
  13209. ? { ...options.interceptors }
  13210. : undefined
  13211. this[kMaxRedirections] = maxRedirections
  13212. this[kFactory] = factory
  13213. this[kClients] = new Map()
  13214. this[kFinalizer] = new FinalizationRegistry(/* istanbul ignore next: gc is undeterministic */ key => {
  13215. const ref = this[kClients].get(key)
  13216. if (ref !== undefined && ref.deref() === undefined) {
  13217. this[kClients].delete(key)
  13218. }
  13219. })
  13220. const agent = this
  13221. this[kOnDrain] = (origin, targets) => {
  13222. agent.emit('drain', origin, [agent, ...targets])
  13223. }
  13224. this[kOnConnect] = (origin, targets) => {
  13225. agent.emit('connect', origin, [agent, ...targets])
  13226. }
  13227. this[kOnDisconnect] = (origin, targets, err) => {
  13228. agent.emit('disconnect', origin, [agent, ...targets], err)
  13229. }
  13230. this[kOnConnectionError] = (origin, targets, err) => {
  13231. agent.emit('connectionError', origin, [agent, ...targets], err)
  13232. }
  13233. }
  13234. get [kRunning] () {
  13235. let ret = 0
  13236. for (const ref of this[kClients].values()) {
  13237. const client = ref.deref()
  13238. /* istanbul ignore next: gc is undeterministic */
  13239. if (client) {
  13240. ret += client[kRunning]
  13241. }
  13242. }
  13243. return ret
  13244. }
  13245. [kDispatch] (opts, handler) {
  13246. let key
  13247. if (opts.origin && (typeof opts.origin === 'string' || opts.origin instanceof URL)) {
  13248. key = String(opts.origin)
  13249. } else {
  13250. throw new InvalidArgumentError('opts.origin must be a non-empty string or URL.')
  13251. }
  13252. const ref = this[kClients].get(key)
  13253. let dispatcher = ref ? ref.deref() : null
  13254. if (!dispatcher) {
  13255. dispatcher = this[kFactory](opts.origin, this[kOptions])
  13256. .on('drain', this[kOnDrain])
  13257. .on('connect', this[kOnConnect])
  13258. .on('disconnect', this[kOnDisconnect])
  13259. .on('connectionError', this[kOnConnectionError])
  13260. this[kClients].set(key, new WeakRef(dispatcher))
  13261. this[kFinalizer].register(dispatcher, key)
  13262. }
  13263. return dispatcher.dispatch(opts, handler)
  13264. }
  13265. async [kClose] () {
  13266. const closePromises = []
  13267. for (const ref of this[kClients].values()) {
  13268. const client = ref.deref()
  13269. /* istanbul ignore else: gc is undeterministic */
  13270. if (client) {
  13271. closePromises.push(client.close())
  13272. }
  13273. }
  13274. await Promise.all(closePromises)
  13275. }
  13276. async [kDestroy] (err) {
  13277. const destroyPromises = []
  13278. for (const ref of this[kClients].values()) {
  13279. const client = ref.deref()
  13280. /* istanbul ignore else: gc is undeterministic */
  13281. if (client) {
  13282. destroyPromises.push(client.destroy(err))
  13283. }
  13284. }
  13285. await Promise.all(destroyPromises)
  13286. }
  13287. }
  13288. module.exports = Agent
  13289. /***/ }),
  13290. /***/ 7032:
  13291. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13292. const { addAbortListener } = __nccwpck_require__(3983)
  13293. const { RequestAbortedError } = __nccwpck_require__(8045)
  13294. const kListener = Symbol('kListener')
  13295. const kSignal = Symbol('kSignal')
  13296. function abort (self) {
  13297. if (self.abort) {
  13298. self.abort()
  13299. } else {
  13300. self.onError(new RequestAbortedError())
  13301. }
  13302. }
  13303. function addSignal (self, signal) {
  13304. self[kSignal] = null
  13305. self[kListener] = null
  13306. if (!signal) {
  13307. return
  13308. }
  13309. if (signal.aborted) {
  13310. abort(self)
  13311. return
  13312. }
  13313. self[kSignal] = signal
  13314. self[kListener] = () => {
  13315. abort(self)
  13316. }
  13317. addAbortListener(self[kSignal], self[kListener])
  13318. }
  13319. function removeSignal (self) {
  13320. if (!self[kSignal]) {
  13321. return
  13322. }
  13323. if ('removeEventListener' in self[kSignal]) {
  13324. self[kSignal].removeEventListener('abort', self[kListener])
  13325. } else {
  13326. self[kSignal].removeListener('abort', self[kListener])
  13327. }
  13328. self[kSignal] = null
  13329. self[kListener] = null
  13330. }
  13331. module.exports = {
  13332. addSignal,
  13333. removeSignal
  13334. }
  13335. /***/ }),
  13336. /***/ 9744:
  13337. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13338. "use strict";
  13339. const { AsyncResource } = __nccwpck_require__(852)
  13340. const { InvalidArgumentError, RequestAbortedError, SocketError } = __nccwpck_require__(8045)
  13341. const util = __nccwpck_require__(3983)
  13342. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  13343. class ConnectHandler extends AsyncResource {
  13344. constructor (opts, callback) {
  13345. if (!opts || typeof opts !== 'object') {
  13346. throw new InvalidArgumentError('invalid opts')
  13347. }
  13348. if (typeof callback !== 'function') {
  13349. throw new InvalidArgumentError('invalid callback')
  13350. }
  13351. const { signal, opaque, responseHeaders } = opts
  13352. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  13353. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  13354. }
  13355. super('UNDICI_CONNECT')
  13356. this.opaque = opaque || null
  13357. this.responseHeaders = responseHeaders || null
  13358. this.callback = callback
  13359. this.abort = null
  13360. addSignal(this, signal)
  13361. }
  13362. onConnect (abort, context) {
  13363. if (!this.callback) {
  13364. throw new RequestAbortedError()
  13365. }
  13366. this.abort = abort
  13367. this.context = context
  13368. }
  13369. onHeaders () {
  13370. throw new SocketError('bad connect', null)
  13371. }
  13372. onUpgrade (statusCode, rawHeaders, socket) {
  13373. const { callback, opaque, context } = this
  13374. removeSignal(this)
  13375. this.callback = null
  13376. let headers = rawHeaders
  13377. // Indicates is an HTTP2Session
  13378. if (headers != null) {
  13379. headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13380. }
  13381. this.runInAsyncScope(callback, null, null, {
  13382. statusCode,
  13383. headers,
  13384. socket,
  13385. opaque,
  13386. context
  13387. })
  13388. }
  13389. onError (err) {
  13390. const { callback, opaque } = this
  13391. removeSignal(this)
  13392. if (callback) {
  13393. this.callback = null
  13394. queueMicrotask(() => {
  13395. this.runInAsyncScope(callback, null, err, { opaque })
  13396. })
  13397. }
  13398. }
  13399. }
  13400. function connect (opts, callback) {
  13401. if (callback === undefined) {
  13402. return new Promise((resolve, reject) => {
  13403. connect.call(this, opts, (err, data) => {
  13404. return err ? reject(err) : resolve(data)
  13405. })
  13406. })
  13407. }
  13408. try {
  13409. const connectHandler = new ConnectHandler(opts, callback)
  13410. this.dispatch({ ...opts, method: 'CONNECT' }, connectHandler)
  13411. } catch (err) {
  13412. if (typeof callback !== 'function') {
  13413. throw err
  13414. }
  13415. const opaque = opts && opts.opaque
  13416. queueMicrotask(() => callback(err, { opaque }))
  13417. }
  13418. }
  13419. module.exports = connect
  13420. /***/ }),
  13421. /***/ 8752:
  13422. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13423. "use strict";
  13424. const {
  13425. Readable,
  13426. Duplex,
  13427. PassThrough
  13428. } = __nccwpck_require__(2781)
  13429. const {
  13430. InvalidArgumentError,
  13431. InvalidReturnValueError,
  13432. RequestAbortedError
  13433. } = __nccwpck_require__(8045)
  13434. const util = __nccwpck_require__(3983)
  13435. const { AsyncResource } = __nccwpck_require__(852)
  13436. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  13437. const assert = __nccwpck_require__(9491)
  13438. const kResume = Symbol('resume')
  13439. class PipelineRequest extends Readable {
  13440. constructor () {
  13441. super({ autoDestroy: true })
  13442. this[kResume] = null
  13443. }
  13444. _read () {
  13445. const { [kResume]: resume } = this
  13446. if (resume) {
  13447. this[kResume] = null
  13448. resume()
  13449. }
  13450. }
  13451. _destroy (err, callback) {
  13452. this._read()
  13453. callback(err)
  13454. }
  13455. }
  13456. class PipelineResponse extends Readable {
  13457. constructor (resume) {
  13458. super({ autoDestroy: true })
  13459. this[kResume] = resume
  13460. }
  13461. _read () {
  13462. this[kResume]()
  13463. }
  13464. _destroy (err, callback) {
  13465. if (!err && !this._readableState.endEmitted) {
  13466. err = new RequestAbortedError()
  13467. }
  13468. callback(err)
  13469. }
  13470. }
  13471. class PipelineHandler extends AsyncResource {
  13472. constructor (opts, handler) {
  13473. if (!opts || typeof opts !== 'object') {
  13474. throw new InvalidArgumentError('invalid opts')
  13475. }
  13476. if (typeof handler !== 'function') {
  13477. throw new InvalidArgumentError('invalid handler')
  13478. }
  13479. const { signal, method, opaque, onInfo, responseHeaders } = opts
  13480. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  13481. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  13482. }
  13483. if (method === 'CONNECT') {
  13484. throw new InvalidArgumentError('invalid method')
  13485. }
  13486. if (onInfo && typeof onInfo !== 'function') {
  13487. throw new InvalidArgumentError('invalid onInfo callback')
  13488. }
  13489. super('UNDICI_PIPELINE')
  13490. this.opaque = opaque || null
  13491. this.responseHeaders = responseHeaders || null
  13492. this.handler = handler
  13493. this.abort = null
  13494. this.context = null
  13495. this.onInfo = onInfo || null
  13496. this.req = new PipelineRequest().on('error', util.nop)
  13497. this.ret = new Duplex({
  13498. readableObjectMode: opts.objectMode,
  13499. autoDestroy: true,
  13500. read: () => {
  13501. const { body } = this
  13502. if (body && body.resume) {
  13503. body.resume()
  13504. }
  13505. },
  13506. write: (chunk, encoding, callback) => {
  13507. const { req } = this
  13508. if (req.push(chunk, encoding) || req._readableState.destroyed) {
  13509. callback()
  13510. } else {
  13511. req[kResume] = callback
  13512. }
  13513. },
  13514. destroy: (err, callback) => {
  13515. const { body, req, res, ret, abort } = this
  13516. if (!err && !ret._readableState.endEmitted) {
  13517. err = new RequestAbortedError()
  13518. }
  13519. if (abort && err) {
  13520. abort()
  13521. }
  13522. util.destroy(body, err)
  13523. util.destroy(req, err)
  13524. util.destroy(res, err)
  13525. removeSignal(this)
  13526. callback(err)
  13527. }
  13528. }).on('prefinish', () => {
  13529. const { req } = this
  13530. // Node < 15 does not call _final in same tick.
  13531. req.push(null)
  13532. })
  13533. this.res = null
  13534. addSignal(this, signal)
  13535. }
  13536. onConnect (abort, context) {
  13537. const { ret, res } = this
  13538. assert(!res, 'pipeline cannot be retried')
  13539. if (ret.destroyed) {
  13540. throw new RequestAbortedError()
  13541. }
  13542. this.abort = abort
  13543. this.context = context
  13544. }
  13545. onHeaders (statusCode, rawHeaders, resume) {
  13546. const { opaque, handler, context } = this
  13547. if (statusCode < 200) {
  13548. if (this.onInfo) {
  13549. const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13550. this.onInfo({ statusCode, headers })
  13551. }
  13552. return
  13553. }
  13554. this.res = new PipelineResponse(resume)
  13555. let body
  13556. try {
  13557. this.handler = null
  13558. const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13559. body = this.runInAsyncScope(handler, null, {
  13560. statusCode,
  13561. headers,
  13562. opaque,
  13563. body: this.res,
  13564. context
  13565. })
  13566. } catch (err) {
  13567. this.res.on('error', util.nop)
  13568. throw err
  13569. }
  13570. if (!body || typeof body.on !== 'function') {
  13571. throw new InvalidReturnValueError('expected Readable')
  13572. }
  13573. body
  13574. .on('data', (chunk) => {
  13575. const { ret, body } = this
  13576. if (!ret.push(chunk) && body.pause) {
  13577. body.pause()
  13578. }
  13579. })
  13580. .on('error', (err) => {
  13581. const { ret } = this
  13582. util.destroy(ret, err)
  13583. })
  13584. .on('end', () => {
  13585. const { ret } = this
  13586. ret.push(null)
  13587. })
  13588. .on('close', () => {
  13589. const { ret } = this
  13590. if (!ret._readableState.ended) {
  13591. util.destroy(ret, new RequestAbortedError())
  13592. }
  13593. })
  13594. this.body = body
  13595. }
  13596. onData (chunk) {
  13597. const { res } = this
  13598. return res.push(chunk)
  13599. }
  13600. onComplete (trailers) {
  13601. const { res } = this
  13602. res.push(null)
  13603. }
  13604. onError (err) {
  13605. const { ret } = this
  13606. this.handler = null
  13607. util.destroy(ret, err)
  13608. }
  13609. }
  13610. function pipeline (opts, handler) {
  13611. try {
  13612. const pipelineHandler = new PipelineHandler(opts, handler)
  13613. this.dispatch({ ...opts, body: pipelineHandler.req }, pipelineHandler)
  13614. return pipelineHandler.ret
  13615. } catch (err) {
  13616. return new PassThrough().destroy(err)
  13617. }
  13618. }
  13619. module.exports = pipeline
  13620. /***/ }),
  13621. /***/ 5448:
  13622. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13623. "use strict";
  13624. const Readable = __nccwpck_require__(3858)
  13625. const {
  13626. InvalidArgumentError,
  13627. RequestAbortedError
  13628. } = __nccwpck_require__(8045)
  13629. const util = __nccwpck_require__(3983)
  13630. const { getResolveErrorBodyCallback } = __nccwpck_require__(7474)
  13631. const { AsyncResource } = __nccwpck_require__(852)
  13632. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  13633. class RequestHandler extends AsyncResource {
  13634. constructor (opts, callback) {
  13635. if (!opts || typeof opts !== 'object') {
  13636. throw new InvalidArgumentError('invalid opts')
  13637. }
  13638. const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError, highWaterMark } = opts
  13639. try {
  13640. if (typeof callback !== 'function') {
  13641. throw new InvalidArgumentError('invalid callback')
  13642. }
  13643. if (highWaterMark && (typeof highWaterMark !== 'number' || highWaterMark < 0)) {
  13644. throw new InvalidArgumentError('invalid highWaterMark')
  13645. }
  13646. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  13647. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  13648. }
  13649. if (method === 'CONNECT') {
  13650. throw new InvalidArgumentError('invalid method')
  13651. }
  13652. if (onInfo && typeof onInfo !== 'function') {
  13653. throw new InvalidArgumentError('invalid onInfo callback')
  13654. }
  13655. super('UNDICI_REQUEST')
  13656. } catch (err) {
  13657. if (util.isStream(body)) {
  13658. util.destroy(body.on('error', util.nop), err)
  13659. }
  13660. throw err
  13661. }
  13662. this.responseHeaders = responseHeaders || null
  13663. this.opaque = opaque || null
  13664. this.callback = callback
  13665. this.res = null
  13666. this.abort = null
  13667. this.body = body
  13668. this.trailers = {}
  13669. this.context = null
  13670. this.onInfo = onInfo || null
  13671. this.throwOnError = throwOnError
  13672. this.highWaterMark = highWaterMark
  13673. if (util.isStream(body)) {
  13674. body.on('error', (err) => {
  13675. this.onError(err)
  13676. })
  13677. }
  13678. addSignal(this, signal)
  13679. }
  13680. onConnect (abort, context) {
  13681. if (!this.callback) {
  13682. throw new RequestAbortedError()
  13683. }
  13684. this.abort = abort
  13685. this.context = context
  13686. }
  13687. onHeaders (statusCode, rawHeaders, resume, statusMessage) {
  13688. const { callback, opaque, abort, context, responseHeaders, highWaterMark } = this
  13689. const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13690. if (statusCode < 200) {
  13691. if (this.onInfo) {
  13692. this.onInfo({ statusCode, headers })
  13693. }
  13694. return
  13695. }
  13696. const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers
  13697. const contentType = parsedHeaders['content-type']
  13698. const body = new Readable({ resume, abort, contentType, highWaterMark })
  13699. this.callback = null
  13700. this.res = body
  13701. if (callback !== null) {
  13702. if (this.throwOnError && statusCode >= 400) {
  13703. this.runInAsyncScope(getResolveErrorBodyCallback, null,
  13704. { callback, body, contentType, statusCode, statusMessage, headers }
  13705. )
  13706. } else {
  13707. this.runInAsyncScope(callback, null, null, {
  13708. statusCode,
  13709. headers,
  13710. trailers: this.trailers,
  13711. opaque,
  13712. body,
  13713. context
  13714. })
  13715. }
  13716. }
  13717. }
  13718. onData (chunk) {
  13719. const { res } = this
  13720. return res.push(chunk)
  13721. }
  13722. onComplete (trailers) {
  13723. const { res } = this
  13724. removeSignal(this)
  13725. util.parseHeaders(trailers, this.trailers)
  13726. res.push(null)
  13727. }
  13728. onError (err) {
  13729. const { res, callback, body, opaque } = this
  13730. removeSignal(this)
  13731. if (callback) {
  13732. // TODO: Does this need queueMicrotask?
  13733. this.callback = null
  13734. queueMicrotask(() => {
  13735. this.runInAsyncScope(callback, null, err, { opaque })
  13736. })
  13737. }
  13738. if (res) {
  13739. this.res = null
  13740. // Ensure all queued handlers are invoked before destroying res.
  13741. queueMicrotask(() => {
  13742. util.destroy(res, err)
  13743. })
  13744. }
  13745. if (body) {
  13746. this.body = null
  13747. util.destroy(body, err)
  13748. }
  13749. }
  13750. }
  13751. function request (opts, callback) {
  13752. if (callback === undefined) {
  13753. return new Promise((resolve, reject) => {
  13754. request.call(this, opts, (err, data) => {
  13755. return err ? reject(err) : resolve(data)
  13756. })
  13757. })
  13758. }
  13759. try {
  13760. this.dispatch(opts, new RequestHandler(opts, callback))
  13761. } catch (err) {
  13762. if (typeof callback !== 'function') {
  13763. throw err
  13764. }
  13765. const opaque = opts && opts.opaque
  13766. queueMicrotask(() => callback(err, { opaque }))
  13767. }
  13768. }
  13769. module.exports = request
  13770. module.exports.RequestHandler = RequestHandler
  13771. /***/ }),
  13772. /***/ 5395:
  13773. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13774. "use strict";
  13775. const { finished, PassThrough } = __nccwpck_require__(2781)
  13776. const {
  13777. InvalidArgumentError,
  13778. InvalidReturnValueError,
  13779. RequestAbortedError
  13780. } = __nccwpck_require__(8045)
  13781. const util = __nccwpck_require__(3983)
  13782. const { getResolveErrorBodyCallback } = __nccwpck_require__(7474)
  13783. const { AsyncResource } = __nccwpck_require__(852)
  13784. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  13785. class StreamHandler extends AsyncResource {
  13786. constructor (opts, factory, callback) {
  13787. if (!opts || typeof opts !== 'object') {
  13788. throw new InvalidArgumentError('invalid opts')
  13789. }
  13790. const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError } = opts
  13791. try {
  13792. if (typeof callback !== 'function') {
  13793. throw new InvalidArgumentError('invalid callback')
  13794. }
  13795. if (typeof factory !== 'function') {
  13796. throw new InvalidArgumentError('invalid factory')
  13797. }
  13798. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  13799. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  13800. }
  13801. if (method === 'CONNECT') {
  13802. throw new InvalidArgumentError('invalid method')
  13803. }
  13804. if (onInfo && typeof onInfo !== 'function') {
  13805. throw new InvalidArgumentError('invalid onInfo callback')
  13806. }
  13807. super('UNDICI_STREAM')
  13808. } catch (err) {
  13809. if (util.isStream(body)) {
  13810. util.destroy(body.on('error', util.nop), err)
  13811. }
  13812. throw err
  13813. }
  13814. this.responseHeaders = responseHeaders || null
  13815. this.opaque = opaque || null
  13816. this.factory = factory
  13817. this.callback = callback
  13818. this.res = null
  13819. this.abort = null
  13820. this.context = null
  13821. this.trailers = null
  13822. this.body = body
  13823. this.onInfo = onInfo || null
  13824. this.throwOnError = throwOnError || false
  13825. if (util.isStream(body)) {
  13826. body.on('error', (err) => {
  13827. this.onError(err)
  13828. })
  13829. }
  13830. addSignal(this, signal)
  13831. }
  13832. onConnect (abort, context) {
  13833. if (!this.callback) {
  13834. throw new RequestAbortedError()
  13835. }
  13836. this.abort = abort
  13837. this.context = context
  13838. }
  13839. onHeaders (statusCode, rawHeaders, resume, statusMessage) {
  13840. const { factory, opaque, context, callback, responseHeaders } = this
  13841. const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13842. if (statusCode < 200) {
  13843. if (this.onInfo) {
  13844. this.onInfo({ statusCode, headers })
  13845. }
  13846. return
  13847. }
  13848. this.factory = null
  13849. let res
  13850. if (this.throwOnError && statusCode >= 400) {
  13851. const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers
  13852. const contentType = parsedHeaders['content-type']
  13853. res = new PassThrough()
  13854. this.callback = null
  13855. this.runInAsyncScope(getResolveErrorBodyCallback, null,
  13856. { callback, body: res, contentType, statusCode, statusMessage, headers }
  13857. )
  13858. } else {
  13859. if (factory === null) {
  13860. return
  13861. }
  13862. res = this.runInAsyncScope(factory, null, {
  13863. statusCode,
  13864. headers,
  13865. opaque,
  13866. context
  13867. })
  13868. if (
  13869. !res ||
  13870. typeof res.write !== 'function' ||
  13871. typeof res.end !== 'function' ||
  13872. typeof res.on !== 'function'
  13873. ) {
  13874. throw new InvalidReturnValueError('expected Writable')
  13875. }
  13876. // TODO: Avoid finished. It registers an unnecessary amount of listeners.
  13877. finished(res, { readable: false }, (err) => {
  13878. const { callback, res, opaque, trailers, abort } = this
  13879. this.res = null
  13880. if (err || !res.readable) {
  13881. util.destroy(res, err)
  13882. }
  13883. this.callback = null
  13884. this.runInAsyncScope(callback, null, err || null, { opaque, trailers })
  13885. if (err) {
  13886. abort()
  13887. }
  13888. })
  13889. }
  13890. res.on('drain', resume)
  13891. this.res = res
  13892. const needDrain = res.writableNeedDrain !== undefined
  13893. ? res.writableNeedDrain
  13894. : res._writableState && res._writableState.needDrain
  13895. return needDrain !== true
  13896. }
  13897. onData (chunk) {
  13898. const { res } = this
  13899. return res ? res.write(chunk) : true
  13900. }
  13901. onComplete (trailers) {
  13902. const { res } = this
  13903. removeSignal(this)
  13904. if (!res) {
  13905. return
  13906. }
  13907. this.trailers = util.parseHeaders(trailers)
  13908. res.end()
  13909. }
  13910. onError (err) {
  13911. const { res, callback, opaque, body } = this
  13912. removeSignal(this)
  13913. this.factory = null
  13914. if (res) {
  13915. this.res = null
  13916. util.destroy(res, err)
  13917. } else if (callback) {
  13918. this.callback = null
  13919. queueMicrotask(() => {
  13920. this.runInAsyncScope(callback, null, err, { opaque })
  13921. })
  13922. }
  13923. if (body) {
  13924. this.body = null
  13925. util.destroy(body, err)
  13926. }
  13927. }
  13928. }
  13929. function stream (opts, factory, callback) {
  13930. if (callback === undefined) {
  13931. return new Promise((resolve, reject) => {
  13932. stream.call(this, opts, factory, (err, data) => {
  13933. return err ? reject(err) : resolve(data)
  13934. })
  13935. })
  13936. }
  13937. try {
  13938. this.dispatch(opts, new StreamHandler(opts, factory, callback))
  13939. } catch (err) {
  13940. if (typeof callback !== 'function') {
  13941. throw err
  13942. }
  13943. const opaque = opts && opts.opaque
  13944. queueMicrotask(() => callback(err, { opaque }))
  13945. }
  13946. }
  13947. module.exports = stream
  13948. /***/ }),
  13949. /***/ 6923:
  13950. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  13951. "use strict";
  13952. const { InvalidArgumentError, RequestAbortedError, SocketError } = __nccwpck_require__(8045)
  13953. const { AsyncResource } = __nccwpck_require__(852)
  13954. const util = __nccwpck_require__(3983)
  13955. const { addSignal, removeSignal } = __nccwpck_require__(7032)
  13956. const assert = __nccwpck_require__(9491)
  13957. class UpgradeHandler extends AsyncResource {
  13958. constructor (opts, callback) {
  13959. if (!opts || typeof opts !== 'object') {
  13960. throw new InvalidArgumentError('invalid opts')
  13961. }
  13962. if (typeof callback !== 'function') {
  13963. throw new InvalidArgumentError('invalid callback')
  13964. }
  13965. const { signal, opaque, responseHeaders } = opts
  13966. if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {
  13967. throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')
  13968. }
  13969. super('UNDICI_UPGRADE')
  13970. this.responseHeaders = responseHeaders || null
  13971. this.opaque = opaque || null
  13972. this.callback = callback
  13973. this.abort = null
  13974. this.context = null
  13975. addSignal(this, signal)
  13976. }
  13977. onConnect (abort, context) {
  13978. if (!this.callback) {
  13979. throw new RequestAbortedError()
  13980. }
  13981. this.abort = abort
  13982. this.context = null
  13983. }
  13984. onHeaders () {
  13985. throw new SocketError('bad upgrade', null)
  13986. }
  13987. onUpgrade (statusCode, rawHeaders, socket) {
  13988. const { callback, opaque, context } = this
  13989. assert.strictEqual(statusCode, 101)
  13990. removeSignal(this)
  13991. this.callback = null
  13992. const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)
  13993. this.runInAsyncScope(callback, null, null, {
  13994. headers,
  13995. socket,
  13996. opaque,
  13997. context
  13998. })
  13999. }
  14000. onError (err) {
  14001. const { callback, opaque } = this
  14002. removeSignal(this)
  14003. if (callback) {
  14004. this.callback = null
  14005. queueMicrotask(() => {
  14006. this.runInAsyncScope(callback, null, err, { opaque })
  14007. })
  14008. }
  14009. }
  14010. }
  14011. function upgrade (opts, callback) {
  14012. if (callback === undefined) {
  14013. return new Promise((resolve, reject) => {
  14014. upgrade.call(this, opts, (err, data) => {
  14015. return err ? reject(err) : resolve(data)
  14016. })
  14017. })
  14018. }
  14019. try {
  14020. const upgradeHandler = new UpgradeHandler(opts, callback)
  14021. this.dispatch({
  14022. ...opts,
  14023. method: opts.method || 'GET',
  14024. upgrade: opts.protocol || 'Websocket'
  14025. }, upgradeHandler)
  14026. } catch (err) {
  14027. if (typeof callback !== 'function') {
  14028. throw err
  14029. }
  14030. const opaque = opts && opts.opaque
  14031. queueMicrotask(() => callback(err, { opaque }))
  14032. }
  14033. }
  14034. module.exports = upgrade
  14035. /***/ }),
  14036. /***/ 4059:
  14037. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  14038. "use strict";
  14039. module.exports.request = __nccwpck_require__(5448)
  14040. module.exports.stream = __nccwpck_require__(5395)
  14041. module.exports.pipeline = __nccwpck_require__(8752)
  14042. module.exports.upgrade = __nccwpck_require__(6923)
  14043. module.exports.connect = __nccwpck_require__(9744)
  14044. /***/ }),
  14045. /***/ 3858:
  14046. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  14047. "use strict";
  14048. // Ported from https://github.com/nodejs/undici/pull/907
  14049. const assert = __nccwpck_require__(9491)
  14050. const { Readable } = __nccwpck_require__(2781)
  14051. const { RequestAbortedError, NotSupportedError, InvalidArgumentError } = __nccwpck_require__(8045)
  14052. const util = __nccwpck_require__(3983)
  14053. const { ReadableStreamFrom, toUSVString } = __nccwpck_require__(3983)
  14054. let Blob
  14055. const kConsume = Symbol('kConsume')
  14056. const kReading = Symbol('kReading')
  14057. const kBody = Symbol('kBody')
  14058. const kAbort = Symbol('abort')
  14059. const kContentType = Symbol('kContentType')
  14060. const noop = () => {}
  14061. module.exports = class BodyReadable extends Readable {
  14062. constructor ({
  14063. resume,
  14064. abort,
  14065. contentType = '',
  14066. highWaterMark = 64 * 1024 // Same as nodejs fs streams.
  14067. }) {
  14068. super({
  14069. autoDestroy: true,
  14070. read: resume,
  14071. highWaterMark
  14072. })
  14073. this._readableState.dataEmitted = false
  14074. this[kAbort] = abort
  14075. this[kConsume] = null
  14076. this[kBody] = null
  14077. this[kContentType] = contentType
  14078. // Is stream being consumed through Readable API?
  14079. // This is an optimization so that we avoid checking
  14080. // for 'data' and 'readable' listeners in the hot path
  14081. // inside push().
  14082. this[kReading] = false
  14083. }
  14084. destroy (err) {
  14085. if (this.destroyed) {
  14086. // Node < 16
  14087. return this
  14088. }
  14089. if (!err && !this._readableState.endEmitted) {
  14090. err = new RequestAbortedError()
  14091. }
  14092. if (err) {
  14093. this[kAbort]()
  14094. }
  14095. return super.destroy(err)
  14096. }
  14097. emit (ev, ...args) {
  14098. if (ev === 'data') {
  14099. // Node < 16.7
  14100. this._readableState.dataEmitted = true
  14101. } else if (ev === 'error') {
  14102. // Node < 16
  14103. this._readableState.errorEmitted = true
  14104. }
  14105. return super.emit(ev, ...args)
  14106. }
  14107. on (ev, ...args) {
  14108. if (ev === 'data' || ev === 'readable') {
  14109. this[kReading] = true
  14110. }
  14111. return super.on(ev, ...args)
  14112. }
  14113. addListener (ev, ...args) {
  14114. return this.on(ev, ...args)
  14115. }
  14116. off (ev, ...args) {
  14117. const ret = super.off(ev, ...args)
  14118. if (ev === 'data' || ev === 'readable') {
  14119. this[kReading] = (
  14120. this.listenerCount('data') > 0 ||
  14121. this.listenerCount('readable') > 0
  14122. )
  14123. }
  14124. return ret
  14125. }
  14126. removeListener (ev, ...args) {
  14127. return this.off(ev, ...args)
  14128. }
  14129. push (chunk) {
  14130. if (this[kConsume] && chunk !== null && this.readableLength === 0) {
  14131. consumePush(this[kConsume], chunk)
  14132. return this[kReading] ? super.push(chunk) : true
  14133. }
  14134. return super.push(chunk)
  14135. }
  14136. // https://fetch.spec.whatwg.org/#dom-body-text
  14137. async text () {
  14138. return consume(this, 'text')
  14139. }
  14140. // https://fetch.spec.whatwg.org/#dom-body-json
  14141. async json () {
  14142. return consume(this, 'json')
  14143. }
  14144. // https://fetch.spec.whatwg.org/#dom-body-blob
  14145. async blob () {
  14146. return consume(this, 'blob')
  14147. }
  14148. // https://fetch.spec.whatwg.org/#dom-body-arraybuffer
  14149. async arrayBuffer () {
  14150. return consume(this, 'arrayBuffer')
  14151. }
  14152. // https://fetch.spec.whatwg.org/#dom-body-formdata
  14153. async formData () {
  14154. // TODO: Implement.
  14155. throw new NotSupportedError()
  14156. }
  14157. // https://fetch.spec.whatwg.org/#dom-body-bodyused
  14158. get bodyUsed () {
  14159. return util.isDisturbed(this)
  14160. }
  14161. // https://fetch.spec.whatwg.org/#dom-body-body
  14162. get body () {
  14163. if (!this[kBody]) {
  14164. this[kBody] = ReadableStreamFrom(this)
  14165. if (this[kConsume]) {
  14166. // TODO: Is this the best way to force a lock?
  14167. this[kBody].getReader() // Ensure stream is locked.
  14168. assert(this[kBody].locked)
  14169. }
  14170. }
  14171. return this[kBody]
  14172. }
  14173. dump (opts) {
  14174. let limit = opts && Number.isFinite(opts.limit) ? opts.limit : 262144
  14175. const signal = opts && opts.signal
  14176. if (signal) {
  14177. try {
  14178. if (typeof signal !== 'object' || !('aborted' in signal)) {
  14179. throw new InvalidArgumentError('signal must be an AbortSignal')
  14180. }
  14181. util.throwIfAborted(signal)
  14182. } catch (err) {
  14183. return Promise.reject(err)
  14184. }
  14185. }
  14186. if (this.closed) {
  14187. return Promise.resolve(null)
  14188. }
  14189. return new Promise((resolve, reject) => {
  14190. const signalListenerCleanup = signal
  14191. ? util.addAbortListener(signal, () => {
  14192. this.destroy()
  14193. })
  14194. : noop
  14195. this
  14196. .on('close', function () {
  14197. signalListenerCleanup()
  14198. if (signal && signal.aborted) {
  14199. reject(signal.reason || Object.assign(new Error('The operation was aborted'), { name: 'AbortError' }))
  14200. } else {
  14201. resolve(null)
  14202. }
  14203. })
  14204. .on('error', noop)
  14205. .on('data', function (chunk) {
  14206. limit -= chunk.length
  14207. if (limit <= 0) {
  14208. this.destroy()
  14209. }
  14210. })
  14211. .resume()
  14212. })
  14213. }
  14214. }
  14215. // https://streams.spec.whatwg.org/#readablestream-locked
  14216. function isLocked (self) {
  14217. // Consume is an implicit lock.
  14218. return (self[kBody] && self[kBody].locked === true) || self[kConsume]
  14219. }
  14220. // https://fetch.spec.whatwg.org/#body-unusable
  14221. function isUnusable (self) {
  14222. return util.isDisturbed(self) || isLocked(self)
  14223. }
  14224. async function consume (stream, type) {
  14225. if (isUnusable(stream)) {
  14226. throw new TypeError('unusable')
  14227. }
  14228. assert(!stream[kConsume])
  14229. return new Promise((resolve, reject) => {
  14230. stream[kConsume] = {
  14231. type,
  14232. stream,
  14233. resolve,
  14234. reject,
  14235. length: 0,
  14236. body: []
  14237. }
  14238. stream
  14239. .on('error', function (err) {
  14240. consumeFinish(this[kConsume], err)
  14241. })
  14242. .on('close', function () {
  14243. if (this[kConsume].body !== null) {
  14244. consumeFinish(this[kConsume], new RequestAbortedError())
  14245. }
  14246. })
  14247. process.nextTick(consumeStart, stream[kConsume])
  14248. })
  14249. }
  14250. function consumeStart (consume) {
  14251. if (consume.body === null) {
  14252. return
  14253. }
  14254. const { _readableState: state } = consume.stream
  14255. for (const chunk of state.buffer) {
  14256. consumePush(consume, chunk)
  14257. }
  14258. if (state.endEmitted) {
  14259. consumeEnd(this[kConsume])
  14260. } else {
  14261. consume.stream.on('end', function () {
  14262. consumeEnd(this[kConsume])
  14263. })
  14264. }
  14265. consume.stream.resume()
  14266. while (consume.stream.read() != null) {
  14267. // Loop
  14268. }
  14269. }
  14270. function consumeEnd (consume) {
  14271. const { type, body, resolve, stream, length } = consume
  14272. try {
  14273. if (type === 'text') {
  14274. resolve(toUSVString(Buffer.concat(body)))
  14275. } else if (type === 'json') {
  14276. resolve(JSON.parse(Buffer.concat(body)))
  14277. } else if (type === 'arrayBuffer') {
  14278. const dst = new Uint8Array(length)
  14279. let pos = 0
  14280. for (const buf of body) {
  14281. dst.set(buf, pos)
  14282. pos += buf.byteLength
  14283. }
  14284. resolve(dst.buffer)
  14285. } else if (type === 'blob') {
  14286. if (!Blob) {
  14287. Blob = (__nccwpck_require__(4300).Blob)
  14288. }
  14289. resolve(new Blob(body, { type: stream[kContentType] }))
  14290. }
  14291. consumeFinish(consume)
  14292. } catch (err) {
  14293. stream.destroy(err)
  14294. }
  14295. }
  14296. function consumePush (consume, chunk) {
  14297. consume.length += chunk.length
  14298. consume.body.push(chunk)
  14299. }
  14300. function consumeFinish (consume, err) {
  14301. if (consume.body === null) {
  14302. return
  14303. }
  14304. if (err) {
  14305. consume.reject(err)
  14306. } else {
  14307. consume.resolve()
  14308. }
  14309. consume.type = null
  14310. consume.stream = null
  14311. consume.resolve = null
  14312. consume.reject = null
  14313. consume.length = 0
  14314. consume.body = null
  14315. }
  14316. /***/ }),
  14317. /***/ 7474:
  14318. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  14319. const assert = __nccwpck_require__(9491)
  14320. const {
  14321. ResponseStatusCodeError
  14322. } = __nccwpck_require__(8045)
  14323. const { toUSVString } = __nccwpck_require__(3983)
  14324. async function getResolveErrorBodyCallback ({ callback, body, contentType, statusCode, statusMessage, headers }) {
  14325. assert(body)
  14326. let chunks = []
  14327. let limit = 0
  14328. for await (const chunk of body) {
  14329. chunks.push(chunk)
  14330. limit += chunk.length
  14331. if (limit > 128 * 1024) {
  14332. chunks = null
  14333. break
  14334. }
  14335. }
  14336. if (statusCode === 204 || !contentType || !chunks) {
  14337. process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers))
  14338. return
  14339. }
  14340. try {
  14341. if (contentType.startsWith('application/json')) {
  14342. const payload = JSON.parse(toUSVString(Buffer.concat(chunks)))
  14343. process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers, payload))
  14344. return
  14345. }
  14346. if (contentType.startsWith('text/')) {
  14347. const payload = toUSVString(Buffer.concat(chunks))
  14348. process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers, payload))
  14349. return
  14350. }
  14351. } catch (err) {
  14352. // Process in a fallback if error
  14353. }
  14354. process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers))
  14355. }
  14356. module.exports = { getResolveErrorBodyCallback }
  14357. /***/ }),
  14358. /***/ 7931:
  14359. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  14360. "use strict";
  14361. const {
  14362. BalancedPoolMissingUpstreamError,
  14363. InvalidArgumentError
  14364. } = __nccwpck_require__(8045)
  14365. const {
  14366. PoolBase,
  14367. kClients,
  14368. kNeedDrain,
  14369. kAddClient,
  14370. kRemoveClient,
  14371. kGetDispatcher
  14372. } = __nccwpck_require__(3198)
  14373. const Pool = __nccwpck_require__(4634)
  14374. const { kUrl, kInterceptors } = __nccwpck_require__(2785)
  14375. const { parseOrigin } = __nccwpck_require__(3983)
  14376. const kFactory = Symbol('factory')
  14377. const kOptions = Symbol('options')
  14378. const kGreatestCommonDivisor = Symbol('kGreatestCommonDivisor')
  14379. const kCurrentWeight = Symbol('kCurrentWeight')
  14380. const kIndex = Symbol('kIndex')
  14381. const kWeight = Symbol('kWeight')
  14382. const kMaxWeightPerServer = Symbol('kMaxWeightPerServer')
  14383. const kErrorPenalty = Symbol('kErrorPenalty')
  14384. function getGreatestCommonDivisor (a, b) {
  14385. if (b === 0) return a
  14386. return getGreatestCommonDivisor(b, a % b)
  14387. }
  14388. function defaultFactory (origin, opts) {
  14389. return new Pool(origin, opts)
  14390. }
  14391. class BalancedPool extends PoolBase {
  14392. constructor (upstreams = [], { factory = defaultFactory, ...opts } = {}) {
  14393. super()
  14394. this[kOptions] = opts
  14395. this[kIndex] = -1
  14396. this[kCurrentWeight] = 0
  14397. this[kMaxWeightPerServer] = this[kOptions].maxWeightPerServer || 100
  14398. this[kErrorPenalty] = this[kOptions].errorPenalty || 15
  14399. if (!Array.isArray(upstreams)) {
  14400. upstreams = [upstreams]
  14401. }
  14402. if (typeof factory !== 'function') {
  14403. throw new InvalidArgumentError('factory must be a function.')
  14404. }
  14405. this[kInterceptors] = opts.interceptors && opts.interceptors.BalancedPool && Array.isArray(opts.interceptors.BalancedPool)
  14406. ? opts.interceptors.BalancedPool
  14407. : []
  14408. this[kFactory] = factory
  14409. for (const upstream of upstreams) {
  14410. this.addUpstream(upstream)
  14411. }
  14412. this._updateBalancedPoolStats()
  14413. }
  14414. addUpstream (upstream) {
  14415. const upstreamOrigin = parseOrigin(upstream).origin
  14416. if (this[kClients].find((pool) => (
  14417. pool[kUrl].origin === upstreamOrigin &&
  14418. pool.closed !== true &&
  14419. pool.destroyed !== true
  14420. ))) {
  14421. return this
  14422. }
  14423. const pool = this[kFactory](upstreamOrigin, Object.assign({}, this[kOptions]))
  14424. this[kAddClient](pool)
  14425. pool.on('connect', () => {
  14426. pool[kWeight] = Math.min(this[kMaxWeightPerServer], pool[kWeight] + this[kErrorPenalty])
  14427. })
  14428. pool.on('connectionError', () => {
  14429. pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty])
  14430. this._updateBalancedPoolStats()
  14431. })
  14432. pool.on('disconnect', (...args) => {
  14433. const err = args[2]
  14434. if (err && err.code === 'UND_ERR_SOCKET') {
  14435. // decrease the weight of the pool.
  14436. pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty])
  14437. this._updateBalancedPoolStats()
  14438. }
  14439. })
  14440. for (const client of this[kClients]) {
  14441. client[kWeight] = this[kMaxWeightPerServer]
  14442. }
  14443. this._updateBalancedPoolStats()
  14444. return this
  14445. }
  14446. _updateBalancedPoolStats () {
  14447. this[kGreatestCommonDivisor] = this[kClients].map(p => p[kWeight]).reduce(getGreatestCommonDivisor, 0)
  14448. }
  14449. removeUpstream (upstream) {
  14450. const upstreamOrigin = parseOrigin(upstream).origin
  14451. const pool = this[kClients].find((pool) => (
  14452. pool[kUrl].origin === upstreamOrigin &&
  14453. pool.closed !== true &&
  14454. pool.destroyed !== true
  14455. ))
  14456. if (pool) {
  14457. this[kRemoveClient](pool)
  14458. }
  14459. return this
  14460. }
  14461. get upstreams () {
  14462. return this[kClients]
  14463. .filter(dispatcher => dispatcher.closed !== true && dispatcher.destroyed !== true)
  14464. .map((p) => p[kUrl].origin)
  14465. }
  14466. [kGetDispatcher] () {
  14467. // We validate that pools is greater than 0,
  14468. // otherwise we would have to wait until an upstream
  14469. // is added, which might never happen.
  14470. if (this[kClients].length === 0) {
  14471. throw new BalancedPoolMissingUpstreamError()
  14472. }
  14473. const dispatcher = this[kClients].find(dispatcher => (
  14474. !dispatcher[kNeedDrain] &&
  14475. dispatcher.closed !== true &&
  14476. dispatcher.destroyed !== true
  14477. ))
  14478. if (!dispatcher) {
  14479. return
  14480. }
  14481. const allClientsBusy = this[kClients].map(pool => pool[kNeedDrain]).reduce((a, b) => a && b, true)
  14482. if (allClientsBusy) {
  14483. return
  14484. }
  14485. let counter = 0
  14486. let maxWeightIndex = this[kClients].findIndex(pool => !pool[kNeedDrain])
  14487. while (counter++ < this[kClients].length) {
  14488. this[kIndex] = (this[kIndex] + 1) % this[kClients].length
  14489. const pool = this[kClients][this[kIndex]]
  14490. // find pool index with the largest weight
  14491. if (pool[kWeight] > this[kClients][maxWeightIndex][kWeight] && !pool[kNeedDrain]) {
  14492. maxWeightIndex = this[kIndex]
  14493. }
  14494. // decrease the current weight every `this[kClients].length`.
  14495. if (this[kIndex] === 0) {
  14496. // Set the current weight to the next lower weight.
  14497. this[kCurrentWeight] = this[kCurrentWeight] - this[kGreatestCommonDivisor]
  14498. if (this[kCurrentWeight] <= 0) {
  14499. this[kCurrentWeight] = this[kMaxWeightPerServer]
  14500. }
  14501. }
  14502. if (pool[kWeight] >= this[kCurrentWeight] && (!pool[kNeedDrain])) {
  14503. return pool
  14504. }
  14505. }
  14506. this[kCurrentWeight] = this[kClients][maxWeightIndex][kWeight]
  14507. this[kIndex] = maxWeightIndex
  14508. return this[kClients][maxWeightIndex]
  14509. }
  14510. }
  14511. module.exports = BalancedPool
  14512. /***/ }),
  14513. /***/ 6101:
  14514. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  14515. "use strict";
  14516. const { kConstruct } = __nccwpck_require__(9174)
  14517. const { urlEquals, fieldValues: getFieldValues } = __nccwpck_require__(2396)
  14518. const { kEnumerableProperty, isDisturbed } = __nccwpck_require__(3983)
  14519. const { kHeadersList } = __nccwpck_require__(2785)
  14520. const { webidl } = __nccwpck_require__(1744)
  14521. const { Response, cloneResponse } = __nccwpck_require__(7823)
  14522. const { Request } = __nccwpck_require__(8359)
  14523. const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(5861)
  14524. const { fetching } = __nccwpck_require__(4881)
  14525. const { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = __nccwpck_require__(2538)
  14526. const assert = __nccwpck_require__(9491)
  14527. const { getGlobalDispatcher } = __nccwpck_require__(1892)
  14528. /**
  14529. * @see https://w3c.github.io/ServiceWorker/#dfn-cache-batch-operation
  14530. * @typedef {Object} CacheBatchOperation
  14531. * @property {'delete' | 'put'} type
  14532. * @property {any} request
  14533. * @property {any} response
  14534. * @property {import('../../types/cache').CacheQueryOptions} options
  14535. */
  14536. /**
  14537. * @see https://w3c.github.io/ServiceWorker/#dfn-request-response-list
  14538. * @typedef {[any, any][]} requestResponseList
  14539. */
  14540. class Cache {
  14541. /**
  14542. * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-request-response-list
  14543. * @type {requestResponseList}
  14544. */
  14545. #relevantRequestResponseList
  14546. constructor () {
  14547. if (arguments[0] !== kConstruct) {
  14548. webidl.illegalConstructor()
  14549. }
  14550. this.#relevantRequestResponseList = arguments[1]
  14551. }
  14552. async match (request, options = {}) {
  14553. webidl.brandCheck(this, Cache)
  14554. webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.match' })
  14555. request = webidl.converters.RequestInfo(request)
  14556. options = webidl.converters.CacheQueryOptions(options)
  14557. const p = await this.matchAll(request, options)
  14558. if (p.length === 0) {
  14559. return
  14560. }
  14561. return p[0]
  14562. }
  14563. async matchAll (request = undefined, options = {}) {
  14564. webidl.brandCheck(this, Cache)
  14565. if (request !== undefined) request = webidl.converters.RequestInfo(request)
  14566. options = webidl.converters.CacheQueryOptions(options)
  14567. // 1.
  14568. let r = null
  14569. // 2.
  14570. if (request !== undefined) {
  14571. if (request instanceof Request) {
  14572. // 2.1.1
  14573. r = request[kState]
  14574. // 2.1.2
  14575. if (r.method !== 'GET' && !options.ignoreMethod) {
  14576. return []
  14577. }
  14578. } else if (typeof request === 'string') {
  14579. // 2.2.1
  14580. r = new Request(request)[kState]
  14581. }
  14582. }
  14583. // 5.
  14584. // 5.1
  14585. const responses = []
  14586. // 5.2
  14587. if (request === undefined) {
  14588. // 5.2.1
  14589. for (const requestResponse of this.#relevantRequestResponseList) {
  14590. responses.push(requestResponse[1])
  14591. }
  14592. } else { // 5.3
  14593. // 5.3.1
  14594. const requestResponses = this.#queryCache(r, options)
  14595. // 5.3.2
  14596. for (const requestResponse of requestResponses) {
  14597. responses.push(requestResponse[1])
  14598. }
  14599. }
  14600. // 5.4
  14601. // We don't implement CORs so we don't need to loop over the responses, yay!
  14602. // 5.5.1
  14603. const responseList = []
  14604. // 5.5.2
  14605. for (const response of responses) {
  14606. // 5.5.2.1
  14607. const responseObject = new Response(response.body?.source ?? null)
  14608. const body = responseObject[kState].body
  14609. responseObject[kState] = response
  14610. responseObject[kState].body = body
  14611. responseObject[kHeaders][kHeadersList] = response.headersList
  14612. responseObject[kHeaders][kGuard] = 'immutable'
  14613. responseList.push(responseObject)
  14614. }
  14615. // 6.
  14616. return Object.freeze(responseList)
  14617. }
  14618. async add (request) {
  14619. webidl.brandCheck(this, Cache)
  14620. webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.add' })
  14621. request = webidl.converters.RequestInfo(request)
  14622. // 1.
  14623. const requests = [request]
  14624. // 2.
  14625. const responseArrayPromise = this.addAll(requests)
  14626. // 3.
  14627. return await responseArrayPromise
  14628. }
  14629. async addAll (requests) {
  14630. webidl.brandCheck(this, Cache)
  14631. webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.addAll' })
  14632. requests = webidl.converters['sequence<RequestInfo>'](requests)
  14633. // 1.
  14634. const responsePromises = []
  14635. // 2.
  14636. const requestList = []
  14637. // 3.
  14638. for (const request of requests) {
  14639. if (typeof request === 'string') {
  14640. continue
  14641. }
  14642. // 3.1
  14643. const r = request[kState]
  14644. // 3.2
  14645. if (!urlIsHttpHttpsScheme(r.url) || r.method !== 'GET') {
  14646. throw webidl.errors.exception({
  14647. header: 'Cache.addAll',
  14648. message: 'Expected http/s scheme when method is not GET.'
  14649. })
  14650. }
  14651. }
  14652. // 4.
  14653. /** @type {ReturnType<typeof fetching>[]} */
  14654. const fetchControllers = []
  14655. // 5.
  14656. for (const request of requests) {
  14657. // 5.1
  14658. const r = new Request(request)[kState]
  14659. // 5.2
  14660. if (!urlIsHttpHttpsScheme(r.url)) {
  14661. throw webidl.errors.exception({
  14662. header: 'Cache.addAll',
  14663. message: 'Expected http/s scheme.'
  14664. })
  14665. }
  14666. // 5.4
  14667. r.initiator = 'fetch'
  14668. r.destination = 'subresource'
  14669. // 5.5
  14670. requestList.push(r)
  14671. // 5.6
  14672. const responsePromise = createDeferredPromise()
  14673. // 5.7
  14674. fetchControllers.push(fetching({
  14675. request: r,
  14676. dispatcher: getGlobalDispatcher(),
  14677. processResponse (response) {
  14678. // 1.
  14679. if (response.type === 'error' || response.status === 206 || response.status < 200 || response.status > 299) {
  14680. responsePromise.reject(webidl.errors.exception({
  14681. header: 'Cache.addAll',
  14682. message: 'Received an invalid status code or the request failed.'
  14683. }))
  14684. } else if (response.headersList.contains('vary')) { // 2.
  14685. // 2.1
  14686. const fieldValues = getFieldValues(response.headersList.get('vary'))
  14687. // 2.2
  14688. for (const fieldValue of fieldValues) {
  14689. // 2.2.1
  14690. if (fieldValue === '*') {
  14691. responsePromise.reject(webidl.errors.exception({
  14692. header: 'Cache.addAll',
  14693. message: 'invalid vary field value'
  14694. }))
  14695. for (const controller of fetchControllers) {
  14696. controller.abort()
  14697. }
  14698. return
  14699. }
  14700. }
  14701. }
  14702. },
  14703. processResponseEndOfBody (response) {
  14704. // 1.
  14705. if (response.aborted) {
  14706. responsePromise.reject(new DOMException('aborted', 'AbortError'))
  14707. return
  14708. }
  14709. // 2.
  14710. responsePromise.resolve(response)
  14711. }
  14712. }))
  14713. // 5.8
  14714. responsePromises.push(responsePromise.promise)
  14715. }
  14716. // 6.
  14717. const p = Promise.all(responsePromises)
  14718. // 7.
  14719. const responses = await p
  14720. // 7.1
  14721. const operations = []
  14722. // 7.2
  14723. let index = 0
  14724. // 7.3
  14725. for (const response of responses) {
  14726. // 7.3.1
  14727. /** @type {CacheBatchOperation} */
  14728. const operation = {
  14729. type: 'put', // 7.3.2
  14730. request: requestList[index], // 7.3.3
  14731. response // 7.3.4
  14732. }
  14733. operations.push(operation) // 7.3.5
  14734. index++ // 7.3.6
  14735. }
  14736. // 7.5
  14737. const cacheJobPromise = createDeferredPromise()
  14738. // 7.6.1
  14739. let errorData = null
  14740. // 7.6.2
  14741. try {
  14742. this.#batchCacheOperations(operations)
  14743. } catch (e) {
  14744. errorData = e
  14745. }
  14746. // 7.6.3
  14747. queueMicrotask(() => {
  14748. // 7.6.3.1
  14749. if (errorData === null) {
  14750. cacheJobPromise.resolve(undefined)
  14751. } else {
  14752. // 7.6.3.2
  14753. cacheJobPromise.reject(errorData)
  14754. }
  14755. })
  14756. // 7.7
  14757. return cacheJobPromise.promise
  14758. }
  14759. async put (request, response) {
  14760. webidl.brandCheck(this, Cache)
  14761. webidl.argumentLengthCheck(arguments, 2, { header: 'Cache.put' })
  14762. request = webidl.converters.RequestInfo(request)
  14763. response = webidl.converters.Response(response)
  14764. // 1.
  14765. let innerRequest = null
  14766. // 2.
  14767. if (request instanceof Request) {
  14768. innerRequest = request[kState]
  14769. } else { // 3.
  14770. innerRequest = new Request(request)[kState]
  14771. }
  14772. // 4.
  14773. if (!urlIsHttpHttpsScheme(innerRequest.url) || innerRequest.method !== 'GET') {
  14774. throw webidl.errors.exception({
  14775. header: 'Cache.put',
  14776. message: 'Expected an http/s scheme when method is not GET'
  14777. })
  14778. }
  14779. // 5.
  14780. const innerResponse = response[kState]
  14781. // 6.
  14782. if (innerResponse.status === 206) {
  14783. throw webidl.errors.exception({
  14784. header: 'Cache.put',
  14785. message: 'Got 206 status'
  14786. })
  14787. }
  14788. // 7.
  14789. if (innerResponse.headersList.contains('vary')) {
  14790. // 7.1.
  14791. const fieldValues = getFieldValues(innerResponse.headersList.get('vary'))
  14792. // 7.2.
  14793. for (const fieldValue of fieldValues) {
  14794. // 7.2.1
  14795. if (fieldValue === '*') {
  14796. throw webidl.errors.exception({
  14797. header: 'Cache.put',
  14798. message: 'Got * vary field value'
  14799. })
  14800. }
  14801. }
  14802. }
  14803. // 8.
  14804. if (innerResponse.body && (isDisturbed(innerResponse.body.stream) || innerResponse.body.stream.locked)) {
  14805. throw webidl.errors.exception({
  14806. header: 'Cache.put',
  14807. message: 'Response body is locked or disturbed'
  14808. })
  14809. }
  14810. // 9.
  14811. const clonedResponse = cloneResponse(innerResponse)
  14812. // 10.
  14813. const bodyReadPromise = createDeferredPromise()
  14814. // 11.
  14815. if (innerResponse.body != null) {
  14816. // 11.1
  14817. const stream = innerResponse.body.stream
  14818. // 11.2
  14819. const reader = stream.getReader()
  14820. // 11.3
  14821. readAllBytes(reader).then(bodyReadPromise.resolve, bodyReadPromise.reject)
  14822. } else {
  14823. bodyReadPromise.resolve(undefined)
  14824. }
  14825. // 12.
  14826. /** @type {CacheBatchOperation[]} */
  14827. const operations = []
  14828. // 13.
  14829. /** @type {CacheBatchOperation} */
  14830. const operation = {
  14831. type: 'put', // 14.
  14832. request: innerRequest, // 15.
  14833. response: clonedResponse // 16.
  14834. }
  14835. // 17.
  14836. operations.push(operation)
  14837. // 19.
  14838. const bytes = await bodyReadPromise.promise
  14839. if (clonedResponse.body != null) {
  14840. clonedResponse.body.source = bytes
  14841. }
  14842. // 19.1
  14843. const cacheJobPromise = createDeferredPromise()
  14844. // 19.2.1
  14845. let errorData = null
  14846. // 19.2.2
  14847. try {
  14848. this.#batchCacheOperations(operations)
  14849. } catch (e) {
  14850. errorData = e
  14851. }
  14852. // 19.2.3
  14853. queueMicrotask(() => {
  14854. // 19.2.3.1
  14855. if (errorData === null) {
  14856. cacheJobPromise.resolve()
  14857. } else { // 19.2.3.2
  14858. cacheJobPromise.reject(errorData)
  14859. }
  14860. })
  14861. return cacheJobPromise.promise
  14862. }
  14863. async delete (request, options = {}) {
  14864. webidl.brandCheck(this, Cache)
  14865. webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.delete' })
  14866. request = webidl.converters.RequestInfo(request)
  14867. options = webidl.converters.CacheQueryOptions(options)
  14868. /**
  14869. * @type {Request}
  14870. */
  14871. let r = null
  14872. if (request instanceof Request) {
  14873. r = request[kState]
  14874. if (r.method !== 'GET' && !options.ignoreMethod) {
  14875. return false
  14876. }
  14877. } else {
  14878. assert(typeof request === 'string')
  14879. r = new Request(request)[kState]
  14880. }
  14881. /** @type {CacheBatchOperation[]} */
  14882. const operations = []
  14883. /** @type {CacheBatchOperation} */
  14884. const operation = {
  14885. type: 'delete',
  14886. request: r,
  14887. options
  14888. }
  14889. operations.push(operation)
  14890. const cacheJobPromise = createDeferredPromise()
  14891. let errorData = null
  14892. let requestResponses
  14893. try {
  14894. requestResponses = this.#batchCacheOperations(operations)
  14895. } catch (e) {
  14896. errorData = e
  14897. }
  14898. queueMicrotask(() => {
  14899. if (errorData === null) {
  14900. cacheJobPromise.resolve(!!requestResponses?.length)
  14901. } else {
  14902. cacheJobPromise.reject(errorData)
  14903. }
  14904. })
  14905. return cacheJobPromise.promise
  14906. }
  14907. /**
  14908. * @see https://w3c.github.io/ServiceWorker/#dom-cache-keys
  14909. * @param {any} request
  14910. * @param {import('../../types/cache').CacheQueryOptions} options
  14911. * @returns {readonly Request[]}
  14912. */
  14913. async keys (request = undefined, options = {}) {
  14914. webidl.brandCheck(this, Cache)
  14915. if (request !== undefined) request = webidl.converters.RequestInfo(request)
  14916. options = webidl.converters.CacheQueryOptions(options)
  14917. // 1.
  14918. let r = null
  14919. // 2.
  14920. if (request !== undefined) {
  14921. // 2.1
  14922. if (request instanceof Request) {
  14923. // 2.1.1
  14924. r = request[kState]
  14925. // 2.1.2
  14926. if (r.method !== 'GET' && !options.ignoreMethod) {
  14927. return []
  14928. }
  14929. } else if (typeof request === 'string') { // 2.2
  14930. r = new Request(request)[kState]
  14931. }
  14932. }
  14933. // 4.
  14934. const promise = createDeferredPromise()
  14935. // 5.
  14936. // 5.1
  14937. const requests = []
  14938. // 5.2
  14939. if (request === undefined) {
  14940. // 5.2.1
  14941. for (const requestResponse of this.#relevantRequestResponseList) {
  14942. // 5.2.1.1
  14943. requests.push(requestResponse[0])
  14944. }
  14945. } else { // 5.3
  14946. // 5.3.1
  14947. const requestResponses = this.#queryCache(r, options)
  14948. // 5.3.2
  14949. for (const requestResponse of requestResponses) {
  14950. // 5.3.2.1
  14951. requests.push(requestResponse[0])
  14952. }
  14953. }
  14954. // 5.4
  14955. queueMicrotask(() => {
  14956. // 5.4.1
  14957. const requestList = []
  14958. // 5.4.2
  14959. for (const request of requests) {
  14960. const requestObject = new Request('https://a')
  14961. requestObject[kState] = request
  14962. requestObject[kHeaders][kHeadersList] = request.headersList
  14963. requestObject[kHeaders][kGuard] = 'immutable'
  14964. requestObject[kRealm] = request.client
  14965. // 5.4.2.1
  14966. requestList.push(requestObject)
  14967. }
  14968. // 5.4.3
  14969. promise.resolve(Object.freeze(requestList))
  14970. })
  14971. return promise.promise
  14972. }
  14973. /**
  14974. * @see https://w3c.github.io/ServiceWorker/#batch-cache-operations-algorithm
  14975. * @param {CacheBatchOperation[]} operations
  14976. * @returns {requestResponseList}
  14977. */
  14978. #batchCacheOperations (operations) {
  14979. // 1.
  14980. const cache = this.#relevantRequestResponseList
  14981. // 2.
  14982. const backupCache = [...cache]
  14983. // 3.
  14984. const addedItems = []
  14985. // 4.1
  14986. const resultList = []
  14987. try {
  14988. // 4.2
  14989. for (const operation of operations) {
  14990. // 4.2.1
  14991. if (operation.type !== 'delete' && operation.type !== 'put') {
  14992. throw webidl.errors.exception({
  14993. header: 'Cache.#batchCacheOperations',
  14994. message: 'operation type does not match "delete" or "put"'
  14995. })
  14996. }
  14997. // 4.2.2
  14998. if (operation.type === 'delete' && operation.response != null) {
  14999. throw webidl.errors.exception({
  15000. header: 'Cache.#batchCacheOperations',
  15001. message: 'delete operation should not have an associated response'
  15002. })
  15003. }
  15004. // 4.2.3
  15005. if (this.#queryCache(operation.request, operation.options, addedItems).length) {
  15006. throw new DOMException('???', 'InvalidStateError')
  15007. }
  15008. // 4.2.4
  15009. let requestResponses
  15010. // 4.2.5
  15011. if (operation.type === 'delete') {
  15012. // 4.2.5.1
  15013. requestResponses = this.#queryCache(operation.request, operation.options)
  15014. // TODO: the spec is wrong, this is needed to pass WPTs
  15015. if (requestResponses.length === 0) {
  15016. return []
  15017. }
  15018. // 4.2.5.2
  15019. for (const requestResponse of requestResponses) {
  15020. const idx = cache.indexOf(requestResponse)
  15021. assert(idx !== -1)
  15022. // 4.2.5.2.1
  15023. cache.splice(idx, 1)
  15024. }
  15025. } else if (operation.type === 'put') { // 4.2.6
  15026. // 4.2.6.1
  15027. if (operation.response == null) {
  15028. throw webidl.errors.exception({
  15029. header: 'Cache.#batchCacheOperations',
  15030. message: 'put operation should have an associated response'
  15031. })
  15032. }
  15033. // 4.2.6.2
  15034. const r = operation.request
  15035. // 4.2.6.3
  15036. if (!urlIsHttpHttpsScheme(r.url)) {
  15037. throw webidl.errors.exception({
  15038. header: 'Cache.#batchCacheOperations',
  15039. message: 'expected http or https scheme'
  15040. })
  15041. }
  15042. // 4.2.6.4
  15043. if (r.method !== 'GET') {
  15044. throw webidl.errors.exception({
  15045. header: 'Cache.#batchCacheOperations',
  15046. message: 'not get method'
  15047. })
  15048. }
  15049. // 4.2.6.5
  15050. if (operation.options != null) {
  15051. throw webidl.errors.exception({
  15052. header: 'Cache.#batchCacheOperations',
  15053. message: 'options must not be defined'
  15054. })
  15055. }
  15056. // 4.2.6.6
  15057. requestResponses = this.#queryCache(operation.request)
  15058. // 4.2.6.7
  15059. for (const requestResponse of requestResponses) {
  15060. const idx = cache.indexOf(requestResponse)
  15061. assert(idx !== -1)
  15062. // 4.2.6.7.1
  15063. cache.splice(idx, 1)
  15064. }
  15065. // 4.2.6.8
  15066. cache.push([operation.request, operation.response])
  15067. // 4.2.6.10
  15068. addedItems.push([operation.request, operation.response])
  15069. }
  15070. // 4.2.7
  15071. resultList.push([operation.request, operation.response])
  15072. }
  15073. // 4.3
  15074. return resultList
  15075. } catch (e) { // 5.
  15076. // 5.1
  15077. this.#relevantRequestResponseList.length = 0
  15078. // 5.2
  15079. this.#relevantRequestResponseList = backupCache
  15080. // 5.3
  15081. throw e
  15082. }
  15083. }
  15084. /**
  15085. * @see https://w3c.github.io/ServiceWorker/#query-cache
  15086. * @param {any} requestQuery
  15087. * @param {import('../../types/cache').CacheQueryOptions} options
  15088. * @param {requestResponseList} targetStorage
  15089. * @returns {requestResponseList}
  15090. */
  15091. #queryCache (requestQuery, options, targetStorage) {
  15092. /** @type {requestResponseList} */
  15093. const resultList = []
  15094. const storage = targetStorage ?? this.#relevantRequestResponseList
  15095. for (const requestResponse of storage) {
  15096. const [cachedRequest, cachedResponse] = requestResponse
  15097. if (this.#requestMatchesCachedItem(requestQuery, cachedRequest, cachedResponse, options)) {
  15098. resultList.push(requestResponse)
  15099. }
  15100. }
  15101. return resultList
  15102. }
  15103. /**
  15104. * @see https://w3c.github.io/ServiceWorker/#request-matches-cached-item-algorithm
  15105. * @param {any} requestQuery
  15106. * @param {any} request
  15107. * @param {any | null} response
  15108. * @param {import('../../types/cache').CacheQueryOptions | undefined} options
  15109. * @returns {boolean}
  15110. */
  15111. #requestMatchesCachedItem (requestQuery, request, response = null, options) {
  15112. // if (options?.ignoreMethod === false && request.method === 'GET') {
  15113. // return false
  15114. // }
  15115. const queryURL = new URL(requestQuery.url)
  15116. const cachedURL = new URL(request.url)
  15117. if (options?.ignoreSearch) {
  15118. cachedURL.search = ''
  15119. queryURL.search = ''
  15120. }
  15121. if (!urlEquals(queryURL, cachedURL, true)) {
  15122. return false
  15123. }
  15124. if (
  15125. response == null ||
  15126. options?.ignoreVary ||
  15127. !response.headersList.contains('vary')
  15128. ) {
  15129. return true
  15130. }
  15131. const fieldValues = getFieldValues(response.headersList.get('vary'))
  15132. for (const fieldValue of fieldValues) {
  15133. if (fieldValue === '*') {
  15134. return false
  15135. }
  15136. const requestValue = request.headersList.get(fieldValue)
  15137. const queryValue = requestQuery.headersList.get(fieldValue)
  15138. // If one has the header and the other doesn't, or one has
  15139. // a different value than the other, return false
  15140. if (requestValue !== queryValue) {
  15141. return false
  15142. }
  15143. }
  15144. return true
  15145. }
  15146. }
  15147. Object.defineProperties(Cache.prototype, {
  15148. [Symbol.toStringTag]: {
  15149. value: 'Cache',
  15150. configurable: true
  15151. },
  15152. match: kEnumerableProperty,
  15153. matchAll: kEnumerableProperty,
  15154. add: kEnumerableProperty,
  15155. addAll: kEnumerableProperty,
  15156. put: kEnumerableProperty,
  15157. delete: kEnumerableProperty,
  15158. keys: kEnumerableProperty
  15159. })
  15160. const cacheQueryOptionConverters = [
  15161. {
  15162. key: 'ignoreSearch',
  15163. converter: webidl.converters.boolean,
  15164. defaultValue: false
  15165. },
  15166. {
  15167. key: 'ignoreMethod',
  15168. converter: webidl.converters.boolean,
  15169. defaultValue: false
  15170. },
  15171. {
  15172. key: 'ignoreVary',
  15173. converter: webidl.converters.boolean,
  15174. defaultValue: false
  15175. }
  15176. ]
  15177. webidl.converters.CacheQueryOptions = webidl.dictionaryConverter(cacheQueryOptionConverters)
  15178. webidl.converters.MultiCacheQueryOptions = webidl.dictionaryConverter([
  15179. ...cacheQueryOptionConverters,
  15180. {
  15181. key: 'cacheName',
  15182. converter: webidl.converters.DOMString
  15183. }
  15184. ])
  15185. webidl.converters.Response = webidl.interfaceConverter(Response)
  15186. webidl.converters['sequence<RequestInfo>'] = webidl.sequenceConverter(
  15187. webidl.converters.RequestInfo
  15188. )
  15189. module.exports = {
  15190. Cache
  15191. }
  15192. /***/ }),
  15193. /***/ 7907:
  15194. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  15195. "use strict";
  15196. const { kConstruct } = __nccwpck_require__(9174)
  15197. const { Cache } = __nccwpck_require__(6101)
  15198. const { webidl } = __nccwpck_require__(1744)
  15199. const { kEnumerableProperty } = __nccwpck_require__(3983)
  15200. class CacheStorage {
  15201. /**
  15202. * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-name-to-cache-map
  15203. * @type {Map<string, import('./cache').requestResponseList}
  15204. */
  15205. #caches = new Map()
  15206. constructor () {
  15207. if (arguments[0] !== kConstruct) {
  15208. webidl.illegalConstructor()
  15209. }
  15210. }
  15211. async match (request, options = {}) {
  15212. webidl.brandCheck(this, CacheStorage)
  15213. webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.match' })
  15214. request = webidl.converters.RequestInfo(request)
  15215. options = webidl.converters.MultiCacheQueryOptions(options)
  15216. // 1.
  15217. if (options.cacheName != null) {
  15218. // 1.1.1.1
  15219. if (this.#caches.has(options.cacheName)) {
  15220. // 1.1.1.1.1
  15221. const cacheList = this.#caches.get(options.cacheName)
  15222. const cache = new Cache(kConstruct, cacheList)
  15223. return await cache.match(request, options)
  15224. }
  15225. } else { // 2.
  15226. // 2.2
  15227. for (const cacheList of this.#caches.values()) {
  15228. const cache = new Cache(kConstruct, cacheList)
  15229. // 2.2.1.2
  15230. const response = await cache.match(request, options)
  15231. if (response !== undefined) {
  15232. return response
  15233. }
  15234. }
  15235. }
  15236. }
  15237. /**
  15238. * @see https://w3c.github.io/ServiceWorker/#cache-storage-has
  15239. * @param {string} cacheName
  15240. * @returns {Promise<boolean>}
  15241. */
  15242. async has (cacheName) {
  15243. webidl.brandCheck(this, CacheStorage)
  15244. webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.has' })
  15245. cacheName = webidl.converters.DOMString(cacheName)
  15246. // 2.1.1
  15247. // 2.2
  15248. return this.#caches.has(cacheName)
  15249. }
  15250. /**
  15251. * @see https://w3c.github.io/ServiceWorker/#dom-cachestorage-open
  15252. * @param {string} cacheName
  15253. * @returns {Promise<Cache>}
  15254. */
  15255. async open (cacheName) {
  15256. webidl.brandCheck(this, CacheStorage)
  15257. webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.open' })
  15258. cacheName = webidl.converters.DOMString(cacheName)
  15259. // 2.1
  15260. if (this.#caches.has(cacheName)) {
  15261. // await caches.open('v1') !== await caches.open('v1')
  15262. // 2.1.1
  15263. const cache = this.#caches.get(cacheName)
  15264. // 2.1.1.1
  15265. return new Cache(kConstruct, cache)
  15266. }
  15267. // 2.2
  15268. const cache = []
  15269. // 2.3
  15270. this.#caches.set(cacheName, cache)
  15271. // 2.4
  15272. return new Cache(kConstruct, cache)
  15273. }
  15274. /**
  15275. * @see https://w3c.github.io/ServiceWorker/#cache-storage-delete
  15276. * @param {string} cacheName
  15277. * @returns {Promise<boolean>}
  15278. */
  15279. async delete (cacheName) {
  15280. webidl.brandCheck(this, CacheStorage)
  15281. webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.delete' })
  15282. cacheName = webidl.converters.DOMString(cacheName)
  15283. return this.#caches.delete(cacheName)
  15284. }
  15285. /**
  15286. * @see https://w3c.github.io/ServiceWorker/#cache-storage-keys
  15287. * @returns {string[]}
  15288. */
  15289. async keys () {
  15290. webidl.brandCheck(this, CacheStorage)
  15291. // 2.1
  15292. const keys = this.#caches.keys()
  15293. // 2.2
  15294. return [...keys]
  15295. }
  15296. }
  15297. Object.defineProperties(CacheStorage.prototype, {
  15298. [Symbol.toStringTag]: {
  15299. value: 'CacheStorage',
  15300. configurable: true
  15301. },
  15302. match: kEnumerableProperty,
  15303. has: kEnumerableProperty,
  15304. open: kEnumerableProperty,
  15305. delete: kEnumerableProperty,
  15306. keys: kEnumerableProperty
  15307. })
  15308. module.exports = {
  15309. CacheStorage
  15310. }
  15311. /***/ }),
  15312. /***/ 9174:
  15313. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  15314. "use strict";
  15315. module.exports = {
  15316. kConstruct: (__nccwpck_require__(2785).kConstruct)
  15317. }
  15318. /***/ }),
  15319. /***/ 2396:
  15320. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  15321. "use strict";
  15322. const assert = __nccwpck_require__(9491)
  15323. const { URLSerializer } = __nccwpck_require__(685)
  15324. const { isValidHeaderName } = __nccwpck_require__(2538)
  15325. /**
  15326. * @see https://url.spec.whatwg.org/#concept-url-equals
  15327. * @param {URL} A
  15328. * @param {URL} B
  15329. * @param {boolean | undefined} excludeFragment
  15330. * @returns {boolean}
  15331. */
  15332. function urlEquals (A, B, excludeFragment = false) {
  15333. const serializedA = URLSerializer(A, excludeFragment)
  15334. const serializedB = URLSerializer(B, excludeFragment)
  15335. return serializedA === serializedB
  15336. }
  15337. /**
  15338. * @see https://github.com/chromium/chromium/blob/694d20d134cb553d8d89e5500b9148012b1ba299/content/browser/cache_storage/cache_storage_cache.cc#L260-L262
  15339. * @param {string} header
  15340. */
  15341. function fieldValues (header) {
  15342. assert(header !== null)
  15343. const values = []
  15344. for (let value of header.split(',')) {
  15345. value = value.trim()
  15346. if (!value.length) {
  15347. continue
  15348. } else if (!isValidHeaderName(value)) {
  15349. continue
  15350. }
  15351. values.push(value)
  15352. }
  15353. return values
  15354. }
  15355. module.exports = {
  15356. urlEquals,
  15357. fieldValues
  15358. }
  15359. /***/ }),
  15360. /***/ 3598:
  15361. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  15362. "use strict";
  15363. // @ts-check
  15364. /* global WebAssembly */
  15365. const assert = __nccwpck_require__(9491)
  15366. const net = __nccwpck_require__(1808)
  15367. const http = __nccwpck_require__(3685)
  15368. const { pipeline } = __nccwpck_require__(2781)
  15369. const util = __nccwpck_require__(3983)
  15370. const timers = __nccwpck_require__(9459)
  15371. const Request = __nccwpck_require__(2905)
  15372. const DispatcherBase = __nccwpck_require__(4839)
  15373. const {
  15374. RequestContentLengthMismatchError,
  15375. ResponseContentLengthMismatchError,
  15376. InvalidArgumentError,
  15377. RequestAbortedError,
  15378. HeadersTimeoutError,
  15379. HeadersOverflowError,
  15380. SocketError,
  15381. InformationalError,
  15382. BodyTimeoutError,
  15383. HTTPParserError,
  15384. ResponseExceededMaxSizeError,
  15385. ClientDestroyedError
  15386. } = __nccwpck_require__(8045)
  15387. const buildConnector = __nccwpck_require__(2067)
  15388. const {
  15389. kUrl,
  15390. kReset,
  15391. kServerName,
  15392. kClient,
  15393. kBusy,
  15394. kParser,
  15395. kConnect,
  15396. kBlocking,
  15397. kResuming,
  15398. kRunning,
  15399. kPending,
  15400. kSize,
  15401. kWriting,
  15402. kQueue,
  15403. kConnected,
  15404. kConnecting,
  15405. kNeedDrain,
  15406. kNoRef,
  15407. kKeepAliveDefaultTimeout,
  15408. kHostHeader,
  15409. kPendingIdx,
  15410. kRunningIdx,
  15411. kError,
  15412. kPipelining,
  15413. kSocket,
  15414. kKeepAliveTimeoutValue,
  15415. kMaxHeadersSize,
  15416. kKeepAliveMaxTimeout,
  15417. kKeepAliveTimeoutThreshold,
  15418. kHeadersTimeout,
  15419. kBodyTimeout,
  15420. kStrictContentLength,
  15421. kConnector,
  15422. kMaxRedirections,
  15423. kMaxRequests,
  15424. kCounter,
  15425. kClose,
  15426. kDestroy,
  15427. kDispatch,
  15428. kInterceptors,
  15429. kLocalAddress,
  15430. kMaxResponseSize,
  15431. kHTTPConnVersion,
  15432. // HTTP2
  15433. kHost,
  15434. kHTTP2Session,
  15435. kHTTP2SessionState,
  15436. kHTTP2BuildRequest,
  15437. kHTTP2CopyHeaders,
  15438. kHTTP1BuildRequest
  15439. } = __nccwpck_require__(2785)
  15440. /** @type {import('http2')} */
  15441. let http2
  15442. try {
  15443. http2 = __nccwpck_require__(5158)
  15444. } catch {
  15445. // @ts-ignore
  15446. http2 = { constants: {} }
  15447. }
  15448. const {
  15449. constants: {
  15450. HTTP2_HEADER_AUTHORITY,
  15451. HTTP2_HEADER_METHOD,
  15452. HTTP2_HEADER_PATH,
  15453. HTTP2_HEADER_SCHEME,
  15454. HTTP2_HEADER_CONTENT_LENGTH,
  15455. HTTP2_HEADER_EXPECT,
  15456. HTTP2_HEADER_STATUS
  15457. }
  15458. } = http2
  15459. // Experimental
  15460. let h2ExperimentalWarned = false
  15461. const FastBuffer = Buffer[Symbol.species]
  15462. const kClosedResolve = Symbol('kClosedResolve')
  15463. const channels = {}
  15464. try {
  15465. const diagnosticsChannel = __nccwpck_require__(7643)
  15466. channels.sendHeaders = diagnosticsChannel.channel('undici:client:sendHeaders')
  15467. channels.beforeConnect = diagnosticsChannel.channel('undici:client:beforeConnect')
  15468. channels.connectError = diagnosticsChannel.channel('undici:client:connectError')
  15469. channels.connected = diagnosticsChannel.channel('undici:client:connected')
  15470. } catch {
  15471. channels.sendHeaders = { hasSubscribers: false }
  15472. channels.beforeConnect = { hasSubscribers: false }
  15473. channels.connectError = { hasSubscribers: false }
  15474. channels.connected = { hasSubscribers: false }
  15475. }
  15476. /**
  15477. * @type {import('../types/client').default}
  15478. */
  15479. class Client extends DispatcherBase {
  15480. /**
  15481. *
  15482. * @param {string|URL} url
  15483. * @param {import('../types/client').Client.Options} options
  15484. */
  15485. constructor (url, {
  15486. interceptors,
  15487. maxHeaderSize,
  15488. headersTimeout,
  15489. socketTimeout,
  15490. requestTimeout,
  15491. connectTimeout,
  15492. bodyTimeout,
  15493. idleTimeout,
  15494. keepAlive,
  15495. keepAliveTimeout,
  15496. maxKeepAliveTimeout,
  15497. keepAliveMaxTimeout,
  15498. keepAliveTimeoutThreshold,
  15499. socketPath,
  15500. pipelining,
  15501. tls,
  15502. strictContentLength,
  15503. maxCachedSessions,
  15504. maxRedirections,
  15505. connect,
  15506. maxRequestsPerClient,
  15507. localAddress,
  15508. maxResponseSize,
  15509. autoSelectFamily,
  15510. autoSelectFamilyAttemptTimeout,
  15511. // h2
  15512. allowH2,
  15513. maxConcurrentStreams
  15514. } = {}) {
  15515. super()
  15516. if (keepAlive !== undefined) {
  15517. throw new InvalidArgumentError('unsupported keepAlive, use pipelining=0 instead')
  15518. }
  15519. if (socketTimeout !== undefined) {
  15520. throw new InvalidArgumentError('unsupported socketTimeout, use headersTimeout & bodyTimeout instead')
  15521. }
  15522. if (requestTimeout !== undefined) {
  15523. throw new InvalidArgumentError('unsupported requestTimeout, use headersTimeout & bodyTimeout instead')
  15524. }
  15525. if (idleTimeout !== undefined) {
  15526. throw new InvalidArgumentError('unsupported idleTimeout, use keepAliveTimeout instead')
  15527. }
  15528. if (maxKeepAliveTimeout !== undefined) {
  15529. throw new InvalidArgumentError('unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead')
  15530. }
  15531. if (maxHeaderSize != null && !Number.isFinite(maxHeaderSize)) {
  15532. throw new InvalidArgumentError('invalid maxHeaderSize')
  15533. }
  15534. if (socketPath != null && typeof socketPath !== 'string') {
  15535. throw new InvalidArgumentError('invalid socketPath')
  15536. }
  15537. if (connectTimeout != null && (!Number.isFinite(connectTimeout) || connectTimeout < 0)) {
  15538. throw new InvalidArgumentError('invalid connectTimeout')
  15539. }
  15540. if (keepAliveTimeout != null && (!Number.isFinite(keepAliveTimeout) || keepAliveTimeout <= 0)) {
  15541. throw new InvalidArgumentError('invalid keepAliveTimeout')
  15542. }
  15543. if (keepAliveMaxTimeout != null && (!Number.isFinite(keepAliveMaxTimeout) || keepAliveMaxTimeout <= 0)) {
  15544. throw new InvalidArgumentError('invalid keepAliveMaxTimeout')
  15545. }
  15546. if (keepAliveTimeoutThreshold != null && !Number.isFinite(keepAliveTimeoutThreshold)) {
  15547. throw new InvalidArgumentError('invalid keepAliveTimeoutThreshold')
  15548. }
  15549. if (headersTimeout != null && (!Number.isInteger(headersTimeout) || headersTimeout < 0)) {
  15550. throw new InvalidArgumentError('headersTimeout must be a positive integer or zero')
  15551. }
  15552. if (bodyTimeout != null && (!Number.isInteger(bodyTimeout) || bodyTimeout < 0)) {
  15553. throw new InvalidArgumentError('bodyTimeout must be a positive integer or zero')
  15554. }
  15555. if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {
  15556. throw new InvalidArgumentError('connect must be a function or an object')
  15557. }
  15558. if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) {
  15559. throw new InvalidArgumentError('maxRedirections must be a positive number')
  15560. }
  15561. if (maxRequestsPerClient != null && (!Number.isInteger(maxRequestsPerClient) || maxRequestsPerClient < 0)) {
  15562. throw new InvalidArgumentError('maxRequestsPerClient must be a positive number')
  15563. }
  15564. if (localAddress != null && (typeof localAddress !== 'string' || net.isIP(localAddress) === 0)) {
  15565. throw new InvalidArgumentError('localAddress must be valid string IP address')
  15566. }
  15567. if (maxResponseSize != null && (!Number.isInteger(maxResponseSize) || maxResponseSize < -1)) {
  15568. throw new InvalidArgumentError('maxResponseSize must be a positive number')
  15569. }
  15570. if (
  15571. autoSelectFamilyAttemptTimeout != null &&
  15572. (!Number.isInteger(autoSelectFamilyAttemptTimeout) || autoSelectFamilyAttemptTimeout < -1)
  15573. ) {
  15574. throw new InvalidArgumentError('autoSelectFamilyAttemptTimeout must be a positive number')
  15575. }
  15576. // h2
  15577. if (allowH2 != null && typeof allowH2 !== 'boolean') {
  15578. throw new InvalidArgumentError('allowH2 must be a valid boolean value')
  15579. }
  15580. if (maxConcurrentStreams != null && (typeof maxConcurrentStreams !== 'number' || maxConcurrentStreams < 1)) {
  15581. throw new InvalidArgumentError('maxConcurrentStreams must be a possitive integer, greater than 0')
  15582. }
  15583. if (typeof connect !== 'function') {
  15584. connect = buildConnector({
  15585. ...tls,
  15586. maxCachedSessions,
  15587. allowH2,
  15588. socketPath,
  15589. timeout: connectTimeout,
  15590. ...(util.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined),
  15591. ...connect
  15592. })
  15593. }
  15594. this[kInterceptors] = interceptors && interceptors.Client && Array.isArray(interceptors.Client)
  15595. ? interceptors.Client
  15596. : [createRedirectInterceptor({ maxRedirections })]
  15597. this[kUrl] = util.parseOrigin(url)
  15598. this[kConnector] = connect
  15599. this[kSocket] = null
  15600. this[kPipelining] = pipelining != null ? pipelining : 1
  15601. this[kMaxHeadersSize] = maxHeaderSize || http.maxHeaderSize
  15602. this[kKeepAliveDefaultTimeout] = keepAliveTimeout == null ? 4e3 : keepAliveTimeout
  15603. this[kKeepAliveMaxTimeout] = keepAliveMaxTimeout == null ? 600e3 : keepAliveMaxTimeout
  15604. this[kKeepAliveTimeoutThreshold] = keepAliveTimeoutThreshold == null ? 1e3 : keepAliveTimeoutThreshold
  15605. this[kKeepAliveTimeoutValue] = this[kKeepAliveDefaultTimeout]
  15606. this[kServerName] = null
  15607. this[kLocalAddress] = localAddress != null ? localAddress : null
  15608. this[kResuming] = 0 // 0, idle, 1, scheduled, 2 resuming
  15609. this[kNeedDrain] = 0 // 0, idle, 1, scheduled, 2 resuming
  15610. this[kHostHeader] = `host: ${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ''}\r\n`
  15611. this[kBodyTimeout] = bodyTimeout != null ? bodyTimeout : 300e3
  15612. this[kHeadersTimeout] = headersTimeout != null ? headersTimeout : 300e3
  15613. this[kStrictContentLength] = strictContentLength == null ? true : strictContentLength
  15614. this[kMaxRedirections] = maxRedirections
  15615. this[kMaxRequests] = maxRequestsPerClient
  15616. this[kClosedResolve] = null
  15617. this[kMaxResponseSize] = maxResponseSize > -1 ? maxResponseSize : -1
  15618. this[kHTTPConnVersion] = 'h1'
  15619. // HTTP/2
  15620. this[kHTTP2Session] = null
  15621. this[kHTTP2SessionState] = !allowH2
  15622. ? null
  15623. : {
  15624. // streams: null, // Fixed queue of streams - For future support of `push`
  15625. openStreams: 0, // Keep track of them to decide wether or not unref the session
  15626. maxConcurrentStreams: maxConcurrentStreams != null ? maxConcurrentStreams : 100 // Max peerConcurrentStreams for a Node h2 server
  15627. }
  15628. this[kHost] = `${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ''}`
  15629. // kQueue is built up of 3 sections separated by
  15630. // the kRunningIdx and kPendingIdx indices.
  15631. // | complete | running | pending |
  15632. // ^ kRunningIdx ^ kPendingIdx ^ kQueue.length
  15633. // kRunningIdx points to the first running element.
  15634. // kPendingIdx points to the first pending element.
  15635. // This implements a fast queue with an amortized
  15636. // time of O(1).
  15637. this[kQueue] = []
  15638. this[kRunningIdx] = 0
  15639. this[kPendingIdx] = 0
  15640. }
  15641. get pipelining () {
  15642. return this[kPipelining]
  15643. }
  15644. set pipelining (value) {
  15645. this[kPipelining] = value
  15646. resume(this, true)
  15647. }
  15648. get [kPending] () {
  15649. return this[kQueue].length - this[kPendingIdx]
  15650. }
  15651. get [kRunning] () {
  15652. return this[kPendingIdx] - this[kRunningIdx]
  15653. }
  15654. get [kSize] () {
  15655. return this[kQueue].length - this[kRunningIdx]
  15656. }
  15657. get [kConnected] () {
  15658. return !!this[kSocket] && !this[kConnecting] && !this[kSocket].destroyed
  15659. }
  15660. get [kBusy] () {
  15661. const socket = this[kSocket]
  15662. return (
  15663. (socket && (socket[kReset] || socket[kWriting] || socket[kBlocking])) ||
  15664. (this[kSize] >= (this[kPipelining] || 1)) ||
  15665. this[kPending] > 0
  15666. )
  15667. }
  15668. /* istanbul ignore: only used for test */
  15669. [kConnect] (cb) {
  15670. connect(this)
  15671. this.once('connect', cb)
  15672. }
  15673. [kDispatch] (opts, handler) {
  15674. const origin = opts.origin || this[kUrl].origin
  15675. const request = this[kHTTPConnVersion] === 'h2'
  15676. ? Request[kHTTP2BuildRequest](origin, opts, handler)
  15677. : Request[kHTTP1BuildRequest](origin, opts, handler)
  15678. this[kQueue].push(request)
  15679. if (this[kResuming]) {
  15680. // Do nothing.
  15681. } else if (util.bodyLength(request.body) == null && util.isIterable(request.body)) {
  15682. // Wait a tick in case stream/iterator is ended in the same tick.
  15683. this[kResuming] = 1
  15684. process.nextTick(resume, this)
  15685. } else {
  15686. resume(this, true)
  15687. }
  15688. if (this[kResuming] && this[kNeedDrain] !== 2 && this[kBusy]) {
  15689. this[kNeedDrain] = 2
  15690. }
  15691. return this[kNeedDrain] < 2
  15692. }
  15693. async [kClose] () {
  15694. // TODO: for H2 we need to gracefully flush the remaining enqueued
  15695. // request and close each stream.
  15696. return new Promise((resolve) => {
  15697. if (!this[kSize]) {
  15698. resolve(null)
  15699. } else {
  15700. this[kClosedResolve] = resolve
  15701. }
  15702. })
  15703. }
  15704. async [kDestroy] (err) {
  15705. return new Promise((resolve) => {
  15706. const requests = this[kQueue].splice(this[kPendingIdx])
  15707. for (let i = 0; i < requests.length; i++) {
  15708. const request = requests[i]
  15709. errorRequest(this, request, err)
  15710. }
  15711. const callback = () => {
  15712. if (this[kClosedResolve]) {
  15713. // TODO (fix): Should we error here with ClientDestroyedError?
  15714. this[kClosedResolve]()
  15715. this[kClosedResolve] = null
  15716. }
  15717. resolve()
  15718. }
  15719. if (this[kHTTP2Session] != null) {
  15720. util.destroy(this[kHTTP2Session], err)
  15721. this[kHTTP2Session] = null
  15722. this[kHTTP2SessionState] = null
  15723. }
  15724. if (!this[kSocket]) {
  15725. queueMicrotask(callback)
  15726. } else {
  15727. util.destroy(this[kSocket].on('close', callback), err)
  15728. }
  15729. resume(this)
  15730. })
  15731. }
  15732. }
  15733. function onHttp2SessionError (err) {
  15734. assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')
  15735. this[kSocket][kError] = err
  15736. onError(this[kClient], err)
  15737. }
  15738. function onHttp2FrameError (type, code, id) {
  15739. const err = new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`)
  15740. if (id === 0) {
  15741. this[kSocket][kError] = err
  15742. onError(this[kClient], err)
  15743. }
  15744. }
  15745. function onHttp2SessionEnd () {
  15746. util.destroy(this, new SocketError('other side closed'))
  15747. util.destroy(this[kSocket], new SocketError('other side closed'))
  15748. }
  15749. function onHTTP2GoAway (code) {
  15750. const client = this[kClient]
  15751. const err = new InformationalError(`HTTP/2: "GOAWAY" frame received with code ${code}`)
  15752. client[kSocket] = null
  15753. client[kHTTP2Session] = null
  15754. if (client.destroyed) {
  15755. assert(this[kPending] === 0)
  15756. // Fail entire queue.
  15757. const requests = client[kQueue].splice(client[kRunningIdx])
  15758. for (let i = 0; i < requests.length; i++) {
  15759. const request = requests[i]
  15760. errorRequest(this, request, err)
  15761. }
  15762. } else if (client[kRunning] > 0) {
  15763. // Fail head of pipeline.
  15764. const request = client[kQueue][client[kRunningIdx]]
  15765. client[kQueue][client[kRunningIdx]++] = null
  15766. errorRequest(client, request, err)
  15767. }
  15768. client[kPendingIdx] = client[kRunningIdx]
  15769. assert(client[kRunning] === 0)
  15770. client.emit('disconnect',
  15771. client[kUrl],
  15772. [client],
  15773. err
  15774. )
  15775. resume(client)
  15776. }
  15777. const constants = __nccwpck_require__(953)
  15778. const createRedirectInterceptor = __nccwpck_require__(8861)
  15779. const EMPTY_BUF = Buffer.alloc(0)
  15780. async function lazyllhttp () {
  15781. const llhttpWasmData = process.env.JEST_WORKER_ID ? __nccwpck_require__(1145) : undefined
  15782. let mod
  15783. try {
  15784. mod = await WebAssembly.compile(Buffer.from(__nccwpck_require__(5627), 'base64'))
  15785. } catch (e) {
  15786. /* istanbul ignore next */
  15787. // We could check if the error was caused by the simd option not
  15788. // being enabled, but the occurring of this other error
  15789. // * https://github.com/emscripten-core/emscripten/issues/11495
  15790. // got me to remove that check to avoid breaking Node 12.
  15791. mod = await WebAssembly.compile(Buffer.from(llhttpWasmData || __nccwpck_require__(1145), 'base64'))
  15792. }
  15793. return await WebAssembly.instantiate(mod, {
  15794. env: {
  15795. /* eslint-disable camelcase */
  15796. wasm_on_url: (p, at, len) => {
  15797. /* istanbul ignore next */
  15798. return 0
  15799. },
  15800. wasm_on_status: (p, at, len) => {
  15801. assert.strictEqual(currentParser.ptr, p)
  15802. const start = at - currentBufferPtr + currentBufferRef.byteOffset
  15803. return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
  15804. },
  15805. wasm_on_message_begin: (p) => {
  15806. assert.strictEqual(currentParser.ptr, p)
  15807. return currentParser.onMessageBegin() || 0
  15808. },
  15809. wasm_on_header_field: (p, at, len) => {
  15810. assert.strictEqual(currentParser.ptr, p)
  15811. const start = at - currentBufferPtr + currentBufferRef.byteOffset
  15812. return currentParser.onHeaderField(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
  15813. },
  15814. wasm_on_header_value: (p, at, len) => {
  15815. assert.strictEqual(currentParser.ptr, p)
  15816. const start = at - currentBufferPtr + currentBufferRef.byteOffset
  15817. return currentParser.onHeaderValue(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
  15818. },
  15819. wasm_on_headers_complete: (p, statusCode, upgrade, shouldKeepAlive) => {
  15820. assert.strictEqual(currentParser.ptr, p)
  15821. return currentParser.onHeadersComplete(statusCode, Boolean(upgrade), Boolean(shouldKeepAlive)) || 0
  15822. },
  15823. wasm_on_body: (p, at, len) => {
  15824. assert.strictEqual(currentParser.ptr, p)
  15825. const start = at - currentBufferPtr + currentBufferRef.byteOffset
  15826. return currentParser.onBody(new FastBuffer(currentBufferRef.buffer, start, len)) || 0
  15827. },
  15828. wasm_on_message_complete: (p) => {
  15829. assert.strictEqual(currentParser.ptr, p)
  15830. return currentParser.onMessageComplete() || 0
  15831. }
  15832. /* eslint-enable camelcase */
  15833. }
  15834. })
  15835. }
  15836. let llhttpInstance = null
  15837. let llhttpPromise = lazyllhttp()
  15838. llhttpPromise.catch()
  15839. let currentParser = null
  15840. let currentBufferRef = null
  15841. let currentBufferSize = 0
  15842. let currentBufferPtr = null
  15843. const TIMEOUT_HEADERS = 1
  15844. const TIMEOUT_BODY = 2
  15845. const TIMEOUT_IDLE = 3
  15846. class Parser {
  15847. constructor (client, socket, { exports }) {
  15848. assert(Number.isFinite(client[kMaxHeadersSize]) && client[kMaxHeadersSize] > 0)
  15849. this.llhttp = exports
  15850. this.ptr = this.llhttp.llhttp_alloc(constants.TYPE.RESPONSE)
  15851. this.client = client
  15852. this.socket = socket
  15853. this.timeout = null
  15854. this.timeoutValue = null
  15855. this.timeoutType = null
  15856. this.statusCode = null
  15857. this.statusText = ''
  15858. this.upgrade = false
  15859. this.headers = []
  15860. this.headersSize = 0
  15861. this.headersMaxSize = client[kMaxHeadersSize]
  15862. this.shouldKeepAlive = false
  15863. this.paused = false
  15864. this.resume = this.resume.bind(this)
  15865. this.bytesRead = 0
  15866. this.keepAlive = ''
  15867. this.contentLength = ''
  15868. this.connection = ''
  15869. this.maxResponseSize = client[kMaxResponseSize]
  15870. }
  15871. setTimeout (value, type) {
  15872. this.timeoutType = type
  15873. if (value !== this.timeoutValue) {
  15874. timers.clearTimeout(this.timeout)
  15875. if (value) {
  15876. this.timeout = timers.setTimeout(onParserTimeout, value, this)
  15877. // istanbul ignore else: only for jest
  15878. if (this.timeout.unref) {
  15879. this.timeout.unref()
  15880. }
  15881. } else {
  15882. this.timeout = null
  15883. }
  15884. this.timeoutValue = value
  15885. } else if (this.timeout) {
  15886. // istanbul ignore else: only for jest
  15887. if (this.timeout.refresh) {
  15888. this.timeout.refresh()
  15889. }
  15890. }
  15891. }
  15892. resume () {
  15893. if (this.socket.destroyed || !this.paused) {
  15894. return
  15895. }
  15896. assert(this.ptr != null)
  15897. assert(currentParser == null)
  15898. this.llhttp.llhttp_resume(this.ptr)
  15899. assert(this.timeoutType === TIMEOUT_BODY)
  15900. if (this.timeout) {
  15901. // istanbul ignore else: only for jest
  15902. if (this.timeout.refresh) {
  15903. this.timeout.refresh()
  15904. }
  15905. }
  15906. this.paused = false
  15907. this.execute(this.socket.read() || EMPTY_BUF) // Flush parser.
  15908. this.readMore()
  15909. }
  15910. readMore () {
  15911. while (!this.paused && this.ptr) {
  15912. const chunk = this.socket.read()
  15913. if (chunk === null) {
  15914. break
  15915. }
  15916. this.execute(chunk)
  15917. }
  15918. }
  15919. execute (data) {
  15920. assert(this.ptr != null)
  15921. assert(currentParser == null)
  15922. assert(!this.paused)
  15923. const { socket, llhttp } = this
  15924. if (data.length > currentBufferSize) {
  15925. if (currentBufferPtr) {
  15926. llhttp.free(currentBufferPtr)
  15927. }
  15928. currentBufferSize = Math.ceil(data.length / 4096) * 4096
  15929. currentBufferPtr = llhttp.malloc(currentBufferSize)
  15930. }
  15931. new Uint8Array(llhttp.memory.buffer, currentBufferPtr, currentBufferSize).set(data)
  15932. // Call `execute` on the wasm parser.
  15933. // We pass the `llhttp_parser` pointer address, the pointer address of buffer view data,
  15934. // and finally the length of bytes to parse.
  15935. // The return value is an error code or `constants.ERROR.OK`.
  15936. try {
  15937. let ret
  15938. try {
  15939. currentBufferRef = data
  15940. currentParser = this
  15941. ret = llhttp.llhttp_execute(this.ptr, currentBufferPtr, data.length)
  15942. /* eslint-disable-next-line no-useless-catch */
  15943. } catch (err) {
  15944. /* istanbul ignore next: difficult to make a test case for */
  15945. throw err
  15946. } finally {
  15947. currentParser = null
  15948. currentBufferRef = null
  15949. }
  15950. const offset = llhttp.llhttp_get_error_pos(this.ptr) - currentBufferPtr
  15951. if (ret === constants.ERROR.PAUSED_UPGRADE) {
  15952. this.onUpgrade(data.slice(offset))
  15953. } else if (ret === constants.ERROR.PAUSED) {
  15954. this.paused = true
  15955. socket.unshift(data.slice(offset))
  15956. } else if (ret !== constants.ERROR.OK) {
  15957. const ptr = llhttp.llhttp_get_error_reason(this.ptr)
  15958. let message = ''
  15959. /* istanbul ignore else: difficult to make a test case for */
  15960. if (ptr) {
  15961. const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0)
  15962. message =
  15963. 'Response does not match the HTTP/1.1 protocol (' +
  15964. Buffer.from(llhttp.memory.buffer, ptr, len).toString() +
  15965. ')'
  15966. }
  15967. throw new HTTPParserError(message, constants.ERROR[ret], data.slice(offset))
  15968. }
  15969. } catch (err) {
  15970. util.destroy(socket, err)
  15971. }
  15972. }
  15973. destroy () {
  15974. assert(this.ptr != null)
  15975. assert(currentParser == null)
  15976. this.llhttp.llhttp_free(this.ptr)
  15977. this.ptr = null
  15978. timers.clearTimeout(this.timeout)
  15979. this.timeout = null
  15980. this.timeoutValue = null
  15981. this.timeoutType = null
  15982. this.paused = false
  15983. }
  15984. onStatus (buf) {
  15985. this.statusText = buf.toString()
  15986. }
  15987. onMessageBegin () {
  15988. const { socket, client } = this
  15989. /* istanbul ignore next: difficult to make a test case for */
  15990. if (socket.destroyed) {
  15991. return -1
  15992. }
  15993. const request = client[kQueue][client[kRunningIdx]]
  15994. if (!request) {
  15995. return -1
  15996. }
  15997. }
  15998. onHeaderField (buf) {
  15999. const len = this.headers.length
  16000. if ((len & 1) === 0) {
  16001. this.headers.push(buf)
  16002. } else {
  16003. this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf])
  16004. }
  16005. this.trackHeader(buf.length)
  16006. }
  16007. onHeaderValue (buf) {
  16008. let len = this.headers.length
  16009. if ((len & 1) === 1) {
  16010. this.headers.push(buf)
  16011. len += 1
  16012. } else {
  16013. this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf])
  16014. }
  16015. const key = this.headers[len - 2]
  16016. if (key.length === 10 && key.toString().toLowerCase() === 'keep-alive') {
  16017. this.keepAlive += buf.toString()
  16018. } else if (key.length === 10 && key.toString().toLowerCase() === 'connection') {
  16019. this.connection += buf.toString()
  16020. } else if (key.length === 14 && key.toString().toLowerCase() === 'content-length') {
  16021. this.contentLength += buf.toString()
  16022. }
  16023. this.trackHeader(buf.length)
  16024. }
  16025. trackHeader (len) {
  16026. this.headersSize += len
  16027. if (this.headersSize >= this.headersMaxSize) {
  16028. util.destroy(this.socket, new HeadersOverflowError())
  16029. }
  16030. }
  16031. onUpgrade (head) {
  16032. const { upgrade, client, socket, headers, statusCode } = this
  16033. assert(upgrade)
  16034. const request = client[kQueue][client[kRunningIdx]]
  16035. assert(request)
  16036. assert(!socket.destroyed)
  16037. assert(socket === client[kSocket])
  16038. assert(!this.paused)
  16039. assert(request.upgrade || request.method === 'CONNECT')
  16040. this.statusCode = null
  16041. this.statusText = ''
  16042. this.shouldKeepAlive = null
  16043. assert(this.headers.length % 2 === 0)
  16044. this.headers = []
  16045. this.headersSize = 0
  16046. socket.unshift(head)
  16047. socket[kParser].destroy()
  16048. socket[kParser] = null
  16049. socket[kClient] = null
  16050. socket[kError] = null
  16051. socket
  16052. .removeListener('error', onSocketError)
  16053. .removeListener('readable', onSocketReadable)
  16054. .removeListener('end', onSocketEnd)
  16055. .removeListener('close', onSocketClose)
  16056. client[kSocket] = null
  16057. client[kQueue][client[kRunningIdx]++] = null
  16058. client.emit('disconnect', client[kUrl], [client], new InformationalError('upgrade'))
  16059. try {
  16060. request.onUpgrade(statusCode, headers, socket)
  16061. } catch (err) {
  16062. util.destroy(socket, err)
  16063. }
  16064. resume(client)
  16065. }
  16066. onHeadersComplete (statusCode, upgrade, shouldKeepAlive) {
  16067. const { client, socket, headers, statusText } = this
  16068. /* istanbul ignore next: difficult to make a test case for */
  16069. if (socket.destroyed) {
  16070. return -1
  16071. }
  16072. const request = client[kQueue][client[kRunningIdx]]
  16073. /* istanbul ignore next: difficult to make a test case for */
  16074. if (!request) {
  16075. return -1
  16076. }
  16077. assert(!this.upgrade)
  16078. assert(this.statusCode < 200)
  16079. if (statusCode === 100) {
  16080. util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket)))
  16081. return -1
  16082. }
  16083. /* this can only happen if server is misbehaving */
  16084. if (upgrade && !request.upgrade) {
  16085. util.destroy(socket, new SocketError('bad upgrade', util.getSocketInfo(socket)))
  16086. return -1
  16087. }
  16088. assert.strictEqual(this.timeoutType, TIMEOUT_HEADERS)
  16089. this.statusCode = statusCode
  16090. this.shouldKeepAlive = (
  16091. shouldKeepAlive ||
  16092. // Override llhttp value which does not allow keepAlive for HEAD.
  16093. (request.method === 'HEAD' && !socket[kReset] && this.connection.toLowerCase() === 'keep-alive')
  16094. )
  16095. if (this.statusCode >= 200) {
  16096. const bodyTimeout = request.bodyTimeout != null
  16097. ? request.bodyTimeout
  16098. : client[kBodyTimeout]
  16099. this.setTimeout(bodyTimeout, TIMEOUT_BODY)
  16100. } else if (this.timeout) {
  16101. // istanbul ignore else: only for jest
  16102. if (this.timeout.refresh) {
  16103. this.timeout.refresh()
  16104. }
  16105. }
  16106. if (request.method === 'CONNECT') {
  16107. assert(client[kRunning] === 1)
  16108. this.upgrade = true
  16109. return 2
  16110. }
  16111. if (upgrade) {
  16112. assert(client[kRunning] === 1)
  16113. this.upgrade = true
  16114. return 2
  16115. }
  16116. assert(this.headers.length % 2 === 0)
  16117. this.headers = []
  16118. this.headersSize = 0
  16119. if (this.shouldKeepAlive && client[kPipelining]) {
  16120. const keepAliveTimeout = this.keepAlive ? util.parseKeepAliveTimeout(this.keepAlive) : null
  16121. if (keepAliveTimeout != null) {
  16122. const timeout = Math.min(
  16123. keepAliveTimeout - client[kKeepAliveTimeoutThreshold],
  16124. client[kKeepAliveMaxTimeout]
  16125. )
  16126. if (timeout <= 0) {
  16127. socket[kReset] = true
  16128. } else {
  16129. client[kKeepAliveTimeoutValue] = timeout
  16130. }
  16131. } else {
  16132. client[kKeepAliveTimeoutValue] = client[kKeepAliveDefaultTimeout]
  16133. }
  16134. } else {
  16135. // Stop more requests from being dispatched.
  16136. socket[kReset] = true
  16137. }
  16138. const pause = request.onHeaders(statusCode, headers, this.resume, statusText) === false
  16139. if (request.aborted) {
  16140. return -1
  16141. }
  16142. if (request.method === 'HEAD') {
  16143. return 1
  16144. }
  16145. if (statusCode < 200) {
  16146. return 1
  16147. }
  16148. if (socket[kBlocking]) {
  16149. socket[kBlocking] = false
  16150. resume(client)
  16151. }
  16152. return pause ? constants.ERROR.PAUSED : 0
  16153. }
  16154. onBody (buf) {
  16155. const { client, socket, statusCode, maxResponseSize } = this
  16156. if (socket.destroyed) {
  16157. return -1
  16158. }
  16159. const request = client[kQueue][client[kRunningIdx]]
  16160. assert(request)
  16161. assert.strictEqual(this.timeoutType, TIMEOUT_BODY)
  16162. if (this.timeout) {
  16163. // istanbul ignore else: only for jest
  16164. if (this.timeout.refresh) {
  16165. this.timeout.refresh()
  16166. }
  16167. }
  16168. assert(statusCode >= 200)
  16169. if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) {
  16170. util.destroy(socket, new ResponseExceededMaxSizeError())
  16171. return -1
  16172. }
  16173. this.bytesRead += buf.length
  16174. if (request.onData(buf) === false) {
  16175. return constants.ERROR.PAUSED
  16176. }
  16177. }
  16178. onMessageComplete () {
  16179. const { client, socket, statusCode, upgrade, headers, contentLength, bytesRead, shouldKeepAlive } = this
  16180. if (socket.destroyed && (!statusCode || shouldKeepAlive)) {
  16181. return -1
  16182. }
  16183. if (upgrade) {
  16184. return
  16185. }
  16186. const request = client[kQueue][client[kRunningIdx]]
  16187. assert(request)
  16188. assert(statusCode >= 100)
  16189. this.statusCode = null
  16190. this.statusText = ''
  16191. this.bytesRead = 0
  16192. this.contentLength = ''
  16193. this.keepAlive = ''
  16194. this.connection = ''
  16195. assert(this.headers.length % 2 === 0)
  16196. this.headers = []
  16197. this.headersSize = 0
  16198. if (statusCode < 200) {
  16199. return
  16200. }
  16201. /* istanbul ignore next: should be handled by llhttp? */
  16202. if (request.method !== 'HEAD' && contentLength && bytesRead !== parseInt(contentLength, 10)) {
  16203. util.destroy(socket, new ResponseContentLengthMismatchError())
  16204. return -1
  16205. }
  16206. request.onComplete(headers)
  16207. client[kQueue][client[kRunningIdx]++] = null
  16208. if (socket[kWriting]) {
  16209. assert.strictEqual(client[kRunning], 0)
  16210. // Response completed before request.
  16211. util.destroy(socket, new InformationalError('reset'))
  16212. return constants.ERROR.PAUSED
  16213. } else if (!shouldKeepAlive) {
  16214. util.destroy(socket, new InformationalError('reset'))
  16215. return constants.ERROR.PAUSED
  16216. } else if (socket[kReset] && client[kRunning] === 0) {
  16217. // Destroy socket once all requests have completed.
  16218. // The request at the tail of the pipeline is the one
  16219. // that requested reset and no further requests should
  16220. // have been queued since then.
  16221. util.destroy(socket, new InformationalError('reset'))
  16222. return constants.ERROR.PAUSED
  16223. } else if (client[kPipelining] === 1) {
  16224. // We must wait a full event loop cycle to reuse this socket to make sure
  16225. // that non-spec compliant servers are not closing the connection even if they
  16226. // said they won't.
  16227. setImmediate(resume, client)
  16228. } else {
  16229. resume(client)
  16230. }
  16231. }
  16232. }
  16233. function onParserTimeout (parser) {
  16234. const { socket, timeoutType, client } = parser
  16235. /* istanbul ignore else */
  16236. if (timeoutType === TIMEOUT_HEADERS) {
  16237. if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) {
  16238. assert(!parser.paused, 'cannot be paused while waiting for headers')
  16239. util.destroy(socket, new HeadersTimeoutError())
  16240. }
  16241. } else if (timeoutType === TIMEOUT_BODY) {
  16242. if (!parser.paused) {
  16243. util.destroy(socket, new BodyTimeoutError())
  16244. }
  16245. } else if (timeoutType === TIMEOUT_IDLE) {
  16246. assert(client[kRunning] === 0 && client[kKeepAliveTimeoutValue])
  16247. util.destroy(socket, new InformationalError('socket idle timeout'))
  16248. }
  16249. }
  16250. function onSocketReadable () {
  16251. const { [kParser]: parser } = this
  16252. if (parser) {
  16253. parser.readMore()
  16254. }
  16255. }
  16256. function onSocketError (err) {
  16257. const { [kClient]: client, [kParser]: parser } = this
  16258. assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')
  16259. if (client[kHTTPConnVersion] !== 'h2') {
  16260. // On Mac OS, we get an ECONNRESET even if there is a full body to be forwarded
  16261. // to the user.
  16262. if (err.code === 'ECONNRESET' && parser.statusCode && !parser.shouldKeepAlive) {
  16263. // We treat all incoming data so for as a valid response.
  16264. parser.onMessageComplete()
  16265. return
  16266. }
  16267. }
  16268. this[kError] = err
  16269. onError(this[kClient], err)
  16270. }
  16271. function onError (client, err) {
  16272. if (
  16273. client[kRunning] === 0 &&
  16274. err.code !== 'UND_ERR_INFO' &&
  16275. err.code !== 'UND_ERR_SOCKET'
  16276. ) {
  16277. // Error is not caused by running request and not a recoverable
  16278. // socket error.
  16279. assert(client[kPendingIdx] === client[kRunningIdx])
  16280. const requests = client[kQueue].splice(client[kRunningIdx])
  16281. for (let i = 0; i < requests.length; i++) {
  16282. const request = requests[i]
  16283. errorRequest(client, request, err)
  16284. }
  16285. assert(client[kSize] === 0)
  16286. }
  16287. }
  16288. function onSocketEnd () {
  16289. const { [kParser]: parser, [kClient]: client } = this
  16290. if (client[kHTTPConnVersion] !== 'h2') {
  16291. if (parser.statusCode && !parser.shouldKeepAlive) {
  16292. // We treat all incoming data so far as a valid response.
  16293. parser.onMessageComplete()
  16294. return
  16295. }
  16296. }
  16297. util.destroy(this, new SocketError('other side closed', util.getSocketInfo(this)))
  16298. }
  16299. function onSocketClose () {
  16300. const { [kClient]: client, [kParser]: parser } = this
  16301. if (client[kHTTPConnVersion] === 'h1' && parser) {
  16302. if (!this[kError] && parser.statusCode && !parser.shouldKeepAlive) {
  16303. // We treat all incoming data so far as a valid response.
  16304. parser.onMessageComplete()
  16305. }
  16306. this[kParser].destroy()
  16307. this[kParser] = null
  16308. }
  16309. const err = this[kError] || new SocketError('closed', util.getSocketInfo(this))
  16310. client[kSocket] = null
  16311. if (client.destroyed) {
  16312. assert(client[kPending] === 0)
  16313. // Fail entire queue.
  16314. const requests = client[kQueue].splice(client[kRunningIdx])
  16315. for (let i = 0; i < requests.length; i++) {
  16316. const request = requests[i]
  16317. errorRequest(client, request, err)
  16318. }
  16319. } else if (client[kRunning] > 0 && err.code !== 'UND_ERR_INFO') {
  16320. // Fail head of pipeline.
  16321. const request = client[kQueue][client[kRunningIdx]]
  16322. client[kQueue][client[kRunningIdx]++] = null
  16323. errorRequest(client, request, err)
  16324. }
  16325. client[kPendingIdx] = client[kRunningIdx]
  16326. assert(client[kRunning] === 0)
  16327. client.emit('disconnect', client[kUrl], [client], err)
  16328. resume(client)
  16329. }
  16330. async function connect (client) {
  16331. assert(!client[kConnecting])
  16332. assert(!client[kSocket])
  16333. let { host, hostname, protocol, port } = client[kUrl]
  16334. // Resolve ipv6
  16335. if (hostname[0] === '[') {
  16336. const idx = hostname.indexOf(']')
  16337. assert(idx !== -1)
  16338. const ip = hostname.substring(1, idx)
  16339. assert(net.isIP(ip))
  16340. hostname = ip
  16341. }
  16342. client[kConnecting] = true
  16343. if (channels.beforeConnect.hasSubscribers) {
  16344. channels.beforeConnect.publish({
  16345. connectParams: {
  16346. host,
  16347. hostname,
  16348. protocol,
  16349. port,
  16350. servername: client[kServerName],
  16351. localAddress: client[kLocalAddress]
  16352. },
  16353. connector: client[kConnector]
  16354. })
  16355. }
  16356. try {
  16357. const socket = await new Promise((resolve, reject) => {
  16358. client[kConnector]({
  16359. host,
  16360. hostname,
  16361. protocol,
  16362. port,
  16363. servername: client[kServerName],
  16364. localAddress: client[kLocalAddress]
  16365. }, (err, socket) => {
  16366. if (err) {
  16367. reject(err)
  16368. } else {
  16369. resolve(socket)
  16370. }
  16371. })
  16372. })
  16373. if (client.destroyed) {
  16374. util.destroy(socket.on('error', () => {}), new ClientDestroyedError())
  16375. return
  16376. }
  16377. client[kConnecting] = false
  16378. assert(socket)
  16379. const isH2 = socket.alpnProtocol === 'h2'
  16380. if (isH2) {
  16381. if (!h2ExperimentalWarned) {
  16382. h2ExperimentalWarned = true
  16383. process.emitWarning('H2 support is experimental, expect them to change at any time.', {
  16384. code: 'UNDICI-H2'
  16385. })
  16386. }
  16387. const session = http2.connect(client[kUrl], {
  16388. createConnection: () => socket,
  16389. peerMaxConcurrentStreams: client[kHTTP2SessionState].maxConcurrentStreams
  16390. })
  16391. client[kHTTPConnVersion] = 'h2'
  16392. session[kClient] = client
  16393. session[kSocket] = socket
  16394. session.on('error', onHttp2SessionError)
  16395. session.on('frameError', onHttp2FrameError)
  16396. session.on('end', onHttp2SessionEnd)
  16397. session.on('goaway', onHTTP2GoAway)
  16398. session.on('close', onSocketClose)
  16399. session.unref()
  16400. client[kHTTP2Session] = session
  16401. socket[kHTTP2Session] = session
  16402. } else {
  16403. if (!llhttpInstance) {
  16404. llhttpInstance = await llhttpPromise
  16405. llhttpPromise = null
  16406. }
  16407. socket[kNoRef] = false
  16408. socket[kWriting] = false
  16409. socket[kReset] = false
  16410. socket[kBlocking] = false
  16411. socket[kParser] = new Parser(client, socket, llhttpInstance)
  16412. }
  16413. socket[kCounter] = 0
  16414. socket[kMaxRequests] = client[kMaxRequests]
  16415. socket[kClient] = client
  16416. socket[kError] = null
  16417. socket
  16418. .on('error', onSocketError)
  16419. .on('readable', onSocketReadable)
  16420. .on('end', onSocketEnd)
  16421. .on('close', onSocketClose)
  16422. client[kSocket] = socket
  16423. if (channels.connected.hasSubscribers) {
  16424. channels.connected.publish({
  16425. connectParams: {
  16426. host,
  16427. hostname,
  16428. protocol,
  16429. port,
  16430. servername: client[kServerName],
  16431. localAddress: client[kLocalAddress]
  16432. },
  16433. connector: client[kConnector],
  16434. socket
  16435. })
  16436. }
  16437. client.emit('connect', client[kUrl], [client])
  16438. } catch (err) {
  16439. if (client.destroyed) {
  16440. return
  16441. }
  16442. client[kConnecting] = false
  16443. if (channels.connectError.hasSubscribers) {
  16444. channels.connectError.publish({
  16445. connectParams: {
  16446. host,
  16447. hostname,
  16448. protocol,
  16449. port,
  16450. servername: client[kServerName],
  16451. localAddress: client[kLocalAddress]
  16452. },
  16453. connector: client[kConnector],
  16454. error: err
  16455. })
  16456. }
  16457. if (err.code === 'ERR_TLS_CERT_ALTNAME_INVALID') {
  16458. assert(client[kRunning] === 0)
  16459. while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) {
  16460. const request = client[kQueue][client[kPendingIdx]++]
  16461. errorRequest(client, request, err)
  16462. }
  16463. } else {
  16464. onError(client, err)
  16465. }
  16466. client.emit('connectionError', client[kUrl], [client], err)
  16467. }
  16468. resume(client)
  16469. }
  16470. function emitDrain (client) {
  16471. client[kNeedDrain] = 0
  16472. client.emit('drain', client[kUrl], [client])
  16473. }
  16474. function resume (client, sync) {
  16475. if (client[kResuming] === 2) {
  16476. return
  16477. }
  16478. client[kResuming] = 2
  16479. _resume(client, sync)
  16480. client[kResuming] = 0
  16481. if (client[kRunningIdx] > 256) {
  16482. client[kQueue].splice(0, client[kRunningIdx])
  16483. client[kPendingIdx] -= client[kRunningIdx]
  16484. client[kRunningIdx] = 0
  16485. }
  16486. }
  16487. function _resume (client, sync) {
  16488. while (true) {
  16489. if (client.destroyed) {
  16490. assert(client[kPending] === 0)
  16491. return
  16492. }
  16493. if (client[kClosedResolve] && !client[kSize]) {
  16494. client[kClosedResolve]()
  16495. client[kClosedResolve] = null
  16496. return
  16497. }
  16498. const socket = client[kSocket]
  16499. if (socket && !socket.destroyed && socket.alpnProtocol !== 'h2') {
  16500. if (client[kSize] === 0) {
  16501. if (!socket[kNoRef] && socket.unref) {
  16502. socket.unref()
  16503. socket[kNoRef] = true
  16504. }
  16505. } else if (socket[kNoRef] && socket.ref) {
  16506. socket.ref()
  16507. socket[kNoRef] = false
  16508. }
  16509. if (client[kSize] === 0) {
  16510. if (socket[kParser].timeoutType !== TIMEOUT_IDLE) {
  16511. socket[kParser].setTimeout(client[kKeepAliveTimeoutValue], TIMEOUT_IDLE)
  16512. }
  16513. } else if (client[kRunning] > 0 && socket[kParser].statusCode < 200) {
  16514. if (socket[kParser].timeoutType !== TIMEOUT_HEADERS) {
  16515. const request = client[kQueue][client[kRunningIdx]]
  16516. const headersTimeout = request.headersTimeout != null
  16517. ? request.headersTimeout
  16518. : client[kHeadersTimeout]
  16519. socket[kParser].setTimeout(headersTimeout, TIMEOUT_HEADERS)
  16520. }
  16521. }
  16522. }
  16523. if (client[kBusy]) {
  16524. client[kNeedDrain] = 2
  16525. } else if (client[kNeedDrain] === 2) {
  16526. if (sync) {
  16527. client[kNeedDrain] = 1
  16528. process.nextTick(emitDrain, client)
  16529. } else {
  16530. emitDrain(client)
  16531. }
  16532. continue
  16533. }
  16534. if (client[kPending] === 0) {
  16535. return
  16536. }
  16537. if (client[kRunning] >= (client[kPipelining] || 1)) {
  16538. return
  16539. }
  16540. const request = client[kQueue][client[kPendingIdx]]
  16541. if (client[kUrl].protocol === 'https:' && client[kServerName] !== request.servername) {
  16542. if (client[kRunning] > 0) {
  16543. return
  16544. }
  16545. client[kServerName] = request.servername
  16546. if (socket && socket.servername !== request.servername) {
  16547. util.destroy(socket, new InformationalError('servername changed'))
  16548. return
  16549. }
  16550. }
  16551. if (client[kConnecting]) {
  16552. return
  16553. }
  16554. if (!socket && !client[kHTTP2Session]) {
  16555. connect(client)
  16556. return
  16557. }
  16558. if (socket.destroyed || socket[kWriting] || socket[kReset] || socket[kBlocking]) {
  16559. return
  16560. }
  16561. if (client[kRunning] > 0 && !request.idempotent) {
  16562. // Non-idempotent request cannot be retried.
  16563. // Ensure that no other requests are inflight and
  16564. // could cause failure.
  16565. return
  16566. }
  16567. if (client[kRunning] > 0 && (request.upgrade || request.method === 'CONNECT')) {
  16568. // Don't dispatch an upgrade until all preceding requests have completed.
  16569. // A misbehaving server might upgrade the connection before all pipelined
  16570. // request has completed.
  16571. return
  16572. }
  16573. if (client[kRunning] > 0 && util.bodyLength(request.body) !== 0 &&
  16574. (util.isStream(request.body) || util.isAsyncIterable(request.body))) {
  16575. // Request with stream or iterator body can error while other requests
  16576. // are inflight and indirectly error those as well.
  16577. // Ensure this doesn't happen by waiting for inflight
  16578. // to complete before dispatching.
  16579. // Request with stream or iterator body cannot be retried.
  16580. // Ensure that no other requests are inflight and
  16581. // could cause failure.
  16582. return
  16583. }
  16584. if (!request.aborted && write(client, request)) {
  16585. client[kPendingIdx]++
  16586. } else {
  16587. client[kQueue].splice(client[kPendingIdx], 1)
  16588. }
  16589. }
  16590. }
  16591. // https://www.rfc-editor.org/rfc/rfc7230#section-3.3.2
  16592. function shouldSendContentLength (method) {
  16593. return method !== 'GET' && method !== 'HEAD' && method !== 'OPTIONS' && method !== 'TRACE' && method !== 'CONNECT'
  16594. }
  16595. function write (client, request) {
  16596. if (client[kHTTPConnVersion] === 'h2') {
  16597. writeH2(client, client[kHTTP2Session], request)
  16598. return
  16599. }
  16600. const { body, method, path, host, upgrade, headers, blocking, reset } = request
  16601. // https://tools.ietf.org/html/rfc7231#section-4.3.1
  16602. // https://tools.ietf.org/html/rfc7231#section-4.3.2
  16603. // https://tools.ietf.org/html/rfc7231#section-4.3.5
  16604. // Sending a payload body on a request that does not
  16605. // expect it can cause undefined behavior on some
  16606. // servers and corrupt connection state. Do not
  16607. // re-use the connection for further requests.
  16608. const expectsPayload = (
  16609. method === 'PUT' ||
  16610. method === 'POST' ||
  16611. method === 'PATCH'
  16612. )
  16613. if (body && typeof body.read === 'function') {
  16614. // Try to read EOF in order to get length.
  16615. body.read(0)
  16616. }
  16617. const bodyLength = util.bodyLength(body)
  16618. let contentLength = bodyLength
  16619. if (contentLength === null) {
  16620. contentLength = request.contentLength
  16621. }
  16622. if (contentLength === 0 && !expectsPayload) {
  16623. // https://tools.ietf.org/html/rfc7230#section-3.3.2
  16624. // A user agent SHOULD NOT send a Content-Length header field when
  16625. // the request message does not contain a payload body and the method
  16626. // semantics do not anticipate such a body.
  16627. contentLength = null
  16628. }
  16629. // https://github.com/nodejs/undici/issues/2046
  16630. // A user agent may send a Content-Length header with 0 value, this should be allowed.
  16631. if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength !== null && request.contentLength !== contentLength) {
  16632. if (client[kStrictContentLength]) {
  16633. errorRequest(client, request, new RequestContentLengthMismatchError())
  16634. return false
  16635. }
  16636. process.emitWarning(new RequestContentLengthMismatchError())
  16637. }
  16638. const socket = client[kSocket]
  16639. try {
  16640. request.onConnect((err) => {
  16641. if (request.aborted || request.completed) {
  16642. return
  16643. }
  16644. errorRequest(client, request, err || new RequestAbortedError())
  16645. util.destroy(socket, new InformationalError('aborted'))
  16646. })
  16647. } catch (err) {
  16648. errorRequest(client, request, err)
  16649. }
  16650. if (request.aborted) {
  16651. return false
  16652. }
  16653. if (method === 'HEAD') {
  16654. // https://github.com/mcollina/undici/issues/258
  16655. // Close after a HEAD request to interop with misbehaving servers
  16656. // that may send a body in the response.
  16657. socket[kReset] = true
  16658. }
  16659. if (upgrade || method === 'CONNECT') {
  16660. // On CONNECT or upgrade, block pipeline from dispatching further
  16661. // requests on this connection.
  16662. socket[kReset] = true
  16663. }
  16664. if (reset != null) {
  16665. socket[kReset] = reset
  16666. }
  16667. if (client[kMaxRequests] && socket[kCounter]++ >= client[kMaxRequests]) {
  16668. socket[kReset] = true
  16669. }
  16670. if (blocking) {
  16671. socket[kBlocking] = true
  16672. }
  16673. let header = `${method} ${path} HTTP/1.1\r\n`
  16674. if (typeof host === 'string') {
  16675. header += `host: ${host}\r\n`
  16676. } else {
  16677. header += client[kHostHeader]
  16678. }
  16679. if (upgrade) {
  16680. header += `connection: upgrade\r\nupgrade: ${upgrade}\r\n`
  16681. } else if (client[kPipelining] && !socket[kReset]) {
  16682. header += 'connection: keep-alive\r\n'
  16683. } else {
  16684. header += 'connection: close\r\n'
  16685. }
  16686. if (headers) {
  16687. header += headers
  16688. }
  16689. if (channels.sendHeaders.hasSubscribers) {
  16690. channels.sendHeaders.publish({ request, headers: header, socket })
  16691. }
  16692. /* istanbul ignore else: assertion */
  16693. if (!body || bodyLength === 0) {
  16694. if (contentLength === 0) {
  16695. socket.write(`${header}content-length: 0\r\n\r\n`, 'latin1')
  16696. } else {
  16697. assert(contentLength === null, 'no body must not have content length')
  16698. socket.write(`${header}\r\n`, 'latin1')
  16699. }
  16700. request.onRequestSent()
  16701. } else if (util.isBuffer(body)) {
  16702. assert(contentLength === body.byteLength, 'buffer body must have content length')
  16703. socket.cork()
  16704. socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1')
  16705. socket.write(body)
  16706. socket.uncork()
  16707. request.onBodySent(body)
  16708. request.onRequestSent()
  16709. if (!expectsPayload) {
  16710. socket[kReset] = true
  16711. }
  16712. } else if (util.isBlobLike(body)) {
  16713. if (typeof body.stream === 'function') {
  16714. writeIterable({ body: body.stream(), client, request, socket, contentLength, header, expectsPayload })
  16715. } else {
  16716. writeBlob({ body, client, request, socket, contentLength, header, expectsPayload })
  16717. }
  16718. } else if (util.isStream(body)) {
  16719. writeStream({ body, client, request, socket, contentLength, header, expectsPayload })
  16720. } else if (util.isIterable(body)) {
  16721. writeIterable({ body, client, request, socket, contentLength, header, expectsPayload })
  16722. } else {
  16723. assert(false)
  16724. }
  16725. return true
  16726. }
  16727. function writeH2 (client, session, request) {
  16728. const { body, method, path, host, upgrade, expectContinue, signal, headers: reqHeaders } = request
  16729. let headers
  16730. if (typeof reqHeaders === 'string') headers = Request[kHTTP2CopyHeaders](reqHeaders.trim())
  16731. else headers = reqHeaders
  16732. if (upgrade) {
  16733. errorRequest(client, request, new Error('Upgrade not supported for H2'))
  16734. return false
  16735. }
  16736. try {
  16737. // TODO(HTTP/2): Should we call onConnect immediately or on stream ready event?
  16738. request.onConnect((err) => {
  16739. if (request.aborted || request.completed) {
  16740. return
  16741. }
  16742. errorRequest(client, request, err || new RequestAbortedError())
  16743. })
  16744. } catch (err) {
  16745. errorRequest(client, request, err)
  16746. }
  16747. if (request.aborted) {
  16748. return false
  16749. }
  16750. /** @type {import('node:http2').ClientHttp2Stream} */
  16751. let stream
  16752. const h2State = client[kHTTP2SessionState]
  16753. headers[HTTP2_HEADER_AUTHORITY] = host || client[kHost]
  16754. headers[HTTP2_HEADER_METHOD] = method
  16755. if (method === 'CONNECT') {
  16756. session.ref()
  16757. // we are already connected, streams are pending, first request
  16758. // will create a new stream. We trigger a request to create the stream and wait until
  16759. // `ready` event is triggered
  16760. // We disabled endStream to allow the user to write to the stream
  16761. stream = session.request(headers, { endStream: false, signal })
  16762. if (stream.id && !stream.pending) {
  16763. request.onUpgrade(null, null, stream)
  16764. ++h2State.openStreams
  16765. } else {
  16766. stream.once('ready', () => {
  16767. request.onUpgrade(null, null, stream)
  16768. ++h2State.openStreams
  16769. })
  16770. }
  16771. stream.once('close', () => {
  16772. h2State.openStreams -= 1
  16773. // TODO(HTTP/2): unref only if current streams count is 0
  16774. if (h2State.openStreams === 0) session.unref()
  16775. })
  16776. return true
  16777. }
  16778. // https://tools.ietf.org/html/rfc7540#section-8.3
  16779. // :path and :scheme headers must be omited when sending CONNECT
  16780. headers[HTTP2_HEADER_PATH] = path
  16781. headers[HTTP2_HEADER_SCHEME] = 'https'
  16782. // https://tools.ietf.org/html/rfc7231#section-4.3.1
  16783. // https://tools.ietf.org/html/rfc7231#section-4.3.2
  16784. // https://tools.ietf.org/html/rfc7231#section-4.3.5
  16785. // Sending a payload body on a request that does not
  16786. // expect it can cause undefined behavior on some
  16787. // servers and corrupt connection state. Do not
  16788. // re-use the connection for further requests.
  16789. const expectsPayload = (
  16790. method === 'PUT' ||
  16791. method === 'POST' ||
  16792. method === 'PATCH'
  16793. )
  16794. if (body && typeof body.read === 'function') {
  16795. // Try to read EOF in order to get length.
  16796. body.read(0)
  16797. }
  16798. let contentLength = util.bodyLength(body)
  16799. if (contentLength == null) {
  16800. contentLength = request.contentLength
  16801. }
  16802. if (contentLength === 0 || !expectsPayload) {
  16803. // https://tools.ietf.org/html/rfc7230#section-3.3.2
  16804. // A user agent SHOULD NOT send a Content-Length header field when
  16805. // the request message does not contain a payload body and the method
  16806. // semantics do not anticipate such a body.
  16807. contentLength = null
  16808. }
  16809. // https://github.com/nodejs/undici/issues/2046
  16810. // A user agent may send a Content-Length header with 0 value, this should be allowed.
  16811. if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength != null && request.contentLength !== contentLength) {
  16812. if (client[kStrictContentLength]) {
  16813. errorRequest(client, request, new RequestContentLengthMismatchError())
  16814. return false
  16815. }
  16816. process.emitWarning(new RequestContentLengthMismatchError())
  16817. }
  16818. if (contentLength != null) {
  16819. assert(body, 'no body must not have content length')
  16820. headers[HTTP2_HEADER_CONTENT_LENGTH] = `${contentLength}`
  16821. }
  16822. session.ref()
  16823. const shouldEndStream = method === 'GET' || method === 'HEAD'
  16824. if (expectContinue) {
  16825. headers[HTTP2_HEADER_EXPECT] = '100-continue'
  16826. stream = session.request(headers, { endStream: shouldEndStream, signal })
  16827. stream.once('continue', writeBodyH2)
  16828. } else {
  16829. stream = session.request(headers, {
  16830. endStream: shouldEndStream,
  16831. signal
  16832. })
  16833. writeBodyH2()
  16834. }
  16835. // Increment counter as we have new several streams open
  16836. ++h2State.openStreams
  16837. stream.once('response', headers => {
  16838. const { [HTTP2_HEADER_STATUS]: statusCode, ...realHeaders } = headers
  16839. if (request.onHeaders(Number(statusCode), realHeaders, stream.resume.bind(stream), '') === false) {
  16840. stream.pause()
  16841. }
  16842. })
  16843. stream.once('end', () => {
  16844. request.onComplete([])
  16845. })
  16846. stream.on('data', (chunk) => {
  16847. if (request.onData(chunk) === false) {
  16848. stream.pause()
  16849. }
  16850. })
  16851. stream.once('close', () => {
  16852. h2State.openStreams -= 1
  16853. // TODO(HTTP/2): unref only if current streams count is 0
  16854. if (h2State.openStreams === 0) {
  16855. session.unref()
  16856. }
  16857. })
  16858. stream.once('error', function (err) {
  16859. if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) {
  16860. h2State.streams -= 1
  16861. util.destroy(stream, err)
  16862. }
  16863. })
  16864. stream.once('frameError', (type, code) => {
  16865. const err = new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`)
  16866. errorRequest(client, request, err)
  16867. if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) {
  16868. h2State.streams -= 1
  16869. util.destroy(stream, err)
  16870. }
  16871. })
  16872. // stream.on('aborted', () => {
  16873. // // TODO(HTTP/2): Support aborted
  16874. // })
  16875. // stream.on('timeout', () => {
  16876. // // TODO(HTTP/2): Support timeout
  16877. // })
  16878. // stream.on('push', headers => {
  16879. // // TODO(HTTP/2): Suppor push
  16880. // })
  16881. // stream.on('trailers', headers => {
  16882. // // TODO(HTTP/2): Support trailers
  16883. // })
  16884. return true
  16885. function writeBodyH2 () {
  16886. /* istanbul ignore else: assertion */
  16887. if (!body) {
  16888. request.onRequestSent()
  16889. } else if (util.isBuffer(body)) {
  16890. assert(contentLength === body.byteLength, 'buffer body must have content length')
  16891. stream.cork()
  16892. stream.write(body)
  16893. stream.uncork()
  16894. stream.end()
  16895. request.onBodySent(body)
  16896. request.onRequestSent()
  16897. } else if (util.isBlobLike(body)) {
  16898. if (typeof body.stream === 'function') {
  16899. writeIterable({
  16900. client,
  16901. request,
  16902. contentLength,
  16903. h2stream: stream,
  16904. expectsPayload,
  16905. body: body.stream(),
  16906. socket: client[kSocket],
  16907. header: ''
  16908. })
  16909. } else {
  16910. writeBlob({
  16911. body,
  16912. client,
  16913. request,
  16914. contentLength,
  16915. expectsPayload,
  16916. h2stream: stream,
  16917. header: '',
  16918. socket: client[kSocket]
  16919. })
  16920. }
  16921. } else if (util.isStream(body)) {
  16922. writeStream({
  16923. body,
  16924. client,
  16925. request,
  16926. contentLength,
  16927. expectsPayload,
  16928. socket: client[kSocket],
  16929. h2stream: stream,
  16930. header: ''
  16931. })
  16932. } else if (util.isIterable(body)) {
  16933. writeIterable({
  16934. body,
  16935. client,
  16936. request,
  16937. contentLength,
  16938. expectsPayload,
  16939. header: '',
  16940. h2stream: stream,
  16941. socket: client[kSocket]
  16942. })
  16943. } else {
  16944. assert(false)
  16945. }
  16946. }
  16947. }
  16948. function writeStream ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) {
  16949. assert(contentLength !== 0 || client[kRunning] === 0, 'stream body cannot be pipelined')
  16950. if (client[kHTTPConnVersion] === 'h2') {
  16951. // For HTTP/2, is enough to pipe the stream
  16952. const pipe = pipeline(
  16953. body,
  16954. h2stream,
  16955. (err) => {
  16956. if (err) {
  16957. util.destroy(body, err)
  16958. util.destroy(h2stream, err)
  16959. } else {
  16960. request.onRequestSent()
  16961. }
  16962. }
  16963. )
  16964. pipe.on('data', onPipeData)
  16965. pipe.once('end', () => {
  16966. pipe.removeListener('data', onPipeData)
  16967. util.destroy(pipe)
  16968. })
  16969. function onPipeData (chunk) {
  16970. request.onBodySent(chunk)
  16971. }
  16972. return
  16973. }
  16974. let finished = false
  16975. const writer = new AsyncWriter({ socket, request, contentLength, client, expectsPayload, header })
  16976. const onData = function (chunk) {
  16977. if (finished) {
  16978. return
  16979. }
  16980. try {
  16981. if (!writer.write(chunk) && this.pause) {
  16982. this.pause()
  16983. }
  16984. } catch (err) {
  16985. util.destroy(this, err)
  16986. }
  16987. }
  16988. const onDrain = function () {
  16989. if (finished) {
  16990. return
  16991. }
  16992. if (body.resume) {
  16993. body.resume()
  16994. }
  16995. }
  16996. const onAbort = function () {
  16997. if (finished) {
  16998. return
  16999. }
  17000. const err = new RequestAbortedError()
  17001. queueMicrotask(() => onFinished(err))
  17002. }
  17003. const onFinished = function (err) {
  17004. if (finished) {
  17005. return
  17006. }
  17007. finished = true
  17008. assert(socket.destroyed || (socket[kWriting] && client[kRunning] <= 1))
  17009. socket
  17010. .off('drain', onDrain)
  17011. .off('error', onFinished)
  17012. body
  17013. .removeListener('data', onData)
  17014. .removeListener('end', onFinished)
  17015. .removeListener('error', onFinished)
  17016. .removeListener('close', onAbort)
  17017. if (!err) {
  17018. try {
  17019. writer.end()
  17020. } catch (er) {
  17021. err = er
  17022. }
  17023. }
  17024. writer.destroy(err)
  17025. if (err && (err.code !== 'UND_ERR_INFO' || err.message !== 'reset')) {
  17026. util.destroy(body, err)
  17027. } else {
  17028. util.destroy(body)
  17029. }
  17030. }
  17031. body
  17032. .on('data', onData)
  17033. .on('end', onFinished)
  17034. .on('error', onFinished)
  17035. .on('close', onAbort)
  17036. if (body.resume) {
  17037. body.resume()
  17038. }
  17039. socket
  17040. .on('drain', onDrain)
  17041. .on('error', onFinished)
  17042. }
  17043. async function writeBlob ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) {
  17044. assert(contentLength === body.size, 'blob body must have content length')
  17045. const isH2 = client[kHTTPConnVersion] === 'h2'
  17046. try {
  17047. if (contentLength != null && contentLength !== body.size) {
  17048. throw new RequestContentLengthMismatchError()
  17049. }
  17050. const buffer = Buffer.from(await body.arrayBuffer())
  17051. if (isH2) {
  17052. h2stream.cork()
  17053. h2stream.write(buffer)
  17054. h2stream.uncork()
  17055. } else {
  17056. socket.cork()
  17057. socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1')
  17058. socket.write(buffer)
  17059. socket.uncork()
  17060. }
  17061. request.onBodySent(buffer)
  17062. request.onRequestSent()
  17063. if (!expectsPayload) {
  17064. socket[kReset] = true
  17065. }
  17066. resume(client)
  17067. } catch (err) {
  17068. util.destroy(isH2 ? h2stream : socket, err)
  17069. }
  17070. }
  17071. async function writeIterable ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) {
  17072. assert(contentLength !== 0 || client[kRunning] === 0, 'iterator body cannot be pipelined')
  17073. let callback = null
  17074. function onDrain () {
  17075. if (callback) {
  17076. const cb = callback
  17077. callback = null
  17078. cb()
  17079. }
  17080. }
  17081. const waitForDrain = () => new Promise((resolve, reject) => {
  17082. assert(callback === null)
  17083. if (socket[kError]) {
  17084. reject(socket[kError])
  17085. } else {
  17086. callback = resolve
  17087. }
  17088. })
  17089. if (client[kHTTPConnVersion] === 'h2') {
  17090. h2stream
  17091. .on('close', onDrain)
  17092. .on('drain', onDrain)
  17093. try {
  17094. // It's up to the user to somehow abort the async iterable.
  17095. for await (const chunk of body) {
  17096. if (socket[kError]) {
  17097. throw socket[kError]
  17098. }
  17099. const res = h2stream.write(chunk)
  17100. request.onBodySent(chunk)
  17101. if (!res) {
  17102. await waitForDrain()
  17103. }
  17104. }
  17105. } catch (err) {
  17106. h2stream.destroy(err)
  17107. } finally {
  17108. request.onRequestSent()
  17109. h2stream.end()
  17110. h2stream
  17111. .off('close', onDrain)
  17112. .off('drain', onDrain)
  17113. }
  17114. return
  17115. }
  17116. socket
  17117. .on('close', onDrain)
  17118. .on('drain', onDrain)
  17119. const writer = new AsyncWriter({ socket, request, contentLength, client, expectsPayload, header })
  17120. try {
  17121. // It's up to the user to somehow abort the async iterable.
  17122. for await (const chunk of body) {
  17123. if (socket[kError]) {
  17124. throw socket[kError]
  17125. }
  17126. if (!writer.write(chunk)) {
  17127. await waitForDrain()
  17128. }
  17129. }
  17130. writer.end()
  17131. } catch (err) {
  17132. writer.destroy(err)
  17133. } finally {
  17134. socket
  17135. .off('close', onDrain)
  17136. .off('drain', onDrain)
  17137. }
  17138. }
  17139. class AsyncWriter {
  17140. constructor ({ socket, request, contentLength, client, expectsPayload, header }) {
  17141. this.socket = socket
  17142. this.request = request
  17143. this.contentLength = contentLength
  17144. this.client = client
  17145. this.bytesWritten = 0
  17146. this.expectsPayload = expectsPayload
  17147. this.header = header
  17148. socket[kWriting] = true
  17149. }
  17150. write (chunk) {
  17151. const { socket, request, contentLength, client, bytesWritten, expectsPayload, header } = this
  17152. if (socket[kError]) {
  17153. throw socket[kError]
  17154. }
  17155. if (socket.destroyed) {
  17156. return false
  17157. }
  17158. const len = Buffer.byteLength(chunk)
  17159. if (!len) {
  17160. return true
  17161. }
  17162. // We should defer writing chunks.
  17163. if (contentLength !== null && bytesWritten + len > contentLength) {
  17164. if (client[kStrictContentLength]) {
  17165. throw new RequestContentLengthMismatchError()
  17166. }
  17167. process.emitWarning(new RequestContentLengthMismatchError())
  17168. }
  17169. socket.cork()
  17170. if (bytesWritten === 0) {
  17171. if (!expectsPayload) {
  17172. socket[kReset] = true
  17173. }
  17174. if (contentLength === null) {
  17175. socket.write(`${header}transfer-encoding: chunked\r\n`, 'latin1')
  17176. } else {
  17177. socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1')
  17178. }
  17179. }
  17180. if (contentLength === null) {
  17181. socket.write(`\r\n${len.toString(16)}\r\n`, 'latin1')
  17182. }
  17183. this.bytesWritten += len
  17184. const ret = socket.write(chunk)
  17185. socket.uncork()
  17186. request.onBodySent(chunk)
  17187. if (!ret) {
  17188. if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {
  17189. // istanbul ignore else: only for jest
  17190. if (socket[kParser].timeout.refresh) {
  17191. socket[kParser].timeout.refresh()
  17192. }
  17193. }
  17194. }
  17195. return ret
  17196. }
  17197. end () {
  17198. const { socket, contentLength, client, bytesWritten, expectsPayload, header, request } = this
  17199. request.onRequestSent()
  17200. socket[kWriting] = false
  17201. if (socket[kError]) {
  17202. throw socket[kError]
  17203. }
  17204. if (socket.destroyed) {
  17205. return
  17206. }
  17207. if (bytesWritten === 0) {
  17208. if (expectsPayload) {
  17209. // https://tools.ietf.org/html/rfc7230#section-3.3.2
  17210. // A user agent SHOULD send a Content-Length in a request message when
  17211. // no Transfer-Encoding is sent and the request method defines a meaning
  17212. // for an enclosed payload body.
  17213. socket.write(`${header}content-length: 0\r\n\r\n`, 'latin1')
  17214. } else {
  17215. socket.write(`${header}\r\n`, 'latin1')
  17216. }
  17217. } else if (contentLength === null) {
  17218. socket.write('\r\n0\r\n\r\n', 'latin1')
  17219. }
  17220. if (contentLength !== null && bytesWritten !== contentLength) {
  17221. if (client[kStrictContentLength]) {
  17222. throw new RequestContentLengthMismatchError()
  17223. } else {
  17224. process.emitWarning(new RequestContentLengthMismatchError())
  17225. }
  17226. }
  17227. if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {
  17228. // istanbul ignore else: only for jest
  17229. if (socket[kParser].timeout.refresh) {
  17230. socket[kParser].timeout.refresh()
  17231. }
  17232. }
  17233. resume(client)
  17234. }
  17235. destroy (err) {
  17236. const { socket, client } = this
  17237. socket[kWriting] = false
  17238. if (err) {
  17239. assert(client[kRunning] <= 1, 'pipeline should only contain this request')
  17240. util.destroy(socket, err)
  17241. }
  17242. }
  17243. }
  17244. function errorRequest (client, request, err) {
  17245. try {
  17246. request.onError(err)
  17247. assert(request.aborted)
  17248. } catch (err) {
  17249. client.emit('error', err)
  17250. }
  17251. }
  17252. module.exports = Client
  17253. /***/ }),
  17254. /***/ 6436:
  17255. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  17256. "use strict";
  17257. /* istanbul ignore file: only for Node 12 */
  17258. const { kConnected, kSize } = __nccwpck_require__(2785)
  17259. class CompatWeakRef {
  17260. constructor (value) {
  17261. this.value = value
  17262. }
  17263. deref () {
  17264. return this.value[kConnected] === 0 && this.value[kSize] === 0
  17265. ? undefined
  17266. : this.value
  17267. }
  17268. }
  17269. class CompatFinalizer {
  17270. constructor (finalizer) {
  17271. this.finalizer = finalizer
  17272. }
  17273. register (dispatcher, key) {
  17274. if (dispatcher.on) {
  17275. dispatcher.on('disconnect', () => {
  17276. if (dispatcher[kConnected] === 0 && dispatcher[kSize] === 0) {
  17277. this.finalizer(key)
  17278. }
  17279. })
  17280. }
  17281. }
  17282. }
  17283. module.exports = function () {
  17284. // FIXME: remove workaround when the Node bug is fixed
  17285. // https://github.com/nodejs/node/issues/49344#issuecomment-1741776308
  17286. if (process.env.NODE_V8_COVERAGE) {
  17287. return {
  17288. WeakRef: CompatWeakRef,
  17289. FinalizationRegistry: CompatFinalizer
  17290. }
  17291. }
  17292. return {
  17293. WeakRef: global.WeakRef || CompatWeakRef,
  17294. FinalizationRegistry: global.FinalizationRegistry || CompatFinalizer
  17295. }
  17296. }
  17297. /***/ }),
  17298. /***/ 663:
  17299. /***/ ((module) => {
  17300. "use strict";
  17301. // https://wicg.github.io/cookie-store/#cookie-maximum-attribute-value-size
  17302. const maxAttributeValueSize = 1024
  17303. // https://wicg.github.io/cookie-store/#cookie-maximum-name-value-pair-size
  17304. const maxNameValuePairSize = 4096
  17305. module.exports = {
  17306. maxAttributeValueSize,
  17307. maxNameValuePairSize
  17308. }
  17309. /***/ }),
  17310. /***/ 1724:
  17311. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  17312. "use strict";
  17313. const { parseSetCookie } = __nccwpck_require__(4408)
  17314. const { stringify } = __nccwpck_require__(3121)
  17315. const { webidl } = __nccwpck_require__(1744)
  17316. const { Headers } = __nccwpck_require__(554)
  17317. /**
  17318. * @typedef {Object} Cookie
  17319. * @property {string} name
  17320. * @property {string} value
  17321. * @property {Date|number|undefined} expires
  17322. * @property {number|undefined} maxAge
  17323. * @property {string|undefined} domain
  17324. * @property {string|undefined} path
  17325. * @property {boolean|undefined} secure
  17326. * @property {boolean|undefined} httpOnly
  17327. * @property {'Strict'|'Lax'|'None'} sameSite
  17328. * @property {string[]} unparsed
  17329. */
  17330. /**
  17331. * @param {Headers} headers
  17332. * @returns {Record<string, string>}
  17333. */
  17334. function getCookies (headers) {
  17335. webidl.argumentLengthCheck(arguments, 1, { header: 'getCookies' })
  17336. webidl.brandCheck(headers, Headers, { strict: false })
  17337. const cookie = headers.get('cookie')
  17338. const out = {}
  17339. if (!cookie) {
  17340. return out
  17341. }
  17342. for (const piece of cookie.split(';')) {
  17343. const [name, ...value] = piece.split('=')
  17344. out[name.trim()] = value.join('=')
  17345. }
  17346. return out
  17347. }
  17348. /**
  17349. * @param {Headers} headers
  17350. * @param {string} name
  17351. * @param {{ path?: string, domain?: string }|undefined} attributes
  17352. * @returns {void}
  17353. */
  17354. function deleteCookie (headers, name, attributes) {
  17355. webidl.argumentLengthCheck(arguments, 2, { header: 'deleteCookie' })
  17356. webidl.brandCheck(headers, Headers, { strict: false })
  17357. name = webidl.converters.DOMString(name)
  17358. attributes = webidl.converters.DeleteCookieAttributes(attributes)
  17359. // Matches behavior of
  17360. // https://github.com/denoland/deno_std/blob/63827b16330b82489a04614027c33b7904e08be5/http/cookie.ts#L278
  17361. setCookie(headers, {
  17362. name,
  17363. value: '',
  17364. expires: new Date(0),
  17365. ...attributes
  17366. })
  17367. }
  17368. /**
  17369. * @param {Headers} headers
  17370. * @returns {Cookie[]}
  17371. */
  17372. function getSetCookies (headers) {
  17373. webidl.argumentLengthCheck(arguments, 1, { header: 'getSetCookies' })
  17374. webidl.brandCheck(headers, Headers, { strict: false })
  17375. const cookies = headers.getSetCookie()
  17376. if (!cookies) {
  17377. return []
  17378. }
  17379. return cookies.map((pair) => parseSetCookie(pair))
  17380. }
  17381. /**
  17382. * @param {Headers} headers
  17383. * @param {Cookie} cookie
  17384. * @returns {void}
  17385. */
  17386. function setCookie (headers, cookie) {
  17387. webidl.argumentLengthCheck(arguments, 2, { header: 'setCookie' })
  17388. webidl.brandCheck(headers, Headers, { strict: false })
  17389. cookie = webidl.converters.Cookie(cookie)
  17390. const str = stringify(cookie)
  17391. if (str) {
  17392. headers.append('Set-Cookie', stringify(cookie))
  17393. }
  17394. }
  17395. webidl.converters.DeleteCookieAttributes = webidl.dictionaryConverter([
  17396. {
  17397. converter: webidl.nullableConverter(webidl.converters.DOMString),
  17398. key: 'path',
  17399. defaultValue: null
  17400. },
  17401. {
  17402. converter: webidl.nullableConverter(webidl.converters.DOMString),
  17403. key: 'domain',
  17404. defaultValue: null
  17405. }
  17406. ])
  17407. webidl.converters.Cookie = webidl.dictionaryConverter([
  17408. {
  17409. converter: webidl.converters.DOMString,
  17410. key: 'name'
  17411. },
  17412. {
  17413. converter: webidl.converters.DOMString,
  17414. key: 'value'
  17415. },
  17416. {
  17417. converter: webidl.nullableConverter((value) => {
  17418. if (typeof value === 'number') {
  17419. return webidl.converters['unsigned long long'](value)
  17420. }
  17421. return new Date(value)
  17422. }),
  17423. key: 'expires',
  17424. defaultValue: null
  17425. },
  17426. {
  17427. converter: webidl.nullableConverter(webidl.converters['long long']),
  17428. key: 'maxAge',
  17429. defaultValue: null
  17430. },
  17431. {
  17432. converter: webidl.nullableConverter(webidl.converters.DOMString),
  17433. key: 'domain',
  17434. defaultValue: null
  17435. },
  17436. {
  17437. converter: webidl.nullableConverter(webidl.converters.DOMString),
  17438. key: 'path',
  17439. defaultValue: null
  17440. },
  17441. {
  17442. converter: webidl.nullableConverter(webidl.converters.boolean),
  17443. key: 'secure',
  17444. defaultValue: null
  17445. },
  17446. {
  17447. converter: webidl.nullableConverter(webidl.converters.boolean),
  17448. key: 'httpOnly',
  17449. defaultValue: null
  17450. },
  17451. {
  17452. converter: webidl.converters.USVString,
  17453. key: 'sameSite',
  17454. allowedValues: ['Strict', 'Lax', 'None']
  17455. },
  17456. {
  17457. converter: webidl.sequenceConverter(webidl.converters.DOMString),
  17458. key: 'unparsed',
  17459. defaultValue: []
  17460. }
  17461. ])
  17462. module.exports = {
  17463. getCookies,
  17464. deleteCookie,
  17465. getSetCookies,
  17466. setCookie
  17467. }
  17468. /***/ }),
  17469. /***/ 4408:
  17470. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  17471. "use strict";
  17472. const { maxNameValuePairSize, maxAttributeValueSize } = __nccwpck_require__(663)
  17473. const { isCTLExcludingHtab } = __nccwpck_require__(3121)
  17474. const { collectASequenceOfCodePointsFast } = __nccwpck_require__(685)
  17475. const assert = __nccwpck_require__(9491)
  17476. /**
  17477. * @description Parses the field-value attributes of a set-cookie header string.
  17478. * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4
  17479. * @param {string} header
  17480. * @returns if the header is invalid, null will be returned
  17481. */
  17482. function parseSetCookie (header) {
  17483. // 1. If the set-cookie-string contains a %x00-08 / %x0A-1F / %x7F
  17484. // character (CTL characters excluding HTAB): Abort these steps and
  17485. // ignore the set-cookie-string entirely.
  17486. if (isCTLExcludingHtab(header)) {
  17487. return null
  17488. }
  17489. let nameValuePair = ''
  17490. let unparsedAttributes = ''
  17491. let name = ''
  17492. let value = ''
  17493. // 2. If the set-cookie-string contains a %x3B (";") character:
  17494. if (header.includes(';')) {
  17495. // 1. The name-value-pair string consists of the characters up to,
  17496. // but not including, the first %x3B (";"), and the unparsed-
  17497. // attributes consist of the remainder of the set-cookie-string
  17498. // (including the %x3B (";") in question).
  17499. const position = { position: 0 }
  17500. nameValuePair = collectASequenceOfCodePointsFast(';', header, position)
  17501. unparsedAttributes = header.slice(position.position)
  17502. } else {
  17503. // Otherwise:
  17504. // 1. The name-value-pair string consists of all the characters
  17505. // contained in the set-cookie-string, and the unparsed-
  17506. // attributes is the empty string.
  17507. nameValuePair = header
  17508. }
  17509. // 3. If the name-value-pair string lacks a %x3D ("=") character, then
  17510. // the name string is empty, and the value string is the value of
  17511. // name-value-pair.
  17512. if (!nameValuePair.includes('=')) {
  17513. value = nameValuePair
  17514. } else {
  17515. // Otherwise, the name string consists of the characters up to, but
  17516. // not including, the first %x3D ("=") character, and the (possibly
  17517. // empty) value string consists of the characters after the first
  17518. // %x3D ("=") character.
  17519. const position = { position: 0 }
  17520. name = collectASequenceOfCodePointsFast(
  17521. '=',
  17522. nameValuePair,
  17523. position
  17524. )
  17525. value = nameValuePair.slice(position.position + 1)
  17526. }
  17527. // 4. Remove any leading or trailing WSP characters from the name
  17528. // string and the value string.
  17529. name = name.trim()
  17530. value = value.trim()
  17531. // 5. If the sum of the lengths of the name string and the value string
  17532. // is more than 4096 octets, abort these steps and ignore the set-
  17533. // cookie-string entirely.
  17534. if (name.length + value.length > maxNameValuePairSize) {
  17535. return null
  17536. }
  17537. // 6. The cookie-name is the name string, and the cookie-value is the
  17538. // value string.
  17539. return {
  17540. name, value, ...parseUnparsedAttributes(unparsedAttributes)
  17541. }
  17542. }
  17543. /**
  17544. * Parses the remaining attributes of a set-cookie header
  17545. * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4
  17546. * @param {string} unparsedAttributes
  17547. * @param {[Object.<string, unknown>]={}} cookieAttributeList
  17548. */
  17549. function parseUnparsedAttributes (unparsedAttributes, cookieAttributeList = {}) {
  17550. // 1. If the unparsed-attributes string is empty, skip the rest of
  17551. // these steps.
  17552. if (unparsedAttributes.length === 0) {
  17553. return cookieAttributeList
  17554. }
  17555. // 2. Discard the first character of the unparsed-attributes (which
  17556. // will be a %x3B (";") character).
  17557. assert(unparsedAttributes[0] === ';')
  17558. unparsedAttributes = unparsedAttributes.slice(1)
  17559. let cookieAv = ''
  17560. // 3. If the remaining unparsed-attributes contains a %x3B (";")
  17561. // character:
  17562. if (unparsedAttributes.includes(';')) {
  17563. // 1. Consume the characters of the unparsed-attributes up to, but
  17564. // not including, the first %x3B (";") character.
  17565. cookieAv = collectASequenceOfCodePointsFast(
  17566. ';',
  17567. unparsedAttributes,
  17568. { position: 0 }
  17569. )
  17570. unparsedAttributes = unparsedAttributes.slice(cookieAv.length)
  17571. } else {
  17572. // Otherwise:
  17573. // 1. Consume the remainder of the unparsed-attributes.
  17574. cookieAv = unparsedAttributes
  17575. unparsedAttributes = ''
  17576. }
  17577. // Let the cookie-av string be the characters consumed in this step.
  17578. let attributeName = ''
  17579. let attributeValue = ''
  17580. // 4. If the cookie-av string contains a %x3D ("=") character:
  17581. if (cookieAv.includes('=')) {
  17582. // 1. The (possibly empty) attribute-name string consists of the
  17583. // characters up to, but not including, the first %x3D ("=")
  17584. // character, and the (possibly empty) attribute-value string
  17585. // consists of the characters after the first %x3D ("=")
  17586. // character.
  17587. const position = { position: 0 }
  17588. attributeName = collectASequenceOfCodePointsFast(
  17589. '=',
  17590. cookieAv,
  17591. position
  17592. )
  17593. attributeValue = cookieAv.slice(position.position + 1)
  17594. } else {
  17595. // Otherwise:
  17596. // 1. The attribute-name string consists of the entire cookie-av
  17597. // string, and the attribute-value string is empty.
  17598. attributeName = cookieAv
  17599. }
  17600. // 5. Remove any leading or trailing WSP characters from the attribute-
  17601. // name string and the attribute-value string.
  17602. attributeName = attributeName.trim()
  17603. attributeValue = attributeValue.trim()
  17604. // 6. If the attribute-value is longer than 1024 octets, ignore the
  17605. // cookie-av string and return to Step 1 of this algorithm.
  17606. if (attributeValue.length > maxAttributeValueSize) {
  17607. return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
  17608. }
  17609. // 7. Process the attribute-name and attribute-value according to the
  17610. // requirements in the following subsections. (Notice that
  17611. // attributes with unrecognized attribute-names are ignored.)
  17612. const attributeNameLowercase = attributeName.toLowerCase()
  17613. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.1
  17614. // If the attribute-name case-insensitively matches the string
  17615. // "Expires", the user agent MUST process the cookie-av as follows.
  17616. if (attributeNameLowercase === 'expires') {
  17617. // 1. Let the expiry-time be the result of parsing the attribute-value
  17618. // as cookie-date (see Section 5.1.1).
  17619. const expiryTime = new Date(attributeValue)
  17620. // 2. If the attribute-value failed to parse as a cookie date, ignore
  17621. // the cookie-av.
  17622. cookieAttributeList.expires = expiryTime
  17623. } else if (attributeNameLowercase === 'max-age') {
  17624. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.2
  17625. // If the attribute-name case-insensitively matches the string "Max-
  17626. // Age", the user agent MUST process the cookie-av as follows.
  17627. // 1. If the first character of the attribute-value is not a DIGIT or a
  17628. // "-" character, ignore the cookie-av.
  17629. const charCode = attributeValue.charCodeAt(0)
  17630. if ((charCode < 48 || charCode > 57) && attributeValue[0] !== '-') {
  17631. return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
  17632. }
  17633. // 2. If the remainder of attribute-value contains a non-DIGIT
  17634. // character, ignore the cookie-av.
  17635. if (!/^\d+$/.test(attributeValue)) {
  17636. return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
  17637. }
  17638. // 3. Let delta-seconds be the attribute-value converted to an integer.
  17639. const deltaSeconds = Number(attributeValue)
  17640. // 4. Let cookie-age-limit be the maximum age of the cookie (which
  17641. // SHOULD be 400 days or less, see Section 4.1.2.2).
  17642. // 5. Set delta-seconds to the smaller of its present value and cookie-
  17643. // age-limit.
  17644. // deltaSeconds = Math.min(deltaSeconds * 1000, maxExpiresMs)
  17645. // 6. If delta-seconds is less than or equal to zero (0), let expiry-
  17646. // time be the earliest representable date and time. Otherwise, let
  17647. // the expiry-time be the current date and time plus delta-seconds
  17648. // seconds.
  17649. // const expiryTime = deltaSeconds <= 0 ? Date.now() : Date.now() + deltaSeconds
  17650. // 7. Append an attribute to the cookie-attribute-list with an
  17651. // attribute-name of Max-Age and an attribute-value of expiry-time.
  17652. cookieAttributeList.maxAge = deltaSeconds
  17653. } else if (attributeNameLowercase === 'domain') {
  17654. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.3
  17655. // If the attribute-name case-insensitively matches the string "Domain",
  17656. // the user agent MUST process the cookie-av as follows.
  17657. // 1. Let cookie-domain be the attribute-value.
  17658. let cookieDomain = attributeValue
  17659. // 2. If cookie-domain starts with %x2E ("."), let cookie-domain be
  17660. // cookie-domain without its leading %x2E (".").
  17661. if (cookieDomain[0] === '.') {
  17662. cookieDomain = cookieDomain.slice(1)
  17663. }
  17664. // 3. Convert the cookie-domain to lower case.
  17665. cookieDomain = cookieDomain.toLowerCase()
  17666. // 4. Append an attribute to the cookie-attribute-list with an
  17667. // attribute-name of Domain and an attribute-value of cookie-domain.
  17668. cookieAttributeList.domain = cookieDomain
  17669. } else if (attributeNameLowercase === 'path') {
  17670. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.4
  17671. // If the attribute-name case-insensitively matches the string "Path",
  17672. // the user agent MUST process the cookie-av as follows.
  17673. // 1. If the attribute-value is empty or if the first character of the
  17674. // attribute-value is not %x2F ("/"):
  17675. let cookiePath = ''
  17676. if (attributeValue.length === 0 || attributeValue[0] !== '/') {
  17677. // 1. Let cookie-path be the default-path.
  17678. cookiePath = '/'
  17679. } else {
  17680. // Otherwise:
  17681. // 1. Let cookie-path be the attribute-value.
  17682. cookiePath = attributeValue
  17683. }
  17684. // 2. Append an attribute to the cookie-attribute-list with an
  17685. // attribute-name of Path and an attribute-value of cookie-path.
  17686. cookieAttributeList.path = cookiePath
  17687. } else if (attributeNameLowercase === 'secure') {
  17688. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.5
  17689. // If the attribute-name case-insensitively matches the string "Secure",
  17690. // the user agent MUST append an attribute to the cookie-attribute-list
  17691. // with an attribute-name of Secure and an empty attribute-value.
  17692. cookieAttributeList.secure = true
  17693. } else if (attributeNameLowercase === 'httponly') {
  17694. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.6
  17695. // If the attribute-name case-insensitively matches the string
  17696. // "HttpOnly", the user agent MUST append an attribute to the cookie-
  17697. // attribute-list with an attribute-name of HttpOnly and an empty
  17698. // attribute-value.
  17699. cookieAttributeList.httpOnly = true
  17700. } else if (attributeNameLowercase === 'samesite') {
  17701. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.7
  17702. // If the attribute-name case-insensitively matches the string
  17703. // "SameSite", the user agent MUST process the cookie-av as follows:
  17704. // 1. Let enforcement be "Default".
  17705. let enforcement = 'Default'
  17706. const attributeValueLowercase = attributeValue.toLowerCase()
  17707. // 2. If cookie-av's attribute-value is a case-insensitive match for
  17708. // "None", set enforcement to "None".
  17709. if (attributeValueLowercase.includes('none')) {
  17710. enforcement = 'None'
  17711. }
  17712. // 3. If cookie-av's attribute-value is a case-insensitive match for
  17713. // "Strict", set enforcement to "Strict".
  17714. if (attributeValueLowercase.includes('strict')) {
  17715. enforcement = 'Strict'
  17716. }
  17717. // 4. If cookie-av's attribute-value is a case-insensitive match for
  17718. // "Lax", set enforcement to "Lax".
  17719. if (attributeValueLowercase.includes('lax')) {
  17720. enforcement = 'Lax'
  17721. }
  17722. // 5. Append an attribute to the cookie-attribute-list with an
  17723. // attribute-name of "SameSite" and an attribute-value of
  17724. // enforcement.
  17725. cookieAttributeList.sameSite = enforcement
  17726. } else {
  17727. cookieAttributeList.unparsed ??= []
  17728. cookieAttributeList.unparsed.push(`${attributeName}=${attributeValue}`)
  17729. }
  17730. // 8. Return to Step 1 of this algorithm.
  17731. return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)
  17732. }
  17733. module.exports = {
  17734. parseSetCookie,
  17735. parseUnparsedAttributes
  17736. }
  17737. /***/ }),
  17738. /***/ 3121:
  17739. /***/ ((module) => {
  17740. "use strict";
  17741. /**
  17742. * @param {string} value
  17743. * @returns {boolean}
  17744. */
  17745. function isCTLExcludingHtab (value) {
  17746. if (value.length === 0) {
  17747. return false
  17748. }
  17749. for (const char of value) {
  17750. const code = char.charCodeAt(0)
  17751. if (
  17752. (code >= 0x00 || code <= 0x08) ||
  17753. (code >= 0x0A || code <= 0x1F) ||
  17754. code === 0x7F
  17755. ) {
  17756. return false
  17757. }
  17758. }
  17759. }
  17760. /**
  17761. CHAR = <any US-ASCII character (octets 0 - 127)>
  17762. token = 1*<any CHAR except CTLs or separators>
  17763. separators = "(" | ")" | "<" | ">" | "@"
  17764. | "," | ";" | ":" | "\" | <">
  17765. | "/" | "[" | "]" | "?" | "="
  17766. | "{" | "}" | SP | HT
  17767. * @param {string} name
  17768. */
  17769. function validateCookieName (name) {
  17770. for (const char of name) {
  17771. const code = char.charCodeAt(0)
  17772. if (
  17773. (code <= 0x20 || code > 0x7F) ||
  17774. char === '(' ||
  17775. char === ')' ||
  17776. char === '>' ||
  17777. char === '<' ||
  17778. char === '@' ||
  17779. char === ',' ||
  17780. char === ';' ||
  17781. char === ':' ||
  17782. char === '\\' ||
  17783. char === '"' ||
  17784. char === '/' ||
  17785. char === '[' ||
  17786. char === ']' ||
  17787. char === '?' ||
  17788. char === '=' ||
  17789. char === '{' ||
  17790. char === '}'
  17791. ) {
  17792. throw new Error('Invalid cookie name')
  17793. }
  17794. }
  17795. }
  17796. /**
  17797. cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE )
  17798. cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E
  17799. ; US-ASCII characters excluding CTLs,
  17800. ; whitespace DQUOTE, comma, semicolon,
  17801. ; and backslash
  17802. * @param {string} value
  17803. */
  17804. function validateCookieValue (value) {
  17805. for (const char of value) {
  17806. const code = char.charCodeAt(0)
  17807. if (
  17808. code < 0x21 || // exclude CTLs (0-31)
  17809. code === 0x22 ||
  17810. code === 0x2C ||
  17811. code === 0x3B ||
  17812. code === 0x5C ||
  17813. code > 0x7E // non-ascii
  17814. ) {
  17815. throw new Error('Invalid header value')
  17816. }
  17817. }
  17818. }
  17819. /**
  17820. * path-value = <any CHAR except CTLs or ";">
  17821. * @param {string} path
  17822. */
  17823. function validateCookiePath (path) {
  17824. for (const char of path) {
  17825. const code = char.charCodeAt(0)
  17826. if (code < 0x21 || char === ';') {
  17827. throw new Error('Invalid cookie path')
  17828. }
  17829. }
  17830. }
  17831. /**
  17832. * I have no idea why these values aren't allowed to be honest,
  17833. * but Deno tests these. - Khafra
  17834. * @param {string} domain
  17835. */
  17836. function validateCookieDomain (domain) {
  17837. if (
  17838. domain.startsWith('-') ||
  17839. domain.endsWith('.') ||
  17840. domain.endsWith('-')
  17841. ) {
  17842. throw new Error('Invalid cookie domain')
  17843. }
  17844. }
  17845. /**
  17846. * @see https://www.rfc-editor.org/rfc/rfc7231#section-7.1.1.1
  17847. * @param {number|Date} date
  17848. IMF-fixdate = day-name "," SP date1 SP time-of-day SP GMT
  17849. ; fixed length/zone/capitalization subset of the format
  17850. ; see Section 3.3 of [RFC5322]
  17851. day-name = %x4D.6F.6E ; "Mon", case-sensitive
  17852. / %x54.75.65 ; "Tue", case-sensitive
  17853. / %x57.65.64 ; "Wed", case-sensitive
  17854. / %x54.68.75 ; "Thu", case-sensitive
  17855. / %x46.72.69 ; "Fri", case-sensitive
  17856. / %x53.61.74 ; "Sat", case-sensitive
  17857. / %x53.75.6E ; "Sun", case-sensitive
  17858. date1 = day SP month SP year
  17859. ; e.g., 02 Jun 1982
  17860. day = 2DIGIT
  17861. month = %x4A.61.6E ; "Jan", case-sensitive
  17862. / %x46.65.62 ; "Feb", case-sensitive
  17863. / %x4D.61.72 ; "Mar", case-sensitive
  17864. / %x41.70.72 ; "Apr", case-sensitive
  17865. / %x4D.61.79 ; "May", case-sensitive
  17866. / %x4A.75.6E ; "Jun", case-sensitive
  17867. / %x4A.75.6C ; "Jul", case-sensitive
  17868. / %x41.75.67 ; "Aug", case-sensitive
  17869. / %x53.65.70 ; "Sep", case-sensitive
  17870. / %x4F.63.74 ; "Oct", case-sensitive
  17871. / %x4E.6F.76 ; "Nov", case-sensitive
  17872. / %x44.65.63 ; "Dec", case-sensitive
  17873. year = 4DIGIT
  17874. GMT = %x47.4D.54 ; "GMT", case-sensitive
  17875. time-of-day = hour ":" minute ":" second
  17876. ; 00:00:00 - 23:59:60 (leap second)
  17877. hour = 2DIGIT
  17878. minute = 2DIGIT
  17879. second = 2DIGIT
  17880. */
  17881. function toIMFDate (date) {
  17882. if (typeof date === 'number') {
  17883. date = new Date(date)
  17884. }
  17885. const days = [
  17886. 'Sun', 'Mon', 'Tue', 'Wed',
  17887. 'Thu', 'Fri', 'Sat'
  17888. ]
  17889. const months = [
  17890. 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
  17891. 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'
  17892. ]
  17893. const dayName = days[date.getUTCDay()]
  17894. const day = date.getUTCDate().toString().padStart(2, '0')
  17895. const month = months[date.getUTCMonth()]
  17896. const year = date.getUTCFullYear()
  17897. const hour = date.getUTCHours().toString().padStart(2, '0')
  17898. const minute = date.getUTCMinutes().toString().padStart(2, '0')
  17899. const second = date.getUTCSeconds().toString().padStart(2, '0')
  17900. return `${dayName}, ${day} ${month} ${year} ${hour}:${minute}:${second} GMT`
  17901. }
  17902. /**
  17903. max-age-av = "Max-Age=" non-zero-digit *DIGIT
  17904. ; In practice, both expires-av and max-age-av
  17905. ; are limited to dates representable by the
  17906. ; user agent.
  17907. * @param {number} maxAge
  17908. */
  17909. function validateCookieMaxAge (maxAge) {
  17910. if (maxAge < 0) {
  17911. throw new Error('Invalid cookie max-age')
  17912. }
  17913. }
  17914. /**
  17915. * @see https://www.rfc-editor.org/rfc/rfc6265#section-4.1.1
  17916. * @param {import('./index').Cookie} cookie
  17917. */
  17918. function stringify (cookie) {
  17919. if (cookie.name.length === 0) {
  17920. return null
  17921. }
  17922. validateCookieName(cookie.name)
  17923. validateCookieValue(cookie.value)
  17924. const out = [`${cookie.name}=${cookie.value}`]
  17925. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.1
  17926. // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.2
  17927. if (cookie.name.startsWith('__Secure-')) {
  17928. cookie.secure = true
  17929. }
  17930. if (cookie.name.startsWith('__Host-')) {
  17931. cookie.secure = true
  17932. cookie.domain = null
  17933. cookie.path = '/'
  17934. }
  17935. if (cookie.secure) {
  17936. out.push('Secure')
  17937. }
  17938. if (cookie.httpOnly) {
  17939. out.push('HttpOnly')
  17940. }
  17941. if (typeof cookie.maxAge === 'number') {
  17942. validateCookieMaxAge(cookie.maxAge)
  17943. out.push(`Max-Age=${cookie.maxAge}`)
  17944. }
  17945. if (cookie.domain) {
  17946. validateCookieDomain(cookie.domain)
  17947. out.push(`Domain=${cookie.domain}`)
  17948. }
  17949. if (cookie.path) {
  17950. validateCookiePath(cookie.path)
  17951. out.push(`Path=${cookie.path}`)
  17952. }
  17953. if (cookie.expires && cookie.expires.toString() !== 'Invalid Date') {
  17954. out.push(`Expires=${toIMFDate(cookie.expires)}`)
  17955. }
  17956. if (cookie.sameSite) {
  17957. out.push(`SameSite=${cookie.sameSite}`)
  17958. }
  17959. for (const part of cookie.unparsed) {
  17960. if (!part.includes('=')) {
  17961. throw new Error('Invalid unparsed')
  17962. }
  17963. const [key, ...value] = part.split('=')
  17964. out.push(`${key.trim()}=${value.join('=')}`)
  17965. }
  17966. return out.join('; ')
  17967. }
  17968. module.exports = {
  17969. isCTLExcludingHtab,
  17970. validateCookieName,
  17971. validateCookiePath,
  17972. validateCookieValue,
  17973. toIMFDate,
  17974. stringify
  17975. }
  17976. /***/ }),
  17977. /***/ 2067:
  17978. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  17979. "use strict";
  17980. const net = __nccwpck_require__(1808)
  17981. const assert = __nccwpck_require__(9491)
  17982. const util = __nccwpck_require__(3983)
  17983. const { InvalidArgumentError, ConnectTimeoutError } = __nccwpck_require__(8045)
  17984. let tls // include tls conditionally since it is not always available
  17985. // TODO: session re-use does not wait for the first
  17986. // connection to resolve the session and might therefore
  17987. // resolve the same servername multiple times even when
  17988. // re-use is enabled.
  17989. let SessionCache
  17990. // FIXME: remove workaround when the Node bug is fixed
  17991. // https://github.com/nodejs/node/issues/49344#issuecomment-1741776308
  17992. if (global.FinalizationRegistry && !process.env.NODE_V8_COVERAGE) {
  17993. SessionCache = class WeakSessionCache {
  17994. constructor (maxCachedSessions) {
  17995. this._maxCachedSessions = maxCachedSessions
  17996. this._sessionCache = new Map()
  17997. this._sessionRegistry = new global.FinalizationRegistry((key) => {
  17998. if (this._sessionCache.size < this._maxCachedSessions) {
  17999. return
  18000. }
  18001. const ref = this._sessionCache.get(key)
  18002. if (ref !== undefined && ref.deref() === undefined) {
  18003. this._sessionCache.delete(key)
  18004. }
  18005. })
  18006. }
  18007. get (sessionKey) {
  18008. const ref = this._sessionCache.get(sessionKey)
  18009. return ref ? ref.deref() : null
  18010. }
  18011. set (sessionKey, session) {
  18012. if (this._maxCachedSessions === 0) {
  18013. return
  18014. }
  18015. this._sessionCache.set(sessionKey, new WeakRef(session))
  18016. this._sessionRegistry.register(session, sessionKey)
  18017. }
  18018. }
  18019. } else {
  18020. SessionCache = class SimpleSessionCache {
  18021. constructor (maxCachedSessions) {
  18022. this._maxCachedSessions = maxCachedSessions
  18023. this._sessionCache = new Map()
  18024. }
  18025. get (sessionKey) {
  18026. return this._sessionCache.get(sessionKey)
  18027. }
  18028. set (sessionKey, session) {
  18029. if (this._maxCachedSessions === 0) {
  18030. return
  18031. }
  18032. if (this._sessionCache.size >= this._maxCachedSessions) {
  18033. // remove the oldest session
  18034. const { value: oldestKey } = this._sessionCache.keys().next()
  18035. this._sessionCache.delete(oldestKey)
  18036. }
  18037. this._sessionCache.set(sessionKey, session)
  18038. }
  18039. }
  18040. }
  18041. function buildConnector ({ allowH2, maxCachedSessions, socketPath, timeout, ...opts }) {
  18042. if (maxCachedSessions != null && (!Number.isInteger(maxCachedSessions) || maxCachedSessions < 0)) {
  18043. throw new InvalidArgumentError('maxCachedSessions must be a positive integer or zero')
  18044. }
  18045. const options = { path: socketPath, ...opts }
  18046. const sessionCache = new SessionCache(maxCachedSessions == null ? 100 : maxCachedSessions)
  18047. timeout = timeout == null ? 10e3 : timeout
  18048. allowH2 = allowH2 != null ? allowH2 : false
  18049. return function connect ({ hostname, host, protocol, port, servername, localAddress, httpSocket }, callback) {
  18050. let socket
  18051. if (protocol === 'https:') {
  18052. if (!tls) {
  18053. tls = __nccwpck_require__(4404)
  18054. }
  18055. servername = servername || options.servername || util.getServerName(host) || null
  18056. const sessionKey = servername || hostname
  18057. const session = sessionCache.get(sessionKey) || null
  18058. assert(sessionKey)
  18059. socket = tls.connect({
  18060. highWaterMark: 16384, // TLS in node can't have bigger HWM anyway...
  18061. ...options,
  18062. servername,
  18063. session,
  18064. localAddress,
  18065. // TODO(HTTP/2): Add support for h2c
  18066. ALPNProtocols: allowH2 ? ['http/1.1', 'h2'] : ['http/1.1'],
  18067. socket: httpSocket, // upgrade socket connection
  18068. port: port || 443,
  18069. host: hostname
  18070. })
  18071. socket
  18072. .on('session', function (session) {
  18073. // TODO (fix): Can a session become invalid once established? Don't think so?
  18074. sessionCache.set(sessionKey, session)
  18075. })
  18076. } else {
  18077. assert(!httpSocket, 'httpSocket can only be sent on TLS update')
  18078. socket = net.connect({
  18079. highWaterMark: 64 * 1024, // Same as nodejs fs streams.
  18080. ...options,
  18081. localAddress,
  18082. port: port || 80,
  18083. host: hostname
  18084. })
  18085. }
  18086. // Set TCP keep alive options on the socket here instead of in connect() for the case of assigning the socket
  18087. if (options.keepAlive == null || options.keepAlive) {
  18088. const keepAliveInitialDelay = options.keepAliveInitialDelay === undefined ? 60e3 : options.keepAliveInitialDelay
  18089. socket.setKeepAlive(true, keepAliveInitialDelay)
  18090. }
  18091. const cancelTimeout = setupTimeout(() => onConnectTimeout(socket), timeout)
  18092. socket
  18093. .setNoDelay(true)
  18094. .once(protocol === 'https:' ? 'secureConnect' : 'connect', function () {
  18095. cancelTimeout()
  18096. if (callback) {
  18097. const cb = callback
  18098. callback = null
  18099. cb(null, this)
  18100. }
  18101. })
  18102. .on('error', function (err) {
  18103. cancelTimeout()
  18104. if (callback) {
  18105. const cb = callback
  18106. callback = null
  18107. cb(err)
  18108. }
  18109. })
  18110. return socket
  18111. }
  18112. }
  18113. function setupTimeout (onConnectTimeout, timeout) {
  18114. if (!timeout) {
  18115. return () => {}
  18116. }
  18117. let s1 = null
  18118. let s2 = null
  18119. const timeoutId = setTimeout(() => {
  18120. // setImmediate is added to make sure that we priotorise socket error events over timeouts
  18121. s1 = setImmediate(() => {
  18122. if (process.platform === 'win32') {
  18123. // Windows needs an extra setImmediate probably due to implementation differences in the socket logic
  18124. s2 = setImmediate(() => onConnectTimeout())
  18125. } else {
  18126. onConnectTimeout()
  18127. }
  18128. })
  18129. }, timeout)
  18130. return () => {
  18131. clearTimeout(timeoutId)
  18132. clearImmediate(s1)
  18133. clearImmediate(s2)
  18134. }
  18135. }
  18136. function onConnectTimeout (socket) {
  18137. util.destroy(socket, new ConnectTimeoutError())
  18138. }
  18139. module.exports = buildConnector
  18140. /***/ }),
  18141. /***/ 4462:
  18142. /***/ ((module) => {
  18143. "use strict";
  18144. /** @type {Record<string, string | undefined>} */
  18145. const headerNameLowerCasedRecord = {}
  18146. // https://developer.mozilla.org/docs/Web/HTTP/Headers
  18147. const wellknownHeaderNames = [
  18148. 'Accept',
  18149. 'Accept-Encoding',
  18150. 'Accept-Language',
  18151. 'Accept-Ranges',
  18152. 'Access-Control-Allow-Credentials',
  18153. 'Access-Control-Allow-Headers',
  18154. 'Access-Control-Allow-Methods',
  18155. 'Access-Control-Allow-Origin',
  18156. 'Access-Control-Expose-Headers',
  18157. 'Access-Control-Max-Age',
  18158. 'Access-Control-Request-Headers',
  18159. 'Access-Control-Request-Method',
  18160. 'Age',
  18161. 'Allow',
  18162. 'Alt-Svc',
  18163. 'Alt-Used',
  18164. 'Authorization',
  18165. 'Cache-Control',
  18166. 'Clear-Site-Data',
  18167. 'Connection',
  18168. 'Content-Disposition',
  18169. 'Content-Encoding',
  18170. 'Content-Language',
  18171. 'Content-Length',
  18172. 'Content-Location',
  18173. 'Content-Range',
  18174. 'Content-Security-Policy',
  18175. 'Content-Security-Policy-Report-Only',
  18176. 'Content-Type',
  18177. 'Cookie',
  18178. 'Cross-Origin-Embedder-Policy',
  18179. 'Cross-Origin-Opener-Policy',
  18180. 'Cross-Origin-Resource-Policy',
  18181. 'Date',
  18182. 'Device-Memory',
  18183. 'Downlink',
  18184. 'ECT',
  18185. 'ETag',
  18186. 'Expect',
  18187. 'Expect-CT',
  18188. 'Expires',
  18189. 'Forwarded',
  18190. 'From',
  18191. 'Host',
  18192. 'If-Match',
  18193. 'If-Modified-Since',
  18194. 'If-None-Match',
  18195. 'If-Range',
  18196. 'If-Unmodified-Since',
  18197. 'Keep-Alive',
  18198. 'Last-Modified',
  18199. 'Link',
  18200. 'Location',
  18201. 'Max-Forwards',
  18202. 'Origin',
  18203. 'Permissions-Policy',
  18204. 'Pragma',
  18205. 'Proxy-Authenticate',
  18206. 'Proxy-Authorization',
  18207. 'RTT',
  18208. 'Range',
  18209. 'Referer',
  18210. 'Referrer-Policy',
  18211. 'Refresh',
  18212. 'Retry-After',
  18213. 'Sec-WebSocket-Accept',
  18214. 'Sec-WebSocket-Extensions',
  18215. 'Sec-WebSocket-Key',
  18216. 'Sec-WebSocket-Protocol',
  18217. 'Sec-WebSocket-Version',
  18218. 'Server',
  18219. 'Server-Timing',
  18220. 'Service-Worker-Allowed',
  18221. 'Service-Worker-Navigation-Preload',
  18222. 'Set-Cookie',
  18223. 'SourceMap',
  18224. 'Strict-Transport-Security',
  18225. 'Supports-Loading-Mode',
  18226. 'TE',
  18227. 'Timing-Allow-Origin',
  18228. 'Trailer',
  18229. 'Transfer-Encoding',
  18230. 'Upgrade',
  18231. 'Upgrade-Insecure-Requests',
  18232. 'User-Agent',
  18233. 'Vary',
  18234. 'Via',
  18235. 'WWW-Authenticate',
  18236. 'X-Content-Type-Options',
  18237. 'X-DNS-Prefetch-Control',
  18238. 'X-Frame-Options',
  18239. 'X-Permitted-Cross-Domain-Policies',
  18240. 'X-Powered-By',
  18241. 'X-Requested-With',
  18242. 'X-XSS-Protection'
  18243. ]
  18244. for (let i = 0; i < wellknownHeaderNames.length; ++i) {
  18245. const key = wellknownHeaderNames[i]
  18246. const lowerCasedKey = key.toLowerCase()
  18247. headerNameLowerCasedRecord[key] = headerNameLowerCasedRecord[lowerCasedKey] =
  18248. lowerCasedKey
  18249. }
  18250. // Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`.
  18251. Object.setPrototypeOf(headerNameLowerCasedRecord, null)
  18252. module.exports = {
  18253. wellknownHeaderNames,
  18254. headerNameLowerCasedRecord
  18255. }
  18256. /***/ }),
  18257. /***/ 8045:
  18258. /***/ ((module) => {
  18259. "use strict";
  18260. class UndiciError extends Error {
  18261. constructor (message) {
  18262. super(message)
  18263. this.name = 'UndiciError'
  18264. this.code = 'UND_ERR'
  18265. }
  18266. }
  18267. class ConnectTimeoutError extends UndiciError {
  18268. constructor (message) {
  18269. super(message)
  18270. Error.captureStackTrace(this, ConnectTimeoutError)
  18271. this.name = 'ConnectTimeoutError'
  18272. this.message = message || 'Connect Timeout Error'
  18273. this.code = 'UND_ERR_CONNECT_TIMEOUT'
  18274. }
  18275. }
  18276. class HeadersTimeoutError extends UndiciError {
  18277. constructor (message) {
  18278. super(message)
  18279. Error.captureStackTrace(this, HeadersTimeoutError)
  18280. this.name = 'HeadersTimeoutError'
  18281. this.message = message || 'Headers Timeout Error'
  18282. this.code = 'UND_ERR_HEADERS_TIMEOUT'
  18283. }
  18284. }
  18285. class HeadersOverflowError extends UndiciError {
  18286. constructor (message) {
  18287. super(message)
  18288. Error.captureStackTrace(this, HeadersOverflowError)
  18289. this.name = 'HeadersOverflowError'
  18290. this.message = message || 'Headers Overflow Error'
  18291. this.code = 'UND_ERR_HEADERS_OVERFLOW'
  18292. }
  18293. }
  18294. class BodyTimeoutError extends UndiciError {
  18295. constructor (message) {
  18296. super(message)
  18297. Error.captureStackTrace(this, BodyTimeoutError)
  18298. this.name = 'BodyTimeoutError'
  18299. this.message = message || 'Body Timeout Error'
  18300. this.code = 'UND_ERR_BODY_TIMEOUT'
  18301. }
  18302. }
  18303. class ResponseStatusCodeError extends UndiciError {
  18304. constructor (message, statusCode, headers, body) {
  18305. super(message)
  18306. Error.captureStackTrace(this, ResponseStatusCodeError)
  18307. this.name = 'ResponseStatusCodeError'
  18308. this.message = message || 'Response Status Code Error'
  18309. this.code = 'UND_ERR_RESPONSE_STATUS_CODE'
  18310. this.body = body
  18311. this.status = statusCode
  18312. this.statusCode = statusCode
  18313. this.headers = headers
  18314. }
  18315. }
  18316. class InvalidArgumentError extends UndiciError {
  18317. constructor (message) {
  18318. super(message)
  18319. Error.captureStackTrace(this, InvalidArgumentError)
  18320. this.name = 'InvalidArgumentError'
  18321. this.message = message || 'Invalid Argument Error'
  18322. this.code = 'UND_ERR_INVALID_ARG'
  18323. }
  18324. }
  18325. class InvalidReturnValueError extends UndiciError {
  18326. constructor (message) {
  18327. super(message)
  18328. Error.captureStackTrace(this, InvalidReturnValueError)
  18329. this.name = 'InvalidReturnValueError'
  18330. this.message = message || 'Invalid Return Value Error'
  18331. this.code = 'UND_ERR_INVALID_RETURN_VALUE'
  18332. }
  18333. }
  18334. class RequestAbortedError extends UndiciError {
  18335. constructor (message) {
  18336. super(message)
  18337. Error.captureStackTrace(this, RequestAbortedError)
  18338. this.name = 'AbortError'
  18339. this.message = message || 'Request aborted'
  18340. this.code = 'UND_ERR_ABORTED'
  18341. }
  18342. }
  18343. class InformationalError extends UndiciError {
  18344. constructor (message) {
  18345. super(message)
  18346. Error.captureStackTrace(this, InformationalError)
  18347. this.name = 'InformationalError'
  18348. this.message = message || 'Request information'
  18349. this.code = 'UND_ERR_INFO'
  18350. }
  18351. }
  18352. class RequestContentLengthMismatchError extends UndiciError {
  18353. constructor (message) {
  18354. super(message)
  18355. Error.captureStackTrace(this, RequestContentLengthMismatchError)
  18356. this.name = 'RequestContentLengthMismatchError'
  18357. this.message = message || 'Request body length does not match content-length header'
  18358. this.code = 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH'
  18359. }
  18360. }
  18361. class ResponseContentLengthMismatchError extends UndiciError {
  18362. constructor (message) {
  18363. super(message)
  18364. Error.captureStackTrace(this, ResponseContentLengthMismatchError)
  18365. this.name = 'ResponseContentLengthMismatchError'
  18366. this.message = message || 'Response body length does not match content-length header'
  18367. this.code = 'UND_ERR_RES_CONTENT_LENGTH_MISMATCH'
  18368. }
  18369. }
  18370. class ClientDestroyedError extends UndiciError {
  18371. constructor (message) {
  18372. super(message)
  18373. Error.captureStackTrace(this, ClientDestroyedError)
  18374. this.name = 'ClientDestroyedError'
  18375. this.message = message || 'The client is destroyed'
  18376. this.code = 'UND_ERR_DESTROYED'
  18377. }
  18378. }
  18379. class ClientClosedError extends UndiciError {
  18380. constructor (message) {
  18381. super(message)
  18382. Error.captureStackTrace(this, ClientClosedError)
  18383. this.name = 'ClientClosedError'
  18384. this.message = message || 'The client is closed'
  18385. this.code = 'UND_ERR_CLOSED'
  18386. }
  18387. }
  18388. class SocketError extends UndiciError {
  18389. constructor (message, socket) {
  18390. super(message)
  18391. Error.captureStackTrace(this, SocketError)
  18392. this.name = 'SocketError'
  18393. this.message = message || 'Socket error'
  18394. this.code = 'UND_ERR_SOCKET'
  18395. this.socket = socket
  18396. }
  18397. }
  18398. class NotSupportedError extends UndiciError {
  18399. constructor (message) {
  18400. super(message)
  18401. Error.captureStackTrace(this, NotSupportedError)
  18402. this.name = 'NotSupportedError'
  18403. this.message = message || 'Not supported error'
  18404. this.code = 'UND_ERR_NOT_SUPPORTED'
  18405. }
  18406. }
  18407. class BalancedPoolMissingUpstreamError extends UndiciError {
  18408. constructor (message) {
  18409. super(message)
  18410. Error.captureStackTrace(this, NotSupportedError)
  18411. this.name = 'MissingUpstreamError'
  18412. this.message = message || 'No upstream has been added to the BalancedPool'
  18413. this.code = 'UND_ERR_BPL_MISSING_UPSTREAM'
  18414. }
  18415. }
  18416. class HTTPParserError extends Error {
  18417. constructor (message, code, data) {
  18418. super(message)
  18419. Error.captureStackTrace(this, HTTPParserError)
  18420. this.name = 'HTTPParserError'
  18421. this.code = code ? `HPE_${code}` : undefined
  18422. this.data = data ? data.toString() : undefined
  18423. }
  18424. }
  18425. class ResponseExceededMaxSizeError extends UndiciError {
  18426. constructor (message) {
  18427. super(message)
  18428. Error.captureStackTrace(this, ResponseExceededMaxSizeError)
  18429. this.name = 'ResponseExceededMaxSizeError'
  18430. this.message = message || 'Response content exceeded max size'
  18431. this.code = 'UND_ERR_RES_EXCEEDED_MAX_SIZE'
  18432. }
  18433. }
  18434. class RequestRetryError extends UndiciError {
  18435. constructor (message, code, { headers, data }) {
  18436. super(message)
  18437. Error.captureStackTrace(this, RequestRetryError)
  18438. this.name = 'RequestRetryError'
  18439. this.message = message || 'Request retry error'
  18440. this.code = 'UND_ERR_REQ_RETRY'
  18441. this.statusCode = code
  18442. this.data = data
  18443. this.headers = headers
  18444. }
  18445. }
  18446. module.exports = {
  18447. HTTPParserError,
  18448. UndiciError,
  18449. HeadersTimeoutError,
  18450. HeadersOverflowError,
  18451. BodyTimeoutError,
  18452. RequestContentLengthMismatchError,
  18453. ConnectTimeoutError,
  18454. ResponseStatusCodeError,
  18455. InvalidArgumentError,
  18456. InvalidReturnValueError,
  18457. RequestAbortedError,
  18458. ClientDestroyedError,
  18459. ClientClosedError,
  18460. InformationalError,
  18461. SocketError,
  18462. NotSupportedError,
  18463. ResponseContentLengthMismatchError,
  18464. BalancedPoolMissingUpstreamError,
  18465. ResponseExceededMaxSizeError,
  18466. RequestRetryError
  18467. }
  18468. /***/ }),
  18469. /***/ 2905:
  18470. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  18471. "use strict";
  18472. const {
  18473. InvalidArgumentError,
  18474. NotSupportedError
  18475. } = __nccwpck_require__(8045)
  18476. const assert = __nccwpck_require__(9491)
  18477. const { kHTTP2BuildRequest, kHTTP2CopyHeaders, kHTTP1BuildRequest } = __nccwpck_require__(2785)
  18478. const util = __nccwpck_require__(3983)
  18479. // tokenRegExp and headerCharRegex have been lifted from
  18480. // https://github.com/nodejs/node/blob/main/lib/_http_common.js
  18481. /**
  18482. * Verifies that the given val is a valid HTTP token
  18483. * per the rules defined in RFC 7230
  18484. * See https://tools.ietf.org/html/rfc7230#section-3.2.6
  18485. */
  18486. const tokenRegExp = /^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/
  18487. /**
  18488. * Matches if val contains an invalid field-vchar
  18489. * field-value = *( field-content / obs-fold )
  18490. * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]
  18491. * field-vchar = VCHAR / obs-text
  18492. */
  18493. const headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/
  18494. // Verifies that a given path is valid does not contain control chars \x00 to \x20
  18495. const invalidPathRegex = /[^\u0021-\u00ff]/
  18496. const kHandler = Symbol('handler')
  18497. const channels = {}
  18498. let extractBody
  18499. try {
  18500. const diagnosticsChannel = __nccwpck_require__(7643)
  18501. channels.create = diagnosticsChannel.channel('undici:request:create')
  18502. channels.bodySent = diagnosticsChannel.channel('undici:request:bodySent')
  18503. channels.headers = diagnosticsChannel.channel('undici:request:headers')
  18504. channels.trailers = diagnosticsChannel.channel('undici:request:trailers')
  18505. channels.error = diagnosticsChannel.channel('undici:request:error')
  18506. } catch {
  18507. channels.create = { hasSubscribers: false }
  18508. channels.bodySent = { hasSubscribers: false }
  18509. channels.headers = { hasSubscribers: false }
  18510. channels.trailers = { hasSubscribers: false }
  18511. channels.error = { hasSubscribers: false }
  18512. }
  18513. class Request {
  18514. constructor (origin, {
  18515. path,
  18516. method,
  18517. body,
  18518. headers,
  18519. query,
  18520. idempotent,
  18521. blocking,
  18522. upgrade,
  18523. headersTimeout,
  18524. bodyTimeout,
  18525. reset,
  18526. throwOnError,
  18527. expectContinue
  18528. }, handler) {
  18529. if (typeof path !== 'string') {
  18530. throw new InvalidArgumentError('path must be a string')
  18531. } else if (
  18532. path[0] !== '/' &&
  18533. !(path.startsWith('http://') || path.startsWith('https://')) &&
  18534. method !== 'CONNECT'
  18535. ) {
  18536. throw new InvalidArgumentError('path must be an absolute URL or start with a slash')
  18537. } else if (invalidPathRegex.exec(path) !== null) {
  18538. throw new InvalidArgumentError('invalid request path')
  18539. }
  18540. if (typeof method !== 'string') {
  18541. throw new InvalidArgumentError('method must be a string')
  18542. } else if (tokenRegExp.exec(method) === null) {
  18543. throw new InvalidArgumentError('invalid request method')
  18544. }
  18545. if (upgrade && typeof upgrade !== 'string') {
  18546. throw new InvalidArgumentError('upgrade must be a string')
  18547. }
  18548. if (headersTimeout != null && (!Number.isFinite(headersTimeout) || headersTimeout < 0)) {
  18549. throw new InvalidArgumentError('invalid headersTimeout')
  18550. }
  18551. if (bodyTimeout != null && (!Number.isFinite(bodyTimeout) || bodyTimeout < 0)) {
  18552. throw new InvalidArgumentError('invalid bodyTimeout')
  18553. }
  18554. if (reset != null && typeof reset !== 'boolean') {
  18555. throw new InvalidArgumentError('invalid reset')
  18556. }
  18557. if (expectContinue != null && typeof expectContinue !== 'boolean') {
  18558. throw new InvalidArgumentError('invalid expectContinue')
  18559. }
  18560. this.headersTimeout = headersTimeout
  18561. this.bodyTimeout = bodyTimeout
  18562. this.throwOnError = throwOnError === true
  18563. this.method = method
  18564. this.abort = null
  18565. if (body == null) {
  18566. this.body = null
  18567. } else if (util.isStream(body)) {
  18568. this.body = body
  18569. const rState = this.body._readableState
  18570. if (!rState || !rState.autoDestroy) {
  18571. this.endHandler = function autoDestroy () {
  18572. util.destroy(this)
  18573. }
  18574. this.body.on('end', this.endHandler)
  18575. }
  18576. this.errorHandler = err => {
  18577. if (this.abort) {
  18578. this.abort(err)
  18579. } else {
  18580. this.error = err
  18581. }
  18582. }
  18583. this.body.on('error', this.errorHandler)
  18584. } else if (util.isBuffer(body)) {
  18585. this.body = body.byteLength ? body : null
  18586. } else if (ArrayBuffer.isView(body)) {
  18587. this.body = body.buffer.byteLength ? Buffer.from(body.buffer, body.byteOffset, body.byteLength) : null
  18588. } else if (body instanceof ArrayBuffer) {
  18589. this.body = body.byteLength ? Buffer.from(body) : null
  18590. } else if (typeof body === 'string') {
  18591. this.body = body.length ? Buffer.from(body) : null
  18592. } else if (util.isFormDataLike(body) || util.isIterable(body) || util.isBlobLike(body)) {
  18593. this.body = body
  18594. } else {
  18595. throw new InvalidArgumentError('body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable')
  18596. }
  18597. this.completed = false
  18598. this.aborted = false
  18599. this.upgrade = upgrade || null
  18600. this.path = query ? util.buildURL(path, query) : path
  18601. this.origin = origin
  18602. this.idempotent = idempotent == null
  18603. ? method === 'HEAD' || method === 'GET'
  18604. : idempotent
  18605. this.blocking = blocking == null ? false : blocking
  18606. this.reset = reset == null ? null : reset
  18607. this.host = null
  18608. this.contentLength = null
  18609. this.contentType = null
  18610. this.headers = ''
  18611. // Only for H2
  18612. this.expectContinue = expectContinue != null ? expectContinue : false
  18613. if (Array.isArray(headers)) {
  18614. if (headers.length % 2 !== 0) {
  18615. throw new InvalidArgumentError('headers array must be even')
  18616. }
  18617. for (let i = 0; i < headers.length; i += 2) {
  18618. processHeader(this, headers[i], headers[i + 1])
  18619. }
  18620. } else if (headers && typeof headers === 'object') {
  18621. const keys = Object.keys(headers)
  18622. for (let i = 0; i < keys.length; i++) {
  18623. const key = keys[i]
  18624. processHeader(this, key, headers[key])
  18625. }
  18626. } else if (headers != null) {
  18627. throw new InvalidArgumentError('headers must be an object or an array')
  18628. }
  18629. if (util.isFormDataLike(this.body)) {
  18630. if (util.nodeMajor < 16 || (util.nodeMajor === 16 && util.nodeMinor < 8)) {
  18631. throw new InvalidArgumentError('Form-Data bodies are only supported in node v16.8 and newer.')
  18632. }
  18633. if (!extractBody) {
  18634. extractBody = (__nccwpck_require__(9990).extractBody)
  18635. }
  18636. const [bodyStream, contentType] = extractBody(body)
  18637. if (this.contentType == null) {
  18638. this.contentType = contentType
  18639. this.headers += `content-type: ${contentType}\r\n`
  18640. }
  18641. this.body = bodyStream.stream
  18642. this.contentLength = bodyStream.length
  18643. } else if (util.isBlobLike(body) && this.contentType == null && body.type) {
  18644. this.contentType = body.type
  18645. this.headers += `content-type: ${body.type}\r\n`
  18646. }
  18647. util.validateHandler(handler, method, upgrade)
  18648. this.servername = util.getServerName(this.host)
  18649. this[kHandler] = handler
  18650. if (channels.create.hasSubscribers) {
  18651. channels.create.publish({ request: this })
  18652. }
  18653. }
  18654. onBodySent (chunk) {
  18655. if (this[kHandler].onBodySent) {
  18656. try {
  18657. return this[kHandler].onBodySent(chunk)
  18658. } catch (err) {
  18659. this.abort(err)
  18660. }
  18661. }
  18662. }
  18663. onRequestSent () {
  18664. if (channels.bodySent.hasSubscribers) {
  18665. channels.bodySent.publish({ request: this })
  18666. }
  18667. if (this[kHandler].onRequestSent) {
  18668. try {
  18669. return this[kHandler].onRequestSent()
  18670. } catch (err) {
  18671. this.abort(err)
  18672. }
  18673. }
  18674. }
  18675. onConnect (abort) {
  18676. assert(!this.aborted)
  18677. assert(!this.completed)
  18678. if (this.error) {
  18679. abort(this.error)
  18680. } else {
  18681. this.abort = abort
  18682. return this[kHandler].onConnect(abort)
  18683. }
  18684. }
  18685. onHeaders (statusCode, headers, resume, statusText) {
  18686. assert(!this.aborted)
  18687. assert(!this.completed)
  18688. if (channels.headers.hasSubscribers) {
  18689. channels.headers.publish({ request: this, response: { statusCode, headers, statusText } })
  18690. }
  18691. try {
  18692. return this[kHandler].onHeaders(statusCode, headers, resume, statusText)
  18693. } catch (err) {
  18694. this.abort(err)
  18695. }
  18696. }
  18697. onData (chunk) {
  18698. assert(!this.aborted)
  18699. assert(!this.completed)
  18700. try {
  18701. return this[kHandler].onData(chunk)
  18702. } catch (err) {
  18703. this.abort(err)
  18704. return false
  18705. }
  18706. }
  18707. onUpgrade (statusCode, headers, socket) {
  18708. assert(!this.aborted)
  18709. assert(!this.completed)
  18710. return this[kHandler].onUpgrade(statusCode, headers, socket)
  18711. }
  18712. onComplete (trailers) {
  18713. this.onFinally()
  18714. assert(!this.aborted)
  18715. this.completed = true
  18716. if (channels.trailers.hasSubscribers) {
  18717. channels.trailers.publish({ request: this, trailers })
  18718. }
  18719. try {
  18720. return this[kHandler].onComplete(trailers)
  18721. } catch (err) {
  18722. // TODO (fix): This might be a bad idea?
  18723. this.onError(err)
  18724. }
  18725. }
  18726. onError (error) {
  18727. this.onFinally()
  18728. if (channels.error.hasSubscribers) {
  18729. channels.error.publish({ request: this, error })
  18730. }
  18731. if (this.aborted) {
  18732. return
  18733. }
  18734. this.aborted = true
  18735. return this[kHandler].onError(error)
  18736. }
  18737. onFinally () {
  18738. if (this.errorHandler) {
  18739. this.body.off('error', this.errorHandler)
  18740. this.errorHandler = null
  18741. }
  18742. if (this.endHandler) {
  18743. this.body.off('end', this.endHandler)
  18744. this.endHandler = null
  18745. }
  18746. }
  18747. // TODO: adjust to support H2
  18748. addHeader (key, value) {
  18749. processHeader(this, key, value)
  18750. return this
  18751. }
  18752. static [kHTTP1BuildRequest] (origin, opts, handler) {
  18753. // TODO: Migrate header parsing here, to make Requests
  18754. // HTTP agnostic
  18755. return new Request(origin, opts, handler)
  18756. }
  18757. static [kHTTP2BuildRequest] (origin, opts, handler) {
  18758. const headers = opts.headers
  18759. opts = { ...opts, headers: null }
  18760. const request = new Request(origin, opts, handler)
  18761. request.headers = {}
  18762. if (Array.isArray(headers)) {
  18763. if (headers.length % 2 !== 0) {
  18764. throw new InvalidArgumentError('headers array must be even')
  18765. }
  18766. for (let i = 0; i < headers.length; i += 2) {
  18767. processHeader(request, headers[i], headers[i + 1], true)
  18768. }
  18769. } else if (headers && typeof headers === 'object') {
  18770. const keys = Object.keys(headers)
  18771. for (let i = 0; i < keys.length; i++) {
  18772. const key = keys[i]
  18773. processHeader(request, key, headers[key], true)
  18774. }
  18775. } else if (headers != null) {
  18776. throw new InvalidArgumentError('headers must be an object or an array')
  18777. }
  18778. return request
  18779. }
  18780. static [kHTTP2CopyHeaders] (raw) {
  18781. const rawHeaders = raw.split('\r\n')
  18782. const headers = {}
  18783. for (const header of rawHeaders) {
  18784. const [key, value] = header.split(': ')
  18785. if (value == null || value.length === 0) continue
  18786. if (headers[key]) headers[key] += `,${value}`
  18787. else headers[key] = value
  18788. }
  18789. return headers
  18790. }
  18791. }
  18792. function processHeaderValue (key, val, skipAppend) {
  18793. if (val && typeof val === 'object') {
  18794. throw new InvalidArgumentError(`invalid ${key} header`)
  18795. }
  18796. val = val != null ? `${val}` : ''
  18797. if (headerCharRegex.exec(val) !== null) {
  18798. throw new InvalidArgumentError(`invalid ${key} header`)
  18799. }
  18800. return skipAppend ? val : `${key}: ${val}\r\n`
  18801. }
  18802. function processHeader (request, key, val, skipAppend = false) {
  18803. if (val && (typeof val === 'object' && !Array.isArray(val))) {
  18804. throw new InvalidArgumentError(`invalid ${key} header`)
  18805. } else if (val === undefined) {
  18806. return
  18807. }
  18808. if (
  18809. request.host === null &&
  18810. key.length === 4 &&
  18811. key.toLowerCase() === 'host'
  18812. ) {
  18813. if (headerCharRegex.exec(val) !== null) {
  18814. throw new InvalidArgumentError(`invalid ${key} header`)
  18815. }
  18816. // Consumed by Client
  18817. request.host = val
  18818. } else if (
  18819. request.contentLength === null &&
  18820. key.length === 14 &&
  18821. key.toLowerCase() === 'content-length'
  18822. ) {
  18823. request.contentLength = parseInt(val, 10)
  18824. if (!Number.isFinite(request.contentLength)) {
  18825. throw new InvalidArgumentError('invalid content-length header')
  18826. }
  18827. } else if (
  18828. request.contentType === null &&
  18829. key.length === 12 &&
  18830. key.toLowerCase() === 'content-type'
  18831. ) {
  18832. request.contentType = val
  18833. if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend)
  18834. else request.headers += processHeaderValue(key, val)
  18835. } else if (
  18836. key.length === 17 &&
  18837. key.toLowerCase() === 'transfer-encoding'
  18838. ) {
  18839. throw new InvalidArgumentError('invalid transfer-encoding header')
  18840. } else if (
  18841. key.length === 10 &&
  18842. key.toLowerCase() === 'connection'
  18843. ) {
  18844. const value = typeof val === 'string' ? val.toLowerCase() : null
  18845. if (value !== 'close' && value !== 'keep-alive') {
  18846. throw new InvalidArgumentError('invalid connection header')
  18847. } else if (value === 'close') {
  18848. request.reset = true
  18849. }
  18850. } else if (
  18851. key.length === 10 &&
  18852. key.toLowerCase() === 'keep-alive'
  18853. ) {
  18854. throw new InvalidArgumentError('invalid keep-alive header')
  18855. } else if (
  18856. key.length === 7 &&
  18857. key.toLowerCase() === 'upgrade'
  18858. ) {
  18859. throw new InvalidArgumentError('invalid upgrade header')
  18860. } else if (
  18861. key.length === 6 &&
  18862. key.toLowerCase() === 'expect'
  18863. ) {
  18864. throw new NotSupportedError('expect header not supported')
  18865. } else if (tokenRegExp.exec(key) === null) {
  18866. throw new InvalidArgumentError('invalid header key')
  18867. } else {
  18868. if (Array.isArray(val)) {
  18869. for (let i = 0; i < val.length; i++) {
  18870. if (skipAppend) {
  18871. if (request.headers[key]) request.headers[key] += `,${processHeaderValue(key, val[i], skipAppend)}`
  18872. else request.headers[key] = processHeaderValue(key, val[i], skipAppend)
  18873. } else {
  18874. request.headers += processHeaderValue(key, val[i])
  18875. }
  18876. }
  18877. } else {
  18878. if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend)
  18879. else request.headers += processHeaderValue(key, val)
  18880. }
  18881. }
  18882. }
  18883. module.exports = Request
  18884. /***/ }),
  18885. /***/ 2785:
  18886. /***/ ((module) => {
  18887. module.exports = {
  18888. kClose: Symbol('close'),
  18889. kDestroy: Symbol('destroy'),
  18890. kDispatch: Symbol('dispatch'),
  18891. kUrl: Symbol('url'),
  18892. kWriting: Symbol('writing'),
  18893. kResuming: Symbol('resuming'),
  18894. kQueue: Symbol('queue'),
  18895. kConnect: Symbol('connect'),
  18896. kConnecting: Symbol('connecting'),
  18897. kHeadersList: Symbol('headers list'),
  18898. kKeepAliveDefaultTimeout: Symbol('default keep alive timeout'),
  18899. kKeepAliveMaxTimeout: Symbol('max keep alive timeout'),
  18900. kKeepAliveTimeoutThreshold: Symbol('keep alive timeout threshold'),
  18901. kKeepAliveTimeoutValue: Symbol('keep alive timeout'),
  18902. kKeepAlive: Symbol('keep alive'),
  18903. kHeadersTimeout: Symbol('headers timeout'),
  18904. kBodyTimeout: Symbol('body timeout'),
  18905. kServerName: Symbol('server name'),
  18906. kLocalAddress: Symbol('local address'),
  18907. kHost: Symbol('host'),
  18908. kNoRef: Symbol('no ref'),
  18909. kBodyUsed: Symbol('used'),
  18910. kRunning: Symbol('running'),
  18911. kBlocking: Symbol('blocking'),
  18912. kPending: Symbol('pending'),
  18913. kSize: Symbol('size'),
  18914. kBusy: Symbol('busy'),
  18915. kQueued: Symbol('queued'),
  18916. kFree: Symbol('free'),
  18917. kConnected: Symbol('connected'),
  18918. kClosed: Symbol('closed'),
  18919. kNeedDrain: Symbol('need drain'),
  18920. kReset: Symbol('reset'),
  18921. kDestroyed: Symbol.for('nodejs.stream.destroyed'),
  18922. kMaxHeadersSize: Symbol('max headers size'),
  18923. kRunningIdx: Symbol('running index'),
  18924. kPendingIdx: Symbol('pending index'),
  18925. kError: Symbol('error'),
  18926. kClients: Symbol('clients'),
  18927. kClient: Symbol('client'),
  18928. kParser: Symbol('parser'),
  18929. kOnDestroyed: Symbol('destroy callbacks'),
  18930. kPipelining: Symbol('pipelining'),
  18931. kSocket: Symbol('socket'),
  18932. kHostHeader: Symbol('host header'),
  18933. kConnector: Symbol('connector'),
  18934. kStrictContentLength: Symbol('strict content length'),
  18935. kMaxRedirections: Symbol('maxRedirections'),
  18936. kMaxRequests: Symbol('maxRequestsPerClient'),
  18937. kProxy: Symbol('proxy agent options'),
  18938. kCounter: Symbol('socket request counter'),
  18939. kInterceptors: Symbol('dispatch interceptors'),
  18940. kMaxResponseSize: Symbol('max response size'),
  18941. kHTTP2Session: Symbol('http2Session'),
  18942. kHTTP2SessionState: Symbol('http2Session state'),
  18943. kHTTP2BuildRequest: Symbol('http2 build request'),
  18944. kHTTP1BuildRequest: Symbol('http1 build request'),
  18945. kHTTP2CopyHeaders: Symbol('http2 copy headers'),
  18946. kHTTPConnVersion: Symbol('http connection version'),
  18947. kRetryHandlerDefaultRetry: Symbol('retry agent default retry'),
  18948. kConstruct: Symbol('constructable')
  18949. }
  18950. /***/ }),
  18951. /***/ 3983:
  18952. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  18953. "use strict";
  18954. const assert = __nccwpck_require__(9491)
  18955. const { kDestroyed, kBodyUsed } = __nccwpck_require__(2785)
  18956. const { IncomingMessage } = __nccwpck_require__(3685)
  18957. const stream = __nccwpck_require__(2781)
  18958. const net = __nccwpck_require__(1808)
  18959. const { InvalidArgumentError } = __nccwpck_require__(8045)
  18960. const { Blob } = __nccwpck_require__(4300)
  18961. const nodeUtil = __nccwpck_require__(3837)
  18962. const { stringify } = __nccwpck_require__(3477)
  18963. const { headerNameLowerCasedRecord } = __nccwpck_require__(4462)
  18964. const [nodeMajor, nodeMinor] = process.versions.node.split('.').map(v => Number(v))
  18965. function nop () {}
  18966. function isStream (obj) {
  18967. return obj && typeof obj === 'object' && typeof obj.pipe === 'function' && typeof obj.on === 'function'
  18968. }
  18969. // based on https://github.com/node-fetch/fetch-blob/blob/8ab587d34080de94140b54f07168451e7d0b655e/index.js#L229-L241 (MIT License)
  18970. function isBlobLike (object) {
  18971. return (Blob && object instanceof Blob) || (
  18972. object &&
  18973. typeof object === 'object' &&
  18974. (typeof object.stream === 'function' ||
  18975. typeof object.arrayBuffer === 'function') &&
  18976. /^(Blob|File)$/.test(object[Symbol.toStringTag])
  18977. )
  18978. }
  18979. function buildURL (url, queryParams) {
  18980. if (url.includes('?') || url.includes('#')) {
  18981. throw new Error('Query params cannot be passed when url already contains "?" or "#".')
  18982. }
  18983. const stringified = stringify(queryParams)
  18984. if (stringified) {
  18985. url += '?' + stringified
  18986. }
  18987. return url
  18988. }
  18989. function parseURL (url) {
  18990. if (typeof url === 'string') {
  18991. url = new URL(url)
  18992. if (!/^https?:/.test(url.origin || url.protocol)) {
  18993. throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')
  18994. }
  18995. return url
  18996. }
  18997. if (!url || typeof url !== 'object') {
  18998. throw new InvalidArgumentError('Invalid URL: The URL argument must be a non-null object.')
  18999. }
  19000. if (!/^https?:/.test(url.origin || url.protocol)) {
  19001. throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')
  19002. }
  19003. if (!(url instanceof URL)) {
  19004. if (url.port != null && url.port !== '' && !Number.isFinite(parseInt(url.port))) {
  19005. throw new InvalidArgumentError('Invalid URL: port must be a valid integer or a string representation of an integer.')
  19006. }
  19007. if (url.path != null && typeof url.path !== 'string') {
  19008. throw new InvalidArgumentError('Invalid URL path: the path must be a string or null/undefined.')
  19009. }
  19010. if (url.pathname != null && typeof url.pathname !== 'string') {
  19011. throw new InvalidArgumentError('Invalid URL pathname: the pathname must be a string or null/undefined.')
  19012. }
  19013. if (url.hostname != null && typeof url.hostname !== 'string') {
  19014. throw new InvalidArgumentError('Invalid URL hostname: the hostname must be a string or null/undefined.')
  19015. }
  19016. if (url.origin != null && typeof url.origin !== 'string') {
  19017. throw new InvalidArgumentError('Invalid URL origin: the origin must be a string or null/undefined.')
  19018. }
  19019. const port = url.port != null
  19020. ? url.port
  19021. : (url.protocol === 'https:' ? 443 : 80)
  19022. let origin = url.origin != null
  19023. ? url.origin
  19024. : `${url.protocol}//${url.hostname}:${port}`
  19025. let path = url.path != null
  19026. ? url.path
  19027. : `${url.pathname || ''}${url.search || ''}`
  19028. if (origin.endsWith('/')) {
  19029. origin = origin.substring(0, origin.length - 1)
  19030. }
  19031. if (path && !path.startsWith('/')) {
  19032. path = `/${path}`
  19033. }
  19034. // new URL(path, origin) is unsafe when `path` contains an absolute URL
  19035. // From https://developer.mozilla.org/en-US/docs/Web/API/URL/URL:
  19036. // If first parameter is a relative URL, second param is required, and will be used as the base URL.
  19037. // If first parameter is an absolute URL, a given second param will be ignored.
  19038. url = new URL(origin + path)
  19039. }
  19040. return url
  19041. }
  19042. function parseOrigin (url) {
  19043. url = parseURL(url)
  19044. if (url.pathname !== '/' || url.search || url.hash) {
  19045. throw new InvalidArgumentError('invalid url')
  19046. }
  19047. return url
  19048. }
  19049. function getHostname (host) {
  19050. if (host[0] === '[') {
  19051. const idx = host.indexOf(']')
  19052. assert(idx !== -1)
  19053. return host.substring(1, idx)
  19054. }
  19055. const idx = host.indexOf(':')
  19056. if (idx === -1) return host
  19057. return host.substring(0, idx)
  19058. }
  19059. // IP addresses are not valid server names per RFC6066
  19060. // > Currently, the only server names supported are DNS hostnames
  19061. function getServerName (host) {
  19062. if (!host) {
  19063. return null
  19064. }
  19065. assert.strictEqual(typeof host, 'string')
  19066. const servername = getHostname(host)
  19067. if (net.isIP(servername)) {
  19068. return ''
  19069. }
  19070. return servername
  19071. }
  19072. function deepClone (obj) {
  19073. return JSON.parse(JSON.stringify(obj))
  19074. }
  19075. function isAsyncIterable (obj) {
  19076. return !!(obj != null && typeof obj[Symbol.asyncIterator] === 'function')
  19077. }
  19078. function isIterable (obj) {
  19079. return !!(obj != null && (typeof obj[Symbol.iterator] === 'function' || typeof obj[Symbol.asyncIterator] === 'function'))
  19080. }
  19081. function bodyLength (body) {
  19082. if (body == null) {
  19083. return 0
  19084. } else if (isStream(body)) {
  19085. const state = body._readableState
  19086. return state && state.objectMode === false && state.ended === true && Number.isFinite(state.length)
  19087. ? state.length
  19088. : null
  19089. } else if (isBlobLike(body)) {
  19090. return body.size != null ? body.size : null
  19091. } else if (isBuffer(body)) {
  19092. return body.byteLength
  19093. }
  19094. return null
  19095. }
  19096. function isDestroyed (stream) {
  19097. return !stream || !!(stream.destroyed || stream[kDestroyed])
  19098. }
  19099. function isReadableAborted (stream) {
  19100. const state = stream && stream._readableState
  19101. return isDestroyed(stream) && state && !state.endEmitted
  19102. }
  19103. function destroy (stream, err) {
  19104. if (stream == null || !isStream(stream) || isDestroyed(stream)) {
  19105. return
  19106. }
  19107. if (typeof stream.destroy === 'function') {
  19108. if (Object.getPrototypeOf(stream).constructor === IncomingMessage) {
  19109. // See: https://github.com/nodejs/node/pull/38505/files
  19110. stream.socket = null
  19111. }
  19112. stream.destroy(err)
  19113. } else if (err) {
  19114. process.nextTick((stream, err) => {
  19115. stream.emit('error', err)
  19116. }, stream, err)
  19117. }
  19118. if (stream.destroyed !== true) {
  19119. stream[kDestroyed] = true
  19120. }
  19121. }
  19122. const KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/
  19123. function parseKeepAliveTimeout (val) {
  19124. const m = val.toString().match(KEEPALIVE_TIMEOUT_EXPR)
  19125. return m ? parseInt(m[1], 10) * 1000 : null
  19126. }
  19127. /**
  19128. * Retrieves a header name and returns its lowercase value.
  19129. * @param {string | Buffer} value Header name
  19130. * @returns {string}
  19131. */
  19132. function headerNameToString (value) {
  19133. return headerNameLowerCasedRecord[value] || value.toLowerCase()
  19134. }
  19135. function parseHeaders (headers, obj = {}) {
  19136. // For H2 support
  19137. if (!Array.isArray(headers)) return headers
  19138. for (let i = 0; i < headers.length; i += 2) {
  19139. const key = headers[i].toString().toLowerCase()
  19140. let val = obj[key]
  19141. if (!val) {
  19142. if (Array.isArray(headers[i + 1])) {
  19143. obj[key] = headers[i + 1].map(x => x.toString('utf8'))
  19144. } else {
  19145. obj[key] = headers[i + 1].toString('utf8')
  19146. }
  19147. } else {
  19148. if (!Array.isArray(val)) {
  19149. val = [val]
  19150. obj[key] = val
  19151. }
  19152. val.push(headers[i + 1].toString('utf8'))
  19153. }
  19154. }
  19155. // See https://github.com/nodejs/node/pull/46528
  19156. if ('content-length' in obj && 'content-disposition' in obj) {
  19157. obj['content-disposition'] = Buffer.from(obj['content-disposition']).toString('latin1')
  19158. }
  19159. return obj
  19160. }
  19161. function parseRawHeaders (headers) {
  19162. const ret = []
  19163. let hasContentLength = false
  19164. let contentDispositionIdx = -1
  19165. for (let n = 0; n < headers.length; n += 2) {
  19166. const key = headers[n + 0].toString()
  19167. const val = headers[n + 1].toString('utf8')
  19168. if (key.length === 14 && (key === 'content-length' || key.toLowerCase() === 'content-length')) {
  19169. ret.push(key, val)
  19170. hasContentLength = true
  19171. } else if (key.length === 19 && (key === 'content-disposition' || key.toLowerCase() === 'content-disposition')) {
  19172. contentDispositionIdx = ret.push(key, val) - 1
  19173. } else {
  19174. ret.push(key, val)
  19175. }
  19176. }
  19177. // See https://github.com/nodejs/node/pull/46528
  19178. if (hasContentLength && contentDispositionIdx !== -1) {
  19179. ret[contentDispositionIdx] = Buffer.from(ret[contentDispositionIdx]).toString('latin1')
  19180. }
  19181. return ret
  19182. }
  19183. function isBuffer (buffer) {
  19184. // See, https://github.com/mcollina/undici/pull/319
  19185. return buffer instanceof Uint8Array || Buffer.isBuffer(buffer)
  19186. }
  19187. function validateHandler (handler, method, upgrade) {
  19188. if (!handler || typeof handler !== 'object') {
  19189. throw new InvalidArgumentError('handler must be an object')
  19190. }
  19191. if (typeof handler.onConnect !== 'function') {
  19192. throw new InvalidArgumentError('invalid onConnect method')
  19193. }
  19194. if (typeof handler.onError !== 'function') {
  19195. throw new InvalidArgumentError('invalid onError method')
  19196. }
  19197. if (typeof handler.onBodySent !== 'function' && handler.onBodySent !== undefined) {
  19198. throw new InvalidArgumentError('invalid onBodySent method')
  19199. }
  19200. if (upgrade || method === 'CONNECT') {
  19201. if (typeof handler.onUpgrade !== 'function') {
  19202. throw new InvalidArgumentError('invalid onUpgrade method')
  19203. }
  19204. } else {
  19205. if (typeof handler.onHeaders !== 'function') {
  19206. throw new InvalidArgumentError('invalid onHeaders method')
  19207. }
  19208. if (typeof handler.onData !== 'function') {
  19209. throw new InvalidArgumentError('invalid onData method')
  19210. }
  19211. if (typeof handler.onComplete !== 'function') {
  19212. throw new InvalidArgumentError('invalid onComplete method')
  19213. }
  19214. }
  19215. }
  19216. // A body is disturbed if it has been read from and it cannot
  19217. // be re-used without losing state or data.
  19218. function isDisturbed (body) {
  19219. return !!(body && (
  19220. stream.isDisturbed
  19221. ? stream.isDisturbed(body) || body[kBodyUsed] // TODO (fix): Why is body[kBodyUsed] needed?
  19222. : body[kBodyUsed] ||
  19223. body.readableDidRead ||
  19224. (body._readableState && body._readableState.dataEmitted) ||
  19225. isReadableAborted(body)
  19226. ))
  19227. }
  19228. function isErrored (body) {
  19229. return !!(body && (
  19230. stream.isErrored
  19231. ? stream.isErrored(body)
  19232. : /state: 'errored'/.test(nodeUtil.inspect(body)
  19233. )))
  19234. }
  19235. function isReadable (body) {
  19236. return !!(body && (
  19237. stream.isReadable
  19238. ? stream.isReadable(body)
  19239. : /state: 'readable'/.test(nodeUtil.inspect(body)
  19240. )))
  19241. }
  19242. function getSocketInfo (socket) {
  19243. return {
  19244. localAddress: socket.localAddress,
  19245. localPort: socket.localPort,
  19246. remoteAddress: socket.remoteAddress,
  19247. remotePort: socket.remotePort,
  19248. remoteFamily: socket.remoteFamily,
  19249. timeout: socket.timeout,
  19250. bytesWritten: socket.bytesWritten,
  19251. bytesRead: socket.bytesRead
  19252. }
  19253. }
  19254. async function * convertIterableToBuffer (iterable) {
  19255. for await (const chunk of iterable) {
  19256. yield Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk)
  19257. }
  19258. }
  19259. let ReadableStream
  19260. function ReadableStreamFrom (iterable) {
  19261. if (!ReadableStream) {
  19262. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  19263. }
  19264. if (ReadableStream.from) {
  19265. return ReadableStream.from(convertIterableToBuffer(iterable))
  19266. }
  19267. let iterator
  19268. return new ReadableStream(
  19269. {
  19270. async start () {
  19271. iterator = iterable[Symbol.asyncIterator]()
  19272. },
  19273. async pull (controller) {
  19274. const { done, value } = await iterator.next()
  19275. if (done) {
  19276. queueMicrotask(() => {
  19277. controller.close()
  19278. })
  19279. } else {
  19280. const buf = Buffer.isBuffer(value) ? value : Buffer.from(value)
  19281. controller.enqueue(new Uint8Array(buf))
  19282. }
  19283. return controller.desiredSize > 0
  19284. },
  19285. async cancel (reason) {
  19286. await iterator.return()
  19287. }
  19288. },
  19289. 0
  19290. )
  19291. }
  19292. // The chunk should be a FormData instance and contains
  19293. // all the required methods.
  19294. function isFormDataLike (object) {
  19295. return (
  19296. object &&
  19297. typeof object === 'object' &&
  19298. typeof object.append === 'function' &&
  19299. typeof object.delete === 'function' &&
  19300. typeof object.get === 'function' &&
  19301. typeof object.getAll === 'function' &&
  19302. typeof object.has === 'function' &&
  19303. typeof object.set === 'function' &&
  19304. object[Symbol.toStringTag] === 'FormData'
  19305. )
  19306. }
  19307. function throwIfAborted (signal) {
  19308. if (!signal) { return }
  19309. if (typeof signal.throwIfAborted === 'function') {
  19310. signal.throwIfAborted()
  19311. } else {
  19312. if (signal.aborted) {
  19313. // DOMException not available < v17.0.0
  19314. const err = new Error('The operation was aborted')
  19315. err.name = 'AbortError'
  19316. throw err
  19317. }
  19318. }
  19319. }
  19320. function addAbortListener (signal, listener) {
  19321. if ('addEventListener' in signal) {
  19322. signal.addEventListener('abort', listener, { once: true })
  19323. return () => signal.removeEventListener('abort', listener)
  19324. }
  19325. signal.addListener('abort', listener)
  19326. return () => signal.removeListener('abort', listener)
  19327. }
  19328. const hasToWellFormed = !!String.prototype.toWellFormed
  19329. /**
  19330. * @param {string} val
  19331. */
  19332. function toUSVString (val) {
  19333. if (hasToWellFormed) {
  19334. return `${val}`.toWellFormed()
  19335. } else if (nodeUtil.toUSVString) {
  19336. return nodeUtil.toUSVString(val)
  19337. }
  19338. return `${val}`
  19339. }
  19340. // Parsed accordingly to RFC 9110
  19341. // https://www.rfc-editor.org/rfc/rfc9110#field.content-range
  19342. function parseRangeHeader (range) {
  19343. if (range == null || range === '') return { start: 0, end: null, size: null }
  19344. const m = range ? range.match(/^bytes (\d+)-(\d+)\/(\d+)?$/) : null
  19345. return m
  19346. ? {
  19347. start: parseInt(m[1]),
  19348. end: m[2] ? parseInt(m[2]) : null,
  19349. size: m[3] ? parseInt(m[3]) : null
  19350. }
  19351. : null
  19352. }
  19353. const kEnumerableProperty = Object.create(null)
  19354. kEnumerableProperty.enumerable = true
  19355. module.exports = {
  19356. kEnumerableProperty,
  19357. nop,
  19358. isDisturbed,
  19359. isErrored,
  19360. isReadable,
  19361. toUSVString,
  19362. isReadableAborted,
  19363. isBlobLike,
  19364. parseOrigin,
  19365. parseURL,
  19366. getServerName,
  19367. isStream,
  19368. isIterable,
  19369. isAsyncIterable,
  19370. isDestroyed,
  19371. headerNameToString,
  19372. parseRawHeaders,
  19373. parseHeaders,
  19374. parseKeepAliveTimeout,
  19375. destroy,
  19376. bodyLength,
  19377. deepClone,
  19378. ReadableStreamFrom,
  19379. isBuffer,
  19380. validateHandler,
  19381. getSocketInfo,
  19382. isFormDataLike,
  19383. buildURL,
  19384. throwIfAborted,
  19385. addAbortListener,
  19386. parseRangeHeader,
  19387. nodeMajor,
  19388. nodeMinor,
  19389. nodeHasAutoSelectFamily: nodeMajor > 18 || (nodeMajor === 18 && nodeMinor >= 13),
  19390. safeHTTPMethods: ['GET', 'HEAD', 'OPTIONS', 'TRACE']
  19391. }
  19392. /***/ }),
  19393. /***/ 4839:
  19394. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  19395. "use strict";
  19396. const Dispatcher = __nccwpck_require__(412)
  19397. const {
  19398. ClientDestroyedError,
  19399. ClientClosedError,
  19400. InvalidArgumentError
  19401. } = __nccwpck_require__(8045)
  19402. const { kDestroy, kClose, kDispatch, kInterceptors } = __nccwpck_require__(2785)
  19403. const kDestroyed = Symbol('destroyed')
  19404. const kClosed = Symbol('closed')
  19405. const kOnDestroyed = Symbol('onDestroyed')
  19406. const kOnClosed = Symbol('onClosed')
  19407. const kInterceptedDispatch = Symbol('Intercepted Dispatch')
  19408. class DispatcherBase extends Dispatcher {
  19409. constructor () {
  19410. super()
  19411. this[kDestroyed] = false
  19412. this[kOnDestroyed] = null
  19413. this[kClosed] = false
  19414. this[kOnClosed] = []
  19415. }
  19416. get destroyed () {
  19417. return this[kDestroyed]
  19418. }
  19419. get closed () {
  19420. return this[kClosed]
  19421. }
  19422. get interceptors () {
  19423. return this[kInterceptors]
  19424. }
  19425. set interceptors (newInterceptors) {
  19426. if (newInterceptors) {
  19427. for (let i = newInterceptors.length - 1; i >= 0; i--) {
  19428. const interceptor = this[kInterceptors][i]
  19429. if (typeof interceptor !== 'function') {
  19430. throw new InvalidArgumentError('interceptor must be an function')
  19431. }
  19432. }
  19433. }
  19434. this[kInterceptors] = newInterceptors
  19435. }
  19436. close (callback) {
  19437. if (callback === undefined) {
  19438. return new Promise((resolve, reject) => {
  19439. this.close((err, data) => {
  19440. return err ? reject(err) : resolve(data)
  19441. })
  19442. })
  19443. }
  19444. if (typeof callback !== 'function') {
  19445. throw new InvalidArgumentError('invalid callback')
  19446. }
  19447. if (this[kDestroyed]) {
  19448. queueMicrotask(() => callback(new ClientDestroyedError(), null))
  19449. return
  19450. }
  19451. if (this[kClosed]) {
  19452. if (this[kOnClosed]) {
  19453. this[kOnClosed].push(callback)
  19454. } else {
  19455. queueMicrotask(() => callback(null, null))
  19456. }
  19457. return
  19458. }
  19459. this[kClosed] = true
  19460. this[kOnClosed].push(callback)
  19461. const onClosed = () => {
  19462. const callbacks = this[kOnClosed]
  19463. this[kOnClosed] = null
  19464. for (let i = 0; i < callbacks.length; i++) {
  19465. callbacks[i](null, null)
  19466. }
  19467. }
  19468. // Should not error.
  19469. this[kClose]()
  19470. .then(() => this.destroy())
  19471. .then(() => {
  19472. queueMicrotask(onClosed)
  19473. })
  19474. }
  19475. destroy (err, callback) {
  19476. if (typeof err === 'function') {
  19477. callback = err
  19478. err = null
  19479. }
  19480. if (callback === undefined) {
  19481. return new Promise((resolve, reject) => {
  19482. this.destroy(err, (err, data) => {
  19483. return err ? /* istanbul ignore next: should never error */ reject(err) : resolve(data)
  19484. })
  19485. })
  19486. }
  19487. if (typeof callback !== 'function') {
  19488. throw new InvalidArgumentError('invalid callback')
  19489. }
  19490. if (this[kDestroyed]) {
  19491. if (this[kOnDestroyed]) {
  19492. this[kOnDestroyed].push(callback)
  19493. } else {
  19494. queueMicrotask(() => callback(null, null))
  19495. }
  19496. return
  19497. }
  19498. if (!err) {
  19499. err = new ClientDestroyedError()
  19500. }
  19501. this[kDestroyed] = true
  19502. this[kOnDestroyed] = this[kOnDestroyed] || []
  19503. this[kOnDestroyed].push(callback)
  19504. const onDestroyed = () => {
  19505. const callbacks = this[kOnDestroyed]
  19506. this[kOnDestroyed] = null
  19507. for (let i = 0; i < callbacks.length; i++) {
  19508. callbacks[i](null, null)
  19509. }
  19510. }
  19511. // Should not error.
  19512. this[kDestroy](err).then(() => {
  19513. queueMicrotask(onDestroyed)
  19514. })
  19515. }
  19516. [kInterceptedDispatch] (opts, handler) {
  19517. if (!this[kInterceptors] || this[kInterceptors].length === 0) {
  19518. this[kInterceptedDispatch] = this[kDispatch]
  19519. return this[kDispatch](opts, handler)
  19520. }
  19521. let dispatch = this[kDispatch].bind(this)
  19522. for (let i = this[kInterceptors].length - 1; i >= 0; i--) {
  19523. dispatch = this[kInterceptors][i](dispatch)
  19524. }
  19525. this[kInterceptedDispatch] = dispatch
  19526. return dispatch(opts, handler)
  19527. }
  19528. dispatch (opts, handler) {
  19529. if (!handler || typeof handler !== 'object') {
  19530. throw new InvalidArgumentError('handler must be an object')
  19531. }
  19532. try {
  19533. if (!opts || typeof opts !== 'object') {
  19534. throw new InvalidArgumentError('opts must be an object.')
  19535. }
  19536. if (this[kDestroyed] || this[kOnDestroyed]) {
  19537. throw new ClientDestroyedError()
  19538. }
  19539. if (this[kClosed]) {
  19540. throw new ClientClosedError()
  19541. }
  19542. return this[kInterceptedDispatch](opts, handler)
  19543. } catch (err) {
  19544. if (typeof handler.onError !== 'function') {
  19545. throw new InvalidArgumentError('invalid onError method')
  19546. }
  19547. handler.onError(err)
  19548. return false
  19549. }
  19550. }
  19551. }
  19552. module.exports = DispatcherBase
  19553. /***/ }),
  19554. /***/ 412:
  19555. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  19556. "use strict";
  19557. const EventEmitter = __nccwpck_require__(2361)
  19558. class Dispatcher extends EventEmitter {
  19559. dispatch () {
  19560. throw new Error('not implemented')
  19561. }
  19562. close () {
  19563. throw new Error('not implemented')
  19564. }
  19565. destroy () {
  19566. throw new Error('not implemented')
  19567. }
  19568. }
  19569. module.exports = Dispatcher
  19570. /***/ }),
  19571. /***/ 9990:
  19572. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  19573. "use strict";
  19574. const Busboy = __nccwpck_require__(727)
  19575. const util = __nccwpck_require__(3983)
  19576. const {
  19577. ReadableStreamFrom,
  19578. isBlobLike,
  19579. isReadableStreamLike,
  19580. readableStreamClose,
  19581. createDeferredPromise,
  19582. fullyReadBody
  19583. } = __nccwpck_require__(2538)
  19584. const { FormData } = __nccwpck_require__(2015)
  19585. const { kState } = __nccwpck_require__(5861)
  19586. const { webidl } = __nccwpck_require__(1744)
  19587. const { DOMException, structuredClone } = __nccwpck_require__(1037)
  19588. const { Blob, File: NativeFile } = __nccwpck_require__(4300)
  19589. const { kBodyUsed } = __nccwpck_require__(2785)
  19590. const assert = __nccwpck_require__(9491)
  19591. const { isErrored } = __nccwpck_require__(3983)
  19592. const { isUint8Array, isArrayBuffer } = __nccwpck_require__(9830)
  19593. const { File: UndiciFile } = __nccwpck_require__(8511)
  19594. const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(685)
  19595. let random
  19596. try {
  19597. const crypto = __nccwpck_require__(6005)
  19598. random = (max) => crypto.randomInt(0, max)
  19599. } catch {
  19600. random = (max) => Math.floor(Math.random(max))
  19601. }
  19602. let ReadableStream = globalThis.ReadableStream
  19603. /** @type {globalThis['File']} */
  19604. const File = NativeFile ?? UndiciFile
  19605. const textEncoder = new TextEncoder()
  19606. const textDecoder = new TextDecoder()
  19607. // https://fetch.spec.whatwg.org/#concept-bodyinit-extract
  19608. function extractBody (object, keepalive = false) {
  19609. if (!ReadableStream) {
  19610. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  19611. }
  19612. // 1. Let stream be null.
  19613. let stream = null
  19614. // 2. If object is a ReadableStream object, then set stream to object.
  19615. if (object instanceof ReadableStream) {
  19616. stream = object
  19617. } else if (isBlobLike(object)) {
  19618. // 3. Otherwise, if object is a Blob object, set stream to the
  19619. // result of running object’s get stream.
  19620. stream = object.stream()
  19621. } else {
  19622. // 4. Otherwise, set stream to a new ReadableStream object, and set
  19623. // up stream.
  19624. stream = new ReadableStream({
  19625. async pull (controller) {
  19626. controller.enqueue(
  19627. typeof source === 'string' ? textEncoder.encode(source) : source
  19628. )
  19629. queueMicrotask(() => readableStreamClose(controller))
  19630. },
  19631. start () {},
  19632. type: undefined
  19633. })
  19634. }
  19635. // 5. Assert: stream is a ReadableStream object.
  19636. assert(isReadableStreamLike(stream))
  19637. // 6. Let action be null.
  19638. let action = null
  19639. // 7. Let source be null.
  19640. let source = null
  19641. // 8. Let length be null.
  19642. let length = null
  19643. // 9. Let type be null.
  19644. let type = null
  19645. // 10. Switch on object:
  19646. if (typeof object === 'string') {
  19647. // Set source to the UTF-8 encoding of object.
  19648. // Note: setting source to a Uint8Array here breaks some mocking assumptions.
  19649. source = object
  19650. // Set type to `text/plain;charset=UTF-8`.
  19651. type = 'text/plain;charset=UTF-8'
  19652. } else if (object instanceof URLSearchParams) {
  19653. // URLSearchParams
  19654. // spec says to run application/x-www-form-urlencoded on body.list
  19655. // this is implemented in Node.js as apart of an URLSearchParams instance toString method
  19656. // See: https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/lib/internal/url.js#L490
  19657. // and https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/lib/internal/url.js#L1100
  19658. // Set source to the result of running the application/x-www-form-urlencoded serializer with object’s list.
  19659. source = object.toString()
  19660. // Set type to `application/x-www-form-urlencoded;charset=UTF-8`.
  19661. type = 'application/x-www-form-urlencoded;charset=UTF-8'
  19662. } else if (isArrayBuffer(object)) {
  19663. // BufferSource/ArrayBuffer
  19664. // Set source to a copy of the bytes held by object.
  19665. source = new Uint8Array(object.slice())
  19666. } else if (ArrayBuffer.isView(object)) {
  19667. // BufferSource/ArrayBufferView
  19668. // Set source to a copy of the bytes held by object.
  19669. source = new Uint8Array(object.buffer.slice(object.byteOffset, object.byteOffset + object.byteLength))
  19670. } else if (util.isFormDataLike(object)) {
  19671. const boundary = `----formdata-undici-0${`${random(1e11)}`.padStart(11, '0')}`
  19672. const prefix = `--${boundary}\r\nContent-Disposition: form-data`
  19673. /*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */
  19674. const escape = (str) =>
  19675. str.replace(/\n/g, '%0A').replace(/\r/g, '%0D').replace(/"/g, '%22')
  19676. const normalizeLinefeeds = (value) => value.replace(/\r?\n|\r/g, '\r\n')
  19677. // Set action to this step: run the multipart/form-data
  19678. // encoding algorithm, with object’s entry list and UTF-8.
  19679. // - This ensures that the body is immutable and can't be changed afterwords
  19680. // - That the content-length is calculated in advance.
  19681. // - And that all parts are pre-encoded and ready to be sent.
  19682. const blobParts = []
  19683. const rn = new Uint8Array([13, 10]) // '\r\n'
  19684. length = 0
  19685. let hasUnknownSizeValue = false
  19686. for (const [name, value] of object) {
  19687. if (typeof value === 'string') {
  19688. const chunk = textEncoder.encode(prefix +
  19689. `; name="${escape(normalizeLinefeeds(name))}"` +
  19690. `\r\n\r\n${normalizeLinefeeds(value)}\r\n`)
  19691. blobParts.push(chunk)
  19692. length += chunk.byteLength
  19693. } else {
  19694. const chunk = textEncoder.encode(`${prefix}; name="${escape(normalizeLinefeeds(name))}"` +
  19695. (value.name ? `; filename="${escape(value.name)}"` : '') + '\r\n' +
  19696. `Content-Type: ${
  19697. value.type || 'application/octet-stream'
  19698. }\r\n\r\n`)
  19699. blobParts.push(chunk, value, rn)
  19700. if (typeof value.size === 'number') {
  19701. length += chunk.byteLength + value.size + rn.byteLength
  19702. } else {
  19703. hasUnknownSizeValue = true
  19704. }
  19705. }
  19706. }
  19707. const chunk = textEncoder.encode(`--${boundary}--`)
  19708. blobParts.push(chunk)
  19709. length += chunk.byteLength
  19710. if (hasUnknownSizeValue) {
  19711. length = null
  19712. }
  19713. // Set source to object.
  19714. source = object
  19715. action = async function * () {
  19716. for (const part of blobParts) {
  19717. if (part.stream) {
  19718. yield * part.stream()
  19719. } else {
  19720. yield part
  19721. }
  19722. }
  19723. }
  19724. // Set type to `multipart/form-data; boundary=`,
  19725. // followed by the multipart/form-data boundary string generated
  19726. // by the multipart/form-data encoding algorithm.
  19727. type = 'multipart/form-data; boundary=' + boundary
  19728. } else if (isBlobLike(object)) {
  19729. // Blob
  19730. // Set source to object.
  19731. source = object
  19732. // Set length to object’s size.
  19733. length = object.size
  19734. // If object’s type attribute is not the empty byte sequence, set
  19735. // type to its value.
  19736. if (object.type) {
  19737. type = object.type
  19738. }
  19739. } else if (typeof object[Symbol.asyncIterator] === 'function') {
  19740. // If keepalive is true, then throw a TypeError.
  19741. if (keepalive) {
  19742. throw new TypeError('keepalive')
  19743. }
  19744. // If object is disturbed or locked, then throw a TypeError.
  19745. if (util.isDisturbed(object) || object.locked) {
  19746. throw new TypeError(
  19747. 'Response body object should not be disturbed or locked'
  19748. )
  19749. }
  19750. stream =
  19751. object instanceof ReadableStream ? object : ReadableStreamFrom(object)
  19752. }
  19753. // 11. If source is a byte sequence, then set action to a
  19754. // step that returns source and length to source’s length.
  19755. if (typeof source === 'string' || util.isBuffer(source)) {
  19756. length = Buffer.byteLength(source)
  19757. }
  19758. // 12. If action is non-null, then run these steps in in parallel:
  19759. if (action != null) {
  19760. // Run action.
  19761. let iterator
  19762. stream = new ReadableStream({
  19763. async start () {
  19764. iterator = action(object)[Symbol.asyncIterator]()
  19765. },
  19766. async pull (controller) {
  19767. const { value, done } = await iterator.next()
  19768. if (done) {
  19769. // When running action is done, close stream.
  19770. queueMicrotask(() => {
  19771. controller.close()
  19772. })
  19773. } else {
  19774. // Whenever one or more bytes are available and stream is not errored,
  19775. // enqueue a Uint8Array wrapping an ArrayBuffer containing the available
  19776. // bytes into stream.
  19777. if (!isErrored(stream)) {
  19778. controller.enqueue(new Uint8Array(value))
  19779. }
  19780. }
  19781. return controller.desiredSize > 0
  19782. },
  19783. async cancel (reason) {
  19784. await iterator.return()
  19785. },
  19786. type: undefined
  19787. })
  19788. }
  19789. // 13. Let body be a body whose stream is stream, source is source,
  19790. // and length is length.
  19791. const body = { stream, source, length }
  19792. // 14. Return (body, type).
  19793. return [body, type]
  19794. }
  19795. // https://fetch.spec.whatwg.org/#bodyinit-safely-extract
  19796. function safelyExtractBody (object, keepalive = false) {
  19797. if (!ReadableStream) {
  19798. // istanbul ignore next
  19799. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  19800. }
  19801. // To safely extract a body and a `Content-Type` value from
  19802. // a byte sequence or BodyInit object object, run these steps:
  19803. // 1. If object is a ReadableStream object, then:
  19804. if (object instanceof ReadableStream) {
  19805. // Assert: object is neither disturbed nor locked.
  19806. // istanbul ignore next
  19807. assert(!util.isDisturbed(object), 'The body has already been consumed.')
  19808. // istanbul ignore next
  19809. assert(!object.locked, 'The stream is locked.')
  19810. }
  19811. // 2. Return the results of extracting object.
  19812. return extractBody(object, keepalive)
  19813. }
  19814. function cloneBody (body) {
  19815. // To clone a body body, run these steps:
  19816. // https://fetch.spec.whatwg.org/#concept-body-clone
  19817. // 1. Let « out1, out2 » be the result of teeing body’s stream.
  19818. const [out1, out2] = body.stream.tee()
  19819. const out2Clone = structuredClone(out2, { transfer: [out2] })
  19820. // This, for whatever reasons, unrefs out2Clone which allows
  19821. // the process to exit by itself.
  19822. const [, finalClone] = out2Clone.tee()
  19823. // 2. Set body’s stream to out1.
  19824. body.stream = out1
  19825. // 3. Return a body whose stream is out2 and other members are copied from body.
  19826. return {
  19827. stream: finalClone,
  19828. length: body.length,
  19829. source: body.source
  19830. }
  19831. }
  19832. async function * consumeBody (body) {
  19833. if (body) {
  19834. if (isUint8Array(body)) {
  19835. yield body
  19836. } else {
  19837. const stream = body.stream
  19838. if (util.isDisturbed(stream)) {
  19839. throw new TypeError('The body has already been consumed.')
  19840. }
  19841. if (stream.locked) {
  19842. throw new TypeError('The stream is locked.')
  19843. }
  19844. // Compat.
  19845. stream[kBodyUsed] = true
  19846. yield * stream
  19847. }
  19848. }
  19849. }
  19850. function throwIfAborted (state) {
  19851. if (state.aborted) {
  19852. throw new DOMException('The operation was aborted.', 'AbortError')
  19853. }
  19854. }
  19855. function bodyMixinMethods (instance) {
  19856. const methods = {
  19857. blob () {
  19858. // The blob() method steps are to return the result of
  19859. // running consume body with this and the following step
  19860. // given a byte sequence bytes: return a Blob whose
  19861. // contents are bytes and whose type attribute is this’s
  19862. // MIME type.
  19863. return specConsumeBody(this, (bytes) => {
  19864. let mimeType = bodyMimeType(this)
  19865. if (mimeType === 'failure') {
  19866. mimeType = ''
  19867. } else if (mimeType) {
  19868. mimeType = serializeAMimeType(mimeType)
  19869. }
  19870. // Return a Blob whose contents are bytes and type attribute
  19871. // is mimeType.
  19872. return new Blob([bytes], { type: mimeType })
  19873. }, instance)
  19874. },
  19875. arrayBuffer () {
  19876. // The arrayBuffer() method steps are to return the result
  19877. // of running consume body with this and the following step
  19878. // given a byte sequence bytes: return a new ArrayBuffer
  19879. // whose contents are bytes.
  19880. return specConsumeBody(this, (bytes) => {
  19881. return new Uint8Array(bytes).buffer
  19882. }, instance)
  19883. },
  19884. text () {
  19885. // The text() method steps are to return the result of running
  19886. // consume body with this and UTF-8 decode.
  19887. return specConsumeBody(this, utf8DecodeBytes, instance)
  19888. },
  19889. json () {
  19890. // The json() method steps are to return the result of running
  19891. // consume body with this and parse JSON from bytes.
  19892. return specConsumeBody(this, parseJSONFromBytes, instance)
  19893. },
  19894. async formData () {
  19895. webidl.brandCheck(this, instance)
  19896. throwIfAborted(this[kState])
  19897. const contentType = this.headers.get('Content-Type')
  19898. // If mimeType’s essence is "multipart/form-data", then:
  19899. if (/multipart\/form-data/.test(contentType)) {
  19900. const headers = {}
  19901. for (const [key, value] of this.headers) headers[key.toLowerCase()] = value
  19902. const responseFormData = new FormData()
  19903. let busboy
  19904. try {
  19905. busboy = new Busboy({
  19906. headers,
  19907. preservePath: true
  19908. })
  19909. } catch (err) {
  19910. throw new DOMException(`${err}`, 'AbortError')
  19911. }
  19912. busboy.on('field', (name, value) => {
  19913. responseFormData.append(name, value)
  19914. })
  19915. busboy.on('file', (name, value, filename, encoding, mimeType) => {
  19916. const chunks = []
  19917. if (encoding === 'base64' || encoding.toLowerCase() === 'base64') {
  19918. let base64chunk = ''
  19919. value.on('data', (chunk) => {
  19920. base64chunk += chunk.toString().replace(/[\r\n]/gm, '')
  19921. const end = base64chunk.length - base64chunk.length % 4
  19922. chunks.push(Buffer.from(base64chunk.slice(0, end), 'base64'))
  19923. base64chunk = base64chunk.slice(end)
  19924. })
  19925. value.on('end', () => {
  19926. chunks.push(Buffer.from(base64chunk, 'base64'))
  19927. responseFormData.append(name, new File(chunks, filename, { type: mimeType }))
  19928. })
  19929. } else {
  19930. value.on('data', (chunk) => {
  19931. chunks.push(chunk)
  19932. })
  19933. value.on('end', () => {
  19934. responseFormData.append(name, new File(chunks, filename, { type: mimeType }))
  19935. })
  19936. }
  19937. })
  19938. const busboyResolve = new Promise((resolve, reject) => {
  19939. busboy.on('finish', resolve)
  19940. busboy.on('error', (err) => reject(new TypeError(err)))
  19941. })
  19942. if (this.body !== null) for await (const chunk of consumeBody(this[kState].body)) busboy.write(chunk)
  19943. busboy.end()
  19944. await busboyResolve
  19945. return responseFormData
  19946. } else if (/application\/x-www-form-urlencoded/.test(contentType)) {
  19947. // Otherwise, if mimeType’s essence is "application/x-www-form-urlencoded", then:
  19948. // 1. Let entries be the result of parsing bytes.
  19949. let entries
  19950. try {
  19951. let text = ''
  19952. // application/x-www-form-urlencoded parser will keep the BOM.
  19953. // https://url.spec.whatwg.org/#concept-urlencoded-parser
  19954. // Note that streaming decoder is stateful and cannot be reused
  19955. const streamingDecoder = new TextDecoder('utf-8', { ignoreBOM: true })
  19956. for await (const chunk of consumeBody(this[kState].body)) {
  19957. if (!isUint8Array(chunk)) {
  19958. throw new TypeError('Expected Uint8Array chunk')
  19959. }
  19960. text += streamingDecoder.decode(chunk, { stream: true })
  19961. }
  19962. text += streamingDecoder.decode()
  19963. entries = new URLSearchParams(text)
  19964. } catch (err) {
  19965. // istanbul ignore next: Unclear when new URLSearchParams can fail on a string.
  19966. // 2. If entries is failure, then throw a TypeError.
  19967. throw Object.assign(new TypeError(), { cause: err })
  19968. }
  19969. // 3. Return a new FormData object whose entries are entries.
  19970. const formData = new FormData()
  19971. for (const [name, value] of entries) {
  19972. formData.append(name, value)
  19973. }
  19974. return formData
  19975. } else {
  19976. // Wait a tick before checking if the request has been aborted.
  19977. // Otherwise, a TypeError can be thrown when an AbortError should.
  19978. await Promise.resolve()
  19979. throwIfAborted(this[kState])
  19980. // Otherwise, throw a TypeError.
  19981. throw webidl.errors.exception({
  19982. header: `${instance.name}.formData`,
  19983. message: 'Could not parse content as FormData.'
  19984. })
  19985. }
  19986. }
  19987. }
  19988. return methods
  19989. }
  19990. function mixinBody (prototype) {
  19991. Object.assign(prototype.prototype, bodyMixinMethods(prototype))
  19992. }
  19993. /**
  19994. * @see https://fetch.spec.whatwg.org/#concept-body-consume-body
  19995. * @param {Response|Request} object
  19996. * @param {(value: unknown) => unknown} convertBytesToJSValue
  19997. * @param {Response|Request} instance
  19998. */
  19999. async function specConsumeBody (object, convertBytesToJSValue, instance) {
  20000. webidl.brandCheck(object, instance)
  20001. throwIfAborted(object[kState])
  20002. // 1. If object is unusable, then return a promise rejected
  20003. // with a TypeError.
  20004. if (bodyUnusable(object[kState].body)) {
  20005. throw new TypeError('Body is unusable')
  20006. }
  20007. // 2. Let promise be a new promise.
  20008. const promise = createDeferredPromise()
  20009. // 3. Let errorSteps given error be to reject promise with error.
  20010. const errorSteps = (error) => promise.reject(error)
  20011. // 4. Let successSteps given a byte sequence data be to resolve
  20012. // promise with the result of running convertBytesToJSValue
  20013. // with data. If that threw an exception, then run errorSteps
  20014. // with that exception.
  20015. const successSteps = (data) => {
  20016. try {
  20017. promise.resolve(convertBytesToJSValue(data))
  20018. } catch (e) {
  20019. errorSteps(e)
  20020. }
  20021. }
  20022. // 5. If object’s body is null, then run successSteps with an
  20023. // empty byte sequence.
  20024. if (object[kState].body == null) {
  20025. successSteps(new Uint8Array())
  20026. return promise.promise
  20027. }
  20028. // 6. Otherwise, fully read object’s body given successSteps,
  20029. // errorSteps, and object’s relevant global object.
  20030. await fullyReadBody(object[kState].body, successSteps, errorSteps)
  20031. // 7. Return promise.
  20032. return promise.promise
  20033. }
  20034. // https://fetch.spec.whatwg.org/#body-unusable
  20035. function bodyUnusable (body) {
  20036. // An object including the Body interface mixin is
  20037. // said to be unusable if its body is non-null and
  20038. // its body’s stream is disturbed or locked.
  20039. return body != null && (body.stream.locked || util.isDisturbed(body.stream))
  20040. }
  20041. /**
  20042. * @see https://encoding.spec.whatwg.org/#utf-8-decode
  20043. * @param {Buffer} buffer
  20044. */
  20045. function utf8DecodeBytes (buffer) {
  20046. if (buffer.length === 0) {
  20047. return ''
  20048. }
  20049. // 1. Let buffer be the result of peeking three bytes from
  20050. // ioQueue, converted to a byte sequence.
  20051. // 2. If buffer is 0xEF 0xBB 0xBF, then read three
  20052. // bytes from ioQueue. (Do nothing with those bytes.)
  20053. if (buffer[0] === 0xEF && buffer[1] === 0xBB && buffer[2] === 0xBF) {
  20054. buffer = buffer.subarray(3)
  20055. }
  20056. // 3. Process a queue with an instance of UTF-8’s
  20057. // decoder, ioQueue, output, and "replacement".
  20058. const output = textDecoder.decode(buffer)
  20059. // 4. Return output.
  20060. return output
  20061. }
  20062. /**
  20063. * @see https://infra.spec.whatwg.org/#parse-json-bytes-to-a-javascript-value
  20064. * @param {Uint8Array} bytes
  20065. */
  20066. function parseJSONFromBytes (bytes) {
  20067. return JSON.parse(utf8DecodeBytes(bytes))
  20068. }
  20069. /**
  20070. * @see https://fetch.spec.whatwg.org/#concept-body-mime-type
  20071. * @param {import('./response').Response|import('./request').Request} object
  20072. */
  20073. function bodyMimeType (object) {
  20074. const { headersList } = object[kState]
  20075. const contentType = headersList.get('content-type')
  20076. if (contentType === null) {
  20077. return 'failure'
  20078. }
  20079. return parseMIMEType(contentType)
  20080. }
  20081. module.exports = {
  20082. extractBody,
  20083. safelyExtractBody,
  20084. cloneBody,
  20085. mixinBody
  20086. }
  20087. /***/ }),
  20088. /***/ 1037:
  20089. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  20090. "use strict";
  20091. const { MessageChannel, receiveMessageOnPort } = __nccwpck_require__(1267)
  20092. const corsSafeListedMethods = ['GET', 'HEAD', 'POST']
  20093. const corsSafeListedMethodsSet = new Set(corsSafeListedMethods)
  20094. const nullBodyStatus = [101, 204, 205, 304]
  20095. const redirectStatus = [301, 302, 303, 307, 308]
  20096. const redirectStatusSet = new Set(redirectStatus)
  20097. // https://fetch.spec.whatwg.org/#block-bad-port
  20098. const badPorts = [
  20099. '1', '7', '9', '11', '13', '15', '17', '19', '20', '21', '22', '23', '25', '37', '42', '43', '53', '69', '77', '79',
  20100. '87', '95', '101', '102', '103', '104', '109', '110', '111', '113', '115', '117', '119', '123', '135', '137',
  20101. '139', '143', '161', '179', '389', '427', '465', '512', '513', '514', '515', '526', '530', '531', '532',
  20102. '540', '548', '554', '556', '563', '587', '601', '636', '989', '990', '993', '995', '1719', '1720', '1723',
  20103. '2049', '3659', '4045', '5060', '5061', '6000', '6566', '6665', '6666', '6667', '6668', '6669', '6697',
  20104. '10080'
  20105. ]
  20106. const badPortsSet = new Set(badPorts)
  20107. // https://w3c.github.io/webappsec-referrer-policy/#referrer-policies
  20108. const referrerPolicy = [
  20109. '',
  20110. 'no-referrer',
  20111. 'no-referrer-when-downgrade',
  20112. 'same-origin',
  20113. 'origin',
  20114. 'strict-origin',
  20115. 'origin-when-cross-origin',
  20116. 'strict-origin-when-cross-origin',
  20117. 'unsafe-url'
  20118. ]
  20119. const referrerPolicySet = new Set(referrerPolicy)
  20120. const requestRedirect = ['follow', 'manual', 'error']
  20121. const safeMethods = ['GET', 'HEAD', 'OPTIONS', 'TRACE']
  20122. const safeMethodsSet = new Set(safeMethods)
  20123. const requestMode = ['navigate', 'same-origin', 'no-cors', 'cors']
  20124. const requestCredentials = ['omit', 'same-origin', 'include']
  20125. const requestCache = [
  20126. 'default',
  20127. 'no-store',
  20128. 'reload',
  20129. 'no-cache',
  20130. 'force-cache',
  20131. 'only-if-cached'
  20132. ]
  20133. // https://fetch.spec.whatwg.org/#request-body-header-name
  20134. const requestBodyHeader = [
  20135. 'content-encoding',
  20136. 'content-language',
  20137. 'content-location',
  20138. 'content-type',
  20139. // See https://github.com/nodejs/undici/issues/2021
  20140. // 'Content-Length' is a forbidden header name, which is typically
  20141. // removed in the Headers implementation. However, undici doesn't
  20142. // filter out headers, so we add it here.
  20143. 'content-length'
  20144. ]
  20145. // https://fetch.spec.whatwg.org/#enumdef-requestduplex
  20146. const requestDuplex = [
  20147. 'half'
  20148. ]
  20149. // http://fetch.spec.whatwg.org/#forbidden-method
  20150. const forbiddenMethods = ['CONNECT', 'TRACE', 'TRACK']
  20151. const forbiddenMethodsSet = new Set(forbiddenMethods)
  20152. const subresource = [
  20153. 'audio',
  20154. 'audioworklet',
  20155. 'font',
  20156. 'image',
  20157. 'manifest',
  20158. 'paintworklet',
  20159. 'script',
  20160. 'style',
  20161. 'track',
  20162. 'video',
  20163. 'xslt',
  20164. ''
  20165. ]
  20166. const subresourceSet = new Set(subresource)
  20167. /** @type {globalThis['DOMException']} */
  20168. const DOMException = globalThis.DOMException ?? (() => {
  20169. // DOMException was only made a global in Node v17.0.0,
  20170. // but fetch supports >= v16.8.
  20171. try {
  20172. atob('~')
  20173. } catch (err) {
  20174. return Object.getPrototypeOf(err).constructor
  20175. }
  20176. })()
  20177. let channel
  20178. /** @type {globalThis['structuredClone']} */
  20179. const structuredClone =
  20180. globalThis.structuredClone ??
  20181. // https://github.com/nodejs/node/blob/b27ae24dcc4251bad726d9d84baf678d1f707fed/lib/internal/structured_clone.js
  20182. // structuredClone was added in v17.0.0, but fetch supports v16.8
  20183. function structuredClone (value, options = undefined) {
  20184. if (arguments.length === 0) {
  20185. throw new TypeError('missing argument')
  20186. }
  20187. if (!channel) {
  20188. channel = new MessageChannel()
  20189. }
  20190. channel.port1.unref()
  20191. channel.port2.unref()
  20192. channel.port1.postMessage(value, options?.transfer)
  20193. return receiveMessageOnPort(channel.port2).message
  20194. }
  20195. module.exports = {
  20196. DOMException,
  20197. structuredClone,
  20198. subresource,
  20199. forbiddenMethods,
  20200. requestBodyHeader,
  20201. referrerPolicy,
  20202. requestRedirect,
  20203. requestMode,
  20204. requestCredentials,
  20205. requestCache,
  20206. redirectStatus,
  20207. corsSafeListedMethods,
  20208. nullBodyStatus,
  20209. safeMethods,
  20210. badPorts,
  20211. requestDuplex,
  20212. subresourceSet,
  20213. badPortsSet,
  20214. redirectStatusSet,
  20215. corsSafeListedMethodsSet,
  20216. safeMethodsSet,
  20217. forbiddenMethodsSet,
  20218. referrerPolicySet
  20219. }
  20220. /***/ }),
  20221. /***/ 685:
  20222. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  20223. const assert = __nccwpck_require__(9491)
  20224. const { atob } = __nccwpck_require__(4300)
  20225. const { isomorphicDecode } = __nccwpck_require__(2538)
  20226. const encoder = new TextEncoder()
  20227. /**
  20228. * @see https://mimesniff.spec.whatwg.org/#http-token-code-point
  20229. */
  20230. const HTTP_TOKEN_CODEPOINTS = /^[!#$%&'*+-.^_|~A-Za-z0-9]+$/
  20231. const HTTP_WHITESPACE_REGEX = /(\u000A|\u000D|\u0009|\u0020)/ // eslint-disable-line
  20232. /**
  20233. * @see https://mimesniff.spec.whatwg.org/#http-quoted-string-token-code-point
  20234. */
  20235. const HTTP_QUOTED_STRING_TOKENS = /[\u0009|\u0020-\u007E|\u0080-\u00FF]/ // eslint-disable-line
  20236. // https://fetch.spec.whatwg.org/#data-url-processor
  20237. /** @param {URL} dataURL */
  20238. function dataURLProcessor (dataURL) {
  20239. // 1. Assert: dataURL’s scheme is "data".
  20240. assert(dataURL.protocol === 'data:')
  20241. // 2. Let input be the result of running the URL
  20242. // serializer on dataURL with exclude fragment
  20243. // set to true.
  20244. let input = URLSerializer(dataURL, true)
  20245. // 3. Remove the leading "data:" string from input.
  20246. input = input.slice(5)
  20247. // 4. Let position point at the start of input.
  20248. const position = { position: 0 }
  20249. // 5. Let mimeType be the result of collecting a
  20250. // sequence of code points that are not equal
  20251. // to U+002C (,), given position.
  20252. let mimeType = collectASequenceOfCodePointsFast(
  20253. ',',
  20254. input,
  20255. position
  20256. )
  20257. // 6. Strip leading and trailing ASCII whitespace
  20258. // from mimeType.
  20259. // Undici implementation note: we need to store the
  20260. // length because if the mimetype has spaces removed,
  20261. // the wrong amount will be sliced from the input in
  20262. // step #9
  20263. const mimeTypeLength = mimeType.length
  20264. mimeType = removeASCIIWhitespace(mimeType, true, true)
  20265. // 7. If position is past the end of input, then
  20266. // return failure
  20267. if (position.position >= input.length) {
  20268. return 'failure'
  20269. }
  20270. // 8. Advance position by 1.
  20271. position.position++
  20272. // 9. Let encodedBody be the remainder of input.
  20273. const encodedBody = input.slice(mimeTypeLength + 1)
  20274. // 10. Let body be the percent-decoding of encodedBody.
  20275. let body = stringPercentDecode(encodedBody)
  20276. // 11. If mimeType ends with U+003B (;), followed by
  20277. // zero or more U+0020 SPACE, followed by an ASCII
  20278. // case-insensitive match for "base64", then:
  20279. if (/;(\u0020){0,}base64$/i.test(mimeType)) {
  20280. // 1. Let stringBody be the isomorphic decode of body.
  20281. const stringBody = isomorphicDecode(body)
  20282. // 2. Set body to the forgiving-base64 decode of
  20283. // stringBody.
  20284. body = forgivingBase64(stringBody)
  20285. // 3. If body is failure, then return failure.
  20286. if (body === 'failure') {
  20287. return 'failure'
  20288. }
  20289. // 4. Remove the last 6 code points from mimeType.
  20290. mimeType = mimeType.slice(0, -6)
  20291. // 5. Remove trailing U+0020 SPACE code points from mimeType,
  20292. // if any.
  20293. mimeType = mimeType.replace(/(\u0020)+$/, '')
  20294. // 6. Remove the last U+003B (;) code point from mimeType.
  20295. mimeType = mimeType.slice(0, -1)
  20296. }
  20297. // 12. If mimeType starts with U+003B (;), then prepend
  20298. // "text/plain" to mimeType.
  20299. if (mimeType.startsWith(';')) {
  20300. mimeType = 'text/plain' + mimeType
  20301. }
  20302. // 13. Let mimeTypeRecord be the result of parsing
  20303. // mimeType.
  20304. let mimeTypeRecord = parseMIMEType(mimeType)
  20305. // 14. If mimeTypeRecord is failure, then set
  20306. // mimeTypeRecord to text/plain;charset=US-ASCII.
  20307. if (mimeTypeRecord === 'failure') {
  20308. mimeTypeRecord = parseMIMEType('text/plain;charset=US-ASCII')
  20309. }
  20310. // 15. Return a new data: URL struct whose MIME
  20311. // type is mimeTypeRecord and body is body.
  20312. // https://fetch.spec.whatwg.org/#data-url-struct
  20313. return { mimeType: mimeTypeRecord, body }
  20314. }
  20315. // https://url.spec.whatwg.org/#concept-url-serializer
  20316. /**
  20317. * @param {URL} url
  20318. * @param {boolean} excludeFragment
  20319. */
  20320. function URLSerializer (url, excludeFragment = false) {
  20321. if (!excludeFragment) {
  20322. return url.href
  20323. }
  20324. const href = url.href
  20325. const hashLength = url.hash.length
  20326. return hashLength === 0 ? href : href.substring(0, href.length - hashLength)
  20327. }
  20328. // https://infra.spec.whatwg.org/#collect-a-sequence-of-code-points
  20329. /**
  20330. * @param {(char: string) => boolean} condition
  20331. * @param {string} input
  20332. * @param {{ position: number }} position
  20333. */
  20334. function collectASequenceOfCodePoints (condition, input, position) {
  20335. // 1. Let result be the empty string.
  20336. let result = ''
  20337. // 2. While position doesn’t point past the end of input and the
  20338. // code point at position within input meets the condition condition:
  20339. while (position.position < input.length && condition(input[position.position])) {
  20340. // 1. Append that code point to the end of result.
  20341. result += input[position.position]
  20342. // 2. Advance position by 1.
  20343. position.position++
  20344. }
  20345. // 3. Return result.
  20346. return result
  20347. }
  20348. /**
  20349. * A faster collectASequenceOfCodePoints that only works when comparing a single character.
  20350. * @param {string} char
  20351. * @param {string} input
  20352. * @param {{ position: number }} position
  20353. */
  20354. function collectASequenceOfCodePointsFast (char, input, position) {
  20355. const idx = input.indexOf(char, position.position)
  20356. const start = position.position
  20357. if (idx === -1) {
  20358. position.position = input.length
  20359. return input.slice(start)
  20360. }
  20361. position.position = idx
  20362. return input.slice(start, position.position)
  20363. }
  20364. // https://url.spec.whatwg.org/#string-percent-decode
  20365. /** @param {string} input */
  20366. function stringPercentDecode (input) {
  20367. // 1. Let bytes be the UTF-8 encoding of input.
  20368. const bytes = encoder.encode(input)
  20369. // 2. Return the percent-decoding of bytes.
  20370. return percentDecode(bytes)
  20371. }
  20372. // https://url.spec.whatwg.org/#percent-decode
  20373. /** @param {Uint8Array} input */
  20374. function percentDecode (input) {
  20375. // 1. Let output be an empty byte sequence.
  20376. /** @type {number[]} */
  20377. const output = []
  20378. // 2. For each byte byte in input:
  20379. for (let i = 0; i < input.length; i++) {
  20380. const byte = input[i]
  20381. // 1. If byte is not 0x25 (%), then append byte to output.
  20382. if (byte !== 0x25) {
  20383. output.push(byte)
  20384. // 2. Otherwise, if byte is 0x25 (%) and the next two bytes
  20385. // after byte in input are not in the ranges
  20386. // 0x30 (0) to 0x39 (9), 0x41 (A) to 0x46 (F),
  20387. // and 0x61 (a) to 0x66 (f), all inclusive, append byte
  20388. // to output.
  20389. } else if (
  20390. byte === 0x25 &&
  20391. !/^[0-9A-Fa-f]{2}$/i.test(String.fromCharCode(input[i + 1], input[i + 2]))
  20392. ) {
  20393. output.push(0x25)
  20394. // 3. Otherwise:
  20395. } else {
  20396. // 1. Let bytePoint be the two bytes after byte in input,
  20397. // decoded, and then interpreted as hexadecimal number.
  20398. const nextTwoBytes = String.fromCharCode(input[i + 1], input[i + 2])
  20399. const bytePoint = Number.parseInt(nextTwoBytes, 16)
  20400. // 2. Append a byte whose value is bytePoint to output.
  20401. output.push(bytePoint)
  20402. // 3. Skip the next two bytes in input.
  20403. i += 2
  20404. }
  20405. }
  20406. // 3. Return output.
  20407. return Uint8Array.from(output)
  20408. }
  20409. // https://mimesniff.spec.whatwg.org/#parse-a-mime-type
  20410. /** @param {string} input */
  20411. function parseMIMEType (input) {
  20412. // 1. Remove any leading and trailing HTTP whitespace
  20413. // from input.
  20414. input = removeHTTPWhitespace(input, true, true)
  20415. // 2. Let position be a position variable for input,
  20416. // initially pointing at the start of input.
  20417. const position = { position: 0 }
  20418. // 3. Let type be the result of collecting a sequence
  20419. // of code points that are not U+002F (/) from
  20420. // input, given position.
  20421. const type = collectASequenceOfCodePointsFast(
  20422. '/',
  20423. input,
  20424. position
  20425. )
  20426. // 4. If type is the empty string or does not solely
  20427. // contain HTTP token code points, then return failure.
  20428. // https://mimesniff.spec.whatwg.org/#http-token-code-point
  20429. if (type.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(type)) {
  20430. return 'failure'
  20431. }
  20432. // 5. If position is past the end of input, then return
  20433. // failure
  20434. if (position.position > input.length) {
  20435. return 'failure'
  20436. }
  20437. // 6. Advance position by 1. (This skips past U+002F (/).)
  20438. position.position++
  20439. // 7. Let subtype be the result of collecting a sequence of
  20440. // code points that are not U+003B (;) from input, given
  20441. // position.
  20442. let subtype = collectASequenceOfCodePointsFast(
  20443. ';',
  20444. input,
  20445. position
  20446. )
  20447. // 8. Remove any trailing HTTP whitespace from subtype.
  20448. subtype = removeHTTPWhitespace(subtype, false, true)
  20449. // 9. If subtype is the empty string or does not solely
  20450. // contain HTTP token code points, then return failure.
  20451. if (subtype.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(subtype)) {
  20452. return 'failure'
  20453. }
  20454. const typeLowercase = type.toLowerCase()
  20455. const subtypeLowercase = subtype.toLowerCase()
  20456. // 10. Let mimeType be a new MIME type record whose type
  20457. // is type, in ASCII lowercase, and subtype is subtype,
  20458. // in ASCII lowercase.
  20459. // https://mimesniff.spec.whatwg.org/#mime-type
  20460. const mimeType = {
  20461. type: typeLowercase,
  20462. subtype: subtypeLowercase,
  20463. /** @type {Map<string, string>} */
  20464. parameters: new Map(),
  20465. // https://mimesniff.spec.whatwg.org/#mime-type-essence
  20466. essence: `${typeLowercase}/${subtypeLowercase}`
  20467. }
  20468. // 11. While position is not past the end of input:
  20469. while (position.position < input.length) {
  20470. // 1. Advance position by 1. (This skips past U+003B (;).)
  20471. position.position++
  20472. // 2. Collect a sequence of code points that are HTTP
  20473. // whitespace from input given position.
  20474. collectASequenceOfCodePoints(
  20475. // https://fetch.spec.whatwg.org/#http-whitespace
  20476. char => HTTP_WHITESPACE_REGEX.test(char),
  20477. input,
  20478. position
  20479. )
  20480. // 3. Let parameterName be the result of collecting a
  20481. // sequence of code points that are not U+003B (;)
  20482. // or U+003D (=) from input, given position.
  20483. let parameterName = collectASequenceOfCodePoints(
  20484. (char) => char !== ';' && char !== '=',
  20485. input,
  20486. position
  20487. )
  20488. // 4. Set parameterName to parameterName, in ASCII
  20489. // lowercase.
  20490. parameterName = parameterName.toLowerCase()
  20491. // 5. If position is not past the end of input, then:
  20492. if (position.position < input.length) {
  20493. // 1. If the code point at position within input is
  20494. // U+003B (;), then continue.
  20495. if (input[position.position] === ';') {
  20496. continue
  20497. }
  20498. // 2. Advance position by 1. (This skips past U+003D (=).)
  20499. position.position++
  20500. }
  20501. // 6. If position is past the end of input, then break.
  20502. if (position.position > input.length) {
  20503. break
  20504. }
  20505. // 7. Let parameterValue be null.
  20506. let parameterValue = null
  20507. // 8. If the code point at position within input is
  20508. // U+0022 ("), then:
  20509. if (input[position.position] === '"') {
  20510. // 1. Set parameterValue to the result of collecting
  20511. // an HTTP quoted string from input, given position
  20512. // and the extract-value flag.
  20513. parameterValue = collectAnHTTPQuotedString(input, position, true)
  20514. // 2. Collect a sequence of code points that are not
  20515. // U+003B (;) from input, given position.
  20516. collectASequenceOfCodePointsFast(
  20517. ';',
  20518. input,
  20519. position
  20520. )
  20521. // 9. Otherwise:
  20522. } else {
  20523. // 1. Set parameterValue to the result of collecting
  20524. // a sequence of code points that are not U+003B (;)
  20525. // from input, given position.
  20526. parameterValue = collectASequenceOfCodePointsFast(
  20527. ';',
  20528. input,
  20529. position
  20530. )
  20531. // 2. Remove any trailing HTTP whitespace from parameterValue.
  20532. parameterValue = removeHTTPWhitespace(parameterValue, false, true)
  20533. // 3. If parameterValue is the empty string, then continue.
  20534. if (parameterValue.length === 0) {
  20535. continue
  20536. }
  20537. }
  20538. // 10. If all of the following are true
  20539. // - parameterName is not the empty string
  20540. // - parameterName solely contains HTTP token code points
  20541. // - parameterValue solely contains HTTP quoted-string token code points
  20542. // - mimeType’s parameters[parameterName] does not exist
  20543. // then set mimeType’s parameters[parameterName] to parameterValue.
  20544. if (
  20545. parameterName.length !== 0 &&
  20546. HTTP_TOKEN_CODEPOINTS.test(parameterName) &&
  20547. (parameterValue.length === 0 || HTTP_QUOTED_STRING_TOKENS.test(parameterValue)) &&
  20548. !mimeType.parameters.has(parameterName)
  20549. ) {
  20550. mimeType.parameters.set(parameterName, parameterValue)
  20551. }
  20552. }
  20553. // 12. Return mimeType.
  20554. return mimeType
  20555. }
  20556. // https://infra.spec.whatwg.org/#forgiving-base64-decode
  20557. /** @param {string} data */
  20558. function forgivingBase64 (data) {
  20559. // 1. Remove all ASCII whitespace from data.
  20560. data = data.replace(/[\u0009\u000A\u000C\u000D\u0020]/g, '') // eslint-disable-line
  20561. // 2. If data’s code point length divides by 4 leaving
  20562. // no remainder, then:
  20563. if (data.length % 4 === 0) {
  20564. // 1. If data ends with one or two U+003D (=) code points,
  20565. // then remove them from data.
  20566. data = data.replace(/=?=$/, '')
  20567. }
  20568. // 3. If data’s code point length divides by 4 leaving
  20569. // a remainder of 1, then return failure.
  20570. if (data.length % 4 === 1) {
  20571. return 'failure'
  20572. }
  20573. // 4. If data contains a code point that is not one of
  20574. // U+002B (+)
  20575. // U+002F (/)
  20576. // ASCII alphanumeric
  20577. // then return failure.
  20578. if (/[^+/0-9A-Za-z]/.test(data)) {
  20579. return 'failure'
  20580. }
  20581. const binary = atob(data)
  20582. const bytes = new Uint8Array(binary.length)
  20583. for (let byte = 0; byte < binary.length; byte++) {
  20584. bytes[byte] = binary.charCodeAt(byte)
  20585. }
  20586. return bytes
  20587. }
  20588. // https://fetch.spec.whatwg.org/#collect-an-http-quoted-string
  20589. // tests: https://fetch.spec.whatwg.org/#example-http-quoted-string
  20590. /**
  20591. * @param {string} input
  20592. * @param {{ position: number }} position
  20593. * @param {boolean?} extractValue
  20594. */
  20595. function collectAnHTTPQuotedString (input, position, extractValue) {
  20596. // 1. Let positionStart be position.
  20597. const positionStart = position.position
  20598. // 2. Let value be the empty string.
  20599. let value = ''
  20600. // 3. Assert: the code point at position within input
  20601. // is U+0022 (").
  20602. assert(input[position.position] === '"')
  20603. // 4. Advance position by 1.
  20604. position.position++
  20605. // 5. While true:
  20606. while (true) {
  20607. // 1. Append the result of collecting a sequence of code points
  20608. // that are not U+0022 (") or U+005C (\) from input, given
  20609. // position, to value.
  20610. value += collectASequenceOfCodePoints(
  20611. (char) => char !== '"' && char !== '\\',
  20612. input,
  20613. position
  20614. )
  20615. // 2. If position is past the end of input, then break.
  20616. if (position.position >= input.length) {
  20617. break
  20618. }
  20619. // 3. Let quoteOrBackslash be the code point at position within
  20620. // input.
  20621. const quoteOrBackslash = input[position.position]
  20622. // 4. Advance position by 1.
  20623. position.position++
  20624. // 5. If quoteOrBackslash is U+005C (\), then:
  20625. if (quoteOrBackslash === '\\') {
  20626. // 1. If position is past the end of input, then append
  20627. // U+005C (\) to value and break.
  20628. if (position.position >= input.length) {
  20629. value += '\\'
  20630. break
  20631. }
  20632. // 2. Append the code point at position within input to value.
  20633. value += input[position.position]
  20634. // 3. Advance position by 1.
  20635. position.position++
  20636. // 6. Otherwise:
  20637. } else {
  20638. // 1. Assert: quoteOrBackslash is U+0022 (").
  20639. assert(quoteOrBackslash === '"')
  20640. // 2. Break.
  20641. break
  20642. }
  20643. }
  20644. // 6. If the extract-value flag is set, then return value.
  20645. if (extractValue) {
  20646. return value
  20647. }
  20648. // 7. Return the code points from positionStart to position,
  20649. // inclusive, within input.
  20650. return input.slice(positionStart, position.position)
  20651. }
  20652. /**
  20653. * @see https://mimesniff.spec.whatwg.org/#serialize-a-mime-type
  20654. */
  20655. function serializeAMimeType (mimeType) {
  20656. assert(mimeType !== 'failure')
  20657. const { parameters, essence } = mimeType
  20658. // 1. Let serialization be the concatenation of mimeType’s
  20659. // type, U+002F (/), and mimeType’s subtype.
  20660. let serialization = essence
  20661. // 2. For each name → value of mimeType’s parameters:
  20662. for (let [name, value] of parameters.entries()) {
  20663. // 1. Append U+003B (;) to serialization.
  20664. serialization += ';'
  20665. // 2. Append name to serialization.
  20666. serialization += name
  20667. // 3. Append U+003D (=) to serialization.
  20668. serialization += '='
  20669. // 4. If value does not solely contain HTTP token code
  20670. // points or value is the empty string, then:
  20671. if (!HTTP_TOKEN_CODEPOINTS.test(value)) {
  20672. // 1. Precede each occurence of U+0022 (") or
  20673. // U+005C (\) in value with U+005C (\).
  20674. value = value.replace(/(\\|")/g, '\\$1')
  20675. // 2. Prepend U+0022 (") to value.
  20676. value = '"' + value
  20677. // 3. Append U+0022 (") to value.
  20678. value += '"'
  20679. }
  20680. // 5. Append value to serialization.
  20681. serialization += value
  20682. }
  20683. // 3. Return serialization.
  20684. return serialization
  20685. }
  20686. /**
  20687. * @see https://fetch.spec.whatwg.org/#http-whitespace
  20688. * @param {string} char
  20689. */
  20690. function isHTTPWhiteSpace (char) {
  20691. return char === '\r' || char === '\n' || char === '\t' || char === ' '
  20692. }
  20693. /**
  20694. * @see https://fetch.spec.whatwg.org/#http-whitespace
  20695. * @param {string} str
  20696. */
  20697. function removeHTTPWhitespace (str, leading = true, trailing = true) {
  20698. let lead = 0
  20699. let trail = str.length - 1
  20700. if (leading) {
  20701. for (; lead < str.length && isHTTPWhiteSpace(str[lead]); lead++);
  20702. }
  20703. if (trailing) {
  20704. for (; trail > 0 && isHTTPWhiteSpace(str[trail]); trail--);
  20705. }
  20706. return str.slice(lead, trail + 1)
  20707. }
  20708. /**
  20709. * @see https://infra.spec.whatwg.org/#ascii-whitespace
  20710. * @param {string} char
  20711. */
  20712. function isASCIIWhitespace (char) {
  20713. return char === '\r' || char === '\n' || char === '\t' || char === '\f' || char === ' '
  20714. }
  20715. /**
  20716. * @see https://infra.spec.whatwg.org/#strip-leading-and-trailing-ascii-whitespace
  20717. */
  20718. function removeASCIIWhitespace (str, leading = true, trailing = true) {
  20719. let lead = 0
  20720. let trail = str.length - 1
  20721. if (leading) {
  20722. for (; lead < str.length && isASCIIWhitespace(str[lead]); lead++);
  20723. }
  20724. if (trailing) {
  20725. for (; trail > 0 && isASCIIWhitespace(str[trail]); trail--);
  20726. }
  20727. return str.slice(lead, trail + 1)
  20728. }
  20729. module.exports = {
  20730. dataURLProcessor,
  20731. URLSerializer,
  20732. collectASequenceOfCodePoints,
  20733. collectASequenceOfCodePointsFast,
  20734. stringPercentDecode,
  20735. parseMIMEType,
  20736. collectAnHTTPQuotedString,
  20737. serializeAMimeType
  20738. }
  20739. /***/ }),
  20740. /***/ 8511:
  20741. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  20742. "use strict";
  20743. const { Blob, File: NativeFile } = __nccwpck_require__(4300)
  20744. const { types } = __nccwpck_require__(3837)
  20745. const { kState } = __nccwpck_require__(5861)
  20746. const { isBlobLike } = __nccwpck_require__(2538)
  20747. const { webidl } = __nccwpck_require__(1744)
  20748. const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(685)
  20749. const { kEnumerableProperty } = __nccwpck_require__(3983)
  20750. const encoder = new TextEncoder()
  20751. class File extends Blob {
  20752. constructor (fileBits, fileName, options = {}) {
  20753. // The File constructor is invoked with two or three parameters, depending
  20754. // on whether the optional dictionary parameter is used. When the File()
  20755. // constructor is invoked, user agents must run the following steps:
  20756. webidl.argumentLengthCheck(arguments, 2, { header: 'File constructor' })
  20757. fileBits = webidl.converters['sequence<BlobPart>'](fileBits)
  20758. fileName = webidl.converters.USVString(fileName)
  20759. options = webidl.converters.FilePropertyBag(options)
  20760. // 1. Let bytes be the result of processing blob parts given fileBits and
  20761. // options.
  20762. // Note: Blob handles this for us
  20763. // 2. Let n be the fileName argument to the constructor.
  20764. const n = fileName
  20765. // 3. Process FilePropertyBag dictionary argument by running the following
  20766. // substeps:
  20767. // 1. If the type member is provided and is not the empty string, let t
  20768. // be set to the type dictionary member. If t contains any characters
  20769. // outside the range U+0020 to U+007E, then set t to the empty string
  20770. // and return from these substeps.
  20771. // 2. Convert every character in t to ASCII lowercase.
  20772. let t = options.type
  20773. let d
  20774. // eslint-disable-next-line no-labels
  20775. substep: {
  20776. if (t) {
  20777. t = parseMIMEType(t)
  20778. if (t === 'failure') {
  20779. t = ''
  20780. // eslint-disable-next-line no-labels
  20781. break substep
  20782. }
  20783. t = serializeAMimeType(t).toLowerCase()
  20784. }
  20785. // 3. If the lastModified member is provided, let d be set to the
  20786. // lastModified dictionary member. If it is not provided, set d to the
  20787. // current date and time represented as the number of milliseconds since
  20788. // the Unix Epoch (which is the equivalent of Date.now() [ECMA-262]).
  20789. d = options.lastModified
  20790. }
  20791. // 4. Return a new File object F such that:
  20792. // F refers to the bytes byte sequence.
  20793. // F.size is set to the number of total bytes in bytes.
  20794. // F.name is set to n.
  20795. // F.type is set to t.
  20796. // F.lastModified is set to d.
  20797. super(processBlobParts(fileBits, options), { type: t })
  20798. this[kState] = {
  20799. name: n,
  20800. lastModified: d,
  20801. type: t
  20802. }
  20803. }
  20804. get name () {
  20805. webidl.brandCheck(this, File)
  20806. return this[kState].name
  20807. }
  20808. get lastModified () {
  20809. webidl.brandCheck(this, File)
  20810. return this[kState].lastModified
  20811. }
  20812. get type () {
  20813. webidl.brandCheck(this, File)
  20814. return this[kState].type
  20815. }
  20816. }
  20817. class FileLike {
  20818. constructor (blobLike, fileName, options = {}) {
  20819. // TODO: argument idl type check
  20820. // The File constructor is invoked with two or three parameters, depending
  20821. // on whether the optional dictionary parameter is used. When the File()
  20822. // constructor is invoked, user agents must run the following steps:
  20823. // 1. Let bytes be the result of processing blob parts given fileBits and
  20824. // options.
  20825. // 2. Let n be the fileName argument to the constructor.
  20826. const n = fileName
  20827. // 3. Process FilePropertyBag dictionary argument by running the following
  20828. // substeps:
  20829. // 1. If the type member is provided and is not the empty string, let t
  20830. // be set to the type dictionary member. If t contains any characters
  20831. // outside the range U+0020 to U+007E, then set t to the empty string
  20832. // and return from these substeps.
  20833. // TODO
  20834. const t = options.type
  20835. // 2. Convert every character in t to ASCII lowercase.
  20836. // TODO
  20837. // 3. If the lastModified member is provided, let d be set to the
  20838. // lastModified dictionary member. If it is not provided, set d to the
  20839. // current date and time represented as the number of milliseconds since
  20840. // the Unix Epoch (which is the equivalent of Date.now() [ECMA-262]).
  20841. const d = options.lastModified ?? Date.now()
  20842. // 4. Return a new File object F such that:
  20843. // F refers to the bytes byte sequence.
  20844. // F.size is set to the number of total bytes in bytes.
  20845. // F.name is set to n.
  20846. // F.type is set to t.
  20847. // F.lastModified is set to d.
  20848. this[kState] = {
  20849. blobLike,
  20850. name: n,
  20851. type: t,
  20852. lastModified: d
  20853. }
  20854. }
  20855. stream (...args) {
  20856. webidl.brandCheck(this, FileLike)
  20857. return this[kState].blobLike.stream(...args)
  20858. }
  20859. arrayBuffer (...args) {
  20860. webidl.brandCheck(this, FileLike)
  20861. return this[kState].blobLike.arrayBuffer(...args)
  20862. }
  20863. slice (...args) {
  20864. webidl.brandCheck(this, FileLike)
  20865. return this[kState].blobLike.slice(...args)
  20866. }
  20867. text (...args) {
  20868. webidl.brandCheck(this, FileLike)
  20869. return this[kState].blobLike.text(...args)
  20870. }
  20871. get size () {
  20872. webidl.brandCheck(this, FileLike)
  20873. return this[kState].blobLike.size
  20874. }
  20875. get type () {
  20876. webidl.brandCheck(this, FileLike)
  20877. return this[kState].blobLike.type
  20878. }
  20879. get name () {
  20880. webidl.brandCheck(this, FileLike)
  20881. return this[kState].name
  20882. }
  20883. get lastModified () {
  20884. webidl.brandCheck(this, FileLike)
  20885. return this[kState].lastModified
  20886. }
  20887. get [Symbol.toStringTag] () {
  20888. return 'File'
  20889. }
  20890. }
  20891. Object.defineProperties(File.prototype, {
  20892. [Symbol.toStringTag]: {
  20893. value: 'File',
  20894. configurable: true
  20895. },
  20896. name: kEnumerableProperty,
  20897. lastModified: kEnumerableProperty
  20898. })
  20899. webidl.converters.Blob = webidl.interfaceConverter(Blob)
  20900. webidl.converters.BlobPart = function (V, opts) {
  20901. if (webidl.util.Type(V) === 'Object') {
  20902. if (isBlobLike(V)) {
  20903. return webidl.converters.Blob(V, { strict: false })
  20904. }
  20905. if (
  20906. ArrayBuffer.isView(V) ||
  20907. types.isAnyArrayBuffer(V)
  20908. ) {
  20909. return webidl.converters.BufferSource(V, opts)
  20910. }
  20911. }
  20912. return webidl.converters.USVString(V, opts)
  20913. }
  20914. webidl.converters['sequence<BlobPart>'] = webidl.sequenceConverter(
  20915. webidl.converters.BlobPart
  20916. )
  20917. // https://www.w3.org/TR/FileAPI/#dfn-FilePropertyBag
  20918. webidl.converters.FilePropertyBag = webidl.dictionaryConverter([
  20919. {
  20920. key: 'lastModified',
  20921. converter: webidl.converters['long long'],
  20922. get defaultValue () {
  20923. return Date.now()
  20924. }
  20925. },
  20926. {
  20927. key: 'type',
  20928. converter: webidl.converters.DOMString,
  20929. defaultValue: ''
  20930. },
  20931. {
  20932. key: 'endings',
  20933. converter: (value) => {
  20934. value = webidl.converters.DOMString(value)
  20935. value = value.toLowerCase()
  20936. if (value !== 'native') {
  20937. value = 'transparent'
  20938. }
  20939. return value
  20940. },
  20941. defaultValue: 'transparent'
  20942. }
  20943. ])
  20944. /**
  20945. * @see https://www.w3.org/TR/FileAPI/#process-blob-parts
  20946. * @param {(NodeJS.TypedArray|Blob|string)[]} parts
  20947. * @param {{ type: string, endings: string }} options
  20948. */
  20949. function processBlobParts (parts, options) {
  20950. // 1. Let bytes be an empty sequence of bytes.
  20951. /** @type {NodeJS.TypedArray[]} */
  20952. const bytes = []
  20953. // 2. For each element in parts:
  20954. for (const element of parts) {
  20955. // 1. If element is a USVString, run the following substeps:
  20956. if (typeof element === 'string') {
  20957. // 1. Let s be element.
  20958. let s = element
  20959. // 2. If the endings member of options is "native", set s
  20960. // to the result of converting line endings to native
  20961. // of element.
  20962. if (options.endings === 'native') {
  20963. s = convertLineEndingsNative(s)
  20964. }
  20965. // 3. Append the result of UTF-8 encoding s to bytes.
  20966. bytes.push(encoder.encode(s))
  20967. } else if (
  20968. types.isAnyArrayBuffer(element) ||
  20969. types.isTypedArray(element)
  20970. ) {
  20971. // 2. If element is a BufferSource, get a copy of the
  20972. // bytes held by the buffer source, and append those
  20973. // bytes to bytes.
  20974. if (!element.buffer) { // ArrayBuffer
  20975. bytes.push(new Uint8Array(element))
  20976. } else {
  20977. bytes.push(
  20978. new Uint8Array(element.buffer, element.byteOffset, element.byteLength)
  20979. )
  20980. }
  20981. } else if (isBlobLike(element)) {
  20982. // 3. If element is a Blob, append the bytes it represents
  20983. // to bytes.
  20984. bytes.push(element)
  20985. }
  20986. }
  20987. // 3. Return bytes.
  20988. return bytes
  20989. }
  20990. /**
  20991. * @see https://www.w3.org/TR/FileAPI/#convert-line-endings-to-native
  20992. * @param {string} s
  20993. */
  20994. function convertLineEndingsNative (s) {
  20995. // 1. Let native line ending be be the code point U+000A LF.
  20996. let nativeLineEnding = '\n'
  20997. // 2. If the underlying platform’s conventions are to
  20998. // represent newlines as a carriage return and line feed
  20999. // sequence, set native line ending to the code point
  21000. // U+000D CR followed by the code point U+000A LF.
  21001. if (process.platform === 'win32') {
  21002. nativeLineEnding = '\r\n'
  21003. }
  21004. return s.replace(/\r?\n/g, nativeLineEnding)
  21005. }
  21006. // If this function is moved to ./util.js, some tools (such as
  21007. // rollup) will warn about circular dependencies. See:
  21008. // https://github.com/nodejs/undici/issues/1629
  21009. function isFileLike (object) {
  21010. return (
  21011. (NativeFile && object instanceof NativeFile) ||
  21012. object instanceof File || (
  21013. object &&
  21014. (typeof object.stream === 'function' ||
  21015. typeof object.arrayBuffer === 'function') &&
  21016. object[Symbol.toStringTag] === 'File'
  21017. )
  21018. )
  21019. }
  21020. module.exports = { File, FileLike, isFileLike }
  21021. /***/ }),
  21022. /***/ 2015:
  21023. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  21024. "use strict";
  21025. const { isBlobLike, toUSVString, makeIterator } = __nccwpck_require__(2538)
  21026. const { kState } = __nccwpck_require__(5861)
  21027. const { File: UndiciFile, FileLike, isFileLike } = __nccwpck_require__(8511)
  21028. const { webidl } = __nccwpck_require__(1744)
  21029. const { Blob, File: NativeFile } = __nccwpck_require__(4300)
  21030. /** @type {globalThis['File']} */
  21031. const File = NativeFile ?? UndiciFile
  21032. // https://xhr.spec.whatwg.org/#formdata
  21033. class FormData {
  21034. constructor (form) {
  21035. if (form !== undefined) {
  21036. throw webidl.errors.conversionFailed({
  21037. prefix: 'FormData constructor',
  21038. argument: 'Argument 1',
  21039. types: ['undefined']
  21040. })
  21041. }
  21042. this[kState] = []
  21043. }
  21044. append (name, value, filename = undefined) {
  21045. webidl.brandCheck(this, FormData)
  21046. webidl.argumentLengthCheck(arguments, 2, { header: 'FormData.append' })
  21047. if (arguments.length === 3 && !isBlobLike(value)) {
  21048. throw new TypeError(
  21049. "Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'"
  21050. )
  21051. }
  21052. // 1. Let value be value if given; otherwise blobValue.
  21053. name = webidl.converters.USVString(name)
  21054. value = isBlobLike(value)
  21055. ? webidl.converters.Blob(value, { strict: false })
  21056. : webidl.converters.USVString(value)
  21057. filename = arguments.length === 3
  21058. ? webidl.converters.USVString(filename)
  21059. : undefined
  21060. // 2. Let entry be the result of creating an entry with
  21061. // name, value, and filename if given.
  21062. const entry = makeEntry(name, value, filename)
  21063. // 3. Append entry to this’s entry list.
  21064. this[kState].push(entry)
  21065. }
  21066. delete (name) {
  21067. webidl.brandCheck(this, FormData)
  21068. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.delete' })
  21069. name = webidl.converters.USVString(name)
  21070. // The delete(name) method steps are to remove all entries whose name
  21071. // is name from this’s entry list.
  21072. this[kState] = this[kState].filter(entry => entry.name !== name)
  21073. }
  21074. get (name) {
  21075. webidl.brandCheck(this, FormData)
  21076. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.get' })
  21077. name = webidl.converters.USVString(name)
  21078. // 1. If there is no entry whose name is name in this’s entry list,
  21079. // then return null.
  21080. const idx = this[kState].findIndex((entry) => entry.name === name)
  21081. if (idx === -1) {
  21082. return null
  21083. }
  21084. // 2. Return the value of the first entry whose name is name from
  21085. // this’s entry list.
  21086. return this[kState][idx].value
  21087. }
  21088. getAll (name) {
  21089. webidl.brandCheck(this, FormData)
  21090. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.getAll' })
  21091. name = webidl.converters.USVString(name)
  21092. // 1. If there is no entry whose name is name in this’s entry list,
  21093. // then return the empty list.
  21094. // 2. Return the values of all entries whose name is name, in order,
  21095. // from this’s entry list.
  21096. return this[kState]
  21097. .filter((entry) => entry.name === name)
  21098. .map((entry) => entry.value)
  21099. }
  21100. has (name) {
  21101. webidl.brandCheck(this, FormData)
  21102. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.has' })
  21103. name = webidl.converters.USVString(name)
  21104. // The has(name) method steps are to return true if there is an entry
  21105. // whose name is name in this’s entry list; otherwise false.
  21106. return this[kState].findIndex((entry) => entry.name === name) !== -1
  21107. }
  21108. set (name, value, filename = undefined) {
  21109. webidl.brandCheck(this, FormData)
  21110. webidl.argumentLengthCheck(arguments, 2, { header: 'FormData.set' })
  21111. if (arguments.length === 3 && !isBlobLike(value)) {
  21112. throw new TypeError(
  21113. "Failed to execute 'set' on 'FormData': parameter 2 is not of type 'Blob'"
  21114. )
  21115. }
  21116. // The set(name, value) and set(name, blobValue, filename) method steps
  21117. // are:
  21118. // 1. Let value be value if given; otherwise blobValue.
  21119. name = webidl.converters.USVString(name)
  21120. value = isBlobLike(value)
  21121. ? webidl.converters.Blob(value, { strict: false })
  21122. : webidl.converters.USVString(value)
  21123. filename = arguments.length === 3
  21124. ? toUSVString(filename)
  21125. : undefined
  21126. // 2. Let entry be the result of creating an entry with name, value, and
  21127. // filename if given.
  21128. const entry = makeEntry(name, value, filename)
  21129. // 3. If there are entries in this’s entry list whose name is name, then
  21130. // replace the first such entry with entry and remove the others.
  21131. const idx = this[kState].findIndex((entry) => entry.name === name)
  21132. if (idx !== -1) {
  21133. this[kState] = [
  21134. ...this[kState].slice(0, idx),
  21135. entry,
  21136. ...this[kState].slice(idx + 1).filter((entry) => entry.name !== name)
  21137. ]
  21138. } else {
  21139. // 4. Otherwise, append entry to this’s entry list.
  21140. this[kState].push(entry)
  21141. }
  21142. }
  21143. entries () {
  21144. webidl.brandCheck(this, FormData)
  21145. return makeIterator(
  21146. () => this[kState].map(pair => [pair.name, pair.value]),
  21147. 'FormData',
  21148. 'key+value'
  21149. )
  21150. }
  21151. keys () {
  21152. webidl.brandCheck(this, FormData)
  21153. return makeIterator(
  21154. () => this[kState].map(pair => [pair.name, pair.value]),
  21155. 'FormData',
  21156. 'key'
  21157. )
  21158. }
  21159. values () {
  21160. webidl.brandCheck(this, FormData)
  21161. return makeIterator(
  21162. () => this[kState].map(pair => [pair.name, pair.value]),
  21163. 'FormData',
  21164. 'value'
  21165. )
  21166. }
  21167. /**
  21168. * @param {(value: string, key: string, self: FormData) => void} callbackFn
  21169. * @param {unknown} thisArg
  21170. */
  21171. forEach (callbackFn, thisArg = globalThis) {
  21172. webidl.brandCheck(this, FormData)
  21173. webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.forEach' })
  21174. if (typeof callbackFn !== 'function') {
  21175. throw new TypeError(
  21176. "Failed to execute 'forEach' on 'FormData': parameter 1 is not of type 'Function'."
  21177. )
  21178. }
  21179. for (const [key, value] of this) {
  21180. callbackFn.apply(thisArg, [value, key, this])
  21181. }
  21182. }
  21183. }
  21184. FormData.prototype[Symbol.iterator] = FormData.prototype.entries
  21185. Object.defineProperties(FormData.prototype, {
  21186. [Symbol.toStringTag]: {
  21187. value: 'FormData',
  21188. configurable: true
  21189. }
  21190. })
  21191. /**
  21192. * @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#create-an-entry
  21193. * @param {string} name
  21194. * @param {string|Blob} value
  21195. * @param {?string} filename
  21196. * @returns
  21197. */
  21198. function makeEntry (name, value, filename) {
  21199. // 1. Set name to the result of converting name into a scalar value string.
  21200. // "To convert a string into a scalar value string, replace any surrogates
  21201. // with U+FFFD."
  21202. // see: https://nodejs.org/dist/latest-v18.x/docs/api/buffer.html#buftostringencoding-start-end
  21203. name = Buffer.from(name).toString('utf8')
  21204. // 2. If value is a string, then set value to the result of converting
  21205. // value into a scalar value string.
  21206. if (typeof value === 'string') {
  21207. value = Buffer.from(value).toString('utf8')
  21208. } else {
  21209. // 3. Otherwise:
  21210. // 1. If value is not a File object, then set value to a new File object,
  21211. // representing the same bytes, whose name attribute value is "blob"
  21212. if (!isFileLike(value)) {
  21213. value = value instanceof Blob
  21214. ? new File([value], 'blob', { type: value.type })
  21215. : new FileLike(value, 'blob', { type: value.type })
  21216. }
  21217. // 2. If filename is given, then set value to a new File object,
  21218. // representing the same bytes, whose name attribute is filename.
  21219. if (filename !== undefined) {
  21220. /** @type {FilePropertyBag} */
  21221. const options = {
  21222. type: value.type,
  21223. lastModified: value.lastModified
  21224. }
  21225. value = (NativeFile && value instanceof NativeFile) || value instanceof UndiciFile
  21226. ? new File([value], filename, options)
  21227. : new FileLike(value, filename, options)
  21228. }
  21229. }
  21230. // 4. Return an entry whose name is name and whose value is value.
  21231. return { name, value }
  21232. }
  21233. module.exports = { FormData }
  21234. /***/ }),
  21235. /***/ 1246:
  21236. /***/ ((module) => {
  21237. "use strict";
  21238. // In case of breaking changes, increase the version
  21239. // number to avoid conflicts.
  21240. const globalOrigin = Symbol.for('undici.globalOrigin.1')
  21241. function getGlobalOrigin () {
  21242. return globalThis[globalOrigin]
  21243. }
  21244. function setGlobalOrigin (newOrigin) {
  21245. if (newOrigin === undefined) {
  21246. Object.defineProperty(globalThis, globalOrigin, {
  21247. value: undefined,
  21248. writable: true,
  21249. enumerable: false,
  21250. configurable: false
  21251. })
  21252. return
  21253. }
  21254. const parsedURL = new URL(newOrigin)
  21255. if (parsedURL.protocol !== 'http:' && parsedURL.protocol !== 'https:') {
  21256. throw new TypeError(`Only http & https urls are allowed, received ${parsedURL.protocol}`)
  21257. }
  21258. Object.defineProperty(globalThis, globalOrigin, {
  21259. value: parsedURL,
  21260. writable: true,
  21261. enumerable: false,
  21262. configurable: false
  21263. })
  21264. }
  21265. module.exports = {
  21266. getGlobalOrigin,
  21267. setGlobalOrigin
  21268. }
  21269. /***/ }),
  21270. /***/ 554:
  21271. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  21272. "use strict";
  21273. // https://github.com/Ethan-Arrowood/undici-fetch
  21274. const { kHeadersList, kConstruct } = __nccwpck_require__(2785)
  21275. const { kGuard } = __nccwpck_require__(5861)
  21276. const { kEnumerableProperty } = __nccwpck_require__(3983)
  21277. const {
  21278. makeIterator,
  21279. isValidHeaderName,
  21280. isValidHeaderValue
  21281. } = __nccwpck_require__(2538)
  21282. const util = __nccwpck_require__(3837)
  21283. const { webidl } = __nccwpck_require__(1744)
  21284. const assert = __nccwpck_require__(9491)
  21285. const kHeadersMap = Symbol('headers map')
  21286. const kHeadersSortedMap = Symbol('headers map sorted')
  21287. /**
  21288. * @param {number} code
  21289. */
  21290. function isHTTPWhiteSpaceCharCode (code) {
  21291. return code === 0x00a || code === 0x00d || code === 0x009 || code === 0x020
  21292. }
  21293. /**
  21294. * @see https://fetch.spec.whatwg.org/#concept-header-value-normalize
  21295. * @param {string} potentialValue
  21296. */
  21297. function headerValueNormalize (potentialValue) {
  21298. // To normalize a byte sequence potentialValue, remove
  21299. // any leading and trailing HTTP whitespace bytes from
  21300. // potentialValue.
  21301. let i = 0; let j = potentialValue.length
  21302. while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(j - 1))) --j
  21303. while (j > i && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(i))) ++i
  21304. return i === 0 && j === potentialValue.length ? potentialValue : potentialValue.substring(i, j)
  21305. }
  21306. function fill (headers, object) {
  21307. // To fill a Headers object headers with a given object object, run these steps:
  21308. // 1. If object is a sequence, then for each header in object:
  21309. // Note: webidl conversion to array has already been done.
  21310. if (Array.isArray(object)) {
  21311. for (let i = 0; i < object.length; ++i) {
  21312. const header = object[i]
  21313. // 1. If header does not contain exactly two items, then throw a TypeError.
  21314. if (header.length !== 2) {
  21315. throw webidl.errors.exception({
  21316. header: 'Headers constructor',
  21317. message: `expected name/value pair to be length 2, found ${header.length}.`
  21318. })
  21319. }
  21320. // 2. Append (header’s first item, header’s second item) to headers.
  21321. appendHeader(headers, header[0], header[1])
  21322. }
  21323. } else if (typeof object === 'object' && object !== null) {
  21324. // Note: null should throw
  21325. // 2. Otherwise, object is a record, then for each key → value in object,
  21326. // append (key, value) to headers
  21327. const keys = Object.keys(object)
  21328. for (let i = 0; i < keys.length; ++i) {
  21329. appendHeader(headers, keys[i], object[keys[i]])
  21330. }
  21331. } else {
  21332. throw webidl.errors.conversionFailed({
  21333. prefix: 'Headers constructor',
  21334. argument: 'Argument 1',
  21335. types: ['sequence<sequence<ByteString>>', 'record<ByteString, ByteString>']
  21336. })
  21337. }
  21338. }
  21339. /**
  21340. * @see https://fetch.spec.whatwg.org/#concept-headers-append
  21341. */
  21342. function appendHeader (headers, name, value) {
  21343. // 1. Normalize value.
  21344. value = headerValueNormalize(value)
  21345. // 2. If name is not a header name or value is not a
  21346. // header value, then throw a TypeError.
  21347. if (!isValidHeaderName(name)) {
  21348. throw webidl.errors.invalidArgument({
  21349. prefix: 'Headers.append',
  21350. value: name,
  21351. type: 'header name'
  21352. })
  21353. } else if (!isValidHeaderValue(value)) {
  21354. throw webidl.errors.invalidArgument({
  21355. prefix: 'Headers.append',
  21356. value,
  21357. type: 'header value'
  21358. })
  21359. }
  21360. // 3. If headers’s guard is "immutable", then throw a TypeError.
  21361. // 4. Otherwise, if headers’s guard is "request" and name is a
  21362. // forbidden header name, return.
  21363. // Note: undici does not implement forbidden header names
  21364. if (headers[kGuard] === 'immutable') {
  21365. throw new TypeError('immutable')
  21366. } else if (headers[kGuard] === 'request-no-cors') {
  21367. // 5. Otherwise, if headers’s guard is "request-no-cors":
  21368. // TODO
  21369. }
  21370. // 6. Otherwise, if headers’s guard is "response" and name is a
  21371. // forbidden response-header name, return.
  21372. // 7. Append (name, value) to headers’s header list.
  21373. return headers[kHeadersList].append(name, value)
  21374. // 8. If headers’s guard is "request-no-cors", then remove
  21375. // privileged no-CORS request headers from headers
  21376. }
  21377. class HeadersList {
  21378. /** @type {[string, string][]|null} */
  21379. cookies = null
  21380. constructor (init) {
  21381. if (init instanceof HeadersList) {
  21382. this[kHeadersMap] = new Map(init[kHeadersMap])
  21383. this[kHeadersSortedMap] = init[kHeadersSortedMap]
  21384. this.cookies = init.cookies === null ? null : [...init.cookies]
  21385. } else {
  21386. this[kHeadersMap] = new Map(init)
  21387. this[kHeadersSortedMap] = null
  21388. }
  21389. }
  21390. // https://fetch.spec.whatwg.org/#header-list-contains
  21391. contains (name) {
  21392. // A header list list contains a header name name if list
  21393. // contains a header whose name is a byte-case-insensitive
  21394. // match for name.
  21395. name = name.toLowerCase()
  21396. return this[kHeadersMap].has(name)
  21397. }
  21398. clear () {
  21399. this[kHeadersMap].clear()
  21400. this[kHeadersSortedMap] = null
  21401. this.cookies = null
  21402. }
  21403. // https://fetch.spec.whatwg.org/#concept-header-list-append
  21404. append (name, value) {
  21405. this[kHeadersSortedMap] = null
  21406. // 1. If list contains name, then set name to the first such
  21407. // header’s name.
  21408. const lowercaseName = name.toLowerCase()
  21409. const exists = this[kHeadersMap].get(lowercaseName)
  21410. // 2. Append (name, value) to list.
  21411. if (exists) {
  21412. const delimiter = lowercaseName === 'cookie' ? '; ' : ', '
  21413. this[kHeadersMap].set(lowercaseName, {
  21414. name: exists.name,
  21415. value: `${exists.value}${delimiter}${value}`
  21416. })
  21417. } else {
  21418. this[kHeadersMap].set(lowercaseName, { name, value })
  21419. }
  21420. if (lowercaseName === 'set-cookie') {
  21421. this.cookies ??= []
  21422. this.cookies.push(value)
  21423. }
  21424. }
  21425. // https://fetch.spec.whatwg.org/#concept-header-list-set
  21426. set (name, value) {
  21427. this[kHeadersSortedMap] = null
  21428. const lowercaseName = name.toLowerCase()
  21429. if (lowercaseName === 'set-cookie') {
  21430. this.cookies = [value]
  21431. }
  21432. // 1. If list contains name, then set the value of
  21433. // the first such header to value and remove the
  21434. // others.
  21435. // 2. Otherwise, append header (name, value) to list.
  21436. this[kHeadersMap].set(lowercaseName, { name, value })
  21437. }
  21438. // https://fetch.spec.whatwg.org/#concept-header-list-delete
  21439. delete (name) {
  21440. this[kHeadersSortedMap] = null
  21441. name = name.toLowerCase()
  21442. if (name === 'set-cookie') {
  21443. this.cookies = null
  21444. }
  21445. this[kHeadersMap].delete(name)
  21446. }
  21447. // https://fetch.spec.whatwg.org/#concept-header-list-get
  21448. get (name) {
  21449. const value = this[kHeadersMap].get(name.toLowerCase())
  21450. // 1. If list does not contain name, then return null.
  21451. // 2. Return the values of all headers in list whose name
  21452. // is a byte-case-insensitive match for name,
  21453. // separated from each other by 0x2C 0x20, in order.
  21454. return value === undefined ? null : value.value
  21455. }
  21456. * [Symbol.iterator] () {
  21457. // use the lowercased name
  21458. for (const [name, { value }] of this[kHeadersMap]) {
  21459. yield [name, value]
  21460. }
  21461. }
  21462. get entries () {
  21463. const headers = {}
  21464. if (this[kHeadersMap].size) {
  21465. for (const { name, value } of this[kHeadersMap].values()) {
  21466. headers[name] = value
  21467. }
  21468. }
  21469. return headers
  21470. }
  21471. }
  21472. // https://fetch.spec.whatwg.org/#headers-class
  21473. class Headers {
  21474. constructor (init = undefined) {
  21475. if (init === kConstruct) {
  21476. return
  21477. }
  21478. this[kHeadersList] = new HeadersList()
  21479. // The new Headers(init) constructor steps are:
  21480. // 1. Set this’s guard to "none".
  21481. this[kGuard] = 'none'
  21482. // 2. If init is given, then fill this with init.
  21483. if (init !== undefined) {
  21484. init = webidl.converters.HeadersInit(init)
  21485. fill(this, init)
  21486. }
  21487. }
  21488. // https://fetch.spec.whatwg.org/#dom-headers-append
  21489. append (name, value) {
  21490. webidl.brandCheck(this, Headers)
  21491. webidl.argumentLengthCheck(arguments, 2, { header: 'Headers.append' })
  21492. name = webidl.converters.ByteString(name)
  21493. value = webidl.converters.ByteString(value)
  21494. return appendHeader(this, name, value)
  21495. }
  21496. // https://fetch.spec.whatwg.org/#dom-headers-delete
  21497. delete (name) {
  21498. webidl.brandCheck(this, Headers)
  21499. webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.delete' })
  21500. name = webidl.converters.ByteString(name)
  21501. // 1. If name is not a header name, then throw a TypeError.
  21502. if (!isValidHeaderName(name)) {
  21503. throw webidl.errors.invalidArgument({
  21504. prefix: 'Headers.delete',
  21505. value: name,
  21506. type: 'header name'
  21507. })
  21508. }
  21509. // 2. If this’s guard is "immutable", then throw a TypeError.
  21510. // 3. Otherwise, if this’s guard is "request" and name is a
  21511. // forbidden header name, return.
  21512. // 4. Otherwise, if this’s guard is "request-no-cors", name
  21513. // is not a no-CORS-safelisted request-header name, and
  21514. // name is not a privileged no-CORS request-header name,
  21515. // return.
  21516. // 5. Otherwise, if this’s guard is "response" and name is
  21517. // a forbidden response-header name, return.
  21518. // Note: undici does not implement forbidden header names
  21519. if (this[kGuard] === 'immutable') {
  21520. throw new TypeError('immutable')
  21521. } else if (this[kGuard] === 'request-no-cors') {
  21522. // TODO
  21523. }
  21524. // 6. If this’s header list does not contain name, then
  21525. // return.
  21526. if (!this[kHeadersList].contains(name)) {
  21527. return
  21528. }
  21529. // 7. Delete name from this’s header list.
  21530. // 8. If this’s guard is "request-no-cors", then remove
  21531. // privileged no-CORS request headers from this.
  21532. this[kHeadersList].delete(name)
  21533. }
  21534. // https://fetch.spec.whatwg.org/#dom-headers-get
  21535. get (name) {
  21536. webidl.brandCheck(this, Headers)
  21537. webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.get' })
  21538. name = webidl.converters.ByteString(name)
  21539. // 1. If name is not a header name, then throw a TypeError.
  21540. if (!isValidHeaderName(name)) {
  21541. throw webidl.errors.invalidArgument({
  21542. prefix: 'Headers.get',
  21543. value: name,
  21544. type: 'header name'
  21545. })
  21546. }
  21547. // 2. Return the result of getting name from this’s header
  21548. // list.
  21549. return this[kHeadersList].get(name)
  21550. }
  21551. // https://fetch.spec.whatwg.org/#dom-headers-has
  21552. has (name) {
  21553. webidl.brandCheck(this, Headers)
  21554. webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.has' })
  21555. name = webidl.converters.ByteString(name)
  21556. // 1. If name is not a header name, then throw a TypeError.
  21557. if (!isValidHeaderName(name)) {
  21558. throw webidl.errors.invalidArgument({
  21559. prefix: 'Headers.has',
  21560. value: name,
  21561. type: 'header name'
  21562. })
  21563. }
  21564. // 2. Return true if this’s header list contains name;
  21565. // otherwise false.
  21566. return this[kHeadersList].contains(name)
  21567. }
  21568. // https://fetch.spec.whatwg.org/#dom-headers-set
  21569. set (name, value) {
  21570. webidl.brandCheck(this, Headers)
  21571. webidl.argumentLengthCheck(arguments, 2, { header: 'Headers.set' })
  21572. name = webidl.converters.ByteString(name)
  21573. value = webidl.converters.ByteString(value)
  21574. // 1. Normalize value.
  21575. value = headerValueNormalize(value)
  21576. // 2. If name is not a header name or value is not a
  21577. // header value, then throw a TypeError.
  21578. if (!isValidHeaderName(name)) {
  21579. throw webidl.errors.invalidArgument({
  21580. prefix: 'Headers.set',
  21581. value: name,
  21582. type: 'header name'
  21583. })
  21584. } else if (!isValidHeaderValue(value)) {
  21585. throw webidl.errors.invalidArgument({
  21586. prefix: 'Headers.set',
  21587. value,
  21588. type: 'header value'
  21589. })
  21590. }
  21591. // 3. If this’s guard is "immutable", then throw a TypeError.
  21592. // 4. Otherwise, if this’s guard is "request" and name is a
  21593. // forbidden header name, return.
  21594. // 5. Otherwise, if this’s guard is "request-no-cors" and
  21595. // name/value is not a no-CORS-safelisted request-header,
  21596. // return.
  21597. // 6. Otherwise, if this’s guard is "response" and name is a
  21598. // forbidden response-header name, return.
  21599. // Note: undici does not implement forbidden header names
  21600. if (this[kGuard] === 'immutable') {
  21601. throw new TypeError('immutable')
  21602. } else if (this[kGuard] === 'request-no-cors') {
  21603. // TODO
  21604. }
  21605. // 7. Set (name, value) in this’s header list.
  21606. // 8. If this’s guard is "request-no-cors", then remove
  21607. // privileged no-CORS request headers from this
  21608. this[kHeadersList].set(name, value)
  21609. }
  21610. // https://fetch.spec.whatwg.org/#dom-headers-getsetcookie
  21611. getSetCookie () {
  21612. webidl.brandCheck(this, Headers)
  21613. // 1. If this’s header list does not contain `Set-Cookie`, then return « ».
  21614. // 2. Return the values of all headers in this’s header list whose name is
  21615. // a byte-case-insensitive match for `Set-Cookie`, in order.
  21616. const list = this[kHeadersList].cookies
  21617. if (list) {
  21618. return [...list]
  21619. }
  21620. return []
  21621. }
  21622. // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine
  21623. get [kHeadersSortedMap] () {
  21624. if (this[kHeadersList][kHeadersSortedMap]) {
  21625. return this[kHeadersList][kHeadersSortedMap]
  21626. }
  21627. // 1. Let headers be an empty list of headers with the key being the name
  21628. // and value the value.
  21629. const headers = []
  21630. // 2. Let names be the result of convert header names to a sorted-lowercase
  21631. // set with all the names of the headers in list.
  21632. const names = [...this[kHeadersList]].sort((a, b) => a[0] < b[0] ? -1 : 1)
  21633. const cookies = this[kHeadersList].cookies
  21634. // 3. For each name of names:
  21635. for (let i = 0; i < names.length; ++i) {
  21636. const [name, value] = names[i]
  21637. // 1. If name is `set-cookie`, then:
  21638. if (name === 'set-cookie') {
  21639. // 1. Let values be a list of all values of headers in list whose name
  21640. // is a byte-case-insensitive match for name, in order.
  21641. // 2. For each value of values:
  21642. // 1. Append (name, value) to headers.
  21643. for (let j = 0; j < cookies.length; ++j) {
  21644. headers.push([name, cookies[j]])
  21645. }
  21646. } else {
  21647. // 2. Otherwise:
  21648. // 1. Let value be the result of getting name from list.
  21649. // 2. Assert: value is non-null.
  21650. assert(value !== null)
  21651. // 3. Append (name, value) to headers.
  21652. headers.push([name, value])
  21653. }
  21654. }
  21655. this[kHeadersList][kHeadersSortedMap] = headers
  21656. // 4. Return headers.
  21657. return headers
  21658. }
  21659. keys () {
  21660. webidl.brandCheck(this, Headers)
  21661. if (this[kGuard] === 'immutable') {
  21662. const value = this[kHeadersSortedMap]
  21663. return makeIterator(() => value, 'Headers',
  21664. 'key')
  21665. }
  21666. return makeIterator(
  21667. () => [...this[kHeadersSortedMap].values()],
  21668. 'Headers',
  21669. 'key'
  21670. )
  21671. }
  21672. values () {
  21673. webidl.brandCheck(this, Headers)
  21674. if (this[kGuard] === 'immutable') {
  21675. const value = this[kHeadersSortedMap]
  21676. return makeIterator(() => value, 'Headers',
  21677. 'value')
  21678. }
  21679. return makeIterator(
  21680. () => [...this[kHeadersSortedMap].values()],
  21681. 'Headers',
  21682. 'value'
  21683. )
  21684. }
  21685. entries () {
  21686. webidl.brandCheck(this, Headers)
  21687. if (this[kGuard] === 'immutable') {
  21688. const value = this[kHeadersSortedMap]
  21689. return makeIterator(() => value, 'Headers',
  21690. 'key+value')
  21691. }
  21692. return makeIterator(
  21693. () => [...this[kHeadersSortedMap].values()],
  21694. 'Headers',
  21695. 'key+value'
  21696. )
  21697. }
  21698. /**
  21699. * @param {(value: string, key: string, self: Headers) => void} callbackFn
  21700. * @param {unknown} thisArg
  21701. */
  21702. forEach (callbackFn, thisArg = globalThis) {
  21703. webidl.brandCheck(this, Headers)
  21704. webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.forEach' })
  21705. if (typeof callbackFn !== 'function') {
  21706. throw new TypeError(
  21707. "Failed to execute 'forEach' on 'Headers': parameter 1 is not of type 'Function'."
  21708. )
  21709. }
  21710. for (const [key, value] of this) {
  21711. callbackFn.apply(thisArg, [value, key, this])
  21712. }
  21713. }
  21714. [Symbol.for('nodejs.util.inspect.custom')] () {
  21715. webidl.brandCheck(this, Headers)
  21716. return this[kHeadersList]
  21717. }
  21718. }
  21719. Headers.prototype[Symbol.iterator] = Headers.prototype.entries
  21720. Object.defineProperties(Headers.prototype, {
  21721. append: kEnumerableProperty,
  21722. delete: kEnumerableProperty,
  21723. get: kEnumerableProperty,
  21724. has: kEnumerableProperty,
  21725. set: kEnumerableProperty,
  21726. getSetCookie: kEnumerableProperty,
  21727. keys: kEnumerableProperty,
  21728. values: kEnumerableProperty,
  21729. entries: kEnumerableProperty,
  21730. forEach: kEnumerableProperty,
  21731. [Symbol.iterator]: { enumerable: false },
  21732. [Symbol.toStringTag]: {
  21733. value: 'Headers',
  21734. configurable: true
  21735. },
  21736. [util.inspect.custom]: {
  21737. enumerable: false
  21738. }
  21739. })
  21740. webidl.converters.HeadersInit = function (V) {
  21741. if (webidl.util.Type(V) === 'Object') {
  21742. if (V[Symbol.iterator]) {
  21743. return webidl.converters['sequence<sequence<ByteString>>'](V)
  21744. }
  21745. return webidl.converters['record<ByteString, ByteString>'](V)
  21746. }
  21747. throw webidl.errors.conversionFailed({
  21748. prefix: 'Headers constructor',
  21749. argument: 'Argument 1',
  21750. types: ['sequence<sequence<ByteString>>', 'record<ByteString, ByteString>']
  21751. })
  21752. }
  21753. module.exports = {
  21754. fill,
  21755. Headers,
  21756. HeadersList
  21757. }
  21758. /***/ }),
  21759. /***/ 4881:
  21760. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  21761. "use strict";
  21762. // https://github.com/Ethan-Arrowood/undici-fetch
  21763. const {
  21764. Response,
  21765. makeNetworkError,
  21766. makeAppropriateNetworkError,
  21767. filterResponse,
  21768. makeResponse
  21769. } = __nccwpck_require__(7823)
  21770. const { Headers } = __nccwpck_require__(554)
  21771. const { Request, makeRequest } = __nccwpck_require__(8359)
  21772. const zlib = __nccwpck_require__(9796)
  21773. const {
  21774. bytesMatch,
  21775. makePolicyContainer,
  21776. clonePolicyContainer,
  21777. requestBadPort,
  21778. TAOCheck,
  21779. appendRequestOriginHeader,
  21780. responseLocationURL,
  21781. requestCurrentURL,
  21782. setRequestReferrerPolicyOnRedirect,
  21783. tryUpgradeRequestToAPotentiallyTrustworthyURL,
  21784. createOpaqueTimingInfo,
  21785. appendFetchMetadata,
  21786. corsCheck,
  21787. crossOriginResourcePolicyCheck,
  21788. determineRequestsReferrer,
  21789. coarsenedSharedCurrentTime,
  21790. createDeferredPromise,
  21791. isBlobLike,
  21792. sameOrigin,
  21793. isCancelled,
  21794. isAborted,
  21795. isErrorLike,
  21796. fullyReadBody,
  21797. readableStreamClose,
  21798. isomorphicEncode,
  21799. urlIsLocal,
  21800. urlIsHttpHttpsScheme,
  21801. urlHasHttpsScheme
  21802. } = __nccwpck_require__(2538)
  21803. const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(5861)
  21804. const assert = __nccwpck_require__(9491)
  21805. const { safelyExtractBody } = __nccwpck_require__(9990)
  21806. const {
  21807. redirectStatusSet,
  21808. nullBodyStatus,
  21809. safeMethodsSet,
  21810. requestBodyHeader,
  21811. subresourceSet,
  21812. DOMException
  21813. } = __nccwpck_require__(1037)
  21814. const { kHeadersList } = __nccwpck_require__(2785)
  21815. const EE = __nccwpck_require__(2361)
  21816. const { Readable, pipeline } = __nccwpck_require__(2781)
  21817. const { addAbortListener, isErrored, isReadable, nodeMajor, nodeMinor } = __nccwpck_require__(3983)
  21818. const { dataURLProcessor, serializeAMimeType } = __nccwpck_require__(685)
  21819. const { TransformStream } = __nccwpck_require__(5356)
  21820. const { getGlobalDispatcher } = __nccwpck_require__(1892)
  21821. const { webidl } = __nccwpck_require__(1744)
  21822. const { STATUS_CODES } = __nccwpck_require__(3685)
  21823. const GET_OR_HEAD = ['GET', 'HEAD']
  21824. /** @type {import('buffer').resolveObjectURL} */
  21825. let resolveObjectURL
  21826. let ReadableStream = globalThis.ReadableStream
  21827. class Fetch extends EE {
  21828. constructor (dispatcher) {
  21829. super()
  21830. this.dispatcher = dispatcher
  21831. this.connection = null
  21832. this.dump = false
  21833. this.state = 'ongoing'
  21834. // 2 terminated listeners get added per request,
  21835. // but only 1 gets removed. If there are 20 redirects,
  21836. // 21 listeners will be added.
  21837. // See https://github.com/nodejs/undici/issues/1711
  21838. // TODO (fix): Find and fix root cause for leaked listener.
  21839. this.setMaxListeners(21)
  21840. }
  21841. terminate (reason) {
  21842. if (this.state !== 'ongoing') {
  21843. return
  21844. }
  21845. this.state = 'terminated'
  21846. this.connection?.destroy(reason)
  21847. this.emit('terminated', reason)
  21848. }
  21849. // https://fetch.spec.whatwg.org/#fetch-controller-abort
  21850. abort (error) {
  21851. if (this.state !== 'ongoing') {
  21852. return
  21853. }
  21854. // 1. Set controller’s state to "aborted".
  21855. this.state = 'aborted'
  21856. // 2. Let fallbackError be an "AbortError" DOMException.
  21857. // 3. Set error to fallbackError if it is not given.
  21858. if (!error) {
  21859. error = new DOMException('The operation was aborted.', 'AbortError')
  21860. }
  21861. // 4. Let serializedError be StructuredSerialize(error).
  21862. // If that threw an exception, catch it, and let
  21863. // serializedError be StructuredSerialize(fallbackError).
  21864. // 5. Set controller’s serialized abort reason to serializedError.
  21865. this.serializedAbortReason = error
  21866. this.connection?.destroy(error)
  21867. this.emit('terminated', error)
  21868. }
  21869. }
  21870. // https://fetch.spec.whatwg.org/#fetch-method
  21871. function fetch (input, init = {}) {
  21872. webidl.argumentLengthCheck(arguments, 1, { header: 'globalThis.fetch' })
  21873. // 1. Let p be a new promise.
  21874. const p = createDeferredPromise()
  21875. // 2. Let requestObject be the result of invoking the initial value of
  21876. // Request as constructor with input and init as arguments. If this throws
  21877. // an exception, reject p with it and return p.
  21878. let requestObject
  21879. try {
  21880. requestObject = new Request(input, init)
  21881. } catch (e) {
  21882. p.reject(e)
  21883. return p.promise
  21884. }
  21885. // 3. Let request be requestObject’s request.
  21886. const request = requestObject[kState]
  21887. // 4. If requestObject’s signal’s aborted flag is set, then:
  21888. if (requestObject.signal.aborted) {
  21889. // 1. Abort the fetch() call with p, request, null, and
  21890. // requestObject’s signal’s abort reason.
  21891. abortFetch(p, request, null, requestObject.signal.reason)
  21892. // 2. Return p.
  21893. return p.promise
  21894. }
  21895. // 5. Let globalObject be request’s client’s global object.
  21896. const globalObject = request.client.globalObject
  21897. // 6. If globalObject is a ServiceWorkerGlobalScope object, then set
  21898. // request’s service-workers mode to "none".
  21899. if (globalObject?.constructor?.name === 'ServiceWorkerGlobalScope') {
  21900. request.serviceWorkers = 'none'
  21901. }
  21902. // 7. Let responseObject be null.
  21903. let responseObject = null
  21904. // 8. Let relevantRealm be this’s relevant Realm.
  21905. const relevantRealm = null
  21906. // 9. Let locallyAborted be false.
  21907. let locallyAborted = false
  21908. // 10. Let controller be null.
  21909. let controller = null
  21910. // 11. Add the following abort steps to requestObject’s signal:
  21911. addAbortListener(
  21912. requestObject.signal,
  21913. () => {
  21914. // 1. Set locallyAborted to true.
  21915. locallyAborted = true
  21916. // 2. Assert: controller is non-null.
  21917. assert(controller != null)
  21918. // 3. Abort controller with requestObject’s signal’s abort reason.
  21919. controller.abort(requestObject.signal.reason)
  21920. // 4. Abort the fetch() call with p, request, responseObject,
  21921. // and requestObject’s signal’s abort reason.
  21922. abortFetch(p, request, responseObject, requestObject.signal.reason)
  21923. }
  21924. )
  21925. // 12. Let handleFetchDone given response response be to finalize and
  21926. // report timing with response, globalObject, and "fetch".
  21927. const handleFetchDone = (response) =>
  21928. finalizeAndReportTiming(response, 'fetch')
  21929. // 13. Set controller to the result of calling fetch given request,
  21930. // with processResponseEndOfBody set to handleFetchDone, and processResponse
  21931. // given response being these substeps:
  21932. const processResponse = (response) => {
  21933. // 1. If locallyAborted is true, terminate these substeps.
  21934. if (locallyAborted) {
  21935. return Promise.resolve()
  21936. }
  21937. // 2. If response’s aborted flag is set, then:
  21938. if (response.aborted) {
  21939. // 1. Let deserializedError be the result of deserialize a serialized
  21940. // abort reason given controller’s serialized abort reason and
  21941. // relevantRealm.
  21942. // 2. Abort the fetch() call with p, request, responseObject, and
  21943. // deserializedError.
  21944. abortFetch(p, request, responseObject, controller.serializedAbortReason)
  21945. return Promise.resolve()
  21946. }
  21947. // 3. If response is a network error, then reject p with a TypeError
  21948. // and terminate these substeps.
  21949. if (response.type === 'error') {
  21950. p.reject(
  21951. Object.assign(new TypeError('fetch failed'), { cause: response.error })
  21952. )
  21953. return Promise.resolve()
  21954. }
  21955. // 4. Set responseObject to the result of creating a Response object,
  21956. // given response, "immutable", and relevantRealm.
  21957. responseObject = new Response()
  21958. responseObject[kState] = response
  21959. responseObject[kRealm] = relevantRealm
  21960. responseObject[kHeaders][kHeadersList] = response.headersList
  21961. responseObject[kHeaders][kGuard] = 'immutable'
  21962. responseObject[kHeaders][kRealm] = relevantRealm
  21963. // 5. Resolve p with responseObject.
  21964. p.resolve(responseObject)
  21965. }
  21966. controller = fetching({
  21967. request,
  21968. processResponseEndOfBody: handleFetchDone,
  21969. processResponse,
  21970. dispatcher: init.dispatcher ?? getGlobalDispatcher() // undici
  21971. })
  21972. // 14. Return p.
  21973. return p.promise
  21974. }
  21975. // https://fetch.spec.whatwg.org/#finalize-and-report-timing
  21976. function finalizeAndReportTiming (response, initiatorType = 'other') {
  21977. // 1. If response is an aborted network error, then return.
  21978. if (response.type === 'error' && response.aborted) {
  21979. return
  21980. }
  21981. // 2. If response’s URL list is null or empty, then return.
  21982. if (!response.urlList?.length) {
  21983. return
  21984. }
  21985. // 3. Let originalURL be response’s URL list[0].
  21986. const originalURL = response.urlList[0]
  21987. // 4. Let timingInfo be response’s timing info.
  21988. let timingInfo = response.timingInfo
  21989. // 5. Let cacheState be response’s cache state.
  21990. let cacheState = response.cacheState
  21991. // 6. If originalURL’s scheme is not an HTTP(S) scheme, then return.
  21992. if (!urlIsHttpHttpsScheme(originalURL)) {
  21993. return
  21994. }
  21995. // 7. If timingInfo is null, then return.
  21996. if (timingInfo === null) {
  21997. return
  21998. }
  21999. // 8. If response’s timing allow passed flag is not set, then:
  22000. if (!response.timingAllowPassed) {
  22001. // 1. Set timingInfo to a the result of creating an opaque timing info for timingInfo.
  22002. timingInfo = createOpaqueTimingInfo({
  22003. startTime: timingInfo.startTime
  22004. })
  22005. // 2. Set cacheState to the empty string.
  22006. cacheState = ''
  22007. }
  22008. // 9. Set timingInfo’s end time to the coarsened shared current time
  22009. // given global’s relevant settings object’s cross-origin isolated
  22010. // capability.
  22011. // TODO: given global’s relevant settings object’s cross-origin isolated
  22012. // capability?
  22013. timingInfo.endTime = coarsenedSharedCurrentTime()
  22014. // 10. Set response’s timing info to timingInfo.
  22015. response.timingInfo = timingInfo
  22016. // 11. Mark resource timing for timingInfo, originalURL, initiatorType,
  22017. // global, and cacheState.
  22018. markResourceTiming(
  22019. timingInfo,
  22020. originalURL,
  22021. initiatorType,
  22022. globalThis,
  22023. cacheState
  22024. )
  22025. }
  22026. // https://w3c.github.io/resource-timing/#dfn-mark-resource-timing
  22027. function markResourceTiming (timingInfo, originalURL, initiatorType, globalThis, cacheState) {
  22028. if (nodeMajor > 18 || (nodeMajor === 18 && nodeMinor >= 2)) {
  22029. performance.markResourceTiming(timingInfo, originalURL.href, initiatorType, globalThis, cacheState)
  22030. }
  22031. }
  22032. // https://fetch.spec.whatwg.org/#abort-fetch
  22033. function abortFetch (p, request, responseObject, error) {
  22034. // Note: AbortSignal.reason was added in node v17.2.0
  22035. // which would give us an undefined error to reject with.
  22036. // Remove this once node v16 is no longer supported.
  22037. if (!error) {
  22038. error = new DOMException('The operation was aborted.', 'AbortError')
  22039. }
  22040. // 1. Reject promise with error.
  22041. p.reject(error)
  22042. // 2. If request’s body is not null and is readable, then cancel request’s
  22043. // body with error.
  22044. if (request.body != null && isReadable(request.body?.stream)) {
  22045. request.body.stream.cancel(error).catch((err) => {
  22046. if (err.code === 'ERR_INVALID_STATE') {
  22047. // Node bug?
  22048. return
  22049. }
  22050. throw err
  22051. })
  22052. }
  22053. // 3. If responseObject is null, then return.
  22054. if (responseObject == null) {
  22055. return
  22056. }
  22057. // 4. Let response be responseObject’s response.
  22058. const response = responseObject[kState]
  22059. // 5. If response’s body is not null and is readable, then error response’s
  22060. // body with error.
  22061. if (response.body != null && isReadable(response.body?.stream)) {
  22062. response.body.stream.cancel(error).catch((err) => {
  22063. if (err.code === 'ERR_INVALID_STATE') {
  22064. // Node bug?
  22065. return
  22066. }
  22067. throw err
  22068. })
  22069. }
  22070. }
  22071. // https://fetch.spec.whatwg.org/#fetching
  22072. function fetching ({
  22073. request,
  22074. processRequestBodyChunkLength,
  22075. processRequestEndOfBody,
  22076. processResponse,
  22077. processResponseEndOfBody,
  22078. processResponseConsumeBody,
  22079. useParallelQueue = false,
  22080. dispatcher // undici
  22081. }) {
  22082. // 1. Let taskDestination be null.
  22083. let taskDestination = null
  22084. // 2. Let crossOriginIsolatedCapability be false.
  22085. let crossOriginIsolatedCapability = false
  22086. // 3. If request’s client is non-null, then:
  22087. if (request.client != null) {
  22088. // 1. Set taskDestination to request’s client’s global object.
  22089. taskDestination = request.client.globalObject
  22090. // 2. Set crossOriginIsolatedCapability to request’s client’s cross-origin
  22091. // isolated capability.
  22092. crossOriginIsolatedCapability =
  22093. request.client.crossOriginIsolatedCapability
  22094. }
  22095. // 4. If useParallelQueue is true, then set taskDestination to the result of
  22096. // starting a new parallel queue.
  22097. // TODO
  22098. // 5. Let timingInfo be a new fetch timing info whose start time and
  22099. // post-redirect start time are the coarsened shared current time given
  22100. // crossOriginIsolatedCapability.
  22101. const currenTime = coarsenedSharedCurrentTime(crossOriginIsolatedCapability)
  22102. const timingInfo = createOpaqueTimingInfo({
  22103. startTime: currenTime
  22104. })
  22105. // 6. Let fetchParams be a new fetch params whose
  22106. // request is request,
  22107. // timing info is timingInfo,
  22108. // process request body chunk length is processRequestBodyChunkLength,
  22109. // process request end-of-body is processRequestEndOfBody,
  22110. // process response is processResponse,
  22111. // process response consume body is processResponseConsumeBody,
  22112. // process response end-of-body is processResponseEndOfBody,
  22113. // task destination is taskDestination,
  22114. // and cross-origin isolated capability is crossOriginIsolatedCapability.
  22115. const fetchParams = {
  22116. controller: new Fetch(dispatcher),
  22117. request,
  22118. timingInfo,
  22119. processRequestBodyChunkLength,
  22120. processRequestEndOfBody,
  22121. processResponse,
  22122. processResponseConsumeBody,
  22123. processResponseEndOfBody,
  22124. taskDestination,
  22125. crossOriginIsolatedCapability
  22126. }
  22127. // 7. If request’s body is a byte sequence, then set request’s body to
  22128. // request’s body as a body.
  22129. // NOTE: Since fetching is only called from fetch, body should already be
  22130. // extracted.
  22131. assert(!request.body || request.body.stream)
  22132. // 8. If request’s window is "client", then set request’s window to request’s
  22133. // client, if request’s client’s global object is a Window object; otherwise
  22134. // "no-window".
  22135. if (request.window === 'client') {
  22136. // TODO: What if request.client is null?
  22137. request.window =
  22138. request.client?.globalObject?.constructor?.name === 'Window'
  22139. ? request.client
  22140. : 'no-window'
  22141. }
  22142. // 9. If request’s origin is "client", then set request’s origin to request’s
  22143. // client’s origin.
  22144. if (request.origin === 'client') {
  22145. // TODO: What if request.client is null?
  22146. request.origin = request.client?.origin
  22147. }
  22148. // 10. If all of the following conditions are true:
  22149. // TODO
  22150. // 11. If request’s policy container is "client", then:
  22151. if (request.policyContainer === 'client') {
  22152. // 1. If request’s client is non-null, then set request’s policy
  22153. // container to a clone of request’s client’s policy container. [HTML]
  22154. if (request.client != null) {
  22155. request.policyContainer = clonePolicyContainer(
  22156. request.client.policyContainer
  22157. )
  22158. } else {
  22159. // 2. Otherwise, set request’s policy container to a new policy
  22160. // container.
  22161. request.policyContainer = makePolicyContainer()
  22162. }
  22163. }
  22164. // 12. If request’s header list does not contain `Accept`, then:
  22165. if (!request.headersList.contains('accept')) {
  22166. // 1. Let value be `*/*`.
  22167. const value = '*/*'
  22168. // 2. A user agent should set value to the first matching statement, if
  22169. // any, switching on request’s destination:
  22170. // "document"
  22171. // "frame"
  22172. // "iframe"
  22173. // `text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8`
  22174. // "image"
  22175. // `image/png,image/svg+xml,image/*;q=0.8,*/*;q=0.5`
  22176. // "style"
  22177. // `text/css,*/*;q=0.1`
  22178. // TODO
  22179. // 3. Append `Accept`/value to request’s header list.
  22180. request.headersList.append('accept', value)
  22181. }
  22182. // 13. If request’s header list does not contain `Accept-Language`, then
  22183. // user agents should append `Accept-Language`/an appropriate value to
  22184. // request’s header list.
  22185. if (!request.headersList.contains('accept-language')) {
  22186. request.headersList.append('accept-language', '*')
  22187. }
  22188. // 14. If request’s priority is null, then use request’s initiator and
  22189. // destination appropriately in setting request’s priority to a
  22190. // user-agent-defined object.
  22191. if (request.priority === null) {
  22192. // TODO
  22193. }
  22194. // 15. If request is a subresource request, then:
  22195. if (subresourceSet.has(request.destination)) {
  22196. // TODO
  22197. }
  22198. // 16. Run main fetch given fetchParams.
  22199. mainFetch(fetchParams)
  22200. .catch(err => {
  22201. fetchParams.controller.terminate(err)
  22202. })
  22203. // 17. Return fetchParam's controller
  22204. return fetchParams.controller
  22205. }
  22206. // https://fetch.spec.whatwg.org/#concept-main-fetch
  22207. async function mainFetch (fetchParams, recursive = false) {
  22208. // 1. Let request be fetchParams’s request.
  22209. const request = fetchParams.request
  22210. // 2. Let response be null.
  22211. let response = null
  22212. // 3. If request’s local-URLs-only flag is set and request’s current URL is
  22213. // not local, then set response to a network error.
  22214. if (request.localURLsOnly && !urlIsLocal(requestCurrentURL(request))) {
  22215. response = makeNetworkError('local URLs only')
  22216. }
  22217. // 4. Run report Content Security Policy violations for request.
  22218. // TODO
  22219. // 5. Upgrade request to a potentially trustworthy URL, if appropriate.
  22220. tryUpgradeRequestToAPotentiallyTrustworthyURL(request)
  22221. // 6. If should request be blocked due to a bad port, should fetching request
  22222. // be blocked as mixed content, or should request be blocked by Content
  22223. // Security Policy returns blocked, then set response to a network error.
  22224. if (requestBadPort(request) === 'blocked') {
  22225. response = makeNetworkError('bad port')
  22226. }
  22227. // TODO: should fetching request be blocked as mixed content?
  22228. // TODO: should request be blocked by Content Security Policy?
  22229. // 7. If request’s referrer policy is the empty string, then set request’s
  22230. // referrer policy to request’s policy container’s referrer policy.
  22231. if (request.referrerPolicy === '') {
  22232. request.referrerPolicy = request.policyContainer.referrerPolicy
  22233. }
  22234. // 8. If request’s referrer is not "no-referrer", then set request’s
  22235. // referrer to the result of invoking determine request’s referrer.
  22236. if (request.referrer !== 'no-referrer') {
  22237. request.referrer = determineRequestsReferrer(request)
  22238. }
  22239. // 9. Set request’s current URL’s scheme to "https" if all of the following
  22240. // conditions are true:
  22241. // - request’s current URL’s scheme is "http"
  22242. // - request’s current URL’s host is a domain
  22243. // - Matching request’s current URL’s host per Known HSTS Host Domain Name
  22244. // Matching results in either a superdomain match with an asserted
  22245. // includeSubDomains directive or a congruent match (with or without an
  22246. // asserted includeSubDomains directive). [HSTS]
  22247. // TODO
  22248. // 10. If recursive is false, then run the remaining steps in parallel.
  22249. // TODO
  22250. // 11. If response is null, then set response to the result of running
  22251. // the steps corresponding to the first matching statement:
  22252. if (response === null) {
  22253. response = await (async () => {
  22254. const currentURL = requestCurrentURL(request)
  22255. if (
  22256. // - request’s current URL’s origin is same origin with request’s origin,
  22257. // and request’s response tainting is "basic"
  22258. (sameOrigin(currentURL, request.url) && request.responseTainting === 'basic') ||
  22259. // request’s current URL’s scheme is "data"
  22260. (currentURL.protocol === 'data:') ||
  22261. // - request’s mode is "navigate" or "websocket"
  22262. (request.mode === 'navigate' || request.mode === 'websocket')
  22263. ) {
  22264. // 1. Set request’s response tainting to "basic".
  22265. request.responseTainting = 'basic'
  22266. // 2. Return the result of running scheme fetch given fetchParams.
  22267. return await schemeFetch(fetchParams)
  22268. }
  22269. // request’s mode is "same-origin"
  22270. if (request.mode === 'same-origin') {
  22271. // 1. Return a network error.
  22272. return makeNetworkError('request mode cannot be "same-origin"')
  22273. }
  22274. // request’s mode is "no-cors"
  22275. if (request.mode === 'no-cors') {
  22276. // 1. If request’s redirect mode is not "follow", then return a network
  22277. // error.
  22278. if (request.redirect !== 'follow') {
  22279. return makeNetworkError(
  22280. 'redirect mode cannot be "follow" for "no-cors" request'
  22281. )
  22282. }
  22283. // 2. Set request’s response tainting to "opaque".
  22284. request.responseTainting = 'opaque'
  22285. // 3. Return the result of running scheme fetch given fetchParams.
  22286. return await schemeFetch(fetchParams)
  22287. }
  22288. // request’s current URL’s scheme is not an HTTP(S) scheme
  22289. if (!urlIsHttpHttpsScheme(requestCurrentURL(request))) {
  22290. // Return a network error.
  22291. return makeNetworkError('URL scheme must be a HTTP(S) scheme')
  22292. }
  22293. // - request’s use-CORS-preflight flag is set
  22294. // - request’s unsafe-request flag is set and either request’s method is
  22295. // not a CORS-safelisted method or CORS-unsafe request-header names with
  22296. // request’s header list is not empty
  22297. // 1. Set request’s response tainting to "cors".
  22298. // 2. Let corsWithPreflightResponse be the result of running HTTP fetch
  22299. // given fetchParams and true.
  22300. // 3. If corsWithPreflightResponse is a network error, then clear cache
  22301. // entries using request.
  22302. // 4. Return corsWithPreflightResponse.
  22303. // TODO
  22304. // Otherwise
  22305. // 1. Set request’s response tainting to "cors".
  22306. request.responseTainting = 'cors'
  22307. // 2. Return the result of running HTTP fetch given fetchParams.
  22308. return await httpFetch(fetchParams)
  22309. })()
  22310. }
  22311. // 12. If recursive is true, then return response.
  22312. if (recursive) {
  22313. return response
  22314. }
  22315. // 13. If response is not a network error and response is not a filtered
  22316. // response, then:
  22317. if (response.status !== 0 && !response.internalResponse) {
  22318. // If request’s response tainting is "cors", then:
  22319. if (request.responseTainting === 'cors') {
  22320. // 1. Let headerNames be the result of extracting header list values
  22321. // given `Access-Control-Expose-Headers` and response’s header list.
  22322. // TODO
  22323. // 2. If request’s credentials mode is not "include" and headerNames
  22324. // contains `*`, then set response’s CORS-exposed header-name list to
  22325. // all unique header names in response’s header list.
  22326. // TODO
  22327. // 3. Otherwise, if headerNames is not null or failure, then set
  22328. // response’s CORS-exposed header-name list to headerNames.
  22329. // TODO
  22330. }
  22331. // Set response to the following filtered response with response as its
  22332. // internal response, depending on request’s response tainting:
  22333. if (request.responseTainting === 'basic') {
  22334. response = filterResponse(response, 'basic')
  22335. } else if (request.responseTainting === 'cors') {
  22336. response = filterResponse(response, 'cors')
  22337. } else if (request.responseTainting === 'opaque') {
  22338. response = filterResponse(response, 'opaque')
  22339. } else {
  22340. assert(false)
  22341. }
  22342. }
  22343. // 14. Let internalResponse be response, if response is a network error,
  22344. // and response’s internal response otherwise.
  22345. let internalResponse =
  22346. response.status === 0 ? response : response.internalResponse
  22347. // 15. If internalResponse’s URL list is empty, then set it to a clone of
  22348. // request’s URL list.
  22349. if (internalResponse.urlList.length === 0) {
  22350. internalResponse.urlList.push(...request.urlList)
  22351. }
  22352. // 16. If request’s timing allow failed flag is unset, then set
  22353. // internalResponse’s timing allow passed flag.
  22354. if (!request.timingAllowFailed) {
  22355. response.timingAllowPassed = true
  22356. }
  22357. // 17. If response is not a network error and any of the following returns
  22358. // blocked
  22359. // - should internalResponse to request be blocked as mixed content
  22360. // - should internalResponse to request be blocked by Content Security Policy
  22361. // - should internalResponse to request be blocked due to its MIME type
  22362. // - should internalResponse to request be blocked due to nosniff
  22363. // TODO
  22364. // 18. If response’s type is "opaque", internalResponse’s status is 206,
  22365. // internalResponse’s range-requested flag is set, and request’s header
  22366. // list does not contain `Range`, then set response and internalResponse
  22367. // to a network error.
  22368. if (
  22369. response.type === 'opaque' &&
  22370. internalResponse.status === 206 &&
  22371. internalResponse.rangeRequested &&
  22372. !request.headers.contains('range')
  22373. ) {
  22374. response = internalResponse = makeNetworkError()
  22375. }
  22376. // 19. If response is not a network error and either request’s method is
  22377. // `HEAD` or `CONNECT`, or internalResponse’s status is a null body status,
  22378. // set internalResponse’s body to null and disregard any enqueuing toward
  22379. // it (if any).
  22380. if (
  22381. response.status !== 0 &&
  22382. (request.method === 'HEAD' ||
  22383. request.method === 'CONNECT' ||
  22384. nullBodyStatus.includes(internalResponse.status))
  22385. ) {
  22386. internalResponse.body = null
  22387. fetchParams.controller.dump = true
  22388. }
  22389. // 20. If request’s integrity metadata is not the empty string, then:
  22390. if (request.integrity) {
  22391. // 1. Let processBodyError be this step: run fetch finale given fetchParams
  22392. // and a network error.
  22393. const processBodyError = (reason) =>
  22394. fetchFinale(fetchParams, makeNetworkError(reason))
  22395. // 2. If request’s response tainting is "opaque", or response’s body is null,
  22396. // then run processBodyError and abort these steps.
  22397. if (request.responseTainting === 'opaque' || response.body == null) {
  22398. processBodyError(response.error)
  22399. return
  22400. }
  22401. // 3. Let processBody given bytes be these steps:
  22402. const processBody = (bytes) => {
  22403. // 1. If bytes do not match request’s integrity metadata,
  22404. // then run processBodyError and abort these steps. [SRI]
  22405. if (!bytesMatch(bytes, request.integrity)) {
  22406. processBodyError('integrity mismatch')
  22407. return
  22408. }
  22409. // 2. Set response’s body to bytes as a body.
  22410. response.body = safelyExtractBody(bytes)[0]
  22411. // 3. Run fetch finale given fetchParams and response.
  22412. fetchFinale(fetchParams, response)
  22413. }
  22414. // 4. Fully read response’s body given processBody and processBodyError.
  22415. await fullyReadBody(response.body, processBody, processBodyError)
  22416. } else {
  22417. // 21. Otherwise, run fetch finale given fetchParams and response.
  22418. fetchFinale(fetchParams, response)
  22419. }
  22420. }
  22421. // https://fetch.spec.whatwg.org/#concept-scheme-fetch
  22422. // given a fetch params fetchParams
  22423. function schemeFetch (fetchParams) {
  22424. // Note: since the connection is destroyed on redirect, which sets fetchParams to a
  22425. // cancelled state, we do not want this condition to trigger *unless* there have been
  22426. // no redirects. See https://github.com/nodejs/undici/issues/1776
  22427. // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams.
  22428. if (isCancelled(fetchParams) && fetchParams.request.redirectCount === 0) {
  22429. return Promise.resolve(makeAppropriateNetworkError(fetchParams))
  22430. }
  22431. // 2. Let request be fetchParams’s request.
  22432. const { request } = fetchParams
  22433. const { protocol: scheme } = requestCurrentURL(request)
  22434. // 3. Switch on request’s current URL’s scheme and run the associated steps:
  22435. switch (scheme) {
  22436. case 'about:': {
  22437. // If request’s current URL’s path is the string "blank", then return a new response
  22438. // whose status message is `OK`, header list is « (`Content-Type`, `text/html;charset=utf-8`) »,
  22439. // and body is the empty byte sequence as a body.
  22440. // Otherwise, return a network error.
  22441. return Promise.resolve(makeNetworkError('about scheme is not supported'))
  22442. }
  22443. case 'blob:': {
  22444. if (!resolveObjectURL) {
  22445. resolveObjectURL = (__nccwpck_require__(4300).resolveObjectURL)
  22446. }
  22447. // 1. Let blobURLEntry be request’s current URL’s blob URL entry.
  22448. const blobURLEntry = requestCurrentURL(request)
  22449. // https://github.com/web-platform-tests/wpt/blob/7b0ebaccc62b566a1965396e5be7bb2bc06f841f/FileAPI/url/resources/fetch-tests.js#L52-L56
  22450. // Buffer.resolveObjectURL does not ignore URL queries.
  22451. if (blobURLEntry.search.length !== 0) {
  22452. return Promise.resolve(makeNetworkError('NetworkError when attempting to fetch resource.'))
  22453. }
  22454. const blobURLEntryObject = resolveObjectURL(blobURLEntry.toString())
  22455. // 2. If request’s method is not `GET`, blobURLEntry is null, or blobURLEntry’s
  22456. // object is not a Blob object, then return a network error.
  22457. if (request.method !== 'GET' || !isBlobLike(blobURLEntryObject)) {
  22458. return Promise.resolve(makeNetworkError('invalid method'))
  22459. }
  22460. // 3. Let bodyWithType be the result of safely extracting blobURLEntry’s object.
  22461. const bodyWithType = safelyExtractBody(blobURLEntryObject)
  22462. // 4. Let body be bodyWithType’s body.
  22463. const body = bodyWithType[0]
  22464. // 5. Let length be body’s length, serialized and isomorphic encoded.
  22465. const length = isomorphicEncode(`${body.length}`)
  22466. // 6. Let type be bodyWithType’s type if it is non-null; otherwise the empty byte sequence.
  22467. const type = bodyWithType[1] ?? ''
  22468. // 7. Return a new response whose status message is `OK`, header list is
  22469. // « (`Content-Length`, length), (`Content-Type`, type) », and body is body.
  22470. const response = makeResponse({
  22471. statusText: 'OK',
  22472. headersList: [
  22473. ['content-length', { name: 'Content-Length', value: length }],
  22474. ['content-type', { name: 'Content-Type', value: type }]
  22475. ]
  22476. })
  22477. response.body = body
  22478. return Promise.resolve(response)
  22479. }
  22480. case 'data:': {
  22481. // 1. Let dataURLStruct be the result of running the
  22482. // data: URL processor on request’s current URL.
  22483. const currentURL = requestCurrentURL(request)
  22484. const dataURLStruct = dataURLProcessor(currentURL)
  22485. // 2. If dataURLStruct is failure, then return a
  22486. // network error.
  22487. if (dataURLStruct === 'failure') {
  22488. return Promise.resolve(makeNetworkError('failed to fetch the data URL'))
  22489. }
  22490. // 3. Let mimeType be dataURLStruct’s MIME type, serialized.
  22491. const mimeType = serializeAMimeType(dataURLStruct.mimeType)
  22492. // 4. Return a response whose status message is `OK`,
  22493. // header list is « (`Content-Type`, mimeType) »,
  22494. // and body is dataURLStruct’s body as a body.
  22495. return Promise.resolve(makeResponse({
  22496. statusText: 'OK',
  22497. headersList: [
  22498. ['content-type', { name: 'Content-Type', value: mimeType }]
  22499. ],
  22500. body: safelyExtractBody(dataURLStruct.body)[0]
  22501. }))
  22502. }
  22503. case 'file:': {
  22504. // For now, unfortunate as it is, file URLs are left as an exercise for the reader.
  22505. // When in doubt, return a network error.
  22506. return Promise.resolve(makeNetworkError('not implemented... yet...'))
  22507. }
  22508. case 'http:':
  22509. case 'https:': {
  22510. // Return the result of running HTTP fetch given fetchParams.
  22511. return httpFetch(fetchParams)
  22512. .catch((err) => makeNetworkError(err))
  22513. }
  22514. default: {
  22515. return Promise.resolve(makeNetworkError('unknown scheme'))
  22516. }
  22517. }
  22518. }
  22519. // https://fetch.spec.whatwg.org/#finalize-response
  22520. function finalizeResponse (fetchParams, response) {
  22521. // 1. Set fetchParams’s request’s done flag.
  22522. fetchParams.request.done = true
  22523. // 2, If fetchParams’s process response done is not null, then queue a fetch
  22524. // task to run fetchParams’s process response done given response, with
  22525. // fetchParams’s task destination.
  22526. if (fetchParams.processResponseDone != null) {
  22527. queueMicrotask(() => fetchParams.processResponseDone(response))
  22528. }
  22529. }
  22530. // https://fetch.spec.whatwg.org/#fetch-finale
  22531. function fetchFinale (fetchParams, response) {
  22532. // 1. If response is a network error, then:
  22533. if (response.type === 'error') {
  22534. // 1. Set response’s URL list to « fetchParams’s request’s URL list[0] ».
  22535. response.urlList = [fetchParams.request.urlList[0]]
  22536. // 2. Set response’s timing info to the result of creating an opaque timing
  22537. // info for fetchParams’s timing info.
  22538. response.timingInfo = createOpaqueTimingInfo({
  22539. startTime: fetchParams.timingInfo.startTime
  22540. })
  22541. }
  22542. // 2. Let processResponseEndOfBody be the following steps:
  22543. const processResponseEndOfBody = () => {
  22544. // 1. Set fetchParams’s request’s done flag.
  22545. fetchParams.request.done = true
  22546. // If fetchParams’s process response end-of-body is not null,
  22547. // then queue a fetch task to run fetchParams’s process response
  22548. // end-of-body given response with fetchParams’s task destination.
  22549. if (fetchParams.processResponseEndOfBody != null) {
  22550. queueMicrotask(() => fetchParams.processResponseEndOfBody(response))
  22551. }
  22552. }
  22553. // 3. If fetchParams’s process response is non-null, then queue a fetch task
  22554. // to run fetchParams’s process response given response, with fetchParams’s
  22555. // task destination.
  22556. if (fetchParams.processResponse != null) {
  22557. queueMicrotask(() => fetchParams.processResponse(response))
  22558. }
  22559. // 4. If response’s body is null, then run processResponseEndOfBody.
  22560. if (response.body == null) {
  22561. processResponseEndOfBody()
  22562. } else {
  22563. // 5. Otherwise:
  22564. // 1. Let transformStream be a new a TransformStream.
  22565. // 2. Let identityTransformAlgorithm be an algorithm which, given chunk,
  22566. // enqueues chunk in transformStream.
  22567. const identityTransformAlgorithm = (chunk, controller) => {
  22568. controller.enqueue(chunk)
  22569. }
  22570. // 3. Set up transformStream with transformAlgorithm set to identityTransformAlgorithm
  22571. // and flushAlgorithm set to processResponseEndOfBody.
  22572. const transformStream = new TransformStream({
  22573. start () {},
  22574. transform: identityTransformAlgorithm,
  22575. flush: processResponseEndOfBody
  22576. }, {
  22577. size () {
  22578. return 1
  22579. }
  22580. }, {
  22581. size () {
  22582. return 1
  22583. }
  22584. })
  22585. // 4. Set response’s body to the result of piping response’s body through transformStream.
  22586. response.body = { stream: response.body.stream.pipeThrough(transformStream) }
  22587. }
  22588. // 6. If fetchParams’s process response consume body is non-null, then:
  22589. if (fetchParams.processResponseConsumeBody != null) {
  22590. // 1. Let processBody given nullOrBytes be this step: run fetchParams’s
  22591. // process response consume body given response and nullOrBytes.
  22592. const processBody = (nullOrBytes) => fetchParams.processResponseConsumeBody(response, nullOrBytes)
  22593. // 2. Let processBodyError be this step: run fetchParams’s process
  22594. // response consume body given response and failure.
  22595. const processBodyError = (failure) => fetchParams.processResponseConsumeBody(response, failure)
  22596. // 3. If response’s body is null, then queue a fetch task to run processBody
  22597. // given null, with fetchParams’s task destination.
  22598. if (response.body == null) {
  22599. queueMicrotask(() => processBody(null))
  22600. } else {
  22601. // 4. Otherwise, fully read response’s body given processBody, processBodyError,
  22602. // and fetchParams’s task destination.
  22603. return fullyReadBody(response.body, processBody, processBodyError)
  22604. }
  22605. return Promise.resolve()
  22606. }
  22607. }
  22608. // https://fetch.spec.whatwg.org/#http-fetch
  22609. async function httpFetch (fetchParams) {
  22610. // 1. Let request be fetchParams’s request.
  22611. const request = fetchParams.request
  22612. // 2. Let response be null.
  22613. let response = null
  22614. // 3. Let actualResponse be null.
  22615. let actualResponse = null
  22616. // 4. Let timingInfo be fetchParams’s timing info.
  22617. const timingInfo = fetchParams.timingInfo
  22618. // 5. If request’s service-workers mode is "all", then:
  22619. if (request.serviceWorkers === 'all') {
  22620. // TODO
  22621. }
  22622. // 6. If response is null, then:
  22623. if (response === null) {
  22624. // 1. If makeCORSPreflight is true and one of these conditions is true:
  22625. // TODO
  22626. // 2. If request’s redirect mode is "follow", then set request’s
  22627. // service-workers mode to "none".
  22628. if (request.redirect === 'follow') {
  22629. request.serviceWorkers = 'none'
  22630. }
  22631. // 3. Set response and actualResponse to the result of running
  22632. // HTTP-network-or-cache fetch given fetchParams.
  22633. actualResponse = response = await httpNetworkOrCacheFetch(fetchParams)
  22634. // 4. If request’s response tainting is "cors" and a CORS check
  22635. // for request and response returns failure, then return a network error.
  22636. if (
  22637. request.responseTainting === 'cors' &&
  22638. corsCheck(request, response) === 'failure'
  22639. ) {
  22640. return makeNetworkError('cors failure')
  22641. }
  22642. // 5. If the TAO check for request and response returns failure, then set
  22643. // request’s timing allow failed flag.
  22644. if (TAOCheck(request, response) === 'failure') {
  22645. request.timingAllowFailed = true
  22646. }
  22647. }
  22648. // 7. If either request’s response tainting or response’s type
  22649. // is "opaque", and the cross-origin resource policy check with
  22650. // request’s origin, request’s client, request’s destination,
  22651. // and actualResponse returns blocked, then return a network error.
  22652. if (
  22653. (request.responseTainting === 'opaque' || response.type === 'opaque') &&
  22654. crossOriginResourcePolicyCheck(
  22655. request.origin,
  22656. request.client,
  22657. request.destination,
  22658. actualResponse
  22659. ) === 'blocked'
  22660. ) {
  22661. return makeNetworkError('blocked')
  22662. }
  22663. // 8. If actualResponse’s status is a redirect status, then:
  22664. if (redirectStatusSet.has(actualResponse.status)) {
  22665. // 1. If actualResponse’s status is not 303, request’s body is not null,
  22666. // and the connection uses HTTP/2, then user agents may, and are even
  22667. // encouraged to, transmit an RST_STREAM frame.
  22668. // See, https://github.com/whatwg/fetch/issues/1288
  22669. if (request.redirect !== 'manual') {
  22670. fetchParams.controller.connection.destroy()
  22671. }
  22672. // 2. Switch on request’s redirect mode:
  22673. if (request.redirect === 'error') {
  22674. // Set response to a network error.
  22675. response = makeNetworkError('unexpected redirect')
  22676. } else if (request.redirect === 'manual') {
  22677. // Set response to an opaque-redirect filtered response whose internal
  22678. // response is actualResponse.
  22679. // NOTE(spec): On the web this would return an `opaqueredirect` response,
  22680. // but that doesn't make sense server side.
  22681. // See https://github.com/nodejs/undici/issues/1193.
  22682. response = actualResponse
  22683. } else if (request.redirect === 'follow') {
  22684. // Set response to the result of running HTTP-redirect fetch given
  22685. // fetchParams and response.
  22686. response = await httpRedirectFetch(fetchParams, response)
  22687. } else {
  22688. assert(false)
  22689. }
  22690. }
  22691. // 9. Set response’s timing info to timingInfo.
  22692. response.timingInfo = timingInfo
  22693. // 10. Return response.
  22694. return response
  22695. }
  22696. // https://fetch.spec.whatwg.org/#http-redirect-fetch
  22697. function httpRedirectFetch (fetchParams, response) {
  22698. // 1. Let request be fetchParams’s request.
  22699. const request = fetchParams.request
  22700. // 2. Let actualResponse be response, if response is not a filtered response,
  22701. // and response’s internal response otherwise.
  22702. const actualResponse = response.internalResponse
  22703. ? response.internalResponse
  22704. : response
  22705. // 3. Let locationURL be actualResponse’s location URL given request’s current
  22706. // URL’s fragment.
  22707. let locationURL
  22708. try {
  22709. locationURL = responseLocationURL(
  22710. actualResponse,
  22711. requestCurrentURL(request).hash
  22712. )
  22713. // 4. If locationURL is null, then return response.
  22714. if (locationURL == null) {
  22715. return response
  22716. }
  22717. } catch (err) {
  22718. // 5. If locationURL is failure, then return a network error.
  22719. return Promise.resolve(makeNetworkError(err))
  22720. }
  22721. // 6. If locationURL’s scheme is not an HTTP(S) scheme, then return a network
  22722. // error.
  22723. if (!urlIsHttpHttpsScheme(locationURL)) {
  22724. return Promise.resolve(makeNetworkError('URL scheme must be a HTTP(S) scheme'))
  22725. }
  22726. // 7. If request’s redirect count is 20, then return a network error.
  22727. if (request.redirectCount === 20) {
  22728. return Promise.resolve(makeNetworkError('redirect count exceeded'))
  22729. }
  22730. // 8. Increase request’s redirect count by 1.
  22731. request.redirectCount += 1
  22732. // 9. If request’s mode is "cors", locationURL includes credentials, and
  22733. // request’s origin is not same origin with locationURL’s origin, then return
  22734. // a network error.
  22735. if (
  22736. request.mode === 'cors' &&
  22737. (locationURL.username || locationURL.password) &&
  22738. !sameOrigin(request, locationURL)
  22739. ) {
  22740. return Promise.resolve(makeNetworkError('cross origin not allowed for request mode "cors"'))
  22741. }
  22742. // 10. If request’s response tainting is "cors" and locationURL includes
  22743. // credentials, then return a network error.
  22744. if (
  22745. request.responseTainting === 'cors' &&
  22746. (locationURL.username || locationURL.password)
  22747. ) {
  22748. return Promise.resolve(makeNetworkError(
  22749. 'URL cannot contain credentials for request mode "cors"'
  22750. ))
  22751. }
  22752. // 11. If actualResponse’s status is not 303, request’s body is non-null,
  22753. // and request’s body’s source is null, then return a network error.
  22754. if (
  22755. actualResponse.status !== 303 &&
  22756. request.body != null &&
  22757. request.body.source == null
  22758. ) {
  22759. return Promise.resolve(makeNetworkError())
  22760. }
  22761. // 12. If one of the following is true
  22762. // - actualResponse’s status is 301 or 302 and request’s method is `POST`
  22763. // - actualResponse’s status is 303 and request’s method is not `GET` or `HEAD`
  22764. if (
  22765. ([301, 302].includes(actualResponse.status) && request.method === 'POST') ||
  22766. (actualResponse.status === 303 &&
  22767. !GET_OR_HEAD.includes(request.method))
  22768. ) {
  22769. // then:
  22770. // 1. Set request’s method to `GET` and request’s body to null.
  22771. request.method = 'GET'
  22772. request.body = null
  22773. // 2. For each headerName of request-body-header name, delete headerName from
  22774. // request’s header list.
  22775. for (const headerName of requestBodyHeader) {
  22776. request.headersList.delete(headerName)
  22777. }
  22778. }
  22779. // 13. If request’s current URL’s origin is not same origin with locationURL’s
  22780. // origin, then for each headerName of CORS non-wildcard request-header name,
  22781. // delete headerName from request’s header list.
  22782. if (!sameOrigin(requestCurrentURL(request), locationURL)) {
  22783. // https://fetch.spec.whatwg.org/#cors-non-wildcard-request-header-name
  22784. request.headersList.delete('authorization')
  22785. // https://fetch.spec.whatwg.org/#authentication-entries
  22786. request.headersList.delete('proxy-authorization', true)
  22787. // "Cookie" and "Host" are forbidden request-headers, which undici doesn't implement.
  22788. request.headersList.delete('cookie')
  22789. request.headersList.delete('host')
  22790. }
  22791. // 14. If request’s body is non-null, then set request’s body to the first return
  22792. // value of safely extracting request’s body’s source.
  22793. if (request.body != null) {
  22794. assert(request.body.source != null)
  22795. request.body = safelyExtractBody(request.body.source)[0]
  22796. }
  22797. // 15. Let timingInfo be fetchParams’s timing info.
  22798. const timingInfo = fetchParams.timingInfo
  22799. // 16. Set timingInfo’s redirect end time and post-redirect start time to the
  22800. // coarsened shared current time given fetchParams’s cross-origin isolated
  22801. // capability.
  22802. timingInfo.redirectEndTime = timingInfo.postRedirectStartTime =
  22803. coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability)
  22804. // 17. If timingInfo’s redirect start time is 0, then set timingInfo’s
  22805. // redirect start time to timingInfo’s start time.
  22806. if (timingInfo.redirectStartTime === 0) {
  22807. timingInfo.redirectStartTime = timingInfo.startTime
  22808. }
  22809. // 18. Append locationURL to request’s URL list.
  22810. request.urlList.push(locationURL)
  22811. // 19. Invoke set request’s referrer policy on redirect on request and
  22812. // actualResponse.
  22813. setRequestReferrerPolicyOnRedirect(request, actualResponse)
  22814. // 20. Return the result of running main fetch given fetchParams and true.
  22815. return mainFetch(fetchParams, true)
  22816. }
  22817. // https://fetch.spec.whatwg.org/#http-network-or-cache-fetch
  22818. async function httpNetworkOrCacheFetch (
  22819. fetchParams,
  22820. isAuthenticationFetch = false,
  22821. isNewConnectionFetch = false
  22822. ) {
  22823. // 1. Let request be fetchParams’s request.
  22824. const request = fetchParams.request
  22825. // 2. Let httpFetchParams be null.
  22826. let httpFetchParams = null
  22827. // 3. Let httpRequest be null.
  22828. let httpRequest = null
  22829. // 4. Let response be null.
  22830. let response = null
  22831. // 5. Let storedResponse be null.
  22832. // TODO: cache
  22833. // 6. Let httpCache be null.
  22834. const httpCache = null
  22835. // 7. Let the revalidatingFlag be unset.
  22836. const revalidatingFlag = false
  22837. // 8. Run these steps, but abort when the ongoing fetch is terminated:
  22838. // 1. If request’s window is "no-window" and request’s redirect mode is
  22839. // "error", then set httpFetchParams to fetchParams and httpRequest to
  22840. // request.
  22841. if (request.window === 'no-window' && request.redirect === 'error') {
  22842. httpFetchParams = fetchParams
  22843. httpRequest = request
  22844. } else {
  22845. // Otherwise:
  22846. // 1. Set httpRequest to a clone of request.
  22847. httpRequest = makeRequest(request)
  22848. // 2. Set httpFetchParams to a copy of fetchParams.
  22849. httpFetchParams = { ...fetchParams }
  22850. // 3. Set httpFetchParams’s request to httpRequest.
  22851. httpFetchParams.request = httpRequest
  22852. }
  22853. // 3. Let includeCredentials be true if one of
  22854. const includeCredentials =
  22855. request.credentials === 'include' ||
  22856. (request.credentials === 'same-origin' &&
  22857. request.responseTainting === 'basic')
  22858. // 4. Let contentLength be httpRequest’s body’s length, if httpRequest’s
  22859. // body is non-null; otherwise null.
  22860. const contentLength = httpRequest.body ? httpRequest.body.length : null
  22861. // 5. Let contentLengthHeaderValue be null.
  22862. let contentLengthHeaderValue = null
  22863. // 6. If httpRequest’s body is null and httpRequest’s method is `POST` or
  22864. // `PUT`, then set contentLengthHeaderValue to `0`.
  22865. if (
  22866. httpRequest.body == null &&
  22867. ['POST', 'PUT'].includes(httpRequest.method)
  22868. ) {
  22869. contentLengthHeaderValue = '0'
  22870. }
  22871. // 7. If contentLength is non-null, then set contentLengthHeaderValue to
  22872. // contentLength, serialized and isomorphic encoded.
  22873. if (contentLength != null) {
  22874. contentLengthHeaderValue = isomorphicEncode(`${contentLength}`)
  22875. }
  22876. // 8. If contentLengthHeaderValue is non-null, then append
  22877. // `Content-Length`/contentLengthHeaderValue to httpRequest’s header
  22878. // list.
  22879. if (contentLengthHeaderValue != null) {
  22880. httpRequest.headersList.append('content-length', contentLengthHeaderValue)
  22881. }
  22882. // 9. If contentLengthHeaderValue is non-null, then append (`Content-Length`,
  22883. // contentLengthHeaderValue) to httpRequest’s header list.
  22884. // 10. If contentLength is non-null and httpRequest’s keepalive is true,
  22885. // then:
  22886. if (contentLength != null && httpRequest.keepalive) {
  22887. // NOTE: keepalive is a noop outside of browser context.
  22888. }
  22889. // 11. If httpRequest’s referrer is a URL, then append
  22890. // `Referer`/httpRequest’s referrer, serialized and isomorphic encoded,
  22891. // to httpRequest’s header list.
  22892. if (httpRequest.referrer instanceof URL) {
  22893. httpRequest.headersList.append('referer', isomorphicEncode(httpRequest.referrer.href))
  22894. }
  22895. // 12. Append a request `Origin` header for httpRequest.
  22896. appendRequestOriginHeader(httpRequest)
  22897. // 13. Append the Fetch metadata headers for httpRequest. [FETCH-METADATA]
  22898. appendFetchMetadata(httpRequest)
  22899. // 14. If httpRequest’s header list does not contain `User-Agent`, then
  22900. // user agents should append `User-Agent`/default `User-Agent` value to
  22901. // httpRequest’s header list.
  22902. if (!httpRequest.headersList.contains('user-agent')) {
  22903. httpRequest.headersList.append('user-agent', typeof esbuildDetection === 'undefined' ? 'undici' : 'node')
  22904. }
  22905. // 15. If httpRequest’s cache mode is "default" and httpRequest’s header
  22906. // list contains `If-Modified-Since`, `If-None-Match`,
  22907. // `If-Unmodified-Since`, `If-Match`, or `If-Range`, then set
  22908. // httpRequest’s cache mode to "no-store".
  22909. if (
  22910. httpRequest.cache === 'default' &&
  22911. (httpRequest.headersList.contains('if-modified-since') ||
  22912. httpRequest.headersList.contains('if-none-match') ||
  22913. httpRequest.headersList.contains('if-unmodified-since') ||
  22914. httpRequest.headersList.contains('if-match') ||
  22915. httpRequest.headersList.contains('if-range'))
  22916. ) {
  22917. httpRequest.cache = 'no-store'
  22918. }
  22919. // 16. If httpRequest’s cache mode is "no-cache", httpRequest’s prevent
  22920. // no-cache cache-control header modification flag is unset, and
  22921. // httpRequest’s header list does not contain `Cache-Control`, then append
  22922. // `Cache-Control`/`max-age=0` to httpRequest’s header list.
  22923. if (
  22924. httpRequest.cache === 'no-cache' &&
  22925. !httpRequest.preventNoCacheCacheControlHeaderModification &&
  22926. !httpRequest.headersList.contains('cache-control')
  22927. ) {
  22928. httpRequest.headersList.append('cache-control', 'max-age=0')
  22929. }
  22930. // 17. If httpRequest’s cache mode is "no-store" or "reload", then:
  22931. if (httpRequest.cache === 'no-store' || httpRequest.cache === 'reload') {
  22932. // 1. If httpRequest’s header list does not contain `Pragma`, then append
  22933. // `Pragma`/`no-cache` to httpRequest’s header list.
  22934. if (!httpRequest.headersList.contains('pragma')) {
  22935. httpRequest.headersList.append('pragma', 'no-cache')
  22936. }
  22937. // 2. If httpRequest’s header list does not contain `Cache-Control`,
  22938. // then append `Cache-Control`/`no-cache` to httpRequest’s header list.
  22939. if (!httpRequest.headersList.contains('cache-control')) {
  22940. httpRequest.headersList.append('cache-control', 'no-cache')
  22941. }
  22942. }
  22943. // 18. If httpRequest’s header list contains `Range`, then append
  22944. // `Accept-Encoding`/`identity` to httpRequest’s header list.
  22945. if (httpRequest.headersList.contains('range')) {
  22946. httpRequest.headersList.append('accept-encoding', 'identity')
  22947. }
  22948. // 19. Modify httpRequest’s header list per HTTP. Do not append a given
  22949. // header if httpRequest’s header list contains that header’s name.
  22950. // TODO: https://github.com/whatwg/fetch/issues/1285#issuecomment-896560129
  22951. if (!httpRequest.headersList.contains('accept-encoding')) {
  22952. if (urlHasHttpsScheme(requestCurrentURL(httpRequest))) {
  22953. httpRequest.headersList.append('accept-encoding', 'br, gzip, deflate')
  22954. } else {
  22955. httpRequest.headersList.append('accept-encoding', 'gzip, deflate')
  22956. }
  22957. }
  22958. httpRequest.headersList.delete('host')
  22959. // 20. If includeCredentials is true, then:
  22960. if (includeCredentials) {
  22961. // 1. If the user agent is not configured to block cookies for httpRequest
  22962. // (see section 7 of [COOKIES]), then:
  22963. // TODO: credentials
  22964. // 2. If httpRequest’s header list does not contain `Authorization`, then:
  22965. // TODO: credentials
  22966. }
  22967. // 21. If there’s a proxy-authentication entry, use it as appropriate.
  22968. // TODO: proxy-authentication
  22969. // 22. Set httpCache to the result of determining the HTTP cache
  22970. // partition, given httpRequest.
  22971. // TODO: cache
  22972. // 23. If httpCache is null, then set httpRequest’s cache mode to
  22973. // "no-store".
  22974. if (httpCache == null) {
  22975. httpRequest.cache = 'no-store'
  22976. }
  22977. // 24. If httpRequest’s cache mode is neither "no-store" nor "reload",
  22978. // then:
  22979. if (httpRequest.mode !== 'no-store' && httpRequest.mode !== 'reload') {
  22980. // TODO: cache
  22981. }
  22982. // 9. If aborted, then return the appropriate network error for fetchParams.
  22983. // TODO
  22984. // 10. If response is null, then:
  22985. if (response == null) {
  22986. // 1. If httpRequest’s cache mode is "only-if-cached", then return a
  22987. // network error.
  22988. if (httpRequest.mode === 'only-if-cached') {
  22989. return makeNetworkError('only if cached')
  22990. }
  22991. // 2. Let forwardResponse be the result of running HTTP-network fetch
  22992. // given httpFetchParams, includeCredentials, and isNewConnectionFetch.
  22993. const forwardResponse = await httpNetworkFetch(
  22994. httpFetchParams,
  22995. includeCredentials,
  22996. isNewConnectionFetch
  22997. )
  22998. // 3. If httpRequest’s method is unsafe and forwardResponse’s status is
  22999. // in the range 200 to 399, inclusive, invalidate appropriate stored
  23000. // responses in httpCache, as per the "Invalidation" chapter of HTTP
  23001. // Caching, and set storedResponse to null. [HTTP-CACHING]
  23002. if (
  23003. !safeMethodsSet.has(httpRequest.method) &&
  23004. forwardResponse.status >= 200 &&
  23005. forwardResponse.status <= 399
  23006. ) {
  23007. // TODO: cache
  23008. }
  23009. // 4. If the revalidatingFlag is set and forwardResponse’s status is 304,
  23010. // then:
  23011. if (revalidatingFlag && forwardResponse.status === 304) {
  23012. // TODO: cache
  23013. }
  23014. // 5. If response is null, then:
  23015. if (response == null) {
  23016. // 1. Set response to forwardResponse.
  23017. response = forwardResponse
  23018. // 2. Store httpRequest and forwardResponse in httpCache, as per the
  23019. // "Storing Responses in Caches" chapter of HTTP Caching. [HTTP-CACHING]
  23020. // TODO: cache
  23021. }
  23022. }
  23023. // 11. Set response’s URL list to a clone of httpRequest’s URL list.
  23024. response.urlList = [...httpRequest.urlList]
  23025. // 12. If httpRequest’s header list contains `Range`, then set response’s
  23026. // range-requested flag.
  23027. if (httpRequest.headersList.contains('range')) {
  23028. response.rangeRequested = true
  23029. }
  23030. // 13. Set response’s request-includes-credentials to includeCredentials.
  23031. response.requestIncludesCredentials = includeCredentials
  23032. // 14. If response’s status is 401, httpRequest’s response tainting is not
  23033. // "cors", includeCredentials is true, and request’s window is an environment
  23034. // settings object, then:
  23035. // TODO
  23036. // 15. If response’s status is 407, then:
  23037. if (response.status === 407) {
  23038. // 1. If request’s window is "no-window", then return a network error.
  23039. if (request.window === 'no-window') {
  23040. return makeNetworkError()
  23041. }
  23042. // 2. ???
  23043. // 3. If fetchParams is canceled, then return the appropriate network error for fetchParams.
  23044. if (isCancelled(fetchParams)) {
  23045. return makeAppropriateNetworkError(fetchParams)
  23046. }
  23047. // 4. Prompt the end user as appropriate in request’s window and store
  23048. // the result as a proxy-authentication entry. [HTTP-AUTH]
  23049. // TODO: Invoke some kind of callback?
  23050. // 5. Set response to the result of running HTTP-network-or-cache fetch given
  23051. // fetchParams.
  23052. // TODO
  23053. return makeNetworkError('proxy authentication required')
  23054. }
  23055. // 16. If all of the following are true
  23056. if (
  23057. // response’s status is 421
  23058. response.status === 421 &&
  23059. // isNewConnectionFetch is false
  23060. !isNewConnectionFetch &&
  23061. // request’s body is null, or request’s body is non-null and request’s body’s source is non-null
  23062. (request.body == null || request.body.source != null)
  23063. ) {
  23064. // then:
  23065. // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams.
  23066. if (isCancelled(fetchParams)) {
  23067. return makeAppropriateNetworkError(fetchParams)
  23068. }
  23069. // 2. Set response to the result of running HTTP-network-or-cache
  23070. // fetch given fetchParams, isAuthenticationFetch, and true.
  23071. // TODO (spec): The spec doesn't specify this but we need to cancel
  23072. // the active response before we can start a new one.
  23073. // https://github.com/whatwg/fetch/issues/1293
  23074. fetchParams.controller.connection.destroy()
  23075. response = await httpNetworkOrCacheFetch(
  23076. fetchParams,
  23077. isAuthenticationFetch,
  23078. true
  23079. )
  23080. }
  23081. // 17. If isAuthenticationFetch is true, then create an authentication entry
  23082. if (isAuthenticationFetch) {
  23083. // TODO
  23084. }
  23085. // 18. Return response.
  23086. return response
  23087. }
  23088. // https://fetch.spec.whatwg.org/#http-network-fetch
  23089. async function httpNetworkFetch (
  23090. fetchParams,
  23091. includeCredentials = false,
  23092. forceNewConnection = false
  23093. ) {
  23094. assert(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed)
  23095. fetchParams.controller.connection = {
  23096. abort: null,
  23097. destroyed: false,
  23098. destroy (err) {
  23099. if (!this.destroyed) {
  23100. this.destroyed = true
  23101. this.abort?.(err ?? new DOMException('The operation was aborted.', 'AbortError'))
  23102. }
  23103. }
  23104. }
  23105. // 1. Let request be fetchParams’s request.
  23106. const request = fetchParams.request
  23107. // 2. Let response be null.
  23108. let response = null
  23109. // 3. Let timingInfo be fetchParams’s timing info.
  23110. const timingInfo = fetchParams.timingInfo
  23111. // 4. Let httpCache be the result of determining the HTTP cache partition,
  23112. // given request.
  23113. // TODO: cache
  23114. const httpCache = null
  23115. // 5. If httpCache is null, then set request’s cache mode to "no-store".
  23116. if (httpCache == null) {
  23117. request.cache = 'no-store'
  23118. }
  23119. // 6. Let networkPartitionKey be the result of determining the network
  23120. // partition key given request.
  23121. // TODO
  23122. // 7. Let newConnection be "yes" if forceNewConnection is true; otherwise
  23123. // "no".
  23124. const newConnection = forceNewConnection ? 'yes' : 'no' // eslint-disable-line no-unused-vars
  23125. // 8. Switch on request’s mode:
  23126. if (request.mode === 'websocket') {
  23127. // Let connection be the result of obtaining a WebSocket connection,
  23128. // given request’s current URL.
  23129. // TODO
  23130. } else {
  23131. // Let connection be the result of obtaining a connection, given
  23132. // networkPartitionKey, request’s current URL’s origin,
  23133. // includeCredentials, and forceNewConnection.
  23134. // TODO
  23135. }
  23136. // 9. Run these steps, but abort when the ongoing fetch is terminated:
  23137. // 1. If connection is failure, then return a network error.
  23138. // 2. Set timingInfo’s final connection timing info to the result of
  23139. // calling clamp and coarsen connection timing info with connection’s
  23140. // timing info, timingInfo’s post-redirect start time, and fetchParams’s
  23141. // cross-origin isolated capability.
  23142. // 3. If connection is not an HTTP/2 connection, request’s body is non-null,
  23143. // and request’s body’s source is null, then append (`Transfer-Encoding`,
  23144. // `chunked`) to request’s header list.
  23145. // 4. Set timingInfo’s final network-request start time to the coarsened
  23146. // shared current time given fetchParams’s cross-origin isolated
  23147. // capability.
  23148. // 5. Set response to the result of making an HTTP request over connection
  23149. // using request with the following caveats:
  23150. // - Follow the relevant requirements from HTTP. [HTTP] [HTTP-SEMANTICS]
  23151. // [HTTP-COND] [HTTP-CACHING] [HTTP-AUTH]
  23152. // - If request’s body is non-null, and request’s body’s source is null,
  23153. // then the user agent may have a buffer of up to 64 kibibytes and store
  23154. // a part of request’s body in that buffer. If the user agent reads from
  23155. // request’s body beyond that buffer’s size and the user agent needs to
  23156. // resend request, then instead return a network error.
  23157. // - Set timingInfo’s final network-response start time to the coarsened
  23158. // shared current time given fetchParams’s cross-origin isolated capability,
  23159. // immediately after the user agent’s HTTP parser receives the first byte
  23160. // of the response (e.g., frame header bytes for HTTP/2 or response status
  23161. // line for HTTP/1.x).
  23162. // - Wait until all the headers are transmitted.
  23163. // - Any responses whose status is in the range 100 to 199, inclusive,
  23164. // and is not 101, are to be ignored, except for the purposes of setting
  23165. // timingInfo’s final network-response start time above.
  23166. // - If request’s header list contains `Transfer-Encoding`/`chunked` and
  23167. // response is transferred via HTTP/1.0 or older, then return a network
  23168. // error.
  23169. // - If the HTTP request results in a TLS client certificate dialog, then:
  23170. // 1. If request’s window is an environment settings object, make the
  23171. // dialog available in request’s window.
  23172. // 2. Otherwise, return a network error.
  23173. // To transmit request’s body body, run these steps:
  23174. let requestBody = null
  23175. // 1. If body is null and fetchParams’s process request end-of-body is
  23176. // non-null, then queue a fetch task given fetchParams’s process request
  23177. // end-of-body and fetchParams’s task destination.
  23178. if (request.body == null && fetchParams.processRequestEndOfBody) {
  23179. queueMicrotask(() => fetchParams.processRequestEndOfBody())
  23180. } else if (request.body != null) {
  23181. // 2. Otherwise, if body is non-null:
  23182. // 1. Let processBodyChunk given bytes be these steps:
  23183. const processBodyChunk = async function * (bytes) {
  23184. // 1. If the ongoing fetch is terminated, then abort these steps.
  23185. if (isCancelled(fetchParams)) {
  23186. return
  23187. }
  23188. // 2. Run this step in parallel: transmit bytes.
  23189. yield bytes
  23190. // 3. If fetchParams’s process request body is non-null, then run
  23191. // fetchParams’s process request body given bytes’s length.
  23192. fetchParams.processRequestBodyChunkLength?.(bytes.byteLength)
  23193. }
  23194. // 2. Let processEndOfBody be these steps:
  23195. const processEndOfBody = () => {
  23196. // 1. If fetchParams is canceled, then abort these steps.
  23197. if (isCancelled(fetchParams)) {
  23198. return
  23199. }
  23200. // 2. If fetchParams’s process request end-of-body is non-null,
  23201. // then run fetchParams’s process request end-of-body.
  23202. if (fetchParams.processRequestEndOfBody) {
  23203. fetchParams.processRequestEndOfBody()
  23204. }
  23205. }
  23206. // 3. Let processBodyError given e be these steps:
  23207. const processBodyError = (e) => {
  23208. // 1. If fetchParams is canceled, then abort these steps.
  23209. if (isCancelled(fetchParams)) {
  23210. return
  23211. }
  23212. // 2. If e is an "AbortError" DOMException, then abort fetchParams’s controller.
  23213. if (e.name === 'AbortError') {
  23214. fetchParams.controller.abort()
  23215. } else {
  23216. fetchParams.controller.terminate(e)
  23217. }
  23218. }
  23219. // 4. Incrementally read request’s body given processBodyChunk, processEndOfBody,
  23220. // processBodyError, and fetchParams’s task destination.
  23221. requestBody = (async function * () {
  23222. try {
  23223. for await (const bytes of request.body.stream) {
  23224. yield * processBodyChunk(bytes)
  23225. }
  23226. processEndOfBody()
  23227. } catch (err) {
  23228. processBodyError(err)
  23229. }
  23230. })()
  23231. }
  23232. try {
  23233. // socket is only provided for websockets
  23234. const { body, status, statusText, headersList, socket } = await dispatch({ body: requestBody })
  23235. if (socket) {
  23236. response = makeResponse({ status, statusText, headersList, socket })
  23237. } else {
  23238. const iterator = body[Symbol.asyncIterator]()
  23239. fetchParams.controller.next = () => iterator.next()
  23240. response = makeResponse({ status, statusText, headersList })
  23241. }
  23242. } catch (err) {
  23243. // 10. If aborted, then:
  23244. if (err.name === 'AbortError') {
  23245. // 1. If connection uses HTTP/2, then transmit an RST_STREAM frame.
  23246. fetchParams.controller.connection.destroy()
  23247. // 2. Return the appropriate network error for fetchParams.
  23248. return makeAppropriateNetworkError(fetchParams, err)
  23249. }
  23250. return makeNetworkError(err)
  23251. }
  23252. // 11. Let pullAlgorithm be an action that resumes the ongoing fetch
  23253. // if it is suspended.
  23254. const pullAlgorithm = () => {
  23255. fetchParams.controller.resume()
  23256. }
  23257. // 12. Let cancelAlgorithm be an algorithm that aborts fetchParams’s
  23258. // controller with reason, given reason.
  23259. const cancelAlgorithm = (reason) => {
  23260. fetchParams.controller.abort(reason)
  23261. }
  23262. // 13. Let highWaterMark be a non-negative, non-NaN number, chosen by
  23263. // the user agent.
  23264. // TODO
  23265. // 14. Let sizeAlgorithm be an algorithm that accepts a chunk object
  23266. // and returns a non-negative, non-NaN, non-infinite number, chosen by the user agent.
  23267. // TODO
  23268. // 15. Let stream be a new ReadableStream.
  23269. // 16. Set up stream with pullAlgorithm set to pullAlgorithm,
  23270. // cancelAlgorithm set to cancelAlgorithm, highWaterMark set to
  23271. // highWaterMark, and sizeAlgorithm set to sizeAlgorithm.
  23272. if (!ReadableStream) {
  23273. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  23274. }
  23275. const stream = new ReadableStream(
  23276. {
  23277. async start (controller) {
  23278. fetchParams.controller.controller = controller
  23279. },
  23280. async pull (controller) {
  23281. await pullAlgorithm(controller)
  23282. },
  23283. async cancel (reason) {
  23284. await cancelAlgorithm(reason)
  23285. }
  23286. },
  23287. {
  23288. highWaterMark: 0,
  23289. size () {
  23290. return 1
  23291. }
  23292. }
  23293. )
  23294. // 17. Run these steps, but abort when the ongoing fetch is terminated:
  23295. // 1. Set response’s body to a new body whose stream is stream.
  23296. response.body = { stream }
  23297. // 2. If response is not a network error and request’s cache mode is
  23298. // not "no-store", then update response in httpCache for request.
  23299. // TODO
  23300. // 3. If includeCredentials is true and the user agent is not configured
  23301. // to block cookies for request (see section 7 of [COOKIES]), then run the
  23302. // "set-cookie-string" parsing algorithm (see section 5.2 of [COOKIES]) on
  23303. // the value of each header whose name is a byte-case-insensitive match for
  23304. // `Set-Cookie` in response’s header list, if any, and request’s current URL.
  23305. // TODO
  23306. // 18. If aborted, then:
  23307. // TODO
  23308. // 19. Run these steps in parallel:
  23309. // 1. Run these steps, but abort when fetchParams is canceled:
  23310. fetchParams.controller.on('terminated', onAborted)
  23311. fetchParams.controller.resume = async () => {
  23312. // 1. While true
  23313. while (true) {
  23314. // 1-3. See onData...
  23315. // 4. Set bytes to the result of handling content codings given
  23316. // codings and bytes.
  23317. let bytes
  23318. let isFailure
  23319. try {
  23320. const { done, value } = await fetchParams.controller.next()
  23321. if (isAborted(fetchParams)) {
  23322. break
  23323. }
  23324. bytes = done ? undefined : value
  23325. } catch (err) {
  23326. if (fetchParams.controller.ended && !timingInfo.encodedBodySize) {
  23327. // zlib doesn't like empty streams.
  23328. bytes = undefined
  23329. } else {
  23330. bytes = err
  23331. // err may be propagated from the result of calling readablestream.cancel,
  23332. // which might not be an error. https://github.com/nodejs/undici/issues/2009
  23333. isFailure = true
  23334. }
  23335. }
  23336. if (bytes === undefined) {
  23337. // 2. Otherwise, if the bytes transmission for response’s message
  23338. // body is done normally and stream is readable, then close
  23339. // stream, finalize response for fetchParams and response, and
  23340. // abort these in-parallel steps.
  23341. readableStreamClose(fetchParams.controller.controller)
  23342. finalizeResponse(fetchParams, response)
  23343. return
  23344. }
  23345. // 5. Increase timingInfo’s decoded body size by bytes’s length.
  23346. timingInfo.decodedBodySize += bytes?.byteLength ?? 0
  23347. // 6. If bytes is failure, then terminate fetchParams’s controller.
  23348. if (isFailure) {
  23349. fetchParams.controller.terminate(bytes)
  23350. return
  23351. }
  23352. // 7. Enqueue a Uint8Array wrapping an ArrayBuffer containing bytes
  23353. // into stream.
  23354. fetchParams.controller.controller.enqueue(new Uint8Array(bytes))
  23355. // 8. If stream is errored, then terminate the ongoing fetch.
  23356. if (isErrored(stream)) {
  23357. fetchParams.controller.terminate()
  23358. return
  23359. }
  23360. // 9. If stream doesn’t need more data ask the user agent to suspend
  23361. // the ongoing fetch.
  23362. if (!fetchParams.controller.controller.desiredSize) {
  23363. return
  23364. }
  23365. }
  23366. }
  23367. // 2. If aborted, then:
  23368. function onAborted (reason) {
  23369. // 2. If fetchParams is aborted, then:
  23370. if (isAborted(fetchParams)) {
  23371. // 1. Set response’s aborted flag.
  23372. response.aborted = true
  23373. // 2. If stream is readable, then error stream with the result of
  23374. // deserialize a serialized abort reason given fetchParams’s
  23375. // controller’s serialized abort reason and an
  23376. // implementation-defined realm.
  23377. if (isReadable(stream)) {
  23378. fetchParams.controller.controller.error(
  23379. fetchParams.controller.serializedAbortReason
  23380. )
  23381. }
  23382. } else {
  23383. // 3. Otherwise, if stream is readable, error stream with a TypeError.
  23384. if (isReadable(stream)) {
  23385. fetchParams.controller.controller.error(new TypeError('terminated', {
  23386. cause: isErrorLike(reason) ? reason : undefined
  23387. }))
  23388. }
  23389. }
  23390. // 4. If connection uses HTTP/2, then transmit an RST_STREAM frame.
  23391. // 5. Otherwise, the user agent should close connection unless it would be bad for performance to do so.
  23392. fetchParams.controller.connection.destroy()
  23393. }
  23394. // 20. Return response.
  23395. return response
  23396. async function dispatch ({ body }) {
  23397. const url = requestCurrentURL(request)
  23398. /** @type {import('../..').Agent} */
  23399. const agent = fetchParams.controller.dispatcher
  23400. return new Promise((resolve, reject) => agent.dispatch(
  23401. {
  23402. path: url.pathname + url.search,
  23403. origin: url.origin,
  23404. method: request.method,
  23405. body: fetchParams.controller.dispatcher.isMockActive ? request.body && (request.body.source || request.body.stream) : body,
  23406. headers: request.headersList.entries,
  23407. maxRedirections: 0,
  23408. upgrade: request.mode === 'websocket' ? 'websocket' : undefined
  23409. },
  23410. {
  23411. body: null,
  23412. abort: null,
  23413. onConnect (abort) {
  23414. // TODO (fix): Do we need connection here?
  23415. const { connection } = fetchParams.controller
  23416. if (connection.destroyed) {
  23417. abort(new DOMException('The operation was aborted.', 'AbortError'))
  23418. } else {
  23419. fetchParams.controller.on('terminated', abort)
  23420. this.abort = connection.abort = abort
  23421. }
  23422. },
  23423. onHeaders (status, headersList, resume, statusText) {
  23424. if (status < 200) {
  23425. return
  23426. }
  23427. let codings = []
  23428. let location = ''
  23429. const headers = new Headers()
  23430. // For H2, the headers are a plain JS object
  23431. // We distinguish between them and iterate accordingly
  23432. if (Array.isArray(headersList)) {
  23433. for (let n = 0; n < headersList.length; n += 2) {
  23434. const key = headersList[n + 0].toString('latin1')
  23435. const val = headersList[n + 1].toString('latin1')
  23436. if (key.toLowerCase() === 'content-encoding') {
  23437. // https://www.rfc-editor.org/rfc/rfc7231#section-3.1.2.1
  23438. // "All content-coding values are case-insensitive..."
  23439. codings = val.toLowerCase().split(',').map((x) => x.trim())
  23440. } else if (key.toLowerCase() === 'location') {
  23441. location = val
  23442. }
  23443. headers[kHeadersList].append(key, val)
  23444. }
  23445. } else {
  23446. const keys = Object.keys(headersList)
  23447. for (const key of keys) {
  23448. const val = headersList[key]
  23449. if (key.toLowerCase() === 'content-encoding') {
  23450. // https://www.rfc-editor.org/rfc/rfc7231#section-3.1.2.1
  23451. // "All content-coding values are case-insensitive..."
  23452. codings = val.toLowerCase().split(',').map((x) => x.trim()).reverse()
  23453. } else if (key.toLowerCase() === 'location') {
  23454. location = val
  23455. }
  23456. headers[kHeadersList].append(key, val)
  23457. }
  23458. }
  23459. this.body = new Readable({ read: resume })
  23460. const decoders = []
  23461. const willFollow = request.redirect === 'follow' &&
  23462. location &&
  23463. redirectStatusSet.has(status)
  23464. // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding
  23465. if (request.method !== 'HEAD' && request.method !== 'CONNECT' && !nullBodyStatus.includes(status) && !willFollow) {
  23466. for (const coding of codings) {
  23467. // https://www.rfc-editor.org/rfc/rfc9112.html#section-7.2
  23468. if (coding === 'x-gzip' || coding === 'gzip') {
  23469. decoders.push(zlib.createGunzip({
  23470. // Be less strict when decoding compressed responses, since sometimes
  23471. // servers send slightly invalid responses that are still accepted
  23472. // by common browsers.
  23473. // Always using Z_SYNC_FLUSH is what cURL does.
  23474. flush: zlib.constants.Z_SYNC_FLUSH,
  23475. finishFlush: zlib.constants.Z_SYNC_FLUSH
  23476. }))
  23477. } else if (coding === 'deflate') {
  23478. decoders.push(zlib.createInflate())
  23479. } else if (coding === 'br') {
  23480. decoders.push(zlib.createBrotliDecompress())
  23481. } else {
  23482. decoders.length = 0
  23483. break
  23484. }
  23485. }
  23486. }
  23487. resolve({
  23488. status,
  23489. statusText,
  23490. headersList: headers[kHeadersList],
  23491. body: decoders.length
  23492. ? pipeline(this.body, ...decoders, () => { })
  23493. : this.body.on('error', () => {})
  23494. })
  23495. return true
  23496. },
  23497. onData (chunk) {
  23498. if (fetchParams.controller.dump) {
  23499. return
  23500. }
  23501. // 1. If one or more bytes have been transmitted from response’s
  23502. // message body, then:
  23503. // 1. Let bytes be the transmitted bytes.
  23504. const bytes = chunk
  23505. // 2. Let codings be the result of extracting header list values
  23506. // given `Content-Encoding` and response’s header list.
  23507. // See pullAlgorithm.
  23508. // 3. Increase timingInfo’s encoded body size by bytes’s length.
  23509. timingInfo.encodedBodySize += bytes.byteLength
  23510. // 4. See pullAlgorithm...
  23511. return this.body.push(bytes)
  23512. },
  23513. onComplete () {
  23514. if (this.abort) {
  23515. fetchParams.controller.off('terminated', this.abort)
  23516. }
  23517. fetchParams.controller.ended = true
  23518. this.body.push(null)
  23519. },
  23520. onError (error) {
  23521. if (this.abort) {
  23522. fetchParams.controller.off('terminated', this.abort)
  23523. }
  23524. this.body?.destroy(error)
  23525. fetchParams.controller.terminate(error)
  23526. reject(error)
  23527. },
  23528. onUpgrade (status, headersList, socket) {
  23529. if (status !== 101) {
  23530. return
  23531. }
  23532. const headers = new Headers()
  23533. for (let n = 0; n < headersList.length; n += 2) {
  23534. const key = headersList[n + 0].toString('latin1')
  23535. const val = headersList[n + 1].toString('latin1')
  23536. headers[kHeadersList].append(key, val)
  23537. }
  23538. resolve({
  23539. status,
  23540. statusText: STATUS_CODES[status],
  23541. headersList: headers[kHeadersList],
  23542. socket
  23543. })
  23544. return true
  23545. }
  23546. }
  23547. ))
  23548. }
  23549. }
  23550. module.exports = {
  23551. fetch,
  23552. Fetch,
  23553. fetching,
  23554. finalizeAndReportTiming
  23555. }
  23556. /***/ }),
  23557. /***/ 8359:
  23558. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  23559. "use strict";
  23560. /* globals AbortController */
  23561. const { extractBody, mixinBody, cloneBody } = __nccwpck_require__(9990)
  23562. const { Headers, fill: fillHeaders, HeadersList } = __nccwpck_require__(554)
  23563. const { FinalizationRegistry } = __nccwpck_require__(6436)()
  23564. const util = __nccwpck_require__(3983)
  23565. const {
  23566. isValidHTTPToken,
  23567. sameOrigin,
  23568. normalizeMethod,
  23569. makePolicyContainer,
  23570. normalizeMethodRecord
  23571. } = __nccwpck_require__(2538)
  23572. const {
  23573. forbiddenMethodsSet,
  23574. corsSafeListedMethodsSet,
  23575. referrerPolicy,
  23576. requestRedirect,
  23577. requestMode,
  23578. requestCredentials,
  23579. requestCache,
  23580. requestDuplex
  23581. } = __nccwpck_require__(1037)
  23582. const { kEnumerableProperty } = util
  23583. const { kHeaders, kSignal, kState, kGuard, kRealm } = __nccwpck_require__(5861)
  23584. const { webidl } = __nccwpck_require__(1744)
  23585. const { getGlobalOrigin } = __nccwpck_require__(1246)
  23586. const { URLSerializer } = __nccwpck_require__(685)
  23587. const { kHeadersList, kConstruct } = __nccwpck_require__(2785)
  23588. const assert = __nccwpck_require__(9491)
  23589. const { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = __nccwpck_require__(2361)
  23590. let TransformStream = globalThis.TransformStream
  23591. const kAbortController = Symbol('abortController')
  23592. const requestFinalizer = new FinalizationRegistry(({ signal, abort }) => {
  23593. signal.removeEventListener('abort', abort)
  23594. })
  23595. // https://fetch.spec.whatwg.org/#request-class
  23596. class Request {
  23597. // https://fetch.spec.whatwg.org/#dom-request
  23598. constructor (input, init = {}) {
  23599. if (input === kConstruct) {
  23600. return
  23601. }
  23602. webidl.argumentLengthCheck(arguments, 1, { header: 'Request constructor' })
  23603. input = webidl.converters.RequestInfo(input)
  23604. init = webidl.converters.RequestInit(init)
  23605. // https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object
  23606. this[kRealm] = {
  23607. settingsObject: {
  23608. baseUrl: getGlobalOrigin(),
  23609. get origin () {
  23610. return this.baseUrl?.origin
  23611. },
  23612. policyContainer: makePolicyContainer()
  23613. }
  23614. }
  23615. // 1. Let request be null.
  23616. let request = null
  23617. // 2. Let fallbackMode be null.
  23618. let fallbackMode = null
  23619. // 3. Let baseURL be this’s relevant settings object’s API base URL.
  23620. const baseUrl = this[kRealm].settingsObject.baseUrl
  23621. // 4. Let signal be null.
  23622. let signal = null
  23623. // 5. If input is a string, then:
  23624. if (typeof input === 'string') {
  23625. // 1. Let parsedURL be the result of parsing input with baseURL.
  23626. // 2. If parsedURL is failure, then throw a TypeError.
  23627. let parsedURL
  23628. try {
  23629. parsedURL = new URL(input, baseUrl)
  23630. } catch (err) {
  23631. throw new TypeError('Failed to parse URL from ' + input, { cause: err })
  23632. }
  23633. // 3. If parsedURL includes credentials, then throw a TypeError.
  23634. if (parsedURL.username || parsedURL.password) {
  23635. throw new TypeError(
  23636. 'Request cannot be constructed from a URL that includes credentials: ' +
  23637. input
  23638. )
  23639. }
  23640. // 4. Set request to a new request whose URL is parsedURL.
  23641. request = makeRequest({ urlList: [parsedURL] })
  23642. // 5. Set fallbackMode to "cors".
  23643. fallbackMode = 'cors'
  23644. } else {
  23645. // 6. Otherwise:
  23646. // 7. Assert: input is a Request object.
  23647. assert(input instanceof Request)
  23648. // 8. Set request to input’s request.
  23649. request = input[kState]
  23650. // 9. Set signal to input’s signal.
  23651. signal = input[kSignal]
  23652. }
  23653. // 7. Let origin be this’s relevant settings object’s origin.
  23654. const origin = this[kRealm].settingsObject.origin
  23655. // 8. Let window be "client".
  23656. let window = 'client'
  23657. // 9. If request’s window is an environment settings object and its origin
  23658. // is same origin with origin, then set window to request’s window.
  23659. if (
  23660. request.window?.constructor?.name === 'EnvironmentSettingsObject' &&
  23661. sameOrigin(request.window, origin)
  23662. ) {
  23663. window = request.window
  23664. }
  23665. // 10. If init["window"] exists and is non-null, then throw a TypeError.
  23666. if (init.window != null) {
  23667. throw new TypeError(`'window' option '${window}' must be null`)
  23668. }
  23669. // 11. If init["window"] exists, then set window to "no-window".
  23670. if ('window' in init) {
  23671. window = 'no-window'
  23672. }
  23673. // 12. Set request to a new request with the following properties:
  23674. request = makeRequest({
  23675. // URL request’s URL.
  23676. // undici implementation note: this is set as the first item in request's urlList in makeRequest
  23677. // method request’s method.
  23678. method: request.method,
  23679. // header list A copy of request’s header list.
  23680. // undici implementation note: headersList is cloned in makeRequest
  23681. headersList: request.headersList,
  23682. // unsafe-request flag Set.
  23683. unsafeRequest: request.unsafeRequest,
  23684. // client This’s relevant settings object.
  23685. client: this[kRealm].settingsObject,
  23686. // window window.
  23687. window,
  23688. // priority request’s priority.
  23689. priority: request.priority,
  23690. // origin request’s origin. The propagation of the origin is only significant for navigation requests
  23691. // being handled by a service worker. In this scenario a request can have an origin that is different
  23692. // from the current client.
  23693. origin: request.origin,
  23694. // referrer request’s referrer.
  23695. referrer: request.referrer,
  23696. // referrer policy request’s referrer policy.
  23697. referrerPolicy: request.referrerPolicy,
  23698. // mode request’s mode.
  23699. mode: request.mode,
  23700. // credentials mode request’s credentials mode.
  23701. credentials: request.credentials,
  23702. // cache mode request’s cache mode.
  23703. cache: request.cache,
  23704. // redirect mode request’s redirect mode.
  23705. redirect: request.redirect,
  23706. // integrity metadata request’s integrity metadata.
  23707. integrity: request.integrity,
  23708. // keepalive request’s keepalive.
  23709. keepalive: request.keepalive,
  23710. // reload-navigation flag request’s reload-navigation flag.
  23711. reloadNavigation: request.reloadNavigation,
  23712. // history-navigation flag request’s history-navigation flag.
  23713. historyNavigation: request.historyNavigation,
  23714. // URL list A clone of request’s URL list.
  23715. urlList: [...request.urlList]
  23716. })
  23717. const initHasKey = Object.keys(init).length !== 0
  23718. // 13. If init is not empty, then:
  23719. if (initHasKey) {
  23720. // 1. If request’s mode is "navigate", then set it to "same-origin".
  23721. if (request.mode === 'navigate') {
  23722. request.mode = 'same-origin'
  23723. }
  23724. // 2. Unset request’s reload-navigation flag.
  23725. request.reloadNavigation = false
  23726. // 3. Unset request’s history-navigation flag.
  23727. request.historyNavigation = false
  23728. // 4. Set request’s origin to "client".
  23729. request.origin = 'client'
  23730. // 5. Set request’s referrer to "client"
  23731. request.referrer = 'client'
  23732. // 6. Set request’s referrer policy to the empty string.
  23733. request.referrerPolicy = ''
  23734. // 7. Set request’s URL to request’s current URL.
  23735. request.url = request.urlList[request.urlList.length - 1]
  23736. // 8. Set request’s URL list to « request’s URL ».
  23737. request.urlList = [request.url]
  23738. }
  23739. // 14. If init["referrer"] exists, then:
  23740. if (init.referrer !== undefined) {
  23741. // 1. Let referrer be init["referrer"].
  23742. const referrer = init.referrer
  23743. // 2. If referrer is the empty string, then set request’s referrer to "no-referrer".
  23744. if (referrer === '') {
  23745. request.referrer = 'no-referrer'
  23746. } else {
  23747. // 1. Let parsedReferrer be the result of parsing referrer with
  23748. // baseURL.
  23749. // 2. If parsedReferrer is failure, then throw a TypeError.
  23750. let parsedReferrer
  23751. try {
  23752. parsedReferrer = new URL(referrer, baseUrl)
  23753. } catch (err) {
  23754. throw new TypeError(`Referrer "${referrer}" is not a valid URL.`, { cause: err })
  23755. }
  23756. // 3. If one of the following is true
  23757. // - parsedReferrer’s scheme is "about" and path is the string "client"
  23758. // - parsedReferrer’s origin is not same origin with origin
  23759. // then set request’s referrer to "client".
  23760. if (
  23761. (parsedReferrer.protocol === 'about:' && parsedReferrer.hostname === 'client') ||
  23762. (origin && !sameOrigin(parsedReferrer, this[kRealm].settingsObject.baseUrl))
  23763. ) {
  23764. request.referrer = 'client'
  23765. } else {
  23766. // 4. Otherwise, set request’s referrer to parsedReferrer.
  23767. request.referrer = parsedReferrer
  23768. }
  23769. }
  23770. }
  23771. // 15. If init["referrerPolicy"] exists, then set request’s referrer policy
  23772. // to it.
  23773. if (init.referrerPolicy !== undefined) {
  23774. request.referrerPolicy = init.referrerPolicy
  23775. }
  23776. // 16. Let mode be init["mode"] if it exists, and fallbackMode otherwise.
  23777. let mode
  23778. if (init.mode !== undefined) {
  23779. mode = init.mode
  23780. } else {
  23781. mode = fallbackMode
  23782. }
  23783. // 17. If mode is "navigate", then throw a TypeError.
  23784. if (mode === 'navigate') {
  23785. throw webidl.errors.exception({
  23786. header: 'Request constructor',
  23787. message: 'invalid request mode navigate.'
  23788. })
  23789. }
  23790. // 18. If mode is non-null, set request’s mode to mode.
  23791. if (mode != null) {
  23792. request.mode = mode
  23793. }
  23794. // 19. If init["credentials"] exists, then set request’s credentials mode
  23795. // to it.
  23796. if (init.credentials !== undefined) {
  23797. request.credentials = init.credentials
  23798. }
  23799. // 18. If init["cache"] exists, then set request’s cache mode to it.
  23800. if (init.cache !== undefined) {
  23801. request.cache = init.cache
  23802. }
  23803. // 21. If request’s cache mode is "only-if-cached" and request’s mode is
  23804. // not "same-origin", then throw a TypeError.
  23805. if (request.cache === 'only-if-cached' && request.mode !== 'same-origin') {
  23806. throw new TypeError(
  23807. "'only-if-cached' can be set only with 'same-origin' mode"
  23808. )
  23809. }
  23810. // 22. If init["redirect"] exists, then set request’s redirect mode to it.
  23811. if (init.redirect !== undefined) {
  23812. request.redirect = init.redirect
  23813. }
  23814. // 23. If init["integrity"] exists, then set request’s integrity metadata to it.
  23815. if (init.integrity != null) {
  23816. request.integrity = String(init.integrity)
  23817. }
  23818. // 24. If init["keepalive"] exists, then set request’s keepalive to it.
  23819. if (init.keepalive !== undefined) {
  23820. request.keepalive = Boolean(init.keepalive)
  23821. }
  23822. // 25. If init["method"] exists, then:
  23823. if (init.method !== undefined) {
  23824. // 1. Let method be init["method"].
  23825. let method = init.method
  23826. // 2. If method is not a method or method is a forbidden method, then
  23827. // throw a TypeError.
  23828. if (!isValidHTTPToken(method)) {
  23829. throw new TypeError(`'${method}' is not a valid HTTP method.`)
  23830. }
  23831. if (forbiddenMethodsSet.has(method.toUpperCase())) {
  23832. throw new TypeError(`'${method}' HTTP method is unsupported.`)
  23833. }
  23834. // 3. Normalize method.
  23835. method = normalizeMethodRecord[method] ?? normalizeMethod(method)
  23836. // 4. Set request’s method to method.
  23837. request.method = method
  23838. }
  23839. // 26. If init["signal"] exists, then set signal to it.
  23840. if (init.signal !== undefined) {
  23841. signal = init.signal
  23842. }
  23843. // 27. Set this’s request to request.
  23844. this[kState] = request
  23845. // 28. Set this’s signal to a new AbortSignal object with this’s relevant
  23846. // Realm.
  23847. // TODO: could this be simplified with AbortSignal.any
  23848. // (https://dom.spec.whatwg.org/#dom-abortsignal-any)
  23849. const ac = new AbortController()
  23850. this[kSignal] = ac.signal
  23851. this[kSignal][kRealm] = this[kRealm]
  23852. // 29. If signal is not null, then make this’s signal follow signal.
  23853. if (signal != null) {
  23854. if (
  23855. !signal ||
  23856. typeof signal.aborted !== 'boolean' ||
  23857. typeof signal.addEventListener !== 'function'
  23858. ) {
  23859. throw new TypeError(
  23860. "Failed to construct 'Request': member signal is not of type AbortSignal."
  23861. )
  23862. }
  23863. if (signal.aborted) {
  23864. ac.abort(signal.reason)
  23865. } else {
  23866. // Keep a strong ref to ac while request object
  23867. // is alive. This is needed to prevent AbortController
  23868. // from being prematurely garbage collected.
  23869. // See, https://github.com/nodejs/undici/issues/1926.
  23870. this[kAbortController] = ac
  23871. const acRef = new WeakRef(ac)
  23872. const abort = function () {
  23873. const ac = acRef.deref()
  23874. if (ac !== undefined) {
  23875. ac.abort(this.reason)
  23876. }
  23877. }
  23878. // Third-party AbortControllers may not work with these.
  23879. // See, https://github.com/nodejs/undici/pull/1910#issuecomment-1464495619.
  23880. try {
  23881. // If the max amount of listeners is equal to the default, increase it
  23882. // This is only available in node >= v19.9.0
  23883. if (typeof getMaxListeners === 'function' && getMaxListeners(signal) === defaultMaxListeners) {
  23884. setMaxListeners(100, signal)
  23885. } else if (getEventListeners(signal, 'abort').length >= defaultMaxListeners) {
  23886. setMaxListeners(100, signal)
  23887. }
  23888. } catch {}
  23889. util.addAbortListener(signal, abort)
  23890. requestFinalizer.register(ac, { signal, abort })
  23891. }
  23892. }
  23893. // 30. Set this’s headers to a new Headers object with this’s relevant
  23894. // Realm, whose header list is request’s header list and guard is
  23895. // "request".
  23896. this[kHeaders] = new Headers(kConstruct)
  23897. this[kHeaders][kHeadersList] = request.headersList
  23898. this[kHeaders][kGuard] = 'request'
  23899. this[kHeaders][kRealm] = this[kRealm]
  23900. // 31. If this’s request’s mode is "no-cors", then:
  23901. if (mode === 'no-cors') {
  23902. // 1. If this’s request’s method is not a CORS-safelisted method,
  23903. // then throw a TypeError.
  23904. if (!corsSafeListedMethodsSet.has(request.method)) {
  23905. throw new TypeError(
  23906. `'${request.method} is unsupported in no-cors mode.`
  23907. )
  23908. }
  23909. // 2. Set this’s headers’s guard to "request-no-cors".
  23910. this[kHeaders][kGuard] = 'request-no-cors'
  23911. }
  23912. // 32. If init is not empty, then:
  23913. if (initHasKey) {
  23914. /** @type {HeadersList} */
  23915. const headersList = this[kHeaders][kHeadersList]
  23916. // 1. Let headers be a copy of this’s headers and its associated header
  23917. // list.
  23918. // 2. If init["headers"] exists, then set headers to init["headers"].
  23919. const headers = init.headers !== undefined ? init.headers : new HeadersList(headersList)
  23920. // 3. Empty this’s headers’s header list.
  23921. headersList.clear()
  23922. // 4. If headers is a Headers object, then for each header in its header
  23923. // list, append header’s name/header’s value to this’s headers.
  23924. if (headers instanceof HeadersList) {
  23925. for (const [key, val] of headers) {
  23926. headersList.append(key, val)
  23927. }
  23928. // Note: Copy the `set-cookie` meta-data.
  23929. headersList.cookies = headers.cookies
  23930. } else {
  23931. // 5. Otherwise, fill this’s headers with headers.
  23932. fillHeaders(this[kHeaders], headers)
  23933. }
  23934. }
  23935. // 33. Let inputBody be input’s request’s body if input is a Request
  23936. // object; otherwise null.
  23937. const inputBody = input instanceof Request ? input[kState].body : null
  23938. // 34. If either init["body"] exists and is non-null or inputBody is
  23939. // non-null, and request’s method is `GET` or `HEAD`, then throw a
  23940. // TypeError.
  23941. if (
  23942. (init.body != null || inputBody != null) &&
  23943. (request.method === 'GET' || request.method === 'HEAD')
  23944. ) {
  23945. throw new TypeError('Request with GET/HEAD method cannot have body.')
  23946. }
  23947. // 35. Let initBody be null.
  23948. let initBody = null
  23949. // 36. If init["body"] exists and is non-null, then:
  23950. if (init.body != null) {
  23951. // 1. Let Content-Type be null.
  23952. // 2. Set initBody and Content-Type to the result of extracting
  23953. // init["body"], with keepalive set to request’s keepalive.
  23954. const [extractedBody, contentType] = extractBody(
  23955. init.body,
  23956. request.keepalive
  23957. )
  23958. initBody = extractedBody
  23959. // 3, If Content-Type is non-null and this’s headers’s header list does
  23960. // not contain `Content-Type`, then append `Content-Type`/Content-Type to
  23961. // this’s headers.
  23962. if (contentType && !this[kHeaders][kHeadersList].contains('content-type')) {
  23963. this[kHeaders].append('content-type', contentType)
  23964. }
  23965. }
  23966. // 37. Let inputOrInitBody be initBody if it is non-null; otherwise
  23967. // inputBody.
  23968. const inputOrInitBody = initBody ?? inputBody
  23969. // 38. If inputOrInitBody is non-null and inputOrInitBody’s source is
  23970. // null, then:
  23971. if (inputOrInitBody != null && inputOrInitBody.source == null) {
  23972. // 1. If initBody is non-null and init["duplex"] does not exist,
  23973. // then throw a TypeError.
  23974. if (initBody != null && init.duplex == null) {
  23975. throw new TypeError('RequestInit: duplex option is required when sending a body.')
  23976. }
  23977. // 2. If this’s request’s mode is neither "same-origin" nor "cors",
  23978. // then throw a TypeError.
  23979. if (request.mode !== 'same-origin' && request.mode !== 'cors') {
  23980. throw new TypeError(
  23981. 'If request is made from ReadableStream, mode should be "same-origin" or "cors"'
  23982. )
  23983. }
  23984. // 3. Set this’s request’s use-CORS-preflight flag.
  23985. request.useCORSPreflightFlag = true
  23986. }
  23987. // 39. Let finalBody be inputOrInitBody.
  23988. let finalBody = inputOrInitBody
  23989. // 40. If initBody is null and inputBody is non-null, then:
  23990. if (initBody == null && inputBody != null) {
  23991. // 1. If input is unusable, then throw a TypeError.
  23992. if (util.isDisturbed(inputBody.stream) || inputBody.stream.locked) {
  23993. throw new TypeError(
  23994. 'Cannot construct a Request with a Request object that has already been used.'
  23995. )
  23996. }
  23997. // 2. Set finalBody to the result of creating a proxy for inputBody.
  23998. if (!TransformStream) {
  23999. TransformStream = (__nccwpck_require__(5356).TransformStream)
  24000. }
  24001. // https://streams.spec.whatwg.org/#readablestream-create-a-proxy
  24002. const identityTransform = new TransformStream()
  24003. inputBody.stream.pipeThrough(identityTransform)
  24004. finalBody = {
  24005. source: inputBody.source,
  24006. length: inputBody.length,
  24007. stream: identityTransform.readable
  24008. }
  24009. }
  24010. // 41. Set this’s request’s body to finalBody.
  24011. this[kState].body = finalBody
  24012. }
  24013. // Returns request’s HTTP method, which is "GET" by default.
  24014. get method () {
  24015. webidl.brandCheck(this, Request)
  24016. // The method getter steps are to return this’s request’s method.
  24017. return this[kState].method
  24018. }
  24019. // Returns the URL of request as a string.
  24020. get url () {
  24021. webidl.brandCheck(this, Request)
  24022. // The url getter steps are to return this’s request’s URL, serialized.
  24023. return URLSerializer(this[kState].url)
  24024. }
  24025. // Returns a Headers object consisting of the headers associated with request.
  24026. // Note that headers added in the network layer by the user agent will not
  24027. // be accounted for in this object, e.g., the "Host" header.
  24028. get headers () {
  24029. webidl.brandCheck(this, Request)
  24030. // The headers getter steps are to return this’s headers.
  24031. return this[kHeaders]
  24032. }
  24033. // Returns the kind of resource requested by request, e.g., "document"
  24034. // or "script".
  24035. get destination () {
  24036. webidl.brandCheck(this, Request)
  24037. // The destination getter are to return this’s request’s destination.
  24038. return this[kState].destination
  24039. }
  24040. // Returns the referrer of request. Its value can be a same-origin URL if
  24041. // explicitly set in init, the empty string to indicate no referrer, and
  24042. // "about:client" when defaulting to the global’s default. This is used
  24043. // during fetching to determine the value of the `Referer` header of the
  24044. // request being made.
  24045. get referrer () {
  24046. webidl.brandCheck(this, Request)
  24047. // 1. If this’s request’s referrer is "no-referrer", then return the
  24048. // empty string.
  24049. if (this[kState].referrer === 'no-referrer') {
  24050. return ''
  24051. }
  24052. // 2. If this’s request’s referrer is "client", then return
  24053. // "about:client".
  24054. if (this[kState].referrer === 'client') {
  24055. return 'about:client'
  24056. }
  24057. // Return this’s request’s referrer, serialized.
  24058. return this[kState].referrer.toString()
  24059. }
  24060. // Returns the referrer policy associated with request.
  24061. // This is used during fetching to compute the value of the request’s
  24062. // referrer.
  24063. get referrerPolicy () {
  24064. webidl.brandCheck(this, Request)
  24065. // The referrerPolicy getter steps are to return this’s request’s referrer policy.
  24066. return this[kState].referrerPolicy
  24067. }
  24068. // Returns the mode associated with request, which is a string indicating
  24069. // whether the request will use CORS, or will be restricted to same-origin
  24070. // URLs.
  24071. get mode () {
  24072. webidl.brandCheck(this, Request)
  24073. // The mode getter steps are to return this’s request’s mode.
  24074. return this[kState].mode
  24075. }
  24076. // Returns the credentials mode associated with request,
  24077. // which is a string indicating whether credentials will be sent with the
  24078. // request always, never, or only when sent to a same-origin URL.
  24079. get credentials () {
  24080. // The credentials getter steps are to return this’s request’s credentials mode.
  24081. return this[kState].credentials
  24082. }
  24083. // Returns the cache mode associated with request,
  24084. // which is a string indicating how the request will
  24085. // interact with the browser’s cache when fetching.
  24086. get cache () {
  24087. webidl.brandCheck(this, Request)
  24088. // The cache getter steps are to return this’s request’s cache mode.
  24089. return this[kState].cache
  24090. }
  24091. // Returns the redirect mode associated with request,
  24092. // which is a string indicating how redirects for the
  24093. // request will be handled during fetching. A request
  24094. // will follow redirects by default.
  24095. get redirect () {
  24096. webidl.brandCheck(this, Request)
  24097. // The redirect getter steps are to return this’s request’s redirect mode.
  24098. return this[kState].redirect
  24099. }
  24100. // Returns request’s subresource integrity metadata, which is a
  24101. // cryptographic hash of the resource being fetched. Its value
  24102. // consists of multiple hashes separated by whitespace. [SRI]
  24103. get integrity () {
  24104. webidl.brandCheck(this, Request)
  24105. // The integrity getter steps are to return this’s request’s integrity
  24106. // metadata.
  24107. return this[kState].integrity
  24108. }
  24109. // Returns a boolean indicating whether or not request can outlive the
  24110. // global in which it was created.
  24111. get keepalive () {
  24112. webidl.brandCheck(this, Request)
  24113. // The keepalive getter steps are to return this’s request’s keepalive.
  24114. return this[kState].keepalive
  24115. }
  24116. // Returns a boolean indicating whether or not request is for a reload
  24117. // navigation.
  24118. get isReloadNavigation () {
  24119. webidl.brandCheck(this, Request)
  24120. // The isReloadNavigation getter steps are to return true if this’s
  24121. // request’s reload-navigation flag is set; otherwise false.
  24122. return this[kState].reloadNavigation
  24123. }
  24124. // Returns a boolean indicating whether or not request is for a history
  24125. // navigation (a.k.a. back-foward navigation).
  24126. get isHistoryNavigation () {
  24127. webidl.brandCheck(this, Request)
  24128. // The isHistoryNavigation getter steps are to return true if this’s request’s
  24129. // history-navigation flag is set; otherwise false.
  24130. return this[kState].historyNavigation
  24131. }
  24132. // Returns the signal associated with request, which is an AbortSignal
  24133. // object indicating whether or not request has been aborted, and its
  24134. // abort event handler.
  24135. get signal () {
  24136. webidl.brandCheck(this, Request)
  24137. // The signal getter steps are to return this’s signal.
  24138. return this[kSignal]
  24139. }
  24140. get body () {
  24141. webidl.brandCheck(this, Request)
  24142. return this[kState].body ? this[kState].body.stream : null
  24143. }
  24144. get bodyUsed () {
  24145. webidl.brandCheck(this, Request)
  24146. return !!this[kState].body && util.isDisturbed(this[kState].body.stream)
  24147. }
  24148. get duplex () {
  24149. webidl.brandCheck(this, Request)
  24150. return 'half'
  24151. }
  24152. // Returns a clone of request.
  24153. clone () {
  24154. webidl.brandCheck(this, Request)
  24155. // 1. If this is unusable, then throw a TypeError.
  24156. if (this.bodyUsed || this.body?.locked) {
  24157. throw new TypeError('unusable')
  24158. }
  24159. // 2. Let clonedRequest be the result of cloning this’s request.
  24160. const clonedRequest = cloneRequest(this[kState])
  24161. // 3. Let clonedRequestObject be the result of creating a Request object,
  24162. // given clonedRequest, this’s headers’s guard, and this’s relevant Realm.
  24163. const clonedRequestObject = new Request(kConstruct)
  24164. clonedRequestObject[kState] = clonedRequest
  24165. clonedRequestObject[kRealm] = this[kRealm]
  24166. clonedRequestObject[kHeaders] = new Headers(kConstruct)
  24167. clonedRequestObject[kHeaders][kHeadersList] = clonedRequest.headersList
  24168. clonedRequestObject[kHeaders][kGuard] = this[kHeaders][kGuard]
  24169. clonedRequestObject[kHeaders][kRealm] = this[kHeaders][kRealm]
  24170. // 4. Make clonedRequestObject’s signal follow this’s signal.
  24171. const ac = new AbortController()
  24172. if (this.signal.aborted) {
  24173. ac.abort(this.signal.reason)
  24174. } else {
  24175. util.addAbortListener(
  24176. this.signal,
  24177. () => {
  24178. ac.abort(this.signal.reason)
  24179. }
  24180. )
  24181. }
  24182. clonedRequestObject[kSignal] = ac.signal
  24183. // 4. Return clonedRequestObject.
  24184. return clonedRequestObject
  24185. }
  24186. }
  24187. mixinBody(Request)
  24188. function makeRequest (init) {
  24189. // https://fetch.spec.whatwg.org/#requests
  24190. const request = {
  24191. method: 'GET',
  24192. localURLsOnly: false,
  24193. unsafeRequest: false,
  24194. body: null,
  24195. client: null,
  24196. reservedClient: null,
  24197. replacesClientId: '',
  24198. window: 'client',
  24199. keepalive: false,
  24200. serviceWorkers: 'all',
  24201. initiator: '',
  24202. destination: '',
  24203. priority: null,
  24204. origin: 'client',
  24205. policyContainer: 'client',
  24206. referrer: 'client',
  24207. referrerPolicy: '',
  24208. mode: 'no-cors',
  24209. useCORSPreflightFlag: false,
  24210. credentials: 'same-origin',
  24211. useCredentials: false,
  24212. cache: 'default',
  24213. redirect: 'follow',
  24214. integrity: '',
  24215. cryptoGraphicsNonceMetadata: '',
  24216. parserMetadata: '',
  24217. reloadNavigation: false,
  24218. historyNavigation: false,
  24219. userActivation: false,
  24220. taintedOrigin: false,
  24221. redirectCount: 0,
  24222. responseTainting: 'basic',
  24223. preventNoCacheCacheControlHeaderModification: false,
  24224. done: false,
  24225. timingAllowFailed: false,
  24226. ...init,
  24227. headersList: init.headersList
  24228. ? new HeadersList(init.headersList)
  24229. : new HeadersList()
  24230. }
  24231. request.url = request.urlList[0]
  24232. return request
  24233. }
  24234. // https://fetch.spec.whatwg.org/#concept-request-clone
  24235. function cloneRequest (request) {
  24236. // To clone a request request, run these steps:
  24237. // 1. Let newRequest be a copy of request, except for its body.
  24238. const newRequest = makeRequest({ ...request, body: null })
  24239. // 2. If request’s body is non-null, set newRequest’s body to the
  24240. // result of cloning request’s body.
  24241. if (request.body != null) {
  24242. newRequest.body = cloneBody(request.body)
  24243. }
  24244. // 3. Return newRequest.
  24245. return newRequest
  24246. }
  24247. Object.defineProperties(Request.prototype, {
  24248. method: kEnumerableProperty,
  24249. url: kEnumerableProperty,
  24250. headers: kEnumerableProperty,
  24251. redirect: kEnumerableProperty,
  24252. clone: kEnumerableProperty,
  24253. signal: kEnumerableProperty,
  24254. duplex: kEnumerableProperty,
  24255. destination: kEnumerableProperty,
  24256. body: kEnumerableProperty,
  24257. bodyUsed: kEnumerableProperty,
  24258. isHistoryNavigation: kEnumerableProperty,
  24259. isReloadNavigation: kEnumerableProperty,
  24260. keepalive: kEnumerableProperty,
  24261. integrity: kEnumerableProperty,
  24262. cache: kEnumerableProperty,
  24263. credentials: kEnumerableProperty,
  24264. attribute: kEnumerableProperty,
  24265. referrerPolicy: kEnumerableProperty,
  24266. referrer: kEnumerableProperty,
  24267. mode: kEnumerableProperty,
  24268. [Symbol.toStringTag]: {
  24269. value: 'Request',
  24270. configurable: true
  24271. }
  24272. })
  24273. webidl.converters.Request = webidl.interfaceConverter(
  24274. Request
  24275. )
  24276. // https://fetch.spec.whatwg.org/#requestinfo
  24277. webidl.converters.RequestInfo = function (V) {
  24278. if (typeof V === 'string') {
  24279. return webidl.converters.USVString(V)
  24280. }
  24281. if (V instanceof Request) {
  24282. return webidl.converters.Request(V)
  24283. }
  24284. return webidl.converters.USVString(V)
  24285. }
  24286. webidl.converters.AbortSignal = webidl.interfaceConverter(
  24287. AbortSignal
  24288. )
  24289. // https://fetch.spec.whatwg.org/#requestinit
  24290. webidl.converters.RequestInit = webidl.dictionaryConverter([
  24291. {
  24292. key: 'method',
  24293. converter: webidl.converters.ByteString
  24294. },
  24295. {
  24296. key: 'headers',
  24297. converter: webidl.converters.HeadersInit
  24298. },
  24299. {
  24300. key: 'body',
  24301. converter: webidl.nullableConverter(
  24302. webidl.converters.BodyInit
  24303. )
  24304. },
  24305. {
  24306. key: 'referrer',
  24307. converter: webidl.converters.USVString
  24308. },
  24309. {
  24310. key: 'referrerPolicy',
  24311. converter: webidl.converters.DOMString,
  24312. // https://w3c.github.io/webappsec-referrer-policy/#referrer-policy
  24313. allowedValues: referrerPolicy
  24314. },
  24315. {
  24316. key: 'mode',
  24317. converter: webidl.converters.DOMString,
  24318. // https://fetch.spec.whatwg.org/#concept-request-mode
  24319. allowedValues: requestMode
  24320. },
  24321. {
  24322. key: 'credentials',
  24323. converter: webidl.converters.DOMString,
  24324. // https://fetch.spec.whatwg.org/#requestcredentials
  24325. allowedValues: requestCredentials
  24326. },
  24327. {
  24328. key: 'cache',
  24329. converter: webidl.converters.DOMString,
  24330. // https://fetch.spec.whatwg.org/#requestcache
  24331. allowedValues: requestCache
  24332. },
  24333. {
  24334. key: 'redirect',
  24335. converter: webidl.converters.DOMString,
  24336. // https://fetch.spec.whatwg.org/#requestredirect
  24337. allowedValues: requestRedirect
  24338. },
  24339. {
  24340. key: 'integrity',
  24341. converter: webidl.converters.DOMString
  24342. },
  24343. {
  24344. key: 'keepalive',
  24345. converter: webidl.converters.boolean
  24346. },
  24347. {
  24348. key: 'signal',
  24349. converter: webidl.nullableConverter(
  24350. (signal) => webidl.converters.AbortSignal(
  24351. signal,
  24352. { strict: false }
  24353. )
  24354. )
  24355. },
  24356. {
  24357. key: 'window',
  24358. converter: webidl.converters.any
  24359. },
  24360. {
  24361. key: 'duplex',
  24362. converter: webidl.converters.DOMString,
  24363. allowedValues: requestDuplex
  24364. }
  24365. ])
  24366. module.exports = { Request, makeRequest }
  24367. /***/ }),
  24368. /***/ 7823:
  24369. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  24370. "use strict";
  24371. const { Headers, HeadersList, fill } = __nccwpck_require__(554)
  24372. const { extractBody, cloneBody, mixinBody } = __nccwpck_require__(9990)
  24373. const util = __nccwpck_require__(3983)
  24374. const { kEnumerableProperty } = util
  24375. const {
  24376. isValidReasonPhrase,
  24377. isCancelled,
  24378. isAborted,
  24379. isBlobLike,
  24380. serializeJavascriptValueToJSONString,
  24381. isErrorLike,
  24382. isomorphicEncode
  24383. } = __nccwpck_require__(2538)
  24384. const {
  24385. redirectStatusSet,
  24386. nullBodyStatus,
  24387. DOMException
  24388. } = __nccwpck_require__(1037)
  24389. const { kState, kHeaders, kGuard, kRealm } = __nccwpck_require__(5861)
  24390. const { webidl } = __nccwpck_require__(1744)
  24391. const { FormData } = __nccwpck_require__(2015)
  24392. const { getGlobalOrigin } = __nccwpck_require__(1246)
  24393. const { URLSerializer } = __nccwpck_require__(685)
  24394. const { kHeadersList, kConstruct } = __nccwpck_require__(2785)
  24395. const assert = __nccwpck_require__(9491)
  24396. const { types } = __nccwpck_require__(3837)
  24397. const ReadableStream = globalThis.ReadableStream || (__nccwpck_require__(5356).ReadableStream)
  24398. const textEncoder = new TextEncoder('utf-8')
  24399. // https://fetch.spec.whatwg.org/#response-class
  24400. class Response {
  24401. // Creates network error Response.
  24402. static error () {
  24403. // TODO
  24404. const relevantRealm = { settingsObject: {} }
  24405. // The static error() method steps are to return the result of creating a
  24406. // Response object, given a new network error, "immutable", and this’s
  24407. // relevant Realm.
  24408. const responseObject = new Response()
  24409. responseObject[kState] = makeNetworkError()
  24410. responseObject[kRealm] = relevantRealm
  24411. responseObject[kHeaders][kHeadersList] = responseObject[kState].headersList
  24412. responseObject[kHeaders][kGuard] = 'immutable'
  24413. responseObject[kHeaders][kRealm] = relevantRealm
  24414. return responseObject
  24415. }
  24416. // https://fetch.spec.whatwg.org/#dom-response-json
  24417. static json (data, init = {}) {
  24418. webidl.argumentLengthCheck(arguments, 1, { header: 'Response.json' })
  24419. if (init !== null) {
  24420. init = webidl.converters.ResponseInit(init)
  24421. }
  24422. // 1. Let bytes the result of running serialize a JavaScript value to JSON bytes on data.
  24423. const bytes = textEncoder.encode(
  24424. serializeJavascriptValueToJSONString(data)
  24425. )
  24426. // 2. Let body be the result of extracting bytes.
  24427. const body = extractBody(bytes)
  24428. // 3. Let responseObject be the result of creating a Response object, given a new response,
  24429. // "response", and this’s relevant Realm.
  24430. const relevantRealm = { settingsObject: {} }
  24431. const responseObject = new Response()
  24432. responseObject[kRealm] = relevantRealm
  24433. responseObject[kHeaders][kGuard] = 'response'
  24434. responseObject[kHeaders][kRealm] = relevantRealm
  24435. // 4. Perform initialize a response given responseObject, init, and (body, "application/json").
  24436. initializeResponse(responseObject, init, { body: body[0], type: 'application/json' })
  24437. // 5. Return responseObject.
  24438. return responseObject
  24439. }
  24440. // Creates a redirect Response that redirects to url with status status.
  24441. static redirect (url, status = 302) {
  24442. const relevantRealm = { settingsObject: {} }
  24443. webidl.argumentLengthCheck(arguments, 1, { header: 'Response.redirect' })
  24444. url = webidl.converters.USVString(url)
  24445. status = webidl.converters['unsigned short'](status)
  24446. // 1. Let parsedURL be the result of parsing url with current settings
  24447. // object’s API base URL.
  24448. // 2. If parsedURL is failure, then throw a TypeError.
  24449. // TODO: base-URL?
  24450. let parsedURL
  24451. try {
  24452. parsedURL = new URL(url, getGlobalOrigin())
  24453. } catch (err) {
  24454. throw Object.assign(new TypeError('Failed to parse URL from ' + url), {
  24455. cause: err
  24456. })
  24457. }
  24458. // 3. If status is not a redirect status, then throw a RangeError.
  24459. if (!redirectStatusSet.has(status)) {
  24460. throw new RangeError('Invalid status code ' + status)
  24461. }
  24462. // 4. Let responseObject be the result of creating a Response object,
  24463. // given a new response, "immutable", and this’s relevant Realm.
  24464. const responseObject = new Response()
  24465. responseObject[kRealm] = relevantRealm
  24466. responseObject[kHeaders][kGuard] = 'immutable'
  24467. responseObject[kHeaders][kRealm] = relevantRealm
  24468. // 5. Set responseObject’s response’s status to status.
  24469. responseObject[kState].status = status
  24470. // 6. Let value be parsedURL, serialized and isomorphic encoded.
  24471. const value = isomorphicEncode(URLSerializer(parsedURL))
  24472. // 7. Append `Location`/value to responseObject’s response’s header list.
  24473. responseObject[kState].headersList.append('location', value)
  24474. // 8. Return responseObject.
  24475. return responseObject
  24476. }
  24477. // https://fetch.spec.whatwg.org/#dom-response
  24478. constructor (body = null, init = {}) {
  24479. if (body !== null) {
  24480. body = webidl.converters.BodyInit(body)
  24481. }
  24482. init = webidl.converters.ResponseInit(init)
  24483. // TODO
  24484. this[kRealm] = { settingsObject: {} }
  24485. // 1. Set this’s response to a new response.
  24486. this[kState] = makeResponse({})
  24487. // 2. Set this’s headers to a new Headers object with this’s relevant
  24488. // Realm, whose header list is this’s response’s header list and guard
  24489. // is "response".
  24490. this[kHeaders] = new Headers(kConstruct)
  24491. this[kHeaders][kGuard] = 'response'
  24492. this[kHeaders][kHeadersList] = this[kState].headersList
  24493. this[kHeaders][kRealm] = this[kRealm]
  24494. // 3. Let bodyWithType be null.
  24495. let bodyWithType = null
  24496. // 4. If body is non-null, then set bodyWithType to the result of extracting body.
  24497. if (body != null) {
  24498. const [extractedBody, type] = extractBody(body)
  24499. bodyWithType = { body: extractedBody, type }
  24500. }
  24501. // 5. Perform initialize a response given this, init, and bodyWithType.
  24502. initializeResponse(this, init, bodyWithType)
  24503. }
  24504. // Returns response’s type, e.g., "cors".
  24505. get type () {
  24506. webidl.brandCheck(this, Response)
  24507. // The type getter steps are to return this’s response’s type.
  24508. return this[kState].type
  24509. }
  24510. // Returns response’s URL, if it has one; otherwise the empty string.
  24511. get url () {
  24512. webidl.brandCheck(this, Response)
  24513. const urlList = this[kState].urlList
  24514. // The url getter steps are to return the empty string if this’s
  24515. // response’s URL is null; otherwise this’s response’s URL,
  24516. // serialized with exclude fragment set to true.
  24517. const url = urlList[urlList.length - 1] ?? null
  24518. if (url === null) {
  24519. return ''
  24520. }
  24521. return URLSerializer(url, true)
  24522. }
  24523. // Returns whether response was obtained through a redirect.
  24524. get redirected () {
  24525. webidl.brandCheck(this, Response)
  24526. // The redirected getter steps are to return true if this’s response’s URL
  24527. // list has more than one item; otherwise false.
  24528. return this[kState].urlList.length > 1
  24529. }
  24530. // Returns response’s status.
  24531. get status () {
  24532. webidl.brandCheck(this, Response)
  24533. // The status getter steps are to return this’s response’s status.
  24534. return this[kState].status
  24535. }
  24536. // Returns whether response’s status is an ok status.
  24537. get ok () {
  24538. webidl.brandCheck(this, Response)
  24539. // The ok getter steps are to return true if this’s response’s status is an
  24540. // ok status; otherwise false.
  24541. return this[kState].status >= 200 && this[kState].status <= 299
  24542. }
  24543. // Returns response’s status message.
  24544. get statusText () {
  24545. webidl.brandCheck(this, Response)
  24546. // The statusText getter steps are to return this’s response’s status
  24547. // message.
  24548. return this[kState].statusText
  24549. }
  24550. // Returns response’s headers as Headers.
  24551. get headers () {
  24552. webidl.brandCheck(this, Response)
  24553. // The headers getter steps are to return this’s headers.
  24554. return this[kHeaders]
  24555. }
  24556. get body () {
  24557. webidl.brandCheck(this, Response)
  24558. return this[kState].body ? this[kState].body.stream : null
  24559. }
  24560. get bodyUsed () {
  24561. webidl.brandCheck(this, Response)
  24562. return !!this[kState].body && util.isDisturbed(this[kState].body.stream)
  24563. }
  24564. // Returns a clone of response.
  24565. clone () {
  24566. webidl.brandCheck(this, Response)
  24567. // 1. If this is unusable, then throw a TypeError.
  24568. if (this.bodyUsed || (this.body && this.body.locked)) {
  24569. throw webidl.errors.exception({
  24570. header: 'Response.clone',
  24571. message: 'Body has already been consumed.'
  24572. })
  24573. }
  24574. // 2. Let clonedResponse be the result of cloning this’s response.
  24575. const clonedResponse = cloneResponse(this[kState])
  24576. // 3. Return the result of creating a Response object, given
  24577. // clonedResponse, this’s headers’s guard, and this’s relevant Realm.
  24578. const clonedResponseObject = new Response()
  24579. clonedResponseObject[kState] = clonedResponse
  24580. clonedResponseObject[kRealm] = this[kRealm]
  24581. clonedResponseObject[kHeaders][kHeadersList] = clonedResponse.headersList
  24582. clonedResponseObject[kHeaders][kGuard] = this[kHeaders][kGuard]
  24583. clonedResponseObject[kHeaders][kRealm] = this[kHeaders][kRealm]
  24584. return clonedResponseObject
  24585. }
  24586. }
  24587. mixinBody(Response)
  24588. Object.defineProperties(Response.prototype, {
  24589. type: kEnumerableProperty,
  24590. url: kEnumerableProperty,
  24591. status: kEnumerableProperty,
  24592. ok: kEnumerableProperty,
  24593. redirected: kEnumerableProperty,
  24594. statusText: kEnumerableProperty,
  24595. headers: kEnumerableProperty,
  24596. clone: kEnumerableProperty,
  24597. body: kEnumerableProperty,
  24598. bodyUsed: kEnumerableProperty,
  24599. [Symbol.toStringTag]: {
  24600. value: 'Response',
  24601. configurable: true
  24602. }
  24603. })
  24604. Object.defineProperties(Response, {
  24605. json: kEnumerableProperty,
  24606. redirect: kEnumerableProperty,
  24607. error: kEnumerableProperty
  24608. })
  24609. // https://fetch.spec.whatwg.org/#concept-response-clone
  24610. function cloneResponse (response) {
  24611. // To clone a response response, run these steps:
  24612. // 1. If response is a filtered response, then return a new identical
  24613. // filtered response whose internal response is a clone of response’s
  24614. // internal response.
  24615. if (response.internalResponse) {
  24616. return filterResponse(
  24617. cloneResponse(response.internalResponse),
  24618. response.type
  24619. )
  24620. }
  24621. // 2. Let newResponse be a copy of response, except for its body.
  24622. const newResponse = makeResponse({ ...response, body: null })
  24623. // 3. If response’s body is non-null, then set newResponse’s body to the
  24624. // result of cloning response’s body.
  24625. if (response.body != null) {
  24626. newResponse.body = cloneBody(response.body)
  24627. }
  24628. // 4. Return newResponse.
  24629. return newResponse
  24630. }
  24631. function makeResponse (init) {
  24632. return {
  24633. aborted: false,
  24634. rangeRequested: false,
  24635. timingAllowPassed: false,
  24636. requestIncludesCredentials: false,
  24637. type: 'default',
  24638. status: 200,
  24639. timingInfo: null,
  24640. cacheState: '',
  24641. statusText: '',
  24642. ...init,
  24643. headersList: init.headersList
  24644. ? new HeadersList(init.headersList)
  24645. : new HeadersList(),
  24646. urlList: init.urlList ? [...init.urlList] : []
  24647. }
  24648. }
  24649. function makeNetworkError (reason) {
  24650. const isError = isErrorLike(reason)
  24651. return makeResponse({
  24652. type: 'error',
  24653. status: 0,
  24654. error: isError
  24655. ? reason
  24656. : new Error(reason ? String(reason) : reason),
  24657. aborted: reason && reason.name === 'AbortError'
  24658. })
  24659. }
  24660. function makeFilteredResponse (response, state) {
  24661. state = {
  24662. internalResponse: response,
  24663. ...state
  24664. }
  24665. return new Proxy(response, {
  24666. get (target, p) {
  24667. return p in state ? state[p] : target[p]
  24668. },
  24669. set (target, p, value) {
  24670. assert(!(p in state))
  24671. target[p] = value
  24672. return true
  24673. }
  24674. })
  24675. }
  24676. // https://fetch.spec.whatwg.org/#concept-filtered-response
  24677. function filterResponse (response, type) {
  24678. // Set response to the following filtered response with response as its
  24679. // internal response, depending on request’s response tainting:
  24680. if (type === 'basic') {
  24681. // A basic filtered response is a filtered response whose type is "basic"
  24682. // and header list excludes any headers in internal response’s header list
  24683. // whose name is a forbidden response-header name.
  24684. // Note: undici does not implement forbidden response-header names
  24685. return makeFilteredResponse(response, {
  24686. type: 'basic',
  24687. headersList: response.headersList
  24688. })
  24689. } else if (type === 'cors') {
  24690. // A CORS filtered response is a filtered response whose type is "cors"
  24691. // and header list excludes any headers in internal response’s header
  24692. // list whose name is not a CORS-safelisted response-header name, given
  24693. // internal response’s CORS-exposed header-name list.
  24694. // Note: undici does not implement CORS-safelisted response-header names
  24695. return makeFilteredResponse(response, {
  24696. type: 'cors',
  24697. headersList: response.headersList
  24698. })
  24699. } else if (type === 'opaque') {
  24700. // An opaque filtered response is a filtered response whose type is
  24701. // "opaque", URL list is the empty list, status is 0, status message
  24702. // is the empty byte sequence, header list is empty, and body is null.
  24703. return makeFilteredResponse(response, {
  24704. type: 'opaque',
  24705. urlList: Object.freeze([]),
  24706. status: 0,
  24707. statusText: '',
  24708. body: null
  24709. })
  24710. } else if (type === 'opaqueredirect') {
  24711. // An opaque-redirect filtered response is a filtered response whose type
  24712. // is "opaqueredirect", status is 0, status message is the empty byte
  24713. // sequence, header list is empty, and body is null.
  24714. return makeFilteredResponse(response, {
  24715. type: 'opaqueredirect',
  24716. status: 0,
  24717. statusText: '',
  24718. headersList: [],
  24719. body: null
  24720. })
  24721. } else {
  24722. assert(false)
  24723. }
  24724. }
  24725. // https://fetch.spec.whatwg.org/#appropriate-network-error
  24726. function makeAppropriateNetworkError (fetchParams, err = null) {
  24727. // 1. Assert: fetchParams is canceled.
  24728. assert(isCancelled(fetchParams))
  24729. // 2. Return an aborted network error if fetchParams is aborted;
  24730. // otherwise return a network error.
  24731. return isAborted(fetchParams)
  24732. ? makeNetworkError(Object.assign(new DOMException('The operation was aborted.', 'AbortError'), { cause: err }))
  24733. : makeNetworkError(Object.assign(new DOMException('Request was cancelled.'), { cause: err }))
  24734. }
  24735. // https://whatpr.org/fetch/1392.html#initialize-a-response
  24736. function initializeResponse (response, init, body) {
  24737. // 1. If init["status"] is not in the range 200 to 599, inclusive, then
  24738. // throw a RangeError.
  24739. if (init.status !== null && (init.status < 200 || init.status > 599)) {
  24740. throw new RangeError('init["status"] must be in the range of 200 to 599, inclusive.')
  24741. }
  24742. // 2. If init["statusText"] does not match the reason-phrase token production,
  24743. // then throw a TypeError.
  24744. if ('statusText' in init && init.statusText != null) {
  24745. // See, https://datatracker.ietf.org/doc/html/rfc7230#section-3.1.2:
  24746. // reason-phrase = *( HTAB / SP / VCHAR / obs-text )
  24747. if (!isValidReasonPhrase(String(init.statusText))) {
  24748. throw new TypeError('Invalid statusText')
  24749. }
  24750. }
  24751. // 3. Set response’s response’s status to init["status"].
  24752. if ('status' in init && init.status != null) {
  24753. response[kState].status = init.status
  24754. }
  24755. // 4. Set response’s response’s status message to init["statusText"].
  24756. if ('statusText' in init && init.statusText != null) {
  24757. response[kState].statusText = init.statusText
  24758. }
  24759. // 5. If init["headers"] exists, then fill response’s headers with init["headers"].
  24760. if ('headers' in init && init.headers != null) {
  24761. fill(response[kHeaders], init.headers)
  24762. }
  24763. // 6. If body was given, then:
  24764. if (body) {
  24765. // 1. If response's status is a null body status, then throw a TypeError.
  24766. if (nullBodyStatus.includes(response.status)) {
  24767. throw webidl.errors.exception({
  24768. header: 'Response constructor',
  24769. message: 'Invalid response status code ' + response.status
  24770. })
  24771. }
  24772. // 2. Set response's body to body's body.
  24773. response[kState].body = body.body
  24774. // 3. If body's type is non-null and response's header list does not contain
  24775. // `Content-Type`, then append (`Content-Type`, body's type) to response's header list.
  24776. if (body.type != null && !response[kState].headersList.contains('Content-Type')) {
  24777. response[kState].headersList.append('content-type', body.type)
  24778. }
  24779. }
  24780. }
  24781. webidl.converters.ReadableStream = webidl.interfaceConverter(
  24782. ReadableStream
  24783. )
  24784. webidl.converters.FormData = webidl.interfaceConverter(
  24785. FormData
  24786. )
  24787. webidl.converters.URLSearchParams = webidl.interfaceConverter(
  24788. URLSearchParams
  24789. )
  24790. // https://fetch.spec.whatwg.org/#typedefdef-xmlhttprequestbodyinit
  24791. webidl.converters.XMLHttpRequestBodyInit = function (V) {
  24792. if (typeof V === 'string') {
  24793. return webidl.converters.USVString(V)
  24794. }
  24795. if (isBlobLike(V)) {
  24796. return webidl.converters.Blob(V, { strict: false })
  24797. }
  24798. if (types.isArrayBuffer(V) || types.isTypedArray(V) || types.isDataView(V)) {
  24799. return webidl.converters.BufferSource(V)
  24800. }
  24801. if (util.isFormDataLike(V)) {
  24802. return webidl.converters.FormData(V, { strict: false })
  24803. }
  24804. if (V instanceof URLSearchParams) {
  24805. return webidl.converters.URLSearchParams(V)
  24806. }
  24807. return webidl.converters.DOMString(V)
  24808. }
  24809. // https://fetch.spec.whatwg.org/#bodyinit
  24810. webidl.converters.BodyInit = function (V) {
  24811. if (V instanceof ReadableStream) {
  24812. return webidl.converters.ReadableStream(V)
  24813. }
  24814. // Note: the spec doesn't include async iterables,
  24815. // this is an undici extension.
  24816. if (V?.[Symbol.asyncIterator]) {
  24817. return V
  24818. }
  24819. return webidl.converters.XMLHttpRequestBodyInit(V)
  24820. }
  24821. webidl.converters.ResponseInit = webidl.dictionaryConverter([
  24822. {
  24823. key: 'status',
  24824. converter: webidl.converters['unsigned short'],
  24825. defaultValue: 200
  24826. },
  24827. {
  24828. key: 'statusText',
  24829. converter: webidl.converters.ByteString,
  24830. defaultValue: ''
  24831. },
  24832. {
  24833. key: 'headers',
  24834. converter: webidl.converters.HeadersInit
  24835. }
  24836. ])
  24837. module.exports = {
  24838. makeNetworkError,
  24839. makeResponse,
  24840. makeAppropriateNetworkError,
  24841. filterResponse,
  24842. Response,
  24843. cloneResponse
  24844. }
  24845. /***/ }),
  24846. /***/ 5861:
  24847. /***/ ((module) => {
  24848. "use strict";
  24849. module.exports = {
  24850. kUrl: Symbol('url'),
  24851. kHeaders: Symbol('headers'),
  24852. kSignal: Symbol('signal'),
  24853. kState: Symbol('state'),
  24854. kGuard: Symbol('guard'),
  24855. kRealm: Symbol('realm')
  24856. }
  24857. /***/ }),
  24858. /***/ 2538:
  24859. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  24860. "use strict";
  24861. const { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = __nccwpck_require__(1037)
  24862. const { getGlobalOrigin } = __nccwpck_require__(1246)
  24863. const { performance } = __nccwpck_require__(4074)
  24864. const { isBlobLike, toUSVString, ReadableStreamFrom } = __nccwpck_require__(3983)
  24865. const assert = __nccwpck_require__(9491)
  24866. const { isUint8Array } = __nccwpck_require__(9830)
  24867. let supportedHashes = []
  24868. // https://nodejs.org/api/crypto.html#determining-if-crypto-support-is-unavailable
  24869. /** @type {import('crypto')|undefined} */
  24870. let crypto
  24871. try {
  24872. crypto = __nccwpck_require__(6113)
  24873. const possibleRelevantHashes = ['sha256', 'sha384', 'sha512']
  24874. supportedHashes = crypto.getHashes().filter((hash) => possibleRelevantHashes.includes(hash))
  24875. /* c8 ignore next 3 */
  24876. } catch {
  24877. }
  24878. function responseURL (response) {
  24879. // https://fetch.spec.whatwg.org/#responses
  24880. // A response has an associated URL. It is a pointer to the last URL
  24881. // in response’s URL list and null if response’s URL list is empty.
  24882. const urlList = response.urlList
  24883. const length = urlList.length
  24884. return length === 0 ? null : urlList[length - 1].toString()
  24885. }
  24886. // https://fetch.spec.whatwg.org/#concept-response-location-url
  24887. function responseLocationURL (response, requestFragment) {
  24888. // 1. If response’s status is not a redirect status, then return null.
  24889. if (!redirectStatusSet.has(response.status)) {
  24890. return null
  24891. }
  24892. // 2. Let location be the result of extracting header list values given
  24893. // `Location` and response’s header list.
  24894. let location = response.headersList.get('location')
  24895. // 3. If location is a header value, then set location to the result of
  24896. // parsing location with response’s URL.
  24897. if (location !== null && isValidHeaderValue(location)) {
  24898. location = new URL(location, responseURL(response))
  24899. }
  24900. // 4. If location is a URL whose fragment is null, then set location’s
  24901. // fragment to requestFragment.
  24902. if (location && !location.hash) {
  24903. location.hash = requestFragment
  24904. }
  24905. // 5. Return location.
  24906. return location
  24907. }
  24908. /** @returns {URL} */
  24909. function requestCurrentURL (request) {
  24910. return request.urlList[request.urlList.length - 1]
  24911. }
  24912. function requestBadPort (request) {
  24913. // 1. Let url be request’s current URL.
  24914. const url = requestCurrentURL(request)
  24915. // 2. If url’s scheme is an HTTP(S) scheme and url’s port is a bad port,
  24916. // then return blocked.
  24917. if (urlIsHttpHttpsScheme(url) && badPortsSet.has(url.port)) {
  24918. return 'blocked'
  24919. }
  24920. // 3. Return allowed.
  24921. return 'allowed'
  24922. }
  24923. function isErrorLike (object) {
  24924. return object instanceof Error || (
  24925. object?.constructor?.name === 'Error' ||
  24926. object?.constructor?.name === 'DOMException'
  24927. )
  24928. }
  24929. // Check whether |statusText| is a ByteString and
  24930. // matches the Reason-Phrase token production.
  24931. // RFC 2616: https://tools.ietf.org/html/rfc2616
  24932. // RFC 7230: https://tools.ietf.org/html/rfc7230
  24933. // "reason-phrase = *( HTAB / SP / VCHAR / obs-text )"
  24934. // https://github.com/chromium/chromium/blob/94.0.4604.1/third_party/blink/renderer/core/fetch/response.cc#L116
  24935. function isValidReasonPhrase (statusText) {
  24936. for (let i = 0; i < statusText.length; ++i) {
  24937. const c = statusText.charCodeAt(i)
  24938. if (
  24939. !(
  24940. (
  24941. c === 0x09 || // HTAB
  24942. (c >= 0x20 && c <= 0x7e) || // SP / VCHAR
  24943. (c >= 0x80 && c <= 0xff)
  24944. ) // obs-text
  24945. )
  24946. ) {
  24947. return false
  24948. }
  24949. }
  24950. return true
  24951. }
  24952. /**
  24953. * @see https://tools.ietf.org/html/rfc7230#section-3.2.6
  24954. * @param {number} c
  24955. */
  24956. function isTokenCharCode (c) {
  24957. switch (c) {
  24958. case 0x22:
  24959. case 0x28:
  24960. case 0x29:
  24961. case 0x2c:
  24962. case 0x2f:
  24963. case 0x3a:
  24964. case 0x3b:
  24965. case 0x3c:
  24966. case 0x3d:
  24967. case 0x3e:
  24968. case 0x3f:
  24969. case 0x40:
  24970. case 0x5b:
  24971. case 0x5c:
  24972. case 0x5d:
  24973. case 0x7b:
  24974. case 0x7d:
  24975. // DQUOTE and "(),/:;<=>?@[\]{}"
  24976. return false
  24977. default:
  24978. // VCHAR %x21-7E
  24979. return c >= 0x21 && c <= 0x7e
  24980. }
  24981. }
  24982. /**
  24983. * @param {string} characters
  24984. */
  24985. function isValidHTTPToken (characters) {
  24986. if (characters.length === 0) {
  24987. return false
  24988. }
  24989. for (let i = 0; i < characters.length; ++i) {
  24990. if (!isTokenCharCode(characters.charCodeAt(i))) {
  24991. return false
  24992. }
  24993. }
  24994. return true
  24995. }
  24996. /**
  24997. * @see https://fetch.spec.whatwg.org/#header-name
  24998. * @param {string} potentialValue
  24999. */
  25000. function isValidHeaderName (potentialValue) {
  25001. return isValidHTTPToken(potentialValue)
  25002. }
  25003. /**
  25004. * @see https://fetch.spec.whatwg.org/#header-value
  25005. * @param {string} potentialValue
  25006. */
  25007. function isValidHeaderValue (potentialValue) {
  25008. // - Has no leading or trailing HTTP tab or space bytes.
  25009. // - Contains no 0x00 (NUL) or HTTP newline bytes.
  25010. if (
  25011. potentialValue.startsWith('\t') ||
  25012. potentialValue.startsWith(' ') ||
  25013. potentialValue.endsWith('\t') ||
  25014. potentialValue.endsWith(' ')
  25015. ) {
  25016. return false
  25017. }
  25018. if (
  25019. potentialValue.includes('\0') ||
  25020. potentialValue.includes('\r') ||
  25021. potentialValue.includes('\n')
  25022. ) {
  25023. return false
  25024. }
  25025. return true
  25026. }
  25027. // https://w3c.github.io/webappsec-referrer-policy/#set-requests-referrer-policy-on-redirect
  25028. function setRequestReferrerPolicyOnRedirect (request, actualResponse) {
  25029. // Given a request request and a response actualResponse, this algorithm
  25030. // updates request’s referrer policy according to the Referrer-Policy
  25031. // header (if any) in actualResponse.
  25032. // 1. Let policy be the result of executing § 8.1 Parse a referrer policy
  25033. // from a Referrer-Policy header on actualResponse.
  25034. // 8.1 Parse a referrer policy from a Referrer-Policy header
  25035. // 1. Let policy-tokens be the result of extracting header list values given `Referrer-Policy` and response’s header list.
  25036. const { headersList } = actualResponse
  25037. // 2. Let policy be the empty string.
  25038. // 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.
  25039. // 4. Return policy.
  25040. const policyHeader = (headersList.get('referrer-policy') ?? '').split(',')
  25041. // Note: As the referrer-policy can contain multiple policies
  25042. // separated by comma, we need to loop through all of them
  25043. // and pick the first valid one.
  25044. // Ref: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy#specify_a_fallback_policy
  25045. let policy = ''
  25046. if (policyHeader.length > 0) {
  25047. // The right-most policy takes precedence.
  25048. // The left-most policy is the fallback.
  25049. for (let i = policyHeader.length; i !== 0; i--) {
  25050. const token = policyHeader[i - 1].trim()
  25051. if (referrerPolicyTokens.has(token)) {
  25052. policy = token
  25053. break
  25054. }
  25055. }
  25056. }
  25057. // 2. If policy is not the empty string, then set request’s referrer policy to policy.
  25058. if (policy !== '') {
  25059. request.referrerPolicy = policy
  25060. }
  25061. }
  25062. // https://fetch.spec.whatwg.org/#cross-origin-resource-policy-check
  25063. function crossOriginResourcePolicyCheck () {
  25064. // TODO
  25065. return 'allowed'
  25066. }
  25067. // https://fetch.spec.whatwg.org/#concept-cors-check
  25068. function corsCheck () {
  25069. // TODO
  25070. return 'success'
  25071. }
  25072. // https://fetch.spec.whatwg.org/#concept-tao-check
  25073. function TAOCheck () {
  25074. // TODO
  25075. return 'success'
  25076. }
  25077. function appendFetchMetadata (httpRequest) {
  25078. // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-dest-header
  25079. // TODO
  25080. // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-mode-header
  25081. // 1. Assert: r’s url is a potentially trustworthy URL.
  25082. // TODO
  25083. // 2. Let header be a Structured Header whose value is a token.
  25084. let header = null
  25085. // 3. Set header’s value to r’s mode.
  25086. header = httpRequest.mode
  25087. // 4. Set a structured field value `Sec-Fetch-Mode`/header in r’s header list.
  25088. httpRequest.headersList.set('sec-fetch-mode', header)
  25089. // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-site-header
  25090. // TODO
  25091. // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-user-header
  25092. // TODO
  25093. }
  25094. // https://fetch.spec.whatwg.org/#append-a-request-origin-header
  25095. function appendRequestOriginHeader (request) {
  25096. // 1. Let serializedOrigin be the result of byte-serializing a request origin with request.
  25097. let serializedOrigin = request.origin
  25098. // 2. If request’s response tainting is "cors" or request’s mode is "websocket", then append (`Origin`, serializedOrigin) to request’s header list.
  25099. if (request.responseTainting === 'cors' || request.mode === 'websocket') {
  25100. if (serializedOrigin) {
  25101. request.headersList.append('origin', serializedOrigin)
  25102. }
  25103. // 3. Otherwise, if request’s method is neither `GET` nor `HEAD`, then:
  25104. } else if (request.method !== 'GET' && request.method !== 'HEAD') {
  25105. // 1. Switch on request’s referrer policy:
  25106. switch (request.referrerPolicy) {
  25107. case 'no-referrer':
  25108. // Set serializedOrigin to `null`.
  25109. serializedOrigin = null
  25110. break
  25111. case 'no-referrer-when-downgrade':
  25112. case 'strict-origin':
  25113. case 'strict-origin-when-cross-origin':
  25114. // 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`.
  25115. if (request.origin && urlHasHttpsScheme(request.origin) && !urlHasHttpsScheme(requestCurrentURL(request))) {
  25116. serializedOrigin = null
  25117. }
  25118. break
  25119. case 'same-origin':
  25120. // If request’s origin is not same origin with request’s current URL’s origin, then set serializedOrigin to `null`.
  25121. if (!sameOrigin(request, requestCurrentURL(request))) {
  25122. serializedOrigin = null
  25123. }
  25124. break
  25125. default:
  25126. // Do nothing.
  25127. }
  25128. if (serializedOrigin) {
  25129. // 2. Append (`Origin`, serializedOrigin) to request’s header list.
  25130. request.headersList.append('origin', serializedOrigin)
  25131. }
  25132. }
  25133. }
  25134. function coarsenedSharedCurrentTime (crossOriginIsolatedCapability) {
  25135. // TODO
  25136. return performance.now()
  25137. }
  25138. // https://fetch.spec.whatwg.org/#create-an-opaque-timing-info
  25139. function createOpaqueTimingInfo (timingInfo) {
  25140. return {
  25141. startTime: timingInfo.startTime ?? 0,
  25142. redirectStartTime: 0,
  25143. redirectEndTime: 0,
  25144. postRedirectStartTime: timingInfo.startTime ?? 0,
  25145. finalServiceWorkerStartTime: 0,
  25146. finalNetworkResponseStartTime: 0,
  25147. finalNetworkRequestStartTime: 0,
  25148. endTime: 0,
  25149. encodedBodySize: 0,
  25150. decodedBodySize: 0,
  25151. finalConnectionTimingInfo: null
  25152. }
  25153. }
  25154. // https://html.spec.whatwg.org/multipage/origin.html#policy-container
  25155. function makePolicyContainer () {
  25156. // Note: the fetch spec doesn't make use of embedder policy or CSP list
  25157. return {
  25158. referrerPolicy: 'strict-origin-when-cross-origin'
  25159. }
  25160. }
  25161. // https://html.spec.whatwg.org/multipage/origin.html#clone-a-policy-container
  25162. function clonePolicyContainer (policyContainer) {
  25163. return {
  25164. referrerPolicy: policyContainer.referrerPolicy
  25165. }
  25166. }
  25167. // https://w3c.github.io/webappsec-referrer-policy/#determine-requests-referrer
  25168. function determineRequestsReferrer (request) {
  25169. // 1. Let policy be request's referrer policy.
  25170. const policy = request.referrerPolicy
  25171. // Note: policy cannot (shouldn't) be null or an empty string.
  25172. assert(policy)
  25173. // 2. Let environment be request’s client.
  25174. let referrerSource = null
  25175. // 3. Switch on request’s referrer:
  25176. if (request.referrer === 'client') {
  25177. // Note: node isn't a browser and doesn't implement document/iframes,
  25178. // so we bypass this step and replace it with our own.
  25179. const globalOrigin = getGlobalOrigin()
  25180. if (!globalOrigin || globalOrigin.origin === 'null') {
  25181. return 'no-referrer'
  25182. }
  25183. // note: we need to clone it as it's mutated
  25184. referrerSource = new URL(globalOrigin)
  25185. } else if (request.referrer instanceof URL) {
  25186. // Let referrerSource be request’s referrer.
  25187. referrerSource = request.referrer
  25188. }
  25189. // 4. Let request’s referrerURL be the result of stripping referrerSource for
  25190. // use as a referrer.
  25191. let referrerURL = stripURLForReferrer(referrerSource)
  25192. // 5. Let referrerOrigin be the result of stripping referrerSource for use as
  25193. // a referrer, with the origin-only flag set to true.
  25194. const referrerOrigin = stripURLForReferrer(referrerSource, true)
  25195. // 6. If the result of serializing referrerURL is a string whose length is
  25196. // greater than 4096, set referrerURL to referrerOrigin.
  25197. if (referrerURL.toString().length > 4096) {
  25198. referrerURL = referrerOrigin
  25199. }
  25200. const areSameOrigin = sameOrigin(request, referrerURL)
  25201. const isNonPotentiallyTrustWorthy = isURLPotentiallyTrustworthy(referrerURL) &&
  25202. !isURLPotentiallyTrustworthy(request.url)
  25203. // 8. Execute the switch statements corresponding to the value of policy:
  25204. switch (policy) {
  25205. case 'origin': return referrerOrigin != null ? referrerOrigin : stripURLForReferrer(referrerSource, true)
  25206. case 'unsafe-url': return referrerURL
  25207. case 'same-origin':
  25208. return areSameOrigin ? referrerOrigin : 'no-referrer'
  25209. case 'origin-when-cross-origin':
  25210. return areSameOrigin ? referrerURL : referrerOrigin
  25211. case 'strict-origin-when-cross-origin': {
  25212. const currentURL = requestCurrentURL(request)
  25213. // 1. If the origin of referrerURL and the origin of request’s current
  25214. // URL are the same, then return referrerURL.
  25215. if (sameOrigin(referrerURL, currentURL)) {
  25216. return referrerURL
  25217. }
  25218. // 2. If referrerURL is a potentially trustworthy URL and request’s
  25219. // current URL is not a potentially trustworthy URL, then return no
  25220. // referrer.
  25221. if (isURLPotentiallyTrustworthy(referrerURL) && !isURLPotentiallyTrustworthy(currentURL)) {
  25222. return 'no-referrer'
  25223. }
  25224. // 3. Return referrerOrigin.
  25225. return referrerOrigin
  25226. }
  25227. case 'strict-origin': // eslint-disable-line
  25228. /**
  25229. * 1. If referrerURL is a potentially trustworthy URL and
  25230. * request’s current URL is not a potentially trustworthy URL,
  25231. * then return no referrer.
  25232. * 2. Return referrerOrigin
  25233. */
  25234. case 'no-referrer-when-downgrade': // eslint-disable-line
  25235. /**
  25236. * 1. If referrerURL is a potentially trustworthy URL and
  25237. * request’s current URL is not a potentially trustworthy URL,
  25238. * then return no referrer.
  25239. * 2. Return referrerOrigin
  25240. */
  25241. default: // eslint-disable-line
  25242. return isNonPotentiallyTrustWorthy ? 'no-referrer' : referrerOrigin
  25243. }
  25244. }
  25245. /**
  25246. * @see https://w3c.github.io/webappsec-referrer-policy/#strip-url
  25247. * @param {URL} url
  25248. * @param {boolean|undefined} originOnly
  25249. */
  25250. function stripURLForReferrer (url, originOnly) {
  25251. // 1. Assert: url is a URL.
  25252. assert(url instanceof URL)
  25253. // 2. If url’s scheme is a local scheme, then return no referrer.
  25254. if (url.protocol === 'file:' || url.protocol === 'about:' || url.protocol === 'blank:') {
  25255. return 'no-referrer'
  25256. }
  25257. // 3. Set url’s username to the empty string.
  25258. url.username = ''
  25259. // 4. Set url’s password to the empty string.
  25260. url.password = ''
  25261. // 5. Set url’s fragment to null.
  25262. url.hash = ''
  25263. // 6. If the origin-only flag is true, then:
  25264. if (originOnly) {
  25265. // 1. Set url’s path to « the empty string ».
  25266. url.pathname = ''
  25267. // 2. Set url’s query to null.
  25268. url.search = ''
  25269. }
  25270. // 7. Return url.
  25271. return url
  25272. }
  25273. function isURLPotentiallyTrustworthy (url) {
  25274. if (!(url instanceof URL)) {
  25275. return false
  25276. }
  25277. // If child of about, return true
  25278. if (url.href === 'about:blank' || url.href === 'about:srcdoc') {
  25279. return true
  25280. }
  25281. // If scheme is data, return true
  25282. if (url.protocol === 'data:') return true
  25283. // If file, return true
  25284. if (url.protocol === 'file:') return true
  25285. return isOriginPotentiallyTrustworthy(url.origin)
  25286. function isOriginPotentiallyTrustworthy (origin) {
  25287. // If origin is explicitly null, return false
  25288. if (origin == null || origin === 'null') return false
  25289. const originAsURL = new URL(origin)
  25290. // If secure, return true
  25291. if (originAsURL.protocol === 'https:' || originAsURL.protocol === 'wss:') {
  25292. return true
  25293. }
  25294. // If localhost or variants, return true
  25295. if (/^127(?:\.[0-9]+){0,2}\.[0-9]+$|^\[(?:0*:)*?:?0*1\]$/.test(originAsURL.hostname) ||
  25296. (originAsURL.hostname === 'localhost' || originAsURL.hostname.includes('localhost.')) ||
  25297. (originAsURL.hostname.endsWith('.localhost'))) {
  25298. return true
  25299. }
  25300. // If any other, return false
  25301. return false
  25302. }
  25303. }
  25304. /**
  25305. * @see https://w3c.github.io/webappsec-subresource-integrity/#does-response-match-metadatalist
  25306. * @param {Uint8Array} bytes
  25307. * @param {string} metadataList
  25308. */
  25309. function bytesMatch (bytes, metadataList) {
  25310. // If node is not built with OpenSSL support, we cannot check
  25311. // a request's integrity, so allow it by default (the spec will
  25312. // allow requests if an invalid hash is given, as precedence).
  25313. /* istanbul ignore if: only if node is built with --without-ssl */
  25314. if (crypto === undefined) {
  25315. return true
  25316. }
  25317. // 1. Let parsedMetadata be the result of parsing metadataList.
  25318. const parsedMetadata = parseMetadata(metadataList)
  25319. // 2. If parsedMetadata is no metadata, return true.
  25320. if (parsedMetadata === 'no metadata') {
  25321. return true
  25322. }
  25323. // 3. If response is not eligible for integrity validation, return false.
  25324. // TODO
  25325. // 4. If parsedMetadata is the empty set, return true.
  25326. if (parsedMetadata.length === 0) {
  25327. return true
  25328. }
  25329. // 5. Let metadata be the result of getting the strongest
  25330. // metadata from parsedMetadata.
  25331. const strongest = getStrongestMetadata(parsedMetadata)
  25332. const metadata = filterMetadataListByAlgorithm(parsedMetadata, strongest)
  25333. // 6. For each item in metadata:
  25334. for (const item of metadata) {
  25335. // 1. Let algorithm be the alg component of item.
  25336. const algorithm = item.algo
  25337. // 2. Let expectedValue be the val component of item.
  25338. const expectedValue = item.hash
  25339. // See https://github.com/web-platform-tests/wpt/commit/e4c5cc7a5e48093220528dfdd1c4012dc3837a0e
  25340. // "be liberal with padding". This is annoying, and it's not even in the spec.
  25341. // 3. Let actualValue be the result of applying algorithm to bytes.
  25342. let actualValue = crypto.createHash(algorithm).update(bytes).digest('base64')
  25343. if (actualValue[actualValue.length - 1] === '=') {
  25344. if (actualValue[actualValue.length - 2] === '=') {
  25345. actualValue = actualValue.slice(0, -2)
  25346. } else {
  25347. actualValue = actualValue.slice(0, -1)
  25348. }
  25349. }
  25350. // 4. If actualValue is a case-sensitive match for expectedValue,
  25351. // return true.
  25352. if (compareBase64Mixed(actualValue, expectedValue)) {
  25353. return true
  25354. }
  25355. }
  25356. // 7. Return false.
  25357. return false
  25358. }
  25359. // https://w3c.github.io/webappsec-subresource-integrity/#grammardef-hash-with-options
  25360. // https://www.w3.org/TR/CSP2/#source-list-syntax
  25361. // https://www.rfc-editor.org/rfc/rfc5234#appendix-B.1
  25362. const parseHashWithOptions = /(?<algo>sha256|sha384|sha512)-((?<hash>[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\s|$)( +[!-~]*)?)?/i
  25363. /**
  25364. * @see https://w3c.github.io/webappsec-subresource-integrity/#parse-metadata
  25365. * @param {string} metadata
  25366. */
  25367. function parseMetadata (metadata) {
  25368. // 1. Let result be the empty set.
  25369. /** @type {{ algo: string, hash: string }[]} */
  25370. const result = []
  25371. // 2. Let empty be equal to true.
  25372. let empty = true
  25373. // 3. For each token returned by splitting metadata on spaces:
  25374. for (const token of metadata.split(' ')) {
  25375. // 1. Set empty to false.
  25376. empty = false
  25377. // 2. Parse token as a hash-with-options.
  25378. const parsedToken = parseHashWithOptions.exec(token)
  25379. // 3. If token does not parse, continue to the next token.
  25380. if (
  25381. parsedToken === null ||
  25382. parsedToken.groups === undefined ||
  25383. parsedToken.groups.algo === undefined
  25384. ) {
  25385. // Note: Chromium blocks the request at this point, but Firefox
  25386. // gives a warning that an invalid integrity was given. The
  25387. // correct behavior is to ignore these, and subsequently not
  25388. // check the integrity of the resource.
  25389. continue
  25390. }
  25391. // 4. Let algorithm be the hash-algo component of token.
  25392. const algorithm = parsedToken.groups.algo.toLowerCase()
  25393. // 5. If algorithm is a hash function recognized by the user
  25394. // agent, add the parsed token to result.
  25395. if (supportedHashes.includes(algorithm)) {
  25396. result.push(parsedToken.groups)
  25397. }
  25398. }
  25399. // 4. Return no metadata if empty is true, otherwise return result.
  25400. if (empty === true) {
  25401. return 'no metadata'
  25402. }
  25403. return result
  25404. }
  25405. /**
  25406. * @param {{ algo: 'sha256' | 'sha384' | 'sha512' }[]} metadataList
  25407. */
  25408. function getStrongestMetadata (metadataList) {
  25409. // Let algorithm be the algo component of the first item in metadataList.
  25410. // Can be sha256
  25411. let algorithm = metadataList[0].algo
  25412. // If the algorithm is sha512, then it is the strongest
  25413. // and we can return immediately
  25414. if (algorithm[3] === '5') {
  25415. return algorithm
  25416. }
  25417. for (let i = 1; i < metadataList.length; ++i) {
  25418. const metadata = metadataList[i]
  25419. // If the algorithm is sha512, then it is the strongest
  25420. // and we can break the loop immediately
  25421. if (metadata.algo[3] === '5') {
  25422. algorithm = 'sha512'
  25423. break
  25424. // If the algorithm is sha384, then a potential sha256 or sha384 is ignored
  25425. } else if (algorithm[3] === '3') {
  25426. continue
  25427. // algorithm is sha256, check if algorithm is sha384 and if so, set it as
  25428. // the strongest
  25429. } else if (metadata.algo[3] === '3') {
  25430. algorithm = 'sha384'
  25431. }
  25432. }
  25433. return algorithm
  25434. }
  25435. function filterMetadataListByAlgorithm (metadataList, algorithm) {
  25436. if (metadataList.length === 1) {
  25437. return metadataList
  25438. }
  25439. let pos = 0
  25440. for (let i = 0; i < metadataList.length; ++i) {
  25441. if (metadataList[i].algo === algorithm) {
  25442. metadataList[pos++] = metadataList[i]
  25443. }
  25444. }
  25445. metadataList.length = pos
  25446. return metadataList
  25447. }
  25448. /**
  25449. * Compares two base64 strings, allowing for base64url
  25450. * in the second string.
  25451. *
  25452. * @param {string} actualValue always base64
  25453. * @param {string} expectedValue base64 or base64url
  25454. * @returns {boolean}
  25455. */
  25456. function compareBase64Mixed (actualValue, expectedValue) {
  25457. if (actualValue.length !== expectedValue.length) {
  25458. return false
  25459. }
  25460. for (let i = 0; i < actualValue.length; ++i) {
  25461. if (actualValue[i] !== expectedValue[i]) {
  25462. if (
  25463. (actualValue[i] === '+' && expectedValue[i] === '-') ||
  25464. (actualValue[i] === '/' && expectedValue[i] === '_')
  25465. ) {
  25466. continue
  25467. }
  25468. return false
  25469. }
  25470. }
  25471. return true
  25472. }
  25473. // https://w3c.github.io/webappsec-upgrade-insecure-requests/#upgrade-request
  25474. function tryUpgradeRequestToAPotentiallyTrustworthyURL (request) {
  25475. // TODO
  25476. }
  25477. /**
  25478. * @link {https://html.spec.whatwg.org/multipage/origin.html#same-origin}
  25479. * @param {URL} A
  25480. * @param {URL} B
  25481. */
  25482. function sameOrigin (A, B) {
  25483. // 1. If A and B are the same opaque origin, then return true.
  25484. if (A.origin === B.origin && A.origin === 'null') {
  25485. return true
  25486. }
  25487. // 2. If A and B are both tuple origins and their schemes,
  25488. // hosts, and port are identical, then return true.
  25489. if (A.protocol === B.protocol && A.hostname === B.hostname && A.port === B.port) {
  25490. return true
  25491. }
  25492. // 3. Return false.
  25493. return false
  25494. }
  25495. function createDeferredPromise () {
  25496. let res
  25497. let rej
  25498. const promise = new Promise((resolve, reject) => {
  25499. res = resolve
  25500. rej = reject
  25501. })
  25502. return { promise, resolve: res, reject: rej }
  25503. }
  25504. function isAborted (fetchParams) {
  25505. return fetchParams.controller.state === 'aborted'
  25506. }
  25507. function isCancelled (fetchParams) {
  25508. return fetchParams.controller.state === 'aborted' ||
  25509. fetchParams.controller.state === 'terminated'
  25510. }
  25511. const normalizeMethodRecord = {
  25512. delete: 'DELETE',
  25513. DELETE: 'DELETE',
  25514. get: 'GET',
  25515. GET: 'GET',
  25516. head: 'HEAD',
  25517. HEAD: 'HEAD',
  25518. options: 'OPTIONS',
  25519. OPTIONS: 'OPTIONS',
  25520. post: 'POST',
  25521. POST: 'POST',
  25522. put: 'PUT',
  25523. PUT: 'PUT'
  25524. }
  25525. // Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`.
  25526. Object.setPrototypeOf(normalizeMethodRecord, null)
  25527. /**
  25528. * @see https://fetch.spec.whatwg.org/#concept-method-normalize
  25529. * @param {string} method
  25530. */
  25531. function normalizeMethod (method) {
  25532. return normalizeMethodRecord[method.toLowerCase()] ?? method
  25533. }
  25534. // https://infra.spec.whatwg.org/#serialize-a-javascript-value-to-a-json-string
  25535. function serializeJavascriptValueToJSONString (value) {
  25536. // 1. Let result be ? Call(%JSON.stringify%, undefined, « value »).
  25537. const result = JSON.stringify(value)
  25538. // 2. If result is undefined, then throw a TypeError.
  25539. if (result === undefined) {
  25540. throw new TypeError('Value is not JSON serializable')
  25541. }
  25542. // 3. Assert: result is a string.
  25543. assert(typeof result === 'string')
  25544. // 4. Return result.
  25545. return result
  25546. }
  25547. // https://tc39.es/ecma262/#sec-%25iteratorprototype%25-object
  25548. const esIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))
  25549. /**
  25550. * @see https://webidl.spec.whatwg.org/#dfn-iterator-prototype-object
  25551. * @param {() => unknown[]} iterator
  25552. * @param {string} name name of the instance
  25553. * @param {'key'|'value'|'key+value'} kind
  25554. */
  25555. function makeIterator (iterator, name, kind) {
  25556. const object = {
  25557. index: 0,
  25558. kind,
  25559. target: iterator
  25560. }
  25561. const i = {
  25562. next () {
  25563. // 1. Let interface be the interface for which the iterator prototype object exists.
  25564. // 2. Let thisValue be the this value.
  25565. // 3. Let object be ? ToObject(thisValue).
  25566. // 4. If object is a platform object, then perform a security
  25567. // check, passing:
  25568. // 5. If object is not a default iterator object for interface,
  25569. // then throw a TypeError.
  25570. if (Object.getPrototypeOf(this) !== i) {
  25571. throw new TypeError(
  25572. `'next' called on an object that does not implement interface ${name} Iterator.`
  25573. )
  25574. }
  25575. // 6. Let index be object’s index.
  25576. // 7. Let kind be object’s kind.
  25577. // 8. Let values be object’s target's value pairs to iterate over.
  25578. const { index, kind, target } = object
  25579. const values = target()
  25580. // 9. Let len be the length of values.
  25581. const len = values.length
  25582. // 10. If index is greater than or equal to len, then return
  25583. // CreateIterResultObject(undefined, true).
  25584. if (index >= len) {
  25585. return { value: undefined, done: true }
  25586. }
  25587. // 11. Let pair be the entry in values at index index.
  25588. const pair = values[index]
  25589. // 12. Set object’s index to index + 1.
  25590. object.index = index + 1
  25591. // 13. Return the iterator result for pair and kind.
  25592. return iteratorResult(pair, kind)
  25593. },
  25594. // The class string of an iterator prototype object for a given interface is the
  25595. // result of concatenating the identifier of the interface and the string " Iterator".
  25596. [Symbol.toStringTag]: `${name} Iterator`
  25597. }
  25598. // The [[Prototype]] internal slot of an iterator prototype object must be %IteratorPrototype%.
  25599. Object.setPrototypeOf(i, esIteratorPrototype)
  25600. // esIteratorPrototype needs to be the prototype of i
  25601. // which is the prototype of an empty object. Yes, it's confusing.
  25602. return Object.setPrototypeOf({}, i)
  25603. }
  25604. // https://webidl.spec.whatwg.org/#iterator-result
  25605. function iteratorResult (pair, kind) {
  25606. let result
  25607. // 1. Let result be a value determined by the value of kind:
  25608. switch (kind) {
  25609. case 'key': {
  25610. // 1. Let idlKey be pair’s key.
  25611. // 2. Let key be the result of converting idlKey to an
  25612. // ECMAScript value.
  25613. // 3. result is key.
  25614. result = pair[0]
  25615. break
  25616. }
  25617. case 'value': {
  25618. // 1. Let idlValue be pair’s value.
  25619. // 2. Let value be the result of converting idlValue to
  25620. // an ECMAScript value.
  25621. // 3. result is value.
  25622. result = pair[1]
  25623. break
  25624. }
  25625. case 'key+value': {
  25626. // 1. Let idlKey be pair’s key.
  25627. // 2. Let idlValue be pair’s value.
  25628. // 3. Let key be the result of converting idlKey to an
  25629. // ECMAScript value.
  25630. // 4. Let value be the result of converting idlValue to
  25631. // an ECMAScript value.
  25632. // 5. Let array be ! ArrayCreate(2).
  25633. // 6. Call ! CreateDataProperty(array, "0", key).
  25634. // 7. Call ! CreateDataProperty(array, "1", value).
  25635. // 8. result is array.
  25636. result = pair
  25637. break
  25638. }
  25639. }
  25640. // 2. Return CreateIterResultObject(result, false).
  25641. return { value: result, done: false }
  25642. }
  25643. /**
  25644. * @see https://fetch.spec.whatwg.org/#body-fully-read
  25645. */
  25646. async function fullyReadBody (body, processBody, processBodyError) {
  25647. // 1. If taskDestination is null, then set taskDestination to
  25648. // the result of starting a new parallel queue.
  25649. // 2. Let successSteps given a byte sequence bytes be to queue a
  25650. // fetch task to run processBody given bytes, with taskDestination.
  25651. const successSteps = processBody
  25652. // 3. Let errorSteps be to queue a fetch task to run processBodyError,
  25653. // with taskDestination.
  25654. const errorSteps = processBodyError
  25655. // 4. Let reader be the result of getting a reader for body’s stream.
  25656. // If that threw an exception, then run errorSteps with that
  25657. // exception and return.
  25658. let reader
  25659. try {
  25660. reader = body.stream.getReader()
  25661. } catch (e) {
  25662. errorSteps(e)
  25663. return
  25664. }
  25665. // 5. Read all bytes from reader, given successSteps and errorSteps.
  25666. try {
  25667. const result = await readAllBytes(reader)
  25668. successSteps(result)
  25669. } catch (e) {
  25670. errorSteps(e)
  25671. }
  25672. }
  25673. /** @type {ReadableStream} */
  25674. let ReadableStream = globalThis.ReadableStream
  25675. function isReadableStreamLike (stream) {
  25676. if (!ReadableStream) {
  25677. ReadableStream = (__nccwpck_require__(5356).ReadableStream)
  25678. }
  25679. return stream instanceof ReadableStream || (
  25680. stream[Symbol.toStringTag] === 'ReadableStream' &&
  25681. typeof stream.tee === 'function'
  25682. )
  25683. }
  25684. const MAXIMUM_ARGUMENT_LENGTH = 65535
  25685. /**
  25686. * @see https://infra.spec.whatwg.org/#isomorphic-decode
  25687. * @param {number[]|Uint8Array} input
  25688. */
  25689. function isomorphicDecode (input) {
  25690. // 1. To isomorphic decode a byte sequence input, return a string whose code point
  25691. // length is equal to input’s length and whose code points have the same values
  25692. // as the values of input’s bytes, in the same order.
  25693. if (input.length < MAXIMUM_ARGUMENT_LENGTH) {
  25694. return String.fromCharCode(...input)
  25695. }
  25696. return input.reduce((previous, current) => previous + String.fromCharCode(current), '')
  25697. }
  25698. /**
  25699. * @param {ReadableStreamController<Uint8Array>} controller
  25700. */
  25701. function readableStreamClose (controller) {
  25702. try {
  25703. controller.close()
  25704. } catch (err) {
  25705. // TODO: add comment explaining why this error occurs.
  25706. if (!err.message.includes('Controller is already closed')) {
  25707. throw err
  25708. }
  25709. }
  25710. }
  25711. /**
  25712. * @see https://infra.spec.whatwg.org/#isomorphic-encode
  25713. * @param {string} input
  25714. */
  25715. function isomorphicEncode (input) {
  25716. // 1. Assert: input contains no code points greater than U+00FF.
  25717. for (let i = 0; i < input.length; i++) {
  25718. assert(input.charCodeAt(i) <= 0xFF)
  25719. }
  25720. // 2. Return a byte sequence whose length is equal to input’s code
  25721. // point length and whose bytes have the same values as the
  25722. // values of input’s code points, in the same order
  25723. return input
  25724. }
  25725. /**
  25726. * @see https://streams.spec.whatwg.org/#readablestreamdefaultreader-read-all-bytes
  25727. * @see https://streams.spec.whatwg.org/#read-loop
  25728. * @param {ReadableStreamDefaultReader} reader
  25729. */
  25730. async function readAllBytes (reader) {
  25731. const bytes = []
  25732. let byteLength = 0
  25733. while (true) {
  25734. const { done, value: chunk } = await reader.read()
  25735. if (done) {
  25736. // 1. Call successSteps with bytes.
  25737. return Buffer.concat(bytes, byteLength)
  25738. }
  25739. // 1. If chunk is not a Uint8Array object, call failureSteps
  25740. // with a TypeError and abort these steps.
  25741. if (!isUint8Array(chunk)) {
  25742. throw new TypeError('Received non-Uint8Array chunk')
  25743. }
  25744. // 2. Append the bytes represented by chunk to bytes.
  25745. bytes.push(chunk)
  25746. byteLength += chunk.length
  25747. // 3. Read-loop given reader, bytes, successSteps, and failureSteps.
  25748. }
  25749. }
  25750. /**
  25751. * @see https://fetch.spec.whatwg.org/#is-local
  25752. * @param {URL} url
  25753. */
  25754. function urlIsLocal (url) {
  25755. assert('protocol' in url) // ensure it's a url object
  25756. const protocol = url.protocol
  25757. return protocol === 'about:' || protocol === 'blob:' || protocol === 'data:'
  25758. }
  25759. /**
  25760. * @param {string|URL} url
  25761. */
  25762. function urlHasHttpsScheme (url) {
  25763. if (typeof url === 'string') {
  25764. return url.startsWith('https:')
  25765. }
  25766. return url.protocol === 'https:'
  25767. }
  25768. /**
  25769. * @see https://fetch.spec.whatwg.org/#http-scheme
  25770. * @param {URL} url
  25771. */
  25772. function urlIsHttpHttpsScheme (url) {
  25773. assert('protocol' in url) // ensure it's a url object
  25774. const protocol = url.protocol
  25775. return protocol === 'http:' || protocol === 'https:'
  25776. }
  25777. /**
  25778. * Fetch supports node >= 16.8.0, but Object.hasOwn was added in v16.9.0.
  25779. */
  25780. const hasOwn = Object.hasOwn || ((dict, key) => Object.prototype.hasOwnProperty.call(dict, key))
  25781. module.exports = {
  25782. isAborted,
  25783. isCancelled,
  25784. createDeferredPromise,
  25785. ReadableStreamFrom,
  25786. toUSVString,
  25787. tryUpgradeRequestToAPotentiallyTrustworthyURL,
  25788. coarsenedSharedCurrentTime,
  25789. determineRequestsReferrer,
  25790. makePolicyContainer,
  25791. clonePolicyContainer,
  25792. appendFetchMetadata,
  25793. appendRequestOriginHeader,
  25794. TAOCheck,
  25795. corsCheck,
  25796. crossOriginResourcePolicyCheck,
  25797. createOpaqueTimingInfo,
  25798. setRequestReferrerPolicyOnRedirect,
  25799. isValidHTTPToken,
  25800. requestBadPort,
  25801. requestCurrentURL,
  25802. responseURL,
  25803. responseLocationURL,
  25804. isBlobLike,
  25805. isURLPotentiallyTrustworthy,
  25806. isValidReasonPhrase,
  25807. sameOrigin,
  25808. normalizeMethod,
  25809. serializeJavascriptValueToJSONString,
  25810. makeIterator,
  25811. isValidHeaderName,
  25812. isValidHeaderValue,
  25813. hasOwn,
  25814. isErrorLike,
  25815. fullyReadBody,
  25816. bytesMatch,
  25817. isReadableStreamLike,
  25818. readableStreamClose,
  25819. isomorphicEncode,
  25820. isomorphicDecode,
  25821. urlIsLocal,
  25822. urlHasHttpsScheme,
  25823. urlIsHttpHttpsScheme,
  25824. readAllBytes,
  25825. normalizeMethodRecord,
  25826. parseMetadata
  25827. }
  25828. /***/ }),
  25829. /***/ 1744:
  25830. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  25831. "use strict";
  25832. const { types } = __nccwpck_require__(3837)
  25833. const { hasOwn, toUSVString } = __nccwpck_require__(2538)
  25834. /** @type {import('../../types/webidl').Webidl} */
  25835. const webidl = {}
  25836. webidl.converters = {}
  25837. webidl.util = {}
  25838. webidl.errors = {}
  25839. webidl.errors.exception = function (message) {
  25840. return new TypeError(`${message.header}: ${message.message}`)
  25841. }
  25842. webidl.errors.conversionFailed = function (context) {
  25843. const plural = context.types.length === 1 ? '' : ' one of'
  25844. const message =
  25845. `${context.argument} could not be converted to` +
  25846. `${plural}: ${context.types.join(', ')}.`
  25847. return webidl.errors.exception({
  25848. header: context.prefix,
  25849. message
  25850. })
  25851. }
  25852. webidl.errors.invalidArgument = function (context) {
  25853. return webidl.errors.exception({
  25854. header: context.prefix,
  25855. message: `"${context.value}" is an invalid ${context.type}.`
  25856. })
  25857. }
  25858. // https://webidl.spec.whatwg.org/#implements
  25859. webidl.brandCheck = function (V, I, opts = undefined) {
  25860. if (opts?.strict !== false && !(V instanceof I)) {
  25861. throw new TypeError('Illegal invocation')
  25862. } else {
  25863. return V?.[Symbol.toStringTag] === I.prototype[Symbol.toStringTag]
  25864. }
  25865. }
  25866. webidl.argumentLengthCheck = function ({ length }, min, ctx) {
  25867. if (length < min) {
  25868. throw webidl.errors.exception({
  25869. message: `${min} argument${min !== 1 ? 's' : ''} required, ` +
  25870. `but${length ? ' only' : ''} ${length} found.`,
  25871. ...ctx
  25872. })
  25873. }
  25874. }
  25875. webidl.illegalConstructor = function () {
  25876. throw webidl.errors.exception({
  25877. header: 'TypeError',
  25878. message: 'Illegal constructor'
  25879. })
  25880. }
  25881. // https://tc39.es/ecma262/#sec-ecmascript-data-types-and-values
  25882. webidl.util.Type = function (V) {
  25883. switch (typeof V) {
  25884. case 'undefined': return 'Undefined'
  25885. case 'boolean': return 'Boolean'
  25886. case 'string': return 'String'
  25887. case 'symbol': return 'Symbol'
  25888. case 'number': return 'Number'
  25889. case 'bigint': return 'BigInt'
  25890. case 'function':
  25891. case 'object': {
  25892. if (V === null) {
  25893. return 'Null'
  25894. }
  25895. return 'Object'
  25896. }
  25897. }
  25898. }
  25899. // https://webidl.spec.whatwg.org/#abstract-opdef-converttoint
  25900. webidl.util.ConvertToInt = function (V, bitLength, signedness, opts = {}) {
  25901. let upperBound
  25902. let lowerBound
  25903. // 1. If bitLength is 64, then:
  25904. if (bitLength === 64) {
  25905. // 1. Let upperBound be 2^53 − 1.
  25906. upperBound = Math.pow(2, 53) - 1
  25907. // 2. If signedness is "unsigned", then let lowerBound be 0.
  25908. if (signedness === 'unsigned') {
  25909. lowerBound = 0
  25910. } else {
  25911. // 3. Otherwise let lowerBound be −2^53 + 1.
  25912. lowerBound = Math.pow(-2, 53) + 1
  25913. }
  25914. } else if (signedness === 'unsigned') {
  25915. // 2. Otherwise, if signedness is "unsigned", then:
  25916. // 1. Let lowerBound be 0.
  25917. lowerBound = 0
  25918. // 2. Let upperBound be 2^bitLength − 1.
  25919. upperBound = Math.pow(2, bitLength) - 1
  25920. } else {
  25921. // 3. Otherwise:
  25922. // 1. Let lowerBound be -2^bitLength − 1.
  25923. lowerBound = Math.pow(-2, bitLength) - 1
  25924. // 2. Let upperBound be 2^bitLength − 1 − 1.
  25925. upperBound = Math.pow(2, bitLength - 1) - 1
  25926. }
  25927. // 4. Let x be ? ToNumber(V).
  25928. let x = Number(V)
  25929. // 5. If x is −0, then set x to +0.
  25930. if (x === 0) {
  25931. x = 0
  25932. }
  25933. // 6. If the conversion is to an IDL type associated
  25934. // with the [EnforceRange] extended attribute, then:
  25935. if (opts.enforceRange === true) {
  25936. // 1. If x is NaN, +∞, or −∞, then throw a TypeError.
  25937. if (
  25938. Number.isNaN(x) ||
  25939. x === Number.POSITIVE_INFINITY ||
  25940. x === Number.NEGATIVE_INFINITY
  25941. ) {
  25942. throw webidl.errors.exception({
  25943. header: 'Integer conversion',
  25944. message: `Could not convert ${V} to an integer.`
  25945. })
  25946. }
  25947. // 2. Set x to IntegerPart(x).
  25948. x = webidl.util.IntegerPart(x)
  25949. // 3. If x < lowerBound or x > upperBound, then
  25950. // throw a TypeError.
  25951. if (x < lowerBound || x > upperBound) {
  25952. throw webidl.errors.exception({
  25953. header: 'Integer conversion',
  25954. message: `Value must be between ${lowerBound}-${upperBound}, got ${x}.`
  25955. })
  25956. }
  25957. // 4. Return x.
  25958. return x
  25959. }
  25960. // 7. If x is not NaN and the conversion is to an IDL
  25961. // type associated with the [Clamp] extended
  25962. // attribute, then:
  25963. if (!Number.isNaN(x) && opts.clamp === true) {
  25964. // 1. Set x to min(max(x, lowerBound), upperBound).
  25965. x = Math.min(Math.max(x, lowerBound), upperBound)
  25966. // 2. Round x to the nearest integer, choosing the
  25967. // even integer if it lies halfway between two,
  25968. // and choosing +0 rather than −0.
  25969. if (Math.floor(x) % 2 === 0) {
  25970. x = Math.floor(x)
  25971. } else {
  25972. x = Math.ceil(x)
  25973. }
  25974. // 3. Return x.
  25975. return x
  25976. }
  25977. // 8. If x is NaN, +0, +∞, or −∞, then return +0.
  25978. if (
  25979. Number.isNaN(x) ||
  25980. (x === 0 && Object.is(0, x)) ||
  25981. x === Number.POSITIVE_INFINITY ||
  25982. x === Number.NEGATIVE_INFINITY
  25983. ) {
  25984. return 0
  25985. }
  25986. // 9. Set x to IntegerPart(x).
  25987. x = webidl.util.IntegerPart(x)
  25988. // 10. Set x to x modulo 2^bitLength.
  25989. x = x % Math.pow(2, bitLength)
  25990. // 11. If signedness is "signed" and x ≥ 2^bitLength − 1,
  25991. // then return x − 2^bitLength.
  25992. if (signedness === 'signed' && x >= Math.pow(2, bitLength) - 1) {
  25993. return x - Math.pow(2, bitLength)
  25994. }
  25995. // 12. Otherwise, return x.
  25996. return x
  25997. }
  25998. // https://webidl.spec.whatwg.org/#abstract-opdef-integerpart
  25999. webidl.util.IntegerPart = function (n) {
  26000. // 1. Let r be floor(abs(n)).
  26001. const r = Math.floor(Math.abs(n))
  26002. // 2. If n < 0, then return -1 × r.
  26003. if (n < 0) {
  26004. return -1 * r
  26005. }
  26006. // 3. Otherwise, return r.
  26007. return r
  26008. }
  26009. // https://webidl.spec.whatwg.org/#es-sequence
  26010. webidl.sequenceConverter = function (converter) {
  26011. return (V) => {
  26012. // 1. If Type(V) is not Object, throw a TypeError.
  26013. if (webidl.util.Type(V) !== 'Object') {
  26014. throw webidl.errors.exception({
  26015. header: 'Sequence',
  26016. message: `Value of type ${webidl.util.Type(V)} is not an Object.`
  26017. })
  26018. }
  26019. // 2. Let method be ? GetMethod(V, @@iterator).
  26020. /** @type {Generator} */
  26021. const method = V?.[Symbol.iterator]?.()
  26022. const seq = []
  26023. // 3. If method is undefined, throw a TypeError.
  26024. if (
  26025. method === undefined ||
  26026. typeof method.next !== 'function'
  26027. ) {
  26028. throw webidl.errors.exception({
  26029. header: 'Sequence',
  26030. message: 'Object is not an iterator.'
  26031. })
  26032. }
  26033. // https://webidl.spec.whatwg.org/#create-sequence-from-iterable
  26034. while (true) {
  26035. const { done, value } = method.next()
  26036. if (done) {
  26037. break
  26038. }
  26039. seq.push(converter(value))
  26040. }
  26041. return seq
  26042. }
  26043. }
  26044. // https://webidl.spec.whatwg.org/#es-to-record
  26045. webidl.recordConverter = function (keyConverter, valueConverter) {
  26046. return (O) => {
  26047. // 1. If Type(O) is not Object, throw a TypeError.
  26048. if (webidl.util.Type(O) !== 'Object') {
  26049. throw webidl.errors.exception({
  26050. header: 'Record',
  26051. message: `Value of type ${webidl.util.Type(O)} is not an Object.`
  26052. })
  26053. }
  26054. // 2. Let result be a new empty instance of record<K, V>.
  26055. const result = {}
  26056. if (!types.isProxy(O)) {
  26057. // Object.keys only returns enumerable properties
  26058. const keys = Object.keys(O)
  26059. for (const key of keys) {
  26060. // 1. Let typedKey be key converted to an IDL value of type K.
  26061. const typedKey = keyConverter(key)
  26062. // 2. Let value be ? Get(O, key).
  26063. // 3. Let typedValue be value converted to an IDL value of type V.
  26064. const typedValue = valueConverter(O[key])
  26065. // 4. Set result[typedKey] to typedValue.
  26066. result[typedKey] = typedValue
  26067. }
  26068. // 5. Return result.
  26069. return result
  26070. }
  26071. // 3. Let keys be ? O.[[OwnPropertyKeys]]().
  26072. const keys = Reflect.ownKeys(O)
  26073. // 4. For each key of keys.
  26074. for (const key of keys) {
  26075. // 1. Let desc be ? O.[[GetOwnProperty]](key).
  26076. const desc = Reflect.getOwnPropertyDescriptor(O, key)
  26077. // 2. If desc is not undefined and desc.[[Enumerable]] is true:
  26078. if (desc?.enumerable) {
  26079. // 1. Let typedKey be key converted to an IDL value of type K.
  26080. const typedKey = keyConverter(key)
  26081. // 2. Let value be ? Get(O, key).
  26082. // 3. Let typedValue be value converted to an IDL value of type V.
  26083. const typedValue = valueConverter(O[key])
  26084. // 4. Set result[typedKey] to typedValue.
  26085. result[typedKey] = typedValue
  26086. }
  26087. }
  26088. // 5. Return result.
  26089. return result
  26090. }
  26091. }
  26092. webidl.interfaceConverter = function (i) {
  26093. return (V, opts = {}) => {
  26094. if (opts.strict !== false && !(V instanceof i)) {
  26095. throw webidl.errors.exception({
  26096. header: i.name,
  26097. message: `Expected ${V} to be an instance of ${i.name}.`
  26098. })
  26099. }
  26100. return V
  26101. }
  26102. }
  26103. webidl.dictionaryConverter = function (converters) {
  26104. return (dictionary) => {
  26105. const type = webidl.util.Type(dictionary)
  26106. const dict = {}
  26107. if (type === 'Null' || type === 'Undefined') {
  26108. return dict
  26109. } else if (type !== 'Object') {
  26110. throw webidl.errors.exception({
  26111. header: 'Dictionary',
  26112. message: `Expected ${dictionary} to be one of: Null, Undefined, Object.`
  26113. })
  26114. }
  26115. for (const options of converters) {
  26116. const { key, defaultValue, required, converter } = options
  26117. if (required === true) {
  26118. if (!hasOwn(dictionary, key)) {
  26119. throw webidl.errors.exception({
  26120. header: 'Dictionary',
  26121. message: `Missing required key "${key}".`
  26122. })
  26123. }
  26124. }
  26125. let value = dictionary[key]
  26126. const hasDefault = hasOwn(options, 'defaultValue')
  26127. // Only use defaultValue if value is undefined and
  26128. // a defaultValue options was provided.
  26129. if (hasDefault && value !== null) {
  26130. value = value ?? defaultValue
  26131. }
  26132. // A key can be optional and have no default value.
  26133. // When this happens, do not perform a conversion,
  26134. // and do not assign the key a value.
  26135. if (required || hasDefault || value !== undefined) {
  26136. value = converter(value)
  26137. if (
  26138. options.allowedValues &&
  26139. !options.allowedValues.includes(value)
  26140. ) {
  26141. throw webidl.errors.exception({
  26142. header: 'Dictionary',
  26143. message: `${value} is not an accepted type. Expected one of ${options.allowedValues.join(', ')}.`
  26144. })
  26145. }
  26146. dict[key] = value
  26147. }
  26148. }
  26149. return dict
  26150. }
  26151. }
  26152. webidl.nullableConverter = function (converter) {
  26153. return (V) => {
  26154. if (V === null) {
  26155. return V
  26156. }
  26157. return converter(V)
  26158. }
  26159. }
  26160. // https://webidl.spec.whatwg.org/#es-DOMString
  26161. webidl.converters.DOMString = function (V, opts = {}) {
  26162. // 1. If V is null and the conversion is to an IDL type
  26163. // associated with the [LegacyNullToEmptyString]
  26164. // extended attribute, then return the DOMString value
  26165. // that represents the empty string.
  26166. if (V === null && opts.legacyNullToEmptyString) {
  26167. return ''
  26168. }
  26169. // 2. Let x be ? ToString(V).
  26170. if (typeof V === 'symbol') {
  26171. throw new TypeError('Could not convert argument of type symbol to string.')
  26172. }
  26173. // 3. Return the IDL DOMString value that represents the
  26174. // same sequence of code units as the one the
  26175. // ECMAScript String value x represents.
  26176. return String(V)
  26177. }
  26178. // https://webidl.spec.whatwg.org/#es-ByteString
  26179. webidl.converters.ByteString = function (V) {
  26180. // 1. Let x be ? ToString(V).
  26181. // Note: DOMString converter perform ? ToString(V)
  26182. const x = webidl.converters.DOMString(V)
  26183. // 2. If the value of any element of x is greater than
  26184. // 255, then throw a TypeError.
  26185. for (let index = 0; index < x.length; index++) {
  26186. if (x.charCodeAt(index) > 255) {
  26187. throw new TypeError(
  26188. 'Cannot convert argument to a ByteString because the character at ' +
  26189. `index ${index} has a value of ${x.charCodeAt(index)} which is greater than 255.`
  26190. )
  26191. }
  26192. }
  26193. // 3. Return an IDL ByteString value whose length is the
  26194. // length of x, and where the value of each element is
  26195. // the value of the corresponding element of x.
  26196. return x
  26197. }
  26198. // https://webidl.spec.whatwg.org/#es-USVString
  26199. webidl.converters.USVString = toUSVString
  26200. // https://webidl.spec.whatwg.org/#es-boolean
  26201. webidl.converters.boolean = function (V) {
  26202. // 1. Let x be the result of computing ToBoolean(V).
  26203. const x = Boolean(V)
  26204. // 2. Return the IDL boolean value that is the one that represents
  26205. // the same truth value as the ECMAScript Boolean value x.
  26206. return x
  26207. }
  26208. // https://webidl.spec.whatwg.org/#es-any
  26209. webidl.converters.any = function (V) {
  26210. return V
  26211. }
  26212. // https://webidl.spec.whatwg.org/#es-long-long
  26213. webidl.converters['long long'] = function (V) {
  26214. // 1. Let x be ? ConvertToInt(V, 64, "signed").
  26215. const x = webidl.util.ConvertToInt(V, 64, 'signed')
  26216. // 2. Return the IDL long long value that represents
  26217. // the same numeric value as x.
  26218. return x
  26219. }
  26220. // https://webidl.spec.whatwg.org/#es-unsigned-long-long
  26221. webidl.converters['unsigned long long'] = function (V) {
  26222. // 1. Let x be ? ConvertToInt(V, 64, "unsigned").
  26223. const x = webidl.util.ConvertToInt(V, 64, 'unsigned')
  26224. // 2. Return the IDL unsigned long long value that
  26225. // represents the same numeric value as x.
  26226. return x
  26227. }
  26228. // https://webidl.spec.whatwg.org/#es-unsigned-long
  26229. webidl.converters['unsigned long'] = function (V) {
  26230. // 1. Let x be ? ConvertToInt(V, 32, "unsigned").
  26231. const x = webidl.util.ConvertToInt(V, 32, 'unsigned')
  26232. // 2. Return the IDL unsigned long value that
  26233. // represents the same numeric value as x.
  26234. return x
  26235. }
  26236. // https://webidl.spec.whatwg.org/#es-unsigned-short
  26237. webidl.converters['unsigned short'] = function (V, opts) {
  26238. // 1. Let x be ? ConvertToInt(V, 16, "unsigned").
  26239. const x = webidl.util.ConvertToInt(V, 16, 'unsigned', opts)
  26240. // 2. Return the IDL unsigned short value that represents
  26241. // the same numeric value as x.
  26242. return x
  26243. }
  26244. // https://webidl.spec.whatwg.org/#idl-ArrayBuffer
  26245. webidl.converters.ArrayBuffer = function (V, opts = {}) {
  26246. // 1. If Type(V) is not Object, or V does not have an
  26247. // [[ArrayBufferData]] internal slot, then throw a
  26248. // TypeError.
  26249. // see: https://tc39.es/ecma262/#sec-properties-of-the-arraybuffer-instances
  26250. // see: https://tc39.es/ecma262/#sec-properties-of-the-sharedarraybuffer-instances
  26251. if (
  26252. webidl.util.Type(V) !== 'Object' ||
  26253. !types.isAnyArrayBuffer(V)
  26254. ) {
  26255. throw webidl.errors.conversionFailed({
  26256. prefix: `${V}`,
  26257. argument: `${V}`,
  26258. types: ['ArrayBuffer']
  26259. })
  26260. }
  26261. // 2. If the conversion is not to an IDL type associated
  26262. // with the [AllowShared] extended attribute, and
  26263. // IsSharedArrayBuffer(V) is true, then throw a
  26264. // TypeError.
  26265. if (opts.allowShared === false && types.isSharedArrayBuffer(V)) {
  26266. throw webidl.errors.exception({
  26267. header: 'ArrayBuffer',
  26268. message: 'SharedArrayBuffer is not allowed.'
  26269. })
  26270. }
  26271. // 3. If the conversion is not to an IDL type associated
  26272. // with the [AllowResizable] extended attribute, and
  26273. // IsResizableArrayBuffer(V) is true, then throw a
  26274. // TypeError.
  26275. // Note: resizable ArrayBuffers are currently a proposal.
  26276. // 4. Return the IDL ArrayBuffer value that is a
  26277. // reference to the same object as V.
  26278. return V
  26279. }
  26280. webidl.converters.TypedArray = function (V, T, opts = {}) {
  26281. // 1. Let T be the IDL type V is being converted to.
  26282. // 2. If Type(V) is not Object, or V does not have a
  26283. // [[TypedArrayName]] internal slot with a value
  26284. // equal to T’s name, then throw a TypeError.
  26285. if (
  26286. webidl.util.Type(V) !== 'Object' ||
  26287. !types.isTypedArray(V) ||
  26288. V.constructor.name !== T.name
  26289. ) {
  26290. throw webidl.errors.conversionFailed({
  26291. prefix: `${T.name}`,
  26292. argument: `${V}`,
  26293. types: [T.name]
  26294. })
  26295. }
  26296. // 3. If the conversion is not to an IDL type associated
  26297. // with the [AllowShared] extended attribute, and
  26298. // IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is
  26299. // true, then throw a TypeError.
  26300. if (opts.allowShared === false && types.isSharedArrayBuffer(V.buffer)) {
  26301. throw webidl.errors.exception({
  26302. header: 'ArrayBuffer',
  26303. message: 'SharedArrayBuffer is not allowed.'
  26304. })
  26305. }
  26306. // 4. If the conversion is not to an IDL type associated
  26307. // with the [AllowResizable] extended attribute, and
  26308. // IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is
  26309. // true, then throw a TypeError.
  26310. // Note: resizable array buffers are currently a proposal
  26311. // 5. Return the IDL value of type T that is a reference
  26312. // to the same object as V.
  26313. return V
  26314. }
  26315. webidl.converters.DataView = function (V, opts = {}) {
  26316. // 1. If Type(V) is not Object, or V does not have a
  26317. // [[DataView]] internal slot, then throw a TypeError.
  26318. if (webidl.util.Type(V) !== 'Object' || !types.isDataView(V)) {
  26319. throw webidl.errors.exception({
  26320. header: 'DataView',
  26321. message: 'Object is not a DataView.'
  26322. })
  26323. }
  26324. // 2. If the conversion is not to an IDL type associated
  26325. // with the [AllowShared] extended attribute, and
  26326. // IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is true,
  26327. // then throw a TypeError.
  26328. if (opts.allowShared === false && types.isSharedArrayBuffer(V.buffer)) {
  26329. throw webidl.errors.exception({
  26330. header: 'ArrayBuffer',
  26331. message: 'SharedArrayBuffer is not allowed.'
  26332. })
  26333. }
  26334. // 3. If the conversion is not to an IDL type associated
  26335. // with the [AllowResizable] extended attribute, and
  26336. // IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is
  26337. // true, then throw a TypeError.
  26338. // Note: resizable ArrayBuffers are currently a proposal
  26339. // 4. Return the IDL DataView value that is a reference
  26340. // to the same object as V.
  26341. return V
  26342. }
  26343. // https://webidl.spec.whatwg.org/#BufferSource
  26344. webidl.converters.BufferSource = function (V, opts = {}) {
  26345. if (types.isAnyArrayBuffer(V)) {
  26346. return webidl.converters.ArrayBuffer(V, opts)
  26347. }
  26348. if (types.isTypedArray(V)) {
  26349. return webidl.converters.TypedArray(V, V.constructor)
  26350. }
  26351. if (types.isDataView(V)) {
  26352. return webidl.converters.DataView(V, opts)
  26353. }
  26354. throw new TypeError(`Could not convert ${V} to a BufferSource.`)
  26355. }
  26356. webidl.converters['sequence<ByteString>'] = webidl.sequenceConverter(
  26357. webidl.converters.ByteString
  26358. )
  26359. webidl.converters['sequence<sequence<ByteString>>'] = webidl.sequenceConverter(
  26360. webidl.converters['sequence<ByteString>']
  26361. )
  26362. webidl.converters['record<ByteString, ByteString>'] = webidl.recordConverter(
  26363. webidl.converters.ByteString,
  26364. webidl.converters.ByteString
  26365. )
  26366. module.exports = {
  26367. webidl
  26368. }
  26369. /***/ }),
  26370. /***/ 4854:
  26371. /***/ ((module) => {
  26372. "use strict";
  26373. /**
  26374. * @see https://encoding.spec.whatwg.org/#concept-encoding-get
  26375. * @param {string|undefined} label
  26376. */
  26377. function getEncoding (label) {
  26378. if (!label) {
  26379. return 'failure'
  26380. }
  26381. // 1. Remove any leading and trailing ASCII whitespace from label.
  26382. // 2. If label is an ASCII case-insensitive match for any of the
  26383. // labels listed in the table below, then return the
  26384. // corresponding encoding; otherwise return failure.
  26385. switch (label.trim().toLowerCase()) {
  26386. case 'unicode-1-1-utf-8':
  26387. case 'unicode11utf8':
  26388. case 'unicode20utf8':
  26389. case 'utf-8':
  26390. case 'utf8':
  26391. case 'x-unicode20utf8':
  26392. return 'UTF-8'
  26393. case '866':
  26394. case 'cp866':
  26395. case 'csibm866':
  26396. case 'ibm866':
  26397. return 'IBM866'
  26398. case 'csisolatin2':
  26399. case 'iso-8859-2':
  26400. case 'iso-ir-101':
  26401. case 'iso8859-2':
  26402. case 'iso88592':
  26403. case 'iso_8859-2':
  26404. case 'iso_8859-2:1987':
  26405. case 'l2':
  26406. case 'latin2':
  26407. return 'ISO-8859-2'
  26408. case 'csisolatin3':
  26409. case 'iso-8859-3':
  26410. case 'iso-ir-109':
  26411. case 'iso8859-3':
  26412. case 'iso88593':
  26413. case 'iso_8859-3':
  26414. case 'iso_8859-3:1988':
  26415. case 'l3':
  26416. case 'latin3':
  26417. return 'ISO-8859-3'
  26418. case 'csisolatin4':
  26419. case 'iso-8859-4':
  26420. case 'iso-ir-110':
  26421. case 'iso8859-4':
  26422. case 'iso88594':
  26423. case 'iso_8859-4':
  26424. case 'iso_8859-4:1988':
  26425. case 'l4':
  26426. case 'latin4':
  26427. return 'ISO-8859-4'
  26428. case 'csisolatincyrillic':
  26429. case 'cyrillic':
  26430. case 'iso-8859-5':
  26431. case 'iso-ir-144':
  26432. case 'iso8859-5':
  26433. case 'iso88595':
  26434. case 'iso_8859-5':
  26435. case 'iso_8859-5:1988':
  26436. return 'ISO-8859-5'
  26437. case 'arabic':
  26438. case 'asmo-708':
  26439. case 'csiso88596e':
  26440. case 'csiso88596i':
  26441. case 'csisolatinarabic':
  26442. case 'ecma-114':
  26443. case 'iso-8859-6':
  26444. case 'iso-8859-6-e':
  26445. case 'iso-8859-6-i':
  26446. case 'iso-ir-127':
  26447. case 'iso8859-6':
  26448. case 'iso88596':
  26449. case 'iso_8859-6':
  26450. case 'iso_8859-6:1987':
  26451. return 'ISO-8859-6'
  26452. case 'csisolatingreek':
  26453. case 'ecma-118':
  26454. case 'elot_928':
  26455. case 'greek':
  26456. case 'greek8':
  26457. case 'iso-8859-7':
  26458. case 'iso-ir-126':
  26459. case 'iso8859-7':
  26460. case 'iso88597':
  26461. case 'iso_8859-7':
  26462. case 'iso_8859-7:1987':
  26463. case 'sun_eu_greek':
  26464. return 'ISO-8859-7'
  26465. case 'csiso88598e':
  26466. case 'csisolatinhebrew':
  26467. case 'hebrew':
  26468. case 'iso-8859-8':
  26469. case 'iso-8859-8-e':
  26470. case 'iso-ir-138':
  26471. case 'iso8859-8':
  26472. case 'iso88598':
  26473. case 'iso_8859-8':
  26474. case 'iso_8859-8:1988':
  26475. case 'visual':
  26476. return 'ISO-8859-8'
  26477. case 'csiso88598i':
  26478. case 'iso-8859-8-i':
  26479. case 'logical':
  26480. return 'ISO-8859-8-I'
  26481. case 'csisolatin6':
  26482. case 'iso-8859-10':
  26483. case 'iso-ir-157':
  26484. case 'iso8859-10':
  26485. case 'iso885910':
  26486. case 'l6':
  26487. case 'latin6':
  26488. return 'ISO-8859-10'
  26489. case 'iso-8859-13':
  26490. case 'iso8859-13':
  26491. case 'iso885913':
  26492. return 'ISO-8859-13'
  26493. case 'iso-8859-14':
  26494. case 'iso8859-14':
  26495. case 'iso885914':
  26496. return 'ISO-8859-14'
  26497. case 'csisolatin9':
  26498. case 'iso-8859-15':
  26499. case 'iso8859-15':
  26500. case 'iso885915':
  26501. case 'iso_8859-15':
  26502. case 'l9':
  26503. return 'ISO-8859-15'
  26504. case 'iso-8859-16':
  26505. return 'ISO-8859-16'
  26506. case 'cskoi8r':
  26507. case 'koi':
  26508. case 'koi8':
  26509. case 'koi8-r':
  26510. case 'koi8_r':
  26511. return 'KOI8-R'
  26512. case 'koi8-ru':
  26513. case 'koi8-u':
  26514. return 'KOI8-U'
  26515. case 'csmacintosh':
  26516. case 'mac':
  26517. case 'macintosh':
  26518. case 'x-mac-roman':
  26519. return 'macintosh'
  26520. case 'iso-8859-11':
  26521. case 'iso8859-11':
  26522. case 'iso885911':
  26523. case 'tis-620':
  26524. case 'windows-874':
  26525. return 'windows-874'
  26526. case 'cp1250':
  26527. case 'windows-1250':
  26528. case 'x-cp1250':
  26529. return 'windows-1250'
  26530. case 'cp1251':
  26531. case 'windows-1251':
  26532. case 'x-cp1251':
  26533. return 'windows-1251'
  26534. case 'ansi_x3.4-1968':
  26535. case 'ascii':
  26536. case 'cp1252':
  26537. case 'cp819':
  26538. case 'csisolatin1':
  26539. case 'ibm819':
  26540. case 'iso-8859-1':
  26541. case 'iso-ir-100':
  26542. case 'iso8859-1':
  26543. case 'iso88591':
  26544. case 'iso_8859-1':
  26545. case 'iso_8859-1:1987':
  26546. case 'l1':
  26547. case 'latin1':
  26548. case 'us-ascii':
  26549. case 'windows-1252':
  26550. case 'x-cp1252':
  26551. return 'windows-1252'
  26552. case 'cp1253':
  26553. case 'windows-1253':
  26554. case 'x-cp1253':
  26555. return 'windows-1253'
  26556. case 'cp1254':
  26557. case 'csisolatin5':
  26558. case 'iso-8859-9':
  26559. case 'iso-ir-148':
  26560. case 'iso8859-9':
  26561. case 'iso88599':
  26562. case 'iso_8859-9':
  26563. case 'iso_8859-9:1989':
  26564. case 'l5':
  26565. case 'latin5':
  26566. case 'windows-1254':
  26567. case 'x-cp1254':
  26568. return 'windows-1254'
  26569. case 'cp1255':
  26570. case 'windows-1255':
  26571. case 'x-cp1255':
  26572. return 'windows-1255'
  26573. case 'cp1256':
  26574. case 'windows-1256':
  26575. case 'x-cp1256':
  26576. return 'windows-1256'
  26577. case 'cp1257':
  26578. case 'windows-1257':
  26579. case 'x-cp1257':
  26580. return 'windows-1257'
  26581. case 'cp1258':
  26582. case 'windows-1258':
  26583. case 'x-cp1258':
  26584. return 'windows-1258'
  26585. case 'x-mac-cyrillic':
  26586. case 'x-mac-ukrainian':
  26587. return 'x-mac-cyrillic'
  26588. case 'chinese':
  26589. case 'csgb2312':
  26590. case 'csiso58gb231280':
  26591. case 'gb2312':
  26592. case 'gb_2312':
  26593. case 'gb_2312-80':
  26594. case 'gbk':
  26595. case 'iso-ir-58':
  26596. case 'x-gbk':
  26597. return 'GBK'
  26598. case 'gb18030':
  26599. return 'gb18030'
  26600. case 'big5':
  26601. case 'big5-hkscs':
  26602. case 'cn-big5':
  26603. case 'csbig5':
  26604. case 'x-x-big5':
  26605. return 'Big5'
  26606. case 'cseucpkdfmtjapanese':
  26607. case 'euc-jp':
  26608. case 'x-euc-jp':
  26609. return 'EUC-JP'
  26610. case 'csiso2022jp':
  26611. case 'iso-2022-jp':
  26612. return 'ISO-2022-JP'
  26613. case 'csshiftjis':
  26614. case 'ms932':
  26615. case 'ms_kanji':
  26616. case 'shift-jis':
  26617. case 'shift_jis':
  26618. case 'sjis':
  26619. case 'windows-31j':
  26620. case 'x-sjis':
  26621. return 'Shift_JIS'
  26622. case 'cseuckr':
  26623. case 'csksc56011987':
  26624. case 'euc-kr':
  26625. case 'iso-ir-149':
  26626. case 'korean':
  26627. case 'ks_c_5601-1987':
  26628. case 'ks_c_5601-1989':
  26629. case 'ksc5601':
  26630. case 'ksc_5601':
  26631. case 'windows-949':
  26632. return 'EUC-KR'
  26633. case 'csiso2022kr':
  26634. case 'hz-gb-2312':
  26635. case 'iso-2022-cn':
  26636. case 'iso-2022-cn-ext':
  26637. case 'iso-2022-kr':
  26638. case 'replacement':
  26639. return 'replacement'
  26640. case 'unicodefffe':
  26641. case 'utf-16be':
  26642. return 'UTF-16BE'
  26643. case 'csunicode':
  26644. case 'iso-10646-ucs-2':
  26645. case 'ucs-2':
  26646. case 'unicode':
  26647. case 'unicodefeff':
  26648. case 'utf-16':
  26649. case 'utf-16le':
  26650. return 'UTF-16LE'
  26651. case 'x-user-defined':
  26652. return 'x-user-defined'
  26653. default: return 'failure'
  26654. }
  26655. }
  26656. module.exports = {
  26657. getEncoding
  26658. }
  26659. /***/ }),
  26660. /***/ 1446:
  26661. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  26662. "use strict";
  26663. const {
  26664. staticPropertyDescriptors,
  26665. readOperation,
  26666. fireAProgressEvent
  26667. } = __nccwpck_require__(7530)
  26668. const {
  26669. kState,
  26670. kError,
  26671. kResult,
  26672. kEvents,
  26673. kAborted
  26674. } = __nccwpck_require__(9054)
  26675. const { webidl } = __nccwpck_require__(1744)
  26676. const { kEnumerableProperty } = __nccwpck_require__(3983)
  26677. class FileReader extends EventTarget {
  26678. constructor () {
  26679. super()
  26680. this[kState] = 'empty'
  26681. this[kResult] = null
  26682. this[kError] = null
  26683. this[kEvents] = {
  26684. loadend: null,
  26685. error: null,
  26686. abort: null,
  26687. load: null,
  26688. progress: null,
  26689. loadstart: null
  26690. }
  26691. }
  26692. /**
  26693. * @see https://w3c.github.io/FileAPI/#dfn-readAsArrayBuffer
  26694. * @param {import('buffer').Blob} blob
  26695. */
  26696. readAsArrayBuffer (blob) {
  26697. webidl.brandCheck(this, FileReader)
  26698. webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsArrayBuffer' })
  26699. blob = webidl.converters.Blob(blob, { strict: false })
  26700. // The readAsArrayBuffer(blob) method, when invoked,
  26701. // must initiate a read operation for blob with ArrayBuffer.
  26702. readOperation(this, blob, 'ArrayBuffer')
  26703. }
  26704. /**
  26705. * @see https://w3c.github.io/FileAPI/#readAsBinaryString
  26706. * @param {import('buffer').Blob} blob
  26707. */
  26708. readAsBinaryString (blob) {
  26709. webidl.brandCheck(this, FileReader)
  26710. webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsBinaryString' })
  26711. blob = webidl.converters.Blob(blob, { strict: false })
  26712. // The readAsBinaryString(blob) method, when invoked,
  26713. // must initiate a read operation for blob with BinaryString.
  26714. readOperation(this, blob, 'BinaryString')
  26715. }
  26716. /**
  26717. * @see https://w3c.github.io/FileAPI/#readAsDataText
  26718. * @param {import('buffer').Blob} blob
  26719. * @param {string?} encoding
  26720. */
  26721. readAsText (blob, encoding = undefined) {
  26722. webidl.brandCheck(this, FileReader)
  26723. webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsText' })
  26724. blob = webidl.converters.Blob(blob, { strict: false })
  26725. if (encoding !== undefined) {
  26726. encoding = webidl.converters.DOMString(encoding)
  26727. }
  26728. // The readAsText(blob, encoding) method, when invoked,
  26729. // must initiate a read operation for blob with Text and encoding.
  26730. readOperation(this, blob, 'Text', encoding)
  26731. }
  26732. /**
  26733. * @see https://w3c.github.io/FileAPI/#dfn-readAsDataURL
  26734. * @param {import('buffer').Blob} blob
  26735. */
  26736. readAsDataURL (blob) {
  26737. webidl.brandCheck(this, FileReader)
  26738. webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsDataURL' })
  26739. blob = webidl.converters.Blob(blob, { strict: false })
  26740. // The readAsDataURL(blob) method, when invoked, must
  26741. // initiate a read operation for blob with DataURL.
  26742. readOperation(this, blob, 'DataURL')
  26743. }
  26744. /**
  26745. * @see https://w3c.github.io/FileAPI/#dfn-abort
  26746. */
  26747. abort () {
  26748. // 1. If this's state is "empty" or if this's state is
  26749. // "done" set this's result to null and terminate
  26750. // this algorithm.
  26751. if (this[kState] === 'empty' || this[kState] === 'done') {
  26752. this[kResult] = null
  26753. return
  26754. }
  26755. // 2. If this's state is "loading" set this's state to
  26756. // "done" and set this's result to null.
  26757. if (this[kState] === 'loading') {
  26758. this[kState] = 'done'
  26759. this[kResult] = null
  26760. }
  26761. // 3. If there are any tasks from this on the file reading
  26762. // task source in an affiliated task queue, then remove
  26763. // those tasks from that task queue.
  26764. this[kAborted] = true
  26765. // 4. Terminate the algorithm for the read method being processed.
  26766. // TODO
  26767. // 5. Fire a progress event called abort at this.
  26768. fireAProgressEvent('abort', this)
  26769. // 6. If this's state is not "loading", fire a progress
  26770. // event called loadend at this.
  26771. if (this[kState] !== 'loading') {
  26772. fireAProgressEvent('loadend', this)
  26773. }
  26774. }
  26775. /**
  26776. * @see https://w3c.github.io/FileAPI/#dom-filereader-readystate
  26777. */
  26778. get readyState () {
  26779. webidl.brandCheck(this, FileReader)
  26780. switch (this[kState]) {
  26781. case 'empty': return this.EMPTY
  26782. case 'loading': return this.LOADING
  26783. case 'done': return this.DONE
  26784. }
  26785. }
  26786. /**
  26787. * @see https://w3c.github.io/FileAPI/#dom-filereader-result
  26788. */
  26789. get result () {
  26790. webidl.brandCheck(this, FileReader)
  26791. // The result attribute’s getter, when invoked, must return
  26792. // this's result.
  26793. return this[kResult]
  26794. }
  26795. /**
  26796. * @see https://w3c.github.io/FileAPI/#dom-filereader-error
  26797. */
  26798. get error () {
  26799. webidl.brandCheck(this, FileReader)
  26800. // The error attribute’s getter, when invoked, must return
  26801. // this's error.
  26802. return this[kError]
  26803. }
  26804. get onloadend () {
  26805. webidl.brandCheck(this, FileReader)
  26806. return this[kEvents].loadend
  26807. }
  26808. set onloadend (fn) {
  26809. webidl.brandCheck(this, FileReader)
  26810. if (this[kEvents].loadend) {
  26811. this.removeEventListener('loadend', this[kEvents].loadend)
  26812. }
  26813. if (typeof fn === 'function') {
  26814. this[kEvents].loadend = fn
  26815. this.addEventListener('loadend', fn)
  26816. } else {
  26817. this[kEvents].loadend = null
  26818. }
  26819. }
  26820. get onerror () {
  26821. webidl.brandCheck(this, FileReader)
  26822. return this[kEvents].error
  26823. }
  26824. set onerror (fn) {
  26825. webidl.brandCheck(this, FileReader)
  26826. if (this[kEvents].error) {
  26827. this.removeEventListener('error', this[kEvents].error)
  26828. }
  26829. if (typeof fn === 'function') {
  26830. this[kEvents].error = fn
  26831. this.addEventListener('error', fn)
  26832. } else {
  26833. this[kEvents].error = null
  26834. }
  26835. }
  26836. get onloadstart () {
  26837. webidl.brandCheck(this, FileReader)
  26838. return this[kEvents].loadstart
  26839. }
  26840. set onloadstart (fn) {
  26841. webidl.brandCheck(this, FileReader)
  26842. if (this[kEvents].loadstart) {
  26843. this.removeEventListener('loadstart', this[kEvents].loadstart)
  26844. }
  26845. if (typeof fn === 'function') {
  26846. this[kEvents].loadstart = fn
  26847. this.addEventListener('loadstart', fn)
  26848. } else {
  26849. this[kEvents].loadstart = null
  26850. }
  26851. }
  26852. get onprogress () {
  26853. webidl.brandCheck(this, FileReader)
  26854. return this[kEvents].progress
  26855. }
  26856. set onprogress (fn) {
  26857. webidl.brandCheck(this, FileReader)
  26858. if (this[kEvents].progress) {
  26859. this.removeEventListener('progress', this[kEvents].progress)
  26860. }
  26861. if (typeof fn === 'function') {
  26862. this[kEvents].progress = fn
  26863. this.addEventListener('progress', fn)
  26864. } else {
  26865. this[kEvents].progress = null
  26866. }
  26867. }
  26868. get onload () {
  26869. webidl.brandCheck(this, FileReader)
  26870. return this[kEvents].load
  26871. }
  26872. set onload (fn) {
  26873. webidl.brandCheck(this, FileReader)
  26874. if (this[kEvents].load) {
  26875. this.removeEventListener('load', this[kEvents].load)
  26876. }
  26877. if (typeof fn === 'function') {
  26878. this[kEvents].load = fn
  26879. this.addEventListener('load', fn)
  26880. } else {
  26881. this[kEvents].load = null
  26882. }
  26883. }
  26884. get onabort () {
  26885. webidl.brandCheck(this, FileReader)
  26886. return this[kEvents].abort
  26887. }
  26888. set onabort (fn) {
  26889. webidl.brandCheck(this, FileReader)
  26890. if (this[kEvents].abort) {
  26891. this.removeEventListener('abort', this[kEvents].abort)
  26892. }
  26893. if (typeof fn === 'function') {
  26894. this[kEvents].abort = fn
  26895. this.addEventListener('abort', fn)
  26896. } else {
  26897. this[kEvents].abort = null
  26898. }
  26899. }
  26900. }
  26901. // https://w3c.github.io/FileAPI/#dom-filereader-empty
  26902. FileReader.EMPTY = FileReader.prototype.EMPTY = 0
  26903. // https://w3c.github.io/FileAPI/#dom-filereader-loading
  26904. FileReader.LOADING = FileReader.prototype.LOADING = 1
  26905. // https://w3c.github.io/FileAPI/#dom-filereader-done
  26906. FileReader.DONE = FileReader.prototype.DONE = 2
  26907. Object.defineProperties(FileReader.prototype, {
  26908. EMPTY: staticPropertyDescriptors,
  26909. LOADING: staticPropertyDescriptors,
  26910. DONE: staticPropertyDescriptors,
  26911. readAsArrayBuffer: kEnumerableProperty,
  26912. readAsBinaryString: kEnumerableProperty,
  26913. readAsText: kEnumerableProperty,
  26914. readAsDataURL: kEnumerableProperty,
  26915. abort: kEnumerableProperty,
  26916. readyState: kEnumerableProperty,
  26917. result: kEnumerableProperty,
  26918. error: kEnumerableProperty,
  26919. onloadstart: kEnumerableProperty,
  26920. onprogress: kEnumerableProperty,
  26921. onload: kEnumerableProperty,
  26922. onabort: kEnumerableProperty,
  26923. onerror: kEnumerableProperty,
  26924. onloadend: kEnumerableProperty,
  26925. [Symbol.toStringTag]: {
  26926. value: 'FileReader',
  26927. writable: false,
  26928. enumerable: false,
  26929. configurable: true
  26930. }
  26931. })
  26932. Object.defineProperties(FileReader, {
  26933. EMPTY: staticPropertyDescriptors,
  26934. LOADING: staticPropertyDescriptors,
  26935. DONE: staticPropertyDescriptors
  26936. })
  26937. module.exports = {
  26938. FileReader
  26939. }
  26940. /***/ }),
  26941. /***/ 5504:
  26942. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  26943. "use strict";
  26944. const { webidl } = __nccwpck_require__(1744)
  26945. const kState = Symbol('ProgressEvent state')
  26946. /**
  26947. * @see https://xhr.spec.whatwg.org/#progressevent
  26948. */
  26949. class ProgressEvent extends Event {
  26950. constructor (type, eventInitDict = {}) {
  26951. type = webidl.converters.DOMString(type)
  26952. eventInitDict = webidl.converters.ProgressEventInit(eventInitDict ?? {})
  26953. super(type, eventInitDict)
  26954. this[kState] = {
  26955. lengthComputable: eventInitDict.lengthComputable,
  26956. loaded: eventInitDict.loaded,
  26957. total: eventInitDict.total
  26958. }
  26959. }
  26960. get lengthComputable () {
  26961. webidl.brandCheck(this, ProgressEvent)
  26962. return this[kState].lengthComputable
  26963. }
  26964. get loaded () {
  26965. webidl.brandCheck(this, ProgressEvent)
  26966. return this[kState].loaded
  26967. }
  26968. get total () {
  26969. webidl.brandCheck(this, ProgressEvent)
  26970. return this[kState].total
  26971. }
  26972. }
  26973. webidl.converters.ProgressEventInit = webidl.dictionaryConverter([
  26974. {
  26975. key: 'lengthComputable',
  26976. converter: webidl.converters.boolean,
  26977. defaultValue: false
  26978. },
  26979. {
  26980. key: 'loaded',
  26981. converter: webidl.converters['unsigned long long'],
  26982. defaultValue: 0
  26983. },
  26984. {
  26985. key: 'total',
  26986. converter: webidl.converters['unsigned long long'],
  26987. defaultValue: 0
  26988. },
  26989. {
  26990. key: 'bubbles',
  26991. converter: webidl.converters.boolean,
  26992. defaultValue: false
  26993. },
  26994. {
  26995. key: 'cancelable',
  26996. converter: webidl.converters.boolean,
  26997. defaultValue: false
  26998. },
  26999. {
  27000. key: 'composed',
  27001. converter: webidl.converters.boolean,
  27002. defaultValue: false
  27003. }
  27004. ])
  27005. module.exports = {
  27006. ProgressEvent
  27007. }
  27008. /***/ }),
  27009. /***/ 9054:
  27010. /***/ ((module) => {
  27011. "use strict";
  27012. module.exports = {
  27013. kState: Symbol('FileReader state'),
  27014. kResult: Symbol('FileReader result'),
  27015. kError: Symbol('FileReader error'),
  27016. kLastProgressEventFired: Symbol('FileReader last progress event fired timestamp'),
  27017. kEvents: Symbol('FileReader events'),
  27018. kAborted: Symbol('FileReader aborted')
  27019. }
  27020. /***/ }),
  27021. /***/ 7530:
  27022. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27023. "use strict";
  27024. const {
  27025. kState,
  27026. kError,
  27027. kResult,
  27028. kAborted,
  27029. kLastProgressEventFired
  27030. } = __nccwpck_require__(9054)
  27031. const { ProgressEvent } = __nccwpck_require__(5504)
  27032. const { getEncoding } = __nccwpck_require__(4854)
  27033. const { DOMException } = __nccwpck_require__(1037)
  27034. const { serializeAMimeType, parseMIMEType } = __nccwpck_require__(685)
  27035. const { types } = __nccwpck_require__(3837)
  27036. const { StringDecoder } = __nccwpck_require__(1576)
  27037. const { btoa } = __nccwpck_require__(4300)
  27038. /** @type {PropertyDescriptor} */
  27039. const staticPropertyDescriptors = {
  27040. enumerable: true,
  27041. writable: false,
  27042. configurable: false
  27043. }
  27044. /**
  27045. * @see https://w3c.github.io/FileAPI/#readOperation
  27046. * @param {import('./filereader').FileReader} fr
  27047. * @param {import('buffer').Blob} blob
  27048. * @param {string} type
  27049. * @param {string?} encodingName
  27050. */
  27051. function readOperation (fr, blob, type, encodingName) {
  27052. // 1. If fr’s state is "loading", throw an InvalidStateError
  27053. // DOMException.
  27054. if (fr[kState] === 'loading') {
  27055. throw new DOMException('Invalid state', 'InvalidStateError')
  27056. }
  27057. // 2. Set fr’s state to "loading".
  27058. fr[kState] = 'loading'
  27059. // 3. Set fr’s result to null.
  27060. fr[kResult] = null
  27061. // 4. Set fr’s error to null.
  27062. fr[kError] = null
  27063. // 5. Let stream be the result of calling get stream on blob.
  27064. /** @type {import('stream/web').ReadableStream} */
  27065. const stream = blob.stream()
  27066. // 6. Let reader be the result of getting a reader from stream.
  27067. const reader = stream.getReader()
  27068. // 7. Let bytes be an empty byte sequence.
  27069. /** @type {Uint8Array[]} */
  27070. const bytes = []
  27071. // 8. Let chunkPromise be the result of reading a chunk from
  27072. // stream with reader.
  27073. let chunkPromise = reader.read()
  27074. // 9. Let isFirstChunk be true.
  27075. let isFirstChunk = true
  27076. // 10. In parallel, while true:
  27077. // Note: "In parallel" just means non-blocking
  27078. // Note 2: readOperation itself cannot be async as double
  27079. // reading the body would then reject the promise, instead
  27080. // of throwing an error.
  27081. ;(async () => {
  27082. while (!fr[kAborted]) {
  27083. // 1. Wait for chunkPromise to be fulfilled or rejected.
  27084. try {
  27085. const { done, value } = await chunkPromise
  27086. // 2. If chunkPromise is fulfilled, and isFirstChunk is
  27087. // true, queue a task to fire a progress event called
  27088. // loadstart at fr.
  27089. if (isFirstChunk && !fr[kAborted]) {
  27090. queueMicrotask(() => {
  27091. fireAProgressEvent('loadstart', fr)
  27092. })
  27093. }
  27094. // 3. Set isFirstChunk to false.
  27095. isFirstChunk = false
  27096. // 4. If chunkPromise is fulfilled with an object whose
  27097. // done property is false and whose value property is
  27098. // a Uint8Array object, run these steps:
  27099. if (!done && types.isUint8Array(value)) {
  27100. // 1. Let bs be the byte sequence represented by the
  27101. // Uint8Array object.
  27102. // 2. Append bs to bytes.
  27103. bytes.push(value)
  27104. // 3. If roughly 50ms have passed since these steps
  27105. // were last invoked, queue a task to fire a
  27106. // progress event called progress at fr.
  27107. if (
  27108. (
  27109. fr[kLastProgressEventFired] === undefined ||
  27110. Date.now() - fr[kLastProgressEventFired] >= 50
  27111. ) &&
  27112. !fr[kAborted]
  27113. ) {
  27114. fr[kLastProgressEventFired] = Date.now()
  27115. queueMicrotask(() => {
  27116. fireAProgressEvent('progress', fr)
  27117. })
  27118. }
  27119. // 4. Set chunkPromise to the result of reading a
  27120. // chunk from stream with reader.
  27121. chunkPromise = reader.read()
  27122. } else if (done) {
  27123. // 5. Otherwise, if chunkPromise is fulfilled with an
  27124. // object whose done property is true, queue a task
  27125. // to run the following steps and abort this algorithm:
  27126. queueMicrotask(() => {
  27127. // 1. Set fr’s state to "done".
  27128. fr[kState] = 'done'
  27129. // 2. Let result be the result of package data given
  27130. // bytes, type, blob’s type, and encodingName.
  27131. try {
  27132. const result = packageData(bytes, type, blob.type, encodingName)
  27133. // 4. Else:
  27134. if (fr[kAborted]) {
  27135. return
  27136. }
  27137. // 1. Set fr’s result to result.
  27138. fr[kResult] = result
  27139. // 2. Fire a progress event called load at the fr.
  27140. fireAProgressEvent('load', fr)
  27141. } catch (error) {
  27142. // 3. If package data threw an exception error:
  27143. // 1. Set fr’s error to error.
  27144. fr[kError] = error
  27145. // 2. Fire a progress event called error at fr.
  27146. fireAProgressEvent('error', fr)
  27147. }
  27148. // 5. If fr’s state is not "loading", fire a progress
  27149. // event called loadend at the fr.
  27150. if (fr[kState] !== 'loading') {
  27151. fireAProgressEvent('loadend', fr)
  27152. }
  27153. })
  27154. break
  27155. }
  27156. } catch (error) {
  27157. if (fr[kAborted]) {
  27158. return
  27159. }
  27160. // 6. Otherwise, if chunkPromise is rejected with an
  27161. // error error, queue a task to run the following
  27162. // steps and abort this algorithm:
  27163. queueMicrotask(() => {
  27164. // 1. Set fr’s state to "done".
  27165. fr[kState] = 'done'
  27166. // 2. Set fr’s error to error.
  27167. fr[kError] = error
  27168. // 3. Fire a progress event called error at fr.
  27169. fireAProgressEvent('error', fr)
  27170. // 4. If fr’s state is not "loading", fire a progress
  27171. // event called loadend at fr.
  27172. if (fr[kState] !== 'loading') {
  27173. fireAProgressEvent('loadend', fr)
  27174. }
  27175. })
  27176. break
  27177. }
  27178. }
  27179. })()
  27180. }
  27181. /**
  27182. * @see https://w3c.github.io/FileAPI/#fire-a-progress-event
  27183. * @see https://dom.spec.whatwg.org/#concept-event-fire
  27184. * @param {string} e The name of the event
  27185. * @param {import('./filereader').FileReader} reader
  27186. */
  27187. function fireAProgressEvent (e, reader) {
  27188. // The progress event e does not bubble. e.bubbles must be false
  27189. // The progress event e is NOT cancelable. e.cancelable must be false
  27190. const event = new ProgressEvent(e, {
  27191. bubbles: false,
  27192. cancelable: false
  27193. })
  27194. reader.dispatchEvent(event)
  27195. }
  27196. /**
  27197. * @see https://w3c.github.io/FileAPI/#blob-package-data
  27198. * @param {Uint8Array[]} bytes
  27199. * @param {string} type
  27200. * @param {string?} mimeType
  27201. * @param {string?} encodingName
  27202. */
  27203. function packageData (bytes, type, mimeType, encodingName) {
  27204. // 1. A Blob has an associated package data algorithm, given
  27205. // bytes, a type, a optional mimeType, and a optional
  27206. // encodingName, which switches on type and runs the
  27207. // associated steps:
  27208. switch (type) {
  27209. case 'DataURL': {
  27210. // 1. Return bytes as a DataURL [RFC2397] subject to
  27211. // the considerations below:
  27212. // * Use mimeType as part of the Data URL if it is
  27213. // available in keeping with the Data URL
  27214. // specification [RFC2397].
  27215. // * If mimeType is not available return a Data URL
  27216. // without a media-type. [RFC2397].
  27217. // https://datatracker.ietf.org/doc/html/rfc2397#section-3
  27218. // dataurl := "data:" [ mediatype ] [ ";base64" ] "," data
  27219. // mediatype := [ type "/" subtype ] *( ";" parameter )
  27220. // data := *urlchar
  27221. // parameter := attribute "=" value
  27222. let dataURL = 'data:'
  27223. const parsed = parseMIMEType(mimeType || 'application/octet-stream')
  27224. if (parsed !== 'failure') {
  27225. dataURL += serializeAMimeType(parsed)
  27226. }
  27227. dataURL += ';base64,'
  27228. const decoder = new StringDecoder('latin1')
  27229. for (const chunk of bytes) {
  27230. dataURL += btoa(decoder.write(chunk))
  27231. }
  27232. dataURL += btoa(decoder.end())
  27233. return dataURL
  27234. }
  27235. case 'Text': {
  27236. // 1. Let encoding be failure
  27237. let encoding = 'failure'
  27238. // 2. If the encodingName is present, set encoding to the
  27239. // result of getting an encoding from encodingName.
  27240. if (encodingName) {
  27241. encoding = getEncoding(encodingName)
  27242. }
  27243. // 3. If encoding is failure, and mimeType is present:
  27244. if (encoding === 'failure' && mimeType) {
  27245. // 1. Let type be the result of parse a MIME type
  27246. // given mimeType.
  27247. const type = parseMIMEType(mimeType)
  27248. // 2. If type is not failure, set encoding to the result
  27249. // of getting an encoding from type’s parameters["charset"].
  27250. if (type !== 'failure') {
  27251. encoding = getEncoding(type.parameters.get('charset'))
  27252. }
  27253. }
  27254. // 4. If encoding is failure, then set encoding to UTF-8.
  27255. if (encoding === 'failure') {
  27256. encoding = 'UTF-8'
  27257. }
  27258. // 5. Decode bytes using fallback encoding encoding, and
  27259. // return the result.
  27260. return decode(bytes, encoding)
  27261. }
  27262. case 'ArrayBuffer': {
  27263. // Return a new ArrayBuffer whose contents are bytes.
  27264. const sequence = combineByteSequences(bytes)
  27265. return sequence.buffer
  27266. }
  27267. case 'BinaryString': {
  27268. // Return bytes as a binary string, in which every byte
  27269. // is represented by a code unit of equal value [0..255].
  27270. let binaryString = ''
  27271. const decoder = new StringDecoder('latin1')
  27272. for (const chunk of bytes) {
  27273. binaryString += decoder.write(chunk)
  27274. }
  27275. binaryString += decoder.end()
  27276. return binaryString
  27277. }
  27278. }
  27279. }
  27280. /**
  27281. * @see https://encoding.spec.whatwg.org/#decode
  27282. * @param {Uint8Array[]} ioQueue
  27283. * @param {string} encoding
  27284. */
  27285. function decode (ioQueue, encoding) {
  27286. const bytes = combineByteSequences(ioQueue)
  27287. // 1. Let BOMEncoding be the result of BOM sniffing ioQueue.
  27288. const BOMEncoding = BOMSniffing(bytes)
  27289. let slice = 0
  27290. // 2. If BOMEncoding is non-null:
  27291. if (BOMEncoding !== null) {
  27292. // 1. Set encoding to BOMEncoding.
  27293. encoding = BOMEncoding
  27294. // 2. Read three bytes from ioQueue, if BOMEncoding is
  27295. // UTF-8; otherwise read two bytes.
  27296. // (Do nothing with those bytes.)
  27297. slice = BOMEncoding === 'UTF-8' ? 3 : 2
  27298. }
  27299. // 3. Process a queue with an instance of encoding’s
  27300. // decoder, ioQueue, output, and "replacement".
  27301. // 4. Return output.
  27302. const sliced = bytes.slice(slice)
  27303. return new TextDecoder(encoding).decode(sliced)
  27304. }
  27305. /**
  27306. * @see https://encoding.spec.whatwg.org/#bom-sniff
  27307. * @param {Uint8Array} ioQueue
  27308. */
  27309. function BOMSniffing (ioQueue) {
  27310. // 1. Let BOM be the result of peeking 3 bytes from ioQueue,
  27311. // converted to a byte sequence.
  27312. const [a, b, c] = ioQueue
  27313. // 2. For each of the rows in the table below, starting with
  27314. // the first one and going down, if BOM starts with the
  27315. // bytes given in the first column, then return the
  27316. // encoding given in the cell in the second column of that
  27317. // row. Otherwise, return null.
  27318. if (a === 0xEF && b === 0xBB && c === 0xBF) {
  27319. return 'UTF-8'
  27320. } else if (a === 0xFE && b === 0xFF) {
  27321. return 'UTF-16BE'
  27322. } else if (a === 0xFF && b === 0xFE) {
  27323. return 'UTF-16LE'
  27324. }
  27325. return null
  27326. }
  27327. /**
  27328. * @param {Uint8Array[]} sequences
  27329. */
  27330. function combineByteSequences (sequences) {
  27331. const size = sequences.reduce((a, b) => {
  27332. return a + b.byteLength
  27333. }, 0)
  27334. let offset = 0
  27335. return sequences.reduce((a, b) => {
  27336. a.set(b, offset)
  27337. offset += b.byteLength
  27338. return a
  27339. }, new Uint8Array(size))
  27340. }
  27341. module.exports = {
  27342. staticPropertyDescriptors,
  27343. readOperation,
  27344. fireAProgressEvent
  27345. }
  27346. /***/ }),
  27347. /***/ 1892:
  27348. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27349. "use strict";
  27350. // We include a version number for the Dispatcher API. In case of breaking changes,
  27351. // this version number must be increased to avoid conflicts.
  27352. const globalDispatcher = Symbol.for('undici.globalDispatcher.1')
  27353. const { InvalidArgumentError } = __nccwpck_require__(8045)
  27354. const Agent = __nccwpck_require__(7890)
  27355. if (getGlobalDispatcher() === undefined) {
  27356. setGlobalDispatcher(new Agent())
  27357. }
  27358. function setGlobalDispatcher (agent) {
  27359. if (!agent || typeof agent.dispatch !== 'function') {
  27360. throw new InvalidArgumentError('Argument agent must implement Agent')
  27361. }
  27362. Object.defineProperty(globalThis, globalDispatcher, {
  27363. value: agent,
  27364. writable: true,
  27365. enumerable: false,
  27366. configurable: false
  27367. })
  27368. }
  27369. function getGlobalDispatcher () {
  27370. return globalThis[globalDispatcher]
  27371. }
  27372. module.exports = {
  27373. setGlobalDispatcher,
  27374. getGlobalDispatcher
  27375. }
  27376. /***/ }),
  27377. /***/ 6930:
  27378. /***/ ((module) => {
  27379. "use strict";
  27380. module.exports = class DecoratorHandler {
  27381. constructor (handler) {
  27382. this.handler = handler
  27383. }
  27384. onConnect (...args) {
  27385. return this.handler.onConnect(...args)
  27386. }
  27387. onError (...args) {
  27388. return this.handler.onError(...args)
  27389. }
  27390. onUpgrade (...args) {
  27391. return this.handler.onUpgrade(...args)
  27392. }
  27393. onHeaders (...args) {
  27394. return this.handler.onHeaders(...args)
  27395. }
  27396. onData (...args) {
  27397. return this.handler.onData(...args)
  27398. }
  27399. onComplete (...args) {
  27400. return this.handler.onComplete(...args)
  27401. }
  27402. onBodySent (...args) {
  27403. return this.handler.onBodySent(...args)
  27404. }
  27405. }
  27406. /***/ }),
  27407. /***/ 2860:
  27408. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27409. "use strict";
  27410. const util = __nccwpck_require__(3983)
  27411. const { kBodyUsed } = __nccwpck_require__(2785)
  27412. const assert = __nccwpck_require__(9491)
  27413. const { InvalidArgumentError } = __nccwpck_require__(8045)
  27414. const EE = __nccwpck_require__(2361)
  27415. const redirectableStatusCodes = [300, 301, 302, 303, 307, 308]
  27416. const kBody = Symbol('body')
  27417. class BodyAsyncIterable {
  27418. constructor (body) {
  27419. this[kBody] = body
  27420. this[kBodyUsed] = false
  27421. }
  27422. async * [Symbol.asyncIterator] () {
  27423. assert(!this[kBodyUsed], 'disturbed')
  27424. this[kBodyUsed] = true
  27425. yield * this[kBody]
  27426. }
  27427. }
  27428. class RedirectHandler {
  27429. constructor (dispatch, maxRedirections, opts, handler) {
  27430. if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) {
  27431. throw new InvalidArgumentError('maxRedirections must be a positive number')
  27432. }
  27433. util.validateHandler(handler, opts.method, opts.upgrade)
  27434. this.dispatch = dispatch
  27435. this.location = null
  27436. this.abort = null
  27437. this.opts = { ...opts, maxRedirections: 0 } // opts must be a copy
  27438. this.maxRedirections = maxRedirections
  27439. this.handler = handler
  27440. this.history = []
  27441. if (util.isStream(this.opts.body)) {
  27442. // TODO (fix): Provide some way for the user to cache the file to e.g. /tmp
  27443. // so that it can be dispatched again?
  27444. // TODO (fix): Do we need 100-expect support to provide a way to do this properly?
  27445. if (util.bodyLength(this.opts.body) === 0) {
  27446. this.opts.body
  27447. .on('data', function () {
  27448. assert(false)
  27449. })
  27450. }
  27451. if (typeof this.opts.body.readableDidRead !== 'boolean') {
  27452. this.opts.body[kBodyUsed] = false
  27453. EE.prototype.on.call(this.opts.body, 'data', function () {
  27454. this[kBodyUsed] = true
  27455. })
  27456. }
  27457. } else if (this.opts.body && typeof this.opts.body.pipeTo === 'function') {
  27458. // TODO (fix): We can't access ReadableStream internal state
  27459. // to determine whether or not it has been disturbed. This is just
  27460. // a workaround.
  27461. this.opts.body = new BodyAsyncIterable(this.opts.body)
  27462. } else if (
  27463. this.opts.body &&
  27464. typeof this.opts.body !== 'string' &&
  27465. !ArrayBuffer.isView(this.opts.body) &&
  27466. util.isIterable(this.opts.body)
  27467. ) {
  27468. // TODO: Should we allow re-using iterable if !this.opts.idempotent
  27469. // or through some other flag?
  27470. this.opts.body = new BodyAsyncIterable(this.opts.body)
  27471. }
  27472. }
  27473. onConnect (abort) {
  27474. this.abort = abort
  27475. this.handler.onConnect(abort, { history: this.history })
  27476. }
  27477. onUpgrade (statusCode, headers, socket) {
  27478. this.handler.onUpgrade(statusCode, headers, socket)
  27479. }
  27480. onError (error) {
  27481. this.handler.onError(error)
  27482. }
  27483. onHeaders (statusCode, headers, resume, statusText) {
  27484. this.location = this.history.length >= this.maxRedirections || util.isDisturbed(this.opts.body)
  27485. ? null
  27486. : parseLocation(statusCode, headers)
  27487. if (this.opts.origin) {
  27488. this.history.push(new URL(this.opts.path, this.opts.origin))
  27489. }
  27490. if (!this.location) {
  27491. return this.handler.onHeaders(statusCode, headers, resume, statusText)
  27492. }
  27493. const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)))
  27494. const path = search ? `${pathname}${search}` : pathname
  27495. // Remove headers referring to the original URL.
  27496. // By default it is Host only, unless it's a 303 (see below), which removes also all Content-* headers.
  27497. // https://tools.ietf.org/html/rfc7231#section-6.4
  27498. this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin)
  27499. this.opts.path = path
  27500. this.opts.origin = origin
  27501. this.opts.maxRedirections = 0
  27502. this.opts.query = null
  27503. // https://tools.ietf.org/html/rfc7231#section-6.4.4
  27504. // In case of HTTP 303, always replace method to be either HEAD or GET
  27505. if (statusCode === 303 && this.opts.method !== 'HEAD') {
  27506. this.opts.method = 'GET'
  27507. this.opts.body = null
  27508. }
  27509. }
  27510. onData (chunk) {
  27511. if (this.location) {
  27512. /*
  27513. https://tools.ietf.org/html/rfc7231#section-6.4
  27514. TLDR: undici always ignores 3xx response bodies.
  27515. Redirection is used to serve the requested resource from another URL, so it is assumes that
  27516. no body is generated (and thus can be ignored). Even though generating a body is not prohibited.
  27517. For status 301, 302, 303, 307 and 308 (the latter from RFC 7238), the specs mention that the body usually
  27518. (which means it's optional and not mandated) contain just an hyperlink to the value of
  27519. the Location response header, so the body can be ignored safely.
  27520. For status 300, which is "Multiple Choices", the spec mentions both generating a Location
  27521. response header AND a response body with the other possible location to follow.
  27522. Since the spec explicitily chooses not to specify a format for such body and leave it to
  27523. servers and browsers implementors, we ignore the body as there is no specified way to eventually parse it.
  27524. */
  27525. } else {
  27526. return this.handler.onData(chunk)
  27527. }
  27528. }
  27529. onComplete (trailers) {
  27530. if (this.location) {
  27531. /*
  27532. https://tools.ietf.org/html/rfc7231#section-6.4
  27533. TLDR: undici always ignores 3xx response trailers as they are not expected in case of redirections
  27534. and neither are useful if present.
  27535. See comment on onData method above for more detailed informations.
  27536. */
  27537. this.location = null
  27538. this.abort = null
  27539. this.dispatch(this.opts, this)
  27540. } else {
  27541. this.handler.onComplete(trailers)
  27542. }
  27543. }
  27544. onBodySent (chunk) {
  27545. if (this.handler.onBodySent) {
  27546. this.handler.onBodySent(chunk)
  27547. }
  27548. }
  27549. }
  27550. function parseLocation (statusCode, headers) {
  27551. if (redirectableStatusCodes.indexOf(statusCode) === -1) {
  27552. return null
  27553. }
  27554. for (let i = 0; i < headers.length; i += 2) {
  27555. if (headers[i].toString().toLowerCase() === 'location') {
  27556. return headers[i + 1]
  27557. }
  27558. }
  27559. }
  27560. // https://tools.ietf.org/html/rfc7231#section-6.4.4
  27561. function shouldRemoveHeader (header, removeContent, unknownOrigin) {
  27562. if (header.length === 4) {
  27563. return util.headerNameToString(header) === 'host'
  27564. }
  27565. if (removeContent && util.headerNameToString(header).startsWith('content-')) {
  27566. return true
  27567. }
  27568. if (unknownOrigin && (header.length === 13 || header.length === 6 || header.length === 19)) {
  27569. const name = util.headerNameToString(header)
  27570. return name === 'authorization' || name === 'cookie' || name === 'proxy-authorization'
  27571. }
  27572. return false
  27573. }
  27574. // https://tools.ietf.org/html/rfc7231#section-6.4
  27575. function cleanRequestHeaders (headers, removeContent, unknownOrigin) {
  27576. const ret = []
  27577. if (Array.isArray(headers)) {
  27578. for (let i = 0; i < headers.length; i += 2) {
  27579. if (!shouldRemoveHeader(headers[i], removeContent, unknownOrigin)) {
  27580. ret.push(headers[i], headers[i + 1])
  27581. }
  27582. }
  27583. } else if (headers && typeof headers === 'object') {
  27584. for (const key of Object.keys(headers)) {
  27585. if (!shouldRemoveHeader(key, removeContent, unknownOrigin)) {
  27586. ret.push(key, headers[key])
  27587. }
  27588. }
  27589. } else {
  27590. assert(headers == null, 'headers must be an object or an array')
  27591. }
  27592. return ret
  27593. }
  27594. module.exports = RedirectHandler
  27595. /***/ }),
  27596. /***/ 2286:
  27597. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27598. const assert = __nccwpck_require__(9491)
  27599. const { kRetryHandlerDefaultRetry } = __nccwpck_require__(2785)
  27600. const { RequestRetryError } = __nccwpck_require__(8045)
  27601. const { isDisturbed, parseHeaders, parseRangeHeader } = __nccwpck_require__(3983)
  27602. function calculateRetryAfterHeader (retryAfter) {
  27603. const current = Date.now()
  27604. const diff = new Date(retryAfter).getTime() - current
  27605. return diff
  27606. }
  27607. class RetryHandler {
  27608. constructor (opts, handlers) {
  27609. const { retryOptions, ...dispatchOpts } = opts
  27610. const {
  27611. // Retry scoped
  27612. retry: retryFn,
  27613. maxRetries,
  27614. maxTimeout,
  27615. minTimeout,
  27616. timeoutFactor,
  27617. // Response scoped
  27618. methods,
  27619. errorCodes,
  27620. retryAfter,
  27621. statusCodes
  27622. } = retryOptions ?? {}
  27623. this.dispatch = handlers.dispatch
  27624. this.handler = handlers.handler
  27625. this.opts = dispatchOpts
  27626. this.abort = null
  27627. this.aborted = false
  27628. this.retryOpts = {
  27629. retry: retryFn ?? RetryHandler[kRetryHandlerDefaultRetry],
  27630. retryAfter: retryAfter ?? true,
  27631. maxTimeout: maxTimeout ?? 30 * 1000, // 30s,
  27632. timeout: minTimeout ?? 500, // .5s
  27633. timeoutFactor: timeoutFactor ?? 2,
  27634. maxRetries: maxRetries ?? 5,
  27635. // What errors we should retry
  27636. methods: methods ?? ['GET', 'HEAD', 'OPTIONS', 'PUT', 'DELETE', 'TRACE'],
  27637. // Indicates which errors to retry
  27638. statusCodes: statusCodes ?? [500, 502, 503, 504, 429],
  27639. // List of errors to retry
  27640. errorCodes: errorCodes ?? [
  27641. 'ECONNRESET',
  27642. 'ECONNREFUSED',
  27643. 'ENOTFOUND',
  27644. 'ENETDOWN',
  27645. 'ENETUNREACH',
  27646. 'EHOSTDOWN',
  27647. 'EHOSTUNREACH',
  27648. 'EPIPE'
  27649. ]
  27650. }
  27651. this.retryCount = 0
  27652. this.start = 0
  27653. this.end = null
  27654. this.etag = null
  27655. this.resume = null
  27656. // Handle possible onConnect duplication
  27657. this.handler.onConnect(reason => {
  27658. this.aborted = true
  27659. if (this.abort) {
  27660. this.abort(reason)
  27661. } else {
  27662. this.reason = reason
  27663. }
  27664. })
  27665. }
  27666. onRequestSent () {
  27667. if (this.handler.onRequestSent) {
  27668. this.handler.onRequestSent()
  27669. }
  27670. }
  27671. onUpgrade (statusCode, headers, socket) {
  27672. if (this.handler.onUpgrade) {
  27673. this.handler.onUpgrade(statusCode, headers, socket)
  27674. }
  27675. }
  27676. onConnect (abort) {
  27677. if (this.aborted) {
  27678. abort(this.reason)
  27679. } else {
  27680. this.abort = abort
  27681. }
  27682. }
  27683. onBodySent (chunk) {
  27684. if (this.handler.onBodySent) return this.handler.onBodySent(chunk)
  27685. }
  27686. static [kRetryHandlerDefaultRetry] (err, { state, opts }, cb) {
  27687. const { statusCode, code, headers } = err
  27688. const { method, retryOptions } = opts
  27689. const {
  27690. maxRetries,
  27691. timeout,
  27692. maxTimeout,
  27693. timeoutFactor,
  27694. statusCodes,
  27695. errorCodes,
  27696. methods
  27697. } = retryOptions
  27698. let { counter, currentTimeout } = state
  27699. currentTimeout =
  27700. currentTimeout != null && currentTimeout > 0 ? currentTimeout : timeout
  27701. // Any code that is not a Undici's originated and allowed to retry
  27702. if (
  27703. code &&
  27704. code !== 'UND_ERR_REQ_RETRY' &&
  27705. code !== 'UND_ERR_SOCKET' &&
  27706. !errorCodes.includes(code)
  27707. ) {
  27708. cb(err)
  27709. return
  27710. }
  27711. // If a set of method are provided and the current method is not in the list
  27712. if (Array.isArray(methods) && !methods.includes(method)) {
  27713. cb(err)
  27714. return
  27715. }
  27716. // If a set of status code are provided and the current status code is not in the list
  27717. if (
  27718. statusCode != null &&
  27719. Array.isArray(statusCodes) &&
  27720. !statusCodes.includes(statusCode)
  27721. ) {
  27722. cb(err)
  27723. return
  27724. }
  27725. // If we reached the max number of retries
  27726. if (counter > maxRetries) {
  27727. cb(err)
  27728. return
  27729. }
  27730. let retryAfterHeader = headers != null && headers['retry-after']
  27731. if (retryAfterHeader) {
  27732. retryAfterHeader = Number(retryAfterHeader)
  27733. retryAfterHeader = isNaN(retryAfterHeader)
  27734. ? calculateRetryAfterHeader(retryAfterHeader)
  27735. : retryAfterHeader * 1e3 // Retry-After is in seconds
  27736. }
  27737. const retryTimeout =
  27738. retryAfterHeader > 0
  27739. ? Math.min(retryAfterHeader, maxTimeout)
  27740. : Math.min(currentTimeout * timeoutFactor ** counter, maxTimeout)
  27741. state.currentTimeout = retryTimeout
  27742. setTimeout(() => cb(null), retryTimeout)
  27743. }
  27744. onHeaders (statusCode, rawHeaders, resume, statusMessage) {
  27745. const headers = parseHeaders(rawHeaders)
  27746. this.retryCount += 1
  27747. if (statusCode >= 300) {
  27748. this.abort(
  27749. new RequestRetryError('Request failed', statusCode, {
  27750. headers,
  27751. count: this.retryCount
  27752. })
  27753. )
  27754. return false
  27755. }
  27756. // Checkpoint for resume from where we left it
  27757. if (this.resume != null) {
  27758. this.resume = null
  27759. if (statusCode !== 206) {
  27760. return true
  27761. }
  27762. const contentRange = parseRangeHeader(headers['content-range'])
  27763. // If no content range
  27764. if (!contentRange) {
  27765. this.abort(
  27766. new RequestRetryError('Content-Range mismatch', statusCode, {
  27767. headers,
  27768. count: this.retryCount
  27769. })
  27770. )
  27771. return false
  27772. }
  27773. // Let's start with a weak etag check
  27774. if (this.etag != null && this.etag !== headers.etag) {
  27775. this.abort(
  27776. new RequestRetryError('ETag mismatch', statusCode, {
  27777. headers,
  27778. count: this.retryCount
  27779. })
  27780. )
  27781. return false
  27782. }
  27783. const { start, size, end = size } = contentRange
  27784. assert(this.start === start, 'content-range mismatch')
  27785. assert(this.end == null || this.end === end, 'content-range mismatch')
  27786. this.resume = resume
  27787. return true
  27788. }
  27789. if (this.end == null) {
  27790. if (statusCode === 206) {
  27791. // First time we receive 206
  27792. const range = parseRangeHeader(headers['content-range'])
  27793. if (range == null) {
  27794. return this.handler.onHeaders(
  27795. statusCode,
  27796. rawHeaders,
  27797. resume,
  27798. statusMessage
  27799. )
  27800. }
  27801. const { start, size, end = size } = range
  27802. assert(
  27803. start != null && Number.isFinite(start) && this.start !== start,
  27804. 'content-range mismatch'
  27805. )
  27806. assert(Number.isFinite(start))
  27807. assert(
  27808. end != null && Number.isFinite(end) && this.end !== end,
  27809. 'invalid content-length'
  27810. )
  27811. this.start = start
  27812. this.end = end
  27813. }
  27814. // We make our best to checkpoint the body for further range headers
  27815. if (this.end == null) {
  27816. const contentLength = headers['content-length']
  27817. this.end = contentLength != null ? Number(contentLength) : null
  27818. }
  27819. assert(Number.isFinite(this.start))
  27820. assert(
  27821. this.end == null || Number.isFinite(this.end),
  27822. 'invalid content-length'
  27823. )
  27824. this.resume = resume
  27825. this.etag = headers.etag != null ? headers.etag : null
  27826. return this.handler.onHeaders(
  27827. statusCode,
  27828. rawHeaders,
  27829. resume,
  27830. statusMessage
  27831. )
  27832. }
  27833. const err = new RequestRetryError('Request failed', statusCode, {
  27834. headers,
  27835. count: this.retryCount
  27836. })
  27837. this.abort(err)
  27838. return false
  27839. }
  27840. onData (chunk) {
  27841. this.start += chunk.length
  27842. return this.handler.onData(chunk)
  27843. }
  27844. onComplete (rawTrailers) {
  27845. this.retryCount = 0
  27846. return this.handler.onComplete(rawTrailers)
  27847. }
  27848. onError (err) {
  27849. if (this.aborted || isDisturbed(this.opts.body)) {
  27850. return this.handler.onError(err)
  27851. }
  27852. this.retryOpts.retry(
  27853. err,
  27854. {
  27855. state: { counter: this.retryCount++, currentTimeout: this.retryAfter },
  27856. opts: { retryOptions: this.retryOpts, ...this.opts }
  27857. },
  27858. onRetry.bind(this)
  27859. )
  27860. function onRetry (err) {
  27861. if (err != null || this.aborted || isDisturbed(this.opts.body)) {
  27862. return this.handler.onError(err)
  27863. }
  27864. if (this.start !== 0) {
  27865. this.opts = {
  27866. ...this.opts,
  27867. headers: {
  27868. ...this.opts.headers,
  27869. range: `bytes=${this.start}-${this.end ?? ''}`
  27870. }
  27871. }
  27872. }
  27873. try {
  27874. this.dispatch(this.opts, this)
  27875. } catch (err) {
  27876. this.handler.onError(err)
  27877. }
  27878. }
  27879. }
  27880. }
  27881. module.exports = RetryHandler
  27882. /***/ }),
  27883. /***/ 8861:
  27884. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  27885. "use strict";
  27886. const RedirectHandler = __nccwpck_require__(2860)
  27887. function createRedirectInterceptor ({ maxRedirections: defaultMaxRedirections }) {
  27888. return (dispatch) => {
  27889. return function Intercept (opts, handler) {
  27890. const { maxRedirections = defaultMaxRedirections } = opts
  27891. if (!maxRedirections) {
  27892. return dispatch(opts, handler)
  27893. }
  27894. const redirectHandler = new RedirectHandler(dispatch, maxRedirections, opts, handler)
  27895. opts = { ...opts, maxRedirections: 0 } // Stop sub dispatcher from also redirecting.
  27896. return dispatch(opts, redirectHandler)
  27897. }
  27898. }
  27899. }
  27900. module.exports = createRedirectInterceptor
  27901. /***/ }),
  27902. /***/ 953:
  27903. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  27904. "use strict";
  27905. Object.defineProperty(exports, "__esModule", ({ value: true }));
  27906. 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;
  27907. const utils_1 = __nccwpck_require__(1891);
  27908. // C headers
  27909. var ERROR;
  27910. (function (ERROR) {
  27911. ERROR[ERROR["OK"] = 0] = "OK";
  27912. ERROR[ERROR["INTERNAL"] = 1] = "INTERNAL";
  27913. ERROR[ERROR["STRICT"] = 2] = "STRICT";
  27914. ERROR[ERROR["LF_EXPECTED"] = 3] = "LF_EXPECTED";
  27915. ERROR[ERROR["UNEXPECTED_CONTENT_LENGTH"] = 4] = "UNEXPECTED_CONTENT_LENGTH";
  27916. ERROR[ERROR["CLOSED_CONNECTION"] = 5] = "CLOSED_CONNECTION";
  27917. ERROR[ERROR["INVALID_METHOD"] = 6] = "INVALID_METHOD";
  27918. ERROR[ERROR["INVALID_URL"] = 7] = "INVALID_URL";
  27919. ERROR[ERROR["INVALID_CONSTANT"] = 8] = "INVALID_CONSTANT";
  27920. ERROR[ERROR["INVALID_VERSION"] = 9] = "INVALID_VERSION";
  27921. ERROR[ERROR["INVALID_HEADER_TOKEN"] = 10] = "INVALID_HEADER_TOKEN";
  27922. ERROR[ERROR["INVALID_CONTENT_LENGTH"] = 11] = "INVALID_CONTENT_LENGTH";
  27923. ERROR[ERROR["INVALID_CHUNK_SIZE"] = 12] = "INVALID_CHUNK_SIZE";
  27924. ERROR[ERROR["INVALID_STATUS"] = 13] = "INVALID_STATUS";
  27925. ERROR[ERROR["INVALID_EOF_STATE"] = 14] = "INVALID_EOF_STATE";
  27926. ERROR[ERROR["INVALID_TRANSFER_ENCODING"] = 15] = "INVALID_TRANSFER_ENCODING";
  27927. ERROR[ERROR["CB_MESSAGE_BEGIN"] = 16] = "CB_MESSAGE_BEGIN";
  27928. ERROR[ERROR["CB_HEADERS_COMPLETE"] = 17] = "CB_HEADERS_COMPLETE";
  27929. ERROR[ERROR["CB_MESSAGE_COMPLETE"] = 18] = "CB_MESSAGE_COMPLETE";
  27930. ERROR[ERROR["CB_CHUNK_HEADER"] = 19] = "CB_CHUNK_HEADER";
  27931. ERROR[ERROR["CB_CHUNK_COMPLETE"] = 20] = "CB_CHUNK_COMPLETE";
  27932. ERROR[ERROR["PAUSED"] = 21] = "PAUSED";
  27933. ERROR[ERROR["PAUSED_UPGRADE"] = 22] = "PAUSED_UPGRADE";
  27934. ERROR[ERROR["PAUSED_H2_UPGRADE"] = 23] = "PAUSED_H2_UPGRADE";
  27935. ERROR[ERROR["USER"] = 24] = "USER";
  27936. })(ERROR = exports.ERROR || (exports.ERROR = {}));
  27937. var TYPE;
  27938. (function (TYPE) {
  27939. TYPE[TYPE["BOTH"] = 0] = "BOTH";
  27940. TYPE[TYPE["REQUEST"] = 1] = "REQUEST";
  27941. TYPE[TYPE["RESPONSE"] = 2] = "RESPONSE";
  27942. })(TYPE = exports.TYPE || (exports.TYPE = {}));
  27943. var FLAGS;
  27944. (function (FLAGS) {
  27945. FLAGS[FLAGS["CONNECTION_KEEP_ALIVE"] = 1] = "CONNECTION_KEEP_ALIVE";
  27946. FLAGS[FLAGS["CONNECTION_CLOSE"] = 2] = "CONNECTION_CLOSE";
  27947. FLAGS[FLAGS["CONNECTION_UPGRADE"] = 4] = "CONNECTION_UPGRADE";
  27948. FLAGS[FLAGS["CHUNKED"] = 8] = "CHUNKED";
  27949. FLAGS[FLAGS["UPGRADE"] = 16] = "UPGRADE";
  27950. FLAGS[FLAGS["CONTENT_LENGTH"] = 32] = "CONTENT_LENGTH";
  27951. FLAGS[FLAGS["SKIPBODY"] = 64] = "SKIPBODY";
  27952. FLAGS[FLAGS["TRAILING"] = 128] = "TRAILING";
  27953. // 1 << 8 is unused
  27954. FLAGS[FLAGS["TRANSFER_ENCODING"] = 512] = "TRANSFER_ENCODING";
  27955. })(FLAGS = exports.FLAGS || (exports.FLAGS = {}));
  27956. var LENIENT_FLAGS;
  27957. (function (LENIENT_FLAGS) {
  27958. LENIENT_FLAGS[LENIENT_FLAGS["HEADERS"] = 1] = "HEADERS";
  27959. LENIENT_FLAGS[LENIENT_FLAGS["CHUNKED_LENGTH"] = 2] = "CHUNKED_LENGTH";
  27960. LENIENT_FLAGS[LENIENT_FLAGS["KEEP_ALIVE"] = 4] = "KEEP_ALIVE";
  27961. })(LENIENT_FLAGS = exports.LENIENT_FLAGS || (exports.LENIENT_FLAGS = {}));
  27962. var METHODS;
  27963. (function (METHODS) {
  27964. METHODS[METHODS["DELETE"] = 0] = "DELETE";
  27965. METHODS[METHODS["GET"] = 1] = "GET";
  27966. METHODS[METHODS["HEAD"] = 2] = "HEAD";
  27967. METHODS[METHODS["POST"] = 3] = "POST";
  27968. METHODS[METHODS["PUT"] = 4] = "PUT";
  27969. /* pathological */
  27970. METHODS[METHODS["CONNECT"] = 5] = "CONNECT";
  27971. METHODS[METHODS["OPTIONS"] = 6] = "OPTIONS";
  27972. METHODS[METHODS["TRACE"] = 7] = "TRACE";
  27973. /* WebDAV */
  27974. METHODS[METHODS["COPY"] = 8] = "COPY";
  27975. METHODS[METHODS["LOCK"] = 9] = "LOCK";
  27976. METHODS[METHODS["MKCOL"] = 10] = "MKCOL";
  27977. METHODS[METHODS["MOVE"] = 11] = "MOVE";
  27978. METHODS[METHODS["PROPFIND"] = 12] = "PROPFIND";
  27979. METHODS[METHODS["PROPPATCH"] = 13] = "PROPPATCH";
  27980. METHODS[METHODS["SEARCH"] = 14] = "SEARCH";
  27981. METHODS[METHODS["UNLOCK"] = 15] = "UNLOCK";
  27982. METHODS[METHODS["BIND"] = 16] = "BIND";
  27983. METHODS[METHODS["REBIND"] = 17] = "REBIND";
  27984. METHODS[METHODS["UNBIND"] = 18] = "UNBIND";
  27985. METHODS[METHODS["ACL"] = 19] = "ACL";
  27986. /* subversion */
  27987. METHODS[METHODS["REPORT"] = 20] = "REPORT";
  27988. METHODS[METHODS["MKACTIVITY"] = 21] = "MKACTIVITY";
  27989. METHODS[METHODS["CHECKOUT"] = 22] = "CHECKOUT";
  27990. METHODS[METHODS["MERGE"] = 23] = "MERGE";
  27991. /* upnp */
  27992. METHODS[METHODS["M-SEARCH"] = 24] = "M-SEARCH";
  27993. METHODS[METHODS["NOTIFY"] = 25] = "NOTIFY";
  27994. METHODS[METHODS["SUBSCRIBE"] = 26] = "SUBSCRIBE";
  27995. METHODS[METHODS["UNSUBSCRIBE"] = 27] = "UNSUBSCRIBE";
  27996. /* RFC-5789 */
  27997. METHODS[METHODS["PATCH"] = 28] = "PATCH";
  27998. METHODS[METHODS["PURGE"] = 29] = "PURGE";
  27999. /* CalDAV */
  28000. METHODS[METHODS["MKCALENDAR"] = 30] = "MKCALENDAR";
  28001. /* RFC-2068, section 19.6.1.2 */
  28002. METHODS[METHODS["LINK"] = 31] = "LINK";
  28003. METHODS[METHODS["UNLINK"] = 32] = "UNLINK";
  28004. /* icecast */
  28005. METHODS[METHODS["SOURCE"] = 33] = "SOURCE";
  28006. /* RFC-7540, section 11.6 */
  28007. METHODS[METHODS["PRI"] = 34] = "PRI";
  28008. /* RFC-2326 RTSP */
  28009. METHODS[METHODS["DESCRIBE"] = 35] = "DESCRIBE";
  28010. METHODS[METHODS["ANNOUNCE"] = 36] = "ANNOUNCE";
  28011. METHODS[METHODS["SETUP"] = 37] = "SETUP";
  28012. METHODS[METHODS["PLAY"] = 38] = "PLAY";
  28013. METHODS[METHODS["PAUSE"] = 39] = "PAUSE";
  28014. METHODS[METHODS["TEARDOWN"] = 40] = "TEARDOWN";
  28015. METHODS[METHODS["GET_PARAMETER"] = 41] = "GET_PARAMETER";
  28016. METHODS[METHODS["SET_PARAMETER"] = 42] = "SET_PARAMETER";
  28017. METHODS[METHODS["REDIRECT"] = 43] = "REDIRECT";
  28018. METHODS[METHODS["RECORD"] = 44] = "RECORD";
  28019. /* RAOP */
  28020. METHODS[METHODS["FLUSH"] = 45] = "FLUSH";
  28021. })(METHODS = exports.METHODS || (exports.METHODS = {}));
  28022. exports.METHODS_HTTP = [
  28023. METHODS.DELETE,
  28024. METHODS.GET,
  28025. METHODS.HEAD,
  28026. METHODS.POST,
  28027. METHODS.PUT,
  28028. METHODS.CONNECT,
  28029. METHODS.OPTIONS,
  28030. METHODS.TRACE,
  28031. METHODS.COPY,
  28032. METHODS.LOCK,
  28033. METHODS.MKCOL,
  28034. METHODS.MOVE,
  28035. METHODS.PROPFIND,
  28036. METHODS.PROPPATCH,
  28037. METHODS.SEARCH,
  28038. METHODS.UNLOCK,
  28039. METHODS.BIND,
  28040. METHODS.REBIND,
  28041. METHODS.UNBIND,
  28042. METHODS.ACL,
  28043. METHODS.REPORT,
  28044. METHODS.MKACTIVITY,
  28045. METHODS.CHECKOUT,
  28046. METHODS.MERGE,
  28047. METHODS['M-SEARCH'],
  28048. METHODS.NOTIFY,
  28049. METHODS.SUBSCRIBE,
  28050. METHODS.UNSUBSCRIBE,
  28051. METHODS.PATCH,
  28052. METHODS.PURGE,
  28053. METHODS.MKCALENDAR,
  28054. METHODS.LINK,
  28055. METHODS.UNLINK,
  28056. METHODS.PRI,
  28057. // TODO(indutny): should we allow it with HTTP?
  28058. METHODS.SOURCE,
  28059. ];
  28060. exports.METHODS_ICE = [
  28061. METHODS.SOURCE,
  28062. ];
  28063. exports.METHODS_RTSP = [
  28064. METHODS.OPTIONS,
  28065. METHODS.DESCRIBE,
  28066. METHODS.ANNOUNCE,
  28067. METHODS.SETUP,
  28068. METHODS.PLAY,
  28069. METHODS.PAUSE,
  28070. METHODS.TEARDOWN,
  28071. METHODS.GET_PARAMETER,
  28072. METHODS.SET_PARAMETER,
  28073. METHODS.REDIRECT,
  28074. METHODS.RECORD,
  28075. METHODS.FLUSH,
  28076. // For AirPlay
  28077. METHODS.GET,
  28078. METHODS.POST,
  28079. ];
  28080. exports.METHOD_MAP = utils_1.enumToMap(METHODS);
  28081. exports.H_METHOD_MAP = {};
  28082. Object.keys(exports.METHOD_MAP).forEach((key) => {
  28083. if (/^H/.test(key)) {
  28084. exports.H_METHOD_MAP[key] = exports.METHOD_MAP[key];
  28085. }
  28086. });
  28087. var FINISH;
  28088. (function (FINISH) {
  28089. FINISH[FINISH["SAFE"] = 0] = "SAFE";
  28090. FINISH[FINISH["SAFE_WITH_CB"] = 1] = "SAFE_WITH_CB";
  28091. FINISH[FINISH["UNSAFE"] = 2] = "UNSAFE";
  28092. })(FINISH = exports.FINISH || (exports.FINISH = {}));
  28093. exports.ALPHA = [];
  28094. for (let i = 'A'.charCodeAt(0); i <= 'Z'.charCodeAt(0); i++) {
  28095. // Upper case
  28096. exports.ALPHA.push(String.fromCharCode(i));
  28097. // Lower case
  28098. exports.ALPHA.push(String.fromCharCode(i + 0x20));
  28099. }
  28100. exports.NUM_MAP = {
  28101. 0: 0, 1: 1, 2: 2, 3: 3, 4: 4,
  28102. 5: 5, 6: 6, 7: 7, 8: 8, 9: 9,
  28103. };
  28104. exports.HEX_MAP = {
  28105. 0: 0, 1: 1, 2: 2, 3: 3, 4: 4,
  28106. 5: 5, 6: 6, 7: 7, 8: 8, 9: 9,
  28107. A: 0XA, B: 0XB, C: 0XC, D: 0XD, E: 0XE, F: 0XF,
  28108. a: 0xa, b: 0xb, c: 0xc, d: 0xd, e: 0xe, f: 0xf,
  28109. };
  28110. exports.NUM = [
  28111. '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
  28112. ];
  28113. exports.ALPHANUM = exports.ALPHA.concat(exports.NUM);
  28114. exports.MARK = ['-', '_', '.', '!', '~', '*', '\'', '(', ')'];
  28115. exports.USERINFO_CHARS = exports.ALPHANUM
  28116. .concat(exports.MARK)
  28117. .concat(['%', ';', ':', '&', '=', '+', '$', ',']);
  28118. // TODO(indutny): use RFC
  28119. exports.STRICT_URL_CHAR = [
  28120. '!', '"', '$', '%', '&', '\'',
  28121. '(', ')', '*', '+', ',', '-', '.', '/',
  28122. ':', ';', '<', '=', '>',
  28123. '@', '[', '\\', ']', '^', '_',
  28124. '`',
  28125. '{', '|', '}', '~',
  28126. ].concat(exports.ALPHANUM);
  28127. exports.URL_CHAR = exports.STRICT_URL_CHAR
  28128. .concat(['\t', '\f']);
  28129. // All characters with 0x80 bit set to 1
  28130. for (let i = 0x80; i <= 0xff; i++) {
  28131. exports.URL_CHAR.push(i);
  28132. }
  28133. exports.HEX = exports.NUM.concat(['a', 'b', 'c', 'd', 'e', 'f', 'A', 'B', 'C', 'D', 'E', 'F']);
  28134. /* Tokens as defined by rfc 2616. Also lowercases them.
  28135. * token = 1*<any CHAR except CTLs or separators>
  28136. * separators = "(" | ")" | "<" | ">" | "@"
  28137. * | "," | ";" | ":" | "\" | <">
  28138. * | "/" | "[" | "]" | "?" | "="
  28139. * | "{" | "}" | SP | HT
  28140. */
  28141. exports.STRICT_TOKEN = [
  28142. '!', '#', '$', '%', '&', '\'',
  28143. '*', '+', '-', '.',
  28144. '^', '_', '`',
  28145. '|', '~',
  28146. ].concat(exports.ALPHANUM);
  28147. exports.TOKEN = exports.STRICT_TOKEN.concat([' ']);
  28148. /*
  28149. * Verify that a char is a valid visible (printable) US-ASCII
  28150. * character or %x80-FF
  28151. */
  28152. exports.HEADER_CHARS = ['\t'];
  28153. for (let i = 32; i <= 255; i++) {
  28154. if (i !== 127) {
  28155. exports.HEADER_CHARS.push(i);
  28156. }
  28157. }
  28158. // ',' = \x44
  28159. exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS.filter((c) => c !== 44);
  28160. exports.MAJOR = exports.NUM_MAP;
  28161. exports.MINOR = exports.MAJOR;
  28162. var HEADER_STATE;
  28163. (function (HEADER_STATE) {
  28164. HEADER_STATE[HEADER_STATE["GENERAL"] = 0] = "GENERAL";
  28165. HEADER_STATE[HEADER_STATE["CONNECTION"] = 1] = "CONNECTION";
  28166. HEADER_STATE[HEADER_STATE["CONTENT_LENGTH"] = 2] = "CONTENT_LENGTH";
  28167. HEADER_STATE[HEADER_STATE["TRANSFER_ENCODING"] = 3] = "TRANSFER_ENCODING";
  28168. HEADER_STATE[HEADER_STATE["UPGRADE"] = 4] = "UPGRADE";
  28169. HEADER_STATE[HEADER_STATE["CONNECTION_KEEP_ALIVE"] = 5] = "CONNECTION_KEEP_ALIVE";
  28170. HEADER_STATE[HEADER_STATE["CONNECTION_CLOSE"] = 6] = "CONNECTION_CLOSE";
  28171. HEADER_STATE[HEADER_STATE["CONNECTION_UPGRADE"] = 7] = "CONNECTION_UPGRADE";
  28172. HEADER_STATE[HEADER_STATE["TRANSFER_ENCODING_CHUNKED"] = 8] = "TRANSFER_ENCODING_CHUNKED";
  28173. })(HEADER_STATE = exports.HEADER_STATE || (exports.HEADER_STATE = {}));
  28174. exports.SPECIAL_HEADERS = {
  28175. 'connection': HEADER_STATE.CONNECTION,
  28176. 'content-length': HEADER_STATE.CONTENT_LENGTH,
  28177. 'proxy-connection': HEADER_STATE.CONNECTION,
  28178. 'transfer-encoding': HEADER_STATE.TRANSFER_ENCODING,
  28179. 'upgrade': HEADER_STATE.UPGRADE,
  28180. };
  28181. //# sourceMappingURL=constants.js.map
  28182. /***/ }),
  28183. /***/ 1145:
  28184. /***/ ((module) => {
  28185. module.exports = 'AGFzbQEAAAABMAhgAX8Bf2ADf39/AX9gBH9/f38Bf2AAAGADf39/AGABfwBgAn9/AGAGf39/f39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQACA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAA0ZFAwMEAAAFAAAAAAAABQEFAAUFBQAABgAAAAAGBgYGAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAAABAQcAAAUFAwABBAUBcAESEgUDAQACBggBfwFBgNQECwfRBSIGbWVtb3J5AgALX2luaXRpYWxpemUACRlfX2luZGlyZWN0X2Z1bmN0aW9uX3RhYmxlAQALbGxodHRwX2luaXQAChhsbGh0dHBfc2hvdWxkX2tlZXBfYWxpdmUAQQxsbGh0dHBfYWxsb2MADAZtYWxsb2MARgtsbGh0dHBfZnJlZQANBGZyZWUASA9sbGh0dHBfZ2V0X3R5cGUADhVsbGh0dHBfZ2V0X2h0dHBfbWFqb3IADxVsbGh0dHBfZ2V0X2h0dHBfbWlub3IAEBFsbGh0dHBfZ2V0X21ldGhvZAARFmxsaHR0cF9nZXRfc3RhdHVzX2NvZGUAEhJsbGh0dHBfZ2V0X3VwZ3JhZGUAEwxsbGh0dHBfcmVzZXQAFA5sbGh0dHBfZXhlY3V0ZQAVFGxsaHR0cF9zZXR0aW5nc19pbml0ABYNbGxodHRwX2ZpbmlzaAAXDGxsaHR0cF9wYXVzZQAYDWxsaHR0cF9yZXN1bWUAGRtsbGh0dHBfc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AJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ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0IgBxDQBBACAEIAByNgKI0ICAACACIQAMAQsgAigCCCEACyAAIAE2AgwgAiABNgIIIAEgAjYCDCABIAA2AggPC0EfIQICQCAAQf///wdLDQAgAEEIdiICIAJBgP4/akEQdkEIcSICdCIEIARBgOAfakEQdkEEcSIEdCIGIAZBgIAPakEQdkECcSIGdEEPdiACIARyIAZyayICQQF0IAAgAkEVanZBAXFyQRxqIQILIAEgAjYCHCABQgA3AhAgAkECdEG40oCAAGohBAJAAkBBACgCjNCAgAAiBkEBIAJ0IgNxDQAgBCABNgIAQQAgBiADcjYCjNCAgAAgASAENgIYIAEgATYCCCABIAE2AgwMAQsgAEEAQRkgAkEBdmsgAkEfRht0IQIgBCgCACEGAkADQCAGIgQoAgRBeHEgAEYNASACQR12IQYgAkEBdCECIAQgBkEEcWpBEGoiAygCACIGDQALIAMgATYCACABIAQ2AhggASABNgIMIAEgATYCCAwBCyAEKAIIIgAgATYCDCAEIAE2AgggAUEANgIYIAEgBDYCDCABIAA2AggLQQBBACgCqNCAgABBf2oiAUF/IAEbNgKo0ICAAAsLBAAAAAtOAAJAIAANAD8AQRB0DwsCQCAAQf//A3ENACAAQX9MDQACQCAAQRB2QAAiAEF/Rw0AQQBBMDYC+NOAgABBfw8LIABBEHQPCxDKgICAAAAL8gICA38BfgJAIAJFDQAgACABOgAAIAIgAGoiA0F/aiABOgAAIAJBA0kNACAAIAE6AAIgACABOgABIANBfWogAToAACADQX5qIAE6AAAgAkEHSQ0AIAAgAToAAyADQXxqIAE6AAAgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIFayICQSBJDQAgAa1CgYCAgB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ZW5pZW50X3RyYW5zZmVyX2VuY29kaW5nACUYbGxodHRwX21lc3NhZ2VfbmVlZHNfZW9mAD8JFwEAQQELEQECAwQFCwYHNTk3MS8tJyspCrLgAkUCAAsIABCIgICAAAsZACAAEMKAgIAAGiAAIAI2AjggACABOgAoCxwAIAAgAC8BMiAALQAuIAAQwYCAgAAQgICAgAALKgEBf0HAABDGgICAACIBEMKAgIAAGiABQYCIgIAANgI4IAEgADoAKCABCwoAIAAQyICAgAALBwAgAC0AKAsHACAALQAqCwcAIAAtACsLBwAgAC0AKQsHACAALwEyCwcAIAAtAC4LRQEEfyAAKAIYIQEgAC0ALSECIAAtACghAyAAKAI4IQQgABDCgICAABogACAENgI4IAAgAzoAKCAAIAI6AC0gACABNgIYCxEAIAAgASABIAJqEMOAgIAACxAAIABBAEHcABDMgICAABoLZwEBf0EAIQECQCAAKAIMDQACQAJAAkACQCAALQAvDgMBAAMCCyAAKAI4IgFFDQAgASgCLCIBRQ0AIAAgARGAgICAAAAiAQ0DC0EADwsQyoCAgAAACyAAQcOWgIAANgIQQQ4hAQsgAQseAAJAIAAoAgwNACAAQdGbgIAANgIQIABBFTYCDAsLFgACQCAAKAIMQRVHDQAgAEEANgIMCwsWAAJAIAAoAgxBFkcNACAAQQA2AgwLCwcAIAAoAgwLBwAgACgCEAsJACAAIAE2AhALBwAgACgCFAsiAAJAIABBJEkNABDKgICAAAALIABBAnRBoLOAgABqKAIACyIAAkAgAEEuSQ0AEMqAgIAAAAsgAEECdEGwtICAAGooAgAL7gsBAX9B66iAgAAhAQJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJA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DQAgAC8BMkH//wNxIgVBnH9qQeQASQ0AIAVBzAFGDQAgBUGwAkYNACAEQcAAcQ0AQQAhAyAEQYgEcUGABEYNACAEQShxQQBHIQMLIABBADsBMCAAQQA6AC8gAwuZAQECfwJAAkACQCAALQAqRQ0AIAAtACtFDQBBACEBIAAvATAiAkECcUUNAQwCC0EAIQEgAC8BMCICQQFxRQ0BC0EBIQEgAC0AKEEBRg0AIAAvATJB//8DcSIAQZx/akHkAEkNACAAQcwBRg0AIABBsAJGDQAgAkHAAHENAEEAIQEgAkGIBHFBgARGDQAgAkEocUEARyEBCyABC0kBAXsgAEEQav0MAAAAAAAAAAAAAAAAAAAAACIB/QsDACAAIAH9CwMAIABBMGogAf0LAwAgAEEgaiAB/QsDACAAQd0BNgIcQQALewEBfwJAIAAoAgwiAw0AAkAgACgCBEUNACAAIAE2AgQLAkAgACABIAIQxICAgAAiAw0AIAAoAgwPCyAAIAM2AhxBACEDIAAoAgQiAUUNACAAIAEgAiAAKAIIEYGAgIAAACIBRQ0AIAAgAjYCFCAAIAE2AgwgASEDCyADC+TzAQMOfwN+BH8jgICAgABBEGsiAySAgICAACABIQQgASEFIAEhBiABIQcgASEIIAEhCSABIQogASELIAEhDCABIQ0gASEOIAEhDwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAC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AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIBAOxwEAAQIDBAUGBwgJCgsMDQ4PEBESExQVFhcYGRobHB4fICEjJSg/QEFERUZHSElKS0xNT1BRUlPeA1dZW1xdYGJlZmdoaWprbG1vcHFyc3R1dnd4eXp7fH1+gAGCAYUBhgGHAYkBiwGMAY0BjgGPAZABkQGUAZUBlgGXAZgBmQGaAZsBnAGdAZ4BnwGgAaEBogGjAaQBpQGmAacBqAGpAaoBqwGsAa0BrgGvAbABsQGyAbMBtAG1AbYBtwG4AbkBugG7AbwBvQG+Ab8BwAHBAcIBwwHEAcUBxgHHAcgByQHKAcsBzAHNAc4BzwHQAdEB0gHTAdQB1QHWAdcB2AHZAdoB2wHcAd0B3gHgAeEB4gHjAeQB5QHmAecB6AHpAeoB6wHsAe0B7gHvAfAB8QHyAfMBmQKkArAC/gL+AgsgASIEIAJHDfMBQd0BIRAM/wMLIAEiECACRw3dAUHDASEQDP4DCyABIgEgAkcNkAFB9wAhEAz9AwsgASIBIAJHDYYBQe8AIRAM/AMLIAEiASACRw1/QeoAIRAM+wMLIAEiASACRw17QegAIRAM+gMLIAEiASACRw14QeYAIRAM+QMLIAEiASACRw0aQRghEAz4AwsgASIBIAJHDRRBEiEQDPcDCyABIgEgAkcNWUHFACEQDPYDCyABIgEgAkcNSkE/IRAM9QMLIAEiASACRw1IQTwhEAz0AwsgASIBIAJHDUFBMSEQDPMDCyAALQAuQQFGDesDDIcCCyAAIAEiASACEMCAgIAAQQFHDeYBIABCADcDIAznAQsgACABIgEgAhC0gICAACIQDecBIAEhAQz1AgsCQCABIgEgAkcNAEEGIRAM8AMLIAAgAUEBaiIBIAIQu4CAgAAiEA3oASABIQEMMQsgAEIANwMgQRIhEAzVAwsgASIQIAJHDStBHSEQDO0DCwJAIAEiASACRg0AIAFBAWohAUEQIRAM1AMLQQchEAzsAwsgAEIAIAApAyAiESACIAEiEGutIhJ9IhMgEyARVhs3AyAgESASViIURQ3lAUEIIRAM6wMLAkAgASIBIAJGDQAgAEGJgICAADYCCCAAIAE2AgQgASEBQRQhEAzSAwtBCSEQDOoDCyABIQEgACkDIFAN5AEgASEBDPICCwJAIAEiASACRw0AQQshEAzpAwsgACABQQFqIgEgAhC2gICAACIQDeUBIAEhAQzyAgsgACABIgEgAhC4gICAACIQDeUBIAEhAQzyAgsgACABIgEgAhC4gICAACIQDeYBIAEhAQwNCyAAIAEiASACELqAgIAAIhAN5wEgASEBDPACCwJAIAEiASACRw0AQQ8hEAzlAwsgAS0AACIQQTtGDQggEEENRw3oASABQQFqIQEM7wILIAAgASIBIAIQuoCAgAAiEA3oASABIQEM8gILA0ACQCABLQAAQfC1gIAAai0AACIQQQFGDQAgEEECRw3rASAAKAIEIRAgAEEANgIEIAAgECAB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hwgACABNgIUIAAgBDYCDEEAIRAMvAELIAAoAgQhBCAAQQA2AgQCQCAAIAQgARCtgICAACIEDQAgASEBDKkBCyAAQdwANgIcIAAgATYCFCAAIAQ2AgxBACEQDLsBCwJAIAEtAABBUGoiEEH/AXFBCk8NACAAIBA6ACogAUEBaiEBQc8AIRAMogELIAAoAgQhBCAAQQA2AgQCQCAAIAQgARCtgICAACIEDQAgASEBDKcBCyAAQd4ANgIcIAAgATYCFCAAIAQ2AgxBACEQDLoBCyAAQQA2AgAgF0EBaiEBAkAgAC0AKUEjTw0AIAEhAQxZCyAAQQA2AhwgACABNgIUIABB04mAgAA2AhAgAEEINgIMQQAhEAy5AQsgAEEANgIAC0EAIRAgAEEANgIcIAAgATYCFCAAQZCzgIAANgIQIABBCDYCDAy3AQsgAEEANgIAIBdBAWohAQJAIAAtAClBIUcNACABIQEMVgsgAEEANgIcIAAgATYCFCAAQZuKgIAANgIQIABBCDYCDEEAIRAMtgELIABBADYCACAXQQFqIQECQCAALQApIhBBXWpBC08NACABIQEMVQsCQCAQQQZLDQBBASAQdEHKAHFFDQAgASEBDFULQQAhECAAQQA2AhwgACABNgIUIABB94mAgAA2AhAgAEEINgIMDLUBCyAQQRVGDXEgAEEANgIcIAAgATYCFCAAQbmNgIAANgIQIABBGjYCDEEAIRAMtAELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDFQLIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMswELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDE0LIABB0gA2AhwgACABNgIUIAAgEDYCDEEAIRAMsgELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDE0LIABB0wA2AhwgACABNgIUIAAgEDYCDEEAIRAMsQELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDFELIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMsAELIABBADYCHCAAIAE2AhQgAEH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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE5PVU5DRUVDS09VVE5FQ1RFVEVDUklCRUxVU0hFVEVBRFNFQVJDSFJHRUNUSVZJVFlMRU5EQVJWRU9USUZZUFRJT05TQ0hTRUFZU1RBVENIR0VPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFSFRUUC9BRFRQLw=='
  28190. /***/ }),
  28191. /***/ 1891:
  28192. /***/ ((__unused_webpack_module, exports) => {
  28193. "use strict";
  28194. Object.defineProperty(exports, "__esModule", ({ value: true }));
  28195. exports.enumToMap = void 0;
  28196. function enumToMap(obj) {
  28197. const res = {};
  28198. Object.keys(obj).forEach((key) => {
  28199. const value = obj[key];
  28200. if (typeof value === 'number') {
  28201. res[key] = value;
  28202. }
  28203. });
  28204. return res;
  28205. }
  28206. exports.enumToMap = enumToMap;
  28207. //# sourceMappingURL=utils.js.map
  28208. /***/ }),
  28209. /***/ 6771:
  28210. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28211. "use strict";
  28212. const { kClients } = __nccwpck_require__(2785)
  28213. const Agent = __nccwpck_require__(7890)
  28214. const {
  28215. kAgent,
  28216. kMockAgentSet,
  28217. kMockAgentGet,
  28218. kDispatches,
  28219. kIsMockActive,
  28220. kNetConnect,
  28221. kGetNetConnect,
  28222. kOptions,
  28223. kFactory
  28224. } = __nccwpck_require__(4347)
  28225. const MockClient = __nccwpck_require__(8687)
  28226. const MockPool = __nccwpck_require__(6193)
  28227. const { matchValue, buildMockOptions } = __nccwpck_require__(9323)
  28228. const { InvalidArgumentError, UndiciError } = __nccwpck_require__(8045)
  28229. const Dispatcher = __nccwpck_require__(412)
  28230. const Pluralizer = __nccwpck_require__(8891)
  28231. const PendingInterceptorsFormatter = __nccwpck_require__(6823)
  28232. class FakeWeakRef {
  28233. constructor (value) {
  28234. this.value = value
  28235. }
  28236. deref () {
  28237. return this.value
  28238. }
  28239. }
  28240. class MockAgent extends Dispatcher {
  28241. constructor (opts) {
  28242. super(opts)
  28243. this[kNetConnect] = true
  28244. this[kIsMockActive] = true
  28245. // Instantiate Agent and encapsulate
  28246. if ((opts && opts.agent && typeof opts.agent.dispatch !== 'function')) {
  28247. throw new InvalidArgumentError('Argument opts.agent must implement Agent')
  28248. }
  28249. const agent = opts && opts.agent ? opts.agent : new Agent(opts)
  28250. this[kAgent] = agent
  28251. this[kClients] = agent[kClients]
  28252. this[kOptions] = buildMockOptions(opts)
  28253. }
  28254. get (origin) {
  28255. let dispatcher = this[kMockAgentGet](origin)
  28256. if (!dispatcher) {
  28257. dispatcher = this[kFactory](origin)
  28258. this[kMockAgentSet](origin, dispatcher)
  28259. }
  28260. return dispatcher
  28261. }
  28262. dispatch (opts, handler) {
  28263. // Call MockAgent.get to perform additional setup before dispatching as normal
  28264. this.get(opts.origin)
  28265. return this[kAgent].dispatch(opts, handler)
  28266. }
  28267. async close () {
  28268. await this[kAgent].close()
  28269. this[kClients].clear()
  28270. }
  28271. deactivate () {
  28272. this[kIsMockActive] = false
  28273. }
  28274. activate () {
  28275. this[kIsMockActive] = true
  28276. }
  28277. enableNetConnect (matcher) {
  28278. if (typeof matcher === 'string' || typeof matcher === 'function' || matcher instanceof RegExp) {
  28279. if (Array.isArray(this[kNetConnect])) {
  28280. this[kNetConnect].push(matcher)
  28281. } else {
  28282. this[kNetConnect] = [matcher]
  28283. }
  28284. } else if (typeof matcher === 'undefined') {
  28285. this[kNetConnect] = true
  28286. } else {
  28287. throw new InvalidArgumentError('Unsupported matcher. Must be one of String|Function|RegExp.')
  28288. }
  28289. }
  28290. disableNetConnect () {
  28291. this[kNetConnect] = false
  28292. }
  28293. // This is required to bypass issues caused by using global symbols - see:
  28294. // https://github.com/nodejs/undici/issues/1447
  28295. get isMockActive () {
  28296. return this[kIsMockActive]
  28297. }
  28298. [kMockAgentSet] (origin, dispatcher) {
  28299. this[kClients].set(origin, new FakeWeakRef(dispatcher))
  28300. }
  28301. [kFactory] (origin) {
  28302. const mockOptions = Object.assign({ agent: this }, this[kOptions])
  28303. return this[kOptions] && this[kOptions].connections === 1
  28304. ? new MockClient(origin, mockOptions)
  28305. : new MockPool(origin, mockOptions)
  28306. }
  28307. [kMockAgentGet] (origin) {
  28308. // First check if we can immediately find it
  28309. const ref = this[kClients].get(origin)
  28310. if (ref) {
  28311. return ref.deref()
  28312. }
  28313. // If the origin is not a string create a dummy parent pool and return to user
  28314. if (typeof origin !== 'string') {
  28315. const dispatcher = this[kFactory]('http://localhost:9999')
  28316. this[kMockAgentSet](origin, dispatcher)
  28317. return dispatcher
  28318. }
  28319. // If we match, create a pool and assign the same dispatches
  28320. for (const [keyMatcher, nonExplicitRef] of Array.from(this[kClients])) {
  28321. const nonExplicitDispatcher = nonExplicitRef.deref()
  28322. if (nonExplicitDispatcher && typeof keyMatcher !== 'string' && matchValue(keyMatcher, origin)) {
  28323. const dispatcher = this[kFactory](origin)
  28324. this[kMockAgentSet](origin, dispatcher)
  28325. dispatcher[kDispatches] = nonExplicitDispatcher[kDispatches]
  28326. return dispatcher
  28327. }
  28328. }
  28329. }
  28330. [kGetNetConnect] () {
  28331. return this[kNetConnect]
  28332. }
  28333. pendingInterceptors () {
  28334. const mockAgentClients = this[kClients]
  28335. return Array.from(mockAgentClients.entries())
  28336. .flatMap(([origin, scope]) => scope.deref()[kDispatches].map(dispatch => ({ ...dispatch, origin })))
  28337. .filter(({ pending }) => pending)
  28338. }
  28339. assertNoPendingInterceptors ({ pendingInterceptorsFormatter = new PendingInterceptorsFormatter() } = {}) {
  28340. const pending = this.pendingInterceptors()
  28341. if (pending.length === 0) {
  28342. return
  28343. }
  28344. const pluralizer = new Pluralizer('interceptor', 'interceptors').pluralize(pending.length)
  28345. throw new UndiciError(`
  28346. ${pluralizer.count} ${pluralizer.noun} ${pluralizer.is} pending:
  28347. ${pendingInterceptorsFormatter.format(pending)}
  28348. `.trim())
  28349. }
  28350. }
  28351. module.exports = MockAgent
  28352. /***/ }),
  28353. /***/ 8687:
  28354. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28355. "use strict";
  28356. const { promisify } = __nccwpck_require__(3837)
  28357. const Client = __nccwpck_require__(3598)
  28358. const { buildMockDispatch } = __nccwpck_require__(9323)
  28359. const {
  28360. kDispatches,
  28361. kMockAgent,
  28362. kClose,
  28363. kOriginalClose,
  28364. kOrigin,
  28365. kOriginalDispatch,
  28366. kConnected
  28367. } = __nccwpck_require__(4347)
  28368. const { MockInterceptor } = __nccwpck_require__(410)
  28369. const Symbols = __nccwpck_require__(2785)
  28370. const { InvalidArgumentError } = __nccwpck_require__(8045)
  28371. /**
  28372. * MockClient provides an API that extends the Client to influence the mockDispatches.
  28373. */
  28374. class MockClient extends Client {
  28375. constructor (origin, opts) {
  28376. super(origin, opts)
  28377. if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') {
  28378. throw new InvalidArgumentError('Argument opts.agent must implement Agent')
  28379. }
  28380. this[kMockAgent] = opts.agent
  28381. this[kOrigin] = origin
  28382. this[kDispatches] = []
  28383. this[kConnected] = 1
  28384. this[kOriginalDispatch] = this.dispatch
  28385. this[kOriginalClose] = this.close.bind(this)
  28386. this.dispatch = buildMockDispatch.call(this)
  28387. this.close = this[kClose]
  28388. }
  28389. get [Symbols.kConnected] () {
  28390. return this[kConnected]
  28391. }
  28392. /**
  28393. * Sets up the base interceptor for mocking replies from undici.
  28394. */
  28395. intercept (opts) {
  28396. return new MockInterceptor(opts, this[kDispatches])
  28397. }
  28398. async [kClose] () {
  28399. await promisify(this[kOriginalClose])()
  28400. this[kConnected] = 0
  28401. this[kMockAgent][Symbols.kClients].delete(this[kOrigin])
  28402. }
  28403. }
  28404. module.exports = MockClient
  28405. /***/ }),
  28406. /***/ 888:
  28407. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28408. "use strict";
  28409. const { UndiciError } = __nccwpck_require__(8045)
  28410. class MockNotMatchedError extends UndiciError {
  28411. constructor (message) {
  28412. super(message)
  28413. Error.captureStackTrace(this, MockNotMatchedError)
  28414. this.name = 'MockNotMatchedError'
  28415. this.message = message || 'The request does not match any registered mock dispatches'
  28416. this.code = 'UND_MOCK_ERR_MOCK_NOT_MATCHED'
  28417. }
  28418. }
  28419. module.exports = {
  28420. MockNotMatchedError
  28421. }
  28422. /***/ }),
  28423. /***/ 410:
  28424. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28425. "use strict";
  28426. const { getResponseData, buildKey, addMockDispatch } = __nccwpck_require__(9323)
  28427. const {
  28428. kDispatches,
  28429. kDispatchKey,
  28430. kDefaultHeaders,
  28431. kDefaultTrailers,
  28432. kContentLength,
  28433. kMockDispatch
  28434. } = __nccwpck_require__(4347)
  28435. const { InvalidArgumentError } = __nccwpck_require__(8045)
  28436. const { buildURL } = __nccwpck_require__(3983)
  28437. /**
  28438. * Defines the scope API for an interceptor reply
  28439. */
  28440. class MockScope {
  28441. constructor (mockDispatch) {
  28442. this[kMockDispatch] = mockDispatch
  28443. }
  28444. /**
  28445. * Delay a reply by a set amount in ms.
  28446. */
  28447. delay (waitInMs) {
  28448. if (typeof waitInMs !== 'number' || !Number.isInteger(waitInMs) || waitInMs <= 0) {
  28449. throw new InvalidArgumentError('waitInMs must be a valid integer > 0')
  28450. }
  28451. this[kMockDispatch].delay = waitInMs
  28452. return this
  28453. }
  28454. /**
  28455. * For a defined reply, never mark as consumed.
  28456. */
  28457. persist () {
  28458. this[kMockDispatch].persist = true
  28459. return this
  28460. }
  28461. /**
  28462. * Allow one to define a reply for a set amount of matching requests.
  28463. */
  28464. times (repeatTimes) {
  28465. if (typeof repeatTimes !== 'number' || !Number.isInteger(repeatTimes) || repeatTimes <= 0) {
  28466. throw new InvalidArgumentError('repeatTimes must be a valid integer > 0')
  28467. }
  28468. this[kMockDispatch].times = repeatTimes
  28469. return this
  28470. }
  28471. }
  28472. /**
  28473. * Defines an interceptor for a Mock
  28474. */
  28475. class MockInterceptor {
  28476. constructor (opts, mockDispatches) {
  28477. if (typeof opts !== 'object') {
  28478. throw new InvalidArgumentError('opts must be an object')
  28479. }
  28480. if (typeof opts.path === 'undefined') {
  28481. throw new InvalidArgumentError('opts.path must be defined')
  28482. }
  28483. if (typeof opts.method === 'undefined') {
  28484. opts.method = 'GET'
  28485. }
  28486. // See https://github.com/nodejs/undici/issues/1245
  28487. // As per RFC 3986, clients are not supposed to send URI
  28488. // fragments to servers when they retrieve a document,
  28489. if (typeof opts.path === 'string') {
  28490. if (opts.query) {
  28491. opts.path = buildURL(opts.path, opts.query)
  28492. } else {
  28493. // Matches https://github.com/nodejs/undici/blob/main/lib/fetch/index.js#L1811
  28494. const parsedURL = new URL(opts.path, 'data://')
  28495. opts.path = parsedURL.pathname + parsedURL.search
  28496. }
  28497. }
  28498. if (typeof opts.method === 'string') {
  28499. opts.method = opts.method.toUpperCase()
  28500. }
  28501. this[kDispatchKey] = buildKey(opts)
  28502. this[kDispatches] = mockDispatches
  28503. this[kDefaultHeaders] = {}
  28504. this[kDefaultTrailers] = {}
  28505. this[kContentLength] = false
  28506. }
  28507. createMockScopeDispatchData (statusCode, data, responseOptions = {}) {
  28508. const responseData = getResponseData(data)
  28509. const contentLength = this[kContentLength] ? { 'content-length': responseData.length } : {}
  28510. const headers = { ...this[kDefaultHeaders], ...contentLength, ...responseOptions.headers }
  28511. const trailers = { ...this[kDefaultTrailers], ...responseOptions.trailers }
  28512. return { statusCode, data, headers, trailers }
  28513. }
  28514. validateReplyParameters (statusCode, data, responseOptions) {
  28515. if (typeof statusCode === 'undefined') {
  28516. throw new InvalidArgumentError('statusCode must be defined')
  28517. }
  28518. if (typeof data === 'undefined') {
  28519. throw new InvalidArgumentError('data must be defined')
  28520. }
  28521. if (typeof responseOptions !== 'object') {
  28522. throw new InvalidArgumentError('responseOptions must be an object')
  28523. }
  28524. }
  28525. /**
  28526. * Mock an undici request with a defined reply.
  28527. */
  28528. reply (replyData) {
  28529. // Values of reply aren't available right now as they
  28530. // can only be available when the reply callback is invoked.
  28531. if (typeof replyData === 'function') {
  28532. // We'll first wrap the provided callback in another function,
  28533. // this function will properly resolve the data from the callback
  28534. // when invoked.
  28535. const wrappedDefaultsCallback = (opts) => {
  28536. // Our reply options callback contains the parameter for statusCode, data and options.
  28537. const resolvedData = replyData(opts)
  28538. // Check if it is in the right format
  28539. if (typeof resolvedData !== 'object') {
  28540. throw new InvalidArgumentError('reply options callback must return an object')
  28541. }
  28542. const { statusCode, data = '', responseOptions = {} } = resolvedData
  28543. this.validateReplyParameters(statusCode, data, responseOptions)
  28544. // Since the values can be obtained immediately we return them
  28545. // from this higher order function that will be resolved later.
  28546. return {
  28547. ...this.createMockScopeDispatchData(statusCode, data, responseOptions)
  28548. }
  28549. }
  28550. // Add usual dispatch data, but this time set the data parameter to function that will eventually provide data.
  28551. const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], wrappedDefaultsCallback)
  28552. return new MockScope(newMockDispatch)
  28553. }
  28554. // We can have either one or three parameters, if we get here,
  28555. // we should have 1-3 parameters. So we spread the arguments of
  28556. // this function to obtain the parameters, since replyData will always
  28557. // just be the statusCode.
  28558. const [statusCode, data = '', responseOptions = {}] = [...arguments]
  28559. this.validateReplyParameters(statusCode, data, responseOptions)
  28560. // Send in-already provided data like usual
  28561. const dispatchData = this.createMockScopeDispatchData(statusCode, data, responseOptions)
  28562. const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], dispatchData)
  28563. return new MockScope(newMockDispatch)
  28564. }
  28565. /**
  28566. * Mock an undici request with a defined error.
  28567. */
  28568. replyWithError (error) {
  28569. if (typeof error === 'undefined') {
  28570. throw new InvalidArgumentError('error must be defined')
  28571. }
  28572. const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error })
  28573. return new MockScope(newMockDispatch)
  28574. }
  28575. /**
  28576. * Set default reply headers on the interceptor for subsequent replies
  28577. */
  28578. defaultReplyHeaders (headers) {
  28579. if (typeof headers === 'undefined') {
  28580. throw new InvalidArgumentError('headers must be defined')
  28581. }
  28582. this[kDefaultHeaders] = headers
  28583. return this
  28584. }
  28585. /**
  28586. * Set default reply trailers on the interceptor for subsequent replies
  28587. */
  28588. defaultReplyTrailers (trailers) {
  28589. if (typeof trailers === 'undefined') {
  28590. throw new InvalidArgumentError('trailers must be defined')
  28591. }
  28592. this[kDefaultTrailers] = trailers
  28593. return this
  28594. }
  28595. /**
  28596. * Set reply content length header for replies on the interceptor
  28597. */
  28598. replyContentLength () {
  28599. this[kContentLength] = true
  28600. return this
  28601. }
  28602. }
  28603. module.exports.MockInterceptor = MockInterceptor
  28604. module.exports.MockScope = MockScope
  28605. /***/ }),
  28606. /***/ 6193:
  28607. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28608. "use strict";
  28609. const { promisify } = __nccwpck_require__(3837)
  28610. const Pool = __nccwpck_require__(4634)
  28611. const { buildMockDispatch } = __nccwpck_require__(9323)
  28612. const {
  28613. kDispatches,
  28614. kMockAgent,
  28615. kClose,
  28616. kOriginalClose,
  28617. kOrigin,
  28618. kOriginalDispatch,
  28619. kConnected
  28620. } = __nccwpck_require__(4347)
  28621. const { MockInterceptor } = __nccwpck_require__(410)
  28622. const Symbols = __nccwpck_require__(2785)
  28623. const { InvalidArgumentError } = __nccwpck_require__(8045)
  28624. /**
  28625. * MockPool provides an API that extends the Pool to influence the mockDispatches.
  28626. */
  28627. class MockPool extends Pool {
  28628. constructor (origin, opts) {
  28629. super(origin, opts)
  28630. if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') {
  28631. throw new InvalidArgumentError('Argument opts.agent must implement Agent')
  28632. }
  28633. this[kMockAgent] = opts.agent
  28634. this[kOrigin] = origin
  28635. this[kDispatches] = []
  28636. this[kConnected] = 1
  28637. this[kOriginalDispatch] = this.dispatch
  28638. this[kOriginalClose] = this.close.bind(this)
  28639. this.dispatch = buildMockDispatch.call(this)
  28640. this.close = this[kClose]
  28641. }
  28642. get [Symbols.kConnected] () {
  28643. return this[kConnected]
  28644. }
  28645. /**
  28646. * Sets up the base interceptor for mocking replies from undici.
  28647. */
  28648. intercept (opts) {
  28649. return new MockInterceptor(opts, this[kDispatches])
  28650. }
  28651. async [kClose] () {
  28652. await promisify(this[kOriginalClose])()
  28653. this[kConnected] = 0
  28654. this[kMockAgent][Symbols.kClients].delete(this[kOrigin])
  28655. }
  28656. }
  28657. module.exports = MockPool
  28658. /***/ }),
  28659. /***/ 4347:
  28660. /***/ ((module) => {
  28661. "use strict";
  28662. module.exports = {
  28663. kAgent: Symbol('agent'),
  28664. kOptions: Symbol('options'),
  28665. kFactory: Symbol('factory'),
  28666. kDispatches: Symbol('dispatches'),
  28667. kDispatchKey: Symbol('dispatch key'),
  28668. kDefaultHeaders: Symbol('default headers'),
  28669. kDefaultTrailers: Symbol('default trailers'),
  28670. kContentLength: Symbol('content length'),
  28671. kMockAgent: Symbol('mock agent'),
  28672. kMockAgentSet: Symbol('mock agent set'),
  28673. kMockAgentGet: Symbol('mock agent get'),
  28674. kMockDispatch: Symbol('mock dispatch'),
  28675. kClose: Symbol('close'),
  28676. kOriginalClose: Symbol('original agent close'),
  28677. kOrigin: Symbol('origin'),
  28678. kIsMockActive: Symbol('is mock active'),
  28679. kNetConnect: Symbol('net connect'),
  28680. kGetNetConnect: Symbol('get net connect'),
  28681. kConnected: Symbol('connected')
  28682. }
  28683. /***/ }),
  28684. /***/ 9323:
  28685. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28686. "use strict";
  28687. const { MockNotMatchedError } = __nccwpck_require__(888)
  28688. const {
  28689. kDispatches,
  28690. kMockAgent,
  28691. kOriginalDispatch,
  28692. kOrigin,
  28693. kGetNetConnect
  28694. } = __nccwpck_require__(4347)
  28695. const { buildURL, nop } = __nccwpck_require__(3983)
  28696. const { STATUS_CODES } = __nccwpck_require__(3685)
  28697. const {
  28698. types: {
  28699. isPromise
  28700. }
  28701. } = __nccwpck_require__(3837)
  28702. function matchValue (match, value) {
  28703. if (typeof match === 'string') {
  28704. return match === value
  28705. }
  28706. if (match instanceof RegExp) {
  28707. return match.test(value)
  28708. }
  28709. if (typeof match === 'function') {
  28710. return match(value) === true
  28711. }
  28712. return false
  28713. }
  28714. function lowerCaseEntries (headers) {
  28715. return Object.fromEntries(
  28716. Object.entries(headers).map(([headerName, headerValue]) => {
  28717. return [headerName.toLocaleLowerCase(), headerValue]
  28718. })
  28719. )
  28720. }
  28721. /**
  28722. * @param {import('../../index').Headers|string[]|Record<string, string>} headers
  28723. * @param {string} key
  28724. */
  28725. function getHeaderByName (headers, key) {
  28726. if (Array.isArray(headers)) {
  28727. for (let i = 0; i < headers.length; i += 2) {
  28728. if (headers[i].toLocaleLowerCase() === key.toLocaleLowerCase()) {
  28729. return headers[i + 1]
  28730. }
  28731. }
  28732. return undefined
  28733. } else if (typeof headers.get === 'function') {
  28734. return headers.get(key)
  28735. } else {
  28736. return lowerCaseEntries(headers)[key.toLocaleLowerCase()]
  28737. }
  28738. }
  28739. /** @param {string[]} headers */
  28740. function buildHeadersFromArray (headers) { // fetch HeadersList
  28741. const clone = headers.slice()
  28742. const entries = []
  28743. for (let index = 0; index < clone.length; index += 2) {
  28744. entries.push([clone[index], clone[index + 1]])
  28745. }
  28746. return Object.fromEntries(entries)
  28747. }
  28748. function matchHeaders (mockDispatch, headers) {
  28749. if (typeof mockDispatch.headers === 'function') {
  28750. if (Array.isArray(headers)) { // fetch HeadersList
  28751. headers = buildHeadersFromArray(headers)
  28752. }
  28753. return mockDispatch.headers(headers ? lowerCaseEntries(headers) : {})
  28754. }
  28755. if (typeof mockDispatch.headers === 'undefined') {
  28756. return true
  28757. }
  28758. if (typeof headers !== 'object' || typeof mockDispatch.headers !== 'object') {
  28759. return false
  28760. }
  28761. for (const [matchHeaderName, matchHeaderValue] of Object.entries(mockDispatch.headers)) {
  28762. const headerValue = getHeaderByName(headers, matchHeaderName)
  28763. if (!matchValue(matchHeaderValue, headerValue)) {
  28764. return false
  28765. }
  28766. }
  28767. return true
  28768. }
  28769. function safeUrl (path) {
  28770. if (typeof path !== 'string') {
  28771. return path
  28772. }
  28773. const pathSegments = path.split('?')
  28774. if (pathSegments.length !== 2) {
  28775. return path
  28776. }
  28777. const qp = new URLSearchParams(pathSegments.pop())
  28778. qp.sort()
  28779. return [...pathSegments, qp.toString()].join('?')
  28780. }
  28781. function matchKey (mockDispatch, { path, method, body, headers }) {
  28782. const pathMatch = matchValue(mockDispatch.path, path)
  28783. const methodMatch = matchValue(mockDispatch.method, method)
  28784. const bodyMatch = typeof mockDispatch.body !== 'undefined' ? matchValue(mockDispatch.body, body) : true
  28785. const headersMatch = matchHeaders(mockDispatch, headers)
  28786. return pathMatch && methodMatch && bodyMatch && headersMatch
  28787. }
  28788. function getResponseData (data) {
  28789. if (Buffer.isBuffer(data)) {
  28790. return data
  28791. } else if (typeof data === 'object') {
  28792. return JSON.stringify(data)
  28793. } else {
  28794. return data.toString()
  28795. }
  28796. }
  28797. function getMockDispatch (mockDispatches, key) {
  28798. const basePath = key.query ? buildURL(key.path, key.query) : key.path
  28799. const resolvedPath = typeof basePath === 'string' ? safeUrl(basePath) : basePath
  28800. // Match path
  28801. let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path }) => matchValue(safeUrl(path), resolvedPath))
  28802. if (matchedMockDispatches.length === 0) {
  28803. throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`)
  28804. }
  28805. // Match method
  28806. matchedMockDispatches = matchedMockDispatches.filter(({ method }) => matchValue(method, key.method))
  28807. if (matchedMockDispatches.length === 0) {
  28808. throw new MockNotMatchedError(`Mock dispatch not matched for method '${key.method}'`)
  28809. }
  28810. // Match body
  28811. matchedMockDispatches = matchedMockDispatches.filter(({ body }) => typeof body !== 'undefined' ? matchValue(body, key.body) : true)
  28812. if (matchedMockDispatches.length === 0) {
  28813. throw new MockNotMatchedError(`Mock dispatch not matched for body '${key.body}'`)
  28814. }
  28815. // Match headers
  28816. matchedMockDispatches = matchedMockDispatches.filter((mockDispatch) => matchHeaders(mockDispatch, key.headers))
  28817. if (matchedMockDispatches.length === 0) {
  28818. throw new MockNotMatchedError(`Mock dispatch not matched for headers '${typeof key.headers === 'object' ? JSON.stringify(key.headers) : key.headers}'`)
  28819. }
  28820. return matchedMockDispatches[0]
  28821. }
  28822. function addMockDispatch (mockDispatches, key, data) {
  28823. const baseData = { timesInvoked: 0, times: 1, persist: false, consumed: false }
  28824. const replyData = typeof data === 'function' ? { callback: data } : { ...data }
  28825. const newMockDispatch = { ...baseData, ...key, pending: true, data: { error: null, ...replyData } }
  28826. mockDispatches.push(newMockDispatch)
  28827. return newMockDispatch
  28828. }
  28829. function deleteMockDispatch (mockDispatches, key) {
  28830. const index = mockDispatches.findIndex(dispatch => {
  28831. if (!dispatch.consumed) {
  28832. return false
  28833. }
  28834. return matchKey(dispatch, key)
  28835. })
  28836. if (index !== -1) {
  28837. mockDispatches.splice(index, 1)
  28838. }
  28839. }
  28840. function buildKey (opts) {
  28841. const { path, method, body, headers, query } = opts
  28842. return {
  28843. path,
  28844. method,
  28845. body,
  28846. headers,
  28847. query
  28848. }
  28849. }
  28850. function generateKeyValues (data) {
  28851. return Object.entries(data).reduce((keyValuePairs, [key, value]) => [
  28852. ...keyValuePairs,
  28853. Buffer.from(`${key}`),
  28854. Array.isArray(value) ? value.map(x => Buffer.from(`${x}`)) : Buffer.from(`${value}`)
  28855. ], [])
  28856. }
  28857. /**
  28858. * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
  28859. * @param {number} statusCode
  28860. */
  28861. function getStatusText (statusCode) {
  28862. return STATUS_CODES[statusCode] || 'unknown'
  28863. }
  28864. async function getResponse (body) {
  28865. const buffers = []
  28866. for await (const data of body) {
  28867. buffers.push(data)
  28868. }
  28869. return Buffer.concat(buffers).toString('utf8')
  28870. }
  28871. /**
  28872. * Mock dispatch function used to simulate undici dispatches
  28873. */
  28874. function mockDispatch (opts, handler) {
  28875. // Get mock dispatch from built key
  28876. const key = buildKey(opts)
  28877. const mockDispatch = getMockDispatch(this[kDispatches], key)
  28878. mockDispatch.timesInvoked++
  28879. // Here's where we resolve a callback if a callback is present for the dispatch data.
  28880. if (mockDispatch.data.callback) {
  28881. mockDispatch.data = { ...mockDispatch.data, ...mockDispatch.data.callback(opts) }
  28882. }
  28883. // Parse mockDispatch data
  28884. const { data: { statusCode, data, headers, trailers, error }, delay, persist } = mockDispatch
  28885. const { timesInvoked, times } = mockDispatch
  28886. // If it's used up and not persistent, mark as consumed
  28887. mockDispatch.consumed = !persist && timesInvoked >= times
  28888. mockDispatch.pending = timesInvoked < times
  28889. // If specified, trigger dispatch error
  28890. if (error !== null) {
  28891. deleteMockDispatch(this[kDispatches], key)
  28892. handler.onError(error)
  28893. return true
  28894. }
  28895. // Handle the request with a delay if necessary
  28896. if (typeof delay === 'number' && delay > 0) {
  28897. setTimeout(() => {
  28898. handleReply(this[kDispatches])
  28899. }, delay)
  28900. } else {
  28901. handleReply(this[kDispatches])
  28902. }
  28903. function handleReply (mockDispatches, _data = data) {
  28904. // fetch's HeadersList is a 1D string array
  28905. const optsHeaders = Array.isArray(opts.headers)
  28906. ? buildHeadersFromArray(opts.headers)
  28907. : opts.headers
  28908. const body = typeof _data === 'function'
  28909. ? _data({ ...opts, headers: optsHeaders })
  28910. : _data
  28911. // util.types.isPromise is likely needed for jest.
  28912. if (isPromise(body)) {
  28913. // If handleReply is asynchronous, throwing an error
  28914. // in the callback will reject the promise, rather than
  28915. // synchronously throw the error, which breaks some tests.
  28916. // Rather, we wait for the callback to resolve if it is a
  28917. // promise, and then re-run handleReply with the new body.
  28918. body.then((newData) => handleReply(mockDispatches, newData))
  28919. return
  28920. }
  28921. const responseData = getResponseData(body)
  28922. const responseHeaders = generateKeyValues(headers)
  28923. const responseTrailers = generateKeyValues(trailers)
  28924. handler.abort = nop
  28925. handler.onHeaders(statusCode, responseHeaders, resume, getStatusText(statusCode))
  28926. handler.onData(Buffer.from(responseData))
  28927. handler.onComplete(responseTrailers)
  28928. deleteMockDispatch(mockDispatches, key)
  28929. }
  28930. function resume () {}
  28931. return true
  28932. }
  28933. function buildMockDispatch () {
  28934. const agent = this[kMockAgent]
  28935. const origin = this[kOrigin]
  28936. const originalDispatch = this[kOriginalDispatch]
  28937. return function dispatch (opts, handler) {
  28938. if (agent.isMockActive) {
  28939. try {
  28940. mockDispatch.call(this, opts, handler)
  28941. } catch (error) {
  28942. if (error instanceof MockNotMatchedError) {
  28943. const netConnect = agent[kGetNetConnect]()
  28944. if (netConnect === false) {
  28945. throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`)
  28946. }
  28947. if (checkNetConnect(netConnect, origin)) {
  28948. originalDispatch.call(this, opts, handler)
  28949. } else {
  28950. throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`)
  28951. }
  28952. } else {
  28953. throw error
  28954. }
  28955. }
  28956. } else {
  28957. originalDispatch.call(this, opts, handler)
  28958. }
  28959. }
  28960. }
  28961. function checkNetConnect (netConnect, origin) {
  28962. const url = new URL(origin)
  28963. if (netConnect === true) {
  28964. return true
  28965. } else if (Array.isArray(netConnect) && netConnect.some((matcher) => matchValue(matcher, url.host))) {
  28966. return true
  28967. }
  28968. return false
  28969. }
  28970. function buildMockOptions (opts) {
  28971. if (opts) {
  28972. const { agent, ...mockOptions } = opts
  28973. return mockOptions
  28974. }
  28975. }
  28976. module.exports = {
  28977. getResponseData,
  28978. getMockDispatch,
  28979. addMockDispatch,
  28980. deleteMockDispatch,
  28981. buildKey,
  28982. generateKeyValues,
  28983. matchValue,
  28984. getResponse,
  28985. getStatusText,
  28986. mockDispatch,
  28987. buildMockDispatch,
  28988. checkNetConnect,
  28989. buildMockOptions,
  28990. getHeaderByName
  28991. }
  28992. /***/ }),
  28993. /***/ 6823:
  28994. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  28995. "use strict";
  28996. const { Transform } = __nccwpck_require__(2781)
  28997. const { Console } = __nccwpck_require__(6206)
  28998. /**
  28999. * Gets the output of `console.table(…)` as a string.
  29000. */
  29001. module.exports = class PendingInterceptorsFormatter {
  29002. constructor ({ disableColors } = {}) {
  29003. this.transform = new Transform({
  29004. transform (chunk, _enc, cb) {
  29005. cb(null, chunk)
  29006. }
  29007. })
  29008. this.logger = new Console({
  29009. stdout: this.transform,
  29010. inspectOptions: {
  29011. colors: !disableColors && !process.env.CI
  29012. }
  29013. })
  29014. }
  29015. format (pendingInterceptors) {
  29016. const withPrettyHeaders = pendingInterceptors.map(
  29017. ({ method, path, data: { statusCode }, persist, times, timesInvoked, origin }) => ({
  29018. Method: method,
  29019. Origin: origin,
  29020. Path: path,
  29021. 'Status code': statusCode,
  29022. Persistent: persist ? '✅' : '❌',
  29023. Invocations: timesInvoked,
  29024. Remaining: persist ? Infinity : times - timesInvoked
  29025. }))
  29026. this.logger.table(withPrettyHeaders)
  29027. return this.transform.read().toString()
  29028. }
  29029. }
  29030. /***/ }),
  29031. /***/ 8891:
  29032. /***/ ((module) => {
  29033. "use strict";
  29034. const singulars = {
  29035. pronoun: 'it',
  29036. is: 'is',
  29037. was: 'was',
  29038. this: 'this'
  29039. }
  29040. const plurals = {
  29041. pronoun: 'they',
  29042. is: 'are',
  29043. was: 'were',
  29044. this: 'these'
  29045. }
  29046. module.exports = class Pluralizer {
  29047. constructor (singular, plural) {
  29048. this.singular = singular
  29049. this.plural = plural
  29050. }
  29051. pluralize (count) {
  29052. const one = count === 1
  29053. const keys = one ? singulars : plurals
  29054. const noun = one ? this.singular : this.plural
  29055. return { ...keys, count, noun }
  29056. }
  29057. }
  29058. /***/ }),
  29059. /***/ 8266:
  29060. /***/ ((module) => {
  29061. "use strict";
  29062. /* eslint-disable */
  29063. // Extracted from node/lib/internal/fixed_queue.js
  29064. // Currently optimal queue size, tested on V8 6.0 - 6.6. Must be power of two.
  29065. const kSize = 2048;
  29066. const kMask = kSize - 1;
  29067. // The FixedQueue is implemented as a singly-linked list of fixed-size
  29068. // circular buffers. It looks something like this:
  29069. //
  29070. // head tail
  29071. // | |
  29072. // v v
  29073. // +-----------+ <-----\ +-----------+ <------\ +-----------+
  29074. // | [null] | \----- | next | \------- | next |
  29075. // +-----------+ +-----------+ +-----------+
  29076. // | item | <-- bottom | item | <-- bottom | [empty] |
  29077. // | item | | item | | [empty] |
  29078. // | item | | item | | [empty] |
  29079. // | item | | item | | [empty] |
  29080. // | item | | item | bottom --> | item |
  29081. // | item | | item | | item |
  29082. // | ... | | ... | | ... |
  29083. // | item | | item | | item |
  29084. // | item | | item | | item |
  29085. // | [empty] | <-- top | item | | item |
  29086. // | [empty] | | item | | item |
  29087. // | [empty] | | [empty] | <-- top top --> | [empty] |
  29088. // +-----------+ +-----------+ +-----------+
  29089. //
  29090. // Or, if there is only one circular buffer, it looks something
  29091. // like either of these:
  29092. //
  29093. // head tail head tail
  29094. // | | | |
  29095. // v v v v
  29096. // +-----------+ +-----------+
  29097. // | [null] | | [null] |
  29098. // +-----------+ +-----------+
  29099. // | [empty] | | item |
  29100. // | [empty] | | item |
  29101. // | item | <-- bottom top --> | [empty] |
  29102. // | item | | [empty] |
  29103. // | [empty] | <-- top bottom --> | item |
  29104. // | [empty] | | item |
  29105. // +-----------+ +-----------+
  29106. //
  29107. // Adding a value means moving `top` forward by one, removing means
  29108. // moving `bottom` forward by one. After reaching the end, the queue
  29109. // wraps around.
  29110. //
  29111. // When `top === bottom` the current queue is empty and when
  29112. // `top + 1 === bottom` it's full. This wastes a single space of storage
  29113. // but allows much quicker checks.
  29114. class FixedCircularBuffer {
  29115. constructor() {
  29116. this.bottom = 0;
  29117. this.top = 0;
  29118. this.list = new Array(kSize);
  29119. this.next = null;
  29120. }
  29121. isEmpty() {
  29122. return this.top === this.bottom;
  29123. }
  29124. isFull() {
  29125. return ((this.top + 1) & kMask) === this.bottom;
  29126. }
  29127. push(data) {
  29128. this.list[this.top] = data;
  29129. this.top = (this.top + 1) & kMask;
  29130. }
  29131. shift() {
  29132. const nextItem = this.list[this.bottom];
  29133. if (nextItem === undefined)
  29134. return null;
  29135. this.list[this.bottom] = undefined;
  29136. this.bottom = (this.bottom + 1) & kMask;
  29137. return nextItem;
  29138. }
  29139. }
  29140. module.exports = class FixedQueue {
  29141. constructor() {
  29142. this.head = this.tail = new FixedCircularBuffer();
  29143. }
  29144. isEmpty() {
  29145. return this.head.isEmpty();
  29146. }
  29147. push(data) {
  29148. if (this.head.isFull()) {
  29149. // Head is full: Creates a new queue, sets the old queue's `.next` to it,
  29150. // and sets it as the new main queue.
  29151. this.head = this.head.next = new FixedCircularBuffer();
  29152. }
  29153. this.head.push(data);
  29154. }
  29155. shift() {
  29156. const tail = this.tail;
  29157. const next = tail.shift();
  29158. if (tail.isEmpty() && tail.next !== null) {
  29159. // If there is another queue, it forms the new tail.
  29160. this.tail = tail.next;
  29161. }
  29162. return next;
  29163. }
  29164. };
  29165. /***/ }),
  29166. /***/ 3198:
  29167. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  29168. "use strict";
  29169. const DispatcherBase = __nccwpck_require__(4839)
  29170. const FixedQueue = __nccwpck_require__(8266)
  29171. const { kConnected, kSize, kRunning, kPending, kQueued, kBusy, kFree, kUrl, kClose, kDestroy, kDispatch } = __nccwpck_require__(2785)
  29172. const PoolStats = __nccwpck_require__(9689)
  29173. const kClients = Symbol('clients')
  29174. const kNeedDrain = Symbol('needDrain')
  29175. const kQueue = Symbol('queue')
  29176. const kClosedResolve = Symbol('closed resolve')
  29177. const kOnDrain = Symbol('onDrain')
  29178. const kOnConnect = Symbol('onConnect')
  29179. const kOnDisconnect = Symbol('onDisconnect')
  29180. const kOnConnectionError = Symbol('onConnectionError')
  29181. const kGetDispatcher = Symbol('get dispatcher')
  29182. const kAddClient = Symbol('add client')
  29183. const kRemoveClient = Symbol('remove client')
  29184. const kStats = Symbol('stats')
  29185. class PoolBase extends DispatcherBase {
  29186. constructor () {
  29187. super()
  29188. this[kQueue] = new FixedQueue()
  29189. this[kClients] = []
  29190. this[kQueued] = 0
  29191. const pool = this
  29192. this[kOnDrain] = function onDrain (origin, targets) {
  29193. const queue = pool[kQueue]
  29194. let needDrain = false
  29195. while (!needDrain) {
  29196. const item = queue.shift()
  29197. if (!item) {
  29198. break
  29199. }
  29200. pool[kQueued]--
  29201. needDrain = !this.dispatch(item.opts, item.handler)
  29202. }
  29203. this[kNeedDrain] = needDrain
  29204. if (!this[kNeedDrain] && pool[kNeedDrain]) {
  29205. pool[kNeedDrain] = false
  29206. pool.emit('drain', origin, [pool, ...targets])
  29207. }
  29208. if (pool[kClosedResolve] && queue.isEmpty()) {
  29209. Promise
  29210. .all(pool[kClients].map(c => c.close()))
  29211. .then(pool[kClosedResolve])
  29212. }
  29213. }
  29214. this[kOnConnect] = (origin, targets) => {
  29215. pool.emit('connect', origin, [pool, ...targets])
  29216. }
  29217. this[kOnDisconnect] = (origin, targets, err) => {
  29218. pool.emit('disconnect', origin, [pool, ...targets], err)
  29219. }
  29220. this[kOnConnectionError] = (origin, targets, err) => {
  29221. pool.emit('connectionError', origin, [pool, ...targets], err)
  29222. }
  29223. this[kStats] = new PoolStats(this)
  29224. }
  29225. get [kBusy] () {
  29226. return this[kNeedDrain]
  29227. }
  29228. get [kConnected] () {
  29229. return this[kClients].filter(client => client[kConnected]).length
  29230. }
  29231. get [kFree] () {
  29232. return this[kClients].filter(client => client[kConnected] && !client[kNeedDrain]).length
  29233. }
  29234. get [kPending] () {
  29235. let ret = this[kQueued]
  29236. for (const { [kPending]: pending } of this[kClients]) {
  29237. ret += pending
  29238. }
  29239. return ret
  29240. }
  29241. get [kRunning] () {
  29242. let ret = 0
  29243. for (const { [kRunning]: running } of this[kClients]) {
  29244. ret += running
  29245. }
  29246. return ret
  29247. }
  29248. get [kSize] () {
  29249. let ret = this[kQueued]
  29250. for (const { [kSize]: size } of this[kClients]) {
  29251. ret += size
  29252. }
  29253. return ret
  29254. }
  29255. get stats () {
  29256. return this[kStats]
  29257. }
  29258. async [kClose] () {
  29259. if (this[kQueue].isEmpty()) {
  29260. return Promise.all(this[kClients].map(c => c.close()))
  29261. } else {
  29262. return new Promise((resolve) => {
  29263. this[kClosedResolve] = resolve
  29264. })
  29265. }
  29266. }
  29267. async [kDestroy] (err) {
  29268. while (true) {
  29269. const item = this[kQueue].shift()
  29270. if (!item) {
  29271. break
  29272. }
  29273. item.handler.onError(err)
  29274. }
  29275. return Promise.all(this[kClients].map(c => c.destroy(err)))
  29276. }
  29277. [kDispatch] (opts, handler) {
  29278. const dispatcher = this[kGetDispatcher]()
  29279. if (!dispatcher) {
  29280. this[kNeedDrain] = true
  29281. this[kQueue].push({ opts, handler })
  29282. this[kQueued]++
  29283. } else if (!dispatcher.dispatch(opts, handler)) {
  29284. dispatcher[kNeedDrain] = true
  29285. this[kNeedDrain] = !this[kGetDispatcher]()
  29286. }
  29287. return !this[kNeedDrain]
  29288. }
  29289. [kAddClient] (client) {
  29290. client
  29291. .on('drain', this[kOnDrain])
  29292. .on('connect', this[kOnConnect])
  29293. .on('disconnect', this[kOnDisconnect])
  29294. .on('connectionError', this[kOnConnectionError])
  29295. this[kClients].push(client)
  29296. if (this[kNeedDrain]) {
  29297. process.nextTick(() => {
  29298. if (this[kNeedDrain]) {
  29299. this[kOnDrain](client[kUrl], [this, client])
  29300. }
  29301. })
  29302. }
  29303. return this
  29304. }
  29305. [kRemoveClient] (client) {
  29306. client.close(() => {
  29307. const idx = this[kClients].indexOf(client)
  29308. if (idx !== -1) {
  29309. this[kClients].splice(idx, 1)
  29310. }
  29311. })
  29312. this[kNeedDrain] = this[kClients].some(dispatcher => (
  29313. !dispatcher[kNeedDrain] &&
  29314. dispatcher.closed !== true &&
  29315. dispatcher.destroyed !== true
  29316. ))
  29317. }
  29318. }
  29319. module.exports = {
  29320. PoolBase,
  29321. kClients,
  29322. kNeedDrain,
  29323. kAddClient,
  29324. kRemoveClient,
  29325. kGetDispatcher
  29326. }
  29327. /***/ }),
  29328. /***/ 9689:
  29329. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  29330. const { kFree, kConnected, kPending, kQueued, kRunning, kSize } = __nccwpck_require__(2785)
  29331. const kPool = Symbol('pool')
  29332. class PoolStats {
  29333. constructor (pool) {
  29334. this[kPool] = pool
  29335. }
  29336. get connected () {
  29337. return this[kPool][kConnected]
  29338. }
  29339. get free () {
  29340. return this[kPool][kFree]
  29341. }
  29342. get pending () {
  29343. return this[kPool][kPending]
  29344. }
  29345. get queued () {
  29346. return this[kPool][kQueued]
  29347. }
  29348. get running () {
  29349. return this[kPool][kRunning]
  29350. }
  29351. get size () {
  29352. return this[kPool][kSize]
  29353. }
  29354. }
  29355. module.exports = PoolStats
  29356. /***/ }),
  29357. /***/ 4634:
  29358. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  29359. "use strict";
  29360. const {
  29361. PoolBase,
  29362. kClients,
  29363. kNeedDrain,
  29364. kAddClient,
  29365. kGetDispatcher
  29366. } = __nccwpck_require__(3198)
  29367. const Client = __nccwpck_require__(3598)
  29368. const {
  29369. InvalidArgumentError
  29370. } = __nccwpck_require__(8045)
  29371. const util = __nccwpck_require__(3983)
  29372. const { kUrl, kInterceptors } = __nccwpck_require__(2785)
  29373. const buildConnector = __nccwpck_require__(2067)
  29374. const kOptions = Symbol('options')
  29375. const kConnections = Symbol('connections')
  29376. const kFactory = Symbol('factory')
  29377. function defaultFactory (origin, opts) {
  29378. return new Client(origin, opts)
  29379. }
  29380. class Pool extends PoolBase {
  29381. constructor (origin, {
  29382. connections,
  29383. factory = defaultFactory,
  29384. connect,
  29385. connectTimeout,
  29386. tls,
  29387. maxCachedSessions,
  29388. socketPath,
  29389. autoSelectFamily,
  29390. autoSelectFamilyAttemptTimeout,
  29391. allowH2,
  29392. ...options
  29393. } = {}) {
  29394. super()
  29395. if (connections != null && (!Number.isFinite(connections) || connections < 0)) {
  29396. throw new InvalidArgumentError('invalid connections')
  29397. }
  29398. if (typeof factory !== 'function') {
  29399. throw new InvalidArgumentError('factory must be a function.')
  29400. }
  29401. if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {
  29402. throw new InvalidArgumentError('connect must be a function or an object')
  29403. }
  29404. if (typeof connect !== 'function') {
  29405. connect = buildConnector({
  29406. ...tls,
  29407. maxCachedSessions,
  29408. allowH2,
  29409. socketPath,
  29410. timeout: connectTimeout,
  29411. ...(util.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined),
  29412. ...connect
  29413. })
  29414. }
  29415. this[kInterceptors] = options.interceptors && options.interceptors.Pool && Array.isArray(options.interceptors.Pool)
  29416. ? options.interceptors.Pool
  29417. : []
  29418. this[kConnections] = connections || null
  29419. this[kUrl] = util.parseOrigin(origin)
  29420. this[kOptions] = { ...util.deepClone(options), connect, allowH2 }
  29421. this[kOptions].interceptors = options.interceptors
  29422. ? { ...options.interceptors }
  29423. : undefined
  29424. this[kFactory] = factory
  29425. this.on('connectionError', (origin, targets, error) => {
  29426. // If a connection error occurs, we remove the client from the pool,
  29427. // and emit a connectionError event. They will not be re-used.
  29428. // Fixes https://github.com/nodejs/undici/issues/3895
  29429. for (const target of targets) {
  29430. // Do not use kRemoveClient here, as it will close the client,
  29431. // but the client cannot be closed in this state.
  29432. const idx = this[kClients].indexOf(target)
  29433. if (idx !== -1) {
  29434. this[kClients].splice(idx, 1)
  29435. }
  29436. }
  29437. })
  29438. }
  29439. [kGetDispatcher] () {
  29440. let dispatcher = this[kClients].find(dispatcher => !dispatcher[kNeedDrain])
  29441. if (dispatcher) {
  29442. return dispatcher
  29443. }
  29444. if (!this[kConnections] || this[kClients].length < this[kConnections]) {
  29445. dispatcher = this[kFactory](this[kUrl], this[kOptions])
  29446. this[kAddClient](dispatcher)
  29447. }
  29448. return dispatcher
  29449. }
  29450. }
  29451. module.exports = Pool
  29452. /***/ }),
  29453. /***/ 7858:
  29454. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  29455. "use strict";
  29456. const { kProxy, kClose, kDestroy, kInterceptors } = __nccwpck_require__(2785)
  29457. const { URL } = __nccwpck_require__(7310)
  29458. const Agent = __nccwpck_require__(7890)
  29459. const Pool = __nccwpck_require__(4634)
  29460. const DispatcherBase = __nccwpck_require__(4839)
  29461. const { InvalidArgumentError, RequestAbortedError } = __nccwpck_require__(8045)
  29462. const buildConnector = __nccwpck_require__(2067)
  29463. const kAgent = Symbol('proxy agent')
  29464. const kClient = Symbol('proxy client')
  29465. const kProxyHeaders = Symbol('proxy headers')
  29466. const kRequestTls = Symbol('request tls settings')
  29467. const kProxyTls = Symbol('proxy tls settings')
  29468. const kConnectEndpoint = Symbol('connect endpoint function')
  29469. function defaultProtocolPort (protocol) {
  29470. return protocol === 'https:' ? 443 : 80
  29471. }
  29472. function buildProxyOptions (opts) {
  29473. if (typeof opts === 'string') {
  29474. opts = { uri: opts }
  29475. }
  29476. if (!opts || !opts.uri) {
  29477. throw new InvalidArgumentError('Proxy opts.uri is mandatory')
  29478. }
  29479. return {
  29480. uri: opts.uri,
  29481. protocol: opts.protocol || 'https'
  29482. }
  29483. }
  29484. function defaultFactory (origin, opts) {
  29485. return new Pool(origin, opts)
  29486. }
  29487. class ProxyAgent extends DispatcherBase {
  29488. constructor (opts) {
  29489. super(opts)
  29490. this[kProxy] = buildProxyOptions(opts)
  29491. this[kAgent] = new Agent(opts)
  29492. this[kInterceptors] = opts.interceptors && opts.interceptors.ProxyAgent && Array.isArray(opts.interceptors.ProxyAgent)
  29493. ? opts.interceptors.ProxyAgent
  29494. : []
  29495. if (typeof opts === 'string') {
  29496. opts = { uri: opts }
  29497. }
  29498. if (!opts || !opts.uri) {
  29499. throw new InvalidArgumentError('Proxy opts.uri is mandatory')
  29500. }
  29501. const { clientFactory = defaultFactory } = opts
  29502. if (typeof clientFactory !== 'function') {
  29503. throw new InvalidArgumentError('Proxy opts.clientFactory must be a function.')
  29504. }
  29505. this[kRequestTls] = opts.requestTls
  29506. this[kProxyTls] = opts.proxyTls
  29507. this[kProxyHeaders] = opts.headers || {}
  29508. const resolvedUrl = new URL(opts.uri)
  29509. const { origin, port, host, username, password } = resolvedUrl
  29510. if (opts.auth && opts.token) {
  29511. throw new InvalidArgumentError('opts.auth cannot be used in combination with opts.token')
  29512. } else if (opts.auth) {
  29513. /* @deprecated in favour of opts.token */
  29514. this[kProxyHeaders]['proxy-authorization'] = `Basic ${opts.auth}`
  29515. } else if (opts.token) {
  29516. this[kProxyHeaders]['proxy-authorization'] = opts.token
  29517. } else if (username && password) {
  29518. this[kProxyHeaders]['proxy-authorization'] = `Basic ${Buffer.from(`${decodeURIComponent(username)}:${decodeURIComponent(password)}`).toString('base64')}`
  29519. }
  29520. const connect = buildConnector({ ...opts.proxyTls })
  29521. this[kConnectEndpoint] = buildConnector({ ...opts.requestTls })
  29522. this[kClient] = clientFactory(resolvedUrl, { connect })
  29523. this[kAgent] = new Agent({
  29524. ...opts,
  29525. connect: async (opts, callback) => {
  29526. let requestedHost = opts.host
  29527. if (!opts.port) {
  29528. requestedHost += `:${defaultProtocolPort(opts.protocol)}`
  29529. }
  29530. try {
  29531. const { socket, statusCode } = await this[kClient].connect({
  29532. origin,
  29533. port,
  29534. path: requestedHost,
  29535. signal: opts.signal,
  29536. headers: {
  29537. ...this[kProxyHeaders],
  29538. host
  29539. }
  29540. })
  29541. if (statusCode !== 200) {
  29542. socket.on('error', () => {}).destroy()
  29543. callback(new RequestAbortedError(`Proxy response (${statusCode}) !== 200 when HTTP Tunneling`))
  29544. }
  29545. if (opts.protocol !== 'https:') {
  29546. callback(null, socket)
  29547. return
  29548. }
  29549. let servername
  29550. if (this[kRequestTls]) {
  29551. servername = this[kRequestTls].servername
  29552. } else {
  29553. servername = opts.servername
  29554. }
  29555. this[kConnectEndpoint]({ ...opts, servername, httpSocket: socket }, callback)
  29556. } catch (err) {
  29557. callback(err)
  29558. }
  29559. }
  29560. })
  29561. }
  29562. dispatch (opts, handler) {
  29563. const { host } = new URL(opts.origin)
  29564. const headers = buildHeaders(opts.headers)
  29565. throwIfProxyAuthIsSent(headers)
  29566. return this[kAgent].dispatch(
  29567. {
  29568. ...opts,
  29569. headers: {
  29570. ...headers,
  29571. host
  29572. }
  29573. },
  29574. handler
  29575. )
  29576. }
  29577. async [kClose] () {
  29578. await this[kAgent].close()
  29579. await this[kClient].close()
  29580. }
  29581. async [kDestroy] () {
  29582. await this[kAgent].destroy()
  29583. await this[kClient].destroy()
  29584. }
  29585. }
  29586. /**
  29587. * @param {string[] | Record<string, string>} headers
  29588. * @returns {Record<string, string>}
  29589. */
  29590. function buildHeaders (headers) {
  29591. // When using undici.fetch, the headers list is stored
  29592. // as an array.
  29593. if (Array.isArray(headers)) {
  29594. /** @type {Record<string, string>} */
  29595. const headersPair = {}
  29596. for (let i = 0; i < headers.length; i += 2) {
  29597. headersPair[headers[i]] = headers[i + 1]
  29598. }
  29599. return headersPair
  29600. }
  29601. return headers
  29602. }
  29603. /**
  29604. * @param {Record<string, string>} headers
  29605. *
  29606. * Previous versions of ProxyAgent suggests the Proxy-Authorization in request headers
  29607. * Nevertheless, it was changed and to avoid a security vulnerability by end users
  29608. * this check was created.
  29609. * It should be removed in the next major version for performance reasons
  29610. */
  29611. function throwIfProxyAuthIsSent (headers) {
  29612. const existProxyAuth = headers && Object.keys(headers)
  29613. .find((key) => key.toLowerCase() === 'proxy-authorization')
  29614. if (existProxyAuth) {
  29615. throw new InvalidArgumentError('Proxy-Authorization should be sent in ProxyAgent constructor')
  29616. }
  29617. }
  29618. module.exports = ProxyAgent
  29619. /***/ }),
  29620. /***/ 9459:
  29621. /***/ ((module) => {
  29622. "use strict";
  29623. let fastNow = Date.now()
  29624. let fastNowTimeout
  29625. const fastTimers = []
  29626. function onTimeout () {
  29627. fastNow = Date.now()
  29628. let len = fastTimers.length
  29629. let idx = 0
  29630. while (idx < len) {
  29631. const timer = fastTimers[idx]
  29632. if (timer.state === 0) {
  29633. timer.state = fastNow + timer.delay
  29634. } else if (timer.state > 0 && fastNow >= timer.state) {
  29635. timer.state = -1
  29636. timer.callback(timer.opaque)
  29637. }
  29638. if (timer.state === -1) {
  29639. timer.state = -2
  29640. if (idx !== len - 1) {
  29641. fastTimers[idx] = fastTimers.pop()
  29642. } else {
  29643. fastTimers.pop()
  29644. }
  29645. len -= 1
  29646. } else {
  29647. idx += 1
  29648. }
  29649. }
  29650. if (fastTimers.length > 0) {
  29651. refreshTimeout()
  29652. }
  29653. }
  29654. function refreshTimeout () {
  29655. if (fastNowTimeout && fastNowTimeout.refresh) {
  29656. fastNowTimeout.refresh()
  29657. } else {
  29658. clearTimeout(fastNowTimeout)
  29659. fastNowTimeout = setTimeout(onTimeout, 1e3)
  29660. if (fastNowTimeout.unref) {
  29661. fastNowTimeout.unref()
  29662. }
  29663. }
  29664. }
  29665. class Timeout {
  29666. constructor (callback, delay, opaque) {
  29667. this.callback = callback
  29668. this.delay = delay
  29669. this.opaque = opaque
  29670. // -2 not in timer list
  29671. // -1 in timer list but inactive
  29672. // 0 in timer list waiting for time
  29673. // > 0 in timer list waiting for time to expire
  29674. this.state = -2
  29675. this.refresh()
  29676. }
  29677. refresh () {
  29678. if (this.state === -2) {
  29679. fastTimers.push(this)
  29680. if (!fastNowTimeout || fastTimers.length === 1) {
  29681. refreshTimeout()
  29682. }
  29683. }
  29684. this.state = 0
  29685. }
  29686. clear () {
  29687. this.state = -1
  29688. }
  29689. }
  29690. module.exports = {
  29691. setTimeout (callback, delay, opaque) {
  29692. return delay < 1e3
  29693. ? setTimeout(callback, delay, opaque)
  29694. : new Timeout(callback, delay, opaque)
  29695. },
  29696. clearTimeout (timeout) {
  29697. if (timeout instanceof Timeout) {
  29698. timeout.clear()
  29699. } else {
  29700. clearTimeout(timeout)
  29701. }
  29702. }
  29703. }
  29704. /***/ }),
  29705. /***/ 5354:
  29706. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  29707. "use strict";
  29708. const diagnosticsChannel = __nccwpck_require__(7643)
  29709. const { uid, states } = __nccwpck_require__(9188)
  29710. const {
  29711. kReadyState,
  29712. kSentClose,
  29713. kByteParser,
  29714. kReceivedClose
  29715. } = __nccwpck_require__(7578)
  29716. const { fireEvent, failWebsocketConnection } = __nccwpck_require__(5515)
  29717. const { CloseEvent } = __nccwpck_require__(2611)
  29718. const { makeRequest } = __nccwpck_require__(8359)
  29719. const { fetching } = __nccwpck_require__(4881)
  29720. const { Headers } = __nccwpck_require__(554)
  29721. const { getGlobalDispatcher } = __nccwpck_require__(1892)
  29722. const { kHeadersList } = __nccwpck_require__(2785)
  29723. const channels = {}
  29724. channels.open = diagnosticsChannel.channel('undici:websocket:open')
  29725. channels.close = diagnosticsChannel.channel('undici:websocket:close')
  29726. channels.socketError = diagnosticsChannel.channel('undici:websocket:socket_error')
  29727. /** @type {import('crypto')} */
  29728. let crypto
  29729. try {
  29730. crypto = __nccwpck_require__(6113)
  29731. } catch {
  29732. }
  29733. /**
  29734. * @see https://websockets.spec.whatwg.org/#concept-websocket-establish
  29735. * @param {URL} url
  29736. * @param {string|string[]} protocols
  29737. * @param {import('./websocket').WebSocket} ws
  29738. * @param {(response: any) => void} onEstablish
  29739. * @param {Partial<import('../../types/websocket').WebSocketInit>} options
  29740. */
  29741. function establishWebSocketConnection (url, protocols, ws, onEstablish, options) {
  29742. // 1. Let requestURL be a copy of url, with its scheme set to "http", if url’s
  29743. // scheme is "ws", and to "https" otherwise.
  29744. const requestURL = url
  29745. requestURL.protocol = url.protocol === 'ws:' ? 'http:' : 'https:'
  29746. // 2. Let request be a new request, whose URL is requestURL, client is client,
  29747. // service-workers mode is "none", referrer is "no-referrer", mode is
  29748. // "websocket", credentials mode is "include", cache mode is "no-store" ,
  29749. // and redirect mode is "error".
  29750. const request = makeRequest({
  29751. urlList: [requestURL],
  29752. serviceWorkers: 'none',
  29753. referrer: 'no-referrer',
  29754. mode: 'websocket',
  29755. credentials: 'include',
  29756. cache: 'no-store',
  29757. redirect: 'error'
  29758. })
  29759. // Note: undici extension, allow setting custom headers.
  29760. if (options.headers) {
  29761. const headersList = new Headers(options.headers)[kHeadersList]
  29762. request.headersList = headersList
  29763. }
  29764. // 3. Append (`Upgrade`, `websocket`) to request’s header list.
  29765. // 4. Append (`Connection`, `Upgrade`) to request’s header list.
  29766. // Note: both of these are handled by undici currently.
  29767. // https://github.com/nodejs/undici/blob/68c269c4144c446f3f1220951338daef4a6b5ec4/lib/client.js#L1397
  29768. // 5. Let keyValue be a nonce consisting of a randomly selected
  29769. // 16-byte value that has been forgiving-base64-encoded and
  29770. // isomorphic encoded.
  29771. const keyValue = crypto.randomBytes(16).toString('base64')
  29772. // 6. Append (`Sec-WebSocket-Key`, keyValue) to request’s
  29773. // header list.
  29774. request.headersList.append('sec-websocket-key', keyValue)
  29775. // 7. Append (`Sec-WebSocket-Version`, `13`) to request’s
  29776. // header list.
  29777. request.headersList.append('sec-websocket-version', '13')
  29778. // 8. For each protocol in protocols, combine
  29779. // (`Sec-WebSocket-Protocol`, protocol) in request’s header
  29780. // list.
  29781. for (const protocol of protocols) {
  29782. request.headersList.append('sec-websocket-protocol', protocol)
  29783. }
  29784. // 9. Let permessageDeflate be a user-agent defined
  29785. // "permessage-deflate" extension header value.
  29786. // https://github.com/mozilla/gecko-dev/blob/ce78234f5e653a5d3916813ff990f053510227bc/netwerk/protocol/websocket/WebSocketChannel.cpp#L2673
  29787. // TODO: enable once permessage-deflate is supported
  29788. const permessageDeflate = '' // 'permessage-deflate; 15'
  29789. // 10. Append (`Sec-WebSocket-Extensions`, permessageDeflate) to
  29790. // request’s header list.
  29791. // request.headersList.append('sec-websocket-extensions', permessageDeflate)
  29792. // 11. Fetch request with useParallelQueue set to true, and
  29793. // processResponse given response being these steps:
  29794. const controller = fetching({
  29795. request,
  29796. useParallelQueue: true,
  29797. dispatcher: options.dispatcher ?? getGlobalDispatcher(),
  29798. processResponse (response) {
  29799. // 1. If response is a network error or its status is not 101,
  29800. // fail the WebSocket connection.
  29801. if (response.type === 'error' || response.status !== 101) {
  29802. failWebsocketConnection(ws, 'Received network error or non-101 status code.')
  29803. return
  29804. }
  29805. // 2. If protocols is not the empty list and extracting header
  29806. // list values given `Sec-WebSocket-Protocol` and response’s
  29807. // header list results in null, failure, or the empty byte
  29808. // sequence, then fail the WebSocket connection.
  29809. if (protocols.length !== 0 && !response.headersList.get('Sec-WebSocket-Protocol')) {
  29810. failWebsocketConnection(ws, 'Server did not respond with sent protocols.')
  29811. return
  29812. }
  29813. // 3. Follow the requirements stated step 2 to step 6, inclusive,
  29814. // of the last set of steps in section 4.1 of The WebSocket
  29815. // Protocol to validate response. This either results in fail
  29816. // the WebSocket connection or the WebSocket connection is
  29817. // established.
  29818. // 2. If the response lacks an |Upgrade| header field or the |Upgrade|
  29819. // header field contains a value that is not an ASCII case-
  29820. // insensitive match for the value "websocket", the client MUST
  29821. // _Fail the WebSocket Connection_.
  29822. if (response.headersList.get('Upgrade')?.toLowerCase() !== 'websocket') {
  29823. failWebsocketConnection(ws, 'Server did not set Upgrade header to "websocket".')
  29824. return
  29825. }
  29826. // 3. If the response lacks a |Connection| header field or the
  29827. // |Connection| header field doesn't contain a token that is an
  29828. // ASCII case-insensitive match for the value "Upgrade", the client
  29829. // MUST _Fail the WebSocket Connection_.
  29830. if (response.headersList.get('Connection')?.toLowerCase() !== 'upgrade') {
  29831. failWebsocketConnection(ws, 'Server did not set Connection header to "upgrade".')
  29832. return
  29833. }
  29834. // 4. If the response lacks a |Sec-WebSocket-Accept| header field or
  29835. // the |Sec-WebSocket-Accept| contains a value other than the
  29836. // base64-encoded SHA-1 of the concatenation of the |Sec-WebSocket-
  29837. // Key| (as a string, not base64-decoded) with the string "258EAFA5-
  29838. // E914-47DA-95CA-C5AB0DC85B11" but ignoring any leading and
  29839. // trailing whitespace, the client MUST _Fail the WebSocket
  29840. // Connection_.
  29841. const secWSAccept = response.headersList.get('Sec-WebSocket-Accept')
  29842. const digest = crypto.createHash('sha1').update(keyValue + uid).digest('base64')
  29843. if (secWSAccept !== digest) {
  29844. failWebsocketConnection(ws, 'Incorrect hash received in Sec-WebSocket-Accept header.')
  29845. return
  29846. }
  29847. // 5. If the response includes a |Sec-WebSocket-Extensions| header
  29848. // field and this header field indicates the use of an extension
  29849. // that was not present in the client's handshake (the server has
  29850. // indicated an extension not requested by the client), the client
  29851. // MUST _Fail the WebSocket Connection_. (The parsing of this
  29852. // header field to determine which extensions are requested is
  29853. // discussed in Section 9.1.)
  29854. const secExtension = response.headersList.get('Sec-WebSocket-Extensions')
  29855. if (secExtension !== null && secExtension !== permessageDeflate) {
  29856. failWebsocketConnection(ws, 'Received different permessage-deflate than the one set.')
  29857. return
  29858. }
  29859. // 6. If the response includes a |Sec-WebSocket-Protocol| header field
  29860. // and this header field indicates the use of a subprotocol that was
  29861. // not present in the client's handshake (the server has indicated a
  29862. // subprotocol not requested by the client), the client MUST _Fail
  29863. // the WebSocket Connection_.
  29864. const secProtocol = response.headersList.get('Sec-WebSocket-Protocol')
  29865. if (secProtocol !== null && secProtocol !== request.headersList.get('Sec-WebSocket-Protocol')) {
  29866. failWebsocketConnection(ws, 'Protocol was not set in the opening handshake.')
  29867. return
  29868. }
  29869. response.socket.on('data', onSocketData)
  29870. response.socket.on('close', onSocketClose)
  29871. response.socket.on('error', onSocketError)
  29872. if (channels.open.hasSubscribers) {
  29873. channels.open.publish({
  29874. address: response.socket.address(),
  29875. protocol: secProtocol,
  29876. extensions: secExtension
  29877. })
  29878. }
  29879. onEstablish(response)
  29880. }
  29881. })
  29882. return controller
  29883. }
  29884. /**
  29885. * @param {Buffer} chunk
  29886. */
  29887. function onSocketData (chunk) {
  29888. if (!this.ws[kByteParser].write(chunk)) {
  29889. this.pause()
  29890. }
  29891. }
  29892. /**
  29893. * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol
  29894. * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.4
  29895. */
  29896. function onSocketClose () {
  29897. const { ws } = this
  29898. // If the TCP connection was closed after the
  29899. // WebSocket closing handshake was completed, the WebSocket connection
  29900. // is said to have been closed _cleanly_.
  29901. const wasClean = ws[kSentClose] && ws[kReceivedClose]
  29902. let code = 1005
  29903. let reason = ''
  29904. const result = ws[kByteParser].closingInfo
  29905. if (result) {
  29906. code = result.code ?? 1005
  29907. reason = result.reason
  29908. } else if (!ws[kSentClose]) {
  29909. // If _The WebSocket
  29910. // Connection is Closed_ and no Close control frame was received by the
  29911. // endpoint (such as could occur if the underlying transport connection
  29912. // is lost), _The WebSocket Connection Close Code_ is considered to be
  29913. // 1006.
  29914. code = 1006
  29915. }
  29916. // 1. Change the ready state to CLOSED (3).
  29917. ws[kReadyState] = states.CLOSED
  29918. // 2. If the user agent was required to fail the WebSocket
  29919. // connection, or if the WebSocket connection was closed
  29920. // after being flagged as full, fire an event named error
  29921. // at the WebSocket object.
  29922. // TODO
  29923. // 3. Fire an event named close at the WebSocket object,
  29924. // using CloseEvent, with the wasClean attribute
  29925. // initialized to true if the connection closed cleanly
  29926. // and false otherwise, the code attribute initialized to
  29927. // the WebSocket connection close code, and the reason
  29928. // attribute initialized to the result of applying UTF-8
  29929. // decode without BOM to the WebSocket connection close
  29930. // reason.
  29931. fireEvent('close', ws, CloseEvent, {
  29932. wasClean, code, reason
  29933. })
  29934. if (channels.close.hasSubscribers) {
  29935. channels.close.publish({
  29936. websocket: ws,
  29937. code,
  29938. reason
  29939. })
  29940. }
  29941. }
  29942. function onSocketError (error) {
  29943. const { ws } = this
  29944. ws[kReadyState] = states.CLOSING
  29945. if (channels.socketError.hasSubscribers) {
  29946. channels.socketError.publish(error)
  29947. }
  29948. this.destroy()
  29949. }
  29950. module.exports = {
  29951. establishWebSocketConnection
  29952. }
  29953. /***/ }),
  29954. /***/ 9188:
  29955. /***/ ((module) => {
  29956. "use strict";
  29957. // This is a Globally Unique Identifier unique used
  29958. // to validate that the endpoint accepts websocket
  29959. // connections.
  29960. // See https://www.rfc-editor.org/rfc/rfc6455.html#section-1.3
  29961. const uid = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'
  29962. /** @type {PropertyDescriptor} */
  29963. const staticPropertyDescriptors = {
  29964. enumerable: true,
  29965. writable: false,
  29966. configurable: false
  29967. }
  29968. const states = {
  29969. CONNECTING: 0,
  29970. OPEN: 1,
  29971. CLOSING: 2,
  29972. CLOSED: 3
  29973. }
  29974. const opcodes = {
  29975. CONTINUATION: 0x0,
  29976. TEXT: 0x1,
  29977. BINARY: 0x2,
  29978. CLOSE: 0x8,
  29979. PING: 0x9,
  29980. PONG: 0xA
  29981. }
  29982. const maxUnsigned16Bit = 2 ** 16 - 1 // 65535
  29983. const parserStates = {
  29984. INFO: 0,
  29985. PAYLOADLENGTH_16: 2,
  29986. PAYLOADLENGTH_64: 3,
  29987. READ_DATA: 4
  29988. }
  29989. const emptyBuffer = Buffer.allocUnsafe(0)
  29990. module.exports = {
  29991. uid,
  29992. staticPropertyDescriptors,
  29993. states,
  29994. opcodes,
  29995. maxUnsigned16Bit,
  29996. parserStates,
  29997. emptyBuffer
  29998. }
  29999. /***/ }),
  30000. /***/ 2611:
  30001. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  30002. "use strict";
  30003. const { webidl } = __nccwpck_require__(1744)
  30004. const { kEnumerableProperty } = __nccwpck_require__(3983)
  30005. const { MessagePort } = __nccwpck_require__(1267)
  30006. /**
  30007. * @see https://html.spec.whatwg.org/multipage/comms.html#messageevent
  30008. */
  30009. class MessageEvent extends Event {
  30010. #eventInit
  30011. constructor (type, eventInitDict = {}) {
  30012. webidl.argumentLengthCheck(arguments, 1, { header: 'MessageEvent constructor' })
  30013. type = webidl.converters.DOMString(type)
  30014. eventInitDict = webidl.converters.MessageEventInit(eventInitDict)
  30015. super(type, eventInitDict)
  30016. this.#eventInit = eventInitDict
  30017. }
  30018. get data () {
  30019. webidl.brandCheck(this, MessageEvent)
  30020. return this.#eventInit.data
  30021. }
  30022. get origin () {
  30023. webidl.brandCheck(this, MessageEvent)
  30024. return this.#eventInit.origin
  30025. }
  30026. get lastEventId () {
  30027. webidl.brandCheck(this, MessageEvent)
  30028. return this.#eventInit.lastEventId
  30029. }
  30030. get source () {
  30031. webidl.brandCheck(this, MessageEvent)
  30032. return this.#eventInit.source
  30033. }
  30034. get ports () {
  30035. webidl.brandCheck(this, MessageEvent)
  30036. if (!Object.isFrozen(this.#eventInit.ports)) {
  30037. Object.freeze(this.#eventInit.ports)
  30038. }
  30039. return this.#eventInit.ports
  30040. }
  30041. initMessageEvent (
  30042. type,
  30043. bubbles = false,
  30044. cancelable = false,
  30045. data = null,
  30046. origin = '',
  30047. lastEventId = '',
  30048. source = null,
  30049. ports = []
  30050. ) {
  30051. webidl.brandCheck(this, MessageEvent)
  30052. webidl.argumentLengthCheck(arguments, 1, { header: 'MessageEvent.initMessageEvent' })
  30053. return new MessageEvent(type, {
  30054. bubbles, cancelable, data, origin, lastEventId, source, ports
  30055. })
  30056. }
  30057. }
  30058. /**
  30059. * @see https://websockets.spec.whatwg.org/#the-closeevent-interface
  30060. */
  30061. class CloseEvent extends Event {
  30062. #eventInit
  30063. constructor (type, eventInitDict = {}) {
  30064. webidl.argumentLengthCheck(arguments, 1, { header: 'CloseEvent constructor' })
  30065. type = webidl.converters.DOMString(type)
  30066. eventInitDict = webidl.converters.CloseEventInit(eventInitDict)
  30067. super(type, eventInitDict)
  30068. this.#eventInit = eventInitDict
  30069. }
  30070. get wasClean () {
  30071. webidl.brandCheck(this, CloseEvent)
  30072. return this.#eventInit.wasClean
  30073. }
  30074. get code () {
  30075. webidl.brandCheck(this, CloseEvent)
  30076. return this.#eventInit.code
  30077. }
  30078. get reason () {
  30079. webidl.brandCheck(this, CloseEvent)
  30080. return this.#eventInit.reason
  30081. }
  30082. }
  30083. // https://html.spec.whatwg.org/multipage/webappapis.html#the-errorevent-interface
  30084. class ErrorEvent extends Event {
  30085. #eventInit
  30086. constructor (type, eventInitDict) {
  30087. webidl.argumentLengthCheck(arguments, 1, { header: 'ErrorEvent constructor' })
  30088. super(type, eventInitDict)
  30089. type = webidl.converters.DOMString(type)
  30090. eventInitDict = webidl.converters.ErrorEventInit(eventInitDict ?? {})
  30091. this.#eventInit = eventInitDict
  30092. }
  30093. get message () {
  30094. webidl.brandCheck(this, ErrorEvent)
  30095. return this.#eventInit.message
  30096. }
  30097. get filename () {
  30098. webidl.brandCheck(this, ErrorEvent)
  30099. return this.#eventInit.filename
  30100. }
  30101. get lineno () {
  30102. webidl.brandCheck(this, ErrorEvent)
  30103. return this.#eventInit.lineno
  30104. }
  30105. get colno () {
  30106. webidl.brandCheck(this, ErrorEvent)
  30107. return this.#eventInit.colno
  30108. }
  30109. get error () {
  30110. webidl.brandCheck(this, ErrorEvent)
  30111. return this.#eventInit.error
  30112. }
  30113. }
  30114. Object.defineProperties(MessageEvent.prototype, {
  30115. [Symbol.toStringTag]: {
  30116. value: 'MessageEvent',
  30117. configurable: true
  30118. },
  30119. data: kEnumerableProperty,
  30120. origin: kEnumerableProperty,
  30121. lastEventId: kEnumerableProperty,
  30122. source: kEnumerableProperty,
  30123. ports: kEnumerableProperty,
  30124. initMessageEvent: kEnumerableProperty
  30125. })
  30126. Object.defineProperties(CloseEvent.prototype, {
  30127. [Symbol.toStringTag]: {
  30128. value: 'CloseEvent',
  30129. configurable: true
  30130. },
  30131. reason: kEnumerableProperty,
  30132. code: kEnumerableProperty,
  30133. wasClean: kEnumerableProperty
  30134. })
  30135. Object.defineProperties(ErrorEvent.prototype, {
  30136. [Symbol.toStringTag]: {
  30137. value: 'ErrorEvent',
  30138. configurable: true
  30139. },
  30140. message: kEnumerableProperty,
  30141. filename: kEnumerableProperty,
  30142. lineno: kEnumerableProperty,
  30143. colno: kEnumerableProperty,
  30144. error: kEnumerableProperty
  30145. })
  30146. webidl.converters.MessagePort = webidl.interfaceConverter(MessagePort)
  30147. webidl.converters['sequence<MessagePort>'] = webidl.sequenceConverter(
  30148. webidl.converters.MessagePort
  30149. )
  30150. const eventInit = [
  30151. {
  30152. key: 'bubbles',
  30153. converter: webidl.converters.boolean,
  30154. defaultValue: false
  30155. },
  30156. {
  30157. key: 'cancelable',
  30158. converter: webidl.converters.boolean,
  30159. defaultValue: false
  30160. },
  30161. {
  30162. key: 'composed',
  30163. converter: webidl.converters.boolean,
  30164. defaultValue: false
  30165. }
  30166. ]
  30167. webidl.converters.MessageEventInit = webidl.dictionaryConverter([
  30168. ...eventInit,
  30169. {
  30170. key: 'data',
  30171. converter: webidl.converters.any,
  30172. defaultValue: null
  30173. },
  30174. {
  30175. key: 'origin',
  30176. converter: webidl.converters.USVString,
  30177. defaultValue: ''
  30178. },
  30179. {
  30180. key: 'lastEventId',
  30181. converter: webidl.converters.DOMString,
  30182. defaultValue: ''
  30183. },
  30184. {
  30185. key: 'source',
  30186. // Node doesn't implement WindowProxy or ServiceWorker, so the only
  30187. // valid value for source is a MessagePort.
  30188. converter: webidl.nullableConverter(webidl.converters.MessagePort),
  30189. defaultValue: null
  30190. },
  30191. {
  30192. key: 'ports',
  30193. converter: webidl.converters['sequence<MessagePort>'],
  30194. get defaultValue () {
  30195. return []
  30196. }
  30197. }
  30198. ])
  30199. webidl.converters.CloseEventInit = webidl.dictionaryConverter([
  30200. ...eventInit,
  30201. {
  30202. key: 'wasClean',
  30203. converter: webidl.converters.boolean,
  30204. defaultValue: false
  30205. },
  30206. {
  30207. key: 'code',
  30208. converter: webidl.converters['unsigned short'],
  30209. defaultValue: 0
  30210. },
  30211. {
  30212. key: 'reason',
  30213. converter: webidl.converters.USVString,
  30214. defaultValue: ''
  30215. }
  30216. ])
  30217. webidl.converters.ErrorEventInit = webidl.dictionaryConverter([
  30218. ...eventInit,
  30219. {
  30220. key: 'message',
  30221. converter: webidl.converters.DOMString,
  30222. defaultValue: ''
  30223. },
  30224. {
  30225. key: 'filename',
  30226. converter: webidl.converters.USVString,
  30227. defaultValue: ''
  30228. },
  30229. {
  30230. key: 'lineno',
  30231. converter: webidl.converters['unsigned long'],
  30232. defaultValue: 0
  30233. },
  30234. {
  30235. key: 'colno',
  30236. converter: webidl.converters['unsigned long'],
  30237. defaultValue: 0
  30238. },
  30239. {
  30240. key: 'error',
  30241. converter: webidl.converters.any
  30242. }
  30243. ])
  30244. module.exports = {
  30245. MessageEvent,
  30246. CloseEvent,
  30247. ErrorEvent
  30248. }
  30249. /***/ }),
  30250. /***/ 5444:
  30251. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  30252. "use strict";
  30253. const { maxUnsigned16Bit } = __nccwpck_require__(9188)
  30254. /** @type {import('crypto')} */
  30255. let crypto
  30256. try {
  30257. crypto = __nccwpck_require__(6113)
  30258. } catch {
  30259. }
  30260. class WebsocketFrameSend {
  30261. /**
  30262. * @param {Buffer|undefined} data
  30263. */
  30264. constructor (data) {
  30265. this.frameData = data
  30266. this.maskKey = crypto.randomBytes(4)
  30267. }
  30268. createFrame (opcode) {
  30269. const bodyLength = this.frameData?.byteLength ?? 0
  30270. /** @type {number} */
  30271. let payloadLength = bodyLength // 0-125
  30272. let offset = 6
  30273. if (bodyLength > maxUnsigned16Bit) {
  30274. offset += 8 // payload length is next 8 bytes
  30275. payloadLength = 127
  30276. } else if (bodyLength > 125) {
  30277. offset += 2 // payload length is next 2 bytes
  30278. payloadLength = 126
  30279. }
  30280. const buffer = Buffer.allocUnsafe(bodyLength + offset)
  30281. // Clear first 2 bytes, everything else is overwritten
  30282. buffer[0] = buffer[1] = 0
  30283. buffer[0] |= 0x80 // FIN
  30284. buffer[0] = (buffer[0] & 0xF0) + opcode // opcode
  30285. /*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> */
  30286. buffer[offset - 4] = this.maskKey[0]
  30287. buffer[offset - 3] = this.maskKey[1]
  30288. buffer[offset - 2] = this.maskKey[2]
  30289. buffer[offset - 1] = this.maskKey[3]
  30290. buffer[1] = payloadLength
  30291. if (payloadLength === 126) {
  30292. buffer.writeUInt16BE(bodyLength, 2)
  30293. } else if (payloadLength === 127) {
  30294. // Clear extended payload length
  30295. buffer[2] = buffer[3] = 0
  30296. buffer.writeUIntBE(bodyLength, 4, 6)
  30297. }
  30298. buffer[1] |= 0x80 // MASK
  30299. // mask body
  30300. for (let i = 0; i < bodyLength; i++) {
  30301. buffer[offset + i] = this.frameData[i] ^ this.maskKey[i % 4]
  30302. }
  30303. return buffer
  30304. }
  30305. }
  30306. module.exports = {
  30307. WebsocketFrameSend
  30308. }
  30309. /***/ }),
  30310. /***/ 1688:
  30311. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  30312. "use strict";
  30313. const { Writable } = __nccwpck_require__(2781)
  30314. const diagnosticsChannel = __nccwpck_require__(7643)
  30315. const { parserStates, opcodes, states, emptyBuffer } = __nccwpck_require__(9188)
  30316. const { kReadyState, kSentClose, kResponse, kReceivedClose } = __nccwpck_require__(7578)
  30317. const { isValidStatusCode, failWebsocketConnection, websocketMessageReceived } = __nccwpck_require__(5515)
  30318. const { WebsocketFrameSend } = __nccwpck_require__(5444)
  30319. // This code was influenced by ws released under the MIT license.
  30320. // Copyright (c) 2011 Einar Otto Stangvik <einaros@gmail.com>
  30321. // Copyright (c) 2013 Arnout Kazemier and contributors
  30322. // Copyright (c) 2016 Luigi Pinca and contributors
  30323. const channels = {}
  30324. channels.ping = diagnosticsChannel.channel('undici:websocket:ping')
  30325. channels.pong = diagnosticsChannel.channel('undici:websocket:pong')
  30326. class ByteParser extends Writable {
  30327. #buffers = []
  30328. #byteOffset = 0
  30329. #state = parserStates.INFO
  30330. #info = {}
  30331. #fragments = []
  30332. constructor (ws) {
  30333. super()
  30334. this.ws = ws
  30335. }
  30336. /**
  30337. * @param {Buffer} chunk
  30338. * @param {() => void} callback
  30339. */
  30340. _write (chunk, _, callback) {
  30341. this.#buffers.push(chunk)
  30342. this.#byteOffset += chunk.length
  30343. this.run(callback)
  30344. }
  30345. /**
  30346. * Runs whenever a new chunk is received.
  30347. * Callback is called whenever there are no more chunks buffering,
  30348. * or not enough bytes are buffered to parse.
  30349. */
  30350. run (callback) {
  30351. while (true) {
  30352. if (this.#state === parserStates.INFO) {
  30353. // If there aren't enough bytes to parse the payload length, etc.
  30354. if (this.#byteOffset < 2) {
  30355. return callback()
  30356. }
  30357. const buffer = this.consume(2)
  30358. this.#info.fin = (buffer[0] & 0x80) !== 0
  30359. this.#info.opcode = buffer[0] & 0x0F
  30360. // If we receive a fragmented message, we use the type of the first
  30361. // frame to parse the full message as binary/text, when it's terminated
  30362. this.#info.originalOpcode ??= this.#info.opcode
  30363. this.#info.fragmented = !this.#info.fin && this.#info.opcode !== opcodes.CONTINUATION
  30364. if (this.#info.fragmented && this.#info.opcode !== opcodes.BINARY && this.#info.opcode !== opcodes.TEXT) {
  30365. // Only text and binary frames can be fragmented
  30366. failWebsocketConnection(this.ws, 'Invalid frame type was fragmented.')
  30367. return
  30368. }
  30369. const payloadLength = buffer[1] & 0x7F
  30370. if (payloadLength <= 125) {
  30371. this.#info.payloadLength = payloadLength
  30372. this.#state = parserStates.READ_DATA
  30373. } else if (payloadLength === 126) {
  30374. this.#state = parserStates.PAYLOADLENGTH_16
  30375. } else if (payloadLength === 127) {
  30376. this.#state = parserStates.PAYLOADLENGTH_64
  30377. }
  30378. if (this.#info.fragmented && payloadLength > 125) {
  30379. // A fragmented frame can't be fragmented itself
  30380. failWebsocketConnection(this.ws, 'Fragmented frame exceeded 125 bytes.')
  30381. return
  30382. } else if (
  30383. (this.#info.opcode === opcodes.PING ||
  30384. this.#info.opcode === opcodes.PONG ||
  30385. this.#info.opcode === opcodes.CLOSE) &&
  30386. payloadLength > 125
  30387. ) {
  30388. // Control frames can have a payload length of 125 bytes MAX
  30389. failWebsocketConnection(this.ws, 'Payload length for control frame exceeded 125 bytes.')
  30390. return
  30391. } else if (this.#info.opcode === opcodes.CLOSE) {
  30392. if (payloadLength === 1) {
  30393. failWebsocketConnection(this.ws, 'Received close frame with a 1-byte body.')
  30394. return
  30395. }
  30396. const body = this.consume(payloadLength)
  30397. this.#info.closeInfo = this.parseCloseBody(false, body)
  30398. if (!this.ws[kSentClose]) {
  30399. // If an endpoint receives a Close frame and did not previously send a
  30400. // Close frame, the endpoint MUST send a Close frame in response. (When
  30401. // sending a Close frame in response, the endpoint typically echos the
  30402. // status code it received.)
  30403. const body = Buffer.allocUnsafe(2)
  30404. body.writeUInt16BE(this.#info.closeInfo.code, 0)
  30405. const closeFrame = new WebsocketFrameSend(body)
  30406. this.ws[kResponse].socket.write(
  30407. closeFrame.createFrame(opcodes.CLOSE),
  30408. (err) => {
  30409. if (!err) {
  30410. this.ws[kSentClose] = true
  30411. }
  30412. }
  30413. )
  30414. }
  30415. // Upon either sending or receiving a Close control frame, it is said
  30416. // that _The WebSocket Closing Handshake is Started_ and that the
  30417. // WebSocket connection is in the CLOSING state.
  30418. this.ws[kReadyState] = states.CLOSING
  30419. this.ws[kReceivedClose] = true
  30420. this.end()
  30421. return
  30422. } else if (this.#info.opcode === opcodes.PING) {
  30423. // Upon receipt of a Ping frame, an endpoint MUST send a Pong frame in
  30424. // response, unless it already received a Close frame.
  30425. // A Pong frame sent in response to a Ping frame must have identical
  30426. // "Application data"
  30427. const body = this.consume(payloadLength)
  30428. if (!this.ws[kReceivedClose]) {
  30429. const frame = new WebsocketFrameSend(body)
  30430. this.ws[kResponse].socket.write(frame.createFrame(opcodes.PONG))
  30431. if (channels.ping.hasSubscribers) {
  30432. channels.ping.publish({
  30433. payload: body
  30434. })
  30435. }
  30436. }
  30437. this.#state = parserStates.INFO
  30438. if (this.#byteOffset > 0) {
  30439. continue
  30440. } else {
  30441. callback()
  30442. return
  30443. }
  30444. } else if (this.#info.opcode === opcodes.PONG) {
  30445. // A Pong frame MAY be sent unsolicited. This serves as a
  30446. // unidirectional heartbeat. A response to an unsolicited Pong frame is
  30447. // not expected.
  30448. const body = this.consume(payloadLength)
  30449. if (channels.pong.hasSubscribers) {
  30450. channels.pong.publish({
  30451. payload: body
  30452. })
  30453. }
  30454. if (this.#byteOffset > 0) {
  30455. continue
  30456. } else {
  30457. callback()
  30458. return
  30459. }
  30460. }
  30461. } else if (this.#state === parserStates.PAYLOADLENGTH_16) {
  30462. if (this.#byteOffset < 2) {
  30463. return callback()
  30464. }
  30465. const buffer = this.consume(2)
  30466. this.#info.payloadLength = buffer.readUInt16BE(0)
  30467. this.#state = parserStates.READ_DATA
  30468. } else if (this.#state === parserStates.PAYLOADLENGTH_64) {
  30469. if (this.#byteOffset < 8) {
  30470. return callback()
  30471. }
  30472. const buffer = this.consume(8)
  30473. const upper = buffer.readUInt32BE(0)
  30474. // 2^31 is the maxinimum bytes an arraybuffer can contain
  30475. // on 32-bit systems. Although, on 64-bit systems, this is
  30476. // 2^53-1 bytes.
  30477. // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Invalid_array_length
  30478. // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/common/globals.h;drc=1946212ac0100668f14eb9e2843bdd846e510a1e;bpv=1;bpt=1;l=1275
  30479. // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/objects/js-array-buffer.h;l=34;drc=1946212ac0100668f14eb9e2843bdd846e510a1e
  30480. if (upper > 2 ** 31 - 1) {
  30481. failWebsocketConnection(this.ws, 'Received payload length > 2^31 bytes.')
  30482. return
  30483. }
  30484. const lower = buffer.readUInt32BE(4)
  30485. this.#info.payloadLength = (upper << 8) + lower
  30486. this.#state = parserStates.READ_DATA
  30487. } else if (this.#state === parserStates.READ_DATA) {
  30488. if (this.#byteOffset < this.#info.payloadLength) {
  30489. // If there is still more data in this chunk that needs to be read
  30490. return callback()
  30491. } else if (this.#byteOffset >= this.#info.payloadLength) {
  30492. // If the server sent multiple frames in a single chunk
  30493. const body = this.consume(this.#info.payloadLength)
  30494. this.#fragments.push(body)
  30495. // If the frame is unfragmented, or a fragmented frame was terminated,
  30496. // a message was received
  30497. if (!this.#info.fragmented || (this.#info.fin && this.#info.opcode === opcodes.CONTINUATION)) {
  30498. const fullMessage = Buffer.concat(this.#fragments)
  30499. websocketMessageReceived(this.ws, this.#info.originalOpcode, fullMessage)
  30500. this.#info = {}
  30501. this.#fragments.length = 0
  30502. }
  30503. this.#state = parserStates.INFO
  30504. }
  30505. }
  30506. if (this.#byteOffset > 0) {
  30507. continue
  30508. } else {
  30509. callback()
  30510. break
  30511. }
  30512. }
  30513. }
  30514. /**
  30515. * Take n bytes from the buffered Buffers
  30516. * @param {number} n
  30517. * @returns {Buffer|null}
  30518. */
  30519. consume (n) {
  30520. if (n > this.#byteOffset) {
  30521. return null
  30522. } else if (n === 0) {
  30523. return emptyBuffer
  30524. }
  30525. if (this.#buffers[0].length === n) {
  30526. this.#byteOffset -= this.#buffers[0].length
  30527. return this.#buffers.shift()
  30528. }
  30529. const buffer = Buffer.allocUnsafe(n)
  30530. let offset = 0
  30531. while (offset !== n) {
  30532. const next = this.#buffers[0]
  30533. const { length } = next
  30534. if (length + offset === n) {
  30535. buffer.set(this.#buffers.shift(), offset)
  30536. break
  30537. } else if (length + offset > n) {
  30538. buffer.set(next.subarray(0, n - offset), offset)
  30539. this.#buffers[0] = next.subarray(n - offset)
  30540. break
  30541. } else {
  30542. buffer.set(this.#buffers.shift(), offset)
  30543. offset += next.length
  30544. }
  30545. }
  30546. this.#byteOffset -= n
  30547. return buffer
  30548. }
  30549. parseCloseBody (onlyCode, data) {
  30550. // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.5
  30551. /** @type {number|undefined} */
  30552. let code
  30553. if (data.length >= 2) {
  30554. // _The WebSocket Connection Close Code_ is
  30555. // defined as the status code (Section 7.4) contained in the first Close
  30556. // control frame received by the application
  30557. code = data.readUInt16BE(0)
  30558. }
  30559. if (onlyCode) {
  30560. if (!isValidStatusCode(code)) {
  30561. return null
  30562. }
  30563. return { code }
  30564. }
  30565. // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.6
  30566. /** @type {Buffer} */
  30567. let reason = data.subarray(2)
  30568. // Remove BOM
  30569. if (reason[0] === 0xEF && reason[1] === 0xBB && reason[2] === 0xBF) {
  30570. reason = reason.subarray(3)
  30571. }
  30572. if (code !== undefined && !isValidStatusCode(code)) {
  30573. return null
  30574. }
  30575. try {
  30576. // TODO: optimize this
  30577. reason = new TextDecoder('utf-8', { fatal: true }).decode(reason)
  30578. } catch {
  30579. return null
  30580. }
  30581. return { code, reason }
  30582. }
  30583. get closingInfo () {
  30584. return this.#info.closeInfo
  30585. }
  30586. }
  30587. module.exports = {
  30588. ByteParser
  30589. }
  30590. /***/ }),
  30591. /***/ 7578:
  30592. /***/ ((module) => {
  30593. "use strict";
  30594. module.exports = {
  30595. kWebSocketURL: Symbol('url'),
  30596. kReadyState: Symbol('ready state'),
  30597. kController: Symbol('controller'),
  30598. kResponse: Symbol('response'),
  30599. kBinaryType: Symbol('binary type'),
  30600. kSentClose: Symbol('sent close'),
  30601. kReceivedClose: Symbol('received close'),
  30602. kByteParser: Symbol('byte parser')
  30603. }
  30604. /***/ }),
  30605. /***/ 5515:
  30606. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  30607. "use strict";
  30608. const { kReadyState, kController, kResponse, kBinaryType, kWebSocketURL } = __nccwpck_require__(7578)
  30609. const { states, opcodes } = __nccwpck_require__(9188)
  30610. const { MessageEvent, ErrorEvent } = __nccwpck_require__(2611)
  30611. /* globals Blob */
  30612. /**
  30613. * @param {import('./websocket').WebSocket} ws
  30614. */
  30615. function isEstablished (ws) {
  30616. // If the server's response is validated as provided for above, it is
  30617. // said that _The WebSocket Connection is Established_ and that the
  30618. // WebSocket Connection is in the OPEN state.
  30619. return ws[kReadyState] === states.OPEN
  30620. }
  30621. /**
  30622. * @param {import('./websocket').WebSocket} ws
  30623. */
  30624. function isClosing (ws) {
  30625. // Upon either sending or receiving a Close control frame, it is said
  30626. // that _The WebSocket Closing Handshake is Started_ and that the
  30627. // WebSocket connection is in the CLOSING state.
  30628. return ws[kReadyState] === states.CLOSING
  30629. }
  30630. /**
  30631. * @param {import('./websocket').WebSocket} ws
  30632. */
  30633. function isClosed (ws) {
  30634. return ws[kReadyState] === states.CLOSED
  30635. }
  30636. /**
  30637. * @see https://dom.spec.whatwg.org/#concept-event-fire
  30638. * @param {string} e
  30639. * @param {EventTarget} target
  30640. * @param {EventInit | undefined} eventInitDict
  30641. */
  30642. function fireEvent (e, target, eventConstructor = Event, eventInitDict) {
  30643. // 1. If eventConstructor is not given, then let eventConstructor be Event.
  30644. // 2. Let event be the result of creating an event given eventConstructor,
  30645. // in the relevant realm of target.
  30646. // 3. Initialize event’s type attribute to e.
  30647. const event = new eventConstructor(e, eventInitDict) // eslint-disable-line new-cap
  30648. // 4. Initialize any other IDL attributes of event as described in the
  30649. // invocation of this algorithm.
  30650. // 5. Return the result of dispatching event at target, with legacy target
  30651. // override flag set if set.
  30652. target.dispatchEvent(event)
  30653. }
  30654. /**
  30655. * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol
  30656. * @param {import('./websocket').WebSocket} ws
  30657. * @param {number} type Opcode
  30658. * @param {Buffer} data application data
  30659. */
  30660. function websocketMessageReceived (ws, type, data) {
  30661. // 1. If ready state is not OPEN (1), then return.
  30662. if (ws[kReadyState] !== states.OPEN) {
  30663. return
  30664. }
  30665. // 2. Let dataForEvent be determined by switching on type and binary type:
  30666. let dataForEvent
  30667. if (type === opcodes.TEXT) {
  30668. // -> type indicates that the data is Text
  30669. // a new DOMString containing data
  30670. try {
  30671. dataForEvent = new TextDecoder('utf-8', { fatal: true }).decode(data)
  30672. } catch {
  30673. failWebsocketConnection(ws, 'Received invalid UTF-8 in text frame.')
  30674. return
  30675. }
  30676. } else if (type === opcodes.BINARY) {
  30677. if (ws[kBinaryType] === 'blob') {
  30678. // -> type indicates that the data is Binary and binary type is "blob"
  30679. // a new Blob object, created in the relevant Realm of the WebSocket
  30680. // object, that represents data as its raw data
  30681. dataForEvent = new Blob([data])
  30682. } else {
  30683. // -> type indicates that the data is Binary and binary type is "arraybuffer"
  30684. // a new ArrayBuffer object, created in the relevant Realm of the
  30685. // WebSocket object, whose contents are data
  30686. dataForEvent = new Uint8Array(data).buffer
  30687. }
  30688. }
  30689. // 3. Fire an event named message at the WebSocket object, using MessageEvent,
  30690. // with the origin attribute initialized to the serialization of the WebSocket
  30691. // object’s url's origin, and the data attribute initialized to dataForEvent.
  30692. fireEvent('message', ws, MessageEvent, {
  30693. origin: ws[kWebSocketURL].origin,
  30694. data: dataForEvent
  30695. })
  30696. }
  30697. /**
  30698. * @see https://datatracker.ietf.org/doc/html/rfc6455
  30699. * @see https://datatracker.ietf.org/doc/html/rfc2616
  30700. * @see https://bugs.chromium.org/p/chromium/issues/detail?id=398407
  30701. * @param {string} protocol
  30702. */
  30703. function isValidSubprotocol (protocol) {
  30704. // If present, this value indicates one
  30705. // or more comma-separated subprotocol the client wishes to speak,
  30706. // ordered by preference. The elements that comprise this value
  30707. // MUST be non-empty strings with characters in the range U+0021 to
  30708. // U+007E not including separator characters as defined in
  30709. // [RFC2616] and MUST all be unique strings.
  30710. if (protocol.length === 0) {
  30711. return false
  30712. }
  30713. for (const char of protocol) {
  30714. const code = char.charCodeAt(0)
  30715. if (
  30716. code < 0x21 ||
  30717. code > 0x7E ||
  30718. char === '(' ||
  30719. char === ')' ||
  30720. char === '<' ||
  30721. char === '>' ||
  30722. char === '@' ||
  30723. char === ',' ||
  30724. char === ';' ||
  30725. char === ':' ||
  30726. char === '\\' ||
  30727. char === '"' ||
  30728. char === '/' ||
  30729. char === '[' ||
  30730. char === ']' ||
  30731. char === '?' ||
  30732. char === '=' ||
  30733. char === '{' ||
  30734. char === '}' ||
  30735. code === 32 || // SP
  30736. code === 9 // HT
  30737. ) {
  30738. return false
  30739. }
  30740. }
  30741. return true
  30742. }
  30743. /**
  30744. * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7-4
  30745. * @param {number} code
  30746. */
  30747. function isValidStatusCode (code) {
  30748. if (code >= 1000 && code < 1015) {
  30749. return (
  30750. code !== 1004 && // reserved
  30751. code !== 1005 && // "MUST NOT be set as a status code"
  30752. code !== 1006 // "MUST NOT be set as a status code"
  30753. )
  30754. }
  30755. return code >= 3000 && code <= 4999
  30756. }
  30757. /**
  30758. * @param {import('./websocket').WebSocket} ws
  30759. * @param {string|undefined} reason
  30760. */
  30761. function failWebsocketConnection (ws, reason) {
  30762. const { [kController]: controller, [kResponse]: response } = ws
  30763. controller.abort()
  30764. if (response?.socket && !response.socket.destroyed) {
  30765. response.socket.destroy()
  30766. }
  30767. if (reason) {
  30768. fireEvent('error', ws, ErrorEvent, {
  30769. error: new Error(reason)
  30770. })
  30771. }
  30772. }
  30773. module.exports = {
  30774. isEstablished,
  30775. isClosing,
  30776. isClosed,
  30777. fireEvent,
  30778. isValidSubprotocol,
  30779. isValidStatusCode,
  30780. failWebsocketConnection,
  30781. websocketMessageReceived
  30782. }
  30783. /***/ }),
  30784. /***/ 4284:
  30785. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  30786. "use strict";
  30787. const { webidl } = __nccwpck_require__(1744)
  30788. const { DOMException } = __nccwpck_require__(1037)
  30789. const { URLSerializer } = __nccwpck_require__(685)
  30790. const { getGlobalOrigin } = __nccwpck_require__(1246)
  30791. const { staticPropertyDescriptors, states, opcodes, emptyBuffer } = __nccwpck_require__(9188)
  30792. const {
  30793. kWebSocketURL,
  30794. kReadyState,
  30795. kController,
  30796. kBinaryType,
  30797. kResponse,
  30798. kSentClose,
  30799. kByteParser
  30800. } = __nccwpck_require__(7578)
  30801. const { isEstablished, isClosing, isValidSubprotocol, failWebsocketConnection, fireEvent } = __nccwpck_require__(5515)
  30802. const { establishWebSocketConnection } = __nccwpck_require__(5354)
  30803. const { WebsocketFrameSend } = __nccwpck_require__(5444)
  30804. const { ByteParser } = __nccwpck_require__(1688)
  30805. const { kEnumerableProperty, isBlobLike } = __nccwpck_require__(3983)
  30806. const { getGlobalDispatcher } = __nccwpck_require__(1892)
  30807. const { types } = __nccwpck_require__(3837)
  30808. let experimentalWarned = false
  30809. // https://websockets.spec.whatwg.org/#interface-definition
  30810. class WebSocket extends EventTarget {
  30811. #events = {
  30812. open: null,
  30813. error: null,
  30814. close: null,
  30815. message: null
  30816. }
  30817. #bufferedAmount = 0
  30818. #protocol = ''
  30819. #extensions = ''
  30820. /**
  30821. * @param {string} url
  30822. * @param {string|string[]} protocols
  30823. */
  30824. constructor (url, protocols = []) {
  30825. super()
  30826. webidl.argumentLengthCheck(arguments, 1, { header: 'WebSocket constructor' })
  30827. if (!experimentalWarned) {
  30828. experimentalWarned = true
  30829. process.emitWarning('WebSockets are experimental, expect them to change at any time.', {
  30830. code: 'UNDICI-WS'
  30831. })
  30832. }
  30833. const options = webidl.converters['DOMString or sequence<DOMString> or WebSocketInit'](protocols)
  30834. url = webidl.converters.USVString(url)
  30835. protocols = options.protocols
  30836. // 1. Let baseURL be this's relevant settings object's API base URL.
  30837. const baseURL = getGlobalOrigin()
  30838. // 1. Let urlRecord be the result of applying the URL parser to url with baseURL.
  30839. let urlRecord
  30840. try {
  30841. urlRecord = new URL(url, baseURL)
  30842. } catch (e) {
  30843. // 3. If urlRecord is failure, then throw a "SyntaxError" DOMException.
  30844. throw new DOMException(e, 'SyntaxError')
  30845. }
  30846. // 4. If urlRecord’s scheme is "http", then set urlRecord’s scheme to "ws".
  30847. if (urlRecord.protocol === 'http:') {
  30848. urlRecord.protocol = 'ws:'
  30849. } else if (urlRecord.protocol === 'https:') {
  30850. // 5. Otherwise, if urlRecord’s scheme is "https", set urlRecord’s scheme to "wss".
  30851. urlRecord.protocol = 'wss:'
  30852. }
  30853. // 6. If urlRecord’s scheme is not "ws" or "wss", then throw a "SyntaxError" DOMException.
  30854. if (urlRecord.protocol !== 'ws:' && urlRecord.protocol !== 'wss:') {
  30855. throw new DOMException(
  30856. `Expected a ws: or wss: protocol, got ${urlRecord.protocol}`,
  30857. 'SyntaxError'
  30858. )
  30859. }
  30860. // 7. If urlRecord’s fragment is non-null, then throw a "SyntaxError"
  30861. // DOMException.
  30862. if (urlRecord.hash || urlRecord.href.endsWith('#')) {
  30863. throw new DOMException('Got fragment', 'SyntaxError')
  30864. }
  30865. // 8. If protocols is a string, set protocols to a sequence consisting
  30866. // of just that string.
  30867. if (typeof protocols === 'string') {
  30868. protocols = [protocols]
  30869. }
  30870. // 9. If any of the values in protocols occur more than once or otherwise
  30871. // fail to match the requirements for elements that comprise the value
  30872. // of `Sec-WebSocket-Protocol` fields as defined by The WebSocket
  30873. // protocol, then throw a "SyntaxError" DOMException.
  30874. if (protocols.length !== new Set(protocols.map(p => p.toLowerCase())).size) {
  30875. throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError')
  30876. }
  30877. if (protocols.length > 0 && !protocols.every(p => isValidSubprotocol(p))) {
  30878. throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError')
  30879. }
  30880. // 10. Set this's url to urlRecord.
  30881. this[kWebSocketURL] = new URL(urlRecord.href)
  30882. // 11. Let client be this's relevant settings object.
  30883. // 12. Run this step in parallel:
  30884. // 1. Establish a WebSocket connection given urlRecord, protocols,
  30885. // and client.
  30886. this[kController] = establishWebSocketConnection(
  30887. urlRecord,
  30888. protocols,
  30889. this,
  30890. (response) => this.#onConnectionEstablished(response),
  30891. options
  30892. )
  30893. // Each WebSocket object has an associated ready state, which is a
  30894. // number representing the state of the connection. Initially it must
  30895. // be CONNECTING (0).
  30896. this[kReadyState] = WebSocket.CONNECTING
  30897. // The extensions attribute must initially return the empty string.
  30898. // The protocol attribute must initially return the empty string.
  30899. // Each WebSocket object has an associated binary type, which is a
  30900. // BinaryType. Initially it must be "blob".
  30901. this[kBinaryType] = 'blob'
  30902. }
  30903. /**
  30904. * @see https://websockets.spec.whatwg.org/#dom-websocket-close
  30905. * @param {number|undefined} code
  30906. * @param {string|undefined} reason
  30907. */
  30908. close (code = undefined, reason = undefined) {
  30909. webidl.brandCheck(this, WebSocket)
  30910. if (code !== undefined) {
  30911. code = webidl.converters['unsigned short'](code, { clamp: true })
  30912. }
  30913. if (reason !== undefined) {
  30914. reason = webidl.converters.USVString(reason)
  30915. }
  30916. // 1. If code is present, but is neither an integer equal to 1000 nor an
  30917. // integer in the range 3000 to 4999, inclusive, throw an
  30918. // "InvalidAccessError" DOMException.
  30919. if (code !== undefined) {
  30920. if (code !== 1000 && (code < 3000 || code > 4999)) {
  30921. throw new DOMException('invalid code', 'InvalidAccessError')
  30922. }
  30923. }
  30924. let reasonByteLength = 0
  30925. // 2. If reason is present, then run these substeps:
  30926. if (reason !== undefined) {
  30927. // 1. Let reasonBytes be the result of encoding reason.
  30928. // 2. If reasonBytes is longer than 123 bytes, then throw a
  30929. // "SyntaxError" DOMException.
  30930. reasonByteLength = Buffer.byteLength(reason)
  30931. if (reasonByteLength > 123) {
  30932. throw new DOMException(
  30933. `Reason must be less than 123 bytes; received ${reasonByteLength}`,
  30934. 'SyntaxError'
  30935. )
  30936. }
  30937. }
  30938. // 3. Run the first matching steps from the following list:
  30939. if (this[kReadyState] === WebSocket.CLOSING || this[kReadyState] === WebSocket.CLOSED) {
  30940. // If this's ready state is CLOSING (2) or CLOSED (3)
  30941. // Do nothing.
  30942. } else if (!isEstablished(this)) {
  30943. // If the WebSocket connection is not yet established
  30944. // Fail the WebSocket connection and set this's ready state
  30945. // to CLOSING (2).
  30946. failWebsocketConnection(this, 'Connection was closed before it was established.')
  30947. this[kReadyState] = WebSocket.CLOSING
  30948. } else if (!isClosing(this)) {
  30949. // If the WebSocket closing handshake has not yet been started
  30950. // Start the WebSocket closing handshake and set this's ready
  30951. // state to CLOSING (2).
  30952. // - If neither code nor reason is present, the WebSocket Close
  30953. // message must not have a body.
  30954. // - If code is present, then the status code to use in the
  30955. // WebSocket Close message must be the integer given by code.
  30956. // - If reason is also present, then reasonBytes must be
  30957. // provided in the Close message after the status code.
  30958. const frame = new WebsocketFrameSend()
  30959. // If neither code nor reason is present, the WebSocket Close
  30960. // message must not have a body.
  30961. // If code is present, then the status code to use in the
  30962. // WebSocket Close message must be the integer given by code.
  30963. if (code !== undefined && reason === undefined) {
  30964. frame.frameData = Buffer.allocUnsafe(2)
  30965. frame.frameData.writeUInt16BE(code, 0)
  30966. } else if (code !== undefined && reason !== undefined) {
  30967. // If reason is also present, then reasonBytes must be
  30968. // provided in the Close message after the status code.
  30969. frame.frameData = Buffer.allocUnsafe(2 + reasonByteLength)
  30970. frame.frameData.writeUInt16BE(code, 0)
  30971. // the body MAY contain UTF-8-encoded data with value /reason/
  30972. frame.frameData.write(reason, 2, 'utf-8')
  30973. } else {
  30974. frame.frameData = emptyBuffer
  30975. }
  30976. /** @type {import('stream').Duplex} */
  30977. const socket = this[kResponse].socket
  30978. socket.write(frame.createFrame(opcodes.CLOSE), (err) => {
  30979. if (!err) {
  30980. this[kSentClose] = true
  30981. }
  30982. })
  30983. // Upon either sending or receiving a Close control frame, it is said
  30984. // that _The WebSocket Closing Handshake is Started_ and that the
  30985. // WebSocket connection is in the CLOSING state.
  30986. this[kReadyState] = states.CLOSING
  30987. } else {
  30988. // Otherwise
  30989. // Set this's ready state to CLOSING (2).
  30990. this[kReadyState] = WebSocket.CLOSING
  30991. }
  30992. }
  30993. /**
  30994. * @see https://websockets.spec.whatwg.org/#dom-websocket-send
  30995. * @param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data
  30996. */
  30997. send (data) {
  30998. webidl.brandCheck(this, WebSocket)
  30999. webidl.argumentLengthCheck(arguments, 1, { header: 'WebSocket.send' })
  31000. data = webidl.converters.WebSocketSendData(data)
  31001. // 1. If this's ready state is CONNECTING, then throw an
  31002. // "InvalidStateError" DOMException.
  31003. if (this[kReadyState] === WebSocket.CONNECTING) {
  31004. throw new DOMException('Sent before connected.', 'InvalidStateError')
  31005. }
  31006. // 2. Run the appropriate set of steps from the following list:
  31007. // https://datatracker.ietf.org/doc/html/rfc6455#section-6.1
  31008. // https://datatracker.ietf.org/doc/html/rfc6455#section-5.2
  31009. if (!isEstablished(this) || isClosing(this)) {
  31010. return
  31011. }
  31012. /** @type {import('stream').Duplex} */
  31013. const socket = this[kResponse].socket
  31014. // If data is a string
  31015. if (typeof data === 'string') {
  31016. // If the WebSocket connection is established and the WebSocket
  31017. // closing handshake has not yet started, then the user agent
  31018. // must send a WebSocket Message comprised of the data argument
  31019. // using a text frame opcode; if the data cannot be sent, e.g.
  31020. // because it would need to be buffered but the buffer is full,
  31021. // the user agent must flag the WebSocket as full and then close
  31022. // the WebSocket connection. Any invocation of this method with a
  31023. // string argument that does not throw an exception must increase
  31024. // the bufferedAmount attribute by the number of bytes needed to
  31025. // express the argument as UTF-8.
  31026. const value = Buffer.from(data)
  31027. const frame = new WebsocketFrameSend(value)
  31028. const buffer = frame.createFrame(opcodes.TEXT)
  31029. this.#bufferedAmount += value.byteLength
  31030. socket.write(buffer, () => {
  31031. this.#bufferedAmount -= value.byteLength
  31032. })
  31033. } else if (types.isArrayBuffer(data)) {
  31034. // If the WebSocket connection is established, and the WebSocket
  31035. // closing handshake has not yet started, then the user agent must
  31036. // send a WebSocket Message comprised of data using a binary frame
  31037. // opcode; if the data cannot be sent, e.g. because it would need
  31038. // to be buffered but the buffer is full, the user agent must flag
  31039. // the WebSocket as full and then close the WebSocket connection.
  31040. // The data to be sent is the data stored in the buffer described
  31041. // by the ArrayBuffer object. Any invocation of this method with an
  31042. // ArrayBuffer argument that does not throw an exception must
  31043. // increase the bufferedAmount attribute by the length of the
  31044. // ArrayBuffer in bytes.
  31045. const value = Buffer.from(data)
  31046. const frame = new WebsocketFrameSend(value)
  31047. const buffer = frame.createFrame(opcodes.BINARY)
  31048. this.#bufferedAmount += value.byteLength
  31049. socket.write(buffer, () => {
  31050. this.#bufferedAmount -= value.byteLength
  31051. })
  31052. } else if (ArrayBuffer.isView(data)) {
  31053. // If the WebSocket connection is established, and the WebSocket
  31054. // closing handshake has not yet started, then the user agent must
  31055. // send a WebSocket Message comprised of data using a binary frame
  31056. // opcode; if the data cannot be sent, e.g. because it would need to
  31057. // be buffered but the buffer is full, the user agent must flag the
  31058. // WebSocket as full and then close the WebSocket connection. The
  31059. // data to be sent is the data stored in the section of the buffer
  31060. // described by the ArrayBuffer object that data references. Any
  31061. // invocation of this method with this kind of argument that does
  31062. // not throw an exception must increase the bufferedAmount attribute
  31063. // by the length of data’s buffer in bytes.
  31064. const ab = Buffer.from(data, data.byteOffset, data.byteLength)
  31065. const frame = new WebsocketFrameSend(ab)
  31066. const buffer = frame.createFrame(opcodes.BINARY)
  31067. this.#bufferedAmount += ab.byteLength
  31068. socket.write(buffer, () => {
  31069. this.#bufferedAmount -= ab.byteLength
  31070. })
  31071. } else if (isBlobLike(data)) {
  31072. // If the WebSocket connection is established, and the WebSocket
  31073. // closing handshake has not yet started, then the user agent must
  31074. // send a WebSocket Message comprised of data using a binary frame
  31075. // opcode; if the data cannot be sent, e.g. because it would need to
  31076. // be buffered but the buffer is full, the user agent must flag the
  31077. // WebSocket as full and then close the WebSocket connection. The data
  31078. // to be sent is the raw data represented by the Blob object. Any
  31079. // invocation of this method with a Blob argument that does not throw
  31080. // an exception must increase the bufferedAmount attribute by the size
  31081. // of the Blob object’s raw data, in bytes.
  31082. const frame = new WebsocketFrameSend()
  31083. data.arrayBuffer().then((ab) => {
  31084. const value = Buffer.from(ab)
  31085. frame.frameData = value
  31086. const buffer = frame.createFrame(opcodes.BINARY)
  31087. this.#bufferedAmount += value.byteLength
  31088. socket.write(buffer, () => {
  31089. this.#bufferedAmount -= value.byteLength
  31090. })
  31091. })
  31092. }
  31093. }
  31094. get readyState () {
  31095. webidl.brandCheck(this, WebSocket)
  31096. // The readyState getter steps are to return this's ready state.
  31097. return this[kReadyState]
  31098. }
  31099. get bufferedAmount () {
  31100. webidl.brandCheck(this, WebSocket)
  31101. return this.#bufferedAmount
  31102. }
  31103. get url () {
  31104. webidl.brandCheck(this, WebSocket)
  31105. // The url getter steps are to return this's url, serialized.
  31106. return URLSerializer(this[kWebSocketURL])
  31107. }
  31108. get extensions () {
  31109. webidl.brandCheck(this, WebSocket)
  31110. return this.#extensions
  31111. }
  31112. get protocol () {
  31113. webidl.brandCheck(this, WebSocket)
  31114. return this.#protocol
  31115. }
  31116. get onopen () {
  31117. webidl.brandCheck(this, WebSocket)
  31118. return this.#events.open
  31119. }
  31120. set onopen (fn) {
  31121. webidl.brandCheck(this, WebSocket)
  31122. if (this.#events.open) {
  31123. this.removeEventListener('open', this.#events.open)
  31124. }
  31125. if (typeof fn === 'function') {
  31126. this.#events.open = fn
  31127. this.addEventListener('open', fn)
  31128. } else {
  31129. this.#events.open = null
  31130. }
  31131. }
  31132. get onerror () {
  31133. webidl.brandCheck(this, WebSocket)
  31134. return this.#events.error
  31135. }
  31136. set onerror (fn) {
  31137. webidl.brandCheck(this, WebSocket)
  31138. if (this.#events.error) {
  31139. this.removeEventListener('error', this.#events.error)
  31140. }
  31141. if (typeof fn === 'function') {
  31142. this.#events.error = fn
  31143. this.addEventListener('error', fn)
  31144. } else {
  31145. this.#events.error = null
  31146. }
  31147. }
  31148. get onclose () {
  31149. webidl.brandCheck(this, WebSocket)
  31150. return this.#events.close
  31151. }
  31152. set onclose (fn) {
  31153. webidl.brandCheck(this, WebSocket)
  31154. if (this.#events.close) {
  31155. this.removeEventListener('close', this.#events.close)
  31156. }
  31157. if (typeof fn === 'function') {
  31158. this.#events.close = fn
  31159. this.addEventListener('close', fn)
  31160. } else {
  31161. this.#events.close = null
  31162. }
  31163. }
  31164. get onmessage () {
  31165. webidl.brandCheck(this, WebSocket)
  31166. return this.#events.message
  31167. }
  31168. set onmessage (fn) {
  31169. webidl.brandCheck(this, WebSocket)
  31170. if (this.#events.message) {
  31171. this.removeEventListener('message', this.#events.message)
  31172. }
  31173. if (typeof fn === 'function') {
  31174. this.#events.message = fn
  31175. this.addEventListener('message', fn)
  31176. } else {
  31177. this.#events.message = null
  31178. }
  31179. }
  31180. get binaryType () {
  31181. webidl.brandCheck(this, WebSocket)
  31182. return this[kBinaryType]
  31183. }
  31184. set binaryType (type) {
  31185. webidl.brandCheck(this, WebSocket)
  31186. if (type !== 'blob' && type !== 'arraybuffer') {
  31187. this[kBinaryType] = 'blob'
  31188. } else {
  31189. this[kBinaryType] = type
  31190. }
  31191. }
  31192. /**
  31193. * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol
  31194. */
  31195. #onConnectionEstablished (response) {
  31196. // processResponse is called when the "response’s header list has been received and initialized."
  31197. // once this happens, the connection is open
  31198. this[kResponse] = response
  31199. const parser = new ByteParser(this)
  31200. parser.on('drain', function onParserDrain () {
  31201. this.ws[kResponse].socket.resume()
  31202. })
  31203. response.socket.ws = this
  31204. this[kByteParser] = parser
  31205. // 1. Change the ready state to OPEN (1).
  31206. this[kReadyState] = states.OPEN
  31207. // 2. Change the extensions attribute’s value to the extensions in use, if
  31208. // it is not the null value.
  31209. // https://datatracker.ietf.org/doc/html/rfc6455#section-9.1
  31210. const extensions = response.headersList.get('sec-websocket-extensions')
  31211. if (extensions !== null) {
  31212. this.#extensions = extensions
  31213. }
  31214. // 3. Change the protocol attribute’s value to the subprotocol in use, if
  31215. // it is not the null value.
  31216. // https://datatracker.ietf.org/doc/html/rfc6455#section-1.9
  31217. const protocol = response.headersList.get('sec-websocket-protocol')
  31218. if (protocol !== null) {
  31219. this.#protocol = protocol
  31220. }
  31221. // 4. Fire an event named open at the WebSocket object.
  31222. fireEvent('open', this)
  31223. }
  31224. }
  31225. // https://websockets.spec.whatwg.org/#dom-websocket-connecting
  31226. WebSocket.CONNECTING = WebSocket.prototype.CONNECTING = states.CONNECTING
  31227. // https://websockets.spec.whatwg.org/#dom-websocket-open
  31228. WebSocket.OPEN = WebSocket.prototype.OPEN = states.OPEN
  31229. // https://websockets.spec.whatwg.org/#dom-websocket-closing
  31230. WebSocket.CLOSING = WebSocket.prototype.CLOSING = states.CLOSING
  31231. // https://websockets.spec.whatwg.org/#dom-websocket-closed
  31232. WebSocket.CLOSED = WebSocket.prototype.CLOSED = states.CLOSED
  31233. Object.defineProperties(WebSocket.prototype, {
  31234. CONNECTING: staticPropertyDescriptors,
  31235. OPEN: staticPropertyDescriptors,
  31236. CLOSING: staticPropertyDescriptors,
  31237. CLOSED: staticPropertyDescriptors,
  31238. url: kEnumerableProperty,
  31239. readyState: kEnumerableProperty,
  31240. bufferedAmount: kEnumerableProperty,
  31241. onopen: kEnumerableProperty,
  31242. onerror: kEnumerableProperty,
  31243. onclose: kEnumerableProperty,
  31244. close: kEnumerableProperty,
  31245. onmessage: kEnumerableProperty,
  31246. binaryType: kEnumerableProperty,
  31247. send: kEnumerableProperty,
  31248. extensions: kEnumerableProperty,
  31249. protocol: kEnumerableProperty,
  31250. [Symbol.toStringTag]: {
  31251. value: 'WebSocket',
  31252. writable: false,
  31253. enumerable: false,
  31254. configurable: true
  31255. }
  31256. })
  31257. Object.defineProperties(WebSocket, {
  31258. CONNECTING: staticPropertyDescriptors,
  31259. OPEN: staticPropertyDescriptors,
  31260. CLOSING: staticPropertyDescriptors,
  31261. CLOSED: staticPropertyDescriptors
  31262. })
  31263. webidl.converters['sequence<DOMString>'] = webidl.sequenceConverter(
  31264. webidl.converters.DOMString
  31265. )
  31266. webidl.converters['DOMString or sequence<DOMString>'] = function (V) {
  31267. if (webidl.util.Type(V) === 'Object' && Symbol.iterator in V) {
  31268. return webidl.converters['sequence<DOMString>'](V)
  31269. }
  31270. return webidl.converters.DOMString(V)
  31271. }
  31272. // This implements the propsal made in https://github.com/whatwg/websockets/issues/42
  31273. webidl.converters.WebSocketInit = webidl.dictionaryConverter([
  31274. {
  31275. key: 'protocols',
  31276. converter: webidl.converters['DOMString or sequence<DOMString>'],
  31277. get defaultValue () {
  31278. return []
  31279. }
  31280. },
  31281. {
  31282. key: 'dispatcher',
  31283. converter: (V) => V,
  31284. get defaultValue () {
  31285. return getGlobalDispatcher()
  31286. }
  31287. },
  31288. {
  31289. key: 'headers',
  31290. converter: webidl.nullableConverter(webidl.converters.HeadersInit)
  31291. }
  31292. ])
  31293. webidl.converters['DOMString or sequence<DOMString> or WebSocketInit'] = function (V) {
  31294. if (webidl.util.Type(V) === 'Object' && !(Symbol.iterator in V)) {
  31295. return webidl.converters.WebSocketInit(V)
  31296. }
  31297. return { protocols: webidl.converters['DOMString or sequence<DOMString>'](V) }
  31298. }
  31299. webidl.converters.WebSocketSendData = function (V) {
  31300. if (webidl.util.Type(V) === 'Object') {
  31301. if (isBlobLike(V)) {
  31302. return webidl.converters.Blob(V, { strict: false })
  31303. }
  31304. if (ArrayBuffer.isView(V) || types.isAnyArrayBuffer(V)) {
  31305. return webidl.converters.BufferSource(V)
  31306. }
  31307. }
  31308. return webidl.converters.USVString(V)
  31309. }
  31310. module.exports = {
  31311. WebSocket
  31312. }
  31313. /***/ }),
  31314. /***/ 5030:
  31315. /***/ ((__unused_webpack_module, exports) => {
  31316. "use strict";
  31317. Object.defineProperty(exports, "__esModule", ({ value: true }));
  31318. function getUserAgent() {
  31319. if (typeof navigator === "object" && "userAgent" in navigator) {
  31320. return navigator.userAgent;
  31321. }
  31322. if (typeof process === "object" && process.version !== undefined) {
  31323. return `Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`;
  31324. }
  31325. return "<environment undetectable>";
  31326. }
  31327. exports.getUserAgent = getUserAgent;
  31328. //# sourceMappingURL=index.js.map
  31329. /***/ }),
  31330. /***/ 5840:
  31331. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31332. "use strict";
  31333. Object.defineProperty(exports, "__esModule", ({
  31334. value: true
  31335. }));
  31336. Object.defineProperty(exports, "NIL", ({
  31337. enumerable: true,
  31338. get: function () {
  31339. return _nil.default;
  31340. }
  31341. }));
  31342. Object.defineProperty(exports, "parse", ({
  31343. enumerable: true,
  31344. get: function () {
  31345. return _parse.default;
  31346. }
  31347. }));
  31348. Object.defineProperty(exports, "stringify", ({
  31349. enumerable: true,
  31350. get: function () {
  31351. return _stringify.default;
  31352. }
  31353. }));
  31354. Object.defineProperty(exports, "v1", ({
  31355. enumerable: true,
  31356. get: function () {
  31357. return _v.default;
  31358. }
  31359. }));
  31360. Object.defineProperty(exports, "v3", ({
  31361. enumerable: true,
  31362. get: function () {
  31363. return _v2.default;
  31364. }
  31365. }));
  31366. Object.defineProperty(exports, "v4", ({
  31367. enumerable: true,
  31368. get: function () {
  31369. return _v3.default;
  31370. }
  31371. }));
  31372. Object.defineProperty(exports, "v5", ({
  31373. enumerable: true,
  31374. get: function () {
  31375. return _v4.default;
  31376. }
  31377. }));
  31378. Object.defineProperty(exports, "validate", ({
  31379. enumerable: true,
  31380. get: function () {
  31381. return _validate.default;
  31382. }
  31383. }));
  31384. Object.defineProperty(exports, "version", ({
  31385. enumerable: true,
  31386. get: function () {
  31387. return _version.default;
  31388. }
  31389. }));
  31390. var _v = _interopRequireDefault(__nccwpck_require__(8628));
  31391. var _v2 = _interopRequireDefault(__nccwpck_require__(6409));
  31392. var _v3 = _interopRequireDefault(__nccwpck_require__(5122));
  31393. var _v4 = _interopRequireDefault(__nccwpck_require__(9120));
  31394. var _nil = _interopRequireDefault(__nccwpck_require__(5332));
  31395. var _version = _interopRequireDefault(__nccwpck_require__(2414));
  31396. var _validate = _interopRequireDefault(__nccwpck_require__(6900));
  31397. var _stringify = _interopRequireDefault(__nccwpck_require__(8950));
  31398. var _parse = _interopRequireDefault(__nccwpck_require__(2746));
  31399. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31400. /***/ }),
  31401. /***/ 4569:
  31402. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31403. "use strict";
  31404. Object.defineProperty(exports, "__esModule", ({
  31405. value: true
  31406. }));
  31407. exports["default"] = void 0;
  31408. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  31409. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31410. function md5(bytes) {
  31411. if (Array.isArray(bytes)) {
  31412. bytes = Buffer.from(bytes);
  31413. } else if (typeof bytes === 'string') {
  31414. bytes = Buffer.from(bytes, 'utf8');
  31415. }
  31416. return _crypto.default.createHash('md5').update(bytes).digest();
  31417. }
  31418. var _default = md5;
  31419. exports["default"] = _default;
  31420. /***/ }),
  31421. /***/ 2054:
  31422. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31423. "use strict";
  31424. Object.defineProperty(exports, "__esModule", ({
  31425. value: true
  31426. }));
  31427. exports["default"] = void 0;
  31428. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  31429. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31430. var _default = {
  31431. randomUUID: _crypto.default.randomUUID
  31432. };
  31433. exports["default"] = _default;
  31434. /***/ }),
  31435. /***/ 5332:
  31436. /***/ ((__unused_webpack_module, exports) => {
  31437. "use strict";
  31438. Object.defineProperty(exports, "__esModule", ({
  31439. value: true
  31440. }));
  31441. exports["default"] = void 0;
  31442. var _default = '00000000-0000-0000-0000-000000000000';
  31443. exports["default"] = _default;
  31444. /***/ }),
  31445. /***/ 2746:
  31446. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31447. "use strict";
  31448. Object.defineProperty(exports, "__esModule", ({
  31449. value: true
  31450. }));
  31451. exports["default"] = void 0;
  31452. var _validate = _interopRequireDefault(__nccwpck_require__(6900));
  31453. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31454. function parse(uuid) {
  31455. if (!(0, _validate.default)(uuid)) {
  31456. throw TypeError('Invalid UUID');
  31457. }
  31458. let v;
  31459. const arr = new Uint8Array(16); // Parse ########-....-....-....-............
  31460. arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;
  31461. arr[1] = v >>> 16 & 0xff;
  31462. arr[2] = v >>> 8 & 0xff;
  31463. arr[3] = v & 0xff; // Parse ........-####-....-....-............
  31464. arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;
  31465. arr[5] = v & 0xff; // Parse ........-....-####-....-............
  31466. arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;
  31467. arr[7] = v & 0xff; // Parse ........-....-....-####-............
  31468. arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;
  31469. arr[9] = v & 0xff; // Parse ........-....-....-....-############
  31470. // (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes)
  31471. arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;
  31472. arr[11] = v / 0x100000000 & 0xff;
  31473. arr[12] = v >>> 24 & 0xff;
  31474. arr[13] = v >>> 16 & 0xff;
  31475. arr[14] = v >>> 8 & 0xff;
  31476. arr[15] = v & 0xff;
  31477. return arr;
  31478. }
  31479. var _default = parse;
  31480. exports["default"] = _default;
  31481. /***/ }),
  31482. /***/ 814:
  31483. /***/ ((__unused_webpack_module, exports) => {
  31484. "use strict";
  31485. Object.defineProperty(exports, "__esModule", ({
  31486. value: true
  31487. }));
  31488. exports["default"] = void 0;
  31489. 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;
  31490. exports["default"] = _default;
  31491. /***/ }),
  31492. /***/ 807:
  31493. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31494. "use strict";
  31495. Object.defineProperty(exports, "__esModule", ({
  31496. value: true
  31497. }));
  31498. exports["default"] = rng;
  31499. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  31500. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31501. const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate
  31502. let poolPtr = rnds8Pool.length;
  31503. function rng() {
  31504. if (poolPtr > rnds8Pool.length - 16) {
  31505. _crypto.default.randomFillSync(rnds8Pool);
  31506. poolPtr = 0;
  31507. }
  31508. return rnds8Pool.slice(poolPtr, poolPtr += 16);
  31509. }
  31510. /***/ }),
  31511. /***/ 5274:
  31512. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31513. "use strict";
  31514. Object.defineProperty(exports, "__esModule", ({
  31515. value: true
  31516. }));
  31517. exports["default"] = void 0;
  31518. var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
  31519. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31520. function sha1(bytes) {
  31521. if (Array.isArray(bytes)) {
  31522. bytes = Buffer.from(bytes);
  31523. } else if (typeof bytes === 'string') {
  31524. bytes = Buffer.from(bytes, 'utf8');
  31525. }
  31526. return _crypto.default.createHash('sha1').update(bytes).digest();
  31527. }
  31528. var _default = sha1;
  31529. exports["default"] = _default;
  31530. /***/ }),
  31531. /***/ 8950:
  31532. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31533. "use strict";
  31534. Object.defineProperty(exports, "__esModule", ({
  31535. value: true
  31536. }));
  31537. exports["default"] = void 0;
  31538. exports.unsafeStringify = unsafeStringify;
  31539. var _validate = _interopRequireDefault(__nccwpck_require__(6900));
  31540. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31541. /**
  31542. * Convert array of 16 byte values to UUID string format of the form:
  31543. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  31544. */
  31545. const byteToHex = [];
  31546. for (let i = 0; i < 256; ++i) {
  31547. byteToHex.push((i + 0x100).toString(16).slice(1));
  31548. }
  31549. function unsafeStringify(arr, offset = 0) {
  31550. // Note: Be careful editing this code! It's been tuned for performance
  31551. // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
  31552. 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]];
  31553. }
  31554. function stringify(arr, offset = 0) {
  31555. const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one
  31556. // of the following:
  31557. // - One or more input array values don't map to a hex octet (leading to
  31558. // "undefined" in the uuid)
  31559. // - Invalid input values for the RFC `version` or `variant` fields
  31560. if (!(0, _validate.default)(uuid)) {
  31561. throw TypeError('Stringified UUID is invalid');
  31562. }
  31563. return uuid;
  31564. }
  31565. var _default = stringify;
  31566. exports["default"] = _default;
  31567. /***/ }),
  31568. /***/ 8628:
  31569. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31570. "use strict";
  31571. Object.defineProperty(exports, "__esModule", ({
  31572. value: true
  31573. }));
  31574. exports["default"] = void 0;
  31575. var _rng = _interopRequireDefault(__nccwpck_require__(807));
  31576. var _stringify = __nccwpck_require__(8950);
  31577. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31578. // **`v1()` - Generate time-based UUID**
  31579. //
  31580. // Inspired by https://github.com/LiosK/UUID.js
  31581. // and http://docs.python.org/library/uuid.html
  31582. let _nodeId;
  31583. let _clockseq; // Previous uuid creation time
  31584. let _lastMSecs = 0;
  31585. let _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details
  31586. function v1(options, buf, offset) {
  31587. let i = buf && offset || 0;
  31588. const b = buf || new Array(16);
  31589. options = options || {};
  31590. let node = options.node || _nodeId;
  31591. let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not
  31592. // specified. We do this lazily to minimize issues related to insufficient
  31593. // system entropy. See #189
  31594. if (node == null || clockseq == null) {
  31595. const seedBytes = options.random || (options.rng || _rng.default)();
  31596. if (node == null) {
  31597. // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
  31598. node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];
  31599. }
  31600. if (clockseq == null) {
  31601. // Per 4.2.2, randomize (14 bit) clockseq
  31602. clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
  31603. }
  31604. } // UUID timestamps are 100 nano-second units since the Gregorian epoch,
  31605. // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
  31606. // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
  31607. // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
  31608. let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock
  31609. // cycle to simulate higher resolution clock
  31610. let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)
  31611. const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression
  31612. if (dt < 0 && options.clockseq === undefined) {
  31613. clockseq = clockseq + 1 & 0x3fff;
  31614. } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
  31615. // time interval
  31616. if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
  31617. nsecs = 0;
  31618. } // Per 4.2.1.2 Throw error if too many uuids are requested
  31619. if (nsecs >= 10000) {
  31620. throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");
  31621. }
  31622. _lastMSecs = msecs;
  31623. _lastNSecs = nsecs;
  31624. _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
  31625. msecs += 12219292800000; // `time_low`
  31626. const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
  31627. b[i++] = tl >>> 24 & 0xff;
  31628. b[i++] = tl >>> 16 & 0xff;
  31629. b[i++] = tl >>> 8 & 0xff;
  31630. b[i++] = tl & 0xff; // `time_mid`
  31631. const tmh = msecs / 0x100000000 * 10000 & 0xfffffff;
  31632. b[i++] = tmh >>> 8 & 0xff;
  31633. b[i++] = tmh & 0xff; // `time_high_and_version`
  31634. b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
  31635. b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
  31636. b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`
  31637. b[i++] = clockseq & 0xff; // `node`
  31638. for (let n = 0; n < 6; ++n) {
  31639. b[i + n] = node[n];
  31640. }
  31641. return buf || (0, _stringify.unsafeStringify)(b);
  31642. }
  31643. var _default = v1;
  31644. exports["default"] = _default;
  31645. /***/ }),
  31646. /***/ 6409:
  31647. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31648. "use strict";
  31649. Object.defineProperty(exports, "__esModule", ({
  31650. value: true
  31651. }));
  31652. exports["default"] = void 0;
  31653. var _v = _interopRequireDefault(__nccwpck_require__(5998));
  31654. var _md = _interopRequireDefault(__nccwpck_require__(4569));
  31655. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31656. const v3 = (0, _v.default)('v3', 0x30, _md.default);
  31657. var _default = v3;
  31658. exports["default"] = _default;
  31659. /***/ }),
  31660. /***/ 5998:
  31661. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31662. "use strict";
  31663. Object.defineProperty(exports, "__esModule", ({
  31664. value: true
  31665. }));
  31666. exports.URL = exports.DNS = void 0;
  31667. exports["default"] = v35;
  31668. var _stringify = __nccwpck_require__(8950);
  31669. var _parse = _interopRequireDefault(__nccwpck_require__(2746));
  31670. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31671. function stringToBytes(str) {
  31672. str = unescape(encodeURIComponent(str)); // UTF8 escape
  31673. const bytes = [];
  31674. for (let i = 0; i < str.length; ++i) {
  31675. bytes.push(str.charCodeAt(i));
  31676. }
  31677. return bytes;
  31678. }
  31679. const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
  31680. exports.DNS = DNS;
  31681. const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';
  31682. exports.URL = URL;
  31683. function v35(name, version, hashfunc) {
  31684. function generateUUID(value, namespace, buf, offset) {
  31685. var _namespace;
  31686. if (typeof value === 'string') {
  31687. value = stringToBytes(value);
  31688. }
  31689. if (typeof namespace === 'string') {
  31690. namespace = (0, _parse.default)(namespace);
  31691. }
  31692. if (((_namespace = namespace) === null || _namespace === void 0 ? void 0 : _namespace.length) !== 16) {
  31693. throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');
  31694. } // Compute hash of namespace and value, Per 4.3
  31695. // Future: Use spread syntax when supported on all platforms, e.g. `bytes =
  31696. // hashfunc([...namespace, ... value])`
  31697. let bytes = new Uint8Array(16 + value.length);
  31698. bytes.set(namespace);
  31699. bytes.set(value, namespace.length);
  31700. bytes = hashfunc(bytes);
  31701. bytes[6] = bytes[6] & 0x0f | version;
  31702. bytes[8] = bytes[8] & 0x3f | 0x80;
  31703. if (buf) {
  31704. offset = offset || 0;
  31705. for (let i = 0; i < 16; ++i) {
  31706. buf[offset + i] = bytes[i];
  31707. }
  31708. return buf;
  31709. }
  31710. return (0, _stringify.unsafeStringify)(bytes);
  31711. } // Function#name is not settable on some platforms (#270)
  31712. try {
  31713. generateUUID.name = name; // eslint-disable-next-line no-empty
  31714. } catch (err) {} // For CommonJS default export support
  31715. generateUUID.DNS = DNS;
  31716. generateUUID.URL = URL;
  31717. return generateUUID;
  31718. }
  31719. /***/ }),
  31720. /***/ 5122:
  31721. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31722. "use strict";
  31723. Object.defineProperty(exports, "__esModule", ({
  31724. value: true
  31725. }));
  31726. exports["default"] = void 0;
  31727. var _native = _interopRequireDefault(__nccwpck_require__(2054));
  31728. var _rng = _interopRequireDefault(__nccwpck_require__(807));
  31729. var _stringify = __nccwpck_require__(8950);
  31730. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31731. function v4(options, buf, offset) {
  31732. if (_native.default.randomUUID && !buf && !options) {
  31733. return _native.default.randomUUID();
  31734. }
  31735. options = options || {};
  31736. const rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  31737. rnds[6] = rnds[6] & 0x0f | 0x40;
  31738. rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
  31739. if (buf) {
  31740. offset = offset || 0;
  31741. for (let i = 0; i < 16; ++i) {
  31742. buf[offset + i] = rnds[i];
  31743. }
  31744. return buf;
  31745. }
  31746. return (0, _stringify.unsafeStringify)(rnds);
  31747. }
  31748. var _default = v4;
  31749. exports["default"] = _default;
  31750. /***/ }),
  31751. /***/ 9120:
  31752. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31753. "use strict";
  31754. Object.defineProperty(exports, "__esModule", ({
  31755. value: true
  31756. }));
  31757. exports["default"] = void 0;
  31758. var _v = _interopRequireDefault(__nccwpck_require__(5998));
  31759. var _sha = _interopRequireDefault(__nccwpck_require__(5274));
  31760. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31761. const v5 = (0, _v.default)('v5', 0x50, _sha.default);
  31762. var _default = v5;
  31763. exports["default"] = _default;
  31764. /***/ }),
  31765. /***/ 6900:
  31766. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31767. "use strict";
  31768. Object.defineProperty(exports, "__esModule", ({
  31769. value: true
  31770. }));
  31771. exports["default"] = void 0;
  31772. var _regex = _interopRequireDefault(__nccwpck_require__(814));
  31773. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31774. function validate(uuid) {
  31775. return typeof uuid === 'string' && _regex.default.test(uuid);
  31776. }
  31777. var _default = validate;
  31778. exports["default"] = _default;
  31779. /***/ }),
  31780. /***/ 2414:
  31781. /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
  31782. "use strict";
  31783. Object.defineProperty(exports, "__esModule", ({
  31784. value: true
  31785. }));
  31786. exports["default"] = void 0;
  31787. var _validate = _interopRequireDefault(__nccwpck_require__(6900));
  31788. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  31789. function version(uuid) {
  31790. if (!(0, _validate.default)(uuid)) {
  31791. throw TypeError('Invalid UUID');
  31792. }
  31793. return parseInt(uuid.slice(14, 15), 16);
  31794. }
  31795. var _default = version;
  31796. exports["default"] = _default;
  31797. /***/ }),
  31798. /***/ 2940:
  31799. /***/ ((module) => {
  31800. // Returns a wrapper function that returns a wrapped callback
  31801. // The wrapper function should do some stuff, and return a
  31802. // presumably different callback function.
  31803. // This makes sure that own properties are retained, so that
  31804. // decorations and such are not lost along the way.
  31805. module.exports = wrappy
  31806. function wrappy (fn, cb) {
  31807. if (fn && cb) return wrappy(fn)(cb)
  31808. if (typeof fn !== 'function')
  31809. throw new TypeError('need wrapper function')
  31810. Object.keys(fn).forEach(function (k) {
  31811. wrapper[k] = fn[k]
  31812. })
  31813. return wrapper
  31814. function wrapper() {
  31815. var args = new Array(arguments.length)
  31816. for (var i = 0; i < args.length; i++) {
  31817. args[i] = arguments[i]
  31818. }
  31819. var ret = fn.apply(this, args)
  31820. var cb = args[args.length-1]
  31821. if (typeof ret === 'function' && ret !== cb) {
  31822. Object.keys(cb).forEach(function (k) {
  31823. ret[k] = cb[k]
  31824. })
  31825. }
  31826. return ret
  31827. }
  31828. }
  31829. /***/ }),
  31830. /***/ 9491:
  31831. /***/ ((module) => {
  31832. "use strict";
  31833. module.exports = require("assert");
  31834. /***/ }),
  31835. /***/ 852:
  31836. /***/ ((module) => {
  31837. "use strict";
  31838. module.exports = require("async_hooks");
  31839. /***/ }),
  31840. /***/ 4300:
  31841. /***/ ((module) => {
  31842. "use strict";
  31843. module.exports = require("buffer");
  31844. /***/ }),
  31845. /***/ 2081:
  31846. /***/ ((module) => {
  31847. "use strict";
  31848. module.exports = require("child_process");
  31849. /***/ }),
  31850. /***/ 6206:
  31851. /***/ ((module) => {
  31852. "use strict";
  31853. module.exports = require("console");
  31854. /***/ }),
  31855. /***/ 6113:
  31856. /***/ ((module) => {
  31857. "use strict";
  31858. module.exports = require("crypto");
  31859. /***/ }),
  31860. /***/ 7643:
  31861. /***/ ((module) => {
  31862. "use strict";
  31863. module.exports = require("diagnostics_channel");
  31864. /***/ }),
  31865. /***/ 2361:
  31866. /***/ ((module) => {
  31867. "use strict";
  31868. module.exports = require("events");
  31869. /***/ }),
  31870. /***/ 7147:
  31871. /***/ ((module) => {
  31872. "use strict";
  31873. module.exports = require("fs");
  31874. /***/ }),
  31875. /***/ 3685:
  31876. /***/ ((module) => {
  31877. "use strict";
  31878. module.exports = require("http");
  31879. /***/ }),
  31880. /***/ 5158:
  31881. /***/ ((module) => {
  31882. "use strict";
  31883. module.exports = require("http2");
  31884. /***/ }),
  31885. /***/ 5687:
  31886. /***/ ((module) => {
  31887. "use strict";
  31888. module.exports = require("https");
  31889. /***/ }),
  31890. /***/ 1808:
  31891. /***/ ((module) => {
  31892. "use strict";
  31893. module.exports = require("net");
  31894. /***/ }),
  31895. /***/ 6005:
  31896. /***/ ((module) => {
  31897. "use strict";
  31898. module.exports = require("node:crypto");
  31899. /***/ }),
  31900. /***/ 5673:
  31901. /***/ ((module) => {
  31902. "use strict";
  31903. module.exports = require("node:events");
  31904. /***/ }),
  31905. /***/ 4492:
  31906. /***/ ((module) => {
  31907. "use strict";
  31908. module.exports = require("node:stream");
  31909. /***/ }),
  31910. /***/ 7261:
  31911. /***/ ((module) => {
  31912. "use strict";
  31913. module.exports = require("node:util");
  31914. /***/ }),
  31915. /***/ 2037:
  31916. /***/ ((module) => {
  31917. "use strict";
  31918. module.exports = require("os");
  31919. /***/ }),
  31920. /***/ 1017:
  31921. /***/ ((module) => {
  31922. "use strict";
  31923. module.exports = require("path");
  31924. /***/ }),
  31925. /***/ 4074:
  31926. /***/ ((module) => {
  31927. "use strict";
  31928. module.exports = require("perf_hooks");
  31929. /***/ }),
  31930. /***/ 3477:
  31931. /***/ ((module) => {
  31932. "use strict";
  31933. module.exports = require("querystring");
  31934. /***/ }),
  31935. /***/ 2781:
  31936. /***/ ((module) => {
  31937. "use strict";
  31938. module.exports = require("stream");
  31939. /***/ }),
  31940. /***/ 5356:
  31941. /***/ ((module) => {
  31942. "use strict";
  31943. module.exports = require("stream/web");
  31944. /***/ }),
  31945. /***/ 1576:
  31946. /***/ ((module) => {
  31947. "use strict";
  31948. module.exports = require("string_decoder");
  31949. /***/ }),
  31950. /***/ 9512:
  31951. /***/ ((module) => {
  31952. "use strict";
  31953. module.exports = require("timers");
  31954. /***/ }),
  31955. /***/ 4404:
  31956. /***/ ((module) => {
  31957. "use strict";
  31958. module.exports = require("tls");
  31959. /***/ }),
  31960. /***/ 7310:
  31961. /***/ ((module) => {
  31962. "use strict";
  31963. module.exports = require("url");
  31964. /***/ }),
  31965. /***/ 3837:
  31966. /***/ ((module) => {
  31967. "use strict";
  31968. module.exports = require("util");
  31969. /***/ }),
  31970. /***/ 9830:
  31971. /***/ ((module) => {
  31972. "use strict";
  31973. module.exports = require("util/types");
  31974. /***/ }),
  31975. /***/ 1267:
  31976. /***/ ((module) => {
  31977. "use strict";
  31978. module.exports = require("worker_threads");
  31979. /***/ }),
  31980. /***/ 9796:
  31981. /***/ ((module) => {
  31982. "use strict";
  31983. module.exports = require("zlib");
  31984. /***/ }),
  31985. /***/ 2960:
  31986. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  31987. "use strict";
  31988. const WritableStream = (__nccwpck_require__(4492).Writable)
  31989. const inherits = (__nccwpck_require__(7261).inherits)
  31990. const StreamSearch = __nccwpck_require__(1142)
  31991. const PartStream = __nccwpck_require__(1620)
  31992. const HeaderParser = __nccwpck_require__(2032)
  31993. const DASH = 45
  31994. const B_ONEDASH = Buffer.from('-')
  31995. const B_CRLF = Buffer.from('\r\n')
  31996. const EMPTY_FN = function () {}
  31997. function Dicer (cfg) {
  31998. if (!(this instanceof Dicer)) { return new Dicer(cfg) }
  31999. WritableStream.call(this, cfg)
  32000. if (!cfg || (!cfg.headerFirst && typeof cfg.boundary !== 'string')) { throw new TypeError('Boundary required') }
  32001. if (typeof cfg.boundary === 'string') { this.setBoundary(cfg.boundary) } else { this._bparser = undefined }
  32002. this._headerFirst = cfg.headerFirst
  32003. this._dashes = 0
  32004. this._parts = 0
  32005. this._finished = false
  32006. this._realFinish = false
  32007. this._isPreamble = true
  32008. this._justMatched = false
  32009. this._firstWrite = true
  32010. this._inHeader = true
  32011. this._part = undefined
  32012. this._cb = undefined
  32013. this._ignoreData = false
  32014. this._partOpts = { highWaterMark: cfg.partHwm }
  32015. this._pause = false
  32016. const self = this
  32017. this._hparser = new HeaderParser(cfg)
  32018. this._hparser.on('header', function (header) {
  32019. self._inHeader = false
  32020. self._part.emit('header', header)
  32021. })
  32022. }
  32023. inherits(Dicer, WritableStream)
  32024. Dicer.prototype.emit = function (ev) {
  32025. if (ev === 'finish' && !this._realFinish) {
  32026. if (!this._finished) {
  32027. const self = this
  32028. process.nextTick(function () {
  32029. self.emit('error', new Error('Unexpected end of multipart data'))
  32030. if (self._part && !self._ignoreData) {
  32031. const type = (self._isPreamble ? 'Preamble' : 'Part')
  32032. self._part.emit('error', new Error(type + ' terminated early due to unexpected end of multipart data'))
  32033. self._part.push(null)
  32034. process.nextTick(function () {
  32035. self._realFinish = true
  32036. self.emit('finish')
  32037. self._realFinish = false
  32038. })
  32039. return
  32040. }
  32041. self._realFinish = true
  32042. self.emit('finish')
  32043. self._realFinish = false
  32044. })
  32045. }
  32046. } else { WritableStream.prototype.emit.apply(this, arguments) }
  32047. }
  32048. Dicer.prototype._write = function (data, encoding, cb) {
  32049. // ignore unexpected data (e.g. extra trailer data after finished)
  32050. if (!this._hparser && !this._bparser) { return cb() }
  32051. if (this._headerFirst && this._isPreamble) {
  32052. if (!this._part) {
  32053. this._part = new PartStream(this._partOpts)
  32054. if (this.listenerCount('preamble') !== 0) { this.emit('preamble', this._part) } else { this._ignore() }
  32055. }
  32056. const r = this._hparser.push(data)
  32057. if (!this._inHeader && r !== undefined && r < data.length) { data = data.slice(r) } else { return cb() }
  32058. }
  32059. // allows for "easier" testing
  32060. if (this._firstWrite) {
  32061. this._bparser.push(B_CRLF)
  32062. this._firstWrite = false
  32063. }
  32064. this._bparser.push(data)
  32065. if (this._pause) { this._cb = cb } else { cb() }
  32066. }
  32067. Dicer.prototype.reset = function () {
  32068. this._part = undefined
  32069. this._bparser = undefined
  32070. this._hparser = undefined
  32071. }
  32072. Dicer.prototype.setBoundary = function (boundary) {
  32073. const self = this
  32074. this._bparser = new StreamSearch('\r\n--' + boundary)
  32075. this._bparser.on('info', function (isMatch, data, start, end) {
  32076. self._oninfo(isMatch, data, start, end)
  32077. })
  32078. }
  32079. Dicer.prototype._ignore = function () {
  32080. if (this._part && !this._ignoreData) {
  32081. this._ignoreData = true
  32082. this._part.on('error', EMPTY_FN)
  32083. // we must perform some kind of read on the stream even though we are
  32084. // ignoring the data, otherwise node's Readable stream will not emit 'end'
  32085. // after pushing null to the stream
  32086. this._part.resume()
  32087. }
  32088. }
  32089. Dicer.prototype._oninfo = function (isMatch, data, start, end) {
  32090. let buf; const self = this; let i = 0; let r; let shouldWriteMore = true
  32091. if (!this._part && this._justMatched && data) {
  32092. while (this._dashes < 2 && (start + i) < end) {
  32093. if (data[start + i] === DASH) {
  32094. ++i
  32095. ++this._dashes
  32096. } else {
  32097. if (this._dashes) { buf = B_ONEDASH }
  32098. this._dashes = 0
  32099. break
  32100. }
  32101. }
  32102. if (this._dashes === 2) {
  32103. if ((start + i) < end && this.listenerCount('trailer') !== 0) { this.emit('trailer', data.slice(start + i, end)) }
  32104. this.reset()
  32105. this._finished = true
  32106. // no more parts will be added
  32107. if (self._parts === 0) {
  32108. self._realFinish = true
  32109. self.emit('finish')
  32110. self._realFinish = false
  32111. }
  32112. }
  32113. if (this._dashes) { return }
  32114. }
  32115. if (this._justMatched) { this._justMatched = false }
  32116. if (!this._part) {
  32117. this._part = new PartStream(this._partOpts)
  32118. this._part._read = function (n) {
  32119. self._unpause()
  32120. }
  32121. if (this._isPreamble && this.listenerCount('preamble') !== 0) {
  32122. this.emit('preamble', this._part)
  32123. } else if (this._isPreamble !== true && this.listenerCount('part') !== 0) {
  32124. this.emit('part', this._part)
  32125. } else {
  32126. this._ignore()
  32127. }
  32128. if (!this._isPreamble) { this._inHeader = true }
  32129. }
  32130. if (data && start < end && !this._ignoreData) {
  32131. if (this._isPreamble || !this._inHeader) {
  32132. if (buf) { shouldWriteMore = this._part.push(buf) }
  32133. shouldWriteMore = this._part.push(data.slice(start, end))
  32134. if (!shouldWriteMore) { this._pause = true }
  32135. } else if (!this._isPreamble && this._inHeader) {
  32136. if (buf) { this._hparser.push(buf) }
  32137. r = this._hparser.push(data.slice(start, end))
  32138. if (!this._inHeader && r !== undefined && r < end) { this._oninfo(false, data, start + r, end) }
  32139. }
  32140. }
  32141. if (isMatch) {
  32142. this._hparser.reset()
  32143. if (this._isPreamble) { this._isPreamble = false } else {
  32144. if (start !== end) {
  32145. ++this._parts
  32146. this._part.on('end', function () {
  32147. if (--self._parts === 0) {
  32148. if (self._finished) {
  32149. self._realFinish = true
  32150. self.emit('finish')
  32151. self._realFinish = false
  32152. } else {
  32153. self._unpause()
  32154. }
  32155. }
  32156. })
  32157. }
  32158. }
  32159. this._part.push(null)
  32160. this._part = undefined
  32161. this._ignoreData = false
  32162. this._justMatched = true
  32163. this._dashes = 0
  32164. }
  32165. }
  32166. Dicer.prototype._unpause = function () {
  32167. if (!this._pause) { return }
  32168. this._pause = false
  32169. if (this._cb) {
  32170. const cb = this._cb
  32171. this._cb = undefined
  32172. cb()
  32173. }
  32174. }
  32175. module.exports = Dicer
  32176. /***/ }),
  32177. /***/ 2032:
  32178. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  32179. "use strict";
  32180. const EventEmitter = (__nccwpck_require__(5673).EventEmitter)
  32181. const inherits = (__nccwpck_require__(7261).inherits)
  32182. const getLimit = __nccwpck_require__(1467)
  32183. const StreamSearch = __nccwpck_require__(1142)
  32184. const B_DCRLF = Buffer.from('\r\n\r\n')
  32185. const RE_CRLF = /\r\n/g
  32186. const RE_HDR = /^([^:]+):[ \t]?([\x00-\xFF]+)?$/ // eslint-disable-line no-control-regex
  32187. function HeaderParser (cfg) {
  32188. EventEmitter.call(this)
  32189. cfg = cfg || {}
  32190. const self = this
  32191. this.nread = 0
  32192. this.maxed = false
  32193. this.npairs = 0
  32194. this.maxHeaderPairs = getLimit(cfg, 'maxHeaderPairs', 2000)
  32195. this.maxHeaderSize = getLimit(cfg, 'maxHeaderSize', 80 * 1024)
  32196. this.buffer = ''
  32197. this.header = {}
  32198. this.finished = false
  32199. this.ss = new StreamSearch(B_DCRLF)
  32200. this.ss.on('info', function (isMatch, data, start, end) {
  32201. if (data && !self.maxed) {
  32202. if (self.nread + end - start >= self.maxHeaderSize) {
  32203. end = self.maxHeaderSize - self.nread + start
  32204. self.nread = self.maxHeaderSize
  32205. self.maxed = true
  32206. } else { self.nread += (end - start) }
  32207. self.buffer += data.toString('binary', start, end)
  32208. }
  32209. if (isMatch) { self._finish() }
  32210. })
  32211. }
  32212. inherits(HeaderParser, EventEmitter)
  32213. HeaderParser.prototype.push = function (data) {
  32214. const r = this.ss.push(data)
  32215. if (this.finished) { return r }
  32216. }
  32217. HeaderParser.prototype.reset = function () {
  32218. this.finished = false
  32219. this.buffer = ''
  32220. this.header = {}
  32221. this.ss.reset()
  32222. }
  32223. HeaderParser.prototype._finish = function () {
  32224. if (this.buffer) { this._parseHeader() }
  32225. this.ss.matches = this.ss.maxMatches
  32226. const header = this.header
  32227. this.header = {}
  32228. this.buffer = ''
  32229. this.finished = true
  32230. this.nread = this.npairs = 0
  32231. this.maxed = false
  32232. this.emit('header', header)
  32233. }
  32234. HeaderParser.prototype._parseHeader = function () {
  32235. if (this.npairs === this.maxHeaderPairs) { return }
  32236. const lines = this.buffer.split(RE_CRLF)
  32237. const len = lines.length
  32238. let m, h
  32239. for (var i = 0; i < len; ++i) { // eslint-disable-line no-var
  32240. if (lines[i].length === 0) { continue }
  32241. if (lines[i][0] === '\t' || lines[i][0] === ' ') {
  32242. // folded header content
  32243. // RFC2822 says to just remove the CRLF and not the whitespace following
  32244. // it, so we follow the RFC and include the leading whitespace ...
  32245. if (h) {
  32246. this.header[h][this.header[h].length - 1] += lines[i]
  32247. continue
  32248. }
  32249. }
  32250. const posColon = lines[i].indexOf(':')
  32251. if (
  32252. posColon === -1 ||
  32253. posColon === 0
  32254. ) {
  32255. return
  32256. }
  32257. m = RE_HDR.exec(lines[i])
  32258. h = m[1].toLowerCase()
  32259. this.header[h] = this.header[h] || []
  32260. this.header[h].push((m[2] || ''))
  32261. if (++this.npairs === this.maxHeaderPairs) { break }
  32262. }
  32263. }
  32264. module.exports = HeaderParser
  32265. /***/ }),
  32266. /***/ 1620:
  32267. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  32268. "use strict";
  32269. const inherits = (__nccwpck_require__(7261).inherits)
  32270. const ReadableStream = (__nccwpck_require__(4492).Readable)
  32271. function PartStream (opts) {
  32272. ReadableStream.call(this, opts)
  32273. }
  32274. inherits(PartStream, ReadableStream)
  32275. PartStream.prototype._read = function (n) {}
  32276. module.exports = PartStream
  32277. /***/ }),
  32278. /***/ 1142:
  32279. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  32280. "use strict";
  32281. /**
  32282. * Copyright Brian White. All rights reserved.
  32283. *
  32284. * @see https://github.com/mscdex/streamsearch
  32285. *
  32286. * Permission is hereby granted, free of charge, to any person obtaining a copy
  32287. * of this software and associated documentation files (the "Software"), to
  32288. * deal in the Software without restriction, including without limitation the
  32289. * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  32290. * sell copies of the Software, and to permit persons to whom the Software is
  32291. * furnished to do so, subject to the following conditions:
  32292. *
  32293. * The above copyright notice and this permission notice shall be included in
  32294. * all copies or substantial portions of the Software.
  32295. *
  32296. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  32297. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  32298. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  32299. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  32300. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  32301. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  32302. * IN THE SOFTWARE.
  32303. *
  32304. * Based heavily on the Streaming Boyer-Moore-Horspool C++ implementation
  32305. * by Hongli Lai at: https://github.com/FooBarWidget/boyer-moore-horspool
  32306. */
  32307. const EventEmitter = (__nccwpck_require__(5673).EventEmitter)
  32308. const inherits = (__nccwpck_require__(7261).inherits)
  32309. function SBMH (needle) {
  32310. if (typeof needle === 'string') {
  32311. needle = Buffer.from(needle)
  32312. }
  32313. if (!Buffer.isBuffer(needle)) {
  32314. throw new TypeError('The needle has to be a String or a Buffer.')
  32315. }
  32316. const needleLength = needle.length
  32317. if (needleLength === 0) {
  32318. throw new Error('The needle cannot be an empty String/Buffer.')
  32319. }
  32320. if (needleLength > 256) {
  32321. throw new Error('The needle cannot have a length bigger than 256.')
  32322. }
  32323. this.maxMatches = Infinity
  32324. this.matches = 0
  32325. this._occ = new Array(256)
  32326. .fill(needleLength) // Initialize occurrence table.
  32327. this._lookbehind_size = 0
  32328. this._needle = needle
  32329. this._bufpos = 0
  32330. this._lookbehind = Buffer.alloc(needleLength)
  32331. // Populate occurrence table with analysis of the needle,
  32332. // ignoring last letter.
  32333. for (var i = 0; i < needleLength - 1; ++i) { // eslint-disable-line no-var
  32334. this._occ[needle[i]] = needleLength - 1 - i
  32335. }
  32336. }
  32337. inherits(SBMH, EventEmitter)
  32338. SBMH.prototype.reset = function () {
  32339. this._lookbehind_size = 0
  32340. this.matches = 0
  32341. this._bufpos = 0
  32342. }
  32343. SBMH.prototype.push = function (chunk, pos) {
  32344. if (!Buffer.isBuffer(chunk)) {
  32345. chunk = Buffer.from(chunk, 'binary')
  32346. }
  32347. const chlen = chunk.length
  32348. this._bufpos = pos || 0
  32349. let r
  32350. while (r !== chlen && this.matches < this.maxMatches) { r = this._sbmh_feed(chunk) }
  32351. return r
  32352. }
  32353. SBMH.prototype._sbmh_feed = function (data) {
  32354. const len = data.length
  32355. const needle = this._needle
  32356. const needleLength = needle.length
  32357. const lastNeedleChar = needle[needleLength - 1]
  32358. // Positive: points to a position in `data`
  32359. // pos == 3 points to data[3]
  32360. // Negative: points to a position in the lookbehind buffer
  32361. // pos == -2 points to lookbehind[lookbehind_size - 2]
  32362. let pos = -this._lookbehind_size
  32363. let ch
  32364. if (pos < 0) {
  32365. // Lookbehind buffer is not empty. Perform Boyer-Moore-Horspool
  32366. // search with character lookup code that considers both the
  32367. // lookbehind buffer and the current round's haystack data.
  32368. //
  32369. // Loop until
  32370. // there is a match.
  32371. // or until
  32372. // we've moved past the position that requires the
  32373. // lookbehind buffer. In this case we switch to the
  32374. // optimized loop.
  32375. // or until
  32376. // the character to look at lies outside the haystack.
  32377. while (pos < 0 && pos <= len - needleLength) {
  32378. ch = this._sbmh_lookup_char(data, pos + needleLength - 1)
  32379. if (
  32380. ch === lastNeedleChar &&
  32381. this._sbmh_memcmp(data, pos, needleLength - 1)
  32382. ) {
  32383. this._lookbehind_size = 0
  32384. ++this.matches
  32385. this.emit('info', true)
  32386. return (this._bufpos = pos + needleLength)
  32387. }
  32388. pos += this._occ[ch]
  32389. }
  32390. // No match.
  32391. if (pos < 0) {
  32392. // There's too few data for Boyer-Moore-Horspool to run,
  32393. // so let's use a different algorithm to skip as much as
  32394. // we can.
  32395. // Forward pos until
  32396. // the trailing part of lookbehind + data
  32397. // looks like the beginning of the needle
  32398. // or until
  32399. // pos == 0
  32400. while (pos < 0 && !this._sbmh_memcmp(data, pos, len - pos)) { ++pos }
  32401. }
  32402. if (pos >= 0) {
  32403. // Discard lookbehind buffer.
  32404. this.emit('info', false, this._lookbehind, 0, this._lookbehind_size)
  32405. this._lookbehind_size = 0
  32406. } else {
  32407. // Cut off part of the lookbehind buffer that has
  32408. // been processed and append the entire haystack
  32409. // into it.
  32410. const bytesToCutOff = this._lookbehind_size + pos
  32411. if (bytesToCutOff > 0) {
  32412. // The cut off data is guaranteed not to contain the needle.
  32413. this.emit('info', false, this._lookbehind, 0, bytesToCutOff)
  32414. }
  32415. this._lookbehind.copy(this._lookbehind, 0, bytesToCutOff,
  32416. this._lookbehind_size - bytesToCutOff)
  32417. this._lookbehind_size -= bytesToCutOff
  32418. data.copy(this._lookbehind, this._lookbehind_size)
  32419. this._lookbehind_size += len
  32420. this._bufpos = len
  32421. return len
  32422. }
  32423. }
  32424. pos += (pos >= 0) * this._bufpos
  32425. // Lookbehind buffer is now empty. We only need to check if the
  32426. // needle is in the haystack.
  32427. if (data.indexOf(needle, pos) !== -1) {
  32428. pos = data.indexOf(needle, pos)
  32429. ++this.matches
  32430. if (pos > 0) { this.emit('info', true, data, this._bufpos, pos) } else { this.emit('info', true) }
  32431. return (this._bufpos = pos + needleLength)
  32432. } else {
  32433. pos = len - needleLength
  32434. }
  32435. // There was no match. If there's trailing haystack data that we cannot
  32436. // match yet using the Boyer-Moore-Horspool algorithm (because the trailing
  32437. // data is less than the needle size) then match using a modified
  32438. // algorithm that starts matching from the beginning instead of the end.
  32439. // Whatever trailing data is left after running this algorithm is added to
  32440. // the lookbehind buffer.
  32441. while (
  32442. pos < len &&
  32443. (
  32444. data[pos] !== needle[0] ||
  32445. (
  32446. (Buffer.compare(
  32447. data.subarray(pos, pos + len - pos),
  32448. needle.subarray(0, len - pos)
  32449. ) !== 0)
  32450. )
  32451. )
  32452. ) {
  32453. ++pos
  32454. }
  32455. if (pos < len) {
  32456. data.copy(this._lookbehind, 0, pos, pos + (len - pos))
  32457. this._lookbehind_size = len - pos
  32458. }
  32459. // Everything until pos is guaranteed not to contain needle data.
  32460. if (pos > 0) { this.emit('info', false, data, this._bufpos, pos < len ? pos : len) }
  32461. this._bufpos = len
  32462. return len
  32463. }
  32464. SBMH.prototype._sbmh_lookup_char = function (data, pos) {
  32465. return (pos < 0)
  32466. ? this._lookbehind[this._lookbehind_size + pos]
  32467. : data[pos]
  32468. }
  32469. SBMH.prototype._sbmh_memcmp = function (data, pos, len) {
  32470. for (var i = 0; i < len; ++i) { // eslint-disable-line no-var
  32471. if (this._sbmh_lookup_char(data, pos + i) !== this._needle[i]) { return false }
  32472. }
  32473. return true
  32474. }
  32475. module.exports = SBMH
  32476. /***/ }),
  32477. /***/ 727:
  32478. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  32479. "use strict";
  32480. const WritableStream = (__nccwpck_require__(4492).Writable)
  32481. const { inherits } = __nccwpck_require__(7261)
  32482. const Dicer = __nccwpck_require__(2960)
  32483. const MultipartParser = __nccwpck_require__(2183)
  32484. const UrlencodedParser = __nccwpck_require__(8306)
  32485. const parseParams = __nccwpck_require__(1854)
  32486. function Busboy (opts) {
  32487. if (!(this instanceof Busboy)) { return new Busboy(opts) }
  32488. if (typeof opts !== 'object') {
  32489. throw new TypeError('Busboy expected an options-Object.')
  32490. }
  32491. if (typeof opts.headers !== 'object') {
  32492. throw new TypeError('Busboy expected an options-Object with headers-attribute.')
  32493. }
  32494. if (typeof opts.headers['content-type'] !== 'string') {
  32495. throw new TypeError('Missing Content-Type-header.')
  32496. }
  32497. const {
  32498. headers,
  32499. ...streamOptions
  32500. } = opts
  32501. this.opts = {
  32502. autoDestroy: false,
  32503. ...streamOptions
  32504. }
  32505. WritableStream.call(this, this.opts)
  32506. this._done = false
  32507. this._parser = this.getParserByHeaders(headers)
  32508. this._finished = false
  32509. }
  32510. inherits(Busboy, WritableStream)
  32511. Busboy.prototype.emit = function (ev) {
  32512. if (ev === 'finish') {
  32513. if (!this._done) {
  32514. this._parser?.end()
  32515. return
  32516. } else if (this._finished) {
  32517. return
  32518. }
  32519. this._finished = true
  32520. }
  32521. WritableStream.prototype.emit.apply(this, arguments)
  32522. }
  32523. Busboy.prototype.getParserByHeaders = function (headers) {
  32524. const parsed = parseParams(headers['content-type'])
  32525. const cfg = {
  32526. defCharset: this.opts.defCharset,
  32527. fileHwm: this.opts.fileHwm,
  32528. headers,
  32529. highWaterMark: this.opts.highWaterMark,
  32530. isPartAFile: this.opts.isPartAFile,
  32531. limits: this.opts.limits,
  32532. parsedConType: parsed,
  32533. preservePath: this.opts.preservePath
  32534. }
  32535. if (MultipartParser.detect.test(parsed[0])) {
  32536. return new MultipartParser(this, cfg)
  32537. }
  32538. if (UrlencodedParser.detect.test(parsed[0])) {
  32539. return new UrlencodedParser(this, cfg)
  32540. }
  32541. throw new Error('Unsupported Content-Type.')
  32542. }
  32543. Busboy.prototype._write = function (chunk, encoding, cb) {
  32544. this._parser.write(chunk, cb)
  32545. }
  32546. module.exports = Busboy
  32547. module.exports["default"] = Busboy
  32548. module.exports.Busboy = Busboy
  32549. module.exports.Dicer = Dicer
  32550. /***/ }),
  32551. /***/ 2183:
  32552. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  32553. "use strict";
  32554. // TODO:
  32555. // * support 1 nested multipart level
  32556. // (see second multipart example here:
  32557. // http://www.w3.org/TR/html401/interact/forms.html#didx-multipartform-data)
  32558. // * support limits.fieldNameSize
  32559. // -- this will require modifications to utils.parseParams
  32560. const { Readable } = __nccwpck_require__(4492)
  32561. const { inherits } = __nccwpck_require__(7261)
  32562. const Dicer = __nccwpck_require__(2960)
  32563. const parseParams = __nccwpck_require__(1854)
  32564. const decodeText = __nccwpck_require__(4619)
  32565. const basename = __nccwpck_require__(8647)
  32566. const getLimit = __nccwpck_require__(1467)
  32567. const RE_BOUNDARY = /^boundary$/i
  32568. const RE_FIELD = /^form-data$/i
  32569. const RE_CHARSET = /^charset$/i
  32570. const RE_FILENAME = /^filename$/i
  32571. const RE_NAME = /^name$/i
  32572. Multipart.detect = /^multipart\/form-data/i
  32573. function Multipart (boy, cfg) {
  32574. let i
  32575. let len
  32576. const self = this
  32577. let boundary
  32578. const limits = cfg.limits
  32579. const isPartAFile = cfg.isPartAFile || ((fieldName, contentType, fileName) => (contentType === 'application/octet-stream' || fileName !== undefined))
  32580. const parsedConType = cfg.parsedConType || []
  32581. const defCharset = cfg.defCharset || 'utf8'
  32582. const preservePath = cfg.preservePath
  32583. const fileOpts = { highWaterMark: cfg.fileHwm }
  32584. for (i = 0, len = parsedConType.length; i < len; ++i) {
  32585. if (Array.isArray(parsedConType[i]) &&
  32586. RE_BOUNDARY.test(parsedConType[i][0])) {
  32587. boundary = parsedConType[i][1]
  32588. break
  32589. }
  32590. }
  32591. function checkFinished () {
  32592. if (nends === 0 && finished && !boy._done) {
  32593. finished = false
  32594. self.end()
  32595. }
  32596. }
  32597. if (typeof boundary !== 'string') { throw new Error('Multipart: Boundary not found') }
  32598. const fieldSizeLimit = getLimit(limits, 'fieldSize', 1 * 1024 * 1024)
  32599. const fileSizeLimit = getLimit(limits, 'fileSize', Infinity)
  32600. const filesLimit = getLimit(limits, 'files', Infinity)
  32601. const fieldsLimit = getLimit(limits, 'fields', Infinity)
  32602. const partsLimit = getLimit(limits, 'parts', Infinity)
  32603. const headerPairsLimit = getLimit(limits, 'headerPairs', 2000)
  32604. const headerSizeLimit = getLimit(limits, 'headerSize', 80 * 1024)
  32605. let nfiles = 0
  32606. let nfields = 0
  32607. let nends = 0
  32608. let curFile
  32609. let curField
  32610. let finished = false
  32611. this._needDrain = false
  32612. this._pause = false
  32613. this._cb = undefined
  32614. this._nparts = 0
  32615. this._boy = boy
  32616. const parserCfg = {
  32617. boundary,
  32618. maxHeaderPairs: headerPairsLimit,
  32619. maxHeaderSize: headerSizeLimit,
  32620. partHwm: fileOpts.highWaterMark,
  32621. highWaterMark: cfg.highWaterMark
  32622. }
  32623. this.parser = new Dicer(parserCfg)
  32624. this.parser.on('drain', function () {
  32625. self._needDrain = false
  32626. if (self._cb && !self._pause) {
  32627. const cb = self._cb
  32628. self._cb = undefined
  32629. cb()
  32630. }
  32631. }).on('part', function onPart (part) {
  32632. if (++self._nparts > partsLimit) {
  32633. self.parser.removeListener('part', onPart)
  32634. self.parser.on('part', skipPart)
  32635. boy.hitPartsLimit = true
  32636. boy.emit('partsLimit')
  32637. return skipPart(part)
  32638. }
  32639. // hack because streams2 _always_ doesn't emit 'end' until nextTick, so let
  32640. // us emit 'end' early since we know the part has ended if we are already
  32641. // seeing the next part
  32642. if (curField) {
  32643. const field = curField
  32644. field.emit('end')
  32645. field.removeAllListeners('end')
  32646. }
  32647. part.on('header', function (header) {
  32648. let contype
  32649. let fieldname
  32650. let parsed
  32651. let charset
  32652. let encoding
  32653. let filename
  32654. let nsize = 0
  32655. if (header['content-type']) {
  32656. parsed = parseParams(header['content-type'][0])
  32657. if (parsed[0]) {
  32658. contype = parsed[0].toLowerCase()
  32659. for (i = 0, len = parsed.length; i < len; ++i) {
  32660. if (RE_CHARSET.test(parsed[i][0])) {
  32661. charset = parsed[i][1].toLowerCase()
  32662. break
  32663. }
  32664. }
  32665. }
  32666. }
  32667. if (contype === undefined) { contype = 'text/plain' }
  32668. if (charset === undefined) { charset = defCharset }
  32669. if (header['content-disposition']) {
  32670. parsed = parseParams(header['content-disposition'][0])
  32671. if (!RE_FIELD.test(parsed[0])) { return skipPart(part) }
  32672. for (i = 0, len = parsed.length; i < len; ++i) {
  32673. if (RE_NAME.test(parsed[i][0])) {
  32674. fieldname = parsed[i][1]
  32675. } else if (RE_FILENAME.test(parsed[i][0])) {
  32676. filename = parsed[i][1]
  32677. if (!preservePath) { filename = basename(filename) }
  32678. }
  32679. }
  32680. } else { return skipPart(part) }
  32681. if (header['content-transfer-encoding']) { encoding = header['content-transfer-encoding'][0].toLowerCase() } else { encoding = '7bit' }
  32682. let onData,
  32683. onEnd
  32684. if (isPartAFile(fieldname, contype, filename)) {
  32685. // file/binary field
  32686. if (nfiles === filesLimit) {
  32687. if (!boy.hitFilesLimit) {
  32688. boy.hitFilesLimit = true
  32689. boy.emit('filesLimit')
  32690. }
  32691. return skipPart(part)
  32692. }
  32693. ++nfiles
  32694. if (boy.listenerCount('file') === 0) {
  32695. self.parser._ignore()
  32696. return
  32697. }
  32698. ++nends
  32699. const file = new FileStream(fileOpts)
  32700. curFile = file
  32701. file.on('end', function () {
  32702. --nends
  32703. self._pause = false
  32704. checkFinished()
  32705. if (self._cb && !self._needDrain) {
  32706. const cb = self._cb
  32707. self._cb = undefined
  32708. cb()
  32709. }
  32710. })
  32711. file._read = function (n) {
  32712. if (!self._pause) { return }
  32713. self._pause = false
  32714. if (self._cb && !self._needDrain) {
  32715. const cb = self._cb
  32716. self._cb = undefined
  32717. cb()
  32718. }
  32719. }
  32720. boy.emit('file', fieldname, file, filename, encoding, contype)
  32721. onData = function (data) {
  32722. if ((nsize += data.length) > fileSizeLimit) {
  32723. const extralen = fileSizeLimit - nsize + data.length
  32724. if (extralen > 0) { file.push(data.slice(0, extralen)) }
  32725. file.truncated = true
  32726. file.bytesRead = fileSizeLimit
  32727. part.removeAllListeners('data')
  32728. file.emit('limit')
  32729. return
  32730. } else if (!file.push(data)) { self._pause = true }
  32731. file.bytesRead = nsize
  32732. }
  32733. onEnd = function () {
  32734. curFile = undefined
  32735. file.push(null)
  32736. }
  32737. } else {
  32738. // non-file field
  32739. if (nfields === fieldsLimit) {
  32740. if (!boy.hitFieldsLimit) {
  32741. boy.hitFieldsLimit = true
  32742. boy.emit('fieldsLimit')
  32743. }
  32744. return skipPart(part)
  32745. }
  32746. ++nfields
  32747. ++nends
  32748. let buffer = ''
  32749. let truncated = false
  32750. curField = part
  32751. onData = function (data) {
  32752. if ((nsize += data.length) > fieldSizeLimit) {
  32753. const extralen = (fieldSizeLimit - (nsize - data.length))
  32754. buffer += data.toString('binary', 0, extralen)
  32755. truncated = true
  32756. part.removeAllListeners('data')
  32757. } else { buffer += data.toString('binary') }
  32758. }
  32759. onEnd = function () {
  32760. curField = undefined
  32761. if (buffer.length) { buffer = decodeText(buffer, 'binary', charset) }
  32762. boy.emit('field', fieldname, buffer, false, truncated, encoding, contype)
  32763. --nends
  32764. checkFinished()
  32765. }
  32766. }
  32767. /* As of node@2efe4ab761666 (v0.10.29+/v0.11.14+), busboy had become
  32768. broken. Streams2/streams3 is a huge black box of confusion, but
  32769. somehow overriding the sync state seems to fix things again (and still
  32770. seems to work for previous node versions).
  32771. */
  32772. part._readableState.sync = false
  32773. part.on('data', onData)
  32774. part.on('end', onEnd)
  32775. }).on('error', function (err) {
  32776. if (curFile) { curFile.emit('error', err) }
  32777. })
  32778. }).on('error', function (err) {
  32779. boy.emit('error', err)
  32780. }).on('finish', function () {
  32781. finished = true
  32782. checkFinished()
  32783. })
  32784. }
  32785. Multipart.prototype.write = function (chunk, cb) {
  32786. const r = this.parser.write(chunk)
  32787. if (r && !this._pause) {
  32788. cb()
  32789. } else {
  32790. this._needDrain = !r
  32791. this._cb = cb
  32792. }
  32793. }
  32794. Multipart.prototype.end = function () {
  32795. const self = this
  32796. if (self.parser.writable) {
  32797. self.parser.end()
  32798. } else if (!self._boy._done) {
  32799. process.nextTick(function () {
  32800. self._boy._done = true
  32801. self._boy.emit('finish')
  32802. })
  32803. }
  32804. }
  32805. function skipPart (part) {
  32806. part.resume()
  32807. }
  32808. function FileStream (opts) {
  32809. Readable.call(this, opts)
  32810. this.bytesRead = 0
  32811. this.truncated = false
  32812. }
  32813. inherits(FileStream, Readable)
  32814. FileStream.prototype._read = function (n) {}
  32815. module.exports = Multipart
  32816. /***/ }),
  32817. /***/ 8306:
  32818. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  32819. "use strict";
  32820. const Decoder = __nccwpck_require__(7100)
  32821. const decodeText = __nccwpck_require__(4619)
  32822. const getLimit = __nccwpck_require__(1467)
  32823. const RE_CHARSET = /^charset$/i
  32824. UrlEncoded.detect = /^application\/x-www-form-urlencoded/i
  32825. function UrlEncoded (boy, cfg) {
  32826. const limits = cfg.limits
  32827. const parsedConType = cfg.parsedConType
  32828. this.boy = boy
  32829. this.fieldSizeLimit = getLimit(limits, 'fieldSize', 1 * 1024 * 1024)
  32830. this.fieldNameSizeLimit = getLimit(limits, 'fieldNameSize', 100)
  32831. this.fieldsLimit = getLimit(limits, 'fields', Infinity)
  32832. let charset
  32833. for (var i = 0, len = parsedConType.length; i < len; ++i) { // eslint-disable-line no-var
  32834. if (Array.isArray(parsedConType[i]) &&
  32835. RE_CHARSET.test(parsedConType[i][0])) {
  32836. charset = parsedConType[i][1].toLowerCase()
  32837. break
  32838. }
  32839. }
  32840. if (charset === undefined) { charset = cfg.defCharset || 'utf8' }
  32841. this.decoder = new Decoder()
  32842. this.charset = charset
  32843. this._fields = 0
  32844. this._state = 'key'
  32845. this._checkingBytes = true
  32846. this._bytesKey = 0
  32847. this._bytesVal = 0
  32848. this._key = ''
  32849. this._val = ''
  32850. this._keyTrunc = false
  32851. this._valTrunc = false
  32852. this._hitLimit = false
  32853. }
  32854. UrlEncoded.prototype.write = function (data, cb) {
  32855. if (this._fields === this.fieldsLimit) {
  32856. if (!this.boy.hitFieldsLimit) {
  32857. this.boy.hitFieldsLimit = true
  32858. this.boy.emit('fieldsLimit')
  32859. }
  32860. return cb()
  32861. }
  32862. let idxeq; let idxamp; let i; let p = 0; const len = data.length
  32863. while (p < len) {
  32864. if (this._state === 'key') {
  32865. idxeq = idxamp = undefined
  32866. for (i = p; i < len; ++i) {
  32867. if (!this._checkingBytes) { ++p }
  32868. if (data[i] === 0x3D/* = */) {
  32869. idxeq = i
  32870. break
  32871. } else if (data[i] === 0x26/* & */) {
  32872. idxamp = i
  32873. break
  32874. }
  32875. if (this._checkingBytes && this._bytesKey === this.fieldNameSizeLimit) {
  32876. this._hitLimit = true
  32877. break
  32878. } else if (this._checkingBytes) { ++this._bytesKey }
  32879. }
  32880. if (idxeq !== undefined) {
  32881. // key with assignment
  32882. if (idxeq > p) { this._key += this.decoder.write(data.toString('binary', p, idxeq)) }
  32883. this._state = 'val'
  32884. this._hitLimit = false
  32885. this._checkingBytes = true
  32886. this._val = ''
  32887. this._bytesVal = 0
  32888. this._valTrunc = false
  32889. this.decoder.reset()
  32890. p = idxeq + 1
  32891. } else if (idxamp !== undefined) {
  32892. // key with no assignment
  32893. ++this._fields
  32894. let key; const keyTrunc = this._keyTrunc
  32895. if (idxamp > p) { key = (this._key += this.decoder.write(data.toString('binary', p, idxamp))) } else { key = this._key }
  32896. this._hitLimit = false
  32897. this._checkingBytes = true
  32898. this._key = ''
  32899. this._bytesKey = 0
  32900. this._keyTrunc = false
  32901. this.decoder.reset()
  32902. if (key.length) {
  32903. this.boy.emit('field', decodeText(key, 'binary', this.charset),
  32904. '',
  32905. keyTrunc,
  32906. false)
  32907. }
  32908. p = idxamp + 1
  32909. if (this._fields === this.fieldsLimit) { return cb() }
  32910. } else if (this._hitLimit) {
  32911. // we may not have hit the actual limit if there are encoded bytes...
  32912. if (i > p) { this._key += this.decoder.write(data.toString('binary', p, i)) }
  32913. p = i
  32914. if ((this._bytesKey = this._key.length) === this.fieldNameSizeLimit) {
  32915. // yep, we actually did hit the limit
  32916. this._checkingBytes = false
  32917. this._keyTrunc = true
  32918. }
  32919. } else {
  32920. if (p < len) { this._key += this.decoder.write(data.toString('binary', p)) }
  32921. p = len
  32922. }
  32923. } else {
  32924. idxamp = undefined
  32925. for (i = p; i < len; ++i) {
  32926. if (!this._checkingBytes) { ++p }
  32927. if (data[i] === 0x26/* & */) {
  32928. idxamp = i
  32929. break
  32930. }
  32931. if (this._checkingBytes && this._bytesVal === this.fieldSizeLimit) {
  32932. this._hitLimit = true
  32933. break
  32934. } else if (this._checkingBytes) { ++this._bytesVal }
  32935. }
  32936. if (idxamp !== undefined) {
  32937. ++this._fields
  32938. if (idxamp > p) { this._val += this.decoder.write(data.toString('binary', p, idxamp)) }
  32939. this.boy.emit('field', decodeText(this._key, 'binary', this.charset),
  32940. decodeText(this._val, 'binary', this.charset),
  32941. this._keyTrunc,
  32942. this._valTrunc)
  32943. this._state = 'key'
  32944. this._hitLimit = false
  32945. this._checkingBytes = true
  32946. this._key = ''
  32947. this._bytesKey = 0
  32948. this._keyTrunc = false
  32949. this.decoder.reset()
  32950. p = idxamp + 1
  32951. if (this._fields === this.fieldsLimit) { return cb() }
  32952. } else if (this._hitLimit) {
  32953. // we may not have hit the actual limit if there are encoded bytes...
  32954. if (i > p) { this._val += this.decoder.write(data.toString('binary', p, i)) }
  32955. p = i
  32956. if ((this._val === '' && this.fieldSizeLimit === 0) ||
  32957. (this._bytesVal = this._val.length) === this.fieldSizeLimit) {
  32958. // yep, we actually did hit the limit
  32959. this._checkingBytes = false
  32960. this._valTrunc = true
  32961. }
  32962. } else {
  32963. if (p < len) { this._val += this.decoder.write(data.toString('binary', p)) }
  32964. p = len
  32965. }
  32966. }
  32967. }
  32968. cb()
  32969. }
  32970. UrlEncoded.prototype.end = function () {
  32971. if (this.boy._done) { return }
  32972. if (this._state === 'key' && this._key.length > 0) {
  32973. this.boy.emit('field', decodeText(this._key, 'binary', this.charset),
  32974. '',
  32975. this._keyTrunc,
  32976. false)
  32977. } else if (this._state === 'val') {
  32978. this.boy.emit('field', decodeText(this._key, 'binary', this.charset),
  32979. decodeText(this._val, 'binary', this.charset),
  32980. this._keyTrunc,
  32981. this._valTrunc)
  32982. }
  32983. this.boy._done = true
  32984. this.boy.emit('finish')
  32985. }
  32986. module.exports = UrlEncoded
  32987. /***/ }),
  32988. /***/ 7100:
  32989. /***/ ((module) => {
  32990. "use strict";
  32991. const RE_PLUS = /\+/g
  32992. const HEX = [
  32993. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32994. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32995. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32996. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
  32997. 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32998. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  32999. 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  33000. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
  33001. ]
  33002. function Decoder () {
  33003. this.buffer = undefined
  33004. }
  33005. Decoder.prototype.write = function (str) {
  33006. // Replace '+' with ' ' before decoding
  33007. str = str.replace(RE_PLUS, ' ')
  33008. let res = ''
  33009. let i = 0; let p = 0; const len = str.length
  33010. for (; i < len; ++i) {
  33011. if (this.buffer !== undefined) {
  33012. if (!HEX[str.charCodeAt(i)]) {
  33013. res += '%' + this.buffer
  33014. this.buffer = undefined
  33015. --i // retry character
  33016. } else {
  33017. this.buffer += str[i]
  33018. ++p
  33019. if (this.buffer.length === 2) {
  33020. res += String.fromCharCode(parseInt(this.buffer, 16))
  33021. this.buffer = undefined
  33022. }
  33023. }
  33024. } else if (str[i] === '%') {
  33025. if (i > p) {
  33026. res += str.substring(p, i)
  33027. p = i
  33028. }
  33029. this.buffer = ''
  33030. ++p
  33031. }
  33032. }
  33033. if (p < len && this.buffer === undefined) { res += str.substring(p) }
  33034. return res
  33035. }
  33036. Decoder.prototype.reset = function () {
  33037. this.buffer = undefined
  33038. }
  33039. module.exports = Decoder
  33040. /***/ }),
  33041. /***/ 8647:
  33042. /***/ ((module) => {
  33043. "use strict";
  33044. module.exports = function basename (path) {
  33045. if (typeof path !== 'string') { return '' }
  33046. for (var i = path.length - 1; i >= 0; --i) { // eslint-disable-line no-var
  33047. switch (path.charCodeAt(i)) {
  33048. case 0x2F: // '/'
  33049. case 0x5C: // '\'
  33050. path = path.slice(i + 1)
  33051. return (path === '..' || path === '.' ? '' : path)
  33052. }
  33053. }
  33054. return (path === '..' || path === '.' ? '' : path)
  33055. }
  33056. /***/ }),
  33057. /***/ 4619:
  33058. /***/ (function(module) {
  33059. "use strict";
  33060. // Node has always utf-8
  33061. const utf8Decoder = new TextDecoder('utf-8')
  33062. const textDecoders = new Map([
  33063. ['utf-8', utf8Decoder],
  33064. ['utf8', utf8Decoder]
  33065. ])
  33066. function getDecoder (charset) {
  33067. let lc
  33068. while (true) {
  33069. switch (charset) {
  33070. case 'utf-8':
  33071. case 'utf8':
  33072. return decoders.utf8
  33073. case 'latin1':
  33074. case 'ascii': // TODO: Make these a separate, strict decoder?
  33075. case 'us-ascii':
  33076. case 'iso-8859-1':
  33077. case 'iso8859-1':
  33078. case 'iso88591':
  33079. case 'iso_8859-1':
  33080. case 'windows-1252':
  33081. case 'iso_8859-1:1987':
  33082. case 'cp1252':
  33083. case 'x-cp1252':
  33084. return decoders.latin1
  33085. case 'utf16le':
  33086. case 'utf-16le':
  33087. case 'ucs2':
  33088. case 'ucs-2':
  33089. return decoders.utf16le
  33090. case 'base64':
  33091. return decoders.base64
  33092. default:
  33093. if (lc === undefined) {
  33094. lc = true
  33095. charset = charset.toLowerCase()
  33096. continue
  33097. }
  33098. return decoders.other.bind(charset)
  33099. }
  33100. }
  33101. }
  33102. const decoders = {
  33103. utf8: (data, sourceEncoding) => {
  33104. if (data.length === 0) {
  33105. return ''
  33106. }
  33107. if (typeof data === 'string') {
  33108. data = Buffer.from(data, sourceEncoding)
  33109. }
  33110. return data.utf8Slice(0, data.length)
  33111. },
  33112. latin1: (data, sourceEncoding) => {
  33113. if (data.length === 0) {
  33114. return ''
  33115. }
  33116. if (typeof data === 'string') {
  33117. return data
  33118. }
  33119. return data.latin1Slice(0, data.length)
  33120. },
  33121. utf16le: (data, sourceEncoding) => {
  33122. if (data.length === 0) {
  33123. return ''
  33124. }
  33125. if (typeof data === 'string') {
  33126. data = Buffer.from(data, sourceEncoding)
  33127. }
  33128. return data.ucs2Slice(0, data.length)
  33129. },
  33130. base64: (data, sourceEncoding) => {
  33131. if (data.length === 0) {
  33132. return ''
  33133. }
  33134. if (typeof data === 'string') {
  33135. data = Buffer.from(data, sourceEncoding)
  33136. }
  33137. return data.base64Slice(0, data.length)
  33138. },
  33139. other: (data, sourceEncoding) => {
  33140. if (data.length === 0) {
  33141. return ''
  33142. }
  33143. if (typeof data === 'string') {
  33144. data = Buffer.from(data, sourceEncoding)
  33145. }
  33146. if (textDecoders.has(this.toString())) {
  33147. try {
  33148. return textDecoders.get(this).decode(data)
  33149. } catch {}
  33150. }
  33151. return typeof data === 'string'
  33152. ? data
  33153. : data.toString()
  33154. }
  33155. }
  33156. function decodeText (text, sourceEncoding, destEncoding) {
  33157. if (text) {
  33158. return getDecoder(destEncoding)(text, sourceEncoding)
  33159. }
  33160. return text
  33161. }
  33162. module.exports = decodeText
  33163. /***/ }),
  33164. /***/ 1467:
  33165. /***/ ((module) => {
  33166. "use strict";
  33167. module.exports = function getLimit (limits, name, defaultLimit) {
  33168. if (
  33169. !limits ||
  33170. limits[name] === undefined ||
  33171. limits[name] === null
  33172. ) { return defaultLimit }
  33173. if (
  33174. typeof limits[name] !== 'number' ||
  33175. isNaN(limits[name])
  33176. ) { throw new TypeError('Limit ' + name + ' is not a valid number') }
  33177. return limits[name]
  33178. }
  33179. /***/ }),
  33180. /***/ 1854:
  33181. /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
  33182. "use strict";
  33183. /* eslint-disable object-property-newline */
  33184. const decodeText = __nccwpck_require__(4619)
  33185. const RE_ENCODED = /%[a-fA-F0-9][a-fA-F0-9]/g
  33186. const EncodedLookup = {
  33187. '%00': '\x00', '%01': '\x01', '%02': '\x02', '%03': '\x03', '%04': '\x04',
  33188. '%05': '\x05', '%06': '\x06', '%07': '\x07', '%08': '\x08', '%09': '\x09',
  33189. '%0a': '\x0a', '%0A': '\x0a', '%0b': '\x0b', '%0B': '\x0b', '%0c': '\x0c',
  33190. '%0C': '\x0c', '%0d': '\x0d', '%0D': '\x0d', '%0e': '\x0e', '%0E': '\x0e',
  33191. '%0f': '\x0f', '%0F': '\x0f', '%10': '\x10', '%11': '\x11', '%12': '\x12',
  33192. '%13': '\x13', '%14': '\x14', '%15': '\x15', '%16': '\x16', '%17': '\x17',
  33193. '%18': '\x18', '%19': '\x19', '%1a': '\x1a', '%1A': '\x1a', '%1b': '\x1b',
  33194. '%1B': '\x1b', '%1c': '\x1c', '%1C': '\x1c', '%1d': '\x1d', '%1D': '\x1d',
  33195. '%1e': '\x1e', '%1E': '\x1e', '%1f': '\x1f', '%1F': '\x1f', '%20': '\x20',
  33196. '%21': '\x21', '%22': '\x22', '%23': '\x23', '%24': '\x24', '%25': '\x25',
  33197. '%26': '\x26', '%27': '\x27', '%28': '\x28', '%29': '\x29', '%2a': '\x2a',
  33198. '%2A': '\x2a', '%2b': '\x2b', '%2B': '\x2b', '%2c': '\x2c', '%2C': '\x2c',
  33199. '%2d': '\x2d', '%2D': '\x2d', '%2e': '\x2e', '%2E': '\x2e', '%2f': '\x2f',
  33200. '%2F': '\x2f', '%30': '\x30', '%31': '\x31', '%32': '\x32', '%33': '\x33',
  33201. '%34': '\x34', '%35': '\x35', '%36': '\x36', '%37': '\x37', '%38': '\x38',
  33202. '%39': '\x39', '%3a': '\x3a', '%3A': '\x3a', '%3b': '\x3b', '%3B': '\x3b',
  33203. '%3c': '\x3c', '%3C': '\x3c', '%3d': '\x3d', '%3D': '\x3d', '%3e': '\x3e',
  33204. '%3E': '\x3e', '%3f': '\x3f', '%3F': '\x3f', '%40': '\x40', '%41': '\x41',
  33205. '%42': '\x42', '%43': '\x43', '%44': '\x44', '%45': '\x45', '%46': '\x46',
  33206. '%47': '\x47', '%48': '\x48', '%49': '\x49', '%4a': '\x4a', '%4A': '\x4a',
  33207. '%4b': '\x4b', '%4B': '\x4b', '%4c': '\x4c', '%4C': '\x4c', '%4d': '\x4d',
  33208. '%4D': '\x4d', '%4e': '\x4e', '%4E': '\x4e', '%4f': '\x4f', '%4F': '\x4f',
  33209. '%50': '\x50', '%51': '\x51', '%52': '\x52', '%53': '\x53', '%54': '\x54',
  33210. '%55': '\x55', '%56': '\x56', '%57': '\x57', '%58': '\x58', '%59': '\x59',
  33211. '%5a': '\x5a', '%5A': '\x5a', '%5b': '\x5b', '%5B': '\x5b', '%5c': '\x5c',
  33212. '%5C': '\x5c', '%5d': '\x5d', '%5D': '\x5d', '%5e': '\x5e', '%5E': '\x5e',
  33213. '%5f': '\x5f', '%5F': '\x5f', '%60': '\x60', '%61': '\x61', '%62': '\x62',
  33214. '%63': '\x63', '%64': '\x64', '%65': '\x65', '%66': '\x66', '%67': '\x67',
  33215. '%68': '\x68', '%69': '\x69', '%6a': '\x6a', '%6A': '\x6a', '%6b': '\x6b',
  33216. '%6B': '\x6b', '%6c': '\x6c', '%6C': '\x6c', '%6d': '\x6d', '%6D': '\x6d',
  33217. '%6e': '\x6e', '%6E': '\x6e', '%6f': '\x6f', '%6F': '\x6f', '%70': '\x70',
  33218. '%71': '\x71', '%72': '\x72', '%73': '\x73', '%74': '\x74', '%75': '\x75',
  33219. '%76': '\x76', '%77': '\x77', '%78': '\x78', '%79': '\x79', '%7a': '\x7a',
  33220. '%7A': '\x7a', '%7b': '\x7b', '%7B': '\x7b', '%7c': '\x7c', '%7C': '\x7c',
  33221. '%7d': '\x7d', '%7D': '\x7d', '%7e': '\x7e', '%7E': '\x7e', '%7f': '\x7f',
  33222. '%7F': '\x7f', '%80': '\x80', '%81': '\x81', '%82': '\x82', '%83': '\x83',
  33223. '%84': '\x84', '%85': '\x85', '%86': '\x86', '%87': '\x87', '%88': '\x88',
  33224. '%89': '\x89', '%8a': '\x8a', '%8A': '\x8a', '%8b': '\x8b', '%8B': '\x8b',
  33225. '%8c': '\x8c', '%8C': '\x8c', '%8d': '\x8d', '%8D': '\x8d', '%8e': '\x8e',
  33226. '%8E': '\x8e', '%8f': '\x8f', '%8F': '\x8f', '%90': '\x90', '%91': '\x91',
  33227. '%92': '\x92', '%93': '\x93', '%94': '\x94', '%95': '\x95', '%96': '\x96',
  33228. '%97': '\x97', '%98': '\x98', '%99': '\x99', '%9a': '\x9a', '%9A': '\x9a',
  33229. '%9b': '\x9b', '%9B': '\x9b', '%9c': '\x9c', '%9C': '\x9c', '%9d': '\x9d',
  33230. '%9D': '\x9d', '%9e': '\x9e', '%9E': '\x9e', '%9f': '\x9f', '%9F': '\x9f',
  33231. '%a0': '\xa0', '%A0': '\xa0', '%a1': '\xa1', '%A1': '\xa1', '%a2': '\xa2',
  33232. '%A2': '\xa2', '%a3': '\xa3', '%A3': '\xa3', '%a4': '\xa4', '%A4': '\xa4',
  33233. '%a5': '\xa5', '%A5': '\xa5', '%a6': '\xa6', '%A6': '\xa6', '%a7': '\xa7',
  33234. '%A7': '\xa7', '%a8': '\xa8', '%A8': '\xa8', '%a9': '\xa9', '%A9': '\xa9',
  33235. '%aa': '\xaa', '%Aa': '\xaa', '%aA': '\xaa', '%AA': '\xaa', '%ab': '\xab',
  33236. '%Ab': '\xab', '%aB': '\xab', '%AB': '\xab', '%ac': '\xac', '%Ac': '\xac',
  33237. '%aC': '\xac', '%AC': '\xac', '%ad': '\xad', '%Ad': '\xad', '%aD': '\xad',
  33238. '%AD': '\xad', '%ae': '\xae', '%Ae': '\xae', '%aE': '\xae', '%AE': '\xae',
  33239. '%af': '\xaf', '%Af': '\xaf', '%aF': '\xaf', '%AF': '\xaf', '%b0': '\xb0',
  33240. '%B0': '\xb0', '%b1': '\xb1', '%B1': '\xb1', '%b2': '\xb2', '%B2': '\xb2',
  33241. '%b3': '\xb3', '%B3': '\xb3', '%b4': '\xb4', '%B4': '\xb4', '%b5': '\xb5',
  33242. '%B5': '\xb5', '%b6': '\xb6', '%B6': '\xb6', '%b7': '\xb7', '%B7': '\xb7',
  33243. '%b8': '\xb8', '%B8': '\xb8', '%b9': '\xb9', '%B9': '\xb9', '%ba': '\xba',
  33244. '%Ba': '\xba', '%bA': '\xba', '%BA': '\xba', '%bb': '\xbb', '%Bb': '\xbb',
  33245. '%bB': '\xbb', '%BB': '\xbb', '%bc': '\xbc', '%Bc': '\xbc', '%bC': '\xbc',
  33246. '%BC': '\xbc', '%bd': '\xbd', '%Bd': '\xbd', '%bD': '\xbd', '%BD': '\xbd',
  33247. '%be': '\xbe', '%Be': '\xbe', '%bE': '\xbe', '%BE': '\xbe', '%bf': '\xbf',
  33248. '%Bf': '\xbf', '%bF': '\xbf', '%BF': '\xbf', '%c0': '\xc0', '%C0': '\xc0',
  33249. '%c1': '\xc1', '%C1': '\xc1', '%c2': '\xc2', '%C2': '\xc2', '%c3': '\xc3',
  33250. '%C3': '\xc3', '%c4': '\xc4', '%C4': '\xc4', '%c5': '\xc5', '%C5': '\xc5',
  33251. '%c6': '\xc6', '%C6': '\xc6', '%c7': '\xc7', '%C7': '\xc7', '%c8': '\xc8',
  33252. '%C8': '\xc8', '%c9': '\xc9', '%C9': '\xc9', '%ca': '\xca', '%Ca': '\xca',
  33253. '%cA': '\xca', '%CA': '\xca', '%cb': '\xcb', '%Cb': '\xcb', '%cB': '\xcb',
  33254. '%CB': '\xcb', '%cc': '\xcc', '%Cc': '\xcc', '%cC': '\xcc', '%CC': '\xcc',
  33255. '%cd': '\xcd', '%Cd': '\xcd', '%cD': '\xcd', '%CD': '\xcd', '%ce': '\xce',
  33256. '%Ce': '\xce', '%cE': '\xce', '%CE': '\xce', '%cf': '\xcf', '%Cf': '\xcf',
  33257. '%cF': '\xcf', '%CF': '\xcf', '%d0': '\xd0', '%D0': '\xd0', '%d1': '\xd1',
  33258. '%D1': '\xd1', '%d2': '\xd2', '%D2': '\xd2', '%d3': '\xd3', '%D3': '\xd3',
  33259. '%d4': '\xd4', '%D4': '\xd4', '%d5': '\xd5', '%D5': '\xd5', '%d6': '\xd6',
  33260. '%D6': '\xd6', '%d7': '\xd7', '%D7': '\xd7', '%d8': '\xd8', '%D8': '\xd8',
  33261. '%d9': '\xd9', '%D9': '\xd9', '%da': '\xda', '%Da': '\xda', '%dA': '\xda',
  33262. '%DA': '\xda', '%db': '\xdb', '%Db': '\xdb', '%dB': '\xdb', '%DB': '\xdb',
  33263. '%dc': '\xdc', '%Dc': '\xdc', '%dC': '\xdc', '%DC': '\xdc', '%dd': '\xdd',
  33264. '%Dd': '\xdd', '%dD': '\xdd', '%DD': '\xdd', '%de': '\xde', '%De': '\xde',
  33265. '%dE': '\xde', '%DE': '\xde', '%df': '\xdf', '%Df': '\xdf', '%dF': '\xdf',
  33266. '%DF': '\xdf', '%e0': '\xe0', '%E0': '\xe0', '%e1': '\xe1', '%E1': '\xe1',
  33267. '%e2': '\xe2', '%E2': '\xe2', '%e3': '\xe3', '%E3': '\xe3', '%e4': '\xe4',
  33268. '%E4': '\xe4', '%e5': '\xe5', '%E5': '\xe5', '%e6': '\xe6', '%E6': '\xe6',
  33269. '%e7': '\xe7', '%E7': '\xe7', '%e8': '\xe8', '%E8': '\xe8', '%e9': '\xe9',
  33270. '%E9': '\xe9', '%ea': '\xea', '%Ea': '\xea', '%eA': '\xea', '%EA': '\xea',
  33271. '%eb': '\xeb', '%Eb': '\xeb', '%eB': '\xeb', '%EB': '\xeb', '%ec': '\xec',
  33272. '%Ec': '\xec', '%eC': '\xec', '%EC': '\xec', '%ed': '\xed', '%Ed': '\xed',
  33273. '%eD': '\xed', '%ED': '\xed', '%ee': '\xee', '%Ee': '\xee', '%eE': '\xee',
  33274. '%EE': '\xee', '%ef': '\xef', '%Ef': '\xef', '%eF': '\xef', '%EF': '\xef',
  33275. '%f0': '\xf0', '%F0': '\xf0', '%f1': '\xf1', '%F1': '\xf1', '%f2': '\xf2',
  33276. '%F2': '\xf2', '%f3': '\xf3', '%F3': '\xf3', '%f4': '\xf4', '%F4': '\xf4',
  33277. '%f5': '\xf5', '%F5': '\xf5', '%f6': '\xf6', '%F6': '\xf6', '%f7': '\xf7',
  33278. '%F7': '\xf7', '%f8': '\xf8', '%F8': '\xf8', '%f9': '\xf9', '%F9': '\xf9',
  33279. '%fa': '\xfa', '%Fa': '\xfa', '%fA': '\xfa', '%FA': '\xfa', '%fb': '\xfb',
  33280. '%Fb': '\xfb', '%fB': '\xfb', '%FB': '\xfb', '%fc': '\xfc', '%Fc': '\xfc',
  33281. '%fC': '\xfc', '%FC': '\xfc', '%fd': '\xfd', '%Fd': '\xfd', '%fD': '\xfd',
  33282. '%FD': '\xfd', '%fe': '\xfe', '%Fe': '\xfe', '%fE': '\xfe', '%FE': '\xfe',
  33283. '%ff': '\xff', '%Ff': '\xff', '%fF': '\xff', '%FF': '\xff'
  33284. }
  33285. function encodedReplacer (match) {
  33286. return EncodedLookup[match]
  33287. }
  33288. const STATE_KEY = 0
  33289. const STATE_VALUE = 1
  33290. const STATE_CHARSET = 2
  33291. const STATE_LANG = 3
  33292. function parseParams (str) {
  33293. const res = []
  33294. let state = STATE_KEY
  33295. let charset = ''
  33296. let inquote = false
  33297. let escaping = false
  33298. let p = 0
  33299. let tmp = ''
  33300. const len = str.length
  33301. for (var i = 0; i < len; ++i) { // eslint-disable-line no-var
  33302. const char = str[i]
  33303. if (char === '\\' && inquote) {
  33304. if (escaping) { escaping = false } else {
  33305. escaping = true
  33306. continue
  33307. }
  33308. } else if (char === '"') {
  33309. if (!escaping) {
  33310. if (inquote) {
  33311. inquote = false
  33312. state = STATE_KEY
  33313. } else { inquote = true }
  33314. continue
  33315. } else { escaping = false }
  33316. } else {
  33317. if (escaping && inquote) { tmp += '\\' }
  33318. escaping = false
  33319. if ((state === STATE_CHARSET || state === STATE_LANG) && char === "'") {
  33320. if (state === STATE_CHARSET) {
  33321. state = STATE_LANG
  33322. charset = tmp.substring(1)
  33323. } else { state = STATE_VALUE }
  33324. tmp = ''
  33325. continue
  33326. } else if (state === STATE_KEY &&
  33327. (char === '*' || char === '=') &&
  33328. res.length) {
  33329. state = char === '*'
  33330. ? STATE_CHARSET
  33331. : STATE_VALUE
  33332. res[p] = [tmp, undefined]
  33333. tmp = ''
  33334. continue
  33335. } else if (!inquote && char === ';') {
  33336. state = STATE_KEY
  33337. if (charset) {
  33338. if (tmp.length) {
  33339. tmp = decodeText(tmp.replace(RE_ENCODED, encodedReplacer),
  33340. 'binary',
  33341. charset)
  33342. }
  33343. charset = ''
  33344. } else if (tmp.length) {
  33345. tmp = decodeText(tmp, 'binary', 'utf8')
  33346. }
  33347. if (res[p] === undefined) { res[p] = tmp } else { res[p][1] = tmp }
  33348. tmp = ''
  33349. ++p
  33350. continue
  33351. } else if (!inquote && (char === ' ' || char === '\t')) { continue }
  33352. }
  33353. tmp += char
  33354. }
  33355. if (charset && tmp.length) {
  33356. tmp = decodeText(tmp.replace(RE_ENCODED, encodedReplacer),
  33357. 'binary',
  33358. charset)
  33359. } else if (tmp) {
  33360. tmp = decodeText(tmp, 'binary', 'utf8')
  33361. }
  33362. if (res[p] === undefined) {
  33363. if (tmp) { res[p] = tmp }
  33364. } else { res[p][1] = tmp }
  33365. return res
  33366. }
  33367. module.exports = parseParams
  33368. /***/ })
  33369. /******/ });
  33370. /************************************************************************/
  33371. /******/ // The module cache
  33372. /******/ var __webpack_module_cache__ = {};
  33373. /******/
  33374. /******/ // The require function
  33375. /******/ function __nccwpck_require__(moduleId) {
  33376. /******/ // Check if module is in cache
  33377. /******/ var cachedModule = __webpack_module_cache__[moduleId];
  33378. /******/ if (cachedModule !== undefined) {
  33379. /******/ return cachedModule.exports;
  33380. /******/ }
  33381. /******/ // Create a new module (and put it into the cache)
  33382. /******/ var module = __webpack_module_cache__[moduleId] = {
  33383. /******/ // no module.id needed
  33384. /******/ // no module.loaded needed
  33385. /******/ exports: {}
  33386. /******/ };
  33387. /******/
  33388. /******/ // Execute the module function
  33389. /******/ var threw = true;
  33390. /******/ try {
  33391. /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __nccwpck_require__);
  33392. /******/ threw = false;
  33393. /******/ } finally {
  33394. /******/ if(threw) delete __webpack_module_cache__[moduleId];
  33395. /******/ }
  33396. /******/
  33397. /******/ // Return the exports of the module
  33398. /******/ return module.exports;
  33399. /******/ }
  33400. /******/
  33401. /************************************************************************/
  33402. /******/ /* webpack/runtime/compat */
  33403. /******/
  33404. /******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/";
  33405. /******/
  33406. /************************************************************************/
  33407. /******/
  33408. /******/ // startup
  33409. /******/ // Load entry module and return exports
  33410. /******/ // This entry module is referenced by other modules so it can't be inlined
  33411. /******/ var __webpack_exports__ = __nccwpck_require__(3109);
  33412. /******/ module.exports = __webpack_exports__;
  33413. /******/
  33414. /******/ })()
  33415. ;