index.js 598 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290
  1. module.exports =
  2. /******/ (function(modules, runtime) { // webpackBootstrap
  3. /******/ "use strict";
  4. /******/ // The module cache
  5. /******/ var installedModules = {};
  6. /******/
  7. /******/ // The require function
  8. /******/ function __webpack_require__(moduleId) {
  9. /******/
  10. /******/ // Check if module is in cache
  11. /******/ if(installedModules[moduleId]) {
  12. /******/ return installedModules[moduleId].exports;
  13. /******/ }
  14. /******/ // Create a new module (and put it into the cache)
  15. /******/ var module = installedModules[moduleId] = {
  16. /******/ i: moduleId,
  17. /******/ l: false,
  18. /******/ exports: {}
  19. /******/ };
  20. /******/
  21. /******/ // Execute the module function
  22. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  23. /******/
  24. /******/ // Flag the module as loaded
  25. /******/ module.l = true;
  26. /******/
  27. /******/ // Return the exports of the module
  28. /******/ return module.exports;
  29. /******/ }
  30. /******/
  31. /******/
  32. /******/ __webpack_require__.ab = __dirname + "/";
  33. /******/
  34. /******/ // the startup function
  35. /******/ function startup() {
  36. /******/ // Load entry module and return exports
  37. /******/ return __webpack_require__(198);
  38. /******/ };
  39. /******/
  40. /******/ // run startup
  41. /******/ return startup();
  42. /******/ })
  43. /************************************************************************/
  44. /******/ ({
  45. /***/ 0:
  46. /***/ (function(module, __unusedexports, __webpack_require__) {
  47. const Octokit = __webpack_require__(529);
  48. const CORE_PLUGINS = [
  49. __webpack_require__(372),
  50. __webpack_require__(19), // deprecated: remove in v17
  51. __webpack_require__(190),
  52. __webpack_require__(148),
  53. __webpack_require__(248),
  54. __webpack_require__(586),
  55. __webpack_require__(430),
  56. __webpack_require__(850) // deprecated: remove in v17
  57. ];
  58. module.exports = Octokit.plugin(CORE_PLUGINS);
  59. /***/ }),
  60. /***/ 1:
  61. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  62. "use strict";
  63. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  64. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  65. return new (P || (P = Promise))(function (resolve, reject) {
  66. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  67. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  68. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  69. step((generator = generator.apply(thisArg, _arguments || [])).next());
  70. });
  71. };
  72. Object.defineProperty(exports, "__esModule", { value: true });
  73. const childProcess = __webpack_require__(129);
  74. const path = __webpack_require__(622);
  75. const util_1 = __webpack_require__(669);
  76. const ioUtil = __webpack_require__(672);
  77. const exec = util_1.promisify(childProcess.exec);
  78. /**
  79. * Copies a file or folder.
  80. * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js
  81. *
  82. * @param source source path
  83. * @param dest destination path
  84. * @param options optional. See CopyOptions.
  85. */
  86. function cp(source, dest, options = {}) {
  87. return __awaiter(this, void 0, void 0, function* () {
  88. const { force, recursive } = readCopyOptions(options);
  89. const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null;
  90. // Dest is an existing file, but not forcing
  91. if (destStat && destStat.isFile() && !force) {
  92. return;
  93. }
  94. // If dest is an existing directory, should copy inside.
  95. const newDest = destStat && destStat.isDirectory()
  96. ? path.join(dest, path.basename(source))
  97. : dest;
  98. if (!(yield ioUtil.exists(source))) {
  99. throw new Error(`no such file or directory: ${source}`);
  100. }
  101. const sourceStat = yield ioUtil.stat(source);
  102. if (sourceStat.isDirectory()) {
  103. if (!recursive) {
  104. throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`);
  105. }
  106. else {
  107. yield cpDirRecursive(source, newDest, 0, force);
  108. }
  109. }
  110. else {
  111. if (path.relative(source, newDest) === '') {
  112. // a file cannot be copied to itself
  113. throw new Error(`'${newDest}' and '${source}' are the same file`);
  114. }
  115. yield copyFile(source, newDest, force);
  116. }
  117. });
  118. }
  119. exports.cp = cp;
  120. /**
  121. * Moves a path.
  122. *
  123. * @param source source path
  124. * @param dest destination path
  125. * @param options optional. See MoveOptions.
  126. */
  127. function mv(source, dest, options = {}) {
  128. return __awaiter(this, void 0, void 0, function* () {
  129. if (yield ioUtil.exists(dest)) {
  130. let destExists = true;
  131. if (yield ioUtil.isDirectory(dest)) {
  132. // If dest is directory copy src into dest
  133. dest = path.join(dest, path.basename(source));
  134. destExists = yield ioUtil.exists(dest);
  135. }
  136. if (destExists) {
  137. if (options.force == null || options.force) {
  138. yield rmRF(dest);
  139. }
  140. else {
  141. throw new Error('Destination already exists');
  142. }
  143. }
  144. }
  145. yield mkdirP(path.dirname(dest));
  146. yield ioUtil.rename(source, dest);
  147. });
  148. }
  149. exports.mv = mv;
  150. /**
  151. * Remove a path recursively with force
  152. *
  153. * @param inputPath path to remove
  154. */
  155. function rmRF(inputPath) {
  156. return __awaiter(this, void 0, void 0, function* () {
  157. if (ioUtil.IS_WINDOWS) {
  158. // Node doesn't provide a delete operation, only an unlink function. This means that if the file is being used by another
  159. // program (e.g. antivirus), it won't be deleted. To address this, we shell out the work to rd/del.
  160. try {
  161. if (yield ioUtil.isDirectory(inputPath, true)) {
  162. yield exec(`rd /s /q "${inputPath}"`);
  163. }
  164. else {
  165. yield exec(`del /f /a "${inputPath}"`);
  166. }
  167. }
  168. catch (err) {
  169. // if you try to delete a file that doesn't exist, desired result is achieved
  170. // other errors are valid
  171. if (err.code !== 'ENOENT')
  172. throw err;
  173. }
  174. // Shelling out fails to remove a symlink folder with missing source, this unlink catches that
  175. try {
  176. yield ioUtil.unlink(inputPath);
  177. }
  178. catch (err) {
  179. // if you try to delete a file that doesn't exist, desired result is achieved
  180. // other errors are valid
  181. if (err.code !== 'ENOENT')
  182. throw err;
  183. }
  184. }
  185. else {
  186. let isDir = false;
  187. try {
  188. isDir = yield ioUtil.isDirectory(inputPath);
  189. }
  190. catch (err) {
  191. // if you try to delete a file that doesn't exist, desired result is achieved
  192. // other errors are valid
  193. if (err.code !== 'ENOENT')
  194. throw err;
  195. return;
  196. }
  197. if (isDir) {
  198. yield exec(`rm -rf "${inputPath}"`);
  199. }
  200. else {
  201. yield ioUtil.unlink(inputPath);
  202. }
  203. }
  204. });
  205. }
  206. exports.rmRF = rmRF;
  207. /**
  208. * Make a directory. Creates the full path with folders in between
  209. * Will throw if it fails
  210. *
  211. * @param fsPath path to create
  212. * @returns Promise<void>
  213. */
  214. function mkdirP(fsPath) {
  215. return __awaiter(this, void 0, void 0, function* () {
  216. yield ioUtil.mkdirP(fsPath);
  217. });
  218. }
  219. exports.mkdirP = mkdirP;
  220. /**
  221. * Returns path of a tool had the tool actually been invoked. Resolves via paths.
  222. * If you check and the tool does not exist, it will throw.
  223. *
  224. * @param tool name of the tool
  225. * @param check whether to check if tool exists
  226. * @returns Promise<string> path to tool
  227. */
  228. function which(tool, check) {
  229. return __awaiter(this, void 0, void 0, function* () {
  230. if (!tool) {
  231. throw new Error("parameter 'tool' is required");
  232. }
  233. // recursive when check=true
  234. if (check) {
  235. const result = yield which(tool, false);
  236. if (!result) {
  237. if (ioUtil.IS_WINDOWS) {
  238. 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.`);
  239. }
  240. else {
  241. 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.`);
  242. }
  243. }
  244. }
  245. try {
  246. // build the list of extensions to try
  247. const extensions = [];
  248. if (ioUtil.IS_WINDOWS && process.env.PATHEXT) {
  249. for (const extension of process.env.PATHEXT.split(path.delimiter)) {
  250. if (extension) {
  251. extensions.push(extension);
  252. }
  253. }
  254. }
  255. // if it's rooted, return it if exists. otherwise return empty.
  256. if (ioUtil.isRooted(tool)) {
  257. const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions);
  258. if (filePath) {
  259. return filePath;
  260. }
  261. return '';
  262. }
  263. // if any path separators, return empty
  264. if (tool.includes('/') || (ioUtil.IS_WINDOWS && tool.includes('\\'))) {
  265. return '';
  266. }
  267. // build the list of directories
  268. //
  269. // Note, technically "where" checks the current directory on Windows. From a toolkit perspective,
  270. // it feels like we should not do this. Checking the current directory seems like more of a use
  271. // case of a shell, and the which() function exposed by the toolkit should strive for consistency
  272. // across platforms.
  273. const directories = [];
  274. if (process.env.PATH) {
  275. for (const p of process.env.PATH.split(path.delimiter)) {
  276. if (p) {
  277. directories.push(p);
  278. }
  279. }
  280. }
  281. // return the first match
  282. for (const directory of directories) {
  283. const filePath = yield ioUtil.tryGetExecutablePath(directory + path.sep + tool, extensions);
  284. if (filePath) {
  285. return filePath;
  286. }
  287. }
  288. return '';
  289. }
  290. catch (err) {
  291. throw new Error(`which failed with message ${err.message}`);
  292. }
  293. });
  294. }
  295. exports.which = which;
  296. function readCopyOptions(options) {
  297. const force = options.force == null ? true : options.force;
  298. const recursive = Boolean(options.recursive);
  299. return { force, recursive };
  300. }
  301. function cpDirRecursive(sourceDir, destDir, currentDepth, force) {
  302. return __awaiter(this, void 0, void 0, function* () {
  303. // Ensure there is not a run away recursive copy
  304. if (currentDepth >= 255)
  305. return;
  306. currentDepth++;
  307. yield mkdirP(destDir);
  308. const files = yield ioUtil.readdir(sourceDir);
  309. for (const fileName of files) {
  310. const srcFile = `${sourceDir}/${fileName}`;
  311. const destFile = `${destDir}/${fileName}`;
  312. const srcFileStat = yield ioUtil.lstat(srcFile);
  313. if (srcFileStat.isDirectory()) {
  314. // Recurse
  315. yield cpDirRecursive(srcFile, destFile, currentDepth, force);
  316. }
  317. else {
  318. yield copyFile(srcFile, destFile, force);
  319. }
  320. }
  321. // Change the mode for the newly created directory
  322. yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode);
  323. });
  324. }
  325. // Buffered file copy
  326. function copyFile(srcFile, destFile, force) {
  327. return __awaiter(this, void 0, void 0, function* () {
  328. if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) {
  329. // unlink/re-link it
  330. try {
  331. yield ioUtil.lstat(destFile);
  332. yield ioUtil.unlink(destFile);
  333. }
  334. catch (e) {
  335. // Try to override file permission
  336. if (e.code === 'EPERM') {
  337. yield ioUtil.chmod(destFile, '0666');
  338. yield ioUtil.unlink(destFile);
  339. }
  340. // other errors = it doesn't exist, no work to do
  341. }
  342. // Copy over symlink
  343. const symlinkFull = yield ioUtil.readlink(srcFile);
  344. yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null);
  345. }
  346. else if (!(yield ioUtil.exists(destFile)) || force) {
  347. yield ioUtil.copyFile(srcFile, destFile);
  348. }
  349. });
  350. }
  351. //# sourceMappingURL=io.js.map
  352. /***/ }),
  353. /***/ 2:
  354. /***/ (function(module, __unusedexports, __webpack_require__) {
  355. "use strict";
  356. const os = __webpack_require__(87);
  357. const macosRelease = __webpack_require__(118);
  358. const winRelease = __webpack_require__(49);
  359. const osName = (platform, release) => {
  360. if (!platform && release) {
  361. throw new Error('You can\'t specify a `release` without specifying `platform`');
  362. }
  363. platform = platform || os.platform();
  364. let id;
  365. if (platform === 'darwin') {
  366. if (!release && os.platform() === 'darwin') {
  367. release = os.release();
  368. }
  369. const prefix = release ? (Number(release.split('.')[0]) > 15 ? 'macOS' : 'OS X') : 'macOS';
  370. id = release ? macosRelease(release).name : '';
  371. return prefix + (id ? ' ' + id : '');
  372. }
  373. if (platform === 'linux') {
  374. if (!release && os.platform() === 'linux') {
  375. release = os.release();
  376. }
  377. id = release ? release.replace(/^(\d+\.\d+).*/, '$1') : '';
  378. return 'Linux' + (id ? ' ' + id : '');
  379. }
  380. if (platform === 'win32') {
  381. if (!release && os.platform() === 'win32') {
  382. release = os.release();
  383. }
  384. id = release ? winRelease(release) : '';
  385. return 'Windows' + (id ? ' ' + id : '');
  386. }
  387. return platform;
  388. };
  389. module.exports = osName;
  390. /***/ }),
  391. /***/ 8:
  392. /***/ (function(module, __unusedexports, __webpack_require__) {
  393. module.exports = iterator;
  394. const normalizePaginatedListResponse = __webpack_require__(301);
  395. function iterator(octokit, options) {
  396. const headers = options.headers;
  397. let url = octokit.request.endpoint(options).url;
  398. return {
  399. [Symbol.asyncIterator]: () => ({
  400. next() {
  401. if (!url) {
  402. return Promise.resolve({ done: true });
  403. }
  404. return octokit
  405. .request({ url, headers })
  406. .then(response => {
  407. normalizePaginatedListResponse(octokit, url, response);
  408. // `response.headers.link` format:
  409. // '<https://api.github.com/users/aseemk/followers?page=2>; rel="next", <https://api.github.com/users/aseemk/followers?page=2>; rel="last"'
  410. // sets `url` to undefined if "next" URL is not present or `link` header is not set
  411. url = ((response.headers.link || "").match(
  412. /<([^>]+)>;\s*rel="next"/
  413. ) || [])[1];
  414. return { value: response };
  415. });
  416. }
  417. })
  418. };
  419. }
  420. /***/ }),
  421. /***/ 9:
  422. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  423. "use strict";
  424. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  425. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  426. return new (P || (P = Promise))(function (resolve, reject) {
  427. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  428. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  429. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  430. step((generator = generator.apply(thisArg, _arguments || [])).next());
  431. });
  432. };
  433. Object.defineProperty(exports, "__esModule", { value: true });
  434. const os = __webpack_require__(87);
  435. const events = __webpack_require__(614);
  436. const child = __webpack_require__(129);
  437. /* eslint-disable @typescript-eslint/unbound-method */
  438. const IS_WINDOWS = process.platform === 'win32';
  439. /*
  440. * Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way.
  441. */
  442. class ToolRunner extends events.EventEmitter {
  443. constructor(toolPath, args, options) {
  444. super();
  445. if (!toolPath) {
  446. throw new Error("Parameter 'toolPath' cannot be null or empty.");
  447. }
  448. this.toolPath = toolPath;
  449. this.args = args || [];
  450. this.options = options || {};
  451. }
  452. _debug(message) {
  453. if (this.options.listeners && this.options.listeners.debug) {
  454. this.options.listeners.debug(message);
  455. }
  456. }
  457. _getCommandString(options, noPrefix) {
  458. const toolPath = this._getSpawnFileName();
  459. const args = this._getSpawnArgs(options);
  460. let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool
  461. if (IS_WINDOWS) {
  462. // Windows + cmd file
  463. if (this._isCmdFile()) {
  464. cmd += toolPath;
  465. for (const a of args) {
  466. cmd += ` ${a}`;
  467. }
  468. }
  469. // Windows + verbatim
  470. else if (options.windowsVerbatimArguments) {
  471. cmd += `"${toolPath}"`;
  472. for (const a of args) {
  473. cmd += ` ${a}`;
  474. }
  475. }
  476. // Windows (regular)
  477. else {
  478. cmd += this._windowsQuoteCmdArg(toolPath);
  479. for (const a of args) {
  480. cmd += ` ${this._windowsQuoteCmdArg(a)}`;
  481. }
  482. }
  483. }
  484. else {
  485. // OSX/Linux - this can likely be improved with some form of quoting.
  486. // creating processes on Unix is fundamentally different than Windows.
  487. // on Unix, execvp() takes an arg array.
  488. cmd += toolPath;
  489. for (const a of args) {
  490. cmd += ` ${a}`;
  491. }
  492. }
  493. return cmd;
  494. }
  495. _processLineBuffer(data, strBuffer, onLine) {
  496. try {
  497. let s = strBuffer + data.toString();
  498. let n = s.indexOf(os.EOL);
  499. while (n > -1) {
  500. const line = s.substring(0, n);
  501. onLine(line);
  502. // the rest of the string ...
  503. s = s.substring(n + os.EOL.length);
  504. n = s.indexOf(os.EOL);
  505. }
  506. strBuffer = s;
  507. }
  508. catch (err) {
  509. // streaming lines to console is best effort. Don't fail a build.
  510. this._debug(`error processing line. Failed with error ${err}`);
  511. }
  512. }
  513. _getSpawnFileName() {
  514. if (IS_WINDOWS) {
  515. if (this._isCmdFile()) {
  516. return process.env['COMSPEC'] || 'cmd.exe';
  517. }
  518. }
  519. return this.toolPath;
  520. }
  521. _getSpawnArgs(options) {
  522. if (IS_WINDOWS) {
  523. if (this._isCmdFile()) {
  524. let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`;
  525. for (const a of this.args) {
  526. argline += ' ';
  527. argline += options.windowsVerbatimArguments
  528. ? a
  529. : this._windowsQuoteCmdArg(a);
  530. }
  531. argline += '"';
  532. return [argline];
  533. }
  534. }
  535. return this.args;
  536. }
  537. _endsWith(str, end) {
  538. return str.endsWith(end);
  539. }
  540. _isCmdFile() {
  541. const upperToolPath = this.toolPath.toUpperCase();
  542. return (this._endsWith(upperToolPath, '.CMD') ||
  543. this._endsWith(upperToolPath, '.BAT'));
  544. }
  545. _windowsQuoteCmdArg(arg) {
  546. // for .exe, apply the normal quoting rules that libuv applies
  547. if (!this._isCmdFile()) {
  548. return this._uvQuoteCmdArg(arg);
  549. }
  550. // otherwise apply quoting rules specific to the cmd.exe command line parser.
  551. // the libuv rules are generic and are not designed specifically for cmd.exe
  552. // command line parser.
  553. //
  554. // for a detailed description of the cmd.exe command line parser, refer to
  555. // http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912
  556. // need quotes for empty arg
  557. if (!arg) {
  558. return '""';
  559. }
  560. // determine whether the arg needs to be quoted
  561. const cmdSpecialChars = [
  562. ' ',
  563. '\t',
  564. '&',
  565. '(',
  566. ')',
  567. '[',
  568. ']',
  569. '{',
  570. '}',
  571. '^',
  572. '=',
  573. ';',
  574. '!',
  575. "'",
  576. '+',
  577. ',',
  578. '`',
  579. '~',
  580. '|',
  581. '<',
  582. '>',
  583. '"'
  584. ];
  585. let needsQuotes = false;
  586. for (const char of arg) {
  587. if (cmdSpecialChars.some(x => x === char)) {
  588. needsQuotes = true;
  589. break;
  590. }
  591. }
  592. // short-circuit if quotes not needed
  593. if (!needsQuotes) {
  594. return arg;
  595. }
  596. // the following quoting rules are very similar to the rules that by libuv applies.
  597. //
  598. // 1) wrap the string in quotes
  599. //
  600. // 2) double-up quotes - i.e. " => ""
  601. //
  602. // this is different from the libuv quoting rules. libuv replaces " with \", which unfortunately
  603. // doesn't work well with a cmd.exe command line.
  604. //
  605. // note, replacing " with "" also works well if the arg is passed to a downstream .NET console app.
  606. // for example, the command line:
  607. // foo.exe "myarg:""my val"""
  608. // is parsed by a .NET console app into an arg array:
  609. // [ "myarg:\"my val\"" ]
  610. // which is the same end result when applying libuv quoting rules. although the actual
  611. // command line from libuv quoting rules would look like:
  612. // foo.exe "myarg:\"my val\""
  613. //
  614. // 3) double-up slashes that precede a quote,
  615. // e.g. hello \world => "hello \world"
  616. // hello\"world => "hello\\""world"
  617. // hello\\"world => "hello\\\\""world"
  618. // hello world\ => "hello world\\"
  619. //
  620. // technically this is not required for a cmd.exe command line, or the batch argument parser.
  621. // the reasons for including this as a .cmd quoting rule are:
  622. //
  623. // a) this is optimized for the scenario where the argument is passed from the .cmd file to an
  624. // external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule.
  625. //
  626. // b) it's what we've been doing previously (by deferring to node default behavior) and we
  627. // haven't heard any complaints about that aspect.
  628. //
  629. // note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be
  630. // escaped when used on the command line directly - even though within a .cmd file % can be escaped
  631. // by using %%.
  632. //
  633. // the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts
  634. // the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing.
  635. //
  636. // one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would
  637. // often work, since it is unlikely that var^ would exist, and the ^ character is removed when the
  638. // variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args
  639. // to an external program.
  640. //
  641. // an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file.
  642. // % can be escaped within a .cmd file.
  643. let reverse = '"';
  644. let quoteHit = true;
  645. for (let i = arg.length; i > 0; i--) {
  646. // walk the string in reverse
  647. reverse += arg[i - 1];
  648. if (quoteHit && arg[i - 1] === '\\') {
  649. reverse += '\\'; // double the slash
  650. }
  651. else if (arg[i - 1] === '"') {
  652. quoteHit = true;
  653. reverse += '"'; // double the quote
  654. }
  655. else {
  656. quoteHit = false;
  657. }
  658. }
  659. reverse += '"';
  660. return reverse
  661. .split('')
  662. .reverse()
  663. .join('');
  664. }
  665. _uvQuoteCmdArg(arg) {
  666. // Tool runner wraps child_process.spawn() and needs to apply the same quoting as
  667. // Node in certain cases where the undocumented spawn option windowsVerbatimArguments
  668. // is used.
  669. //
  670. // Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV,
  671. // see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details),
  672. // pasting copyright notice from Node within this function:
  673. //
  674. // Copyright Joyent, Inc. and other Node contributors. All rights reserved.
  675. //
  676. // Permission is hereby granted, free of charge, to any person obtaining a copy
  677. // of this software and associated documentation files (the "Software"), to
  678. // deal in the Software without restriction, including without limitation the
  679. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  680. // sell copies of the Software, and to permit persons to whom the Software is
  681. // furnished to do so, subject to the following conditions:
  682. //
  683. // The above copyright notice and this permission notice shall be included in
  684. // all copies or substantial portions of the Software.
  685. //
  686. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  687. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  688. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  689. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  690. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  691. // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  692. // IN THE SOFTWARE.
  693. if (!arg) {
  694. // Need double quotation for empty argument
  695. return '""';
  696. }
  697. if (!arg.includes(' ') && !arg.includes('\t') && !arg.includes('"')) {
  698. // No quotation needed
  699. return arg;
  700. }
  701. if (!arg.includes('"') && !arg.includes('\\')) {
  702. // No embedded double quotes or backslashes, so I can just wrap
  703. // quote marks around the whole thing.
  704. return `"${arg}"`;
  705. }
  706. // Expected input/output:
  707. // input : hello"world
  708. // output: "hello\"world"
  709. // input : hello""world
  710. // output: "hello\"\"world"
  711. // input : hello\world
  712. // output: hello\world
  713. // input : hello\\world
  714. // output: hello\\world
  715. // input : hello\"world
  716. // output: "hello\\\"world"
  717. // input : hello\\"world
  718. // output: "hello\\\\\"world"
  719. // input : hello world\
  720. // output: "hello world\\" - note the comment in libuv actually reads "hello world\"
  721. // but it appears the comment is wrong, it should be "hello world\\"
  722. let reverse = '"';
  723. let quoteHit = true;
  724. for (let i = arg.length; i > 0; i--) {
  725. // walk the string in reverse
  726. reverse += arg[i - 1];
  727. if (quoteHit && arg[i - 1] === '\\') {
  728. reverse += '\\';
  729. }
  730. else if (arg[i - 1] === '"') {
  731. quoteHit = true;
  732. reverse += '\\';
  733. }
  734. else {
  735. quoteHit = false;
  736. }
  737. }
  738. reverse += '"';
  739. return reverse
  740. .split('')
  741. .reverse()
  742. .join('');
  743. }
  744. _cloneExecOptions(options) {
  745. options = options || {};
  746. const result = {
  747. cwd: options.cwd || process.cwd(),
  748. env: options.env || process.env,
  749. silent: options.silent || false,
  750. windowsVerbatimArguments: options.windowsVerbatimArguments || false,
  751. failOnStdErr: options.failOnStdErr || false,
  752. ignoreReturnCode: options.ignoreReturnCode || false,
  753. delay: options.delay || 10000
  754. };
  755. result.outStream = options.outStream || process.stdout;
  756. result.errStream = options.errStream || process.stderr;
  757. return result;
  758. }
  759. _getSpawnOptions(options, toolPath) {
  760. options = options || {};
  761. const result = {};
  762. result.cwd = options.cwd;
  763. result.env = options.env;
  764. result['windowsVerbatimArguments'] =
  765. options.windowsVerbatimArguments || this._isCmdFile();
  766. if (options.windowsVerbatimArguments) {
  767. result.argv0 = `"${toolPath}"`;
  768. }
  769. return result;
  770. }
  771. /**
  772. * Exec a tool.
  773. * Output will be streamed to the live console.
  774. * Returns promise with return code
  775. *
  776. * @param tool path to tool to exec
  777. * @param options optional exec options. See ExecOptions
  778. * @returns number
  779. */
  780. exec() {
  781. return __awaiter(this, void 0, void 0, function* () {
  782. return new Promise((resolve, reject) => {
  783. this._debug(`exec tool: ${this.toolPath}`);
  784. this._debug('arguments:');
  785. for (const arg of this.args) {
  786. this._debug(` ${arg}`);
  787. }
  788. const optionsNonNull = this._cloneExecOptions(this.options);
  789. if (!optionsNonNull.silent && optionsNonNull.outStream) {
  790. optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL);
  791. }
  792. const state = new ExecState(optionsNonNull, this.toolPath);
  793. state.on('debug', (message) => {
  794. this._debug(message);
  795. });
  796. const fileName = this._getSpawnFileName();
  797. const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName));
  798. const stdbuffer = '';
  799. if (cp.stdout) {
  800. cp.stdout.on('data', (data) => {
  801. if (this.options.listeners && this.options.listeners.stdout) {
  802. this.options.listeners.stdout(data);
  803. }
  804. if (!optionsNonNull.silent && optionsNonNull.outStream) {
  805. optionsNonNull.outStream.write(data);
  806. }
  807. this._processLineBuffer(data, stdbuffer, (line) => {
  808. if (this.options.listeners && this.options.listeners.stdline) {
  809. this.options.listeners.stdline(line);
  810. }
  811. });
  812. });
  813. }
  814. const errbuffer = '';
  815. if (cp.stderr) {
  816. cp.stderr.on('data', (data) => {
  817. state.processStderr = true;
  818. if (this.options.listeners && this.options.listeners.stderr) {
  819. this.options.listeners.stderr(data);
  820. }
  821. if (!optionsNonNull.silent &&
  822. optionsNonNull.errStream &&
  823. optionsNonNull.outStream) {
  824. const s = optionsNonNull.failOnStdErr
  825. ? optionsNonNull.errStream
  826. : optionsNonNull.outStream;
  827. s.write(data);
  828. }
  829. this._processLineBuffer(data, errbuffer, (line) => {
  830. if (this.options.listeners && this.options.listeners.errline) {
  831. this.options.listeners.errline(line);
  832. }
  833. });
  834. });
  835. }
  836. cp.on('error', (err) => {
  837. state.processError = err.message;
  838. state.processExited = true;
  839. state.processClosed = true;
  840. state.CheckComplete();
  841. });
  842. cp.on('exit', (code) => {
  843. state.processExitCode = code;
  844. state.processExited = true;
  845. this._debug(`Exit code ${code} received from tool '${this.toolPath}'`);
  846. state.CheckComplete();
  847. });
  848. cp.on('close', (code) => {
  849. state.processExitCode = code;
  850. state.processExited = true;
  851. state.processClosed = true;
  852. this._debug(`STDIO streams have closed for tool '${this.toolPath}'`);
  853. state.CheckComplete();
  854. });
  855. state.on('done', (error, exitCode) => {
  856. if (stdbuffer.length > 0) {
  857. this.emit('stdline', stdbuffer);
  858. }
  859. if (errbuffer.length > 0) {
  860. this.emit('errline', errbuffer);
  861. }
  862. cp.removeAllListeners();
  863. if (error) {
  864. reject(error);
  865. }
  866. else {
  867. resolve(exitCode);
  868. }
  869. });
  870. });
  871. });
  872. }
  873. }
  874. exports.ToolRunner = ToolRunner;
  875. /**
  876. * Convert an arg string to an array of args. Handles escaping
  877. *
  878. * @param argString string of arguments
  879. * @returns string[] array of arguments
  880. */
  881. function argStringToArray(argString) {
  882. const args = [];
  883. let inQuotes = false;
  884. let escaped = false;
  885. let arg = '';
  886. function append(c) {
  887. // we only escape double quotes.
  888. if (escaped && c !== '"') {
  889. arg += '\\';
  890. }
  891. arg += c;
  892. escaped = false;
  893. }
  894. for (let i = 0; i < argString.length; i++) {
  895. const c = argString.charAt(i);
  896. if (c === '"') {
  897. if (!escaped) {
  898. inQuotes = !inQuotes;
  899. }
  900. else {
  901. append(c);
  902. }
  903. continue;
  904. }
  905. if (c === '\\' && escaped) {
  906. append(c);
  907. continue;
  908. }
  909. if (c === '\\' && inQuotes) {
  910. escaped = true;
  911. continue;
  912. }
  913. if (c === ' ' && !inQuotes) {
  914. if (arg.length > 0) {
  915. args.push(arg);
  916. arg = '';
  917. }
  918. continue;
  919. }
  920. append(c);
  921. }
  922. if (arg.length > 0) {
  923. args.push(arg.trim());
  924. }
  925. return args;
  926. }
  927. exports.argStringToArray = argStringToArray;
  928. class ExecState extends events.EventEmitter {
  929. constructor(options, toolPath) {
  930. super();
  931. this.processClosed = false; // tracks whether the process has exited and stdio is closed
  932. this.processError = '';
  933. this.processExitCode = 0;
  934. this.processExited = false; // tracks whether the process has exited
  935. this.processStderr = false; // tracks whether stderr was written to
  936. this.delay = 10000; // 10 seconds
  937. this.done = false;
  938. this.timeout = null;
  939. if (!toolPath) {
  940. throw new Error('toolPath must not be empty');
  941. }
  942. this.options = options;
  943. this.toolPath = toolPath;
  944. if (options.delay) {
  945. this.delay = options.delay;
  946. }
  947. }
  948. CheckComplete() {
  949. if (this.done) {
  950. return;
  951. }
  952. if (this.processClosed) {
  953. this._setResult();
  954. }
  955. else if (this.processExited) {
  956. this.timeout = setTimeout(ExecState.HandleTimeout, this.delay, this);
  957. }
  958. }
  959. _debug(message) {
  960. this.emit('debug', message);
  961. }
  962. _setResult() {
  963. // determine whether there is an error
  964. let error;
  965. if (this.processExited) {
  966. if (this.processError) {
  967. 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}`);
  968. }
  969. else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) {
  970. error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`);
  971. }
  972. else if (this.processStderr && this.options.failOnStdErr) {
  973. error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`);
  974. }
  975. }
  976. // clear the timeout
  977. if (this.timeout) {
  978. clearTimeout(this.timeout);
  979. this.timeout = null;
  980. }
  981. this.done = true;
  982. this.emit('done', error, this.processExitCode);
  983. }
  984. static HandleTimeout(state) {
  985. if (state.done) {
  986. return;
  987. }
  988. if (!state.processClosed && state.processExited) {
  989. const message = `The STDIO streams did not close within ${state.delay /
  990. 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.`;
  991. state._debug(message);
  992. }
  993. state._setResult();
  994. }
  995. }
  996. //# sourceMappingURL=toolrunner.js.map
  997. /***/ }),
  998. /***/ 11:
  999. /***/ (function(module) {
  1000. // Returns a wrapper function that returns a wrapped callback
  1001. // The wrapper function should do some stuff, and return a
  1002. // presumably different callback function.
  1003. // This makes sure that own properties are retained, so that
  1004. // decorations and such are not lost along the way.
  1005. module.exports = wrappy
  1006. function wrappy (fn, cb) {
  1007. if (fn && cb) return wrappy(fn)(cb)
  1008. if (typeof fn !== 'function')
  1009. throw new TypeError('need wrapper function')
  1010. Object.keys(fn).forEach(function (k) {
  1011. wrapper[k] = fn[k]
  1012. })
  1013. return wrapper
  1014. function wrapper() {
  1015. var args = new Array(arguments.length)
  1016. for (var i = 0; i < args.length; i++) {
  1017. args[i] = arguments[i]
  1018. }
  1019. var ret = fn.apply(this, args)
  1020. var cb = args[args.length-1]
  1021. if (typeof ret === 'function' && ret !== cb) {
  1022. Object.keys(cb).forEach(function (k) {
  1023. ret[k] = cb[k]
  1024. })
  1025. }
  1026. return ret
  1027. }
  1028. }
  1029. /***/ }),
  1030. /***/ 16:
  1031. /***/ (function(module) {
  1032. module.exports = require("tls");
  1033. /***/ }),
  1034. /***/ 18:
  1035. /***/ (function() {
  1036. eval("require")("encoding");
  1037. /***/ }),
  1038. /***/ 19:
  1039. /***/ (function(module, __unusedexports, __webpack_require__) {
  1040. module.exports = authenticationPlugin;
  1041. const { Deprecation } = __webpack_require__(692);
  1042. const once = __webpack_require__(969);
  1043. const deprecateAuthenticate = once((log, deprecation) => log.warn(deprecation));
  1044. const authenticate = __webpack_require__(674);
  1045. const beforeRequest = __webpack_require__(471);
  1046. const requestError = __webpack_require__(349);
  1047. function authenticationPlugin(octokit, options) {
  1048. if (options.auth) {
  1049. octokit.authenticate = () => {
  1050. deprecateAuthenticate(
  1051. octokit.log,
  1052. new Deprecation(
  1053. '[@octokit/rest] octokit.authenticate() is deprecated and has no effect when "auth" option is set on Octokit constructor'
  1054. )
  1055. );
  1056. };
  1057. return;
  1058. }
  1059. const state = {
  1060. octokit,
  1061. auth: false
  1062. };
  1063. octokit.authenticate = authenticate.bind(null, state);
  1064. octokit.hook.before("request", beforeRequest.bind(null, state));
  1065. octokit.hook.error("request", requestError.bind(null, state));
  1066. }
  1067. /***/ }),
  1068. /***/ 20:
  1069. /***/ (function(module, __unusedexports, __webpack_require__) {
  1070. "use strict";
  1071. const cp = __webpack_require__(129);
  1072. const parse = __webpack_require__(568);
  1073. const enoent = __webpack_require__(881);
  1074. function spawn(command, args, options) {
  1075. // Parse the arguments
  1076. const parsed = parse(command, args, options);
  1077. // Spawn the child process
  1078. const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
  1079. // Hook into child process "exit" event to emit an error if the command
  1080. // does not exists, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16
  1081. enoent.hookChildProcess(spawned, parsed);
  1082. return spawned;
  1083. }
  1084. function spawnSync(command, args, options) {
  1085. // Parse the arguments
  1086. const parsed = parse(command, args, options);
  1087. // Spawn the child process
  1088. const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
  1089. // Analyze if the command does not exist, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16
  1090. result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
  1091. return result;
  1092. }
  1093. module.exports = spawn;
  1094. module.exports.spawn = spawn;
  1095. module.exports.sync = spawnSync;
  1096. module.exports._parse = parse;
  1097. module.exports._enoent = enoent;
  1098. /***/ }),
  1099. /***/ 39:
  1100. /***/ (function(module) {
  1101. "use strict";
  1102. module.exports = opts => {
  1103. opts = opts || {};
  1104. const env = opts.env || process.env;
  1105. const platform = opts.platform || process.platform;
  1106. if (platform !== 'win32') {
  1107. return 'PATH';
  1108. }
  1109. return Object.keys(env).find(x => x.toUpperCase() === 'PATH') || 'Path';
  1110. };
  1111. /***/ }),
  1112. /***/ 47:
  1113. /***/ (function(module, __unusedexports, __webpack_require__) {
  1114. module.exports = factory;
  1115. const Octokit = __webpack_require__(402);
  1116. const registerPlugin = __webpack_require__(855);
  1117. function factory(plugins) {
  1118. const Api = Octokit.bind(null, plugins || []);
  1119. Api.plugin = registerPlugin.bind(null, plugins || []);
  1120. return Api;
  1121. }
  1122. /***/ }),
  1123. /***/ 49:
  1124. /***/ (function(module, __unusedexports, __webpack_require__) {
  1125. "use strict";
  1126. const os = __webpack_require__(87);
  1127. const execa = __webpack_require__(955);
  1128. // Reference: https://www.gaijin.at/en/lstwinver.php
  1129. const names = new Map([
  1130. ['10.0', '10'],
  1131. ['6.3', '8.1'],
  1132. ['6.2', '8'],
  1133. ['6.1', '7'],
  1134. ['6.0', 'Vista'],
  1135. ['5.2', 'Server 2003'],
  1136. ['5.1', 'XP'],
  1137. ['5.0', '2000'],
  1138. ['4.9', 'ME'],
  1139. ['4.1', '98'],
  1140. ['4.0', '95']
  1141. ]);
  1142. const windowsRelease = release => {
  1143. const version = /\d+\.\d/.exec(release || os.release());
  1144. if (release && !version) {
  1145. throw new Error('`release` argument doesn\'t match `n.n`');
  1146. }
  1147. const ver = (version || [])[0];
  1148. // Server 2008, 2012 and 2016 versions are ambiguous with desktop versions and must be detected at runtime.
  1149. // If `release` is omitted or we're on a Windows system, and the version number is an ambiguous version
  1150. // then use `wmic` to get the OS caption: https://msdn.microsoft.com/en-us/library/aa394531(v=vs.85).aspx
  1151. // If the resulting caption contains the year 2008, 2012 or 2016, it is a server version, so return a server OS name.
  1152. if ((!release || release === os.release()) && ['6.1', '6.2', '6.3', '10.0'].includes(ver)) {
  1153. const stdout = execa.sync('wmic', ['os', 'get', 'Caption']).stdout || '';
  1154. const year = (stdout.match(/2008|2012|2016/) || [])[0];
  1155. if (year) {
  1156. return `Server ${year}`;
  1157. }
  1158. }
  1159. return names.get(ver);
  1160. };
  1161. module.exports = windowsRelease;
  1162. /***/ }),
  1163. /***/ 87:
  1164. /***/ (function(module) {
  1165. module.exports = require("os");
  1166. /***/ }),
  1167. /***/ 118:
  1168. /***/ (function(module, __unusedexports, __webpack_require__) {
  1169. "use strict";
  1170. const os = __webpack_require__(87);
  1171. const nameMap = new Map([
  1172. [19, 'Catalina'],
  1173. [18, 'Mojave'],
  1174. [17, 'High Sierra'],
  1175. [16, 'Sierra'],
  1176. [15, 'El Capitan'],
  1177. [14, 'Yosemite'],
  1178. [13, 'Mavericks'],
  1179. [12, 'Mountain Lion'],
  1180. [11, 'Lion'],
  1181. [10, 'Snow Leopard'],
  1182. [9, 'Leopard'],
  1183. [8, 'Tiger'],
  1184. [7, 'Panther'],
  1185. [6, 'Jaguar'],
  1186. [5, 'Puma']
  1187. ]);
  1188. const macosRelease = release => {
  1189. release = Number((release || os.release()).split('.')[0]);
  1190. return {
  1191. name: nameMap.get(release),
  1192. version: '10.' + (release - 4)
  1193. };
  1194. };
  1195. module.exports = macosRelease;
  1196. // TODO: remove this in the next major version
  1197. module.exports.default = macosRelease;
  1198. /***/ }),
  1199. /***/ 126:
  1200. /***/ (function(module) {
  1201. /**
  1202. * lodash (Custom Build) <https://lodash.com/>
  1203. * Build: `lodash modularize exports="npm" -o ./`
  1204. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  1205. * Released under MIT license <https://lodash.com/license>
  1206. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1207. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1208. */
  1209. /** Used as the size to enable large array optimizations. */
  1210. var LARGE_ARRAY_SIZE = 200;
  1211. /** Used to stand-in for `undefined` hash values. */
  1212. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1213. /** Used as references for various `Number` constants. */
  1214. var INFINITY = 1 / 0;
  1215. /** `Object#toString` result references. */
  1216. var funcTag = '[object Function]',
  1217. genTag = '[object GeneratorFunction]';
  1218. /**
  1219. * Used to match `RegExp`
  1220. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1221. */
  1222. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  1223. /** Used to detect host constructors (Safari). */
  1224. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1225. /** Detect free variable `global` from Node.js. */
  1226. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  1227. /** Detect free variable `self`. */
  1228. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1229. /** Used as a reference to the global object. */
  1230. var root = freeGlobal || freeSelf || Function('return this')();
  1231. /**
  1232. * A specialized version of `_.includes` for arrays without support for
  1233. * specifying an index to search from.
  1234. *
  1235. * @private
  1236. * @param {Array} [array] The array to inspect.
  1237. * @param {*} target The value to search for.
  1238. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1239. */
  1240. function arrayIncludes(array, value) {
  1241. var length = array ? array.length : 0;
  1242. return !!length && baseIndexOf(array, value, 0) > -1;
  1243. }
  1244. /**
  1245. * This function is like `arrayIncludes` except that it accepts a comparator.
  1246. *
  1247. * @private
  1248. * @param {Array} [array] The array to inspect.
  1249. * @param {*} target The value to search for.
  1250. * @param {Function} comparator The comparator invoked per element.
  1251. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1252. */
  1253. function arrayIncludesWith(array, value, comparator) {
  1254. var index = -1,
  1255. length = array ? array.length : 0;
  1256. while (++index < length) {
  1257. if (comparator(value, array[index])) {
  1258. return true;
  1259. }
  1260. }
  1261. return false;
  1262. }
  1263. /**
  1264. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1265. * support for iteratee shorthands.
  1266. *
  1267. * @private
  1268. * @param {Array} array The array to inspect.
  1269. * @param {Function} predicate The function invoked per iteration.
  1270. * @param {number} fromIndex The index to search from.
  1271. * @param {boolean} [fromRight] Specify iterating from right to left.
  1272. * @returns {number} Returns the index of the matched value, else `-1`.
  1273. */
  1274. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  1275. var length = array.length,
  1276. index = fromIndex + (fromRight ? 1 : -1);
  1277. while ((fromRight ? index-- : ++index < length)) {
  1278. if (predicate(array[index], index, array)) {
  1279. return index;
  1280. }
  1281. }
  1282. return -1;
  1283. }
  1284. /**
  1285. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  1286. *
  1287. * @private
  1288. * @param {Array} array The array to inspect.
  1289. * @param {*} value The value to search for.
  1290. * @param {number} fromIndex The index to search from.
  1291. * @returns {number} Returns the index of the matched value, else `-1`.
  1292. */
  1293. function baseIndexOf(array, value, fromIndex) {
  1294. if (value !== value) {
  1295. return baseFindIndex(array, baseIsNaN, fromIndex);
  1296. }
  1297. var index = fromIndex - 1,
  1298. length = array.length;
  1299. while (++index < length) {
  1300. if (array[index] === value) {
  1301. return index;
  1302. }
  1303. }
  1304. return -1;
  1305. }
  1306. /**
  1307. * The base implementation of `_.isNaN` without support for number objects.
  1308. *
  1309. * @private
  1310. * @param {*} value The value to check.
  1311. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  1312. */
  1313. function baseIsNaN(value) {
  1314. return value !== value;
  1315. }
  1316. /**
  1317. * Checks if a cache value for `key` exists.
  1318. *
  1319. * @private
  1320. * @param {Object} cache The cache to query.
  1321. * @param {string} key The key of the entry to check.
  1322. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1323. */
  1324. function cacheHas(cache, key) {
  1325. return cache.has(key);
  1326. }
  1327. /**
  1328. * Gets the value at `key` of `object`.
  1329. *
  1330. * @private
  1331. * @param {Object} [object] The object to query.
  1332. * @param {string} key The key of the property to get.
  1333. * @returns {*} Returns the property value.
  1334. */
  1335. function getValue(object, key) {
  1336. return object == null ? undefined : object[key];
  1337. }
  1338. /**
  1339. * Checks if `value` is a host object in IE < 9.
  1340. *
  1341. * @private
  1342. * @param {*} value The value to check.
  1343. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  1344. */
  1345. function isHostObject(value) {
  1346. // Many host objects are `Object` objects that can coerce to strings
  1347. // despite having improperly defined `toString` methods.
  1348. var result = false;
  1349. if (value != null && typeof value.toString != 'function') {
  1350. try {
  1351. result = !!(value + '');
  1352. } catch (e) {}
  1353. }
  1354. return result;
  1355. }
  1356. /**
  1357. * Converts `set` to an array of its values.
  1358. *
  1359. * @private
  1360. * @param {Object} set The set to convert.
  1361. * @returns {Array} Returns the values.
  1362. */
  1363. function setToArray(set) {
  1364. var index = -1,
  1365. result = Array(set.size);
  1366. set.forEach(function(value) {
  1367. result[++index] = value;
  1368. });
  1369. return result;
  1370. }
  1371. /** Used for built-in method references. */
  1372. var arrayProto = Array.prototype,
  1373. funcProto = Function.prototype,
  1374. objectProto = Object.prototype;
  1375. /** Used to detect overreaching core-js shims. */
  1376. var coreJsData = root['__core-js_shared__'];
  1377. /** Used to detect methods masquerading as native. */
  1378. var maskSrcKey = (function() {
  1379. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  1380. return uid ? ('Symbol(src)_1.' + uid) : '';
  1381. }());
  1382. /** Used to resolve the decompiled source of functions. */
  1383. var funcToString = funcProto.toString;
  1384. /** Used to check objects for own properties. */
  1385. var hasOwnProperty = objectProto.hasOwnProperty;
  1386. /**
  1387. * Used to resolve the
  1388. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  1389. * of values.
  1390. */
  1391. var objectToString = objectProto.toString;
  1392. /** Used to detect if a method is native. */
  1393. var reIsNative = RegExp('^' +
  1394. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  1395. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  1396. );
  1397. /** Built-in value references. */
  1398. var splice = arrayProto.splice;
  1399. /* Built-in method references that are verified to be native. */
  1400. var Map = getNative(root, 'Map'),
  1401. Set = getNative(root, 'Set'),
  1402. nativeCreate = getNative(Object, 'create');
  1403. /**
  1404. * Creates a hash object.
  1405. *
  1406. * @private
  1407. * @constructor
  1408. * @param {Array} [entries] The key-value pairs to cache.
  1409. */
  1410. function Hash(entries) {
  1411. var index = -1,
  1412. length = entries ? entries.length : 0;
  1413. this.clear();
  1414. while (++index < length) {
  1415. var entry = entries[index];
  1416. this.set(entry[0], entry[1]);
  1417. }
  1418. }
  1419. /**
  1420. * Removes all key-value entries from the hash.
  1421. *
  1422. * @private
  1423. * @name clear
  1424. * @memberOf Hash
  1425. */
  1426. function hashClear() {
  1427. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  1428. }
  1429. /**
  1430. * Removes `key` and its value from the hash.
  1431. *
  1432. * @private
  1433. * @name delete
  1434. * @memberOf Hash
  1435. * @param {Object} hash The hash to modify.
  1436. * @param {string} key The key of the value to remove.
  1437. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1438. */
  1439. function hashDelete(key) {
  1440. return this.has(key) && delete this.__data__[key];
  1441. }
  1442. /**
  1443. * Gets the hash value for `key`.
  1444. *
  1445. * @private
  1446. * @name get
  1447. * @memberOf Hash
  1448. * @param {string} key The key of the value to get.
  1449. * @returns {*} Returns the entry value.
  1450. */
  1451. function hashGet(key) {
  1452. var data = this.__data__;
  1453. if (nativeCreate) {
  1454. var result = data[key];
  1455. return result === HASH_UNDEFINED ? undefined : result;
  1456. }
  1457. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  1458. }
  1459. /**
  1460. * Checks if a hash value for `key` exists.
  1461. *
  1462. * @private
  1463. * @name has
  1464. * @memberOf Hash
  1465. * @param {string} key The key of the entry to check.
  1466. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1467. */
  1468. function hashHas(key) {
  1469. var data = this.__data__;
  1470. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  1471. }
  1472. /**
  1473. * Sets the hash `key` to `value`.
  1474. *
  1475. * @private
  1476. * @name set
  1477. * @memberOf Hash
  1478. * @param {string} key The key of the value to set.
  1479. * @param {*} value The value to set.
  1480. * @returns {Object} Returns the hash instance.
  1481. */
  1482. function hashSet(key, value) {
  1483. var data = this.__data__;
  1484. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  1485. return this;
  1486. }
  1487. // Add methods to `Hash`.
  1488. Hash.prototype.clear = hashClear;
  1489. Hash.prototype['delete'] = hashDelete;
  1490. Hash.prototype.get = hashGet;
  1491. Hash.prototype.has = hashHas;
  1492. Hash.prototype.set = hashSet;
  1493. /**
  1494. * Creates an list cache object.
  1495. *
  1496. * @private
  1497. * @constructor
  1498. * @param {Array} [entries] The key-value pairs to cache.
  1499. */
  1500. function ListCache(entries) {
  1501. var index = -1,
  1502. length = entries ? entries.length : 0;
  1503. this.clear();
  1504. while (++index < length) {
  1505. var entry = entries[index];
  1506. this.set(entry[0], entry[1]);
  1507. }
  1508. }
  1509. /**
  1510. * Removes all key-value entries from the list cache.
  1511. *
  1512. * @private
  1513. * @name clear
  1514. * @memberOf ListCache
  1515. */
  1516. function listCacheClear() {
  1517. this.__data__ = [];
  1518. }
  1519. /**
  1520. * Removes `key` and its value from the list cache.
  1521. *
  1522. * @private
  1523. * @name delete
  1524. * @memberOf ListCache
  1525. * @param {string} key The key of the value to remove.
  1526. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1527. */
  1528. function listCacheDelete(key) {
  1529. var data = this.__data__,
  1530. index = assocIndexOf(data, key);
  1531. if (index < 0) {
  1532. return false;
  1533. }
  1534. var lastIndex = data.length - 1;
  1535. if (index == lastIndex) {
  1536. data.pop();
  1537. } else {
  1538. splice.call(data, index, 1);
  1539. }
  1540. return true;
  1541. }
  1542. /**
  1543. * Gets the list cache value for `key`.
  1544. *
  1545. * @private
  1546. * @name get
  1547. * @memberOf ListCache
  1548. * @param {string} key The key of the value to get.
  1549. * @returns {*} Returns the entry value.
  1550. */
  1551. function listCacheGet(key) {
  1552. var data = this.__data__,
  1553. index = assocIndexOf(data, key);
  1554. return index < 0 ? undefined : data[index][1];
  1555. }
  1556. /**
  1557. * Checks if a list cache value for `key` exists.
  1558. *
  1559. * @private
  1560. * @name has
  1561. * @memberOf ListCache
  1562. * @param {string} key The key of the entry to check.
  1563. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1564. */
  1565. function listCacheHas(key) {
  1566. return assocIndexOf(this.__data__, key) > -1;
  1567. }
  1568. /**
  1569. * Sets the list cache `key` to `value`.
  1570. *
  1571. * @private
  1572. * @name set
  1573. * @memberOf ListCache
  1574. * @param {string} key The key of the value to set.
  1575. * @param {*} value The value to set.
  1576. * @returns {Object} Returns the list cache instance.
  1577. */
  1578. function listCacheSet(key, value) {
  1579. var data = this.__data__,
  1580. index = assocIndexOf(data, key);
  1581. if (index < 0) {
  1582. data.push([key, value]);
  1583. } else {
  1584. data[index][1] = value;
  1585. }
  1586. return this;
  1587. }
  1588. // Add methods to `ListCache`.
  1589. ListCache.prototype.clear = listCacheClear;
  1590. ListCache.prototype['delete'] = listCacheDelete;
  1591. ListCache.prototype.get = listCacheGet;
  1592. ListCache.prototype.has = listCacheHas;
  1593. ListCache.prototype.set = listCacheSet;
  1594. /**
  1595. * Creates a map cache object to store key-value pairs.
  1596. *
  1597. * @private
  1598. * @constructor
  1599. * @param {Array} [entries] The key-value pairs to cache.
  1600. */
  1601. function MapCache(entries) {
  1602. var index = -1,
  1603. length = entries ? entries.length : 0;
  1604. this.clear();
  1605. while (++index < length) {
  1606. var entry = entries[index];
  1607. this.set(entry[0], entry[1]);
  1608. }
  1609. }
  1610. /**
  1611. * Removes all key-value entries from the map.
  1612. *
  1613. * @private
  1614. * @name clear
  1615. * @memberOf MapCache
  1616. */
  1617. function mapCacheClear() {
  1618. this.__data__ = {
  1619. 'hash': new Hash,
  1620. 'map': new (Map || ListCache),
  1621. 'string': new Hash
  1622. };
  1623. }
  1624. /**
  1625. * Removes `key` and its value from the map.
  1626. *
  1627. * @private
  1628. * @name delete
  1629. * @memberOf MapCache
  1630. * @param {string} key The key of the value to remove.
  1631. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1632. */
  1633. function mapCacheDelete(key) {
  1634. return getMapData(this, key)['delete'](key);
  1635. }
  1636. /**
  1637. * Gets the map value for `key`.
  1638. *
  1639. * @private
  1640. * @name get
  1641. * @memberOf MapCache
  1642. * @param {string} key The key of the value to get.
  1643. * @returns {*} Returns the entry value.
  1644. */
  1645. function mapCacheGet(key) {
  1646. return getMapData(this, key).get(key);
  1647. }
  1648. /**
  1649. * Checks if a map value for `key` exists.
  1650. *
  1651. * @private
  1652. * @name has
  1653. * @memberOf MapCache
  1654. * @param {string} key The key of the entry to check.
  1655. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1656. */
  1657. function mapCacheHas(key) {
  1658. return getMapData(this, key).has(key);
  1659. }
  1660. /**
  1661. * Sets the map `key` to `value`.
  1662. *
  1663. * @private
  1664. * @name set
  1665. * @memberOf MapCache
  1666. * @param {string} key The key of the value to set.
  1667. * @param {*} value The value to set.
  1668. * @returns {Object} Returns the map cache instance.
  1669. */
  1670. function mapCacheSet(key, value) {
  1671. getMapData(this, key).set(key, value);
  1672. return this;
  1673. }
  1674. // Add methods to `MapCache`.
  1675. MapCache.prototype.clear = mapCacheClear;
  1676. MapCache.prototype['delete'] = mapCacheDelete;
  1677. MapCache.prototype.get = mapCacheGet;
  1678. MapCache.prototype.has = mapCacheHas;
  1679. MapCache.prototype.set = mapCacheSet;
  1680. /**
  1681. *
  1682. * Creates an array cache object to store unique values.
  1683. *
  1684. * @private
  1685. * @constructor
  1686. * @param {Array} [values] The values to cache.
  1687. */
  1688. function SetCache(values) {
  1689. var index = -1,
  1690. length = values ? values.length : 0;
  1691. this.__data__ = new MapCache;
  1692. while (++index < length) {
  1693. this.add(values[index]);
  1694. }
  1695. }
  1696. /**
  1697. * Adds `value` to the array cache.
  1698. *
  1699. * @private
  1700. * @name add
  1701. * @memberOf SetCache
  1702. * @alias push
  1703. * @param {*} value The value to cache.
  1704. * @returns {Object} Returns the cache instance.
  1705. */
  1706. function setCacheAdd(value) {
  1707. this.__data__.set(value, HASH_UNDEFINED);
  1708. return this;
  1709. }
  1710. /**
  1711. * Checks if `value` is in the array cache.
  1712. *
  1713. * @private
  1714. * @name has
  1715. * @memberOf SetCache
  1716. * @param {*} value The value to search for.
  1717. * @returns {number} Returns `true` if `value` is found, else `false`.
  1718. */
  1719. function setCacheHas(value) {
  1720. return this.__data__.has(value);
  1721. }
  1722. // Add methods to `SetCache`.
  1723. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  1724. SetCache.prototype.has = setCacheHas;
  1725. /**
  1726. * Gets the index at which the `key` is found in `array` of key-value pairs.
  1727. *
  1728. * @private
  1729. * @param {Array} array The array to inspect.
  1730. * @param {*} key The key to search for.
  1731. * @returns {number} Returns the index of the matched value, else `-1`.
  1732. */
  1733. function assocIndexOf(array, key) {
  1734. var length = array.length;
  1735. while (length--) {
  1736. if (eq(array[length][0], key)) {
  1737. return length;
  1738. }
  1739. }
  1740. return -1;
  1741. }
  1742. /**
  1743. * The base implementation of `_.isNative` without bad shim checks.
  1744. *
  1745. * @private
  1746. * @param {*} value The value to check.
  1747. * @returns {boolean} Returns `true` if `value` is a native function,
  1748. * else `false`.
  1749. */
  1750. function baseIsNative(value) {
  1751. if (!isObject(value) || isMasked(value)) {
  1752. return false;
  1753. }
  1754. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  1755. return pattern.test(toSource(value));
  1756. }
  1757. /**
  1758. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  1759. *
  1760. * @private
  1761. * @param {Array} array The array to inspect.
  1762. * @param {Function} [iteratee] The iteratee invoked per element.
  1763. * @param {Function} [comparator] The comparator invoked per element.
  1764. * @returns {Array} Returns the new duplicate free array.
  1765. */
  1766. function baseUniq(array, iteratee, comparator) {
  1767. var index = -1,
  1768. includes = arrayIncludes,
  1769. length = array.length,
  1770. isCommon = true,
  1771. result = [],
  1772. seen = result;
  1773. if (comparator) {
  1774. isCommon = false;
  1775. includes = arrayIncludesWith;
  1776. }
  1777. else if (length >= LARGE_ARRAY_SIZE) {
  1778. var set = iteratee ? null : createSet(array);
  1779. if (set) {
  1780. return setToArray(set);
  1781. }
  1782. isCommon = false;
  1783. includes = cacheHas;
  1784. seen = new SetCache;
  1785. }
  1786. else {
  1787. seen = iteratee ? [] : result;
  1788. }
  1789. outer:
  1790. while (++index < length) {
  1791. var value = array[index],
  1792. computed = iteratee ? iteratee(value) : value;
  1793. value = (comparator || value !== 0) ? value : 0;
  1794. if (isCommon && computed === computed) {
  1795. var seenIndex = seen.length;
  1796. while (seenIndex--) {
  1797. if (seen[seenIndex] === computed) {
  1798. continue outer;
  1799. }
  1800. }
  1801. if (iteratee) {
  1802. seen.push(computed);
  1803. }
  1804. result.push(value);
  1805. }
  1806. else if (!includes(seen, computed, comparator)) {
  1807. if (seen !== result) {
  1808. seen.push(computed);
  1809. }
  1810. result.push(value);
  1811. }
  1812. }
  1813. return result;
  1814. }
  1815. /**
  1816. * Creates a set object of `values`.
  1817. *
  1818. * @private
  1819. * @param {Array} values The values to add to the set.
  1820. * @returns {Object} Returns the new set.
  1821. */
  1822. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  1823. return new Set(values);
  1824. };
  1825. /**
  1826. * Gets the data for `map`.
  1827. *
  1828. * @private
  1829. * @param {Object} map The map to query.
  1830. * @param {string} key The reference key.
  1831. * @returns {*} Returns the map data.
  1832. */
  1833. function getMapData(map, key) {
  1834. var data = map.__data__;
  1835. return isKeyable(key)
  1836. ? data[typeof key == 'string' ? 'string' : 'hash']
  1837. : data.map;
  1838. }
  1839. /**
  1840. * Gets the native function at `key` of `object`.
  1841. *
  1842. * @private
  1843. * @param {Object} object The object to query.
  1844. * @param {string} key The key of the method to get.
  1845. * @returns {*} Returns the function if it's native, else `undefined`.
  1846. */
  1847. function getNative(object, key) {
  1848. var value = getValue(object, key);
  1849. return baseIsNative(value) ? value : undefined;
  1850. }
  1851. /**
  1852. * Checks if `value` is suitable for use as unique object key.
  1853. *
  1854. * @private
  1855. * @param {*} value The value to check.
  1856. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  1857. */
  1858. function isKeyable(value) {
  1859. var type = typeof value;
  1860. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  1861. ? (value !== '__proto__')
  1862. : (value === null);
  1863. }
  1864. /**
  1865. * Checks if `func` has its source masked.
  1866. *
  1867. * @private
  1868. * @param {Function} func The function to check.
  1869. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  1870. */
  1871. function isMasked(func) {
  1872. return !!maskSrcKey && (maskSrcKey in func);
  1873. }
  1874. /**
  1875. * Converts `func` to its source code.
  1876. *
  1877. * @private
  1878. * @param {Function} func The function to process.
  1879. * @returns {string} Returns the source code.
  1880. */
  1881. function toSource(func) {
  1882. if (func != null) {
  1883. try {
  1884. return funcToString.call(func);
  1885. } catch (e) {}
  1886. try {
  1887. return (func + '');
  1888. } catch (e) {}
  1889. }
  1890. return '';
  1891. }
  1892. /**
  1893. * Creates a duplicate-free version of an array, using
  1894. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  1895. * for equality comparisons, in which only the first occurrence of each
  1896. * element is kept.
  1897. *
  1898. * @static
  1899. * @memberOf _
  1900. * @since 0.1.0
  1901. * @category Array
  1902. * @param {Array} array The array to inspect.
  1903. * @returns {Array} Returns the new duplicate free array.
  1904. * @example
  1905. *
  1906. * _.uniq([2, 1, 2]);
  1907. * // => [2, 1]
  1908. */
  1909. function uniq(array) {
  1910. return (array && array.length)
  1911. ? baseUniq(array)
  1912. : [];
  1913. }
  1914. /**
  1915. * Performs a
  1916. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  1917. * comparison between two values to determine if they are equivalent.
  1918. *
  1919. * @static
  1920. * @memberOf _
  1921. * @since 4.0.0
  1922. * @category Lang
  1923. * @param {*} value The value to compare.
  1924. * @param {*} other The other value to compare.
  1925. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  1926. * @example
  1927. *
  1928. * var object = { 'a': 1 };
  1929. * var other = { 'a': 1 };
  1930. *
  1931. * _.eq(object, object);
  1932. * // => true
  1933. *
  1934. * _.eq(object, other);
  1935. * // => false
  1936. *
  1937. * _.eq('a', 'a');
  1938. * // => true
  1939. *
  1940. * _.eq('a', Object('a'));
  1941. * // => false
  1942. *
  1943. * _.eq(NaN, NaN);
  1944. * // => true
  1945. */
  1946. function eq(value, other) {
  1947. return value === other || (value !== value && other !== other);
  1948. }
  1949. /**
  1950. * Checks if `value` is classified as a `Function` object.
  1951. *
  1952. * @static
  1953. * @memberOf _
  1954. * @since 0.1.0
  1955. * @category Lang
  1956. * @param {*} value The value to check.
  1957. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  1958. * @example
  1959. *
  1960. * _.isFunction(_);
  1961. * // => true
  1962. *
  1963. * _.isFunction(/abc/);
  1964. * // => false
  1965. */
  1966. function isFunction(value) {
  1967. // The use of `Object#toString` avoids issues with the `typeof` operator
  1968. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  1969. var tag = isObject(value) ? objectToString.call(value) : '';
  1970. return tag == funcTag || tag == genTag;
  1971. }
  1972. /**
  1973. * Checks if `value` is the
  1974. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  1975. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  1976. *
  1977. * @static
  1978. * @memberOf _
  1979. * @since 0.1.0
  1980. * @category Lang
  1981. * @param {*} value The value to check.
  1982. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  1983. * @example
  1984. *
  1985. * _.isObject({});
  1986. * // => true
  1987. *
  1988. * _.isObject([1, 2, 3]);
  1989. * // => true
  1990. *
  1991. * _.isObject(_.noop);
  1992. * // => true
  1993. *
  1994. * _.isObject(null);
  1995. * // => false
  1996. */
  1997. function isObject(value) {
  1998. var type = typeof value;
  1999. return !!value && (type == 'object' || type == 'function');
  2000. }
  2001. /**
  2002. * This method returns `undefined`.
  2003. *
  2004. * @static
  2005. * @memberOf _
  2006. * @since 2.3.0
  2007. * @category Util
  2008. * @example
  2009. *
  2010. * _.times(2, _.noop);
  2011. * // => [undefined, undefined]
  2012. */
  2013. function noop() {
  2014. // No operation performed.
  2015. }
  2016. module.exports = uniq;
  2017. /***/ }),
  2018. /***/ 129:
  2019. /***/ (function(module) {
  2020. module.exports = require("child_process");
  2021. /***/ }),
  2022. /***/ 139:
  2023. /***/ (function(module, __unusedexports, __webpack_require__) {
  2024. // Unique ID creation requires a high quality random # generator. In node.js
  2025. // this is pretty straight-forward - we use the crypto API.
  2026. var crypto = __webpack_require__(417);
  2027. module.exports = function nodeRNG() {
  2028. return crypto.randomBytes(16);
  2029. };
  2030. /***/ }),
  2031. /***/ 141:
  2032. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2033. "use strict";
  2034. var net = __webpack_require__(631);
  2035. var tls = __webpack_require__(16);
  2036. var http = __webpack_require__(605);
  2037. var https = __webpack_require__(211);
  2038. var events = __webpack_require__(614);
  2039. var assert = __webpack_require__(357);
  2040. var util = __webpack_require__(669);
  2041. exports.httpOverHttp = httpOverHttp;
  2042. exports.httpsOverHttp = httpsOverHttp;
  2043. exports.httpOverHttps = httpOverHttps;
  2044. exports.httpsOverHttps = httpsOverHttps;
  2045. function httpOverHttp(options) {
  2046. var agent = new TunnelingAgent(options);
  2047. agent.request = http.request;
  2048. return agent;
  2049. }
  2050. function httpsOverHttp(options) {
  2051. var agent = new TunnelingAgent(options);
  2052. agent.request = http.request;
  2053. agent.createSocket = createSecureSocket;
  2054. return agent;
  2055. }
  2056. function httpOverHttps(options) {
  2057. var agent = new TunnelingAgent(options);
  2058. agent.request = https.request;
  2059. return agent;
  2060. }
  2061. function httpsOverHttps(options) {
  2062. var agent = new TunnelingAgent(options);
  2063. agent.request = https.request;
  2064. agent.createSocket = createSecureSocket;
  2065. return agent;
  2066. }
  2067. function TunnelingAgent(options) {
  2068. var self = this;
  2069. self.options = options || {};
  2070. self.proxyOptions = self.options.proxy || {};
  2071. self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;
  2072. self.requests = [];
  2073. self.sockets = [];
  2074. self.on('free', function onFree(socket, host, port, localAddress) {
  2075. var options = toOptions(host, port, localAddress);
  2076. for (var i = 0, len = self.requests.length; i < len; ++i) {
  2077. var pending = self.requests[i];
  2078. if (pending.host === options.host && pending.port === options.port) {
  2079. // Detect the request to connect same origin server,
  2080. // reuse the connection.
  2081. self.requests.splice(i, 1);
  2082. pending.request.onSocket(socket);
  2083. return;
  2084. }
  2085. }
  2086. socket.destroy();
  2087. self.removeSocket(socket);
  2088. });
  2089. }
  2090. util.inherits(TunnelingAgent, events.EventEmitter);
  2091. TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {
  2092. var self = this;
  2093. var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));
  2094. if (self.sockets.length >= this.maxSockets) {
  2095. // We are over limit so we'll add it to the queue.
  2096. self.requests.push(options);
  2097. return;
  2098. }
  2099. // If we are under maxSockets create a new one.
  2100. self.createSocket(options, function(socket) {
  2101. socket.on('free', onFree);
  2102. socket.on('close', onCloseOrRemove);
  2103. socket.on('agentRemove', onCloseOrRemove);
  2104. req.onSocket(socket);
  2105. function onFree() {
  2106. self.emit('free', socket, options);
  2107. }
  2108. function onCloseOrRemove(err) {
  2109. self.removeSocket(socket);
  2110. socket.removeListener('free', onFree);
  2111. socket.removeListener('close', onCloseOrRemove);
  2112. socket.removeListener('agentRemove', onCloseOrRemove);
  2113. }
  2114. });
  2115. };
  2116. TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
  2117. var self = this;
  2118. var placeholder = {};
  2119. self.sockets.push(placeholder);
  2120. var connectOptions = mergeOptions({}, self.proxyOptions, {
  2121. method: 'CONNECT',
  2122. path: options.host + ':' + options.port,
  2123. agent: false
  2124. });
  2125. if (connectOptions.proxyAuth) {
  2126. connectOptions.headers = connectOptions.headers || {};
  2127. connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
  2128. new Buffer(connectOptions.proxyAuth).toString('base64');
  2129. }
  2130. debug('making CONNECT request');
  2131. var connectReq = self.request(connectOptions);
  2132. connectReq.useChunkedEncodingByDefault = false; // for v0.6
  2133. connectReq.once('response', onResponse); // for v0.6
  2134. connectReq.once('upgrade', onUpgrade); // for v0.6
  2135. connectReq.once('connect', onConnect); // for v0.7 or later
  2136. connectReq.once('error', onError);
  2137. connectReq.end();
  2138. function onResponse(res) {
  2139. // Very hacky. This is necessary to avoid http-parser leaks.
  2140. res.upgrade = true;
  2141. }
  2142. function onUpgrade(res, socket, head) {
  2143. // Hacky.
  2144. process.nextTick(function() {
  2145. onConnect(res, socket, head);
  2146. });
  2147. }
  2148. function onConnect(res, socket, head) {
  2149. connectReq.removeAllListeners();
  2150. socket.removeAllListeners();
  2151. if (res.statusCode === 200) {
  2152. assert.equal(head.length, 0);
  2153. debug('tunneling connection has established');
  2154. self.sockets[self.sockets.indexOf(placeholder)] = socket;
  2155. cb(socket);
  2156. } else {
  2157. debug('tunneling socket could not be established, statusCode=%d',
  2158. res.statusCode);
  2159. var error = new Error('tunneling socket could not be established, ' +
  2160. 'statusCode=' + res.statusCode);
  2161. error.code = 'ECONNRESET';
  2162. options.request.emit('error', error);
  2163. self.removeSocket(placeholder);
  2164. }
  2165. }
  2166. function onError(cause) {
  2167. connectReq.removeAllListeners();
  2168. debug('tunneling socket could not be established, cause=%s\n',
  2169. cause.message, cause.stack);
  2170. var error = new Error('tunneling socket could not be established, ' +
  2171. 'cause=' + cause.message);
  2172. error.code = 'ECONNRESET';
  2173. options.request.emit('error', error);
  2174. self.removeSocket(placeholder);
  2175. }
  2176. };
  2177. TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
  2178. var pos = this.sockets.indexOf(socket)
  2179. if (pos === -1) {
  2180. return;
  2181. }
  2182. this.sockets.splice(pos, 1);
  2183. var pending = this.requests.shift();
  2184. if (pending) {
  2185. // If we have pending requests and a socket gets closed a new one
  2186. // needs to be created to take over in the pool for the one that closed.
  2187. this.createSocket(pending, function(socket) {
  2188. pending.request.onSocket(socket);
  2189. });
  2190. }
  2191. };
  2192. function createSecureSocket(options, cb) {
  2193. var self = this;
  2194. TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
  2195. var hostHeader = options.request.getHeader('host');
  2196. var tlsOptions = mergeOptions({}, self.options, {
  2197. socket: socket,
  2198. servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host
  2199. });
  2200. // 0 is dummy port for v0.6
  2201. var secureSocket = tls.connect(0, tlsOptions);
  2202. self.sockets[self.sockets.indexOf(socket)] = secureSocket;
  2203. cb(secureSocket);
  2204. });
  2205. }
  2206. function toOptions(host, port, localAddress) {
  2207. if (typeof host === 'string') { // since v0.10
  2208. return {
  2209. host: host,
  2210. port: port,
  2211. localAddress: localAddress
  2212. };
  2213. }
  2214. return host; // for v0.11 or later
  2215. }
  2216. function mergeOptions(target) {
  2217. for (var i = 1, len = arguments.length; i < len; ++i) {
  2218. var overrides = arguments[i];
  2219. if (typeof overrides === 'object') {
  2220. var keys = Object.keys(overrides);
  2221. for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
  2222. var k = keys[j];
  2223. if (overrides[k] !== undefined) {
  2224. target[k] = overrides[k];
  2225. }
  2226. }
  2227. }
  2228. }
  2229. return target;
  2230. }
  2231. var debug;
  2232. if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
  2233. debug = function() {
  2234. var args = Array.prototype.slice.call(arguments);
  2235. if (typeof args[0] === 'string') {
  2236. args[0] = 'TUNNEL: ' + args[0];
  2237. } else {
  2238. args.unshift('TUNNEL:');
  2239. }
  2240. console.error.apply(console, args);
  2241. }
  2242. } else {
  2243. debug = function() {};
  2244. }
  2245. exports.debug = debug; // for test
  2246. /***/ }),
  2247. /***/ 143:
  2248. /***/ (function(module, __unusedexports, __webpack_require__) {
  2249. module.exports = withAuthorizationPrefix;
  2250. const atob = __webpack_require__(368);
  2251. const REGEX_IS_BASIC_AUTH = /^[\w-]+:/;
  2252. function withAuthorizationPrefix(authorization) {
  2253. if (/^(basic|bearer|token) /i.test(authorization)) {
  2254. return authorization;
  2255. }
  2256. try {
  2257. if (REGEX_IS_BASIC_AUTH.test(atob(authorization))) {
  2258. return `basic ${authorization}`;
  2259. }
  2260. } catch (error) {}
  2261. if (authorization.split(/\./).length === 3) {
  2262. return `bearer ${authorization}`;
  2263. }
  2264. return `token ${authorization}`;
  2265. }
  2266. /***/ }),
  2267. /***/ 145:
  2268. /***/ (function(module, __unusedexports, __webpack_require__) {
  2269. "use strict";
  2270. const pump = __webpack_require__(453);
  2271. const bufferStream = __webpack_require__(966);
  2272. class MaxBufferError extends Error {
  2273. constructor() {
  2274. super('maxBuffer exceeded');
  2275. this.name = 'MaxBufferError';
  2276. }
  2277. }
  2278. function getStream(inputStream, options) {
  2279. if (!inputStream) {
  2280. return Promise.reject(new Error('Expected a stream'));
  2281. }
  2282. options = Object.assign({maxBuffer: Infinity}, options);
  2283. const {maxBuffer} = options;
  2284. let stream;
  2285. return new Promise((resolve, reject) => {
  2286. const rejectPromise = error => {
  2287. if (error) { // A null check
  2288. error.bufferedData = stream.getBufferedValue();
  2289. }
  2290. reject(error);
  2291. };
  2292. stream = pump(inputStream, bufferStream(options), error => {
  2293. if (error) {
  2294. rejectPromise(error);
  2295. return;
  2296. }
  2297. resolve();
  2298. });
  2299. stream.on('data', () => {
  2300. if (stream.getBufferedLength() > maxBuffer) {
  2301. rejectPromise(new MaxBufferError());
  2302. }
  2303. });
  2304. }).then(() => stream.getBufferedValue());
  2305. }
  2306. module.exports = getStream;
  2307. module.exports.buffer = (stream, options) => getStream(stream, Object.assign({}, options, {encoding: 'buffer'}));
  2308. module.exports.array = (stream, options) => getStream(stream, Object.assign({}, options, {array: true}));
  2309. module.exports.MaxBufferError = MaxBufferError;
  2310. /***/ }),
  2311. /***/ 148:
  2312. /***/ (function(module, __unusedexports, __webpack_require__) {
  2313. module.exports = paginatePlugin;
  2314. const iterator = __webpack_require__(8);
  2315. const paginate = __webpack_require__(807);
  2316. function paginatePlugin(octokit) {
  2317. octokit.paginate = paginate.bind(null, octokit);
  2318. octokit.paginate.iterator = iterator.bind(null, octokit);
  2319. }
  2320. /***/ }),
  2321. /***/ 168:
  2322. /***/ (function(module) {
  2323. "use strict";
  2324. const alias = ['stdin', 'stdout', 'stderr'];
  2325. const hasAlias = opts => alias.some(x => Boolean(opts[x]));
  2326. module.exports = opts => {
  2327. if (!opts) {
  2328. return null;
  2329. }
  2330. if (opts.stdio && hasAlias(opts)) {
  2331. throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${alias.map(x => `\`${x}\``).join(', ')}`);
  2332. }
  2333. if (typeof opts.stdio === 'string') {
  2334. return opts.stdio;
  2335. }
  2336. const stdio = opts.stdio || [];
  2337. if (!Array.isArray(stdio)) {
  2338. throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``);
  2339. }
  2340. const result = [];
  2341. const len = Math.max(stdio.length, alias.length);
  2342. for (let i = 0; i < len; i++) {
  2343. let value = null;
  2344. if (stdio[i] !== undefined) {
  2345. value = stdio[i];
  2346. } else if (opts[alias[i]] !== undefined) {
  2347. value = opts[alias[i]];
  2348. }
  2349. result[i] = value;
  2350. }
  2351. return result;
  2352. };
  2353. /***/ }),
  2354. /***/ 190:
  2355. /***/ (function(module, __unusedexports, __webpack_require__) {
  2356. module.exports = authenticationPlugin;
  2357. const beforeRequest = __webpack_require__(863);
  2358. const requestError = __webpack_require__(991);
  2359. const validate = __webpack_require__(954);
  2360. function authenticationPlugin(octokit, options) {
  2361. if (!options.auth) {
  2362. return;
  2363. }
  2364. validate(options.auth);
  2365. const state = {
  2366. octokit,
  2367. auth: options.auth
  2368. };
  2369. octokit.hook.before("request", beforeRequest.bind(null, state));
  2370. octokit.hook.error("request", requestError.bind(null, state));
  2371. }
  2372. /***/ }),
  2373. /***/ 197:
  2374. /***/ (function(module, __unusedexports, __webpack_require__) {
  2375. module.exports = isexe
  2376. isexe.sync = sync
  2377. var fs = __webpack_require__(747)
  2378. function isexe (path, options, cb) {
  2379. fs.stat(path, function (er, stat) {
  2380. cb(er, er ? false : checkStat(stat, options))
  2381. })
  2382. }
  2383. function sync (path, options) {
  2384. return checkStat(fs.statSync(path), options)
  2385. }
  2386. function checkStat (stat, options) {
  2387. return stat.isFile() && checkMode(stat, options)
  2388. }
  2389. function checkMode (stat, options) {
  2390. var mod = stat.mode
  2391. var uid = stat.uid
  2392. var gid = stat.gid
  2393. var myUid = options.uid !== undefined ?
  2394. options.uid : process.getuid && process.getuid()
  2395. var myGid = options.gid !== undefined ?
  2396. options.gid : process.getgid && process.getgid()
  2397. var u = parseInt('100', 8)
  2398. var g = parseInt('010', 8)
  2399. var o = parseInt('001', 8)
  2400. var ug = u | g
  2401. var ret = (mod & o) ||
  2402. (mod & g) && gid === myGid ||
  2403. (mod & u) && uid === myUid ||
  2404. (mod & ug) && myUid === 0
  2405. return ret
  2406. }
  2407. /***/ }),
  2408. /***/ 198:
  2409. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2410. "use strict";
  2411. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2412. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2413. return new (P || (P = Promise))(function (resolve, reject) {
  2414. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2415. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2416. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2417. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2418. });
  2419. };
  2420. var __importStar = (this && this.__importStar) || function (mod) {
  2421. if (mod && mod.__esModule) return mod;
  2422. var result = {};
  2423. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  2424. result["default"] = mod;
  2425. return result;
  2426. };
  2427. Object.defineProperty(exports, "__esModule", { value: true });
  2428. const core = __importStar(__webpack_require__(470));
  2429. const coreCommand = __importStar(__webpack_require__(431));
  2430. const gitSourceProvider = __importStar(__webpack_require__(293));
  2431. const inputHelper = __importStar(__webpack_require__(821));
  2432. const path = __importStar(__webpack_require__(622));
  2433. const cleanupRepositoryPath = process.env['STATE_repositoryPath'];
  2434. function run() {
  2435. return __awaiter(this, void 0, void 0, function* () {
  2436. try {
  2437. const sourceSettings = inputHelper.getInputs();
  2438. try {
  2439. // Register problem matcher
  2440. coreCommand.issueCommand('add-matcher', {}, path.join(__dirname, 'problem-matcher.json'));
  2441. // Get sources
  2442. yield gitSourceProvider.getSource(sourceSettings);
  2443. }
  2444. finally {
  2445. // Unregister problem matcher
  2446. coreCommand.issueCommand('remove-matcher', { owner: 'checkout-git' }, '');
  2447. }
  2448. }
  2449. catch (error) {
  2450. core.setFailed(error.message);
  2451. }
  2452. });
  2453. }
  2454. function cleanup() {
  2455. return __awaiter(this, void 0, void 0, function* () {
  2456. try {
  2457. yield gitSourceProvider.cleanup(cleanupRepositoryPath);
  2458. }
  2459. catch (error) {
  2460. core.warning(error.message);
  2461. }
  2462. });
  2463. }
  2464. // Main
  2465. if (!cleanupRepositoryPath) {
  2466. run();
  2467. }
  2468. // Post
  2469. else {
  2470. cleanup();
  2471. }
  2472. /***/ }),
  2473. /***/ 211:
  2474. /***/ (function(module) {
  2475. module.exports = require("https");
  2476. /***/ }),
  2477. /***/ 215:
  2478. /***/ (function(module) {
  2479. module.exports = {"name":"@octokit/rest","version":"16.35.0","publishConfig":{"access":"public"},"description":"GitHub REST API client for Node.js","keywords":["octokit","github","rest","api-client"],"author":"Gregor Martynus (https://github.com/gr2m)","contributors":[{"name":"Mike de Boer","email":"info@mikedeboer.nl"},{"name":"Fabian Jakobs","email":"fabian@c9.io"},{"name":"Joe Gallo","email":"joe@brassafrax.com"},{"name":"Gregor Martynus","url":"https://github.com/gr2m"}],"repository":"https://github.com/octokit/rest.js","dependencies":{"@octokit/request":"^5.2.0","@octokit/request-error":"^1.0.2","atob-lite":"^2.0.0","before-after-hook":"^2.0.0","btoa-lite":"^1.0.0","deprecation":"^2.0.0","lodash.get":"^4.4.2","lodash.set":"^4.3.2","lodash.uniq":"^4.5.0","octokit-pagination-methods":"^1.1.0","once":"^1.4.0","universal-user-agent":"^4.0.0"},"devDependencies":{"@gimenete/type-writer":"^0.1.3","@octokit/fixtures-server":"^5.0.6","@octokit/graphql":"^4.2.0","@types/node":"^12.0.0","bundlesize":"^0.18.0","chai":"^4.1.2","compression-webpack-plugin":"^3.0.0","cypress":"^3.0.0","glob":"^7.1.2","http-proxy-agent":"^2.1.0","lodash.camelcase":"^4.3.0","lodash.merge":"^4.6.1","lodash.upperfirst":"^4.3.1","mkdirp":"^0.5.1","mocha":"^6.0.0","mustache":"^3.0.0","nock":"^11.3.3","npm-run-all":"^4.1.2","nyc":"^14.0.0","prettier":"^1.14.2","proxy":"^1.0.0","semantic-release":"^15.0.0","sinon":"^7.2.4","sinon-chai":"^3.0.0","sort-keys":"^4.0.0","string-to-arraybuffer":"^1.0.0","string-to-jsdoc-comment":"^1.0.0","typescript":"^3.3.1","webpack":"^4.0.0","webpack-bundle-analyzer":"^3.0.0","webpack-cli":"^3.0.0"},"types":"index.d.ts","scripts":{"coverage":"nyc report --reporter=html && open coverage/index.html","lint":"prettier --check '{lib,plugins,scripts,test}/**/*.{js,json,ts}' 'docs/*.{js,json}' 'docs/src/**/*' index.js README.md package.json","lint:fix":"prettier --write '{lib,plugins,scripts,test}/**/*.{js,json,ts}' 'docs/*.{js,json}' 'docs/src/**/*' index.js README.md package.json","pretest":"npm run -s lint","test":"nyc mocha test/mocha-node-setup.js \"test/*/**/*-test.js\"","test:browser":"cypress run --browser chrome","build":"npm-run-all build:*","build:ts":"npm run -s update-endpoints:typescript","prebuild:browser":"mkdirp dist/","build:browser":"npm-run-all build:browser:*","build:browser:development":"webpack --mode development --entry . --output-library=Octokit --output=./dist/octokit-rest.js --profile --json > dist/bundle-stats.json","build:browser:production":"webpack --mode production --entry . --plugin=compression-webpack-plugin --output-library=Octokit --output-path=./dist --output-filename=octokit-rest.min.js --devtool source-map","generate-bundle-report":"webpack-bundle-analyzer dist/bundle-stats.json --mode=static --no-open --report dist/bundle-report.html","update-endpoints":"npm-run-all update-endpoints:*","update-endpoints:fetch-json":"node scripts/update-endpoints/fetch-json","update-endpoints:code":"node scripts/update-endpoints/code","update-endpoints:typescript":"node scripts/update-endpoints/typescript","prevalidate:ts":"npm run -s build:ts","validate:ts":"tsc --target es6 --noImplicitAny index.d.ts","postvalidate:ts":"tsc --noEmit --target es6 test/typescript-validate.ts","start-fixtures-server":"octokit-fixtures-server"},"license":"MIT","files":["index.js","index.d.ts","lib","plugins"],"nyc":{"ignore":["test"]},"release":{"publish":["@semantic-release/npm",{"path":"@semantic-release/github","assets":["dist/*","!dist/*.map.gz"]}]},"bundlesize":[{"path":"./dist/octokit-rest.min.js.gz","maxSize":"33 kB"}],"_resolved":"https://registry.npmjs.org/@octokit/rest/-/rest-16.35.0.tgz","_integrity":"sha512-9ShFqYWo0CLoGYhA1FdtdykJuMzS/9H6vSbbQWDX4pWr4p9v+15MsH/wpd/3fIU+tSxylaNO48+PIHqOkBRx3w==","_from":"@octokit/rest@16.35.0"};
  2480. /***/ }),
  2481. /***/ 227:
  2482. /***/ (function(__unusedmodule, exports) {
  2483. "use strict";
  2484. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2485. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2486. return new (P || (P = Promise))(function (resolve, reject) {
  2487. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2488. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2489. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2490. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2491. });
  2492. };
  2493. Object.defineProperty(exports, "__esModule", { value: true });
  2494. function getDownloadRef(ref, commit) {
  2495. if (commit) {
  2496. return commit;
  2497. }
  2498. // todo fix this to work with refs/pull etc
  2499. return ref;
  2500. }
  2501. exports.getDownloadRef = getDownloadRef;
  2502. function getCheckoutInfo(git, ref, commit) {
  2503. return __awaiter(this, void 0, void 0, function* () {
  2504. if (!git) {
  2505. throw new Error('Arg git cannot be empty');
  2506. }
  2507. if (!ref && !commit) {
  2508. throw new Error('Args ref and commit cannot both be empty');
  2509. }
  2510. const result = {};
  2511. const upperRef = (ref || '').toUpperCase();
  2512. // SHA only
  2513. if (!ref) {
  2514. result.ref = commit;
  2515. }
  2516. // refs/heads/
  2517. else if (upperRef.startsWith('REFS/HEADS/')) {
  2518. const branch = ref.substring('refs/heads/'.length);
  2519. result.ref = branch;
  2520. result.startPoint = `refs/remotes/origin/${branch}`;
  2521. }
  2522. // refs/pull/
  2523. else if (upperRef.startsWith('REFS/PULL/')) {
  2524. const branch = ref.substring('refs/pull/'.length);
  2525. result.ref = `refs/remotes/pull/${branch}`;
  2526. }
  2527. // refs/tags/
  2528. else if (upperRef.startsWith('REFS/')) {
  2529. result.ref = ref;
  2530. }
  2531. // Unqualified ref, check for a matching branch or tag
  2532. else {
  2533. if (yield git.branchExists(true, `origin/${ref}`)) {
  2534. result.ref = ref;
  2535. result.startPoint = `refs/remotes/origin/${ref}`;
  2536. }
  2537. else if (yield git.tagExists(`${ref}`)) {
  2538. result.ref = `refs/tags/${ref}`;
  2539. }
  2540. else {
  2541. throw new Error(`A branch or tag with the name '${ref}' could not be found`);
  2542. }
  2543. }
  2544. return result;
  2545. });
  2546. }
  2547. exports.getCheckoutInfo = getCheckoutInfo;
  2548. function getRefSpec(ref, commit) {
  2549. if (!ref && !commit) {
  2550. throw new Error('Args ref and commit cannot both be empty');
  2551. }
  2552. const upperRef = (ref || '').toUpperCase();
  2553. // SHA
  2554. if (commit) {
  2555. // refs/heads
  2556. if (upperRef.startsWith('REFS/HEADS/')) {
  2557. const branch = ref.substring('refs/heads/'.length);
  2558. return [`+${commit}:refs/remotes/origin/${branch}`];
  2559. }
  2560. // refs/pull/
  2561. else if (upperRef.startsWith('REFS/PULL/')) {
  2562. const branch = ref.substring('refs/pull/'.length);
  2563. return [`+${commit}:refs/remotes/pull/${branch}`];
  2564. }
  2565. // refs/tags/
  2566. else if (upperRef.startsWith('REFS/TAGS/')) {
  2567. return [`+${commit}:${ref}`];
  2568. }
  2569. // Otherwise no destination ref
  2570. else {
  2571. return [commit];
  2572. }
  2573. }
  2574. // Unqualified ref, check for a matching branch or tag
  2575. else if (!upperRef.startsWith('REFS/')) {
  2576. return [
  2577. `+refs/heads/${ref}*:refs/remotes/origin/${ref}*`,
  2578. `+refs/tags/${ref}*:refs/tags/${ref}*`
  2579. ];
  2580. }
  2581. // refs/heads/
  2582. else if (upperRef.startsWith('REFS/HEADS/')) {
  2583. const branch = ref.substring('refs/heads/'.length);
  2584. return [`+${ref}:refs/remotes/origin/${branch}`];
  2585. }
  2586. // refs/pull/
  2587. else if (upperRef.startsWith('REFS/PULL/')) {
  2588. const branch = ref.substring('refs/pull/'.length);
  2589. return [`+${ref}:refs/remotes/pull/${branch}`];
  2590. }
  2591. // refs/tags/
  2592. else {
  2593. return [`+${ref}:${ref}`];
  2594. }
  2595. }
  2596. exports.getRefSpec = getRefSpec;
  2597. /***/ }),
  2598. /***/ 248:
  2599. /***/ (function(module, __unusedexports, __webpack_require__) {
  2600. module.exports = octokitRegisterEndpoints;
  2601. const registerEndpoints = __webpack_require__(899);
  2602. function octokitRegisterEndpoints(octokit) {
  2603. octokit.registerEndpoints = registerEndpoints.bind(null, octokit);
  2604. }
  2605. /***/ }),
  2606. /***/ 260:
  2607. /***/ (function(module, __unusedexports, __webpack_require__) {
  2608. // Note: since nyc uses this module to output coverage, any lines
  2609. // that are in the direct sync flow of nyc's outputCoverage are
  2610. // ignored, since we can never get coverage for them.
  2611. var assert = __webpack_require__(357)
  2612. var signals = __webpack_require__(654)
  2613. var EE = __webpack_require__(614)
  2614. /* istanbul ignore if */
  2615. if (typeof EE !== 'function') {
  2616. EE = EE.EventEmitter
  2617. }
  2618. var emitter
  2619. if (process.__signal_exit_emitter__) {
  2620. emitter = process.__signal_exit_emitter__
  2621. } else {
  2622. emitter = process.__signal_exit_emitter__ = new EE()
  2623. emitter.count = 0
  2624. emitter.emitted = {}
  2625. }
  2626. // Because this emitter is a global, we have to check to see if a
  2627. // previous version of this library failed to enable infinite listeners.
  2628. // I know what you're about to say. But literally everything about
  2629. // signal-exit is a compromise with evil. Get used to it.
  2630. if (!emitter.infinite) {
  2631. emitter.setMaxListeners(Infinity)
  2632. emitter.infinite = true
  2633. }
  2634. module.exports = function (cb, opts) {
  2635. assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler')
  2636. if (loaded === false) {
  2637. load()
  2638. }
  2639. var ev = 'exit'
  2640. if (opts && opts.alwaysLast) {
  2641. ev = 'afterexit'
  2642. }
  2643. var remove = function () {
  2644. emitter.removeListener(ev, cb)
  2645. if (emitter.listeners('exit').length === 0 &&
  2646. emitter.listeners('afterexit').length === 0) {
  2647. unload()
  2648. }
  2649. }
  2650. emitter.on(ev, cb)
  2651. return remove
  2652. }
  2653. module.exports.unload = unload
  2654. function unload () {
  2655. if (!loaded) {
  2656. return
  2657. }
  2658. loaded = false
  2659. signals.forEach(function (sig) {
  2660. try {
  2661. process.removeListener(sig, sigListeners[sig])
  2662. } catch (er) {}
  2663. })
  2664. process.emit = originalProcessEmit
  2665. process.reallyExit = originalProcessReallyExit
  2666. emitter.count -= 1
  2667. }
  2668. function emit (event, code, signal) {
  2669. if (emitter.emitted[event]) {
  2670. return
  2671. }
  2672. emitter.emitted[event] = true
  2673. emitter.emit(event, code, signal)
  2674. }
  2675. // { <signal>: <listener fn>, ... }
  2676. var sigListeners = {}
  2677. signals.forEach(function (sig) {
  2678. sigListeners[sig] = function listener () {
  2679. // If there are no other listeners, an exit is coming!
  2680. // Simplest way: remove us and then re-send the signal.
  2681. // We know that this will kill the process, so we can
  2682. // safely emit now.
  2683. var listeners = process.listeners(sig)
  2684. if (listeners.length === emitter.count) {
  2685. unload()
  2686. emit('exit', null, sig)
  2687. /* istanbul ignore next */
  2688. emit('afterexit', null, sig)
  2689. /* istanbul ignore next */
  2690. process.kill(process.pid, sig)
  2691. }
  2692. }
  2693. })
  2694. module.exports.signals = function () {
  2695. return signals
  2696. }
  2697. module.exports.load = load
  2698. var loaded = false
  2699. function load () {
  2700. if (loaded) {
  2701. return
  2702. }
  2703. loaded = true
  2704. // This is the number of onSignalExit's that are in play.
  2705. // It's important so that we can count the correct number of
  2706. // listeners on signals, and don't wait for the other one to
  2707. // handle it instead of us.
  2708. emitter.count += 1
  2709. signals = signals.filter(function (sig) {
  2710. try {
  2711. process.on(sig, sigListeners[sig])
  2712. return true
  2713. } catch (er) {
  2714. return false
  2715. }
  2716. })
  2717. process.emit = processEmit
  2718. process.reallyExit = processReallyExit
  2719. }
  2720. var originalProcessReallyExit = process.reallyExit
  2721. function processReallyExit (code) {
  2722. process.exitCode = code || 0
  2723. emit('exit', process.exitCode, null)
  2724. /* istanbul ignore next */
  2725. emit('afterexit', process.exitCode, null)
  2726. /* istanbul ignore next */
  2727. originalProcessReallyExit.call(process, process.exitCode)
  2728. }
  2729. var originalProcessEmit = process.emit
  2730. function processEmit (ev, arg) {
  2731. if (ev === 'exit') {
  2732. if (arg !== undefined) {
  2733. process.exitCode = arg
  2734. }
  2735. var ret = originalProcessEmit.apply(this, arguments)
  2736. emit('exit', process.exitCode, null)
  2737. /* istanbul ignore next */
  2738. emit('afterexit', process.exitCode, null)
  2739. return ret
  2740. } else {
  2741. return originalProcessEmit.apply(this, arguments)
  2742. }
  2743. }
  2744. /***/ }),
  2745. /***/ 262:
  2746. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2747. "use strict";
  2748. Object.defineProperty(exports, "__esModule", { value: true });
  2749. const fs_1 = __webpack_require__(747);
  2750. const os_1 = __webpack_require__(87);
  2751. class Context {
  2752. /**
  2753. * Hydrate the context from the environment
  2754. */
  2755. constructor() {
  2756. this.payload = {};
  2757. if (process.env.GITHUB_EVENT_PATH) {
  2758. if (fs_1.existsSync(process.env.GITHUB_EVENT_PATH)) {
  2759. this.payload = JSON.parse(fs_1.readFileSync(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' }));
  2760. }
  2761. else {
  2762. const path = process.env.GITHUB_EVENT_PATH;
  2763. process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${os_1.EOL}`);
  2764. }
  2765. }
  2766. this.eventName = process.env.GITHUB_EVENT_NAME;
  2767. this.sha = process.env.GITHUB_SHA;
  2768. this.ref = process.env.GITHUB_REF;
  2769. this.workflow = process.env.GITHUB_WORKFLOW;
  2770. this.action = process.env.GITHUB_ACTION;
  2771. this.actor = process.env.GITHUB_ACTOR;
  2772. }
  2773. get issue() {
  2774. const payload = this.payload;
  2775. return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pullRequest || payload).number });
  2776. }
  2777. get repo() {
  2778. if (process.env.GITHUB_REPOSITORY) {
  2779. const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');
  2780. return { owner, repo };
  2781. }
  2782. if (this.payload.repository) {
  2783. return {
  2784. owner: this.payload.repository.owner.login,
  2785. repo: this.payload.repository.name
  2786. };
  2787. }
  2788. throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'");
  2789. }
  2790. }
  2791. exports.Context = Context;
  2792. //# sourceMappingURL=context.js.map
  2793. /***/ }),
  2794. /***/ 265:
  2795. /***/ (function(module, __unusedexports, __webpack_require__) {
  2796. module.exports = getPage
  2797. const deprecate = __webpack_require__(370)
  2798. const getPageLinks = __webpack_require__(577)
  2799. const HttpError = __webpack_require__(297)
  2800. function getPage (octokit, link, which, headers) {
  2801. deprecate(`octokit.get${which.charAt(0).toUpperCase() + which.slice(1)}Page() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  2802. const url = getPageLinks(link)[which]
  2803. if (!url) {
  2804. const urlError = new HttpError(`No ${which} page found`, 404)
  2805. return Promise.reject(urlError)
  2806. }
  2807. const requestOptions = {
  2808. url,
  2809. headers: applyAcceptHeader(link, headers)
  2810. }
  2811. const promise = octokit.request(requestOptions)
  2812. return promise
  2813. }
  2814. function applyAcceptHeader (res, headers) {
  2815. const previous = res.headers && res.headers['x-github-media-type']
  2816. if (!previous || (headers && headers.accept)) {
  2817. return headers
  2818. }
  2819. headers = headers || {}
  2820. headers.accept = 'application/vnd.' + previous
  2821. .replace('; param=', '.')
  2822. .replace('; format=', '+')
  2823. return headers
  2824. }
  2825. /***/ }),
  2826. /***/ 280:
  2827. /***/ (function(module, exports) {
  2828. exports = module.exports = SemVer
  2829. var debug
  2830. /* istanbul ignore next */
  2831. if (typeof process === 'object' &&
  2832. process.env &&
  2833. process.env.NODE_DEBUG &&
  2834. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  2835. debug = function () {
  2836. var args = Array.prototype.slice.call(arguments, 0)
  2837. args.unshift('SEMVER')
  2838. console.log.apply(console, args)
  2839. }
  2840. } else {
  2841. debug = function () {}
  2842. }
  2843. // Note: this is the semver.org version of the spec that it implements
  2844. // Not necessarily the package version of this code.
  2845. exports.SEMVER_SPEC_VERSION = '2.0.0'
  2846. var MAX_LENGTH = 256
  2847. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  2848. /* istanbul ignore next */ 9007199254740991
  2849. // Max safe segment length for coercion.
  2850. var MAX_SAFE_COMPONENT_LENGTH = 16
  2851. // The actual regexps go on exports.re
  2852. var re = exports.re = []
  2853. var src = exports.src = []
  2854. var R = 0
  2855. // The following Regular Expressions can be used for tokenizing,
  2856. // validating, and parsing SemVer version strings.
  2857. // ## Numeric Identifier
  2858. // A single `0`, or a non-zero digit followed by zero or more digits.
  2859. var NUMERICIDENTIFIER = R++
  2860. src[NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  2861. var NUMERICIDENTIFIERLOOSE = R++
  2862. src[NUMERICIDENTIFIERLOOSE] = '[0-9]+'
  2863. // ## Non-numeric Identifier
  2864. // Zero or more digits, followed by a letter or hyphen, and then zero or
  2865. // more letters, digits, or hyphens.
  2866. var NONNUMERICIDENTIFIER = R++
  2867. src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
  2868. // ## Main Version
  2869. // Three dot-separated numeric identifiers.
  2870. var MAINVERSION = R++
  2871. src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' +
  2872. '(' + src[NUMERICIDENTIFIER] + ')\\.' +
  2873. '(' + src[NUMERICIDENTIFIER] + ')'
  2874. var MAINVERSIONLOOSE = R++
  2875. src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
  2876. '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
  2877. '(' + src[NUMERICIDENTIFIERLOOSE] + ')'
  2878. // ## Pre-release Version Identifier
  2879. // A numeric identifier, or a non-numeric identifier.
  2880. var PRERELEASEIDENTIFIER = R++
  2881. src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] +
  2882. '|' + src[NONNUMERICIDENTIFIER] + ')'
  2883. var PRERELEASEIDENTIFIERLOOSE = R++
  2884. src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] +
  2885. '|' + src[NONNUMERICIDENTIFIER] + ')'
  2886. // ## Pre-release Version
  2887. // Hyphen, followed by one or more dot-separated pre-release version
  2888. // identifiers.
  2889. var PRERELEASE = R++
  2890. src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] +
  2891. '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))'
  2892. var PRERELEASELOOSE = R++
  2893. src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] +
  2894. '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))'
  2895. // ## Build Metadata Identifier
  2896. // Any combination of digits, letters, or hyphens.
  2897. var BUILDIDENTIFIER = R++
  2898. src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
  2899. // ## Build Metadata
  2900. // Plus sign, followed by one or more period-separated build metadata
  2901. // identifiers.
  2902. var BUILD = R++
  2903. src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] +
  2904. '(?:\\.' + src[BUILDIDENTIFIER] + ')*))'
  2905. // ## Full Version String
  2906. // A main version, followed optionally by a pre-release version and
  2907. // build metadata.
  2908. // Note that the only major, minor, patch, and pre-release sections of
  2909. // the version string are capturing groups. The build metadata is not a
  2910. // capturing group, because it should not ever be used in version
  2911. // comparison.
  2912. var FULL = R++
  2913. var FULLPLAIN = 'v?' + src[MAINVERSION] +
  2914. src[PRERELEASE] + '?' +
  2915. src[BUILD] + '?'
  2916. src[FULL] = '^' + FULLPLAIN + '$'
  2917. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  2918. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  2919. // common in the npm registry.
  2920. var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] +
  2921. src[PRERELEASELOOSE] + '?' +
  2922. src[BUILD] + '?'
  2923. var LOOSE = R++
  2924. src[LOOSE] = '^' + LOOSEPLAIN + '$'
  2925. var GTLT = R++
  2926. src[GTLT] = '((?:<|>)?=?)'
  2927. // Something like "2.*" or "1.2.x".
  2928. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  2929. // Only the first item is strictly required.
  2930. var XRANGEIDENTIFIERLOOSE = R++
  2931. src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  2932. var XRANGEIDENTIFIER = R++
  2933. src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*'
  2934. var XRANGEPLAIN = R++
  2935. src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' +
  2936. '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
  2937. '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
  2938. '(?:' + src[PRERELEASE] + ')?' +
  2939. src[BUILD] + '?' +
  2940. ')?)?'
  2941. var XRANGEPLAINLOOSE = R++
  2942. src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  2943. '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  2944. '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  2945. '(?:' + src[PRERELEASELOOSE] + ')?' +
  2946. src[BUILD] + '?' +
  2947. ')?)?'
  2948. var XRANGE = R++
  2949. src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'
  2950. var XRANGELOOSE = R++
  2951. src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$'
  2952. // Coercion.
  2953. // Extract anything that could conceivably be a part of a valid semver
  2954. var COERCE = R++
  2955. src[COERCE] = '(?:^|[^\\d])' +
  2956. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  2957. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  2958. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  2959. '(?:$|[^\\d])'
  2960. // Tilde ranges.
  2961. // Meaning is "reasonably at or greater than"
  2962. var LONETILDE = R++
  2963. src[LONETILDE] = '(?:~>?)'
  2964. var TILDETRIM = R++
  2965. src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+'
  2966. re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g')
  2967. var tildeTrimReplace = '$1~'
  2968. var TILDE = R++
  2969. src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'
  2970. var TILDELOOSE = R++
  2971. src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'
  2972. // Caret ranges.
  2973. // Meaning is "at least and backwards compatible with"
  2974. var LONECARET = R++
  2975. src[LONECARET] = '(?:\\^)'
  2976. var CARETTRIM = R++
  2977. src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+'
  2978. re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g')
  2979. var caretTrimReplace = '$1^'
  2980. var CARET = R++
  2981. src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$'
  2982. var CARETLOOSE = R++
  2983. src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$'
  2984. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  2985. var COMPARATORLOOSE = R++
  2986. src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$'
  2987. var COMPARATOR = R++
  2988. src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$'
  2989. // An expression to strip any whitespace between the gtlt and the thing
  2990. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  2991. var COMPARATORTRIM = R++
  2992. src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] +
  2993. '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'
  2994. // this one has to use the /g flag
  2995. re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g')
  2996. var comparatorTrimReplace = '$1$2$3'
  2997. // Something like `1.2.3 - 1.2.4`
  2998. // Note that these all use the loose form, because they'll be
  2999. // checked against either the strict or loose comparator form
  3000. // later.
  3001. var HYPHENRANGE = R++
  3002. src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' +
  3003. '\\s+-\\s+' +
  3004. '(' + src[XRANGEPLAIN] + ')' +
  3005. '\\s*$'
  3006. var HYPHENRANGELOOSE = R++
  3007. src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' +
  3008. '\\s+-\\s+' +
  3009. '(' + src[XRANGEPLAINLOOSE] + ')' +
  3010. '\\s*$'
  3011. // Star ranges basically just allow anything at all.
  3012. var STAR = R++
  3013. src[STAR] = '(<|>)?=?\\s*\\*'
  3014. // Compile to actual regexp objects.
  3015. // All are flag-free, unless they were created above with a flag.
  3016. for (var i = 0; i < R; i++) {
  3017. debug(i, src[i])
  3018. if (!re[i]) {
  3019. re[i] = new RegExp(src[i])
  3020. }
  3021. }
  3022. exports.parse = parse
  3023. function parse (version, options) {
  3024. if (!options || typeof options !== 'object') {
  3025. options = {
  3026. loose: !!options,
  3027. includePrerelease: false
  3028. }
  3029. }
  3030. if (version instanceof SemVer) {
  3031. return version
  3032. }
  3033. if (typeof version !== 'string') {
  3034. return null
  3035. }
  3036. if (version.length > MAX_LENGTH) {
  3037. return null
  3038. }
  3039. var r = options.loose ? re[LOOSE] : re[FULL]
  3040. if (!r.test(version)) {
  3041. return null
  3042. }
  3043. try {
  3044. return new SemVer(version, options)
  3045. } catch (er) {
  3046. return null
  3047. }
  3048. }
  3049. exports.valid = valid
  3050. function valid (version, options) {
  3051. var v = parse(version, options)
  3052. return v ? v.version : null
  3053. }
  3054. exports.clean = clean
  3055. function clean (version, options) {
  3056. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  3057. return s ? s.version : null
  3058. }
  3059. exports.SemVer = SemVer
  3060. function SemVer (version, options) {
  3061. if (!options || typeof options !== 'object') {
  3062. options = {
  3063. loose: !!options,
  3064. includePrerelease: false
  3065. }
  3066. }
  3067. if (version instanceof SemVer) {
  3068. if (version.loose === options.loose) {
  3069. return version
  3070. } else {
  3071. version = version.version
  3072. }
  3073. } else if (typeof version !== 'string') {
  3074. throw new TypeError('Invalid Version: ' + version)
  3075. }
  3076. if (version.length > MAX_LENGTH) {
  3077. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  3078. }
  3079. if (!(this instanceof SemVer)) {
  3080. return new SemVer(version, options)
  3081. }
  3082. debug('SemVer', version, options)
  3083. this.options = options
  3084. this.loose = !!options.loose
  3085. var m = version.trim().match(options.loose ? re[LOOSE] : re[FULL])
  3086. if (!m) {
  3087. throw new TypeError('Invalid Version: ' + version)
  3088. }
  3089. this.raw = version
  3090. // these are actually numbers
  3091. this.major = +m[1]
  3092. this.minor = +m[2]
  3093. this.patch = +m[3]
  3094. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  3095. throw new TypeError('Invalid major version')
  3096. }
  3097. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  3098. throw new TypeError('Invalid minor version')
  3099. }
  3100. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  3101. throw new TypeError('Invalid patch version')
  3102. }
  3103. // numberify any prerelease numeric ids
  3104. if (!m[4]) {
  3105. this.prerelease = []
  3106. } else {
  3107. this.prerelease = m[4].split('.').map(function (id) {
  3108. if (/^[0-9]+$/.test(id)) {
  3109. var num = +id
  3110. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  3111. return num
  3112. }
  3113. }
  3114. return id
  3115. })
  3116. }
  3117. this.build = m[5] ? m[5].split('.') : []
  3118. this.format()
  3119. }
  3120. SemVer.prototype.format = function () {
  3121. this.version = this.major + '.' + this.minor + '.' + this.patch
  3122. if (this.prerelease.length) {
  3123. this.version += '-' + this.prerelease.join('.')
  3124. }
  3125. return this.version
  3126. }
  3127. SemVer.prototype.toString = function () {
  3128. return this.version
  3129. }
  3130. SemVer.prototype.compare = function (other) {
  3131. debug('SemVer.compare', this.version, this.options, other)
  3132. if (!(other instanceof SemVer)) {
  3133. other = new SemVer(other, this.options)
  3134. }
  3135. return this.compareMain(other) || this.comparePre(other)
  3136. }
  3137. SemVer.prototype.compareMain = function (other) {
  3138. if (!(other instanceof SemVer)) {
  3139. other = new SemVer(other, this.options)
  3140. }
  3141. return compareIdentifiers(this.major, other.major) ||
  3142. compareIdentifiers(this.minor, other.minor) ||
  3143. compareIdentifiers(this.patch, other.patch)
  3144. }
  3145. SemVer.prototype.comparePre = function (other) {
  3146. if (!(other instanceof SemVer)) {
  3147. other = new SemVer(other, this.options)
  3148. }
  3149. // NOT having a prerelease is > having one
  3150. if (this.prerelease.length && !other.prerelease.length) {
  3151. return -1
  3152. } else if (!this.prerelease.length && other.prerelease.length) {
  3153. return 1
  3154. } else if (!this.prerelease.length && !other.prerelease.length) {
  3155. return 0
  3156. }
  3157. var i = 0
  3158. do {
  3159. var a = this.prerelease[i]
  3160. var b = other.prerelease[i]
  3161. debug('prerelease compare', i, a, b)
  3162. if (a === undefined && b === undefined) {
  3163. return 0
  3164. } else if (b === undefined) {
  3165. return 1
  3166. } else if (a === undefined) {
  3167. return -1
  3168. } else if (a === b) {
  3169. continue
  3170. } else {
  3171. return compareIdentifiers(a, b)
  3172. }
  3173. } while (++i)
  3174. }
  3175. // preminor will bump the version up to the next minor release, and immediately
  3176. // down to pre-release. premajor and prepatch work the same way.
  3177. SemVer.prototype.inc = function (release, identifier) {
  3178. switch (release) {
  3179. case 'premajor':
  3180. this.prerelease.length = 0
  3181. this.patch = 0
  3182. this.minor = 0
  3183. this.major++
  3184. this.inc('pre', identifier)
  3185. break
  3186. case 'preminor':
  3187. this.prerelease.length = 0
  3188. this.patch = 0
  3189. this.minor++
  3190. this.inc('pre', identifier)
  3191. break
  3192. case 'prepatch':
  3193. // If this is already a prerelease, it will bump to the next version
  3194. // drop any prereleases that might already exist, since they are not
  3195. // relevant at this point.
  3196. this.prerelease.length = 0
  3197. this.inc('patch', identifier)
  3198. this.inc('pre', identifier)
  3199. break
  3200. // If the input is a non-prerelease version, this acts the same as
  3201. // prepatch.
  3202. case 'prerelease':
  3203. if (this.prerelease.length === 0) {
  3204. this.inc('patch', identifier)
  3205. }
  3206. this.inc('pre', identifier)
  3207. break
  3208. case 'major':
  3209. // If this is a pre-major version, bump up to the same major version.
  3210. // Otherwise increment major.
  3211. // 1.0.0-5 bumps to 1.0.0
  3212. // 1.1.0 bumps to 2.0.0
  3213. if (this.minor !== 0 ||
  3214. this.patch !== 0 ||
  3215. this.prerelease.length === 0) {
  3216. this.major++
  3217. }
  3218. this.minor = 0
  3219. this.patch = 0
  3220. this.prerelease = []
  3221. break
  3222. case 'minor':
  3223. // If this is a pre-minor version, bump up to the same minor version.
  3224. // Otherwise increment minor.
  3225. // 1.2.0-5 bumps to 1.2.0
  3226. // 1.2.1 bumps to 1.3.0
  3227. if (this.patch !== 0 || this.prerelease.length === 0) {
  3228. this.minor++
  3229. }
  3230. this.patch = 0
  3231. this.prerelease = []
  3232. break
  3233. case 'patch':
  3234. // If this is not a pre-release version, it will increment the patch.
  3235. // If it is a pre-release it will bump up to the same patch version.
  3236. // 1.2.0-5 patches to 1.2.0
  3237. // 1.2.0 patches to 1.2.1
  3238. if (this.prerelease.length === 0) {
  3239. this.patch++
  3240. }
  3241. this.prerelease = []
  3242. break
  3243. // This probably shouldn't be used publicly.
  3244. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  3245. case 'pre':
  3246. if (this.prerelease.length === 0) {
  3247. this.prerelease = [0]
  3248. } else {
  3249. var i = this.prerelease.length
  3250. while (--i >= 0) {
  3251. if (typeof this.prerelease[i] === 'number') {
  3252. this.prerelease[i]++
  3253. i = -2
  3254. }
  3255. }
  3256. if (i === -1) {
  3257. // didn't increment anything
  3258. this.prerelease.push(0)
  3259. }
  3260. }
  3261. if (identifier) {
  3262. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  3263. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  3264. if (this.prerelease[0] === identifier) {
  3265. if (isNaN(this.prerelease[1])) {
  3266. this.prerelease = [identifier, 0]
  3267. }
  3268. } else {
  3269. this.prerelease = [identifier, 0]
  3270. }
  3271. }
  3272. break
  3273. default:
  3274. throw new Error('invalid increment argument: ' + release)
  3275. }
  3276. this.format()
  3277. this.raw = this.version
  3278. return this
  3279. }
  3280. exports.inc = inc
  3281. function inc (version, release, loose, identifier) {
  3282. if (typeof (loose) === 'string') {
  3283. identifier = loose
  3284. loose = undefined
  3285. }
  3286. try {
  3287. return new SemVer(version, loose).inc(release, identifier).version
  3288. } catch (er) {
  3289. return null
  3290. }
  3291. }
  3292. exports.diff = diff
  3293. function diff (version1, version2) {
  3294. if (eq(version1, version2)) {
  3295. return null
  3296. } else {
  3297. var v1 = parse(version1)
  3298. var v2 = parse(version2)
  3299. var prefix = ''
  3300. if (v1.prerelease.length || v2.prerelease.length) {
  3301. prefix = 'pre'
  3302. var defaultResult = 'prerelease'
  3303. }
  3304. for (var key in v1) {
  3305. if (key === 'major' || key === 'minor' || key === 'patch') {
  3306. if (v1[key] !== v2[key]) {
  3307. return prefix + key
  3308. }
  3309. }
  3310. }
  3311. return defaultResult // may be undefined
  3312. }
  3313. }
  3314. exports.compareIdentifiers = compareIdentifiers
  3315. var numeric = /^[0-9]+$/
  3316. function compareIdentifiers (a, b) {
  3317. var anum = numeric.test(a)
  3318. var bnum = numeric.test(b)
  3319. if (anum && bnum) {
  3320. a = +a
  3321. b = +b
  3322. }
  3323. return a === b ? 0
  3324. : (anum && !bnum) ? -1
  3325. : (bnum && !anum) ? 1
  3326. : a < b ? -1
  3327. : 1
  3328. }
  3329. exports.rcompareIdentifiers = rcompareIdentifiers
  3330. function rcompareIdentifiers (a, b) {
  3331. return compareIdentifiers(b, a)
  3332. }
  3333. exports.major = major
  3334. function major (a, loose) {
  3335. return new SemVer(a, loose).major
  3336. }
  3337. exports.minor = minor
  3338. function minor (a, loose) {
  3339. return new SemVer(a, loose).minor
  3340. }
  3341. exports.patch = patch
  3342. function patch (a, loose) {
  3343. return new SemVer(a, loose).patch
  3344. }
  3345. exports.compare = compare
  3346. function compare (a, b, loose) {
  3347. return new SemVer(a, loose).compare(new SemVer(b, loose))
  3348. }
  3349. exports.compareLoose = compareLoose
  3350. function compareLoose (a, b) {
  3351. return compare(a, b, true)
  3352. }
  3353. exports.rcompare = rcompare
  3354. function rcompare (a, b, loose) {
  3355. return compare(b, a, loose)
  3356. }
  3357. exports.sort = sort
  3358. function sort (list, loose) {
  3359. return list.sort(function (a, b) {
  3360. return exports.compare(a, b, loose)
  3361. })
  3362. }
  3363. exports.rsort = rsort
  3364. function rsort (list, loose) {
  3365. return list.sort(function (a, b) {
  3366. return exports.rcompare(a, b, loose)
  3367. })
  3368. }
  3369. exports.gt = gt
  3370. function gt (a, b, loose) {
  3371. return compare(a, b, loose) > 0
  3372. }
  3373. exports.lt = lt
  3374. function lt (a, b, loose) {
  3375. return compare(a, b, loose) < 0
  3376. }
  3377. exports.eq = eq
  3378. function eq (a, b, loose) {
  3379. return compare(a, b, loose) === 0
  3380. }
  3381. exports.neq = neq
  3382. function neq (a, b, loose) {
  3383. return compare(a, b, loose) !== 0
  3384. }
  3385. exports.gte = gte
  3386. function gte (a, b, loose) {
  3387. return compare(a, b, loose) >= 0
  3388. }
  3389. exports.lte = lte
  3390. function lte (a, b, loose) {
  3391. return compare(a, b, loose) <= 0
  3392. }
  3393. exports.cmp = cmp
  3394. function cmp (a, op, b, loose) {
  3395. switch (op) {
  3396. case '===':
  3397. if (typeof a === 'object')
  3398. a = a.version
  3399. if (typeof b === 'object')
  3400. b = b.version
  3401. return a === b
  3402. case '!==':
  3403. if (typeof a === 'object')
  3404. a = a.version
  3405. if (typeof b === 'object')
  3406. b = b.version
  3407. return a !== b
  3408. case '':
  3409. case '=':
  3410. case '==':
  3411. return eq(a, b, loose)
  3412. case '!=':
  3413. return neq(a, b, loose)
  3414. case '>':
  3415. return gt(a, b, loose)
  3416. case '>=':
  3417. return gte(a, b, loose)
  3418. case '<':
  3419. return lt(a, b, loose)
  3420. case '<=':
  3421. return lte(a, b, loose)
  3422. default:
  3423. throw new TypeError('Invalid operator: ' + op)
  3424. }
  3425. }
  3426. exports.Comparator = Comparator
  3427. function Comparator (comp, options) {
  3428. if (!options || typeof options !== 'object') {
  3429. options = {
  3430. loose: !!options,
  3431. includePrerelease: false
  3432. }
  3433. }
  3434. if (comp instanceof Comparator) {
  3435. if (comp.loose === !!options.loose) {
  3436. return comp
  3437. } else {
  3438. comp = comp.value
  3439. }
  3440. }
  3441. if (!(this instanceof Comparator)) {
  3442. return new Comparator(comp, options)
  3443. }
  3444. debug('comparator', comp, options)
  3445. this.options = options
  3446. this.loose = !!options.loose
  3447. this.parse(comp)
  3448. if (this.semver === ANY) {
  3449. this.value = ''
  3450. } else {
  3451. this.value = this.operator + this.semver.version
  3452. }
  3453. debug('comp', this)
  3454. }
  3455. var ANY = {}
  3456. Comparator.prototype.parse = function (comp) {
  3457. var r = this.options.loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
  3458. var m = comp.match(r)
  3459. if (!m) {
  3460. throw new TypeError('Invalid comparator: ' + comp)
  3461. }
  3462. this.operator = m[1]
  3463. if (this.operator === '=') {
  3464. this.operator = ''
  3465. }
  3466. // if it literally is just '>' or '' then allow anything.
  3467. if (!m[2]) {
  3468. this.semver = ANY
  3469. } else {
  3470. this.semver = new SemVer(m[2], this.options.loose)
  3471. }
  3472. }
  3473. Comparator.prototype.toString = function () {
  3474. return this.value
  3475. }
  3476. Comparator.prototype.test = function (version) {
  3477. debug('Comparator.test', version, this.options.loose)
  3478. if (this.semver === ANY) {
  3479. return true
  3480. }
  3481. if (typeof version === 'string') {
  3482. version = new SemVer(version, this.options)
  3483. }
  3484. return cmp(version, this.operator, this.semver, this.options)
  3485. }
  3486. Comparator.prototype.intersects = function (comp, options) {
  3487. if (!(comp instanceof Comparator)) {
  3488. throw new TypeError('a Comparator is required')
  3489. }
  3490. if (!options || typeof options !== 'object') {
  3491. options = {
  3492. loose: !!options,
  3493. includePrerelease: false
  3494. }
  3495. }
  3496. var rangeTmp
  3497. if (this.operator === '') {
  3498. rangeTmp = new Range(comp.value, options)
  3499. return satisfies(this.value, rangeTmp, options)
  3500. } else if (comp.operator === '') {
  3501. rangeTmp = new Range(this.value, options)
  3502. return satisfies(comp.semver, rangeTmp, options)
  3503. }
  3504. var sameDirectionIncreasing =
  3505. (this.operator === '>=' || this.operator === '>') &&
  3506. (comp.operator === '>=' || comp.operator === '>')
  3507. var sameDirectionDecreasing =
  3508. (this.operator === '<=' || this.operator === '<') &&
  3509. (comp.operator === '<=' || comp.operator === '<')
  3510. var sameSemVer = this.semver.version === comp.semver.version
  3511. var differentDirectionsInclusive =
  3512. (this.operator === '>=' || this.operator === '<=') &&
  3513. (comp.operator === '>=' || comp.operator === '<=')
  3514. var oppositeDirectionsLessThan =
  3515. cmp(this.semver, '<', comp.semver, options) &&
  3516. ((this.operator === '>=' || this.operator === '>') &&
  3517. (comp.operator === '<=' || comp.operator === '<'))
  3518. var oppositeDirectionsGreaterThan =
  3519. cmp(this.semver, '>', comp.semver, options) &&
  3520. ((this.operator === '<=' || this.operator === '<') &&
  3521. (comp.operator === '>=' || comp.operator === '>'))
  3522. return sameDirectionIncreasing || sameDirectionDecreasing ||
  3523. (sameSemVer && differentDirectionsInclusive) ||
  3524. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  3525. }
  3526. exports.Range = Range
  3527. function Range (range, options) {
  3528. if (!options || typeof options !== 'object') {
  3529. options = {
  3530. loose: !!options,
  3531. includePrerelease: false
  3532. }
  3533. }
  3534. if (range instanceof Range) {
  3535. if (range.loose === !!options.loose &&
  3536. range.includePrerelease === !!options.includePrerelease) {
  3537. return range
  3538. } else {
  3539. return new Range(range.raw, options)
  3540. }
  3541. }
  3542. if (range instanceof Comparator) {
  3543. return new Range(range.value, options)
  3544. }
  3545. if (!(this instanceof Range)) {
  3546. return new Range(range, options)
  3547. }
  3548. this.options = options
  3549. this.loose = !!options.loose
  3550. this.includePrerelease = !!options.includePrerelease
  3551. // First, split based on boolean or ||
  3552. this.raw = range
  3553. this.set = range.split(/\s*\|\|\s*/).map(function (range) {
  3554. return this.parseRange(range.trim())
  3555. }, this).filter(function (c) {
  3556. // throw out any that are not relevant for whatever reason
  3557. return c.length
  3558. })
  3559. if (!this.set.length) {
  3560. throw new TypeError('Invalid SemVer Range: ' + range)
  3561. }
  3562. this.format()
  3563. }
  3564. Range.prototype.format = function () {
  3565. this.range = this.set.map(function (comps) {
  3566. return comps.join(' ').trim()
  3567. }).join('||').trim()
  3568. return this.range
  3569. }
  3570. Range.prototype.toString = function () {
  3571. return this.range
  3572. }
  3573. Range.prototype.parseRange = function (range) {
  3574. var loose = this.options.loose
  3575. range = range.trim()
  3576. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  3577. var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE]
  3578. range = range.replace(hr, hyphenReplace)
  3579. debug('hyphen replace', range)
  3580. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  3581. range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace)
  3582. debug('comparator trim', range, re[COMPARATORTRIM])
  3583. // `~ 1.2.3` => `~1.2.3`
  3584. range = range.replace(re[TILDETRIM], tildeTrimReplace)
  3585. // `^ 1.2.3` => `^1.2.3`
  3586. range = range.replace(re[CARETTRIM], caretTrimReplace)
  3587. // normalize spaces
  3588. range = range.split(/\s+/).join(' ')
  3589. // At this point, the range is completely trimmed and
  3590. // ready to be split into comparators.
  3591. var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
  3592. var set = range.split(' ').map(function (comp) {
  3593. return parseComparator(comp, this.options)
  3594. }, this).join(' ').split(/\s+/)
  3595. if (this.options.loose) {
  3596. // in loose mode, throw out any that are not valid comparators
  3597. set = set.filter(function (comp) {
  3598. return !!comp.match(compRe)
  3599. })
  3600. }
  3601. set = set.map(function (comp) {
  3602. return new Comparator(comp, this.options)
  3603. }, this)
  3604. return set
  3605. }
  3606. Range.prototype.intersects = function (range, options) {
  3607. if (!(range instanceof Range)) {
  3608. throw new TypeError('a Range is required')
  3609. }
  3610. return this.set.some(function (thisComparators) {
  3611. return thisComparators.every(function (thisComparator) {
  3612. return range.set.some(function (rangeComparators) {
  3613. return rangeComparators.every(function (rangeComparator) {
  3614. return thisComparator.intersects(rangeComparator, options)
  3615. })
  3616. })
  3617. })
  3618. })
  3619. }
  3620. // Mostly just for testing and legacy API reasons
  3621. exports.toComparators = toComparators
  3622. function toComparators (range, options) {
  3623. return new Range(range, options).set.map(function (comp) {
  3624. return comp.map(function (c) {
  3625. return c.value
  3626. }).join(' ').trim().split(' ')
  3627. })
  3628. }
  3629. // comprised of xranges, tildes, stars, and gtlt's at this point.
  3630. // already replaced the hyphen ranges
  3631. // turn into a set of JUST comparators.
  3632. function parseComparator (comp, options) {
  3633. debug('comp', comp, options)
  3634. comp = replaceCarets(comp, options)
  3635. debug('caret', comp)
  3636. comp = replaceTildes(comp, options)
  3637. debug('tildes', comp)
  3638. comp = replaceXRanges(comp, options)
  3639. debug('xrange', comp)
  3640. comp = replaceStars(comp, options)
  3641. debug('stars', comp)
  3642. return comp
  3643. }
  3644. function isX (id) {
  3645. return !id || id.toLowerCase() === 'x' || id === '*'
  3646. }
  3647. // ~, ~> --> * (any, kinda silly)
  3648. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  3649. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  3650. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  3651. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  3652. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  3653. function replaceTildes (comp, options) {
  3654. return comp.trim().split(/\s+/).map(function (comp) {
  3655. return replaceTilde(comp, options)
  3656. }).join(' ')
  3657. }
  3658. function replaceTilde (comp, options) {
  3659. var r = options.loose ? re[TILDELOOSE] : re[TILDE]
  3660. return comp.replace(r, function (_, M, m, p, pr) {
  3661. debug('tilde', comp, _, M, m, p, pr)
  3662. var ret
  3663. if (isX(M)) {
  3664. ret = ''
  3665. } else if (isX(m)) {
  3666. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  3667. } else if (isX(p)) {
  3668. // ~1.2 == >=1.2.0 <1.3.0
  3669. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  3670. } else if (pr) {
  3671. debug('replaceTilde pr', pr)
  3672. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  3673. ' <' + M + '.' + (+m + 1) + '.0'
  3674. } else {
  3675. // ~1.2.3 == >=1.2.3 <1.3.0
  3676. ret = '>=' + M + '.' + m + '.' + p +
  3677. ' <' + M + '.' + (+m + 1) + '.0'
  3678. }
  3679. debug('tilde return', ret)
  3680. return ret
  3681. })
  3682. }
  3683. // ^ --> * (any, kinda silly)
  3684. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  3685. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  3686. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  3687. // ^1.2.3 --> >=1.2.3 <2.0.0
  3688. // ^1.2.0 --> >=1.2.0 <2.0.0
  3689. function replaceCarets (comp, options) {
  3690. return comp.trim().split(/\s+/).map(function (comp) {
  3691. return replaceCaret(comp, options)
  3692. }).join(' ')
  3693. }
  3694. function replaceCaret (comp, options) {
  3695. debug('caret', comp, options)
  3696. var r = options.loose ? re[CARETLOOSE] : re[CARET]
  3697. return comp.replace(r, function (_, M, m, p, pr) {
  3698. debug('caret', comp, _, M, m, p, pr)
  3699. var ret
  3700. if (isX(M)) {
  3701. ret = ''
  3702. } else if (isX(m)) {
  3703. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  3704. } else if (isX(p)) {
  3705. if (M === '0') {
  3706. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  3707. } else {
  3708. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  3709. }
  3710. } else if (pr) {
  3711. debug('replaceCaret pr', pr)
  3712. if (M === '0') {
  3713. if (m === '0') {
  3714. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  3715. ' <' + M + '.' + m + '.' + (+p + 1)
  3716. } else {
  3717. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  3718. ' <' + M + '.' + (+m + 1) + '.0'
  3719. }
  3720. } else {
  3721. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  3722. ' <' + (+M + 1) + '.0.0'
  3723. }
  3724. } else {
  3725. debug('no pr')
  3726. if (M === '0') {
  3727. if (m === '0') {
  3728. ret = '>=' + M + '.' + m + '.' + p +
  3729. ' <' + M + '.' + m + '.' + (+p + 1)
  3730. } else {
  3731. ret = '>=' + M + '.' + m + '.' + p +
  3732. ' <' + M + '.' + (+m + 1) + '.0'
  3733. }
  3734. } else {
  3735. ret = '>=' + M + '.' + m + '.' + p +
  3736. ' <' + (+M + 1) + '.0.0'
  3737. }
  3738. }
  3739. debug('caret return', ret)
  3740. return ret
  3741. })
  3742. }
  3743. function replaceXRanges (comp, options) {
  3744. debug('replaceXRanges', comp, options)
  3745. return comp.split(/\s+/).map(function (comp) {
  3746. return replaceXRange(comp, options)
  3747. }).join(' ')
  3748. }
  3749. function replaceXRange (comp, options) {
  3750. comp = comp.trim()
  3751. var r = options.loose ? re[XRANGELOOSE] : re[XRANGE]
  3752. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  3753. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  3754. var xM = isX(M)
  3755. var xm = xM || isX(m)
  3756. var xp = xm || isX(p)
  3757. var anyX = xp
  3758. if (gtlt === '=' && anyX) {
  3759. gtlt = ''
  3760. }
  3761. if (xM) {
  3762. if (gtlt === '>' || gtlt === '<') {
  3763. // nothing is allowed
  3764. ret = '<0.0.0'
  3765. } else {
  3766. // nothing is forbidden
  3767. ret = '*'
  3768. }
  3769. } else if (gtlt && anyX) {
  3770. // we know patch is an x, because we have any x at all.
  3771. // replace X with 0
  3772. if (xm) {
  3773. m = 0
  3774. }
  3775. p = 0
  3776. if (gtlt === '>') {
  3777. // >1 => >=2.0.0
  3778. // >1.2 => >=1.3.0
  3779. // >1.2.3 => >= 1.2.4
  3780. gtlt = '>='
  3781. if (xm) {
  3782. M = +M + 1
  3783. m = 0
  3784. p = 0
  3785. } else {
  3786. m = +m + 1
  3787. p = 0
  3788. }
  3789. } else if (gtlt === '<=') {
  3790. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  3791. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  3792. gtlt = '<'
  3793. if (xm) {
  3794. M = +M + 1
  3795. } else {
  3796. m = +m + 1
  3797. }
  3798. }
  3799. ret = gtlt + M + '.' + m + '.' + p
  3800. } else if (xm) {
  3801. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  3802. } else if (xp) {
  3803. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  3804. }
  3805. debug('xRange return', ret)
  3806. return ret
  3807. })
  3808. }
  3809. // Because * is AND-ed with everything else in the comparator,
  3810. // and '' means "any version", just remove the *s entirely.
  3811. function replaceStars (comp, options) {
  3812. debug('replaceStars', comp, options)
  3813. // Looseness is ignored here. star is always as loose as it gets!
  3814. return comp.trim().replace(re[STAR], '')
  3815. }
  3816. // This function is passed to string.replace(re[HYPHENRANGE])
  3817. // M, m, patch, prerelease, build
  3818. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  3819. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  3820. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  3821. function hyphenReplace ($0,
  3822. from, fM, fm, fp, fpr, fb,
  3823. to, tM, tm, tp, tpr, tb) {
  3824. if (isX(fM)) {
  3825. from = ''
  3826. } else if (isX(fm)) {
  3827. from = '>=' + fM + '.0.0'
  3828. } else if (isX(fp)) {
  3829. from = '>=' + fM + '.' + fm + '.0'
  3830. } else {
  3831. from = '>=' + from
  3832. }
  3833. if (isX(tM)) {
  3834. to = ''
  3835. } else if (isX(tm)) {
  3836. to = '<' + (+tM + 1) + '.0.0'
  3837. } else if (isX(tp)) {
  3838. to = '<' + tM + '.' + (+tm + 1) + '.0'
  3839. } else if (tpr) {
  3840. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  3841. } else {
  3842. to = '<=' + to
  3843. }
  3844. return (from + ' ' + to).trim()
  3845. }
  3846. // if ANY of the sets match ALL of its comparators, then pass
  3847. Range.prototype.test = function (version) {
  3848. if (!version) {
  3849. return false
  3850. }
  3851. if (typeof version === 'string') {
  3852. version = new SemVer(version, this.options)
  3853. }
  3854. for (var i = 0; i < this.set.length; i++) {
  3855. if (testSet(this.set[i], version, this.options)) {
  3856. return true
  3857. }
  3858. }
  3859. return false
  3860. }
  3861. function testSet (set, version, options) {
  3862. for (var i = 0; i < set.length; i++) {
  3863. if (!set[i].test(version)) {
  3864. return false
  3865. }
  3866. }
  3867. if (version.prerelease.length && !options.includePrerelease) {
  3868. // Find the set of versions that are allowed to have prereleases
  3869. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  3870. // That should allow `1.2.3-pr.2` to pass.
  3871. // However, `1.2.4-alpha.notready` should NOT be allowed,
  3872. // even though it's within the range set by the comparators.
  3873. for (i = 0; i < set.length; i++) {
  3874. debug(set[i].semver)
  3875. if (set[i].semver === ANY) {
  3876. continue
  3877. }
  3878. if (set[i].semver.prerelease.length > 0) {
  3879. var allowed = set[i].semver
  3880. if (allowed.major === version.major &&
  3881. allowed.minor === version.minor &&
  3882. allowed.patch === version.patch) {
  3883. return true
  3884. }
  3885. }
  3886. }
  3887. // Version has a -pre, but it's not one of the ones we like.
  3888. return false
  3889. }
  3890. return true
  3891. }
  3892. exports.satisfies = satisfies
  3893. function satisfies (version, range, options) {
  3894. try {
  3895. range = new Range(range, options)
  3896. } catch (er) {
  3897. return false
  3898. }
  3899. return range.test(version)
  3900. }
  3901. exports.maxSatisfying = maxSatisfying
  3902. function maxSatisfying (versions, range, options) {
  3903. var max = null
  3904. var maxSV = null
  3905. try {
  3906. var rangeObj = new Range(range, options)
  3907. } catch (er) {
  3908. return null
  3909. }
  3910. versions.forEach(function (v) {
  3911. if (rangeObj.test(v)) {
  3912. // satisfies(v, range, options)
  3913. if (!max || maxSV.compare(v) === -1) {
  3914. // compare(max, v, true)
  3915. max = v
  3916. maxSV = new SemVer(max, options)
  3917. }
  3918. }
  3919. })
  3920. return max
  3921. }
  3922. exports.minSatisfying = minSatisfying
  3923. function minSatisfying (versions, range, options) {
  3924. var min = null
  3925. var minSV = null
  3926. try {
  3927. var rangeObj = new Range(range, options)
  3928. } catch (er) {
  3929. return null
  3930. }
  3931. versions.forEach(function (v) {
  3932. if (rangeObj.test(v)) {
  3933. // satisfies(v, range, options)
  3934. if (!min || minSV.compare(v) === 1) {
  3935. // compare(min, v, true)
  3936. min = v
  3937. minSV = new SemVer(min, options)
  3938. }
  3939. }
  3940. })
  3941. return min
  3942. }
  3943. exports.minVersion = minVersion
  3944. function minVersion (range, loose) {
  3945. range = new Range(range, loose)
  3946. var minver = new SemVer('0.0.0')
  3947. if (range.test(minver)) {
  3948. return minver
  3949. }
  3950. minver = new SemVer('0.0.0-0')
  3951. if (range.test(minver)) {
  3952. return minver
  3953. }
  3954. minver = null
  3955. for (var i = 0; i < range.set.length; ++i) {
  3956. var comparators = range.set[i]
  3957. comparators.forEach(function (comparator) {
  3958. // Clone to avoid manipulating the comparator's semver object.
  3959. var compver = new SemVer(comparator.semver.version)
  3960. switch (comparator.operator) {
  3961. case '>':
  3962. if (compver.prerelease.length === 0) {
  3963. compver.patch++
  3964. } else {
  3965. compver.prerelease.push(0)
  3966. }
  3967. compver.raw = compver.format()
  3968. /* fallthrough */
  3969. case '':
  3970. case '>=':
  3971. if (!minver || gt(minver, compver)) {
  3972. minver = compver
  3973. }
  3974. break
  3975. case '<':
  3976. case '<=':
  3977. /* Ignore maximum versions */
  3978. break
  3979. /* istanbul ignore next */
  3980. default:
  3981. throw new Error('Unexpected operation: ' + comparator.operator)
  3982. }
  3983. })
  3984. }
  3985. if (minver && range.test(minver)) {
  3986. return minver
  3987. }
  3988. return null
  3989. }
  3990. exports.validRange = validRange
  3991. function validRange (range, options) {
  3992. try {
  3993. // Return '*' instead of '' so that truthiness works.
  3994. // This will throw if it's invalid anyway
  3995. return new Range(range, options).range || '*'
  3996. } catch (er) {
  3997. return null
  3998. }
  3999. }
  4000. // Determine if version is less than all the versions possible in the range
  4001. exports.ltr = ltr
  4002. function ltr (version, range, options) {
  4003. return outside(version, range, '<', options)
  4004. }
  4005. // Determine if version is greater than all the versions possible in the range.
  4006. exports.gtr = gtr
  4007. function gtr (version, range, options) {
  4008. return outside(version, range, '>', options)
  4009. }
  4010. exports.outside = outside
  4011. function outside (version, range, hilo, options) {
  4012. version = new SemVer(version, options)
  4013. range = new Range(range, options)
  4014. var gtfn, ltefn, ltfn, comp, ecomp
  4015. switch (hilo) {
  4016. case '>':
  4017. gtfn = gt
  4018. ltefn = lte
  4019. ltfn = lt
  4020. comp = '>'
  4021. ecomp = '>='
  4022. break
  4023. case '<':
  4024. gtfn = lt
  4025. ltefn = gte
  4026. ltfn = gt
  4027. comp = '<'
  4028. ecomp = '<='
  4029. break
  4030. default:
  4031. throw new TypeError('Must provide a hilo val of "<" or ">"')
  4032. }
  4033. // If it satisifes the range it is not outside
  4034. if (satisfies(version, range, options)) {
  4035. return false
  4036. }
  4037. // From now on, variable terms are as if we're in "gtr" mode.
  4038. // but note that everything is flipped for the "ltr" function.
  4039. for (var i = 0; i < range.set.length; ++i) {
  4040. var comparators = range.set[i]
  4041. var high = null
  4042. var low = null
  4043. comparators.forEach(function (comparator) {
  4044. if (comparator.semver === ANY) {
  4045. comparator = new Comparator('>=0.0.0')
  4046. }
  4047. high = high || comparator
  4048. low = low || comparator
  4049. if (gtfn(comparator.semver, high.semver, options)) {
  4050. high = comparator
  4051. } else if (ltfn(comparator.semver, low.semver, options)) {
  4052. low = comparator
  4053. }
  4054. })
  4055. // If the edge version comparator has a operator then our version
  4056. // isn't outside it
  4057. if (high.operator === comp || high.operator === ecomp) {
  4058. return false
  4059. }
  4060. // If the lowest version comparator has an operator and our version
  4061. // is less than it then it isn't higher than the range
  4062. if ((!low.operator || low.operator === comp) &&
  4063. ltefn(version, low.semver)) {
  4064. return false
  4065. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  4066. return false
  4067. }
  4068. }
  4069. return true
  4070. }
  4071. exports.prerelease = prerelease
  4072. function prerelease (version, options) {
  4073. var parsed = parse(version, options)
  4074. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  4075. }
  4076. exports.intersects = intersects
  4077. function intersects (r1, r2, options) {
  4078. r1 = new Range(r1, options)
  4079. r2 = new Range(r2, options)
  4080. return r1.intersects(r2)
  4081. }
  4082. exports.coerce = coerce
  4083. function coerce (version) {
  4084. if (version instanceof SemVer) {
  4085. return version
  4086. }
  4087. if (typeof version !== 'string') {
  4088. return null
  4089. }
  4090. var match = version.match(re[COERCE])
  4091. if (match == null) {
  4092. return null
  4093. }
  4094. return parse(match[1] +
  4095. '.' + (match[2] || '0') +
  4096. '.' + (match[3] || '0'))
  4097. }
  4098. /***/ }),
  4099. /***/ 289:
  4100. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  4101. "use strict";
  4102. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4103. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4104. return new (P || (P = Promise))(function (resolve, reject) {
  4105. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4106. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4107. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4108. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4109. });
  4110. };
  4111. var __importStar = (this && this.__importStar) || function (mod) {
  4112. if (mod && mod.__esModule) return mod;
  4113. var result = {};
  4114. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  4115. result["default"] = mod;
  4116. return result;
  4117. };
  4118. Object.defineProperty(exports, "__esModule", { value: true });
  4119. const core = __importStar(__webpack_require__(470));
  4120. const exec = __importStar(__webpack_require__(986));
  4121. const fshelper = __importStar(__webpack_require__(618));
  4122. const io = __importStar(__webpack_require__(1));
  4123. const path = __importStar(__webpack_require__(622));
  4124. const retryHelper = __importStar(__webpack_require__(587));
  4125. const git_version_1 = __webpack_require__(559);
  4126. // Auth header not supported before 2.9
  4127. // Wire protocol v2 not supported before 2.18
  4128. exports.MinimumGitVersion = new git_version_1.GitVersion('2.18');
  4129. function CreateCommandManager(workingDirectory, lfs) {
  4130. return __awaiter(this, void 0, void 0, function* () {
  4131. return yield GitCommandManager.createCommandManager(workingDirectory, lfs);
  4132. });
  4133. }
  4134. exports.CreateCommandManager = CreateCommandManager;
  4135. class GitCommandManager {
  4136. // Private constructor; use createCommandManager()
  4137. constructor() {
  4138. this.gitEnv = {
  4139. GIT_TERMINAL_PROMPT: '0',
  4140. GCM_INTERACTIVE: 'Never' // Disable prompting for git credential manager
  4141. };
  4142. this.gitPath = '';
  4143. this.lfs = false;
  4144. this.workingDirectory = '';
  4145. }
  4146. branchDelete(remote, branch) {
  4147. return __awaiter(this, void 0, void 0, function* () {
  4148. const args = ['branch', '--delete', '--force'];
  4149. if (remote) {
  4150. args.push('--remote');
  4151. }
  4152. args.push(branch);
  4153. yield this.execGit(args);
  4154. });
  4155. }
  4156. branchExists(remote, pattern) {
  4157. return __awaiter(this, void 0, void 0, function* () {
  4158. const args = ['branch', '--list'];
  4159. if (remote) {
  4160. args.push('--remote');
  4161. }
  4162. args.push(pattern);
  4163. const output = yield this.execGit(args);
  4164. return !!output.stdout.trim();
  4165. });
  4166. }
  4167. branchList(remote) {
  4168. return __awaiter(this, void 0, void 0, function* () {
  4169. const result = [];
  4170. // Note, this implementation uses "rev-parse --symbolic" because the output from
  4171. // "branch --list" is more difficult when in a detached HEAD state.
  4172. const args = ['rev-parse', '--symbolic'];
  4173. if (remote) {
  4174. args.push('--remotes=origin');
  4175. }
  4176. else {
  4177. args.push('--branches');
  4178. }
  4179. const output = yield this.execGit(args);
  4180. for (let branch of output.stdout.trim().split('\n')) {
  4181. branch = branch.trim();
  4182. if (branch) {
  4183. result.push(branch);
  4184. }
  4185. }
  4186. return result;
  4187. });
  4188. }
  4189. checkout(ref, startPoint) {
  4190. return __awaiter(this, void 0, void 0, function* () {
  4191. const args = ['checkout', '--progress', '--force'];
  4192. if (startPoint) {
  4193. args.push('-B', ref, startPoint);
  4194. }
  4195. else {
  4196. args.push(ref);
  4197. }
  4198. yield this.execGit(args);
  4199. });
  4200. }
  4201. checkoutDetach() {
  4202. return __awaiter(this, void 0, void 0, function* () {
  4203. const args = ['checkout', '--detach'];
  4204. yield this.execGit(args);
  4205. });
  4206. }
  4207. config(configKey, configValue) {
  4208. return __awaiter(this, void 0, void 0, function* () {
  4209. yield this.execGit(['config', configKey, configValue]);
  4210. });
  4211. }
  4212. configExists(configKey) {
  4213. return __awaiter(this, void 0, void 0, function* () {
  4214. const pattern = configKey.replace(/[^a-zA-Z0-9_]/g, x => {
  4215. return `\\${x}`;
  4216. });
  4217. const output = yield this.execGit(['config', '--name-only', '--get-regexp', pattern], true);
  4218. return output.exitCode === 0;
  4219. });
  4220. }
  4221. fetch(fetchDepth, refSpec) {
  4222. return __awaiter(this, void 0, void 0, function* () {
  4223. const args = [
  4224. '-c',
  4225. 'protocol.version=2',
  4226. 'fetch',
  4227. '--no-tags',
  4228. '--prune',
  4229. '--progress',
  4230. '--no-recurse-submodules'
  4231. ];
  4232. if (fetchDepth > 0) {
  4233. args.push(`--depth=${fetchDepth}`);
  4234. }
  4235. else if (fshelper.fileExistsSync(path.join(this.workingDirectory, '.git', 'shallow'))) {
  4236. args.push('--unshallow');
  4237. }
  4238. args.push('origin');
  4239. for (const arg of refSpec) {
  4240. args.push(arg);
  4241. }
  4242. const that = this;
  4243. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  4244. yield that.execGit(args);
  4245. }));
  4246. });
  4247. }
  4248. getWorkingDirectory() {
  4249. return this.workingDirectory;
  4250. }
  4251. init() {
  4252. return __awaiter(this, void 0, void 0, function* () {
  4253. yield this.execGit(['init', this.workingDirectory]);
  4254. });
  4255. }
  4256. isDetached() {
  4257. return __awaiter(this, void 0, void 0, function* () {
  4258. // Note, this implementation uses "branch --show-current" because
  4259. // "rev-parse --symbolic-full-name HEAD" can fail on a new repo
  4260. // with nothing checked out.
  4261. const output = yield this.execGit(['branch', '--show-current']);
  4262. return output.stdout.trim() === '';
  4263. });
  4264. }
  4265. lfsFetch(ref) {
  4266. return __awaiter(this, void 0, void 0, function* () {
  4267. const args = ['lfs', 'fetch', 'origin', ref];
  4268. const that = this;
  4269. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  4270. yield that.execGit(args);
  4271. }));
  4272. });
  4273. }
  4274. lfsInstall() {
  4275. return __awaiter(this, void 0, void 0, function* () {
  4276. yield this.execGit(['lfs', 'install', '--local']);
  4277. });
  4278. }
  4279. log1() {
  4280. return __awaiter(this, void 0, void 0, function* () {
  4281. yield this.execGit(['log', '-1']);
  4282. });
  4283. }
  4284. remoteAdd(remoteName, remoteUrl) {
  4285. return __awaiter(this, void 0, void 0, function* () {
  4286. yield this.execGit(['remote', 'add', remoteName, remoteUrl]);
  4287. });
  4288. }
  4289. tagExists(pattern) {
  4290. return __awaiter(this, void 0, void 0, function* () {
  4291. const output = yield this.execGit(['tag', '--list', pattern]);
  4292. return !!output.stdout.trim();
  4293. });
  4294. }
  4295. tryClean() {
  4296. return __awaiter(this, void 0, void 0, function* () {
  4297. const output = yield this.execGit(['clean', '-ffdx'], true);
  4298. return output.exitCode === 0;
  4299. });
  4300. }
  4301. tryConfigUnset(configKey) {
  4302. return __awaiter(this, void 0, void 0, function* () {
  4303. const output = yield this.execGit(['config', '--unset-all', configKey], true);
  4304. return output.exitCode === 0;
  4305. });
  4306. }
  4307. tryDisableAutomaticGarbageCollection() {
  4308. return __awaiter(this, void 0, void 0, function* () {
  4309. const output = yield this.execGit(['config', 'gc.auto', '0'], true);
  4310. return output.exitCode === 0;
  4311. });
  4312. }
  4313. tryGetFetchUrl() {
  4314. return __awaiter(this, void 0, void 0, function* () {
  4315. const output = yield this.execGit(['config', '--get', 'remote.origin.url'], true);
  4316. if (output.exitCode !== 0) {
  4317. return '';
  4318. }
  4319. const stdout = output.stdout.trim();
  4320. if (stdout.includes('\n')) {
  4321. return '';
  4322. }
  4323. return stdout;
  4324. });
  4325. }
  4326. tryReset() {
  4327. return __awaiter(this, void 0, void 0, function* () {
  4328. const output = yield this.execGit(['reset', '--hard', 'HEAD'], true);
  4329. return output.exitCode === 0;
  4330. });
  4331. }
  4332. static createCommandManager(workingDirectory, lfs) {
  4333. return __awaiter(this, void 0, void 0, function* () {
  4334. const result = new GitCommandManager();
  4335. yield result.initializeCommandManager(workingDirectory, lfs);
  4336. return result;
  4337. });
  4338. }
  4339. execGit(args, allowAllExitCodes = false) {
  4340. return __awaiter(this, void 0, void 0, function* () {
  4341. fshelper.directoryExistsSync(this.workingDirectory, true);
  4342. const result = new GitOutput();
  4343. const env = {};
  4344. for (const key of Object.keys(process.env)) {
  4345. env[key] = process.env[key];
  4346. }
  4347. for (const key of Object.keys(this.gitEnv)) {
  4348. env[key] = this.gitEnv[key];
  4349. }
  4350. const stdout = [];
  4351. const options = {
  4352. cwd: this.workingDirectory,
  4353. env,
  4354. ignoreReturnCode: allowAllExitCodes,
  4355. listeners: {
  4356. stdout: (data) => {
  4357. stdout.push(data.toString());
  4358. }
  4359. }
  4360. };
  4361. result.exitCode = yield exec.exec(`"${this.gitPath}"`, args, options);
  4362. result.stdout = stdout.join('');
  4363. return result;
  4364. });
  4365. }
  4366. initializeCommandManager(workingDirectory, lfs) {
  4367. return __awaiter(this, void 0, void 0, function* () {
  4368. this.workingDirectory = workingDirectory;
  4369. // Git-lfs will try to pull down assets if any of the local/user/system setting exist.
  4370. // If the user didn't enable `LFS` in their pipeline definition, disable LFS fetch/checkout.
  4371. this.lfs = lfs;
  4372. if (!this.lfs) {
  4373. this.gitEnv['GIT_LFS_SKIP_SMUDGE'] = '1';
  4374. }
  4375. this.gitPath = yield io.which('git', true);
  4376. // Git version
  4377. core.debug('Getting git version');
  4378. let gitVersion = new git_version_1.GitVersion();
  4379. let gitOutput = yield this.execGit(['version']);
  4380. let stdout = gitOutput.stdout.trim();
  4381. if (!stdout.includes('\n')) {
  4382. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  4383. if (match) {
  4384. gitVersion = new git_version_1.GitVersion(match[0]);
  4385. }
  4386. }
  4387. if (!gitVersion.isValid()) {
  4388. throw new Error('Unable to determine git version');
  4389. }
  4390. // Minimum git version
  4391. if (!gitVersion.checkMinimum(exports.MinimumGitVersion)) {
  4392. throw new Error(`Minimum required git version is ${exports.MinimumGitVersion}. Your git ('${this.gitPath}') is ${gitVersion}`);
  4393. }
  4394. if (this.lfs) {
  4395. // Git-lfs version
  4396. core.debug('Getting git-lfs version');
  4397. let gitLfsVersion = new git_version_1.GitVersion();
  4398. const gitLfsPath = yield io.which('git-lfs', true);
  4399. gitOutput = yield this.execGit(['lfs', 'version']);
  4400. stdout = gitOutput.stdout.trim();
  4401. if (!stdout.includes('\n')) {
  4402. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  4403. if (match) {
  4404. gitLfsVersion = new git_version_1.GitVersion(match[0]);
  4405. }
  4406. }
  4407. if (!gitLfsVersion.isValid()) {
  4408. throw new Error('Unable to determine git-lfs version');
  4409. }
  4410. // Minimum git-lfs version
  4411. // Note:
  4412. // - Auth header not supported before 2.1
  4413. const minimumGitLfsVersion = new git_version_1.GitVersion('2.1');
  4414. if (!gitLfsVersion.checkMinimum(minimumGitLfsVersion)) {
  4415. throw new Error(`Minimum required git-lfs version is ${minimumGitLfsVersion}. Your git-lfs ('${gitLfsPath}') is ${gitLfsVersion}`);
  4416. }
  4417. }
  4418. // Set the user agent
  4419. const gitHttpUserAgent = `git/${gitVersion} (github-actions-checkout)`;
  4420. core.debug(`Set git useragent to: ${gitHttpUserAgent}`);
  4421. this.gitEnv['GIT_HTTP_USER_AGENT'] = gitHttpUserAgent;
  4422. });
  4423. }
  4424. }
  4425. class GitOutput {
  4426. constructor() {
  4427. this.stdout = '';
  4428. this.exitCode = 0;
  4429. }
  4430. }
  4431. /***/ }),
  4432. /***/ 293:
  4433. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  4434. "use strict";
  4435. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4436. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4437. return new (P || (P = Promise))(function (resolve, reject) {
  4438. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4439. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4440. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4441. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4442. });
  4443. };
  4444. var __importStar = (this && this.__importStar) || function (mod) {
  4445. if (mod && mod.__esModule) return mod;
  4446. var result = {};
  4447. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  4448. result["default"] = mod;
  4449. return result;
  4450. };
  4451. Object.defineProperty(exports, "__esModule", { value: true });
  4452. const core = __importStar(__webpack_require__(470));
  4453. const coreCommand = __importStar(__webpack_require__(431));
  4454. const fs = __importStar(__webpack_require__(747));
  4455. const fsHelper = __importStar(__webpack_require__(618));
  4456. const gitCommandManager = __importStar(__webpack_require__(289));
  4457. const io = __importStar(__webpack_require__(1));
  4458. const path = __importStar(__webpack_require__(622));
  4459. const refHelper = __importStar(__webpack_require__(227));
  4460. const githubApiHelper = __importStar(__webpack_require__(464));
  4461. const authConfigKey = `http.https://github.com/.extraheader`;
  4462. function getSource(settings) {
  4463. return __awaiter(this, void 0, void 0, function* () {
  4464. // Repository URL
  4465. core.info(`Syncing repository: ${settings.repositoryOwner}/${settings.repositoryName}`);
  4466. const repositoryUrl = `https://github.com/${encodeURIComponent(settings.repositoryOwner)}/${encodeURIComponent(settings.repositoryName)}`;
  4467. // Set intra-task state for cleanup
  4468. coreCommand.issueCommand('save-state', { name: 'repositoryPath' }, settings.repositoryPath);
  4469. // Remove conflicting file path
  4470. if (fsHelper.fileExistsSync(settings.repositoryPath)) {
  4471. yield io.rmRF(settings.repositoryPath);
  4472. }
  4473. // Create directory
  4474. let isExisting = true;
  4475. if (!fsHelper.directoryExistsSync(settings.repositoryPath)) {
  4476. isExisting = false;
  4477. yield io.mkdirP(settings.repositoryPath);
  4478. }
  4479. // Git command manager
  4480. core.info(`Working directory is '${settings.repositoryPath}'`);
  4481. let git = null;
  4482. try {
  4483. git = yield gitCommandManager.CreateCommandManager(settings.repositoryPath, settings.lfs);
  4484. }
  4485. catch (err) {
  4486. // Git is required for LFS
  4487. if (settings.lfs) {
  4488. throw err;
  4489. }
  4490. // Otherwise fallback to REST API
  4491. }
  4492. // Prepare existing directory, otherwise recreate
  4493. if (isExisting) {
  4494. yield prepareExistingDirectory(git, settings.repositoryPath, repositoryUrl, settings.clean);
  4495. }
  4496. if (!git || `${1}` == '1') {
  4497. core.info(`Downloading the repository files using the GitHub REST API`);
  4498. core.info(`To create a local repository instead, add Git ${gitCommandManager.MinimumGitVersion} or higher to the PATH`);
  4499. yield githubApiHelper.downloadRepository(settings.accessToken, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit, settings.repositoryPath);
  4500. }
  4501. else {
  4502. // Initialize the repository
  4503. if (!fsHelper.directoryExistsSync(path.join(settings.repositoryPath, '.git'))) {
  4504. yield git.init();
  4505. yield git.remoteAdd('origin', repositoryUrl);
  4506. }
  4507. // Disable automatic garbage collection
  4508. if (!(yield git.tryDisableAutomaticGarbageCollection())) {
  4509. core.warning(`Unable to turn off git automatic garbage collection. The git fetch operation may trigger garbage collection and cause a delay.`);
  4510. }
  4511. // Remove possible previous extraheader
  4512. yield removeGitConfig(git, authConfigKey);
  4513. // Add extraheader (auth)
  4514. const base64Credentials = Buffer.from(`x-access-token:${settings.accessToken}`, 'utf8').toString('base64');
  4515. core.setSecret(base64Credentials);
  4516. const authConfigValue = `AUTHORIZATION: basic ${base64Credentials}`;
  4517. yield git.config(authConfigKey, authConfigValue);
  4518. // LFS install
  4519. if (settings.lfs) {
  4520. yield git.lfsInstall();
  4521. }
  4522. // Fetch
  4523. const refSpec = refHelper.getRefSpec(settings.ref, settings.commit);
  4524. yield git.fetch(settings.fetchDepth, refSpec);
  4525. // Checkout info
  4526. const checkoutInfo = yield refHelper.getCheckoutInfo(git, settings.ref, settings.commit);
  4527. // LFS fetch
  4528. // Explicit lfs-fetch to avoid slow checkout (fetches one lfs object at a time).
  4529. // Explicit lfs fetch will fetch lfs objects in parallel.
  4530. if (settings.lfs) {
  4531. yield git.lfsFetch(checkoutInfo.startPoint || checkoutInfo.ref);
  4532. }
  4533. // Checkout
  4534. yield git.checkout(checkoutInfo.ref, checkoutInfo.startPoint);
  4535. // Dump some info about the checked out commit
  4536. yield git.log1();
  4537. }
  4538. });
  4539. }
  4540. exports.getSource = getSource;
  4541. function cleanup(repositoryPath) {
  4542. return __awaiter(this, void 0, void 0, function* () {
  4543. // Repo exists?
  4544. if (!fsHelper.fileExistsSync(path.join(repositoryPath, '.git', 'config'))) {
  4545. return;
  4546. }
  4547. fsHelper.directoryExistsSync(repositoryPath, true);
  4548. // Remove the config key
  4549. const git = yield gitCommandManager.CreateCommandManager(repositoryPath, false);
  4550. yield removeGitConfig(git, authConfigKey);
  4551. });
  4552. }
  4553. exports.cleanup = cleanup;
  4554. function prepareExistingDirectory(git, repositoryPath, repositoryUrl, clean) {
  4555. return __awaiter(this, void 0, void 0, function* () {
  4556. let remove = false;
  4557. // Check whether using git or REST API
  4558. if (!git) {
  4559. remove = true;
  4560. }
  4561. // Fetch URL does not match
  4562. else if (!fsHelper.directoryExistsSync(path.join(repositoryPath, '.git')) ||
  4563. repositoryUrl !== (yield git.tryGetFetchUrl())) {
  4564. remove = true;
  4565. }
  4566. else {
  4567. // Delete any index.lock and shallow.lock left by a previously canceled run or crashed git process
  4568. const lockPaths = [
  4569. path.join(repositoryPath, '.git', 'index.lock'),
  4570. path.join(repositoryPath, '.git', 'shallow.lock')
  4571. ];
  4572. for (const lockPath of lockPaths) {
  4573. try {
  4574. yield io.rmRF(lockPath);
  4575. }
  4576. catch (error) {
  4577. core.debug(`Unable to delete '${lockPath}'. ${error.message}`);
  4578. }
  4579. }
  4580. try {
  4581. // Checkout detached HEAD
  4582. if (!(yield git.isDetached())) {
  4583. yield git.checkoutDetach();
  4584. }
  4585. // Remove all refs/heads/*
  4586. let branches = yield git.branchList(false);
  4587. for (const branch of branches) {
  4588. yield git.branchDelete(false, branch);
  4589. }
  4590. // Remove all refs/remotes/origin/* to avoid conflicts
  4591. branches = yield git.branchList(true);
  4592. for (const branch of branches) {
  4593. yield git.branchDelete(true, branch);
  4594. }
  4595. // Clean
  4596. if (clean) {
  4597. if (!(yield git.tryClean())) {
  4598. core.debug(`The clean command failed. This might be caused by: 1) path too long, 2) permission issue, or 3) file in use. For futher investigation, manually run 'git clean -ffdx' on the directory '${repositoryPath}'.`);
  4599. remove = true;
  4600. }
  4601. else if (!(yield git.tryReset())) {
  4602. remove = true;
  4603. }
  4604. if (remove) {
  4605. core.warning(`Unable to clean or reset the repository. The repository will be recreated instead.`);
  4606. }
  4607. }
  4608. }
  4609. catch (error) {
  4610. core.warning(`Unable to prepare the existing repository. The repository will be recreated instead.`);
  4611. remove = true;
  4612. }
  4613. }
  4614. if (remove) {
  4615. // Delete the contents of the directory. Don't delete the directory itself
  4616. // since it might be the current working directory.
  4617. core.info(`Deleting the contents of '${repositoryPath}'`);
  4618. for (const file of yield fs.promises.readdir(repositoryPath)) {
  4619. yield io.rmRF(path.join(repositoryPath, file));
  4620. }
  4621. }
  4622. });
  4623. }
  4624. function removeGitConfig(git, configKey) {
  4625. return __awaiter(this, void 0, void 0, function* () {
  4626. if ((yield git.configExists(configKey)) &&
  4627. !(yield git.tryConfigUnset(configKey))) {
  4628. // Load the config contents
  4629. core.warning(`Failed to remove '${configKey}' from the git config. Attempting to remove the config value by editing the file directly.`);
  4630. const configPath = path.join(git.getWorkingDirectory(), '.git', 'config');
  4631. fsHelper.fileExistsSync(configPath);
  4632. let contents = fs.readFileSync(configPath).toString() || '';
  4633. // Filter - only includes lines that do not contain the config key
  4634. const upperConfigKey = configKey.toUpperCase();
  4635. const split = contents
  4636. .split('\n')
  4637. .filter(x => !x.toUpperCase().includes(upperConfigKey));
  4638. contents = split.join('\n');
  4639. // Rewrite the config file
  4640. fs.writeFileSync(configPath, contents);
  4641. }
  4642. });
  4643. }
  4644. /***/ }),
  4645. /***/ 294:
  4646. /***/ (function(module, __unusedexports, __webpack_require__) {
  4647. module.exports = parseOptions;
  4648. const { Deprecation } = __webpack_require__(692);
  4649. const { getUserAgent } = __webpack_require__(796);
  4650. const once = __webpack_require__(969);
  4651. const pkg = __webpack_require__(215);
  4652. const deprecateOptionsTimeout = once((log, deprecation) =>
  4653. log.warn(deprecation)
  4654. );
  4655. const deprecateOptionsAgent = once((log, deprecation) => log.warn(deprecation));
  4656. const deprecateOptionsHeaders = once((log, deprecation) =>
  4657. log.warn(deprecation)
  4658. );
  4659. function parseOptions(options, log, hook) {
  4660. if (options.headers) {
  4661. options.headers = Object.keys(options.headers).reduce((newObj, key) => {
  4662. newObj[key.toLowerCase()] = options.headers[key];
  4663. return newObj;
  4664. }, {});
  4665. }
  4666. const clientDefaults = {
  4667. headers: options.headers || {},
  4668. request: options.request || {},
  4669. mediaType: {
  4670. previews: [],
  4671. format: ""
  4672. }
  4673. };
  4674. if (options.baseUrl) {
  4675. clientDefaults.baseUrl = options.baseUrl;
  4676. }
  4677. if (options.userAgent) {
  4678. clientDefaults.headers["user-agent"] = options.userAgent;
  4679. }
  4680. if (options.previews) {
  4681. clientDefaults.mediaType.previews = options.previews;
  4682. }
  4683. if (options.timeZone) {
  4684. clientDefaults.headers["time-zone"] = options.timeZone;
  4685. }
  4686. if (options.timeout) {
  4687. deprecateOptionsTimeout(
  4688. log,
  4689. new Deprecation(
  4690. "[@octokit/rest] new Octokit({timeout}) is deprecated. Use {request: {timeout}} instead. See https://github.com/octokit/request.js#request"
  4691. )
  4692. );
  4693. clientDefaults.request.timeout = options.timeout;
  4694. }
  4695. if (options.agent) {
  4696. deprecateOptionsAgent(
  4697. log,
  4698. new Deprecation(
  4699. "[@octokit/rest] new Octokit({agent}) is deprecated. Use {request: {agent}} instead. See https://github.com/octokit/request.js#request"
  4700. )
  4701. );
  4702. clientDefaults.request.agent = options.agent;
  4703. }
  4704. if (options.headers) {
  4705. deprecateOptionsHeaders(
  4706. log,
  4707. new Deprecation(
  4708. "[@octokit/rest] new Octokit({headers}) is deprecated. Use {userAgent, previews} instead. See https://github.com/octokit/request.js#request"
  4709. )
  4710. );
  4711. }
  4712. const userAgentOption = clientDefaults.headers["user-agent"];
  4713. const defaultUserAgent = `octokit.js/${pkg.version} ${getUserAgent()}`;
  4714. clientDefaults.headers["user-agent"] = [userAgentOption, defaultUserAgent]
  4715. .filter(Boolean)
  4716. .join(" ");
  4717. clientDefaults.request.hook = hook.bind(null, "request");
  4718. return clientDefaults;
  4719. }
  4720. /***/ }),
  4721. /***/ 297:
  4722. /***/ (function(module) {
  4723. module.exports = class HttpError extends Error {
  4724. constructor (message, code, headers) {
  4725. super(message)
  4726. // Maintains proper stack trace (only available on V8)
  4727. /* istanbul ignore next */
  4728. if (Error.captureStackTrace) {
  4729. Error.captureStackTrace(this, this.constructor)
  4730. }
  4731. this.name = 'HttpError'
  4732. this.code = code
  4733. this.headers = headers
  4734. }
  4735. }
  4736. /***/ }),
  4737. /***/ 301:
  4738. /***/ (function(module, __unusedexports, __webpack_require__) {
  4739. /**
  4740. * Some “list” response that can be paginated have a different response structure
  4741. *
  4742. * They have a `total_count` key in the response (search also has `incomplete_results`,
  4743. * /installation/repositories also has `repository_selection`), as well as a key with
  4744. * the list of the items which name varies from endpoint to endpoint:
  4745. *
  4746. * - https://developer.github.com/v3/search/#example (key `items`)
  4747. * - https://developer.github.com/v3/checks/runs/#response-3 (key: `check_runs`)
  4748. * - https://developer.github.com/v3/checks/suites/#response-1 (key: `check_suites`)
  4749. * - https://developer.github.com/v3/apps/installations/#list-repositories (key: `repositories`)
  4750. * - https://developer.github.com/v3/apps/installations/#list-installations-for-a-user (key `installations`)
  4751. * - https://developer.github.com/v3/orgs/#list-installations-for-an-organization (key `installations`)
  4752. *
  4753. * Octokit normalizes these responses so that paginated results are always returned following
  4754. * the same structure. One challenge is that if the list response has only one page, no Link
  4755. * header is provided, so this header alone is not sufficient to check wether a response is
  4756. * paginated or not. For the exceptions with the namespace, a fallback check for the route
  4757. * paths has to be added in order to normalize the response. We cannot check for the total_count
  4758. * property because it also exists in the response of Get the combined status for a specific ref.
  4759. */
  4760. module.exports = normalizePaginatedListResponse;
  4761. const { Deprecation } = __webpack_require__(692);
  4762. const once = __webpack_require__(969);
  4763. const deprecateIncompleteResults = once((log, deprecation) =>
  4764. log.warn(deprecation)
  4765. );
  4766. const deprecateTotalCount = once((log, deprecation) => log.warn(deprecation));
  4767. const deprecateNamespace = once((log, deprecation) => log.warn(deprecation));
  4768. const REGEX_IS_SEARCH_PATH = /^\/search\//;
  4769. const REGEX_IS_CHECKS_PATH = /^\/repos\/[^/]+\/[^/]+\/commits\/[^/]+\/(check-runs|check-suites)/;
  4770. const REGEX_IS_INSTALLATION_REPOSITORIES_PATH = /^\/installation\/repositories/;
  4771. const REGEX_IS_USER_INSTALLATIONS_PATH = /^\/user\/installations/;
  4772. const REGEX_IS_ORG_INSTALLATIONS_PATH = /^\/orgs\/[^/]+\/installations/;
  4773. function normalizePaginatedListResponse(octokit, url, response) {
  4774. const path = url.replace(octokit.request.endpoint.DEFAULTS.baseUrl, "");
  4775. if (
  4776. !REGEX_IS_SEARCH_PATH.test(path) &&
  4777. !REGEX_IS_CHECKS_PATH.test(path) &&
  4778. !REGEX_IS_INSTALLATION_REPOSITORIES_PATH.test(path) &&
  4779. !REGEX_IS_USER_INSTALLATIONS_PATH.test(path) &&
  4780. !REGEX_IS_ORG_INSTALLATIONS_PATH.test(path)
  4781. ) {
  4782. return;
  4783. }
  4784. // keep the additional properties intact to avoid a breaking change,
  4785. // but log a deprecation warning when accessed
  4786. const incompleteResults = response.data.incomplete_results;
  4787. const repositorySelection = response.data.repository_selection;
  4788. const totalCount = response.data.total_count;
  4789. delete response.data.incomplete_results;
  4790. delete response.data.repository_selection;
  4791. delete response.data.total_count;
  4792. const namespaceKey = Object.keys(response.data)[0];
  4793. response.data = response.data[namespaceKey];
  4794. Object.defineProperty(response.data, namespaceKey, {
  4795. get() {
  4796. deprecateNamespace(
  4797. octokit.log,
  4798. new Deprecation(
  4799. `[@octokit/rest] "result.data.${namespaceKey}" is deprecated. Use "result.data" instead`
  4800. )
  4801. );
  4802. return response.data;
  4803. }
  4804. });
  4805. if (typeof incompleteResults !== "undefined") {
  4806. Object.defineProperty(response.data, "incomplete_results", {
  4807. get() {
  4808. deprecateIncompleteResults(
  4809. octokit.log,
  4810. new Deprecation(
  4811. '[@octokit/rest] "result.data.incomplete_results" is deprecated.'
  4812. )
  4813. );
  4814. return incompleteResults;
  4815. }
  4816. });
  4817. }
  4818. if (typeof repositorySelection !== "undefined") {
  4819. Object.defineProperty(response.data, "repository_selection", {
  4820. get() {
  4821. deprecateTotalCount(
  4822. octokit.log,
  4823. new Deprecation(
  4824. '[@octokit/rest] "result.data.repository_selection" is deprecated.'
  4825. )
  4826. );
  4827. return repositorySelection;
  4828. }
  4829. });
  4830. }
  4831. Object.defineProperty(response.data, "total_count", {
  4832. get() {
  4833. deprecateTotalCount(
  4834. octokit.log,
  4835. new Deprecation(
  4836. '[@octokit/rest] "result.data.total_count" is deprecated.'
  4837. )
  4838. );
  4839. return totalCount;
  4840. }
  4841. });
  4842. }
  4843. /***/ }),
  4844. /***/ 323:
  4845. /***/ (function(module) {
  4846. "use strict";
  4847. var isStream = module.exports = function (stream) {
  4848. return stream !== null && typeof stream === 'object' && typeof stream.pipe === 'function';
  4849. };
  4850. isStream.writable = function (stream) {
  4851. return isStream(stream) && stream.writable !== false && typeof stream._write === 'function' && typeof stream._writableState === 'object';
  4852. };
  4853. isStream.readable = function (stream) {
  4854. return isStream(stream) && stream.readable !== false && typeof stream._read === 'function' && typeof stream._readableState === 'object';
  4855. };
  4856. isStream.duplex = function (stream) {
  4857. return isStream.writable(stream) && isStream.readable(stream);
  4858. };
  4859. isStream.transform = function (stream) {
  4860. return isStream.duplex(stream) && typeof stream._transform === 'function' && typeof stream._transformState === 'object';
  4861. };
  4862. /***/ }),
  4863. /***/ 336:
  4864. /***/ (function(module, __unusedexports, __webpack_require__) {
  4865. module.exports = hasLastPage
  4866. const deprecate = __webpack_require__(370)
  4867. const getPageLinks = __webpack_require__(577)
  4868. function hasLastPage (link) {
  4869. deprecate(`octokit.hasLastPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  4870. return getPageLinks(link).last
  4871. }
  4872. /***/ }),
  4873. /***/ 348:
  4874. /***/ (function(module, __unusedexports, __webpack_require__) {
  4875. "use strict";
  4876. module.exports = validate;
  4877. const { RequestError } = __webpack_require__(463);
  4878. const get = __webpack_require__(854);
  4879. const set = __webpack_require__(883);
  4880. function validate(octokit, options) {
  4881. if (!options.request.validate) {
  4882. return;
  4883. }
  4884. const { validate: params } = options.request;
  4885. Object.keys(params).forEach(parameterName => {
  4886. const parameter = get(params, parameterName);
  4887. const expectedType = parameter.type;
  4888. let parentParameterName;
  4889. let parentValue;
  4890. let parentParamIsPresent = true;
  4891. let parentParameterIsArray = false;
  4892. if (/\./.test(parameterName)) {
  4893. parentParameterName = parameterName.replace(/\.[^.]+$/, "");
  4894. parentParameterIsArray = parentParameterName.slice(-2) === "[]";
  4895. if (parentParameterIsArray) {
  4896. parentParameterName = parentParameterName.slice(0, -2);
  4897. }
  4898. parentValue = get(options, parentParameterName);
  4899. parentParamIsPresent =
  4900. parentParameterName === "headers" ||
  4901. (typeof parentValue === "object" && parentValue !== null);
  4902. }
  4903. const values = parentParameterIsArray
  4904. ? (get(options, parentParameterName) || []).map(
  4905. value => value[parameterName.split(/\./).pop()]
  4906. )
  4907. : [get(options, parameterName)];
  4908. values.forEach((value, i) => {
  4909. const valueIsPresent = typeof value !== "undefined";
  4910. const valueIsNull = value === null;
  4911. const currentParameterName = parentParameterIsArray
  4912. ? parameterName.replace(/\[\]/, `[${i}]`)
  4913. : parameterName;
  4914. if (!parameter.required && !valueIsPresent) {
  4915. return;
  4916. }
  4917. // if the parent parameter is of type object but allows null
  4918. // then the child parameters can be ignored
  4919. if (!parentParamIsPresent) {
  4920. return;
  4921. }
  4922. if (parameter.allowNull && valueIsNull) {
  4923. return;
  4924. }
  4925. if (!parameter.allowNull && valueIsNull) {
  4926. throw new RequestError(
  4927. `'${currentParameterName}' cannot be null`,
  4928. 400,
  4929. {
  4930. request: options
  4931. }
  4932. );
  4933. }
  4934. if (parameter.required && !valueIsPresent) {
  4935. throw new RequestError(
  4936. `Empty value for parameter '${currentParameterName}': ${JSON.stringify(
  4937. value
  4938. )}`,
  4939. 400,
  4940. {
  4941. request: options
  4942. }
  4943. );
  4944. }
  4945. // parse to integer before checking for enum
  4946. // so that string "1" will match enum with number 1
  4947. if (expectedType === "integer") {
  4948. const unparsedValue = value;
  4949. value = parseInt(value, 10);
  4950. if (isNaN(value)) {
  4951. throw new RequestError(
  4952. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  4953. unparsedValue
  4954. )} is NaN`,
  4955. 400,
  4956. {
  4957. request: options
  4958. }
  4959. );
  4960. }
  4961. }
  4962. if (parameter.enum && parameter.enum.indexOf(String(value)) === -1) {
  4963. throw new RequestError(
  4964. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  4965. value
  4966. )}`,
  4967. 400,
  4968. {
  4969. request: options
  4970. }
  4971. );
  4972. }
  4973. if (parameter.validation) {
  4974. const regex = new RegExp(parameter.validation);
  4975. if (!regex.test(value)) {
  4976. throw new RequestError(
  4977. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  4978. value
  4979. )}`,
  4980. 400,
  4981. {
  4982. request: options
  4983. }
  4984. );
  4985. }
  4986. }
  4987. if (expectedType === "object" && typeof value === "string") {
  4988. try {
  4989. value = JSON.parse(value);
  4990. } catch (exception) {
  4991. throw new RequestError(
  4992. `JSON parse error of value for parameter '${currentParameterName}': ${JSON.stringify(
  4993. value
  4994. )}`,
  4995. 400,
  4996. {
  4997. request: options
  4998. }
  4999. );
  5000. }
  5001. }
  5002. set(options, parameter.mapTo || currentParameterName, value);
  5003. });
  5004. });
  5005. return options;
  5006. }
  5007. /***/ }),
  5008. /***/ 349:
  5009. /***/ (function(module, __unusedexports, __webpack_require__) {
  5010. module.exports = authenticationRequestError;
  5011. const { RequestError } = __webpack_require__(463);
  5012. function authenticationRequestError(state, error, options) {
  5013. /* istanbul ignore next */
  5014. if (!error.headers) throw error;
  5015. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  5016. // handle "2FA required" error only
  5017. if (error.status !== 401 || !otpRequired) {
  5018. throw error;
  5019. }
  5020. if (
  5021. error.status === 401 &&
  5022. otpRequired &&
  5023. error.request &&
  5024. error.request.headers["x-github-otp"]
  5025. ) {
  5026. throw new RequestError(
  5027. "Invalid one-time password for two-factor authentication",
  5028. 401,
  5029. {
  5030. headers: error.headers,
  5031. request: options
  5032. }
  5033. );
  5034. }
  5035. if (typeof state.auth.on2fa !== "function") {
  5036. throw new RequestError(
  5037. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  5038. 401,
  5039. {
  5040. headers: error.headers,
  5041. request: options
  5042. }
  5043. );
  5044. }
  5045. return Promise.resolve()
  5046. .then(() => {
  5047. return state.auth.on2fa();
  5048. })
  5049. .then(oneTimePassword => {
  5050. const newOptions = Object.assign(options, {
  5051. headers: Object.assign(
  5052. { "x-github-otp": oneTimePassword },
  5053. options.headers
  5054. )
  5055. });
  5056. return state.octokit.request(newOptions);
  5057. });
  5058. }
  5059. /***/ }),
  5060. /***/ 357:
  5061. /***/ (function(module) {
  5062. module.exports = require("assert");
  5063. /***/ }),
  5064. /***/ 363:
  5065. /***/ (function(module) {
  5066. module.exports = register
  5067. function register (state, name, method, options) {
  5068. if (typeof method !== 'function') {
  5069. throw new Error('method for before hook must be a function')
  5070. }
  5071. if (!options) {
  5072. options = {}
  5073. }
  5074. if (Array.isArray(name)) {
  5075. return name.reverse().reduce(function (callback, name) {
  5076. return register.bind(null, state, name, callback, options)
  5077. }, method)()
  5078. }
  5079. return Promise.resolve()
  5080. .then(function () {
  5081. if (!state.registry[name]) {
  5082. return method(options)
  5083. }
  5084. return (state.registry[name]).reduce(function (method, registered) {
  5085. return registered.hook.bind(null, method, options)
  5086. }, method)()
  5087. })
  5088. }
  5089. /***/ }),
  5090. /***/ 368:
  5091. /***/ (function(module) {
  5092. module.exports = function atob(str) {
  5093. return Buffer.from(str, 'base64').toString('binary')
  5094. }
  5095. /***/ }),
  5096. /***/ 370:
  5097. /***/ (function(module) {
  5098. module.exports = deprecate
  5099. const loggedMessages = {}
  5100. function deprecate (message) {
  5101. if (loggedMessages[message]) {
  5102. return
  5103. }
  5104. console.warn(`DEPRECATED (@octokit/rest): ${message}`)
  5105. loggedMessages[message] = 1
  5106. }
  5107. /***/ }),
  5108. /***/ 372:
  5109. /***/ (function(module) {
  5110. module.exports = octokitDebug;
  5111. function octokitDebug(octokit) {
  5112. octokit.hook.wrap("request", (request, options) => {
  5113. octokit.log.debug("request", options);
  5114. const start = Date.now();
  5115. const requestOptions = octokit.request.endpoint.parse(options);
  5116. const path = requestOptions.url.replace(options.baseUrl, "");
  5117. return request(options)
  5118. .then(response => {
  5119. octokit.log.info(
  5120. `${requestOptions.method} ${path} - ${
  5121. response.status
  5122. } in ${Date.now() - start}ms`
  5123. );
  5124. return response;
  5125. })
  5126. .catch(error => {
  5127. octokit.log.info(
  5128. `${requestOptions.method} ${path} - ${error.status} in ${Date.now() -
  5129. start}ms`
  5130. );
  5131. throw error;
  5132. });
  5133. });
  5134. }
  5135. /***/ }),
  5136. /***/ 385:
  5137. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  5138. "use strict";
  5139. Object.defineProperty(exports, '__esModule', { value: true });
  5140. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  5141. var isPlainObject = _interopDefault(__webpack_require__(696));
  5142. var universalUserAgent = __webpack_require__(796);
  5143. function lowercaseKeys(object) {
  5144. if (!object) {
  5145. return {};
  5146. }
  5147. return Object.keys(object).reduce((newObj, key) => {
  5148. newObj[key.toLowerCase()] = object[key];
  5149. return newObj;
  5150. }, {});
  5151. }
  5152. function mergeDeep(defaults, options) {
  5153. const result = Object.assign({}, defaults);
  5154. Object.keys(options).forEach(key => {
  5155. if (isPlainObject(options[key])) {
  5156. if (!(key in defaults)) Object.assign(result, {
  5157. [key]: options[key]
  5158. });else result[key] = mergeDeep(defaults[key], options[key]);
  5159. } else {
  5160. Object.assign(result, {
  5161. [key]: options[key]
  5162. });
  5163. }
  5164. });
  5165. return result;
  5166. }
  5167. function merge(defaults, route, options) {
  5168. if (typeof route === "string") {
  5169. let [method, url] = route.split(" ");
  5170. options = Object.assign(url ? {
  5171. method,
  5172. url
  5173. } : {
  5174. url: method
  5175. }, options);
  5176. } else {
  5177. options = Object.assign({}, route);
  5178. } // lowercase header names before merging with defaults to avoid duplicates
  5179. options.headers = lowercaseKeys(options.headers);
  5180. const mergedOptions = mergeDeep(defaults || {}, options); // mediaType.previews arrays are merged, instead of overwritten
  5181. if (defaults && defaults.mediaType.previews.length) {
  5182. mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(preview => !mergedOptions.mediaType.previews.includes(preview)).concat(mergedOptions.mediaType.previews);
  5183. }
  5184. mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map(preview => preview.replace(/-preview/, ""));
  5185. return mergedOptions;
  5186. }
  5187. function addQueryParameters(url, parameters) {
  5188. const separator = /\?/.test(url) ? "&" : "?";
  5189. const names = Object.keys(parameters);
  5190. if (names.length === 0) {
  5191. return url;
  5192. }
  5193. return url + separator + names.map(name => {
  5194. if (name === "q") {
  5195. return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+");
  5196. }
  5197. return `${name}=${encodeURIComponent(parameters[name])}`;
  5198. }).join("&");
  5199. }
  5200. const urlVariableRegex = /\{[^}]+\}/g;
  5201. function removeNonChars(variableName) {
  5202. return variableName.replace(/^\W+|\W+$/g, "").split(/,/);
  5203. }
  5204. function extractUrlVariableNames(url) {
  5205. const matches = url.match(urlVariableRegex);
  5206. if (!matches) {
  5207. return [];
  5208. }
  5209. return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
  5210. }
  5211. function omit(object, keysToOmit) {
  5212. return Object.keys(object).filter(option => !keysToOmit.includes(option)).reduce((obj, key) => {
  5213. obj[key] = object[key];
  5214. return obj;
  5215. }, {});
  5216. }
  5217. // Based on https://github.com/bramstein/url-template, licensed under BSD
  5218. // TODO: create separate package.
  5219. //
  5220. // Copyright (c) 2012-2014, Bram Stein
  5221. // All rights reserved.
  5222. // Redistribution and use in source and binary forms, with or without
  5223. // modification, are permitted provided that the following conditions
  5224. // are met:
  5225. // 1. Redistributions of source code must retain the above copyright
  5226. // notice, this list of conditions and the following disclaimer.
  5227. // 2. Redistributions in binary form must reproduce the above copyright
  5228. // notice, this list of conditions and the following disclaimer in the
  5229. // documentation and/or other materials provided with the distribution.
  5230. // 3. The name of the author may not be used to endorse or promote products
  5231. // derived from this software without specific prior written permission.
  5232. // THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
  5233. // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  5234. // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  5235. // EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  5236. // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  5237. // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  5238. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  5239. // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  5240. // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  5241. // EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  5242. /* istanbul ignore file */
  5243. function encodeReserved(str) {
  5244. return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) {
  5245. if (!/%[0-9A-Fa-f]/.test(part)) {
  5246. part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]");
  5247. }
  5248. return part;
  5249. }).join("");
  5250. }
  5251. function encodeUnreserved(str) {
  5252. return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {
  5253. return "%" + c.charCodeAt(0).toString(16).toUpperCase();
  5254. });
  5255. }
  5256. function encodeValue(operator, value, key) {
  5257. value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value);
  5258. if (key) {
  5259. return encodeUnreserved(key) + "=" + value;
  5260. } else {
  5261. return value;
  5262. }
  5263. }
  5264. function isDefined(value) {
  5265. return value !== undefined && value !== null;
  5266. }
  5267. function isKeyOperator(operator) {
  5268. return operator === ";" || operator === "&" || operator === "?";
  5269. }
  5270. function getValues(context, operator, key, modifier) {
  5271. var value = context[key],
  5272. result = [];
  5273. if (isDefined(value) && value !== "") {
  5274. if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
  5275. value = value.toString();
  5276. if (modifier && modifier !== "*") {
  5277. value = value.substring(0, parseInt(modifier, 10));
  5278. }
  5279. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  5280. } else {
  5281. if (modifier === "*") {
  5282. if (Array.isArray(value)) {
  5283. value.filter(isDefined).forEach(function (value) {
  5284. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  5285. });
  5286. } else {
  5287. Object.keys(value).forEach(function (k) {
  5288. if (isDefined(value[k])) {
  5289. result.push(encodeValue(operator, value[k], k));
  5290. }
  5291. });
  5292. }
  5293. } else {
  5294. const tmp = [];
  5295. if (Array.isArray(value)) {
  5296. value.filter(isDefined).forEach(function (value) {
  5297. tmp.push(encodeValue(operator, value));
  5298. });
  5299. } else {
  5300. Object.keys(value).forEach(function (k) {
  5301. if (isDefined(value[k])) {
  5302. tmp.push(encodeUnreserved(k));
  5303. tmp.push(encodeValue(operator, value[k].toString()));
  5304. }
  5305. });
  5306. }
  5307. if (isKeyOperator(operator)) {
  5308. result.push(encodeUnreserved(key) + "=" + tmp.join(","));
  5309. } else if (tmp.length !== 0) {
  5310. result.push(tmp.join(","));
  5311. }
  5312. }
  5313. }
  5314. } else {
  5315. if (operator === ";") {
  5316. if (isDefined(value)) {
  5317. result.push(encodeUnreserved(key));
  5318. }
  5319. } else if (value === "" && (operator === "&" || operator === "?")) {
  5320. result.push(encodeUnreserved(key) + "=");
  5321. } else if (value === "") {
  5322. result.push("");
  5323. }
  5324. }
  5325. return result;
  5326. }
  5327. function parseUrl(template) {
  5328. return {
  5329. expand: expand.bind(null, template)
  5330. };
  5331. }
  5332. function expand(template, context) {
  5333. var operators = ["+", "#", ".", "/", ";", "?", "&"];
  5334. return template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function (_, expression, literal) {
  5335. if (expression) {
  5336. let operator = "";
  5337. const values = [];
  5338. if (operators.indexOf(expression.charAt(0)) !== -1) {
  5339. operator = expression.charAt(0);
  5340. expression = expression.substr(1);
  5341. }
  5342. expression.split(/,/g).forEach(function (variable) {
  5343. var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
  5344. values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
  5345. });
  5346. if (operator && operator !== "+") {
  5347. var separator = ",";
  5348. if (operator === "?") {
  5349. separator = "&";
  5350. } else if (operator !== "#") {
  5351. separator = operator;
  5352. }
  5353. return (values.length !== 0 ? operator : "") + values.join(separator);
  5354. } else {
  5355. return values.join(",");
  5356. }
  5357. } else {
  5358. return encodeReserved(literal);
  5359. }
  5360. });
  5361. }
  5362. function parse(options) {
  5363. // https://fetch.spec.whatwg.org/#methods
  5364. let method = options.method.toUpperCase(); // replace :varname with {varname} to make it RFC 6570 compatible
  5365. let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{+$1}");
  5366. let headers = Object.assign({}, options.headers);
  5367. let body;
  5368. let parameters = omit(options, ["method", "baseUrl", "url", "headers", "request", "mediaType"]); // extract variable names from URL to calculate remaining variables later
  5369. const urlVariableNames = extractUrlVariableNames(url);
  5370. url = parseUrl(url).expand(parameters);
  5371. if (!/^http/.test(url)) {
  5372. url = options.baseUrl + url;
  5373. }
  5374. const omittedParameters = Object.keys(options).filter(option => urlVariableNames.includes(option)).concat("baseUrl");
  5375. const remainingParameters = omit(parameters, omittedParameters);
  5376. const isBinaryRequset = /application\/octet-stream/i.test(headers.accept);
  5377. if (!isBinaryRequset) {
  5378. if (options.mediaType.format) {
  5379. // e.g. application/vnd.github.v3+json => application/vnd.github.v3.raw
  5380. headers.accept = headers.accept.split(/,/).map(preview => preview.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`)).join(",");
  5381. }
  5382. if (options.mediaType.previews.length) {
  5383. const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || [];
  5384. headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map(preview => {
  5385. const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json";
  5386. return `application/vnd.github.${preview}-preview${format}`;
  5387. }).join(",");
  5388. }
  5389. } // for GET/HEAD requests, set URL query parameters from remaining parameters
  5390. // for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters
  5391. if (["GET", "HEAD"].includes(method)) {
  5392. url = addQueryParameters(url, remainingParameters);
  5393. } else {
  5394. if ("data" in remainingParameters) {
  5395. body = remainingParameters.data;
  5396. } else {
  5397. if (Object.keys(remainingParameters).length) {
  5398. body = remainingParameters;
  5399. } else {
  5400. headers["content-length"] = 0;
  5401. }
  5402. }
  5403. } // default content-type for JSON if body is set
  5404. if (!headers["content-type"] && typeof body !== "undefined") {
  5405. headers["content-type"] = "application/json; charset=utf-8";
  5406. } // GitHub expects 'content-length: 0' header for PUT/PATCH requests without body.
  5407. // fetch does not allow to set `content-length` header, but we can set body to an empty string
  5408. if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") {
  5409. body = "";
  5410. } // Only return body/request keys if present
  5411. return Object.assign({
  5412. method,
  5413. url,
  5414. headers
  5415. }, typeof body !== "undefined" ? {
  5416. body
  5417. } : null, options.request ? {
  5418. request: options.request
  5419. } : null);
  5420. }
  5421. function endpointWithDefaults(defaults, route, options) {
  5422. return parse(merge(defaults, route, options));
  5423. }
  5424. function withDefaults(oldDefaults, newDefaults) {
  5425. const DEFAULTS = merge(oldDefaults, newDefaults);
  5426. const endpoint = endpointWithDefaults.bind(null, DEFAULTS);
  5427. return Object.assign(endpoint, {
  5428. DEFAULTS,
  5429. defaults: withDefaults.bind(null, DEFAULTS),
  5430. merge: merge.bind(null, DEFAULTS),
  5431. parse
  5432. });
  5433. }
  5434. const VERSION = "5.5.1";
  5435. const userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`; // DEFAULTS has all properties set that EndpointOptions has, except url.
  5436. // So we use RequestParameters and add method as additional required property.
  5437. const DEFAULTS = {
  5438. method: "GET",
  5439. baseUrl: "https://api.github.com",
  5440. headers: {
  5441. accept: "application/vnd.github.v3+json",
  5442. "user-agent": userAgent
  5443. },
  5444. mediaType: {
  5445. format: "",
  5446. previews: []
  5447. }
  5448. };
  5449. const endpoint = withDefaults(null, DEFAULTS);
  5450. exports.endpoint = endpoint;
  5451. //# sourceMappingURL=index.js.map
  5452. /***/ }),
  5453. /***/ 389:
  5454. /***/ (function(module, __unusedexports, __webpack_require__) {
  5455. "use strict";
  5456. const fs = __webpack_require__(747);
  5457. const shebangCommand = __webpack_require__(866);
  5458. function readShebang(command) {
  5459. // Read the first 150 bytes from the file
  5460. const size = 150;
  5461. let buffer;
  5462. if (Buffer.alloc) {
  5463. // Node.js v4.5+ / v5.10+
  5464. buffer = Buffer.alloc(size);
  5465. } else {
  5466. // Old Node.js API
  5467. buffer = new Buffer(size);
  5468. buffer.fill(0); // zero-fill
  5469. }
  5470. let fd;
  5471. try {
  5472. fd = fs.openSync(command, 'r');
  5473. fs.readSync(fd, buffer, 0, size, 0);
  5474. fs.closeSync(fd);
  5475. } catch (e) { /* Empty */ }
  5476. // Attempt to extract shebang (null is returned if not a shebang)
  5477. return shebangCommand(buffer.toString());
  5478. }
  5479. module.exports = readShebang;
  5480. /***/ }),
  5481. /***/ 402:
  5482. /***/ (function(module, __unusedexports, __webpack_require__) {
  5483. module.exports = Octokit;
  5484. const { request } = __webpack_require__(753);
  5485. const Hook = __webpack_require__(523);
  5486. const parseClientOptions = __webpack_require__(294);
  5487. function Octokit(plugins, options) {
  5488. options = options || {};
  5489. const hook = new Hook.Collection();
  5490. const log = Object.assign(
  5491. {
  5492. debug: () => {},
  5493. info: () => {},
  5494. warn: console.warn,
  5495. error: console.error
  5496. },
  5497. options && options.log
  5498. );
  5499. const api = {
  5500. hook,
  5501. log,
  5502. request: request.defaults(parseClientOptions(options, log, hook))
  5503. };
  5504. plugins.forEach(pluginFunction => pluginFunction(api, options));
  5505. return api;
  5506. }
  5507. /***/ }),
  5508. /***/ 413:
  5509. /***/ (function(module) {
  5510. module.exports = require("stream");
  5511. /***/ }),
  5512. /***/ 417:
  5513. /***/ (function(module) {
  5514. module.exports = require("crypto");
  5515. /***/ }),
  5516. /***/ 427:
  5517. /***/ (function(module, __unusedexports, __webpack_require__) {
  5518. "use strict";
  5519. // Older verions of Node.js might not have `util.getSystemErrorName()`.
  5520. // In that case, fall back to a deprecated internal.
  5521. const util = __webpack_require__(669);
  5522. let uv;
  5523. if (typeof util.getSystemErrorName === 'function') {
  5524. module.exports = util.getSystemErrorName;
  5525. } else {
  5526. try {
  5527. uv = process.binding('uv');
  5528. if (typeof uv.errname !== 'function') {
  5529. throw new TypeError('uv.errname is not a function');
  5530. }
  5531. } catch (err) {
  5532. console.error('execa/lib/errname: unable to establish process.binding(\'uv\')', err);
  5533. uv = null;
  5534. }
  5535. module.exports = code => errname(uv, code);
  5536. }
  5537. // Used for testing the fallback behavior
  5538. module.exports.__test__ = errname;
  5539. function errname(uv, code) {
  5540. if (uv) {
  5541. return uv.errname(code);
  5542. }
  5543. if (!(code < 0)) {
  5544. throw new Error('err >= 0');
  5545. }
  5546. return `Unknown system error ${code}`;
  5547. }
  5548. /***/ }),
  5549. /***/ 430:
  5550. /***/ (function(module, __unusedexports, __webpack_require__) {
  5551. module.exports = octokitValidate;
  5552. const validate = __webpack_require__(348);
  5553. function octokitValidate(octokit) {
  5554. octokit.hook.before("request", validate.bind(null, octokit));
  5555. }
  5556. /***/ }),
  5557. /***/ 431:
  5558. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  5559. "use strict";
  5560. Object.defineProperty(exports, "__esModule", { value: true });
  5561. const os = __webpack_require__(87);
  5562. /**
  5563. * Commands
  5564. *
  5565. * Command Format:
  5566. * ##[name key=value;key=value]message
  5567. *
  5568. * Examples:
  5569. * ##[warning]This is the user warning message
  5570. * ##[set-secret name=mypassword]definitelyNotAPassword!
  5571. */
  5572. function issueCommand(command, properties, message) {
  5573. const cmd = new Command(command, properties, message);
  5574. process.stdout.write(cmd.toString() + os.EOL);
  5575. }
  5576. exports.issueCommand = issueCommand;
  5577. function issue(name, message = '') {
  5578. issueCommand(name, {}, message);
  5579. }
  5580. exports.issue = issue;
  5581. const CMD_STRING = '::';
  5582. class Command {
  5583. constructor(command, properties, message) {
  5584. if (!command) {
  5585. command = 'missing.command';
  5586. }
  5587. this.command = command;
  5588. this.properties = properties;
  5589. this.message = message;
  5590. }
  5591. toString() {
  5592. let cmdStr = CMD_STRING + this.command;
  5593. if (this.properties && Object.keys(this.properties).length > 0) {
  5594. cmdStr += ' ';
  5595. for (const key in this.properties) {
  5596. if (this.properties.hasOwnProperty(key)) {
  5597. const val = this.properties[key];
  5598. if (val) {
  5599. // safely append the val - avoid blowing up when attempting to
  5600. // call .replace() if message is not a string for some reason
  5601. cmdStr += `${key}=${escape(`${val || ''}`)},`;
  5602. }
  5603. }
  5604. }
  5605. }
  5606. cmdStr += CMD_STRING;
  5607. // safely append the message - avoid blowing up when attempting to
  5608. // call .replace() if message is not a string for some reason
  5609. const message = `${this.message || ''}`;
  5610. cmdStr += escapeData(message);
  5611. return cmdStr;
  5612. }
  5613. }
  5614. function escapeData(s) {
  5615. return s.replace(/\r/g, '%0D').replace(/\n/g, '%0A');
  5616. }
  5617. function escape(s) {
  5618. return s
  5619. .replace(/\r/g, '%0D')
  5620. .replace(/\n/g, '%0A')
  5621. .replace(/]/g, '%5D')
  5622. .replace(/;/g, '%3B');
  5623. }
  5624. //# sourceMappingURL=command.js.map
  5625. /***/ }),
  5626. /***/ 453:
  5627. /***/ (function(module, __unusedexports, __webpack_require__) {
  5628. var once = __webpack_require__(969)
  5629. var eos = __webpack_require__(562)
  5630. var fs = __webpack_require__(747) // we only need fs to get the ReadStream and WriteStream prototypes
  5631. var noop = function () {}
  5632. var ancient = /^v?\.0/.test(process.version)
  5633. var isFn = function (fn) {
  5634. return typeof fn === 'function'
  5635. }
  5636. var isFS = function (stream) {
  5637. if (!ancient) return false // newer node version do not need to care about fs is a special way
  5638. if (!fs) return false // browser
  5639. return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close)
  5640. }
  5641. var isRequest = function (stream) {
  5642. return stream.setHeader && isFn(stream.abort)
  5643. }
  5644. var destroyer = function (stream, reading, writing, callback) {
  5645. callback = once(callback)
  5646. var closed = false
  5647. stream.on('close', function () {
  5648. closed = true
  5649. })
  5650. eos(stream, {readable: reading, writable: writing}, function (err) {
  5651. if (err) return callback(err)
  5652. closed = true
  5653. callback()
  5654. })
  5655. var destroyed = false
  5656. return function (err) {
  5657. if (closed) return
  5658. if (destroyed) return
  5659. destroyed = true
  5660. if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks
  5661. if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want
  5662. if (isFn(stream.destroy)) return stream.destroy()
  5663. callback(err || new Error('stream was destroyed'))
  5664. }
  5665. }
  5666. var call = function (fn) {
  5667. fn()
  5668. }
  5669. var pipe = function (from, to) {
  5670. return from.pipe(to)
  5671. }
  5672. var pump = function () {
  5673. var streams = Array.prototype.slice.call(arguments)
  5674. var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop
  5675. if (Array.isArray(streams[0])) streams = streams[0]
  5676. if (streams.length < 2) throw new Error('pump requires two streams per minimum')
  5677. var error
  5678. var destroys = streams.map(function (stream, i) {
  5679. var reading = i < streams.length - 1
  5680. var writing = i > 0
  5681. return destroyer(stream, reading, writing, function (err) {
  5682. if (!error) error = err
  5683. if (err) destroys.forEach(call)
  5684. if (reading) return
  5685. destroys.forEach(call)
  5686. callback(error)
  5687. })
  5688. })
  5689. return streams.reduce(pipe)
  5690. }
  5691. module.exports = pump
  5692. /***/ }),
  5693. /***/ 454:
  5694. /***/ (function(module, exports, __webpack_require__) {
  5695. "use strict";
  5696. Object.defineProperty(exports, '__esModule', { value: true });
  5697. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  5698. var Stream = _interopDefault(__webpack_require__(413));
  5699. var http = _interopDefault(__webpack_require__(605));
  5700. var Url = _interopDefault(__webpack_require__(835));
  5701. var https = _interopDefault(__webpack_require__(211));
  5702. var zlib = _interopDefault(__webpack_require__(761));
  5703. // Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js
  5704. // fix for "Readable" isn't a named export issue
  5705. const Readable = Stream.Readable;
  5706. const BUFFER = Symbol('buffer');
  5707. const TYPE = Symbol('type');
  5708. class Blob {
  5709. constructor() {
  5710. this[TYPE] = '';
  5711. const blobParts = arguments[0];
  5712. const options = arguments[1];
  5713. const buffers = [];
  5714. let size = 0;
  5715. if (blobParts) {
  5716. const a = blobParts;
  5717. const length = Number(a.length);
  5718. for (let i = 0; i < length; i++) {
  5719. const element = a[i];
  5720. let buffer;
  5721. if (element instanceof Buffer) {
  5722. buffer = element;
  5723. } else if (ArrayBuffer.isView(element)) {
  5724. buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength);
  5725. } else if (element instanceof ArrayBuffer) {
  5726. buffer = Buffer.from(element);
  5727. } else if (element instanceof Blob) {
  5728. buffer = element[BUFFER];
  5729. } else {
  5730. buffer = Buffer.from(typeof element === 'string' ? element : String(element));
  5731. }
  5732. size += buffer.length;
  5733. buffers.push(buffer);
  5734. }
  5735. }
  5736. this[BUFFER] = Buffer.concat(buffers);
  5737. let type = options && options.type !== undefined && String(options.type).toLowerCase();
  5738. if (type && !/[^\u0020-\u007E]/.test(type)) {
  5739. this[TYPE] = type;
  5740. }
  5741. }
  5742. get size() {
  5743. return this[BUFFER].length;
  5744. }
  5745. get type() {
  5746. return this[TYPE];
  5747. }
  5748. text() {
  5749. return Promise.resolve(this[BUFFER].toString());
  5750. }
  5751. arrayBuffer() {
  5752. const buf = this[BUFFER];
  5753. const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  5754. return Promise.resolve(ab);
  5755. }
  5756. stream() {
  5757. const readable = new Readable();
  5758. readable._read = function () {};
  5759. readable.push(this[BUFFER]);
  5760. readable.push(null);
  5761. return readable;
  5762. }
  5763. toString() {
  5764. return '[object Blob]';
  5765. }
  5766. slice() {
  5767. const size = this.size;
  5768. const start = arguments[0];
  5769. const end = arguments[1];
  5770. let relativeStart, relativeEnd;
  5771. if (start === undefined) {
  5772. relativeStart = 0;
  5773. } else if (start < 0) {
  5774. relativeStart = Math.max(size + start, 0);
  5775. } else {
  5776. relativeStart = Math.min(start, size);
  5777. }
  5778. if (end === undefined) {
  5779. relativeEnd = size;
  5780. } else if (end < 0) {
  5781. relativeEnd = Math.max(size + end, 0);
  5782. } else {
  5783. relativeEnd = Math.min(end, size);
  5784. }
  5785. const span = Math.max(relativeEnd - relativeStart, 0);
  5786. const buffer = this[BUFFER];
  5787. const slicedBuffer = buffer.slice(relativeStart, relativeStart + span);
  5788. const blob = new Blob([], { type: arguments[2] });
  5789. blob[BUFFER] = slicedBuffer;
  5790. return blob;
  5791. }
  5792. }
  5793. Object.defineProperties(Blob.prototype, {
  5794. size: { enumerable: true },
  5795. type: { enumerable: true },
  5796. slice: { enumerable: true }
  5797. });
  5798. Object.defineProperty(Blob.prototype, Symbol.toStringTag, {
  5799. value: 'Blob',
  5800. writable: false,
  5801. enumerable: false,
  5802. configurable: true
  5803. });
  5804. /**
  5805. * fetch-error.js
  5806. *
  5807. * FetchError interface for operational errors
  5808. */
  5809. /**
  5810. * Create FetchError instance
  5811. *
  5812. * @param String message Error message for human
  5813. * @param String type Error type for machine
  5814. * @param String systemError For Node.js system error
  5815. * @return FetchError
  5816. */
  5817. function FetchError(message, type, systemError) {
  5818. Error.call(this, message);
  5819. this.message = message;
  5820. this.type = type;
  5821. // when err.type is `system`, err.code contains system error code
  5822. if (systemError) {
  5823. this.code = this.errno = systemError.code;
  5824. }
  5825. // hide custom error implementation details from end-users
  5826. Error.captureStackTrace(this, this.constructor);
  5827. }
  5828. FetchError.prototype = Object.create(Error.prototype);
  5829. FetchError.prototype.constructor = FetchError;
  5830. FetchError.prototype.name = 'FetchError';
  5831. let convert;
  5832. try {
  5833. convert = __webpack_require__(18).convert;
  5834. } catch (e) {}
  5835. const INTERNALS = Symbol('Body internals');
  5836. // fix an issue where "PassThrough" isn't a named export for node <10
  5837. const PassThrough = Stream.PassThrough;
  5838. /**
  5839. * Body mixin
  5840. *
  5841. * Ref: https://fetch.spec.whatwg.org/#body
  5842. *
  5843. * @param Stream body Readable stream
  5844. * @param Object opts Response options
  5845. * @return Void
  5846. */
  5847. function Body(body) {
  5848. var _this = this;
  5849. var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  5850. _ref$size = _ref.size;
  5851. let size = _ref$size === undefined ? 0 : _ref$size;
  5852. var _ref$timeout = _ref.timeout;
  5853. let timeout = _ref$timeout === undefined ? 0 : _ref$timeout;
  5854. if (body == null) {
  5855. // body is undefined or null
  5856. body = null;
  5857. } else if (isURLSearchParams(body)) {
  5858. // body is a URLSearchParams
  5859. body = Buffer.from(body.toString());
  5860. } else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  5861. // body is ArrayBuffer
  5862. body = Buffer.from(body);
  5863. } else if (ArrayBuffer.isView(body)) {
  5864. // body is ArrayBufferView
  5865. body = Buffer.from(body.buffer, body.byteOffset, body.byteLength);
  5866. } else if (body instanceof Stream) ; else {
  5867. // none of the above
  5868. // coerce to string then buffer
  5869. body = Buffer.from(String(body));
  5870. }
  5871. this[INTERNALS] = {
  5872. body,
  5873. disturbed: false,
  5874. error: null
  5875. };
  5876. this.size = size;
  5877. this.timeout = timeout;
  5878. if (body instanceof Stream) {
  5879. body.on('error', function (err) {
  5880. const error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err);
  5881. _this[INTERNALS].error = error;
  5882. });
  5883. }
  5884. }
  5885. Body.prototype = {
  5886. get body() {
  5887. return this[INTERNALS].body;
  5888. },
  5889. get bodyUsed() {
  5890. return this[INTERNALS].disturbed;
  5891. },
  5892. /**
  5893. * Decode response as ArrayBuffer
  5894. *
  5895. * @return Promise
  5896. */
  5897. arrayBuffer() {
  5898. return consumeBody.call(this).then(function (buf) {
  5899. return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  5900. });
  5901. },
  5902. /**
  5903. * Return raw response as Blob
  5904. *
  5905. * @return Promise
  5906. */
  5907. blob() {
  5908. let ct = this.headers && this.headers.get('content-type') || '';
  5909. return consumeBody.call(this).then(function (buf) {
  5910. return Object.assign(
  5911. // Prevent copying
  5912. new Blob([], {
  5913. type: ct.toLowerCase()
  5914. }), {
  5915. [BUFFER]: buf
  5916. });
  5917. });
  5918. },
  5919. /**
  5920. * Decode response as json
  5921. *
  5922. * @return Promise
  5923. */
  5924. json() {
  5925. var _this2 = this;
  5926. return consumeBody.call(this).then(function (buffer) {
  5927. try {
  5928. return JSON.parse(buffer.toString());
  5929. } catch (err) {
  5930. return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));
  5931. }
  5932. });
  5933. },
  5934. /**
  5935. * Decode response as text
  5936. *
  5937. * @return Promise
  5938. */
  5939. text() {
  5940. return consumeBody.call(this).then(function (buffer) {
  5941. return buffer.toString();
  5942. });
  5943. },
  5944. /**
  5945. * Decode response as buffer (non-spec api)
  5946. *
  5947. * @return Promise
  5948. */
  5949. buffer() {
  5950. return consumeBody.call(this);
  5951. },
  5952. /**
  5953. * Decode response as text, while automatically detecting the encoding and
  5954. * trying to decode to UTF-8 (non-spec api)
  5955. *
  5956. * @return Promise
  5957. */
  5958. textConverted() {
  5959. var _this3 = this;
  5960. return consumeBody.call(this).then(function (buffer) {
  5961. return convertBody(buffer, _this3.headers);
  5962. });
  5963. }
  5964. };
  5965. // In browsers, all properties are enumerable.
  5966. Object.defineProperties(Body.prototype, {
  5967. body: { enumerable: true },
  5968. bodyUsed: { enumerable: true },
  5969. arrayBuffer: { enumerable: true },
  5970. blob: { enumerable: true },
  5971. json: { enumerable: true },
  5972. text: { enumerable: true }
  5973. });
  5974. Body.mixIn = function (proto) {
  5975. for (const name of Object.getOwnPropertyNames(Body.prototype)) {
  5976. // istanbul ignore else: future proof
  5977. if (!(name in proto)) {
  5978. const desc = Object.getOwnPropertyDescriptor(Body.prototype, name);
  5979. Object.defineProperty(proto, name, desc);
  5980. }
  5981. }
  5982. };
  5983. /**
  5984. * Consume and convert an entire Body to a Buffer.
  5985. *
  5986. * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body
  5987. *
  5988. * @return Promise
  5989. */
  5990. function consumeBody() {
  5991. var _this4 = this;
  5992. if (this[INTERNALS].disturbed) {
  5993. return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`));
  5994. }
  5995. this[INTERNALS].disturbed = true;
  5996. if (this[INTERNALS].error) {
  5997. return Body.Promise.reject(this[INTERNALS].error);
  5998. }
  5999. let body = this.body;
  6000. // body is null
  6001. if (body === null) {
  6002. return Body.Promise.resolve(Buffer.alloc(0));
  6003. }
  6004. // body is blob
  6005. if (isBlob(body)) {
  6006. body = body.stream();
  6007. }
  6008. // body is buffer
  6009. if (Buffer.isBuffer(body)) {
  6010. return Body.Promise.resolve(body);
  6011. }
  6012. // istanbul ignore if: should never happen
  6013. if (!(body instanceof Stream)) {
  6014. return Body.Promise.resolve(Buffer.alloc(0));
  6015. }
  6016. // body is stream
  6017. // get ready to actually consume the body
  6018. let accum = [];
  6019. let accumBytes = 0;
  6020. let abort = false;
  6021. return new Body.Promise(function (resolve, reject) {
  6022. let resTimeout;
  6023. // allow timeout on slow response body
  6024. if (_this4.timeout) {
  6025. resTimeout = setTimeout(function () {
  6026. abort = true;
  6027. reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout'));
  6028. }, _this4.timeout);
  6029. }
  6030. // handle stream errors
  6031. body.on('error', function (err) {
  6032. if (err.name === 'AbortError') {
  6033. // if the request was aborted, reject with this Error
  6034. abort = true;
  6035. reject(err);
  6036. } else {
  6037. // other errors, such as incorrect content-encoding
  6038. reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err));
  6039. }
  6040. });
  6041. body.on('data', function (chunk) {
  6042. if (abort || chunk === null) {
  6043. return;
  6044. }
  6045. if (_this4.size && accumBytes + chunk.length > _this4.size) {
  6046. abort = true;
  6047. reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size'));
  6048. return;
  6049. }
  6050. accumBytes += chunk.length;
  6051. accum.push(chunk);
  6052. });
  6053. body.on('end', function () {
  6054. if (abort) {
  6055. return;
  6056. }
  6057. clearTimeout(resTimeout);
  6058. try {
  6059. resolve(Buffer.concat(accum, accumBytes));
  6060. } catch (err) {
  6061. // handle streams that have accumulated too much data (issue #414)
  6062. reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err));
  6063. }
  6064. });
  6065. });
  6066. }
  6067. /**
  6068. * Detect buffer encoding and convert to target encoding
  6069. * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding
  6070. *
  6071. * @param Buffer buffer Incoming buffer
  6072. * @param String encoding Target encoding
  6073. * @return String
  6074. */
  6075. function convertBody(buffer, headers) {
  6076. if (typeof convert !== 'function') {
  6077. throw new Error('The package `encoding` must be installed to use the textConverted() function');
  6078. }
  6079. const ct = headers.get('content-type');
  6080. let charset = 'utf-8';
  6081. let res, str;
  6082. // header
  6083. if (ct) {
  6084. res = /charset=([^;]*)/i.exec(ct);
  6085. }
  6086. // no charset in content type, peek at response body for at most 1024 bytes
  6087. str = buffer.slice(0, 1024).toString();
  6088. // html5
  6089. if (!res && str) {
  6090. res = /<meta.+?charset=(['"])(.+?)\1/i.exec(str);
  6091. }
  6092. // html4
  6093. if (!res && str) {
  6094. res = /<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(str);
  6095. if (res) {
  6096. res = /charset=(.*)/i.exec(res.pop());
  6097. }
  6098. }
  6099. // xml
  6100. if (!res && str) {
  6101. res = /<\?xml.+?encoding=(['"])(.+?)\1/i.exec(str);
  6102. }
  6103. // found charset
  6104. if (res) {
  6105. charset = res.pop();
  6106. // prevent decode issues when sites use incorrect encoding
  6107. // ref: https://hsivonen.fi/encoding-menu/
  6108. if (charset === 'gb2312' || charset === 'gbk') {
  6109. charset = 'gb18030';
  6110. }
  6111. }
  6112. // turn raw buffers into a single utf-8 buffer
  6113. return convert(buffer, 'UTF-8', charset).toString();
  6114. }
  6115. /**
  6116. * Detect a URLSearchParams object
  6117. * ref: https://github.com/bitinn/node-fetch/issues/296#issuecomment-307598143
  6118. *
  6119. * @param Object obj Object to detect by type or brand
  6120. * @return String
  6121. */
  6122. function isURLSearchParams(obj) {
  6123. // Duck-typing as a necessary condition.
  6124. if (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {
  6125. return false;
  6126. }
  6127. // Brand-checking and more duck-typing as optional condition.
  6128. return obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';
  6129. }
  6130. /**
  6131. * Check if `obj` is a W3C `Blob` object (which `File` inherits from)
  6132. * @param {*} obj
  6133. * @return {boolean}
  6134. */
  6135. function isBlob(obj) {
  6136. return typeof obj === 'object' && typeof obj.arrayBuffer === 'function' && typeof obj.type === 'string' && typeof obj.stream === 'function' && typeof obj.constructor === 'function' && typeof obj.constructor.name === 'string' && /^(Blob|File)$/.test(obj.constructor.name) && /^(Blob|File)$/.test(obj[Symbol.toStringTag]);
  6137. }
  6138. /**
  6139. * Clone body given Res/Req instance
  6140. *
  6141. * @param Mixed instance Response or Request instance
  6142. * @return Mixed
  6143. */
  6144. function clone(instance) {
  6145. let p1, p2;
  6146. let body = instance.body;
  6147. // don't allow cloning a used body
  6148. if (instance.bodyUsed) {
  6149. throw new Error('cannot clone body after it is used');
  6150. }
  6151. // check that body is a stream and not form-data object
  6152. // note: we can't clone the form-data object without having it as a dependency
  6153. if (body instanceof Stream && typeof body.getBoundary !== 'function') {
  6154. // tee instance body
  6155. p1 = new PassThrough();
  6156. p2 = new PassThrough();
  6157. body.pipe(p1);
  6158. body.pipe(p2);
  6159. // set instance body to teed body and return the other teed body
  6160. instance[INTERNALS].body = p1;
  6161. body = p2;
  6162. }
  6163. return body;
  6164. }
  6165. /**
  6166. * Performs the operation "extract a `Content-Type` value from |object|" as
  6167. * specified in the specification:
  6168. * https://fetch.spec.whatwg.org/#concept-bodyinit-extract
  6169. *
  6170. * This function assumes that instance.body is present.
  6171. *
  6172. * @param Mixed instance Any options.body input
  6173. */
  6174. function extractContentType(body) {
  6175. if (body === null) {
  6176. // body is null
  6177. return null;
  6178. } else if (typeof body === 'string') {
  6179. // body is string
  6180. return 'text/plain;charset=UTF-8';
  6181. } else if (isURLSearchParams(body)) {
  6182. // body is a URLSearchParams
  6183. return 'application/x-www-form-urlencoded;charset=UTF-8';
  6184. } else if (isBlob(body)) {
  6185. // body is blob
  6186. return body.type || null;
  6187. } else if (Buffer.isBuffer(body)) {
  6188. // body is buffer
  6189. return null;
  6190. } else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  6191. // body is ArrayBuffer
  6192. return null;
  6193. } else if (ArrayBuffer.isView(body)) {
  6194. // body is ArrayBufferView
  6195. return null;
  6196. } else if (typeof body.getBoundary === 'function') {
  6197. // detect form data input from form-data module
  6198. return `multipart/form-data;boundary=${body.getBoundary()}`;
  6199. } else if (body instanceof Stream) {
  6200. // body is stream
  6201. // can't really do much about this
  6202. return null;
  6203. } else {
  6204. // Body constructor defaults other things to string
  6205. return 'text/plain;charset=UTF-8';
  6206. }
  6207. }
  6208. /**
  6209. * The Fetch Standard treats this as if "total bytes" is a property on the body.
  6210. * For us, we have to explicitly get it with a function.
  6211. *
  6212. * ref: https://fetch.spec.whatwg.org/#concept-body-total-bytes
  6213. *
  6214. * @param Body instance Instance of Body
  6215. * @return Number? Number of bytes, or null if not possible
  6216. */
  6217. function getTotalBytes(instance) {
  6218. const body = instance.body;
  6219. if (body === null) {
  6220. // body is null
  6221. return 0;
  6222. } else if (isBlob(body)) {
  6223. return body.size;
  6224. } else if (Buffer.isBuffer(body)) {
  6225. // body is buffer
  6226. return body.length;
  6227. } else if (body && typeof body.getLengthSync === 'function') {
  6228. // detect form data input from form-data module
  6229. if (body._lengthRetrievers && body._lengthRetrievers.length == 0 || // 1.x
  6230. body.hasKnownLength && body.hasKnownLength()) {
  6231. // 2.x
  6232. return body.getLengthSync();
  6233. }
  6234. return null;
  6235. } else {
  6236. // body is stream
  6237. return null;
  6238. }
  6239. }
  6240. /**
  6241. * Write a Body to a Node.js WritableStream (e.g. http.Request) object.
  6242. *
  6243. * @param Body instance Instance of Body
  6244. * @return Void
  6245. */
  6246. function writeToStream(dest, instance) {
  6247. const body = instance.body;
  6248. if (body === null) {
  6249. // body is null
  6250. dest.end();
  6251. } else if (isBlob(body)) {
  6252. body.stream().pipe(dest);
  6253. } else if (Buffer.isBuffer(body)) {
  6254. // body is buffer
  6255. dest.write(body);
  6256. dest.end();
  6257. } else {
  6258. // body is stream
  6259. body.pipe(dest);
  6260. }
  6261. }
  6262. // expose Promise
  6263. Body.Promise = global.Promise;
  6264. /**
  6265. * headers.js
  6266. *
  6267. * Headers class offers convenient helpers
  6268. */
  6269. const invalidTokenRegex = /[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/;
  6270. const invalidHeaderCharRegex = /[^\t\x20-\x7e\x80-\xff]/;
  6271. function validateName(name) {
  6272. name = `${name}`;
  6273. if (invalidTokenRegex.test(name) || name === '') {
  6274. throw new TypeError(`${name} is not a legal HTTP header name`);
  6275. }
  6276. }
  6277. function validateValue(value) {
  6278. value = `${value}`;
  6279. if (invalidHeaderCharRegex.test(value)) {
  6280. throw new TypeError(`${value} is not a legal HTTP header value`);
  6281. }
  6282. }
  6283. /**
  6284. * Find the key in the map object given a header name.
  6285. *
  6286. * Returns undefined if not found.
  6287. *
  6288. * @param String name Header name
  6289. * @return String|Undefined
  6290. */
  6291. function find(map, name) {
  6292. name = name.toLowerCase();
  6293. for (const key in map) {
  6294. if (key.toLowerCase() === name) {
  6295. return key;
  6296. }
  6297. }
  6298. return undefined;
  6299. }
  6300. const MAP = Symbol('map');
  6301. class Headers {
  6302. /**
  6303. * Headers class
  6304. *
  6305. * @param Object headers Response headers
  6306. * @return Void
  6307. */
  6308. constructor() {
  6309. let init = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
  6310. this[MAP] = Object.create(null);
  6311. if (init instanceof Headers) {
  6312. const rawHeaders = init.raw();
  6313. const headerNames = Object.keys(rawHeaders);
  6314. for (const headerName of headerNames) {
  6315. for (const value of rawHeaders[headerName]) {
  6316. this.append(headerName, value);
  6317. }
  6318. }
  6319. return;
  6320. }
  6321. // We don't worry about converting prop to ByteString here as append()
  6322. // will handle it.
  6323. if (init == null) ; else if (typeof init === 'object') {
  6324. const method = init[Symbol.iterator];
  6325. if (method != null) {
  6326. if (typeof method !== 'function') {
  6327. throw new TypeError('Header pairs must be iterable');
  6328. }
  6329. // sequence<sequence<ByteString>>
  6330. // Note: per spec we have to first exhaust the lists then process them
  6331. const pairs = [];
  6332. for (const pair of init) {
  6333. if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') {
  6334. throw new TypeError('Each header pair must be iterable');
  6335. }
  6336. pairs.push(Array.from(pair));
  6337. }
  6338. for (const pair of pairs) {
  6339. if (pair.length !== 2) {
  6340. throw new TypeError('Each header pair must be a name/value tuple');
  6341. }
  6342. this.append(pair[0], pair[1]);
  6343. }
  6344. } else {
  6345. // record<ByteString, ByteString>
  6346. for (const key of Object.keys(init)) {
  6347. const value = init[key];
  6348. this.append(key, value);
  6349. }
  6350. }
  6351. } else {
  6352. throw new TypeError('Provided initializer must be an object');
  6353. }
  6354. }
  6355. /**
  6356. * Return combined header value given name
  6357. *
  6358. * @param String name Header name
  6359. * @return Mixed
  6360. */
  6361. get(name) {
  6362. name = `${name}`;
  6363. validateName(name);
  6364. const key = find(this[MAP], name);
  6365. if (key === undefined) {
  6366. return null;
  6367. }
  6368. return this[MAP][key].join(', ');
  6369. }
  6370. /**
  6371. * Iterate over all headers
  6372. *
  6373. * @param Function callback Executed for each item with parameters (value, name, thisArg)
  6374. * @param Boolean thisArg `this` context for callback function
  6375. * @return Void
  6376. */
  6377. forEach(callback) {
  6378. let thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
  6379. let pairs = getHeaders(this);
  6380. let i = 0;
  6381. while (i < pairs.length) {
  6382. var _pairs$i = pairs[i];
  6383. const name = _pairs$i[0],
  6384. value = _pairs$i[1];
  6385. callback.call(thisArg, value, name, this);
  6386. pairs = getHeaders(this);
  6387. i++;
  6388. }
  6389. }
  6390. /**
  6391. * Overwrite header values given name
  6392. *
  6393. * @param String name Header name
  6394. * @param String value Header value
  6395. * @return Void
  6396. */
  6397. set(name, value) {
  6398. name = `${name}`;
  6399. value = `${value}`;
  6400. validateName(name);
  6401. validateValue(value);
  6402. const key = find(this[MAP], name);
  6403. this[MAP][key !== undefined ? key : name] = [value];
  6404. }
  6405. /**
  6406. * Append a value onto existing header
  6407. *
  6408. * @param String name Header name
  6409. * @param String value Header value
  6410. * @return Void
  6411. */
  6412. append(name, value) {
  6413. name = `${name}`;
  6414. value = `${value}`;
  6415. validateName(name);
  6416. validateValue(value);
  6417. const key = find(this[MAP], name);
  6418. if (key !== undefined) {
  6419. this[MAP][key].push(value);
  6420. } else {
  6421. this[MAP][name] = [value];
  6422. }
  6423. }
  6424. /**
  6425. * Check for header name existence
  6426. *
  6427. * @param String name Header name
  6428. * @return Boolean
  6429. */
  6430. has(name) {
  6431. name = `${name}`;
  6432. validateName(name);
  6433. return find(this[MAP], name) !== undefined;
  6434. }
  6435. /**
  6436. * Delete all header values given name
  6437. *
  6438. * @param String name Header name
  6439. * @return Void
  6440. */
  6441. delete(name) {
  6442. name = `${name}`;
  6443. validateName(name);
  6444. const key = find(this[MAP], name);
  6445. if (key !== undefined) {
  6446. delete this[MAP][key];
  6447. }
  6448. }
  6449. /**
  6450. * Return raw headers (non-spec api)
  6451. *
  6452. * @return Object
  6453. */
  6454. raw() {
  6455. return this[MAP];
  6456. }
  6457. /**
  6458. * Get an iterator on keys.
  6459. *
  6460. * @return Iterator
  6461. */
  6462. keys() {
  6463. return createHeadersIterator(this, 'key');
  6464. }
  6465. /**
  6466. * Get an iterator on values.
  6467. *
  6468. * @return Iterator
  6469. */
  6470. values() {
  6471. return createHeadersIterator(this, 'value');
  6472. }
  6473. /**
  6474. * Get an iterator on entries.
  6475. *
  6476. * This is the default iterator of the Headers object.
  6477. *
  6478. * @return Iterator
  6479. */
  6480. [Symbol.iterator]() {
  6481. return createHeadersIterator(this, 'key+value');
  6482. }
  6483. }
  6484. Headers.prototype.entries = Headers.prototype[Symbol.iterator];
  6485. Object.defineProperty(Headers.prototype, Symbol.toStringTag, {
  6486. value: 'Headers',
  6487. writable: false,
  6488. enumerable: false,
  6489. configurable: true
  6490. });
  6491. Object.defineProperties(Headers.prototype, {
  6492. get: { enumerable: true },
  6493. forEach: { enumerable: true },
  6494. set: { enumerable: true },
  6495. append: { enumerable: true },
  6496. has: { enumerable: true },
  6497. delete: { enumerable: true },
  6498. keys: { enumerable: true },
  6499. values: { enumerable: true },
  6500. entries: { enumerable: true }
  6501. });
  6502. function getHeaders(headers) {
  6503. let kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value';
  6504. const keys = Object.keys(headers[MAP]).sort();
  6505. return keys.map(kind === 'key' ? function (k) {
  6506. return k.toLowerCase();
  6507. } : kind === 'value' ? function (k) {
  6508. return headers[MAP][k].join(', ');
  6509. } : function (k) {
  6510. return [k.toLowerCase(), headers[MAP][k].join(', ')];
  6511. });
  6512. }
  6513. const INTERNAL = Symbol('internal');
  6514. function createHeadersIterator(target, kind) {
  6515. const iterator = Object.create(HeadersIteratorPrototype);
  6516. iterator[INTERNAL] = {
  6517. target,
  6518. kind,
  6519. index: 0
  6520. };
  6521. return iterator;
  6522. }
  6523. const HeadersIteratorPrototype = Object.setPrototypeOf({
  6524. next() {
  6525. // istanbul ignore if
  6526. if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) {
  6527. throw new TypeError('Value of `this` is not a HeadersIterator');
  6528. }
  6529. var _INTERNAL = this[INTERNAL];
  6530. const target = _INTERNAL.target,
  6531. kind = _INTERNAL.kind,
  6532. index = _INTERNAL.index;
  6533. const values = getHeaders(target, kind);
  6534. const len = values.length;
  6535. if (index >= len) {
  6536. return {
  6537. value: undefined,
  6538. done: true
  6539. };
  6540. }
  6541. this[INTERNAL].index = index + 1;
  6542. return {
  6543. value: values[index],
  6544. done: false
  6545. };
  6546. }
  6547. }, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));
  6548. Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, {
  6549. value: 'HeadersIterator',
  6550. writable: false,
  6551. enumerable: false,
  6552. configurable: true
  6553. });
  6554. /**
  6555. * Export the Headers object in a form that Node.js can consume.
  6556. *
  6557. * @param Headers headers
  6558. * @return Object
  6559. */
  6560. function exportNodeCompatibleHeaders(headers) {
  6561. const obj = Object.assign({ __proto__: null }, headers[MAP]);
  6562. // http.request() only supports string as Host header. This hack makes
  6563. // specifying custom Host header possible.
  6564. const hostHeaderKey = find(headers[MAP], 'Host');
  6565. if (hostHeaderKey !== undefined) {
  6566. obj[hostHeaderKey] = obj[hostHeaderKey][0];
  6567. }
  6568. return obj;
  6569. }
  6570. /**
  6571. * Create a Headers object from an object of headers, ignoring those that do
  6572. * not conform to HTTP grammar productions.
  6573. *
  6574. * @param Object obj Object of headers
  6575. * @return Headers
  6576. */
  6577. function createHeadersLenient(obj) {
  6578. const headers = new Headers();
  6579. for (const name of Object.keys(obj)) {
  6580. if (invalidTokenRegex.test(name)) {
  6581. continue;
  6582. }
  6583. if (Array.isArray(obj[name])) {
  6584. for (const val of obj[name]) {
  6585. if (invalidHeaderCharRegex.test(val)) {
  6586. continue;
  6587. }
  6588. if (headers[MAP][name] === undefined) {
  6589. headers[MAP][name] = [val];
  6590. } else {
  6591. headers[MAP][name].push(val);
  6592. }
  6593. }
  6594. } else if (!invalidHeaderCharRegex.test(obj[name])) {
  6595. headers[MAP][name] = [obj[name]];
  6596. }
  6597. }
  6598. return headers;
  6599. }
  6600. const INTERNALS$1 = Symbol('Response internals');
  6601. // fix an issue where "STATUS_CODES" aren't a named export for node <10
  6602. const STATUS_CODES = http.STATUS_CODES;
  6603. /**
  6604. * Response class
  6605. *
  6606. * @param Stream body Readable stream
  6607. * @param Object opts Response options
  6608. * @return Void
  6609. */
  6610. class Response {
  6611. constructor() {
  6612. let body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  6613. let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  6614. Body.call(this, body, opts);
  6615. const status = opts.status || 200;
  6616. const headers = new Headers(opts.headers);
  6617. if (body != null && !headers.has('Content-Type')) {
  6618. const contentType = extractContentType(body);
  6619. if (contentType) {
  6620. headers.append('Content-Type', contentType);
  6621. }
  6622. }
  6623. this[INTERNALS$1] = {
  6624. url: opts.url,
  6625. status,
  6626. statusText: opts.statusText || STATUS_CODES[status],
  6627. headers,
  6628. counter: opts.counter
  6629. };
  6630. }
  6631. get url() {
  6632. return this[INTERNALS$1].url || '';
  6633. }
  6634. get status() {
  6635. return this[INTERNALS$1].status;
  6636. }
  6637. /**
  6638. * Convenience property representing if the request ended normally
  6639. */
  6640. get ok() {
  6641. return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;
  6642. }
  6643. get redirected() {
  6644. return this[INTERNALS$1].counter > 0;
  6645. }
  6646. get statusText() {
  6647. return this[INTERNALS$1].statusText;
  6648. }
  6649. get headers() {
  6650. return this[INTERNALS$1].headers;
  6651. }
  6652. /**
  6653. * Clone this response
  6654. *
  6655. * @return Response
  6656. */
  6657. clone() {
  6658. return new Response(clone(this), {
  6659. url: this.url,
  6660. status: this.status,
  6661. statusText: this.statusText,
  6662. headers: this.headers,
  6663. ok: this.ok,
  6664. redirected: this.redirected
  6665. });
  6666. }
  6667. }
  6668. Body.mixIn(Response.prototype);
  6669. Object.defineProperties(Response.prototype, {
  6670. url: { enumerable: true },
  6671. status: { enumerable: true },
  6672. ok: { enumerable: true },
  6673. redirected: { enumerable: true },
  6674. statusText: { enumerable: true },
  6675. headers: { enumerable: true },
  6676. clone: { enumerable: true }
  6677. });
  6678. Object.defineProperty(Response.prototype, Symbol.toStringTag, {
  6679. value: 'Response',
  6680. writable: false,
  6681. enumerable: false,
  6682. configurable: true
  6683. });
  6684. const INTERNALS$2 = Symbol('Request internals');
  6685. // fix an issue where "format", "parse" aren't a named export for node <10
  6686. const parse_url = Url.parse;
  6687. const format_url = Url.format;
  6688. const streamDestructionSupported = 'destroy' in Stream.Readable.prototype;
  6689. /**
  6690. * Check if a value is an instance of Request.
  6691. *
  6692. * @param Mixed input
  6693. * @return Boolean
  6694. */
  6695. function isRequest(input) {
  6696. return typeof input === 'object' && typeof input[INTERNALS$2] === 'object';
  6697. }
  6698. function isAbortSignal(signal) {
  6699. const proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal);
  6700. return !!(proto && proto.constructor.name === 'AbortSignal');
  6701. }
  6702. /**
  6703. * Request class
  6704. *
  6705. * @param Mixed input Url or Request instance
  6706. * @param Object init Custom options
  6707. * @return Void
  6708. */
  6709. class Request {
  6710. constructor(input) {
  6711. let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  6712. let parsedURL;
  6713. // normalize input
  6714. if (!isRequest(input)) {
  6715. if (input && input.href) {
  6716. // in order to support Node.js' Url objects; though WHATWG's URL objects
  6717. // will fall into this branch also (since their `toString()` will return
  6718. // `href` property anyway)
  6719. parsedURL = parse_url(input.href);
  6720. } else {
  6721. // coerce input to a string before attempting to parse
  6722. parsedURL = parse_url(`${input}`);
  6723. }
  6724. input = {};
  6725. } else {
  6726. parsedURL = parse_url(input.url);
  6727. }
  6728. let method = init.method || input.method || 'GET';
  6729. method = method.toUpperCase();
  6730. if ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) {
  6731. throw new TypeError('Request with GET/HEAD method cannot have body');
  6732. }
  6733. let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null;
  6734. Body.call(this, inputBody, {
  6735. timeout: init.timeout || input.timeout || 0,
  6736. size: init.size || input.size || 0
  6737. });
  6738. const headers = new Headers(init.headers || input.headers || {});
  6739. if (inputBody != null && !headers.has('Content-Type')) {
  6740. const contentType = extractContentType(inputBody);
  6741. if (contentType) {
  6742. headers.append('Content-Type', contentType);
  6743. }
  6744. }
  6745. let signal = isRequest(input) ? input.signal : null;
  6746. if ('signal' in init) signal = init.signal;
  6747. if (signal != null && !isAbortSignal(signal)) {
  6748. throw new TypeError('Expected signal to be an instanceof AbortSignal');
  6749. }
  6750. this[INTERNALS$2] = {
  6751. method,
  6752. redirect: init.redirect || input.redirect || 'follow',
  6753. headers,
  6754. parsedURL,
  6755. signal
  6756. };
  6757. // node-fetch-only options
  6758. this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20;
  6759. this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true;
  6760. this.counter = init.counter || input.counter || 0;
  6761. this.agent = init.agent || input.agent;
  6762. }
  6763. get method() {
  6764. return this[INTERNALS$2].method;
  6765. }
  6766. get url() {
  6767. return format_url(this[INTERNALS$2].parsedURL);
  6768. }
  6769. get headers() {
  6770. return this[INTERNALS$2].headers;
  6771. }
  6772. get redirect() {
  6773. return this[INTERNALS$2].redirect;
  6774. }
  6775. get signal() {
  6776. return this[INTERNALS$2].signal;
  6777. }
  6778. /**
  6779. * Clone this request
  6780. *
  6781. * @return Request
  6782. */
  6783. clone() {
  6784. return new Request(this);
  6785. }
  6786. }
  6787. Body.mixIn(Request.prototype);
  6788. Object.defineProperty(Request.prototype, Symbol.toStringTag, {
  6789. value: 'Request',
  6790. writable: false,
  6791. enumerable: false,
  6792. configurable: true
  6793. });
  6794. Object.defineProperties(Request.prototype, {
  6795. method: { enumerable: true },
  6796. url: { enumerable: true },
  6797. headers: { enumerable: true },
  6798. redirect: { enumerable: true },
  6799. clone: { enumerable: true },
  6800. signal: { enumerable: true }
  6801. });
  6802. /**
  6803. * Convert a Request to Node.js http request options.
  6804. *
  6805. * @param Request A Request instance
  6806. * @return Object The options object to be passed to http.request
  6807. */
  6808. function getNodeRequestOptions(request) {
  6809. const parsedURL = request[INTERNALS$2].parsedURL;
  6810. const headers = new Headers(request[INTERNALS$2].headers);
  6811. // fetch step 1.3
  6812. if (!headers.has('Accept')) {
  6813. headers.set('Accept', '*/*');
  6814. }
  6815. // Basic fetch
  6816. if (!parsedURL.protocol || !parsedURL.hostname) {
  6817. throw new TypeError('Only absolute URLs are supported');
  6818. }
  6819. if (!/^https?:$/.test(parsedURL.protocol)) {
  6820. throw new TypeError('Only HTTP(S) protocols are supported');
  6821. }
  6822. if (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) {
  6823. throw new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8');
  6824. }
  6825. // HTTP-network-or-cache fetch steps 2.4-2.7
  6826. let contentLengthValue = null;
  6827. if (request.body == null && /^(POST|PUT)$/i.test(request.method)) {
  6828. contentLengthValue = '0';
  6829. }
  6830. if (request.body != null) {
  6831. const totalBytes = getTotalBytes(request);
  6832. if (typeof totalBytes === 'number') {
  6833. contentLengthValue = String(totalBytes);
  6834. }
  6835. }
  6836. if (contentLengthValue) {
  6837. headers.set('Content-Length', contentLengthValue);
  6838. }
  6839. // HTTP-network-or-cache fetch step 2.11
  6840. if (!headers.has('User-Agent')) {
  6841. headers.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)');
  6842. }
  6843. // HTTP-network-or-cache fetch step 2.15
  6844. if (request.compress && !headers.has('Accept-Encoding')) {
  6845. headers.set('Accept-Encoding', 'gzip,deflate');
  6846. }
  6847. let agent = request.agent;
  6848. if (typeof agent === 'function') {
  6849. agent = agent(parsedURL);
  6850. }
  6851. if (!headers.has('Connection') && !agent) {
  6852. headers.set('Connection', 'close');
  6853. }
  6854. // HTTP-network fetch step 4.2
  6855. // chunked encoding is handled by Node.js
  6856. return Object.assign({}, parsedURL, {
  6857. method: request.method,
  6858. headers: exportNodeCompatibleHeaders(headers),
  6859. agent
  6860. });
  6861. }
  6862. /**
  6863. * abort-error.js
  6864. *
  6865. * AbortError interface for cancelled requests
  6866. */
  6867. /**
  6868. * Create AbortError instance
  6869. *
  6870. * @param String message Error message for human
  6871. * @return AbortError
  6872. */
  6873. function AbortError(message) {
  6874. Error.call(this, message);
  6875. this.type = 'aborted';
  6876. this.message = message;
  6877. // hide custom error implementation details from end-users
  6878. Error.captureStackTrace(this, this.constructor);
  6879. }
  6880. AbortError.prototype = Object.create(Error.prototype);
  6881. AbortError.prototype.constructor = AbortError;
  6882. AbortError.prototype.name = 'AbortError';
  6883. // fix an issue where "PassThrough", "resolve" aren't a named export for node <10
  6884. const PassThrough$1 = Stream.PassThrough;
  6885. const resolve_url = Url.resolve;
  6886. /**
  6887. * Fetch function
  6888. *
  6889. * @param Mixed url Absolute url or Request instance
  6890. * @param Object opts Fetch options
  6891. * @return Promise
  6892. */
  6893. function fetch(url, opts) {
  6894. // allow custom promise
  6895. if (!fetch.Promise) {
  6896. throw new Error('native promise missing, set fetch.Promise to your favorite alternative');
  6897. }
  6898. Body.Promise = fetch.Promise;
  6899. // wrap http.request into fetch
  6900. return new fetch.Promise(function (resolve, reject) {
  6901. // build request object
  6902. const request = new Request(url, opts);
  6903. const options = getNodeRequestOptions(request);
  6904. const send = (options.protocol === 'https:' ? https : http).request;
  6905. const signal = request.signal;
  6906. let response = null;
  6907. const abort = function abort() {
  6908. let error = new AbortError('The user aborted a request.');
  6909. reject(error);
  6910. if (request.body && request.body instanceof Stream.Readable) {
  6911. request.body.destroy(error);
  6912. }
  6913. if (!response || !response.body) return;
  6914. response.body.emit('error', error);
  6915. };
  6916. if (signal && signal.aborted) {
  6917. abort();
  6918. return;
  6919. }
  6920. const abortAndFinalize = function abortAndFinalize() {
  6921. abort();
  6922. finalize();
  6923. };
  6924. // send request
  6925. const req = send(options);
  6926. let reqTimeout;
  6927. if (signal) {
  6928. signal.addEventListener('abort', abortAndFinalize);
  6929. }
  6930. function finalize() {
  6931. req.abort();
  6932. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  6933. clearTimeout(reqTimeout);
  6934. }
  6935. if (request.timeout) {
  6936. req.once('socket', function (socket) {
  6937. reqTimeout = setTimeout(function () {
  6938. reject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout'));
  6939. finalize();
  6940. }, request.timeout);
  6941. });
  6942. }
  6943. req.on('error', function (err) {
  6944. reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));
  6945. finalize();
  6946. });
  6947. req.on('response', function (res) {
  6948. clearTimeout(reqTimeout);
  6949. const headers = createHeadersLenient(res.headers);
  6950. // HTTP fetch step 5
  6951. if (fetch.isRedirect(res.statusCode)) {
  6952. // HTTP fetch step 5.2
  6953. const location = headers.get('Location');
  6954. // HTTP fetch step 5.3
  6955. const locationURL = location === null ? null : resolve_url(request.url, location);
  6956. // HTTP fetch step 5.5
  6957. switch (request.redirect) {
  6958. case 'error':
  6959. reject(new FetchError(`redirect mode is set to error: ${request.url}`, 'no-redirect'));
  6960. finalize();
  6961. return;
  6962. case 'manual':
  6963. // node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL.
  6964. if (locationURL !== null) {
  6965. // handle corrupted header
  6966. try {
  6967. headers.set('Location', locationURL);
  6968. } catch (err) {
  6969. // istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request
  6970. reject(err);
  6971. }
  6972. }
  6973. break;
  6974. case 'follow':
  6975. // HTTP-redirect fetch step 2
  6976. if (locationURL === null) {
  6977. break;
  6978. }
  6979. // HTTP-redirect fetch step 5
  6980. if (request.counter >= request.follow) {
  6981. reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));
  6982. finalize();
  6983. return;
  6984. }
  6985. // HTTP-redirect fetch step 6 (counter increment)
  6986. // Create a new Request object.
  6987. const requestOpts = {
  6988. headers: new Headers(request.headers),
  6989. follow: request.follow,
  6990. counter: request.counter + 1,
  6991. agent: request.agent,
  6992. compress: request.compress,
  6993. method: request.method,
  6994. body: request.body,
  6995. signal: request.signal,
  6996. timeout: request.timeout
  6997. };
  6998. // HTTP-redirect fetch step 9
  6999. if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {
  7000. reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));
  7001. finalize();
  7002. return;
  7003. }
  7004. // HTTP-redirect fetch step 11
  7005. if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') {
  7006. requestOpts.method = 'GET';
  7007. requestOpts.body = undefined;
  7008. requestOpts.headers.delete('content-length');
  7009. }
  7010. // HTTP-redirect fetch step 15
  7011. resolve(fetch(new Request(locationURL, requestOpts)));
  7012. finalize();
  7013. return;
  7014. }
  7015. }
  7016. // prepare response
  7017. res.once('end', function () {
  7018. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  7019. });
  7020. let body = res.pipe(new PassThrough$1());
  7021. const response_options = {
  7022. url: request.url,
  7023. status: res.statusCode,
  7024. statusText: res.statusMessage,
  7025. headers: headers,
  7026. size: request.size,
  7027. timeout: request.timeout,
  7028. counter: request.counter
  7029. };
  7030. // HTTP-network fetch step 12.1.1.3
  7031. const codings = headers.get('Content-Encoding');
  7032. // HTTP-network fetch step 12.1.1.4: handle content codings
  7033. // in following scenarios we ignore compression support
  7034. // 1. compression support is disabled
  7035. // 2. HEAD request
  7036. // 3. no Content-Encoding header
  7037. // 4. no content response (204)
  7038. // 5. content not modified response (304)
  7039. if (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) {
  7040. response = new Response(body, response_options);
  7041. resolve(response);
  7042. return;
  7043. }
  7044. // For Node v6+
  7045. // Be less strict when decoding compressed responses, since sometimes
  7046. // servers send slightly invalid responses that are still accepted
  7047. // by common browsers.
  7048. // Always using Z_SYNC_FLUSH is what cURL does.
  7049. const zlibOptions = {
  7050. flush: zlib.Z_SYNC_FLUSH,
  7051. finishFlush: zlib.Z_SYNC_FLUSH
  7052. };
  7053. // for gzip
  7054. if (codings == 'gzip' || codings == 'x-gzip') {
  7055. body = body.pipe(zlib.createGunzip(zlibOptions));
  7056. response = new Response(body, response_options);
  7057. resolve(response);
  7058. return;
  7059. }
  7060. // for deflate
  7061. if (codings == 'deflate' || codings == 'x-deflate') {
  7062. // handle the infamous raw deflate response from old servers
  7063. // a hack for old IIS and Apache servers
  7064. const raw = res.pipe(new PassThrough$1());
  7065. raw.once('data', function (chunk) {
  7066. // see http://stackoverflow.com/questions/37519828
  7067. if ((chunk[0] & 0x0F) === 0x08) {
  7068. body = body.pipe(zlib.createInflate());
  7069. } else {
  7070. body = body.pipe(zlib.createInflateRaw());
  7071. }
  7072. response = new Response(body, response_options);
  7073. resolve(response);
  7074. });
  7075. return;
  7076. }
  7077. // for br
  7078. if (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') {
  7079. body = body.pipe(zlib.createBrotliDecompress());
  7080. response = new Response(body, response_options);
  7081. resolve(response);
  7082. return;
  7083. }
  7084. // otherwise, use response as-is
  7085. response = new Response(body, response_options);
  7086. resolve(response);
  7087. });
  7088. writeToStream(req, request);
  7089. });
  7090. }
  7091. /**
  7092. * Redirect code matching
  7093. *
  7094. * @param Number code Status code
  7095. * @return Boolean
  7096. */
  7097. fetch.isRedirect = function (code) {
  7098. return code === 301 || code === 302 || code === 303 || code === 307 || code === 308;
  7099. };
  7100. // expose Promise
  7101. fetch.Promise = global.Promise;
  7102. module.exports = exports = fetch;
  7103. Object.defineProperty(exports, "__esModule", { value: true });
  7104. exports.default = exports;
  7105. exports.Headers = Headers;
  7106. exports.Request = Request;
  7107. exports.Response = Response;
  7108. exports.FetchError = FetchError;
  7109. /***/ }),
  7110. /***/ 462:
  7111. /***/ (function(module) {
  7112. "use strict";
  7113. // See http://www.robvanderwoude.com/escapechars.php
  7114. const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
  7115. function escapeCommand(arg) {
  7116. // Escape meta chars
  7117. arg = arg.replace(metaCharsRegExp, '^$1');
  7118. return arg;
  7119. }
  7120. function escapeArgument(arg, doubleEscapeMetaChars) {
  7121. // Convert to string
  7122. arg = `${arg}`;
  7123. // Algorithm below is based on https://qntm.org/cmd
  7124. // Sequence of backslashes followed by a double quote:
  7125. // double up all the backslashes and escape the double quote
  7126. arg = arg.replace(/(\\*)"/g, '$1$1\\"');
  7127. // Sequence of backslashes followed by the end of the string
  7128. // (which will become a double quote later):
  7129. // double up all the backslashes
  7130. arg = arg.replace(/(\\*)$/, '$1$1');
  7131. // All other backslashes occur literally
  7132. // Quote the whole thing:
  7133. arg = `"${arg}"`;
  7134. // Escape meta chars
  7135. arg = arg.replace(metaCharsRegExp, '^$1');
  7136. // Double escape meta chars if necessary
  7137. if (doubleEscapeMetaChars) {
  7138. arg = arg.replace(metaCharsRegExp, '^$1');
  7139. }
  7140. return arg;
  7141. }
  7142. module.exports.command = escapeCommand;
  7143. module.exports.argument = escapeArgument;
  7144. /***/ }),
  7145. /***/ 463:
  7146. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7147. "use strict";
  7148. Object.defineProperty(exports, '__esModule', { value: true });
  7149. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  7150. var deprecation = __webpack_require__(692);
  7151. var once = _interopDefault(__webpack_require__(969));
  7152. const logOnce = once(deprecation => console.warn(deprecation));
  7153. /**
  7154. * Error with extra properties to help with debugging
  7155. */
  7156. class RequestError extends Error {
  7157. constructor(message, statusCode, options) {
  7158. super(message); // Maintains proper stack trace (only available on V8)
  7159. /* istanbul ignore next */
  7160. if (Error.captureStackTrace) {
  7161. Error.captureStackTrace(this, this.constructor);
  7162. }
  7163. this.name = "HttpError";
  7164. this.status = statusCode;
  7165. Object.defineProperty(this, "code", {
  7166. get() {
  7167. logOnce(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`."));
  7168. return statusCode;
  7169. }
  7170. });
  7171. this.headers = options.headers || {}; // redact request credentials without mutating original request options
  7172. const requestCopy = Object.assign({}, options.request);
  7173. if (options.request.headers.authorization) {
  7174. requestCopy.headers = Object.assign({}, options.request.headers, {
  7175. authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]")
  7176. });
  7177. }
  7178. requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit
  7179. // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications
  7180. .replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]") // OAuth tokens can be passed as URL query parameters, although it is not recommended
  7181. // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header
  7182. .replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
  7183. this.request = requestCopy;
  7184. }
  7185. }
  7186. exports.RequestError = RequestError;
  7187. //# sourceMappingURL=index.js.map
  7188. /***/ }),
  7189. /***/ 464:
  7190. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7191. "use strict";
  7192. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  7193. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  7194. return new (P || (P = Promise))(function (resolve, reject) {
  7195. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  7196. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  7197. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  7198. step((generator = generator.apply(thisArg, _arguments || [])).next());
  7199. });
  7200. };
  7201. var __importStar = (this && this.__importStar) || function (mod) {
  7202. if (mod && mod.__esModule) return mod;
  7203. var result = {};
  7204. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  7205. result["default"] = mod;
  7206. return result;
  7207. };
  7208. Object.defineProperty(exports, "__esModule", { value: true });
  7209. const assert = __importStar(__webpack_require__(357));
  7210. const core = __importStar(__webpack_require__(470));
  7211. const exec = __importStar(__webpack_require__(986));
  7212. const fs = __importStar(__webpack_require__(747));
  7213. const github = __importStar(__webpack_require__(469));
  7214. const https = __importStar(__webpack_require__(211));
  7215. const io = __importStar(__webpack_require__(1));
  7216. const path = __importStar(__webpack_require__(622));
  7217. const refHelper = __importStar(__webpack_require__(227));
  7218. const retryHelper = __importStar(__webpack_require__(587));
  7219. const toolCache = __importStar(__webpack_require__(533));
  7220. const IS_WINDOWS = process.platform === 'win32';
  7221. function downloadRepository(accessToken, owner, repo, ref, commit, repositoryPath) {
  7222. return __awaiter(this, void 0, void 0, function* () {
  7223. // Determine archive path
  7224. const runnerTemp = process.env['RUNNER_TEMP'];
  7225. assert.ok(runnerTemp, 'RUNNER_TEMP not defined');
  7226. const archivePath = path.join(runnerTemp, 'checkout.tar.gz');
  7227. // await fs.promises.writeFile(archivePath, raw)
  7228. // Get the archive URL using the REST API
  7229. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  7230. // Prepare the archive stream
  7231. core.debug(`Preparing the archive stream: ${archivePath}`);
  7232. yield io.rmRF(archivePath);
  7233. const fileStream = fs.createWriteStream(archivePath);
  7234. const fileStreamClosed = getFileClosedPromise(fileStream);
  7235. try {
  7236. // Get the archive URL using the GitHub REST API
  7237. core.info('Getting archive URL from GitHub REST API');
  7238. const octokit = new github.GitHub(accessToken);
  7239. const params = {
  7240. method: 'HEAD',
  7241. archive_format: IS_WINDOWS ? 'zipball' : 'tarball',
  7242. owner: owner,
  7243. repo: repo,
  7244. ref: refHelper.getDownloadRef(ref, commit)
  7245. };
  7246. const response = yield octokit.repos.getArchiveLink(params);
  7247. console.log('GOT THE RESPONSE');
  7248. console.log(response.status);
  7249. if (response.status != 302) {
  7250. throw new Error(`Unexpected response from GitHub API. Status: '${response.status}'`);
  7251. }
  7252. console.log('GETTING THE LOCATION');
  7253. const archiveUrl = response.headers['Location']; // Do not print the archive URL because it has an embedded token
  7254. assert.ok(archiveUrl, `Expected GitHub API response to contain 'Location' header`);
  7255. // Download the archive
  7256. core.info('Downloading the archive'); // Do not print the archive URL because it has an embedded token
  7257. yield downloadFile(archiveUrl, fileStream);
  7258. }
  7259. finally {
  7260. fileStream.end();
  7261. yield fileStreamClosed;
  7262. }
  7263. // return Buffer.from(response.data) // response.data is ArrayBuffer
  7264. }));
  7265. // // Download the archive
  7266. // core.info('Downloading the archive') // Do not print the URL since it contains a token to download the archive
  7267. // await downloadFile(archiveUrl, archivePath)
  7268. // // console.log(`status=${response.status}`)
  7269. // // console.log(`headers=${JSON.stringify(response.headers)}`)
  7270. // // console.log(`data=${response.data}`)
  7271. // // console.log(`data=${JSON.stringify(response.data)}`)
  7272. // // for (const key of Object.keys(response.data)) {
  7273. // // console.log(`data['${key}']=${response.data[key]}`)
  7274. // // }
  7275. // // Write archive to file
  7276. // const runnerTemp = process.env['RUNNER_TEMP'] as string
  7277. // assert.ok(runnerTemp, 'RUNNER_TEMP not defined')
  7278. // const archivePath = path.join(runnerTemp, 'checkout.tar.gz')
  7279. // await io.rmRF(archivePath)
  7280. // await fs.promises.writeFile(archivePath, raw)
  7281. // // await exec.exec(`ls -la "${archiveFile}"`, [], {
  7282. // // cwd: repositoryPath
  7283. // // } as ExecOptions)
  7284. // Extract archive
  7285. const extractPath = path.join(runnerTemp, `checkout-archive${IS_WINDOWS ? '.zip' : '.tar.gz'}`);
  7286. yield io.rmRF(extractPath);
  7287. yield io.mkdirP(extractPath);
  7288. if (IS_WINDOWS) {
  7289. yield toolCache.extractZip(archivePath, extractPath);
  7290. }
  7291. else {
  7292. yield toolCache.extractTar(archivePath, extractPath);
  7293. }
  7294. // await exec.exec(`tar -xzf "${archiveFile}"`, [], {
  7295. // cwd: extractPath
  7296. // } as ExecOptions)
  7297. // Determine the real directory to copy (ignore extra dir at root of the archive)
  7298. const archiveFileNames = yield fs.promises.readdir(extractPath);
  7299. assert.ok(archiveFileNames.length == 1, 'Expected exactly one directory inside archive');
  7300. const extraDirectoryName = archiveFileNames[0];
  7301. core.info(`Resolved ${extraDirectoryName}`); // contains the short SHA
  7302. const tempRepositoryPath = path.join(extractPath, extraDirectoryName);
  7303. // Move the files
  7304. for (const fileName of yield fs.promises.readdir(tempRepositoryPath)) {
  7305. const sourcePath = path.join(tempRepositoryPath, fileName);
  7306. const targetPath = path.join(repositoryPath, fileName);
  7307. yield io.mv(sourcePath, targetPath);
  7308. }
  7309. yield exec.exec(`find .`, [], {
  7310. cwd: repositoryPath
  7311. });
  7312. });
  7313. }
  7314. exports.downloadRepository = downloadRepository;
  7315. function downloadFile(url, fileStream) {
  7316. return new Promise((resolve, reject) => {
  7317. try {
  7318. https.get(url, (response) => {
  7319. if (response.statusCode != 200) {
  7320. reject(`Request failed with status '${response.statusCode}'`);
  7321. response.resume(); // Consume response data to free up memory
  7322. return;
  7323. }
  7324. response.on('data', chunk => {
  7325. fileStream.write(chunk);
  7326. });
  7327. response.on('end', () => {
  7328. resolve();
  7329. });
  7330. response.on('error', err => {
  7331. reject(err);
  7332. });
  7333. // response.pipe(fileStream)
  7334. });
  7335. }
  7336. catch (err) {
  7337. reject(err);
  7338. }
  7339. });
  7340. }
  7341. function getFileClosedPromise(stream) {
  7342. return new Promise((resolve, reject) => {
  7343. stream.on('error', err => {
  7344. reject(err);
  7345. });
  7346. stream.on('finish', () => {
  7347. resolve();
  7348. });
  7349. });
  7350. }
  7351. /***/ }),
  7352. /***/ 469:
  7353. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7354. "use strict";
  7355. var __importDefault = (this && this.__importDefault) || function (mod) {
  7356. return (mod && mod.__esModule) ? mod : { "default": mod };
  7357. };
  7358. var __importStar = (this && this.__importStar) || function (mod) {
  7359. if (mod && mod.__esModule) return mod;
  7360. var result = {};
  7361. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  7362. result["default"] = mod;
  7363. return result;
  7364. };
  7365. Object.defineProperty(exports, "__esModule", { value: true });
  7366. // Originally pulled from https://github.com/JasonEtco/actions-toolkit/blob/master/src/github.ts
  7367. const graphql_1 = __webpack_require__(898);
  7368. const rest_1 = __importDefault(__webpack_require__(0));
  7369. const Context = __importStar(__webpack_require__(262));
  7370. // We need this in order to extend Octokit
  7371. rest_1.default.prototype = new rest_1.default();
  7372. exports.context = new Context.Context();
  7373. class GitHub extends rest_1.default {
  7374. constructor(token, opts = {}) {
  7375. super(Object.assign(Object.assign({}, opts), { auth: `token ${token}` }));
  7376. this.graphql = graphql_1.graphql.defaults({
  7377. headers: { authorization: `token ${token}` }
  7378. });
  7379. }
  7380. }
  7381. exports.GitHub = GitHub;
  7382. //# sourceMappingURL=github.js.map
  7383. /***/ }),
  7384. /***/ 470:
  7385. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7386. "use strict";
  7387. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  7388. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  7389. return new (P || (P = Promise))(function (resolve, reject) {
  7390. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  7391. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  7392. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  7393. step((generator = generator.apply(thisArg, _arguments || [])).next());
  7394. });
  7395. };
  7396. Object.defineProperty(exports, "__esModule", { value: true });
  7397. const command_1 = __webpack_require__(431);
  7398. const os = __webpack_require__(87);
  7399. const path = __webpack_require__(622);
  7400. /**
  7401. * The code to exit an action
  7402. */
  7403. var ExitCode;
  7404. (function (ExitCode) {
  7405. /**
  7406. * A code indicating that the action was successful
  7407. */
  7408. ExitCode[ExitCode["Success"] = 0] = "Success";
  7409. /**
  7410. * A code indicating that the action was a failure
  7411. */
  7412. ExitCode[ExitCode["Failure"] = 1] = "Failure";
  7413. })(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
  7414. //-----------------------------------------------------------------------
  7415. // Variables
  7416. //-----------------------------------------------------------------------
  7417. /**
  7418. * Sets env variable for this action and future actions in the job
  7419. * @param name the name of the variable to set
  7420. * @param val the value of the variable
  7421. */
  7422. function exportVariable(name, val) {
  7423. process.env[name] = val;
  7424. command_1.issueCommand('set-env', { name }, val);
  7425. }
  7426. exports.exportVariable = exportVariable;
  7427. /**
  7428. * Registers a secret which will get masked from logs
  7429. * @param secret value of the secret
  7430. */
  7431. function setSecret(secret) {
  7432. command_1.issueCommand('add-mask', {}, secret);
  7433. }
  7434. exports.setSecret = setSecret;
  7435. /**
  7436. * Prepends inputPath to the PATH (for this action and future actions)
  7437. * @param inputPath
  7438. */
  7439. function addPath(inputPath) {
  7440. command_1.issueCommand('add-path', {}, inputPath);
  7441. process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
  7442. }
  7443. exports.addPath = addPath;
  7444. /**
  7445. * Gets the value of an input. The value is also trimmed.
  7446. *
  7447. * @param name name of the input to get
  7448. * @param options optional. See InputOptions.
  7449. * @returns string
  7450. */
  7451. function getInput(name, options) {
  7452. const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';
  7453. if (options && options.required && !val) {
  7454. throw new Error(`Input required and not supplied: ${name}`);
  7455. }
  7456. return val.trim();
  7457. }
  7458. exports.getInput = getInput;
  7459. /**
  7460. * Sets the value of an output.
  7461. *
  7462. * @param name name of the output to set
  7463. * @param value value to store
  7464. */
  7465. function setOutput(name, value) {
  7466. command_1.issueCommand('set-output', { name }, value);
  7467. }
  7468. exports.setOutput = setOutput;
  7469. //-----------------------------------------------------------------------
  7470. // Results
  7471. //-----------------------------------------------------------------------
  7472. /**
  7473. * Sets the action status to failed.
  7474. * When the action exits it will be with an exit code of 1
  7475. * @param message add error issue message
  7476. */
  7477. function setFailed(message) {
  7478. process.exitCode = ExitCode.Failure;
  7479. error(message);
  7480. }
  7481. exports.setFailed = setFailed;
  7482. //-----------------------------------------------------------------------
  7483. // Logging Commands
  7484. //-----------------------------------------------------------------------
  7485. /**
  7486. * Writes debug message to user log
  7487. * @param message debug message
  7488. */
  7489. function debug(message) {
  7490. command_1.issueCommand('debug', {}, message);
  7491. }
  7492. exports.debug = debug;
  7493. /**
  7494. * Adds an error issue
  7495. * @param message error issue message
  7496. */
  7497. function error(message) {
  7498. command_1.issue('error', message);
  7499. }
  7500. exports.error = error;
  7501. /**
  7502. * Adds an warning issue
  7503. * @param message warning issue message
  7504. */
  7505. function warning(message) {
  7506. command_1.issue('warning', message);
  7507. }
  7508. exports.warning = warning;
  7509. /**
  7510. * Writes info to log with console.log.
  7511. * @param message info message
  7512. */
  7513. function info(message) {
  7514. process.stdout.write(message + os.EOL);
  7515. }
  7516. exports.info = info;
  7517. /**
  7518. * Begin an output group.
  7519. *
  7520. * Output until the next `groupEnd` will be foldable in this group
  7521. *
  7522. * @param name The name of the output group
  7523. */
  7524. function startGroup(name) {
  7525. command_1.issue('group', name);
  7526. }
  7527. exports.startGroup = startGroup;
  7528. /**
  7529. * End an output group.
  7530. */
  7531. function endGroup() {
  7532. command_1.issue('endgroup');
  7533. }
  7534. exports.endGroup = endGroup;
  7535. /**
  7536. * Wrap an asynchronous function call in a group.
  7537. *
  7538. * Returns the same type as the function itself.
  7539. *
  7540. * @param name The name of the group
  7541. * @param fn The function to wrap in the group
  7542. */
  7543. function group(name, fn) {
  7544. return __awaiter(this, void 0, void 0, function* () {
  7545. startGroup(name);
  7546. let result;
  7547. try {
  7548. result = yield fn();
  7549. }
  7550. finally {
  7551. endGroup();
  7552. }
  7553. return result;
  7554. });
  7555. }
  7556. exports.group = group;
  7557. //# sourceMappingURL=core.js.map
  7558. /***/ }),
  7559. /***/ 471:
  7560. /***/ (function(module, __unusedexports, __webpack_require__) {
  7561. module.exports = authenticationBeforeRequest;
  7562. const btoa = __webpack_require__(675);
  7563. const uniq = __webpack_require__(126);
  7564. function authenticationBeforeRequest(state, options) {
  7565. if (!state.auth.type) {
  7566. return;
  7567. }
  7568. if (state.auth.type === "basic") {
  7569. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  7570. options.headers.authorization = `Basic ${hash}`;
  7571. return;
  7572. }
  7573. if (state.auth.type === "token") {
  7574. options.headers.authorization = `token ${state.auth.token}`;
  7575. return;
  7576. }
  7577. if (state.auth.type === "app") {
  7578. options.headers.authorization = `Bearer ${state.auth.token}`;
  7579. const acceptHeaders = options.headers.accept
  7580. .split(",")
  7581. .concat("application/vnd.github.machine-man-preview+json");
  7582. options.headers.accept = uniq(acceptHeaders)
  7583. .filter(Boolean)
  7584. .join(",");
  7585. return;
  7586. }
  7587. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  7588. if (state.auth.token) {
  7589. options.url += `access_token=${encodeURIComponent(state.auth.token)}`;
  7590. return;
  7591. }
  7592. const key = encodeURIComponent(state.auth.key);
  7593. const secret = encodeURIComponent(state.auth.secret);
  7594. options.url += `client_id=${key}&client_secret=${secret}`;
  7595. }
  7596. /***/ }),
  7597. /***/ 489:
  7598. /***/ (function(module, __unusedexports, __webpack_require__) {
  7599. "use strict";
  7600. const path = __webpack_require__(622);
  7601. const which = __webpack_require__(814);
  7602. const pathKey = __webpack_require__(39)();
  7603. function resolveCommandAttempt(parsed, withoutPathExt) {
  7604. const cwd = process.cwd();
  7605. const hasCustomCwd = parsed.options.cwd != null;
  7606. // If a custom `cwd` was specified, we need to change the process cwd
  7607. // because `which` will do stat calls but does not support a custom cwd
  7608. if (hasCustomCwd) {
  7609. try {
  7610. process.chdir(parsed.options.cwd);
  7611. } catch (err) {
  7612. /* Empty */
  7613. }
  7614. }
  7615. let resolved;
  7616. try {
  7617. resolved = which.sync(parsed.command, {
  7618. path: (parsed.options.env || process.env)[pathKey],
  7619. pathExt: withoutPathExt ? path.delimiter : undefined,
  7620. });
  7621. } catch (e) {
  7622. /* Empty */
  7623. } finally {
  7624. process.chdir(cwd);
  7625. }
  7626. // If we successfully resolved, ensure that an absolute path is returned
  7627. // Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it
  7628. if (resolved) {
  7629. resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved);
  7630. }
  7631. return resolved;
  7632. }
  7633. function resolveCommand(parsed) {
  7634. return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
  7635. }
  7636. module.exports = resolveCommand;
  7637. /***/ }),
  7638. /***/ 510:
  7639. /***/ (function(module) {
  7640. module.exports = addHook
  7641. function addHook (state, kind, name, hook) {
  7642. var orig = hook
  7643. if (!state.registry[name]) {
  7644. state.registry[name] = []
  7645. }
  7646. if (kind === 'before') {
  7647. hook = function (method, options) {
  7648. return Promise.resolve()
  7649. .then(orig.bind(null, options))
  7650. .then(method.bind(null, options))
  7651. }
  7652. }
  7653. if (kind === 'after') {
  7654. hook = function (method, options) {
  7655. var result
  7656. return Promise.resolve()
  7657. .then(method.bind(null, options))
  7658. .then(function (result_) {
  7659. result = result_
  7660. return orig(result, options)
  7661. })
  7662. .then(function () {
  7663. return result
  7664. })
  7665. }
  7666. }
  7667. if (kind === 'error') {
  7668. hook = function (method, options) {
  7669. return Promise.resolve()
  7670. .then(method.bind(null, options))
  7671. .catch(function (error) {
  7672. return orig(error, options)
  7673. })
  7674. }
  7675. }
  7676. state.registry[name].push({
  7677. hook: hook,
  7678. orig: orig
  7679. })
  7680. }
  7681. /***/ }),
  7682. /***/ 523:
  7683. /***/ (function(module, __unusedexports, __webpack_require__) {
  7684. var register = __webpack_require__(363)
  7685. var addHook = __webpack_require__(510)
  7686. var removeHook = __webpack_require__(763)
  7687. // bind with array of arguments: https://stackoverflow.com/a/21792913
  7688. var bind = Function.bind
  7689. var bindable = bind.bind(bind)
  7690. function bindApi (hook, state, name) {
  7691. var removeHookRef = bindable(removeHook, null).apply(null, name ? [state, name] : [state])
  7692. hook.api = { remove: removeHookRef }
  7693. hook.remove = removeHookRef
  7694. ;['before', 'error', 'after', 'wrap'].forEach(function (kind) {
  7695. var args = name ? [state, kind, name] : [state, kind]
  7696. hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args)
  7697. })
  7698. }
  7699. function HookSingular () {
  7700. var singularHookName = 'h'
  7701. var singularHookState = {
  7702. registry: {}
  7703. }
  7704. var singularHook = register.bind(null, singularHookState, singularHookName)
  7705. bindApi(singularHook, singularHookState, singularHookName)
  7706. return singularHook
  7707. }
  7708. function HookCollection () {
  7709. var state = {
  7710. registry: {}
  7711. }
  7712. var hook = register.bind(null, state)
  7713. bindApi(hook, state)
  7714. return hook
  7715. }
  7716. var collectionHookDeprecationMessageDisplayed = false
  7717. function Hook () {
  7718. if (!collectionHookDeprecationMessageDisplayed) {
  7719. console.warn('[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4')
  7720. collectionHookDeprecationMessageDisplayed = true
  7721. }
  7722. return HookCollection()
  7723. }
  7724. Hook.Singular = HookSingular.bind()
  7725. Hook.Collection = HookCollection.bind()
  7726. module.exports = Hook
  7727. // expose constructors as a named property for TypeScript
  7728. module.exports.Hook = Hook
  7729. module.exports.Singular = Hook.Singular
  7730. module.exports.Collection = Hook.Collection
  7731. /***/ }),
  7732. /***/ 529:
  7733. /***/ (function(module, __unusedexports, __webpack_require__) {
  7734. const factory = __webpack_require__(47);
  7735. module.exports = factory();
  7736. /***/ }),
  7737. /***/ 533:
  7738. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7739. "use strict";
  7740. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  7741. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  7742. return new (P || (P = Promise))(function (resolve, reject) {
  7743. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  7744. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  7745. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  7746. step((generator = generator.apply(thisArg, _arguments || [])).next());
  7747. });
  7748. };
  7749. Object.defineProperty(exports, "__esModule", { value: true });
  7750. const core = __webpack_require__(470);
  7751. const io = __webpack_require__(1);
  7752. const fs = __webpack_require__(747);
  7753. const os = __webpack_require__(87);
  7754. const path = __webpack_require__(622);
  7755. const httpm = __webpack_require__(874);
  7756. const semver = __webpack_require__(656);
  7757. const uuidV4 = __webpack_require__(826);
  7758. const exec_1 = __webpack_require__(986);
  7759. const assert_1 = __webpack_require__(357);
  7760. class HTTPError extends Error {
  7761. constructor(httpStatusCode) {
  7762. super(`Unexpected HTTP response: ${httpStatusCode}`);
  7763. this.httpStatusCode = httpStatusCode;
  7764. Object.setPrototypeOf(this, new.target.prototype);
  7765. }
  7766. }
  7767. exports.HTTPError = HTTPError;
  7768. const IS_WINDOWS = process.platform === 'win32';
  7769. const userAgent = 'actions/tool-cache';
  7770. // On load grab temp directory and cache directory and remove them from env (currently don't want to expose this)
  7771. let tempDirectory = process.env['RUNNER_TEMP'] || '';
  7772. let cacheRoot = process.env['RUNNER_TOOL_CACHE'] || '';
  7773. // If directories not found, place them in common temp locations
  7774. if (!tempDirectory || !cacheRoot) {
  7775. let baseLocation;
  7776. if (IS_WINDOWS) {
  7777. // On windows use the USERPROFILE env variable
  7778. baseLocation = process.env['USERPROFILE'] || 'C:\\';
  7779. }
  7780. else {
  7781. if (process.platform === 'darwin') {
  7782. baseLocation = '/Users';
  7783. }
  7784. else {
  7785. baseLocation = '/home';
  7786. }
  7787. }
  7788. if (!tempDirectory) {
  7789. tempDirectory = path.join(baseLocation, 'actions', 'temp');
  7790. }
  7791. if (!cacheRoot) {
  7792. cacheRoot = path.join(baseLocation, 'actions', 'cache');
  7793. }
  7794. }
  7795. /**
  7796. * Download a tool from an url and stream it into a file
  7797. *
  7798. * @param url url of tool to download
  7799. * @returns path to downloaded tool
  7800. */
  7801. function downloadTool(url) {
  7802. return __awaiter(this, void 0, void 0, function* () {
  7803. // Wrap in a promise so that we can resolve from within stream callbacks
  7804. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  7805. try {
  7806. const http = new httpm.HttpClient(userAgent, [], {
  7807. allowRetries: true,
  7808. maxRetries: 3
  7809. });
  7810. const destPath = path.join(tempDirectory, uuidV4());
  7811. yield io.mkdirP(tempDirectory);
  7812. core.debug(`Downloading ${url}`);
  7813. core.debug(`Downloading ${destPath}`);
  7814. if (fs.existsSync(destPath)) {
  7815. throw new Error(`Destination file path ${destPath} already exists`);
  7816. }
  7817. const response = yield http.get(url);
  7818. if (response.message.statusCode !== 200) {
  7819. const err = new HTTPError(response.message.statusCode);
  7820. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  7821. throw err;
  7822. }
  7823. const file = fs.createWriteStream(destPath);
  7824. file.on('open', () => __awaiter(this, void 0, void 0, function* () {
  7825. try {
  7826. const stream = response.message.pipe(file);
  7827. stream.on('close', () => {
  7828. core.debug('download complete');
  7829. resolve(destPath);
  7830. });
  7831. }
  7832. catch (err) {
  7833. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  7834. reject(err);
  7835. }
  7836. }));
  7837. file.on('error', err => {
  7838. file.end();
  7839. reject(err);
  7840. });
  7841. }
  7842. catch (err) {
  7843. reject(err);
  7844. }
  7845. }));
  7846. });
  7847. }
  7848. exports.downloadTool = downloadTool;
  7849. /**
  7850. * Extract a .7z file
  7851. *
  7852. * @param file path to the .7z file
  7853. * @param dest destination directory. Optional.
  7854. * @param _7zPath path to 7zr.exe. Optional, for long path support. Most .7z archives do not have this
  7855. * problem. If your .7z archive contains very long paths, you can pass the path to 7zr.exe which will
  7856. * gracefully handle long paths. By default 7zdec.exe is used because it is a very small program and is
  7857. * bundled with the tool lib. However it does not support long paths. 7zr.exe is the reduced command line
  7858. * interface, it is smaller than the full command line interface, and it does support long paths. At the
  7859. * time of this writing, it is freely available from the LZMA SDK that is available on the 7zip website.
  7860. * Be sure to check the current license agreement. If 7zr.exe is bundled with your action, then the path
  7861. * to 7zr.exe can be pass to this function.
  7862. * @returns path to the destination directory
  7863. */
  7864. function extract7z(file, dest, _7zPath) {
  7865. return __awaiter(this, void 0, void 0, function* () {
  7866. assert_1.ok(IS_WINDOWS, 'extract7z() not supported on current OS');
  7867. assert_1.ok(file, 'parameter "file" is required');
  7868. dest = dest || (yield _createExtractFolder(dest));
  7869. const originalCwd = process.cwd();
  7870. process.chdir(dest);
  7871. if (_7zPath) {
  7872. try {
  7873. const args = [
  7874. 'x',
  7875. '-bb1',
  7876. '-bd',
  7877. '-sccUTF-8',
  7878. file
  7879. ];
  7880. const options = {
  7881. silent: true
  7882. };
  7883. yield exec_1.exec(`"${_7zPath}"`, args, options);
  7884. }
  7885. finally {
  7886. process.chdir(originalCwd);
  7887. }
  7888. }
  7889. else {
  7890. const escapedScript = path
  7891. .join(__dirname, '..', 'scripts', 'Invoke-7zdec.ps1')
  7892. .replace(/'/g, "''")
  7893. .replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  7894. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  7895. const escapedTarget = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  7896. const command = `& '${escapedScript}' -Source '${escapedFile}' -Target '${escapedTarget}'`;
  7897. const args = [
  7898. '-NoLogo',
  7899. '-Sta',
  7900. '-NoProfile',
  7901. '-NonInteractive',
  7902. '-ExecutionPolicy',
  7903. 'Unrestricted',
  7904. '-Command',
  7905. command
  7906. ];
  7907. const options = {
  7908. silent: true
  7909. };
  7910. try {
  7911. const powershellPath = yield io.which('powershell', true);
  7912. yield exec_1.exec(`"${powershellPath}"`, args, options);
  7913. }
  7914. finally {
  7915. process.chdir(originalCwd);
  7916. }
  7917. }
  7918. return dest;
  7919. });
  7920. }
  7921. exports.extract7z = extract7z;
  7922. /**
  7923. * Extract a tar
  7924. *
  7925. * @param file path to the tar
  7926. * @param dest destination directory. Optional.
  7927. * @param flags flags for the tar. Optional.
  7928. * @returns path to the destination directory
  7929. */
  7930. function extractTar(file, dest, flags = 'xz') {
  7931. return __awaiter(this, void 0, void 0, function* () {
  7932. if (!file) {
  7933. throw new Error("parameter 'file' is required");
  7934. }
  7935. dest = dest || (yield _createExtractFolder(dest));
  7936. const tarPath = yield io.which('tar', true);
  7937. yield exec_1.exec(`"${tarPath}"`, [flags, '-C', dest, '-f', file]);
  7938. return dest;
  7939. });
  7940. }
  7941. exports.extractTar = extractTar;
  7942. /**
  7943. * Extract a zip
  7944. *
  7945. * @param file path to the zip
  7946. * @param dest destination directory. Optional.
  7947. * @returns path to the destination directory
  7948. */
  7949. function extractZip(file, dest) {
  7950. return __awaiter(this, void 0, void 0, function* () {
  7951. if (!file) {
  7952. throw new Error("parameter 'file' is required");
  7953. }
  7954. dest = dest || (yield _createExtractFolder(dest));
  7955. if (IS_WINDOWS) {
  7956. yield extractZipWin(file, dest);
  7957. }
  7958. else {
  7959. yield extractZipNix(file, dest);
  7960. }
  7961. return dest;
  7962. });
  7963. }
  7964. exports.extractZip = extractZip;
  7965. function extractZipWin(file, dest) {
  7966. return __awaiter(this, void 0, void 0, function* () {
  7967. // build the powershell command
  7968. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  7969. const escapedDest = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  7970. const command = `$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ; [System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}')`;
  7971. // run powershell
  7972. const powershellPath = yield io.which('powershell');
  7973. const args = [
  7974. '-NoLogo',
  7975. '-Sta',
  7976. '-NoProfile',
  7977. '-NonInteractive',
  7978. '-ExecutionPolicy',
  7979. 'Unrestricted',
  7980. '-Command',
  7981. command
  7982. ];
  7983. yield exec_1.exec(`"${powershellPath}"`, args);
  7984. });
  7985. }
  7986. function extractZipNix(file, dest) {
  7987. return __awaiter(this, void 0, void 0, function* () {
  7988. const unzipPath = yield io.which('unzip');
  7989. yield exec_1.exec(`"${unzipPath}"`, [file], { cwd: dest });
  7990. });
  7991. }
  7992. /**
  7993. * Caches a directory and installs it into the tool cacheDir
  7994. *
  7995. * @param sourceDir the directory to cache into tools
  7996. * @param tool tool name
  7997. * @param version version of the tool. semver format
  7998. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  7999. */
  8000. function cacheDir(sourceDir, tool, version, arch) {
  8001. return __awaiter(this, void 0, void 0, function* () {
  8002. version = semver.clean(version) || version;
  8003. arch = arch || os.arch();
  8004. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  8005. core.debug(`source dir: ${sourceDir}`);
  8006. if (!fs.statSync(sourceDir).isDirectory()) {
  8007. throw new Error('sourceDir is not a directory');
  8008. }
  8009. // Create the tool dir
  8010. const destPath = yield _createToolPath(tool, version, arch);
  8011. // copy each child item. do not move. move can fail on Windows
  8012. // due to anti-virus software having an open handle on a file.
  8013. for (const itemName of fs.readdirSync(sourceDir)) {
  8014. const s = path.join(sourceDir, itemName);
  8015. yield io.cp(s, destPath, { recursive: true });
  8016. }
  8017. // write .complete
  8018. _completeToolPath(tool, version, arch);
  8019. return destPath;
  8020. });
  8021. }
  8022. exports.cacheDir = cacheDir;
  8023. /**
  8024. * Caches a downloaded file (GUID) and installs it
  8025. * into the tool cache with a given targetName
  8026. *
  8027. * @param sourceFile the file to cache into tools. Typically a result of downloadTool which is a guid.
  8028. * @param targetFile the name of the file name in the tools directory
  8029. * @param tool tool name
  8030. * @param version version of the tool. semver format
  8031. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  8032. */
  8033. function cacheFile(sourceFile, targetFile, tool, version, arch) {
  8034. return __awaiter(this, void 0, void 0, function* () {
  8035. version = semver.clean(version) || version;
  8036. arch = arch || os.arch();
  8037. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  8038. core.debug(`source file: ${sourceFile}`);
  8039. if (!fs.statSync(sourceFile).isFile()) {
  8040. throw new Error('sourceFile is not a file');
  8041. }
  8042. // create the tool dir
  8043. const destFolder = yield _createToolPath(tool, version, arch);
  8044. // copy instead of move. move can fail on Windows due to
  8045. // anti-virus software having an open handle on a file.
  8046. const destPath = path.join(destFolder, targetFile);
  8047. core.debug(`destination file ${destPath}`);
  8048. yield io.cp(sourceFile, destPath);
  8049. // write .complete
  8050. _completeToolPath(tool, version, arch);
  8051. return destFolder;
  8052. });
  8053. }
  8054. exports.cacheFile = cacheFile;
  8055. /**
  8056. * Finds the path to a tool version in the local installed tool cache
  8057. *
  8058. * @param toolName name of the tool
  8059. * @param versionSpec version of the tool
  8060. * @param arch optional arch. defaults to arch of computer
  8061. */
  8062. function find(toolName, versionSpec, arch) {
  8063. if (!toolName) {
  8064. throw new Error('toolName parameter is required');
  8065. }
  8066. if (!versionSpec) {
  8067. throw new Error('versionSpec parameter is required');
  8068. }
  8069. arch = arch || os.arch();
  8070. // attempt to resolve an explicit version
  8071. if (!_isExplicitVersion(versionSpec)) {
  8072. const localVersions = findAllVersions(toolName, arch);
  8073. const match = _evaluateVersions(localVersions, versionSpec);
  8074. versionSpec = match;
  8075. }
  8076. // check for the explicit version in the cache
  8077. let toolPath = '';
  8078. if (versionSpec) {
  8079. versionSpec = semver.clean(versionSpec) || '';
  8080. const cachePath = path.join(cacheRoot, toolName, versionSpec, arch);
  8081. core.debug(`checking cache: ${cachePath}`);
  8082. if (fs.existsSync(cachePath) && fs.existsSync(`${cachePath}.complete`)) {
  8083. core.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`);
  8084. toolPath = cachePath;
  8085. }
  8086. else {
  8087. core.debug('not found');
  8088. }
  8089. }
  8090. return toolPath;
  8091. }
  8092. exports.find = find;
  8093. /**
  8094. * Finds the paths to all versions of a tool that are installed in the local tool cache
  8095. *
  8096. * @param toolName name of the tool
  8097. * @param arch optional arch. defaults to arch of computer
  8098. */
  8099. function findAllVersions(toolName, arch) {
  8100. const versions = [];
  8101. arch = arch || os.arch();
  8102. const toolPath = path.join(cacheRoot, toolName);
  8103. if (fs.existsSync(toolPath)) {
  8104. const children = fs.readdirSync(toolPath);
  8105. for (const child of children) {
  8106. if (_isExplicitVersion(child)) {
  8107. const fullPath = path.join(toolPath, child, arch || '');
  8108. if (fs.existsSync(fullPath) && fs.existsSync(`${fullPath}.complete`)) {
  8109. versions.push(child);
  8110. }
  8111. }
  8112. }
  8113. }
  8114. return versions;
  8115. }
  8116. exports.findAllVersions = findAllVersions;
  8117. function _createExtractFolder(dest) {
  8118. return __awaiter(this, void 0, void 0, function* () {
  8119. if (!dest) {
  8120. // create a temp dir
  8121. dest = path.join(tempDirectory, uuidV4());
  8122. }
  8123. yield io.mkdirP(dest);
  8124. return dest;
  8125. });
  8126. }
  8127. function _createToolPath(tool, version, arch) {
  8128. return __awaiter(this, void 0, void 0, function* () {
  8129. const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
  8130. core.debug(`destination ${folderPath}`);
  8131. const markerPath = `${folderPath}.complete`;
  8132. yield io.rmRF(folderPath);
  8133. yield io.rmRF(markerPath);
  8134. yield io.mkdirP(folderPath);
  8135. return folderPath;
  8136. });
  8137. }
  8138. function _completeToolPath(tool, version, arch) {
  8139. const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
  8140. const markerPath = `${folderPath}.complete`;
  8141. fs.writeFileSync(markerPath, '');
  8142. core.debug('finished caching tool');
  8143. }
  8144. function _isExplicitVersion(versionSpec) {
  8145. const c = semver.clean(versionSpec) || '';
  8146. core.debug(`isExplicit: ${c}`);
  8147. const valid = semver.valid(c) != null;
  8148. core.debug(`explicit? ${valid}`);
  8149. return valid;
  8150. }
  8151. function _evaluateVersions(versions, versionSpec) {
  8152. let version = '';
  8153. core.debug(`evaluating ${versions.length} versions`);
  8154. versions = versions.sort((a, b) => {
  8155. if (semver.gt(a, b)) {
  8156. return 1;
  8157. }
  8158. return -1;
  8159. });
  8160. for (let i = versions.length - 1; i >= 0; i--) {
  8161. const potential = versions[i];
  8162. const satisfied = semver.satisfies(potential, versionSpec);
  8163. if (satisfied) {
  8164. version = potential;
  8165. break;
  8166. }
  8167. }
  8168. if (version) {
  8169. core.debug(`matched: ${version}`);
  8170. }
  8171. else {
  8172. core.debug('match not found');
  8173. }
  8174. return version;
  8175. }
  8176. //# sourceMappingURL=tool-cache.js.map
  8177. /***/ }),
  8178. /***/ 536:
  8179. /***/ (function(module, __unusedexports, __webpack_require__) {
  8180. module.exports = hasFirstPage
  8181. const deprecate = __webpack_require__(370)
  8182. const getPageLinks = __webpack_require__(577)
  8183. function hasFirstPage (link) {
  8184. deprecate(`octokit.hasFirstPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  8185. return getPageLinks(link).first
  8186. }
  8187. /***/ }),
  8188. /***/ 550:
  8189. /***/ (function(module, __unusedexports, __webpack_require__) {
  8190. module.exports = getNextPage
  8191. const getPage = __webpack_require__(265)
  8192. function getNextPage (octokit, link, headers) {
  8193. return getPage(octokit, link, 'next', headers)
  8194. }
  8195. /***/ }),
  8196. /***/ 558:
  8197. /***/ (function(module, __unusedexports, __webpack_require__) {
  8198. module.exports = hasPreviousPage
  8199. const deprecate = __webpack_require__(370)
  8200. const getPageLinks = __webpack_require__(577)
  8201. function hasPreviousPage (link) {
  8202. deprecate(`octokit.hasPreviousPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  8203. return getPageLinks(link).prev
  8204. }
  8205. /***/ }),
  8206. /***/ 559:
  8207. /***/ (function(__unusedmodule, exports) {
  8208. "use strict";
  8209. Object.defineProperty(exports, "__esModule", { value: true });
  8210. class GitVersion {
  8211. /**
  8212. * Used for comparing the version of git and git-lfs against the minimum required version
  8213. * @param version the version string, e.g. 1.2 or 1.2.3
  8214. */
  8215. constructor(version) {
  8216. this.major = NaN;
  8217. this.minor = NaN;
  8218. this.patch = NaN;
  8219. if (version) {
  8220. const match = version.match(/^(\d+)\.(\d+)(\.(\d+))?$/);
  8221. if (match) {
  8222. this.major = Number(match[1]);
  8223. this.minor = Number(match[2]);
  8224. if (match[4]) {
  8225. this.patch = Number(match[4]);
  8226. }
  8227. }
  8228. }
  8229. }
  8230. /**
  8231. * Compares the instance against a minimum required version
  8232. * @param minimum Minimum version
  8233. */
  8234. checkMinimum(minimum) {
  8235. if (!minimum.isValid()) {
  8236. throw new Error('Arg minimum is not a valid version');
  8237. }
  8238. // Major is insufficient
  8239. if (this.major < minimum.major) {
  8240. return false;
  8241. }
  8242. // Major is equal
  8243. if (this.major === minimum.major) {
  8244. // Minor is insufficient
  8245. if (this.minor < minimum.minor) {
  8246. return false;
  8247. }
  8248. // Minor is equal
  8249. if (this.minor === minimum.minor) {
  8250. // Patch is insufficient
  8251. if (this.patch && this.patch < (minimum.patch || 0)) {
  8252. return false;
  8253. }
  8254. }
  8255. }
  8256. return true;
  8257. }
  8258. /**
  8259. * Indicates whether the instance was constructed from a valid version string
  8260. */
  8261. isValid() {
  8262. return !isNaN(this.major);
  8263. }
  8264. /**
  8265. * Returns the version as a string, e.g. 1.2 or 1.2.3
  8266. */
  8267. toString() {
  8268. let result = '';
  8269. if (this.isValid()) {
  8270. result = `${this.major}.${this.minor}`;
  8271. if (!isNaN(this.patch)) {
  8272. result += `.${this.patch}`;
  8273. }
  8274. }
  8275. return result;
  8276. }
  8277. }
  8278. exports.GitVersion = GitVersion;
  8279. /***/ }),
  8280. /***/ 562:
  8281. /***/ (function(module, __unusedexports, __webpack_require__) {
  8282. var once = __webpack_require__(969);
  8283. var noop = function() {};
  8284. var isRequest = function(stream) {
  8285. return stream.setHeader && typeof stream.abort === 'function';
  8286. };
  8287. var isChildProcess = function(stream) {
  8288. return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3
  8289. };
  8290. var eos = function(stream, opts, callback) {
  8291. if (typeof opts === 'function') return eos(stream, null, opts);
  8292. if (!opts) opts = {};
  8293. callback = once(callback || noop);
  8294. var ws = stream._writableState;
  8295. var rs = stream._readableState;
  8296. var readable = opts.readable || (opts.readable !== false && stream.readable);
  8297. var writable = opts.writable || (opts.writable !== false && stream.writable);
  8298. var cancelled = false;
  8299. var onlegacyfinish = function() {
  8300. if (!stream.writable) onfinish();
  8301. };
  8302. var onfinish = function() {
  8303. writable = false;
  8304. if (!readable) callback.call(stream);
  8305. };
  8306. var onend = function() {
  8307. readable = false;
  8308. if (!writable) callback.call(stream);
  8309. };
  8310. var onexit = function(exitCode) {
  8311. callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null);
  8312. };
  8313. var onerror = function(err) {
  8314. callback.call(stream, err);
  8315. };
  8316. var onclose = function() {
  8317. process.nextTick(onclosenexttick);
  8318. };
  8319. var onclosenexttick = function() {
  8320. if (cancelled) return;
  8321. if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error('premature close'));
  8322. if (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error('premature close'));
  8323. };
  8324. var onrequest = function() {
  8325. stream.req.on('finish', onfinish);
  8326. };
  8327. if (isRequest(stream)) {
  8328. stream.on('complete', onfinish);
  8329. stream.on('abort', onclose);
  8330. if (stream.req) onrequest();
  8331. else stream.on('request', onrequest);
  8332. } else if (writable && !ws) { // legacy streams
  8333. stream.on('end', onlegacyfinish);
  8334. stream.on('close', onlegacyfinish);
  8335. }
  8336. if (isChildProcess(stream)) stream.on('exit', onexit);
  8337. stream.on('end', onend);
  8338. stream.on('finish', onfinish);
  8339. if (opts.error !== false) stream.on('error', onerror);
  8340. stream.on('close', onclose);
  8341. return function() {
  8342. cancelled = true;
  8343. stream.removeListener('complete', onfinish);
  8344. stream.removeListener('abort', onclose);
  8345. stream.removeListener('request', onrequest);
  8346. if (stream.req) stream.req.removeListener('finish', onfinish);
  8347. stream.removeListener('end', onlegacyfinish);
  8348. stream.removeListener('close', onlegacyfinish);
  8349. stream.removeListener('finish', onfinish);
  8350. stream.removeListener('exit', onexit);
  8351. stream.removeListener('end', onend);
  8352. stream.removeListener('error', onerror);
  8353. stream.removeListener('close', onclose);
  8354. };
  8355. };
  8356. module.exports = eos;
  8357. /***/ }),
  8358. /***/ 563:
  8359. /***/ (function(module, __unusedexports, __webpack_require__) {
  8360. module.exports = getPreviousPage
  8361. const getPage = __webpack_require__(265)
  8362. function getPreviousPage (octokit, link, headers) {
  8363. return getPage(octokit, link, 'prev', headers)
  8364. }
  8365. /***/ }),
  8366. /***/ 568:
  8367. /***/ (function(module, __unusedexports, __webpack_require__) {
  8368. "use strict";
  8369. const path = __webpack_require__(622);
  8370. const niceTry = __webpack_require__(948);
  8371. const resolveCommand = __webpack_require__(489);
  8372. const escape = __webpack_require__(462);
  8373. const readShebang = __webpack_require__(389);
  8374. const semver = __webpack_require__(280);
  8375. const isWin = process.platform === 'win32';
  8376. const isExecutableRegExp = /\.(?:com|exe)$/i;
  8377. const isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
  8378. // `options.shell` is supported in Node ^4.8.0, ^5.7.0 and >= 6.0.0
  8379. const supportsShellOption = niceTry(() => semver.satisfies(process.version, '^4.8.0 || ^5.7.0 || >= 6.0.0', true)) || false;
  8380. function detectShebang(parsed) {
  8381. parsed.file = resolveCommand(parsed);
  8382. const shebang = parsed.file && readShebang(parsed.file);
  8383. if (shebang) {
  8384. parsed.args.unshift(parsed.file);
  8385. parsed.command = shebang;
  8386. return resolveCommand(parsed);
  8387. }
  8388. return parsed.file;
  8389. }
  8390. function parseNonShell(parsed) {
  8391. if (!isWin) {
  8392. return parsed;
  8393. }
  8394. // Detect & add support for shebangs
  8395. const commandFile = detectShebang(parsed);
  8396. // We don't need a shell if the command filename is an executable
  8397. const needsShell = !isExecutableRegExp.test(commandFile);
  8398. // If a shell is required, use cmd.exe and take care of escaping everything correctly
  8399. // Note that `forceShell` is an hidden option used only in tests
  8400. if (parsed.options.forceShell || needsShell) {
  8401. // Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/`
  8402. // The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument
  8403. // Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called,
  8404. // we need to double escape them
  8405. const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
  8406. // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\bar)
  8407. // This is necessary otherwise it will always fail with ENOENT in those cases
  8408. parsed.command = path.normalize(parsed.command);
  8409. // Escape command & arguments
  8410. parsed.command = escape.command(parsed.command);
  8411. parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
  8412. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  8413. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  8414. parsed.command = process.env.comspec || 'cmd.exe';
  8415. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  8416. }
  8417. return parsed;
  8418. }
  8419. function parseShell(parsed) {
  8420. // If node supports the shell option, there's no need to mimic its behavior
  8421. if (supportsShellOption) {
  8422. return parsed;
  8423. }
  8424. // Mimic node shell option
  8425. // See https://github.com/nodejs/node/blob/b9f6a2dc059a1062776133f3d4fd848c4da7d150/lib/child_process.js#L335
  8426. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  8427. if (isWin) {
  8428. parsed.command = typeof parsed.options.shell === 'string' ? parsed.options.shell : process.env.comspec || 'cmd.exe';
  8429. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  8430. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  8431. } else {
  8432. if (typeof parsed.options.shell === 'string') {
  8433. parsed.command = parsed.options.shell;
  8434. } else if (process.platform === 'android') {
  8435. parsed.command = '/system/bin/sh';
  8436. } else {
  8437. parsed.command = '/bin/sh';
  8438. }
  8439. parsed.args = ['-c', shellCommand];
  8440. }
  8441. return parsed;
  8442. }
  8443. function parse(command, args, options) {
  8444. // Normalize arguments, similar to nodejs
  8445. if (args && !Array.isArray(args)) {
  8446. options = args;
  8447. args = null;
  8448. }
  8449. args = args ? args.slice(0) : []; // Clone array to avoid changing the original
  8450. options = Object.assign({}, options); // Clone object to avoid changing the original
  8451. // Build our parsed object
  8452. const parsed = {
  8453. command,
  8454. args,
  8455. options,
  8456. file: undefined,
  8457. original: {
  8458. command,
  8459. args,
  8460. },
  8461. };
  8462. // Delegate further parsing to shell or non-shell
  8463. return options.shell ? parseShell(parsed) : parseNonShell(parsed);
  8464. }
  8465. module.exports = parse;
  8466. /***/ }),
  8467. /***/ 577:
  8468. /***/ (function(module) {
  8469. module.exports = getPageLinks
  8470. function getPageLinks (link) {
  8471. link = link.link || link.headers.link || ''
  8472. const links = {}
  8473. // link format:
  8474. // '<https://api.github.com/users/aseemk/followers?page=2>; rel="next", <https://api.github.com/users/aseemk/followers?page=2>; rel="last"'
  8475. link.replace(/<([^>]*)>;\s*rel="([\w]*)"/g, (m, uri, type) => {
  8476. links[type] = uri
  8477. })
  8478. return links
  8479. }
  8480. /***/ }),
  8481. /***/ 586:
  8482. /***/ (function(module, __unusedexports, __webpack_require__) {
  8483. module.exports = octokitRestApiEndpoints;
  8484. const ROUTES = __webpack_require__(705);
  8485. function octokitRestApiEndpoints(octokit) {
  8486. // Aliasing scopes for backward compatibility
  8487. // See https://github.com/octokit/rest.js/pull/1134
  8488. ROUTES.gitdata = ROUTES.git;
  8489. ROUTES.authorization = ROUTES.oauthAuthorizations;
  8490. ROUTES.pullRequests = ROUTES.pulls;
  8491. octokit.registerEndpoints(ROUTES);
  8492. }
  8493. /***/ }),
  8494. /***/ 587:
  8495. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8496. "use strict";
  8497. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  8498. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  8499. return new (P || (P = Promise))(function (resolve, reject) {
  8500. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  8501. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  8502. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  8503. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8504. });
  8505. };
  8506. var __importStar = (this && this.__importStar) || function (mod) {
  8507. if (mod && mod.__esModule) return mod;
  8508. var result = {};
  8509. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  8510. result["default"] = mod;
  8511. return result;
  8512. };
  8513. Object.defineProperty(exports, "__esModule", { value: true });
  8514. const core = __importStar(__webpack_require__(470));
  8515. const maxAttempts = 3;
  8516. const minSeconds = 10;
  8517. const maxSeconds = 20;
  8518. function execute(action) {
  8519. return __awaiter(this, void 0, void 0, function* () {
  8520. let attempt = 1;
  8521. while (attempt < maxAttempts) {
  8522. // Try
  8523. try {
  8524. return yield action();
  8525. }
  8526. catch (err) {
  8527. core.info(err.message);
  8528. }
  8529. // Sleep
  8530. const seconds = getRandomIntInclusive(minSeconds, maxSeconds);
  8531. core.info(`Waiting ${seconds} before trying again`);
  8532. yield sleep(seconds * 1000);
  8533. attempt++;
  8534. }
  8535. // Last attempt
  8536. return yield action();
  8537. });
  8538. }
  8539. exports.execute = execute;
  8540. function getRandomIntInclusive(minimum, maximum) {
  8541. minimum = Math.floor(minimum);
  8542. maximum = Math.floor(maximum);
  8543. return Math.floor(Math.random() * (maximum - minimum + 1)) + minimum;
  8544. }
  8545. function sleep(milliseconds) {
  8546. return __awaiter(this, void 0, void 0, function* () {
  8547. return new Promise(resolve => setTimeout(resolve, milliseconds));
  8548. });
  8549. }
  8550. /***/ }),
  8551. /***/ 605:
  8552. /***/ (function(module) {
  8553. module.exports = require("http");
  8554. /***/ }),
  8555. /***/ 614:
  8556. /***/ (function(module) {
  8557. module.exports = require("events");
  8558. /***/ }),
  8559. /***/ 618:
  8560. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8561. "use strict";
  8562. var __importStar = (this && this.__importStar) || function (mod) {
  8563. if (mod && mod.__esModule) return mod;
  8564. var result = {};
  8565. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  8566. result["default"] = mod;
  8567. return result;
  8568. };
  8569. Object.defineProperty(exports, "__esModule", { value: true });
  8570. const fs = __importStar(__webpack_require__(747));
  8571. function directoryExistsSync(path, required) {
  8572. if (!path) {
  8573. throw new Error("Arg 'path' must not be empty");
  8574. }
  8575. let stats;
  8576. try {
  8577. stats = fs.statSync(path);
  8578. }
  8579. catch (error) {
  8580. if (error.code === 'ENOENT') {
  8581. if (!required) {
  8582. return false;
  8583. }
  8584. throw new Error(`Directory '${path}' does not exist`);
  8585. }
  8586. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  8587. }
  8588. if (stats.isDirectory()) {
  8589. return true;
  8590. }
  8591. else if (!required) {
  8592. return false;
  8593. }
  8594. throw new Error(`Directory '${path}' does not exist`);
  8595. }
  8596. exports.directoryExistsSync = directoryExistsSync;
  8597. function existsSync(path) {
  8598. if (!path) {
  8599. throw new Error("Arg 'path' must not be empty");
  8600. }
  8601. try {
  8602. fs.statSync(path);
  8603. }
  8604. catch (error) {
  8605. if (error.code === 'ENOENT') {
  8606. return false;
  8607. }
  8608. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  8609. }
  8610. return true;
  8611. }
  8612. exports.existsSync = existsSync;
  8613. function fileExistsSync(path) {
  8614. if (!path) {
  8615. throw new Error("Arg 'path' must not be empty");
  8616. }
  8617. let stats;
  8618. try {
  8619. stats = fs.statSync(path);
  8620. }
  8621. catch (error) {
  8622. if (error.code === 'ENOENT') {
  8623. return false;
  8624. }
  8625. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  8626. }
  8627. if (!stats.isDirectory()) {
  8628. return true;
  8629. }
  8630. return false;
  8631. }
  8632. exports.fileExistsSync = fileExistsSync;
  8633. /***/ }),
  8634. /***/ 621:
  8635. /***/ (function(module, __unusedexports, __webpack_require__) {
  8636. "use strict";
  8637. const path = __webpack_require__(622);
  8638. const pathKey = __webpack_require__(39);
  8639. module.exports = opts => {
  8640. opts = Object.assign({
  8641. cwd: process.cwd(),
  8642. path: process.env[pathKey()]
  8643. }, opts);
  8644. let prev;
  8645. let pth = path.resolve(opts.cwd);
  8646. const ret = [];
  8647. while (prev !== pth) {
  8648. ret.push(path.join(pth, 'node_modules/.bin'));
  8649. prev = pth;
  8650. pth = path.resolve(pth, '..');
  8651. }
  8652. // ensure the running `node` binary is used
  8653. ret.push(path.dirname(process.execPath));
  8654. return ret.concat(opts.path).join(path.delimiter);
  8655. };
  8656. module.exports.env = opts => {
  8657. opts = Object.assign({
  8658. env: process.env
  8659. }, opts);
  8660. const env = Object.assign({}, opts.env);
  8661. const path = pathKey({env});
  8662. opts.path = env[path];
  8663. env[path] = module.exports(opts);
  8664. return env;
  8665. };
  8666. /***/ }),
  8667. /***/ 622:
  8668. /***/ (function(module) {
  8669. module.exports = require("path");
  8670. /***/ }),
  8671. /***/ 631:
  8672. /***/ (function(module) {
  8673. module.exports = require("net");
  8674. /***/ }),
  8675. /***/ 649:
  8676. /***/ (function(module, __unusedexports, __webpack_require__) {
  8677. module.exports = getLastPage
  8678. const getPage = __webpack_require__(265)
  8679. function getLastPage (octokit, link, headers) {
  8680. return getPage(octokit, link, 'last', headers)
  8681. }
  8682. /***/ }),
  8683. /***/ 654:
  8684. /***/ (function(module) {
  8685. // This is not the set of all possible signals.
  8686. //
  8687. // It IS, however, the set of all signals that trigger
  8688. // an exit on either Linux or BSD systems. Linux is a
  8689. // superset of the signal names supported on BSD, and
  8690. // the unknown signals just fail to register, so we can
  8691. // catch that easily enough.
  8692. //
  8693. // Don't bother with SIGKILL. It's uncatchable, which
  8694. // means that we can't fire any callbacks anyway.
  8695. //
  8696. // If a user does happen to register a handler on a non-
  8697. // fatal signal like SIGWINCH or something, and then
  8698. // exit, it'll end up firing `process.emit('exit')`, so
  8699. // the handler will be fired anyway.
  8700. //
  8701. // SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised
  8702. // artificially, inherently leave the process in a
  8703. // state from which it is not safe to try and enter JS
  8704. // listeners.
  8705. module.exports = [
  8706. 'SIGABRT',
  8707. 'SIGALRM',
  8708. 'SIGHUP',
  8709. 'SIGINT',
  8710. 'SIGTERM'
  8711. ]
  8712. if (process.platform !== 'win32') {
  8713. module.exports.push(
  8714. 'SIGVTALRM',
  8715. 'SIGXCPU',
  8716. 'SIGXFSZ',
  8717. 'SIGUSR2',
  8718. 'SIGTRAP',
  8719. 'SIGSYS',
  8720. 'SIGQUIT',
  8721. 'SIGIOT'
  8722. // should detect profiler and enable/disable accordingly.
  8723. // see #21
  8724. // 'SIGPROF'
  8725. )
  8726. }
  8727. if (process.platform === 'linux') {
  8728. module.exports.push(
  8729. 'SIGIO',
  8730. 'SIGPOLL',
  8731. 'SIGPWR',
  8732. 'SIGSTKFLT',
  8733. 'SIGUNUSED'
  8734. )
  8735. }
  8736. /***/ }),
  8737. /***/ 656:
  8738. /***/ (function(module, exports) {
  8739. exports = module.exports = SemVer
  8740. var debug
  8741. /* istanbul ignore next */
  8742. if (typeof process === 'object' &&
  8743. process.env &&
  8744. process.env.NODE_DEBUG &&
  8745. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  8746. debug = function () {
  8747. var args = Array.prototype.slice.call(arguments, 0)
  8748. args.unshift('SEMVER')
  8749. console.log.apply(console, args)
  8750. }
  8751. } else {
  8752. debug = function () {}
  8753. }
  8754. // Note: this is the semver.org version of the spec that it implements
  8755. // Not necessarily the package version of this code.
  8756. exports.SEMVER_SPEC_VERSION = '2.0.0'
  8757. var MAX_LENGTH = 256
  8758. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  8759. /* istanbul ignore next */ 9007199254740991
  8760. // Max safe segment length for coercion.
  8761. var MAX_SAFE_COMPONENT_LENGTH = 16
  8762. // The actual regexps go on exports.re
  8763. var re = exports.re = []
  8764. var src = exports.src = []
  8765. var t = exports.tokens = {}
  8766. var R = 0
  8767. function tok (n) {
  8768. t[n] = R++
  8769. }
  8770. // The following Regular Expressions can be used for tokenizing,
  8771. // validating, and parsing SemVer version strings.
  8772. // ## Numeric Identifier
  8773. // A single `0`, or a non-zero digit followed by zero or more digits.
  8774. tok('NUMERICIDENTIFIER')
  8775. src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  8776. tok('NUMERICIDENTIFIERLOOSE')
  8777. src[t.NUMERICIDENTIFIERLOOSE] = '[0-9]+'
  8778. // ## Non-numeric Identifier
  8779. // Zero or more digits, followed by a letter or hyphen, and then zero or
  8780. // more letters, digits, or hyphens.
  8781. tok('NONNUMERICIDENTIFIER')
  8782. src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
  8783. // ## Main Version
  8784. // Three dot-separated numeric identifiers.
  8785. tok('MAINVERSION')
  8786. src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  8787. '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  8788. '(' + src[t.NUMERICIDENTIFIER] + ')'
  8789. tok('MAINVERSIONLOOSE')
  8790. src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  8791. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  8792. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')'
  8793. // ## Pre-release Version Identifier
  8794. // A numeric identifier, or a non-numeric identifier.
  8795. tok('PRERELEASEIDENTIFIER')
  8796. src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] +
  8797. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  8798. tok('PRERELEASEIDENTIFIERLOOSE')
  8799. src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] +
  8800. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  8801. // ## Pre-release Version
  8802. // Hyphen, followed by one or more dot-separated pre-release version
  8803. // identifiers.
  8804. tok('PRERELEASE')
  8805. src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] +
  8806. '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))'
  8807. tok('PRERELEASELOOSE')
  8808. src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] +
  8809. '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))'
  8810. // ## Build Metadata Identifier
  8811. // Any combination of digits, letters, or hyphens.
  8812. tok('BUILDIDENTIFIER')
  8813. src[t.BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
  8814. // ## Build Metadata
  8815. // Plus sign, followed by one or more period-separated build metadata
  8816. // identifiers.
  8817. tok('BUILD')
  8818. src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] +
  8819. '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))'
  8820. // ## Full Version String
  8821. // A main version, followed optionally by a pre-release version and
  8822. // build metadata.
  8823. // Note that the only major, minor, patch, and pre-release sections of
  8824. // the version string are capturing groups. The build metadata is not a
  8825. // capturing group, because it should not ever be used in version
  8826. // comparison.
  8827. tok('FULL')
  8828. tok('FULLPLAIN')
  8829. src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] +
  8830. src[t.PRERELEASE] + '?' +
  8831. src[t.BUILD] + '?'
  8832. src[t.FULL] = '^' + src[t.FULLPLAIN] + '$'
  8833. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  8834. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  8835. // common in the npm registry.
  8836. tok('LOOSEPLAIN')
  8837. src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] +
  8838. src[t.PRERELEASELOOSE] + '?' +
  8839. src[t.BUILD] + '?'
  8840. tok('LOOSE')
  8841. src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$'
  8842. tok('GTLT')
  8843. src[t.GTLT] = '((?:<|>)?=?)'
  8844. // Something like "2.*" or "1.2.x".
  8845. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  8846. // Only the first item is strictly required.
  8847. tok('XRANGEIDENTIFIERLOOSE')
  8848. src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  8849. tok('XRANGEIDENTIFIER')
  8850. src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*'
  8851. tok('XRANGEPLAIN')
  8852. src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' +
  8853. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  8854. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  8855. '(?:' + src[t.PRERELEASE] + ')?' +
  8856. src[t.BUILD] + '?' +
  8857. ')?)?'
  8858. tok('XRANGEPLAINLOOSE')
  8859. src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  8860. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  8861. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  8862. '(?:' + src[t.PRERELEASELOOSE] + ')?' +
  8863. src[t.BUILD] + '?' +
  8864. ')?)?'
  8865. tok('XRANGE')
  8866. src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$'
  8867. tok('XRANGELOOSE')
  8868. src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$'
  8869. // Coercion.
  8870. // Extract anything that could conceivably be a part of a valid semver
  8871. tok('COERCE')
  8872. src[t.COERCE] = '(^|[^\\d])' +
  8873. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  8874. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  8875. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  8876. '(?:$|[^\\d])'
  8877. tok('COERCERTL')
  8878. re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g')
  8879. // Tilde ranges.
  8880. // Meaning is "reasonably at or greater than"
  8881. tok('LONETILDE')
  8882. src[t.LONETILDE] = '(?:~>?)'
  8883. tok('TILDETRIM')
  8884. src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+'
  8885. re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g')
  8886. var tildeTrimReplace = '$1~'
  8887. tok('TILDE')
  8888. src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$'
  8889. tok('TILDELOOSE')
  8890. src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$'
  8891. // Caret ranges.
  8892. // Meaning is "at least and backwards compatible with"
  8893. tok('LONECARET')
  8894. src[t.LONECARET] = '(?:\\^)'
  8895. tok('CARETTRIM')
  8896. src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+'
  8897. re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g')
  8898. var caretTrimReplace = '$1^'
  8899. tok('CARET')
  8900. src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$'
  8901. tok('CARETLOOSE')
  8902. src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$'
  8903. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  8904. tok('COMPARATORLOOSE')
  8905. src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$'
  8906. tok('COMPARATOR')
  8907. src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$'
  8908. // An expression to strip any whitespace between the gtlt and the thing
  8909. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  8910. tok('COMPARATORTRIM')
  8911. src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] +
  8912. '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')'
  8913. // this one has to use the /g flag
  8914. re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g')
  8915. var comparatorTrimReplace = '$1$2$3'
  8916. // Something like `1.2.3 - 1.2.4`
  8917. // Note that these all use the loose form, because they'll be
  8918. // checked against either the strict or loose comparator form
  8919. // later.
  8920. tok('HYPHENRANGE')
  8921. src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' +
  8922. '\\s+-\\s+' +
  8923. '(' + src[t.XRANGEPLAIN] + ')' +
  8924. '\\s*$'
  8925. tok('HYPHENRANGELOOSE')
  8926. src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' +
  8927. '\\s+-\\s+' +
  8928. '(' + src[t.XRANGEPLAINLOOSE] + ')' +
  8929. '\\s*$'
  8930. // Star ranges basically just allow anything at all.
  8931. tok('STAR')
  8932. src[t.STAR] = '(<|>)?=?\\s*\\*'
  8933. // Compile to actual regexp objects.
  8934. // All are flag-free, unless they were created above with a flag.
  8935. for (var i = 0; i < R; i++) {
  8936. debug(i, src[i])
  8937. if (!re[i]) {
  8938. re[i] = new RegExp(src[i])
  8939. }
  8940. }
  8941. exports.parse = parse
  8942. function parse (version, options) {
  8943. if (!options || typeof options !== 'object') {
  8944. options = {
  8945. loose: !!options,
  8946. includePrerelease: false
  8947. }
  8948. }
  8949. if (version instanceof SemVer) {
  8950. return version
  8951. }
  8952. if (typeof version !== 'string') {
  8953. return null
  8954. }
  8955. if (version.length > MAX_LENGTH) {
  8956. return null
  8957. }
  8958. var r = options.loose ? re[t.LOOSE] : re[t.FULL]
  8959. if (!r.test(version)) {
  8960. return null
  8961. }
  8962. try {
  8963. return new SemVer(version, options)
  8964. } catch (er) {
  8965. return null
  8966. }
  8967. }
  8968. exports.valid = valid
  8969. function valid (version, options) {
  8970. var v = parse(version, options)
  8971. return v ? v.version : null
  8972. }
  8973. exports.clean = clean
  8974. function clean (version, options) {
  8975. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  8976. return s ? s.version : null
  8977. }
  8978. exports.SemVer = SemVer
  8979. function SemVer (version, options) {
  8980. if (!options || typeof options !== 'object') {
  8981. options = {
  8982. loose: !!options,
  8983. includePrerelease: false
  8984. }
  8985. }
  8986. if (version instanceof SemVer) {
  8987. if (version.loose === options.loose) {
  8988. return version
  8989. } else {
  8990. version = version.version
  8991. }
  8992. } else if (typeof version !== 'string') {
  8993. throw new TypeError('Invalid Version: ' + version)
  8994. }
  8995. if (version.length > MAX_LENGTH) {
  8996. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  8997. }
  8998. if (!(this instanceof SemVer)) {
  8999. return new SemVer(version, options)
  9000. }
  9001. debug('SemVer', version, options)
  9002. this.options = options
  9003. this.loose = !!options.loose
  9004. var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])
  9005. if (!m) {
  9006. throw new TypeError('Invalid Version: ' + version)
  9007. }
  9008. this.raw = version
  9009. // these are actually numbers
  9010. this.major = +m[1]
  9011. this.minor = +m[2]
  9012. this.patch = +m[3]
  9013. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  9014. throw new TypeError('Invalid major version')
  9015. }
  9016. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  9017. throw new TypeError('Invalid minor version')
  9018. }
  9019. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  9020. throw new TypeError('Invalid patch version')
  9021. }
  9022. // numberify any prerelease numeric ids
  9023. if (!m[4]) {
  9024. this.prerelease = []
  9025. } else {
  9026. this.prerelease = m[4].split('.').map(function (id) {
  9027. if (/^[0-9]+$/.test(id)) {
  9028. var num = +id
  9029. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  9030. return num
  9031. }
  9032. }
  9033. return id
  9034. })
  9035. }
  9036. this.build = m[5] ? m[5].split('.') : []
  9037. this.format()
  9038. }
  9039. SemVer.prototype.format = function () {
  9040. this.version = this.major + '.' + this.minor + '.' + this.patch
  9041. if (this.prerelease.length) {
  9042. this.version += '-' + this.prerelease.join('.')
  9043. }
  9044. return this.version
  9045. }
  9046. SemVer.prototype.toString = function () {
  9047. return this.version
  9048. }
  9049. SemVer.prototype.compare = function (other) {
  9050. debug('SemVer.compare', this.version, this.options, other)
  9051. if (!(other instanceof SemVer)) {
  9052. other = new SemVer(other, this.options)
  9053. }
  9054. return this.compareMain(other) || this.comparePre(other)
  9055. }
  9056. SemVer.prototype.compareMain = function (other) {
  9057. if (!(other instanceof SemVer)) {
  9058. other = new SemVer(other, this.options)
  9059. }
  9060. return compareIdentifiers(this.major, other.major) ||
  9061. compareIdentifiers(this.minor, other.minor) ||
  9062. compareIdentifiers(this.patch, other.patch)
  9063. }
  9064. SemVer.prototype.comparePre = function (other) {
  9065. if (!(other instanceof SemVer)) {
  9066. other = new SemVer(other, this.options)
  9067. }
  9068. // NOT having a prerelease is > having one
  9069. if (this.prerelease.length && !other.prerelease.length) {
  9070. return -1
  9071. } else if (!this.prerelease.length && other.prerelease.length) {
  9072. return 1
  9073. } else if (!this.prerelease.length && !other.prerelease.length) {
  9074. return 0
  9075. }
  9076. var i = 0
  9077. do {
  9078. var a = this.prerelease[i]
  9079. var b = other.prerelease[i]
  9080. debug('prerelease compare', i, a, b)
  9081. if (a === undefined && b === undefined) {
  9082. return 0
  9083. } else if (b === undefined) {
  9084. return 1
  9085. } else if (a === undefined) {
  9086. return -1
  9087. } else if (a === b) {
  9088. continue
  9089. } else {
  9090. return compareIdentifiers(a, b)
  9091. }
  9092. } while (++i)
  9093. }
  9094. SemVer.prototype.compareBuild = function (other) {
  9095. if (!(other instanceof SemVer)) {
  9096. other = new SemVer(other, this.options)
  9097. }
  9098. var i = 0
  9099. do {
  9100. var a = this.build[i]
  9101. var b = other.build[i]
  9102. debug('prerelease compare', i, a, b)
  9103. if (a === undefined && b === undefined) {
  9104. return 0
  9105. } else if (b === undefined) {
  9106. return 1
  9107. } else if (a === undefined) {
  9108. return -1
  9109. } else if (a === b) {
  9110. continue
  9111. } else {
  9112. return compareIdentifiers(a, b)
  9113. }
  9114. } while (++i)
  9115. }
  9116. // preminor will bump the version up to the next minor release, and immediately
  9117. // down to pre-release. premajor and prepatch work the same way.
  9118. SemVer.prototype.inc = function (release, identifier) {
  9119. switch (release) {
  9120. case 'premajor':
  9121. this.prerelease.length = 0
  9122. this.patch = 0
  9123. this.minor = 0
  9124. this.major++
  9125. this.inc('pre', identifier)
  9126. break
  9127. case 'preminor':
  9128. this.prerelease.length = 0
  9129. this.patch = 0
  9130. this.minor++
  9131. this.inc('pre', identifier)
  9132. break
  9133. case 'prepatch':
  9134. // If this is already a prerelease, it will bump to the next version
  9135. // drop any prereleases that might already exist, since they are not
  9136. // relevant at this point.
  9137. this.prerelease.length = 0
  9138. this.inc('patch', identifier)
  9139. this.inc('pre', identifier)
  9140. break
  9141. // If the input is a non-prerelease version, this acts the same as
  9142. // prepatch.
  9143. case 'prerelease':
  9144. if (this.prerelease.length === 0) {
  9145. this.inc('patch', identifier)
  9146. }
  9147. this.inc('pre', identifier)
  9148. break
  9149. case 'major':
  9150. // If this is a pre-major version, bump up to the same major version.
  9151. // Otherwise increment major.
  9152. // 1.0.0-5 bumps to 1.0.0
  9153. // 1.1.0 bumps to 2.0.0
  9154. if (this.minor !== 0 ||
  9155. this.patch !== 0 ||
  9156. this.prerelease.length === 0) {
  9157. this.major++
  9158. }
  9159. this.minor = 0
  9160. this.patch = 0
  9161. this.prerelease = []
  9162. break
  9163. case 'minor':
  9164. // If this is a pre-minor version, bump up to the same minor version.
  9165. // Otherwise increment minor.
  9166. // 1.2.0-5 bumps to 1.2.0
  9167. // 1.2.1 bumps to 1.3.0
  9168. if (this.patch !== 0 || this.prerelease.length === 0) {
  9169. this.minor++
  9170. }
  9171. this.patch = 0
  9172. this.prerelease = []
  9173. break
  9174. case 'patch':
  9175. // If this is not a pre-release version, it will increment the patch.
  9176. // If it is a pre-release it will bump up to the same patch version.
  9177. // 1.2.0-5 patches to 1.2.0
  9178. // 1.2.0 patches to 1.2.1
  9179. if (this.prerelease.length === 0) {
  9180. this.patch++
  9181. }
  9182. this.prerelease = []
  9183. break
  9184. // This probably shouldn't be used publicly.
  9185. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  9186. case 'pre':
  9187. if (this.prerelease.length === 0) {
  9188. this.prerelease = [0]
  9189. } else {
  9190. var i = this.prerelease.length
  9191. while (--i >= 0) {
  9192. if (typeof this.prerelease[i] === 'number') {
  9193. this.prerelease[i]++
  9194. i = -2
  9195. }
  9196. }
  9197. if (i === -1) {
  9198. // didn't increment anything
  9199. this.prerelease.push(0)
  9200. }
  9201. }
  9202. if (identifier) {
  9203. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  9204. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  9205. if (this.prerelease[0] === identifier) {
  9206. if (isNaN(this.prerelease[1])) {
  9207. this.prerelease = [identifier, 0]
  9208. }
  9209. } else {
  9210. this.prerelease = [identifier, 0]
  9211. }
  9212. }
  9213. break
  9214. default:
  9215. throw new Error('invalid increment argument: ' + release)
  9216. }
  9217. this.format()
  9218. this.raw = this.version
  9219. return this
  9220. }
  9221. exports.inc = inc
  9222. function inc (version, release, loose, identifier) {
  9223. if (typeof (loose) === 'string') {
  9224. identifier = loose
  9225. loose = undefined
  9226. }
  9227. try {
  9228. return new SemVer(version, loose).inc(release, identifier).version
  9229. } catch (er) {
  9230. return null
  9231. }
  9232. }
  9233. exports.diff = diff
  9234. function diff (version1, version2) {
  9235. if (eq(version1, version2)) {
  9236. return null
  9237. } else {
  9238. var v1 = parse(version1)
  9239. var v2 = parse(version2)
  9240. var prefix = ''
  9241. if (v1.prerelease.length || v2.prerelease.length) {
  9242. prefix = 'pre'
  9243. var defaultResult = 'prerelease'
  9244. }
  9245. for (var key in v1) {
  9246. if (key === 'major' || key === 'minor' || key === 'patch') {
  9247. if (v1[key] !== v2[key]) {
  9248. return prefix + key
  9249. }
  9250. }
  9251. }
  9252. return defaultResult // may be undefined
  9253. }
  9254. }
  9255. exports.compareIdentifiers = compareIdentifiers
  9256. var numeric = /^[0-9]+$/
  9257. function compareIdentifiers (a, b) {
  9258. var anum = numeric.test(a)
  9259. var bnum = numeric.test(b)
  9260. if (anum && bnum) {
  9261. a = +a
  9262. b = +b
  9263. }
  9264. return a === b ? 0
  9265. : (anum && !bnum) ? -1
  9266. : (bnum && !anum) ? 1
  9267. : a < b ? -1
  9268. : 1
  9269. }
  9270. exports.rcompareIdentifiers = rcompareIdentifiers
  9271. function rcompareIdentifiers (a, b) {
  9272. return compareIdentifiers(b, a)
  9273. }
  9274. exports.major = major
  9275. function major (a, loose) {
  9276. return new SemVer(a, loose).major
  9277. }
  9278. exports.minor = minor
  9279. function minor (a, loose) {
  9280. return new SemVer(a, loose).minor
  9281. }
  9282. exports.patch = patch
  9283. function patch (a, loose) {
  9284. return new SemVer(a, loose).patch
  9285. }
  9286. exports.compare = compare
  9287. function compare (a, b, loose) {
  9288. return new SemVer(a, loose).compare(new SemVer(b, loose))
  9289. }
  9290. exports.compareLoose = compareLoose
  9291. function compareLoose (a, b) {
  9292. return compare(a, b, true)
  9293. }
  9294. exports.compareBuild = compareBuild
  9295. function compareBuild (a, b, loose) {
  9296. var versionA = new SemVer(a, loose)
  9297. var versionB = new SemVer(b, loose)
  9298. return versionA.compare(versionB) || versionA.compareBuild(versionB)
  9299. }
  9300. exports.rcompare = rcompare
  9301. function rcompare (a, b, loose) {
  9302. return compare(b, a, loose)
  9303. }
  9304. exports.sort = sort
  9305. function sort (list, loose) {
  9306. return list.sort(function (a, b) {
  9307. return exports.compareBuild(a, b, loose)
  9308. })
  9309. }
  9310. exports.rsort = rsort
  9311. function rsort (list, loose) {
  9312. return list.sort(function (a, b) {
  9313. return exports.compareBuild(b, a, loose)
  9314. })
  9315. }
  9316. exports.gt = gt
  9317. function gt (a, b, loose) {
  9318. return compare(a, b, loose) > 0
  9319. }
  9320. exports.lt = lt
  9321. function lt (a, b, loose) {
  9322. return compare(a, b, loose) < 0
  9323. }
  9324. exports.eq = eq
  9325. function eq (a, b, loose) {
  9326. return compare(a, b, loose) === 0
  9327. }
  9328. exports.neq = neq
  9329. function neq (a, b, loose) {
  9330. return compare(a, b, loose) !== 0
  9331. }
  9332. exports.gte = gte
  9333. function gte (a, b, loose) {
  9334. return compare(a, b, loose) >= 0
  9335. }
  9336. exports.lte = lte
  9337. function lte (a, b, loose) {
  9338. return compare(a, b, loose) <= 0
  9339. }
  9340. exports.cmp = cmp
  9341. function cmp (a, op, b, loose) {
  9342. switch (op) {
  9343. case '===':
  9344. if (typeof a === 'object')
  9345. a = a.version
  9346. if (typeof b === 'object')
  9347. b = b.version
  9348. return a === b
  9349. case '!==':
  9350. if (typeof a === 'object')
  9351. a = a.version
  9352. if (typeof b === 'object')
  9353. b = b.version
  9354. return a !== b
  9355. case '':
  9356. case '=':
  9357. case '==':
  9358. return eq(a, b, loose)
  9359. case '!=':
  9360. return neq(a, b, loose)
  9361. case '>':
  9362. return gt(a, b, loose)
  9363. case '>=':
  9364. return gte(a, b, loose)
  9365. case '<':
  9366. return lt(a, b, loose)
  9367. case '<=':
  9368. return lte(a, b, loose)
  9369. default:
  9370. throw new TypeError('Invalid operator: ' + op)
  9371. }
  9372. }
  9373. exports.Comparator = Comparator
  9374. function Comparator (comp, options) {
  9375. if (!options || typeof options !== 'object') {
  9376. options = {
  9377. loose: !!options,
  9378. includePrerelease: false
  9379. }
  9380. }
  9381. if (comp instanceof Comparator) {
  9382. if (comp.loose === !!options.loose) {
  9383. return comp
  9384. } else {
  9385. comp = comp.value
  9386. }
  9387. }
  9388. if (!(this instanceof Comparator)) {
  9389. return new Comparator(comp, options)
  9390. }
  9391. debug('comparator', comp, options)
  9392. this.options = options
  9393. this.loose = !!options.loose
  9394. this.parse(comp)
  9395. if (this.semver === ANY) {
  9396. this.value = ''
  9397. } else {
  9398. this.value = this.operator + this.semver.version
  9399. }
  9400. debug('comp', this)
  9401. }
  9402. var ANY = {}
  9403. Comparator.prototype.parse = function (comp) {
  9404. var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
  9405. var m = comp.match(r)
  9406. if (!m) {
  9407. throw new TypeError('Invalid comparator: ' + comp)
  9408. }
  9409. this.operator = m[1] !== undefined ? m[1] : ''
  9410. if (this.operator === '=') {
  9411. this.operator = ''
  9412. }
  9413. // if it literally is just '>' or '' then allow anything.
  9414. if (!m[2]) {
  9415. this.semver = ANY
  9416. } else {
  9417. this.semver = new SemVer(m[2], this.options.loose)
  9418. }
  9419. }
  9420. Comparator.prototype.toString = function () {
  9421. return this.value
  9422. }
  9423. Comparator.prototype.test = function (version) {
  9424. debug('Comparator.test', version, this.options.loose)
  9425. if (this.semver === ANY || version === ANY) {
  9426. return true
  9427. }
  9428. if (typeof version === 'string') {
  9429. try {
  9430. version = new SemVer(version, this.options)
  9431. } catch (er) {
  9432. return false
  9433. }
  9434. }
  9435. return cmp(version, this.operator, this.semver, this.options)
  9436. }
  9437. Comparator.prototype.intersects = function (comp, options) {
  9438. if (!(comp instanceof Comparator)) {
  9439. throw new TypeError('a Comparator is required')
  9440. }
  9441. if (!options || typeof options !== 'object') {
  9442. options = {
  9443. loose: !!options,
  9444. includePrerelease: false
  9445. }
  9446. }
  9447. var rangeTmp
  9448. if (this.operator === '') {
  9449. if (this.value === '') {
  9450. return true
  9451. }
  9452. rangeTmp = new Range(comp.value, options)
  9453. return satisfies(this.value, rangeTmp, options)
  9454. } else if (comp.operator === '') {
  9455. if (comp.value === '') {
  9456. return true
  9457. }
  9458. rangeTmp = new Range(this.value, options)
  9459. return satisfies(comp.semver, rangeTmp, options)
  9460. }
  9461. var sameDirectionIncreasing =
  9462. (this.operator === '>=' || this.operator === '>') &&
  9463. (comp.operator === '>=' || comp.operator === '>')
  9464. var sameDirectionDecreasing =
  9465. (this.operator === '<=' || this.operator === '<') &&
  9466. (comp.operator === '<=' || comp.operator === '<')
  9467. var sameSemVer = this.semver.version === comp.semver.version
  9468. var differentDirectionsInclusive =
  9469. (this.operator === '>=' || this.operator === '<=') &&
  9470. (comp.operator === '>=' || comp.operator === '<=')
  9471. var oppositeDirectionsLessThan =
  9472. cmp(this.semver, '<', comp.semver, options) &&
  9473. ((this.operator === '>=' || this.operator === '>') &&
  9474. (comp.operator === '<=' || comp.operator === '<'))
  9475. var oppositeDirectionsGreaterThan =
  9476. cmp(this.semver, '>', comp.semver, options) &&
  9477. ((this.operator === '<=' || this.operator === '<') &&
  9478. (comp.operator === '>=' || comp.operator === '>'))
  9479. return sameDirectionIncreasing || sameDirectionDecreasing ||
  9480. (sameSemVer && differentDirectionsInclusive) ||
  9481. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  9482. }
  9483. exports.Range = Range
  9484. function Range (range, options) {
  9485. if (!options || typeof options !== 'object') {
  9486. options = {
  9487. loose: !!options,
  9488. includePrerelease: false
  9489. }
  9490. }
  9491. if (range instanceof Range) {
  9492. if (range.loose === !!options.loose &&
  9493. range.includePrerelease === !!options.includePrerelease) {
  9494. return range
  9495. } else {
  9496. return new Range(range.raw, options)
  9497. }
  9498. }
  9499. if (range instanceof Comparator) {
  9500. return new Range(range.value, options)
  9501. }
  9502. if (!(this instanceof Range)) {
  9503. return new Range(range, options)
  9504. }
  9505. this.options = options
  9506. this.loose = !!options.loose
  9507. this.includePrerelease = !!options.includePrerelease
  9508. // First, split based on boolean or ||
  9509. this.raw = range
  9510. this.set = range.split(/\s*\|\|\s*/).map(function (range) {
  9511. return this.parseRange(range.trim())
  9512. }, this).filter(function (c) {
  9513. // throw out any that are not relevant for whatever reason
  9514. return c.length
  9515. })
  9516. if (!this.set.length) {
  9517. throw new TypeError('Invalid SemVer Range: ' + range)
  9518. }
  9519. this.format()
  9520. }
  9521. Range.prototype.format = function () {
  9522. this.range = this.set.map(function (comps) {
  9523. return comps.join(' ').trim()
  9524. }).join('||').trim()
  9525. return this.range
  9526. }
  9527. Range.prototype.toString = function () {
  9528. return this.range
  9529. }
  9530. Range.prototype.parseRange = function (range) {
  9531. var loose = this.options.loose
  9532. range = range.trim()
  9533. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  9534. var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]
  9535. range = range.replace(hr, hyphenReplace)
  9536. debug('hyphen replace', range)
  9537. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  9538. range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)
  9539. debug('comparator trim', range, re[t.COMPARATORTRIM])
  9540. // `~ 1.2.3` => `~1.2.3`
  9541. range = range.replace(re[t.TILDETRIM], tildeTrimReplace)
  9542. // `^ 1.2.3` => `^1.2.3`
  9543. range = range.replace(re[t.CARETTRIM], caretTrimReplace)
  9544. // normalize spaces
  9545. range = range.split(/\s+/).join(' ')
  9546. // At this point, the range is completely trimmed and
  9547. // ready to be split into comparators.
  9548. var compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
  9549. var set = range.split(' ').map(function (comp) {
  9550. return parseComparator(comp, this.options)
  9551. }, this).join(' ').split(/\s+/)
  9552. if (this.options.loose) {
  9553. // in loose mode, throw out any that are not valid comparators
  9554. set = set.filter(function (comp) {
  9555. return !!comp.match(compRe)
  9556. })
  9557. }
  9558. set = set.map(function (comp) {
  9559. return new Comparator(comp, this.options)
  9560. }, this)
  9561. return set
  9562. }
  9563. Range.prototype.intersects = function (range, options) {
  9564. if (!(range instanceof Range)) {
  9565. throw new TypeError('a Range is required')
  9566. }
  9567. return this.set.some(function (thisComparators) {
  9568. return (
  9569. isSatisfiable(thisComparators, options) &&
  9570. range.set.some(function (rangeComparators) {
  9571. return (
  9572. isSatisfiable(rangeComparators, options) &&
  9573. thisComparators.every(function (thisComparator) {
  9574. return rangeComparators.every(function (rangeComparator) {
  9575. return thisComparator.intersects(rangeComparator, options)
  9576. })
  9577. })
  9578. )
  9579. })
  9580. )
  9581. })
  9582. }
  9583. // take a set of comparators and determine whether there
  9584. // exists a version which can satisfy it
  9585. function isSatisfiable (comparators, options) {
  9586. var result = true
  9587. var remainingComparators = comparators.slice()
  9588. var testComparator = remainingComparators.pop()
  9589. while (result && remainingComparators.length) {
  9590. result = remainingComparators.every(function (otherComparator) {
  9591. return testComparator.intersects(otherComparator, options)
  9592. })
  9593. testComparator = remainingComparators.pop()
  9594. }
  9595. return result
  9596. }
  9597. // Mostly just for testing and legacy API reasons
  9598. exports.toComparators = toComparators
  9599. function toComparators (range, options) {
  9600. return new Range(range, options).set.map(function (comp) {
  9601. return comp.map(function (c) {
  9602. return c.value
  9603. }).join(' ').trim().split(' ')
  9604. })
  9605. }
  9606. // comprised of xranges, tildes, stars, and gtlt's at this point.
  9607. // already replaced the hyphen ranges
  9608. // turn into a set of JUST comparators.
  9609. function parseComparator (comp, options) {
  9610. debug('comp', comp, options)
  9611. comp = replaceCarets(comp, options)
  9612. debug('caret', comp)
  9613. comp = replaceTildes(comp, options)
  9614. debug('tildes', comp)
  9615. comp = replaceXRanges(comp, options)
  9616. debug('xrange', comp)
  9617. comp = replaceStars(comp, options)
  9618. debug('stars', comp)
  9619. return comp
  9620. }
  9621. function isX (id) {
  9622. return !id || id.toLowerCase() === 'x' || id === '*'
  9623. }
  9624. // ~, ~> --> * (any, kinda silly)
  9625. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  9626. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  9627. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  9628. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  9629. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  9630. function replaceTildes (comp, options) {
  9631. return comp.trim().split(/\s+/).map(function (comp) {
  9632. return replaceTilde(comp, options)
  9633. }).join(' ')
  9634. }
  9635. function replaceTilde (comp, options) {
  9636. var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]
  9637. return comp.replace(r, function (_, M, m, p, pr) {
  9638. debug('tilde', comp, _, M, m, p, pr)
  9639. var ret
  9640. if (isX(M)) {
  9641. ret = ''
  9642. } else if (isX(m)) {
  9643. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  9644. } else if (isX(p)) {
  9645. // ~1.2 == >=1.2.0 <1.3.0
  9646. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  9647. } else if (pr) {
  9648. debug('replaceTilde pr', pr)
  9649. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  9650. ' <' + M + '.' + (+m + 1) + '.0'
  9651. } else {
  9652. // ~1.2.3 == >=1.2.3 <1.3.0
  9653. ret = '>=' + M + '.' + m + '.' + p +
  9654. ' <' + M + '.' + (+m + 1) + '.0'
  9655. }
  9656. debug('tilde return', ret)
  9657. return ret
  9658. })
  9659. }
  9660. // ^ --> * (any, kinda silly)
  9661. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  9662. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  9663. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  9664. // ^1.2.3 --> >=1.2.3 <2.0.0
  9665. // ^1.2.0 --> >=1.2.0 <2.0.0
  9666. function replaceCarets (comp, options) {
  9667. return comp.trim().split(/\s+/).map(function (comp) {
  9668. return replaceCaret(comp, options)
  9669. }).join(' ')
  9670. }
  9671. function replaceCaret (comp, options) {
  9672. debug('caret', comp, options)
  9673. var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]
  9674. return comp.replace(r, function (_, M, m, p, pr) {
  9675. debug('caret', comp, _, M, m, p, pr)
  9676. var ret
  9677. if (isX(M)) {
  9678. ret = ''
  9679. } else if (isX(m)) {
  9680. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  9681. } else if (isX(p)) {
  9682. if (M === '0') {
  9683. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  9684. } else {
  9685. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  9686. }
  9687. } else if (pr) {
  9688. debug('replaceCaret pr', pr)
  9689. if (M === '0') {
  9690. if (m === '0') {
  9691. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  9692. ' <' + M + '.' + m + '.' + (+p + 1)
  9693. } else {
  9694. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  9695. ' <' + M + '.' + (+m + 1) + '.0'
  9696. }
  9697. } else {
  9698. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  9699. ' <' + (+M + 1) + '.0.0'
  9700. }
  9701. } else {
  9702. debug('no pr')
  9703. if (M === '0') {
  9704. if (m === '0') {
  9705. ret = '>=' + M + '.' + m + '.' + p +
  9706. ' <' + M + '.' + m + '.' + (+p + 1)
  9707. } else {
  9708. ret = '>=' + M + '.' + m + '.' + p +
  9709. ' <' + M + '.' + (+m + 1) + '.0'
  9710. }
  9711. } else {
  9712. ret = '>=' + M + '.' + m + '.' + p +
  9713. ' <' + (+M + 1) + '.0.0'
  9714. }
  9715. }
  9716. debug('caret return', ret)
  9717. return ret
  9718. })
  9719. }
  9720. function replaceXRanges (comp, options) {
  9721. debug('replaceXRanges', comp, options)
  9722. return comp.split(/\s+/).map(function (comp) {
  9723. return replaceXRange(comp, options)
  9724. }).join(' ')
  9725. }
  9726. function replaceXRange (comp, options) {
  9727. comp = comp.trim()
  9728. var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]
  9729. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  9730. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  9731. var xM = isX(M)
  9732. var xm = xM || isX(m)
  9733. var xp = xm || isX(p)
  9734. var anyX = xp
  9735. if (gtlt === '=' && anyX) {
  9736. gtlt = ''
  9737. }
  9738. // if we're including prereleases in the match, then we need
  9739. // to fix this to -0, the lowest possible prerelease value
  9740. pr = options.includePrerelease ? '-0' : ''
  9741. if (xM) {
  9742. if (gtlt === '>' || gtlt === '<') {
  9743. // nothing is allowed
  9744. ret = '<0.0.0-0'
  9745. } else {
  9746. // nothing is forbidden
  9747. ret = '*'
  9748. }
  9749. } else if (gtlt && anyX) {
  9750. // we know patch is an x, because we have any x at all.
  9751. // replace X with 0
  9752. if (xm) {
  9753. m = 0
  9754. }
  9755. p = 0
  9756. if (gtlt === '>') {
  9757. // >1 => >=2.0.0
  9758. // >1.2 => >=1.3.0
  9759. // >1.2.3 => >= 1.2.4
  9760. gtlt = '>='
  9761. if (xm) {
  9762. M = +M + 1
  9763. m = 0
  9764. p = 0
  9765. } else {
  9766. m = +m + 1
  9767. p = 0
  9768. }
  9769. } else if (gtlt === '<=') {
  9770. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  9771. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  9772. gtlt = '<'
  9773. if (xm) {
  9774. M = +M + 1
  9775. } else {
  9776. m = +m + 1
  9777. }
  9778. }
  9779. ret = gtlt + M + '.' + m + '.' + p + pr
  9780. } else if (xm) {
  9781. ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr
  9782. } else if (xp) {
  9783. ret = '>=' + M + '.' + m + '.0' + pr +
  9784. ' <' + M + '.' + (+m + 1) + '.0' + pr
  9785. }
  9786. debug('xRange return', ret)
  9787. return ret
  9788. })
  9789. }
  9790. // Because * is AND-ed with everything else in the comparator,
  9791. // and '' means "any version", just remove the *s entirely.
  9792. function replaceStars (comp, options) {
  9793. debug('replaceStars', comp, options)
  9794. // Looseness is ignored here. star is always as loose as it gets!
  9795. return comp.trim().replace(re[t.STAR], '')
  9796. }
  9797. // This function is passed to string.replace(re[t.HYPHENRANGE])
  9798. // M, m, patch, prerelease, build
  9799. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  9800. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  9801. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  9802. function hyphenReplace ($0,
  9803. from, fM, fm, fp, fpr, fb,
  9804. to, tM, tm, tp, tpr, tb) {
  9805. if (isX(fM)) {
  9806. from = ''
  9807. } else if (isX(fm)) {
  9808. from = '>=' + fM + '.0.0'
  9809. } else if (isX(fp)) {
  9810. from = '>=' + fM + '.' + fm + '.0'
  9811. } else {
  9812. from = '>=' + from
  9813. }
  9814. if (isX(tM)) {
  9815. to = ''
  9816. } else if (isX(tm)) {
  9817. to = '<' + (+tM + 1) + '.0.0'
  9818. } else if (isX(tp)) {
  9819. to = '<' + tM + '.' + (+tm + 1) + '.0'
  9820. } else if (tpr) {
  9821. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  9822. } else {
  9823. to = '<=' + to
  9824. }
  9825. return (from + ' ' + to).trim()
  9826. }
  9827. // if ANY of the sets match ALL of its comparators, then pass
  9828. Range.prototype.test = function (version) {
  9829. if (!version) {
  9830. return false
  9831. }
  9832. if (typeof version === 'string') {
  9833. try {
  9834. version = new SemVer(version, this.options)
  9835. } catch (er) {
  9836. return false
  9837. }
  9838. }
  9839. for (var i = 0; i < this.set.length; i++) {
  9840. if (testSet(this.set[i], version, this.options)) {
  9841. return true
  9842. }
  9843. }
  9844. return false
  9845. }
  9846. function testSet (set, version, options) {
  9847. for (var i = 0; i < set.length; i++) {
  9848. if (!set[i].test(version)) {
  9849. return false
  9850. }
  9851. }
  9852. if (version.prerelease.length && !options.includePrerelease) {
  9853. // Find the set of versions that are allowed to have prereleases
  9854. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  9855. // That should allow `1.2.3-pr.2` to pass.
  9856. // However, `1.2.4-alpha.notready` should NOT be allowed,
  9857. // even though it's within the range set by the comparators.
  9858. for (i = 0; i < set.length; i++) {
  9859. debug(set[i].semver)
  9860. if (set[i].semver === ANY) {
  9861. continue
  9862. }
  9863. if (set[i].semver.prerelease.length > 0) {
  9864. var allowed = set[i].semver
  9865. if (allowed.major === version.major &&
  9866. allowed.minor === version.minor &&
  9867. allowed.patch === version.patch) {
  9868. return true
  9869. }
  9870. }
  9871. }
  9872. // Version has a -pre, but it's not one of the ones we like.
  9873. return false
  9874. }
  9875. return true
  9876. }
  9877. exports.satisfies = satisfies
  9878. function satisfies (version, range, options) {
  9879. try {
  9880. range = new Range(range, options)
  9881. } catch (er) {
  9882. return false
  9883. }
  9884. return range.test(version)
  9885. }
  9886. exports.maxSatisfying = maxSatisfying
  9887. function maxSatisfying (versions, range, options) {
  9888. var max = null
  9889. var maxSV = null
  9890. try {
  9891. var rangeObj = new Range(range, options)
  9892. } catch (er) {
  9893. return null
  9894. }
  9895. versions.forEach(function (v) {
  9896. if (rangeObj.test(v)) {
  9897. // satisfies(v, range, options)
  9898. if (!max || maxSV.compare(v) === -1) {
  9899. // compare(max, v, true)
  9900. max = v
  9901. maxSV = new SemVer(max, options)
  9902. }
  9903. }
  9904. })
  9905. return max
  9906. }
  9907. exports.minSatisfying = minSatisfying
  9908. function minSatisfying (versions, range, options) {
  9909. var min = null
  9910. var minSV = null
  9911. try {
  9912. var rangeObj = new Range(range, options)
  9913. } catch (er) {
  9914. return null
  9915. }
  9916. versions.forEach(function (v) {
  9917. if (rangeObj.test(v)) {
  9918. // satisfies(v, range, options)
  9919. if (!min || minSV.compare(v) === 1) {
  9920. // compare(min, v, true)
  9921. min = v
  9922. minSV = new SemVer(min, options)
  9923. }
  9924. }
  9925. })
  9926. return min
  9927. }
  9928. exports.minVersion = minVersion
  9929. function minVersion (range, loose) {
  9930. range = new Range(range, loose)
  9931. var minver = new SemVer('0.0.0')
  9932. if (range.test(minver)) {
  9933. return minver
  9934. }
  9935. minver = new SemVer('0.0.0-0')
  9936. if (range.test(minver)) {
  9937. return minver
  9938. }
  9939. minver = null
  9940. for (var i = 0; i < range.set.length; ++i) {
  9941. var comparators = range.set[i]
  9942. comparators.forEach(function (comparator) {
  9943. // Clone to avoid manipulating the comparator's semver object.
  9944. var compver = new SemVer(comparator.semver.version)
  9945. switch (comparator.operator) {
  9946. case '>':
  9947. if (compver.prerelease.length === 0) {
  9948. compver.patch++
  9949. } else {
  9950. compver.prerelease.push(0)
  9951. }
  9952. compver.raw = compver.format()
  9953. /* fallthrough */
  9954. case '':
  9955. case '>=':
  9956. if (!minver || gt(minver, compver)) {
  9957. minver = compver
  9958. }
  9959. break
  9960. case '<':
  9961. case '<=':
  9962. /* Ignore maximum versions */
  9963. break
  9964. /* istanbul ignore next */
  9965. default:
  9966. throw new Error('Unexpected operation: ' + comparator.operator)
  9967. }
  9968. })
  9969. }
  9970. if (minver && range.test(minver)) {
  9971. return minver
  9972. }
  9973. return null
  9974. }
  9975. exports.validRange = validRange
  9976. function validRange (range, options) {
  9977. try {
  9978. // Return '*' instead of '' so that truthiness works.
  9979. // This will throw if it's invalid anyway
  9980. return new Range(range, options).range || '*'
  9981. } catch (er) {
  9982. return null
  9983. }
  9984. }
  9985. // Determine if version is less than all the versions possible in the range
  9986. exports.ltr = ltr
  9987. function ltr (version, range, options) {
  9988. return outside(version, range, '<', options)
  9989. }
  9990. // Determine if version is greater than all the versions possible in the range.
  9991. exports.gtr = gtr
  9992. function gtr (version, range, options) {
  9993. return outside(version, range, '>', options)
  9994. }
  9995. exports.outside = outside
  9996. function outside (version, range, hilo, options) {
  9997. version = new SemVer(version, options)
  9998. range = new Range(range, options)
  9999. var gtfn, ltefn, ltfn, comp, ecomp
  10000. switch (hilo) {
  10001. case '>':
  10002. gtfn = gt
  10003. ltefn = lte
  10004. ltfn = lt
  10005. comp = '>'
  10006. ecomp = '>='
  10007. break
  10008. case '<':
  10009. gtfn = lt
  10010. ltefn = gte
  10011. ltfn = gt
  10012. comp = '<'
  10013. ecomp = '<='
  10014. break
  10015. default:
  10016. throw new TypeError('Must provide a hilo val of "<" or ">"')
  10017. }
  10018. // If it satisifes the range it is not outside
  10019. if (satisfies(version, range, options)) {
  10020. return false
  10021. }
  10022. // From now on, variable terms are as if we're in "gtr" mode.
  10023. // but note that everything is flipped for the "ltr" function.
  10024. for (var i = 0; i < range.set.length; ++i) {
  10025. var comparators = range.set[i]
  10026. var high = null
  10027. var low = null
  10028. comparators.forEach(function (comparator) {
  10029. if (comparator.semver === ANY) {
  10030. comparator = new Comparator('>=0.0.0')
  10031. }
  10032. high = high || comparator
  10033. low = low || comparator
  10034. if (gtfn(comparator.semver, high.semver, options)) {
  10035. high = comparator
  10036. } else if (ltfn(comparator.semver, low.semver, options)) {
  10037. low = comparator
  10038. }
  10039. })
  10040. // If the edge version comparator has a operator then our version
  10041. // isn't outside it
  10042. if (high.operator === comp || high.operator === ecomp) {
  10043. return false
  10044. }
  10045. // If the lowest version comparator has an operator and our version
  10046. // is less than it then it isn't higher than the range
  10047. if ((!low.operator || low.operator === comp) &&
  10048. ltefn(version, low.semver)) {
  10049. return false
  10050. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  10051. return false
  10052. }
  10053. }
  10054. return true
  10055. }
  10056. exports.prerelease = prerelease
  10057. function prerelease (version, options) {
  10058. var parsed = parse(version, options)
  10059. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  10060. }
  10061. exports.intersects = intersects
  10062. function intersects (r1, r2, options) {
  10063. r1 = new Range(r1, options)
  10064. r2 = new Range(r2, options)
  10065. return r1.intersects(r2)
  10066. }
  10067. exports.coerce = coerce
  10068. function coerce (version, options) {
  10069. if (version instanceof SemVer) {
  10070. return version
  10071. }
  10072. if (typeof version === 'number') {
  10073. version = String(version)
  10074. }
  10075. if (typeof version !== 'string') {
  10076. return null
  10077. }
  10078. options = options || {}
  10079. var match = null
  10080. if (!options.rtl) {
  10081. match = version.match(re[t.COERCE])
  10082. } else {
  10083. // Find the right-most coercible string that does not share
  10084. // a terminus with a more left-ward coercible string.
  10085. // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
  10086. //
  10087. // Walk through the string checking with a /g regexp
  10088. // Manually set the index so as to pick up overlapping matches.
  10089. // Stop when we get a match that ends at the string end, since no
  10090. // coercible string can be more right-ward without the same terminus.
  10091. var next
  10092. while ((next = re[t.COERCERTL].exec(version)) &&
  10093. (!match || match.index + match[0].length !== version.length)
  10094. ) {
  10095. if (!match ||
  10096. next.index + next[0].length !== match.index + match[0].length) {
  10097. match = next
  10098. }
  10099. re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length
  10100. }
  10101. // leave it in a clean state
  10102. re[t.COERCERTL].lastIndex = -1
  10103. }
  10104. if (match === null) {
  10105. return null
  10106. }
  10107. return parse(match[2] +
  10108. '.' + (match[3] || '0') +
  10109. '.' + (match[4] || '0'), options)
  10110. }
  10111. /***/ }),
  10112. /***/ 669:
  10113. /***/ (function(module) {
  10114. module.exports = require("util");
  10115. /***/ }),
  10116. /***/ 672:
  10117. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  10118. "use strict";
  10119. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  10120. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  10121. return new (P || (P = Promise))(function (resolve, reject) {
  10122. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  10123. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  10124. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  10125. step((generator = generator.apply(thisArg, _arguments || [])).next());
  10126. });
  10127. };
  10128. var _a;
  10129. Object.defineProperty(exports, "__esModule", { value: true });
  10130. const assert_1 = __webpack_require__(357);
  10131. const fs = __webpack_require__(747);
  10132. const path = __webpack_require__(622);
  10133. _a = fs.promises, exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.readdir = _a.readdir, exports.readlink = _a.readlink, exports.rename = _a.rename, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink;
  10134. exports.IS_WINDOWS = process.platform === 'win32';
  10135. function exists(fsPath) {
  10136. return __awaiter(this, void 0, void 0, function* () {
  10137. try {
  10138. yield exports.stat(fsPath);
  10139. }
  10140. catch (err) {
  10141. if (err.code === 'ENOENT') {
  10142. return false;
  10143. }
  10144. throw err;
  10145. }
  10146. return true;
  10147. });
  10148. }
  10149. exports.exists = exists;
  10150. function isDirectory(fsPath, useStat = false) {
  10151. return __awaiter(this, void 0, void 0, function* () {
  10152. const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath);
  10153. return stats.isDirectory();
  10154. });
  10155. }
  10156. exports.isDirectory = isDirectory;
  10157. /**
  10158. * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:
  10159. * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases).
  10160. */
  10161. function isRooted(p) {
  10162. p = normalizeSeparators(p);
  10163. if (!p) {
  10164. throw new Error('isRooted() parameter "p" cannot be empty');
  10165. }
  10166. if (exports.IS_WINDOWS) {
  10167. return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello
  10168. ); // e.g. C: or C:\hello
  10169. }
  10170. return p.startsWith('/');
  10171. }
  10172. exports.isRooted = isRooted;
  10173. /**
  10174. * Recursively create a directory at `fsPath`.
  10175. *
  10176. * This implementation is optimistic, meaning it attempts to create the full
  10177. * path first, and backs up the path stack from there.
  10178. *
  10179. * @param fsPath The path to create
  10180. * @param maxDepth The maximum recursion depth
  10181. * @param depth The current recursion depth
  10182. */
  10183. function mkdirP(fsPath, maxDepth = 1000, depth = 1) {
  10184. return __awaiter(this, void 0, void 0, function* () {
  10185. assert_1.ok(fsPath, 'a path argument must be provided');
  10186. fsPath = path.resolve(fsPath);
  10187. if (depth >= maxDepth)
  10188. return exports.mkdir(fsPath);
  10189. try {
  10190. yield exports.mkdir(fsPath);
  10191. return;
  10192. }
  10193. catch (err) {
  10194. switch (err.code) {
  10195. case 'ENOENT': {
  10196. yield mkdirP(path.dirname(fsPath), maxDepth, depth + 1);
  10197. yield exports.mkdir(fsPath);
  10198. return;
  10199. }
  10200. default: {
  10201. let stats;
  10202. try {
  10203. stats = yield exports.stat(fsPath);
  10204. }
  10205. catch (err2) {
  10206. throw err;
  10207. }
  10208. if (!stats.isDirectory())
  10209. throw err;
  10210. }
  10211. }
  10212. }
  10213. });
  10214. }
  10215. exports.mkdirP = mkdirP;
  10216. /**
  10217. * Best effort attempt to determine whether a file exists and is executable.
  10218. * @param filePath file path to check
  10219. * @param extensions additional file extensions to try
  10220. * @return if file exists and is executable, returns the file path. otherwise empty string.
  10221. */
  10222. function tryGetExecutablePath(filePath, extensions) {
  10223. return __awaiter(this, void 0, void 0, function* () {
  10224. let stats = undefined;
  10225. try {
  10226. // test file exists
  10227. stats = yield exports.stat(filePath);
  10228. }
  10229. catch (err) {
  10230. if (err.code !== 'ENOENT') {
  10231. // eslint-disable-next-line no-console
  10232. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  10233. }
  10234. }
  10235. if (stats && stats.isFile()) {
  10236. if (exports.IS_WINDOWS) {
  10237. // on Windows, test for valid extension
  10238. const upperExt = path.extname(filePath).toUpperCase();
  10239. if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) {
  10240. return filePath;
  10241. }
  10242. }
  10243. else {
  10244. if (isUnixExecutable(stats)) {
  10245. return filePath;
  10246. }
  10247. }
  10248. }
  10249. // try each extension
  10250. const originalFilePath = filePath;
  10251. for (const extension of extensions) {
  10252. filePath = originalFilePath + extension;
  10253. stats = undefined;
  10254. try {
  10255. stats = yield exports.stat(filePath);
  10256. }
  10257. catch (err) {
  10258. if (err.code !== 'ENOENT') {
  10259. // eslint-disable-next-line no-console
  10260. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  10261. }
  10262. }
  10263. if (stats && stats.isFile()) {
  10264. if (exports.IS_WINDOWS) {
  10265. // preserve the case of the actual file (since an extension was appended)
  10266. try {
  10267. const directory = path.dirname(filePath);
  10268. const upperName = path.basename(filePath).toUpperCase();
  10269. for (const actualName of yield exports.readdir(directory)) {
  10270. if (upperName === actualName.toUpperCase()) {
  10271. filePath = path.join(directory, actualName);
  10272. break;
  10273. }
  10274. }
  10275. }
  10276. catch (err) {
  10277. // eslint-disable-next-line no-console
  10278. console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`);
  10279. }
  10280. return filePath;
  10281. }
  10282. else {
  10283. if (isUnixExecutable(stats)) {
  10284. return filePath;
  10285. }
  10286. }
  10287. }
  10288. }
  10289. return '';
  10290. });
  10291. }
  10292. exports.tryGetExecutablePath = tryGetExecutablePath;
  10293. function normalizeSeparators(p) {
  10294. p = p || '';
  10295. if (exports.IS_WINDOWS) {
  10296. // convert slashes on Windows
  10297. p = p.replace(/\//g, '\\');
  10298. // remove redundant slashes
  10299. return p.replace(/\\\\+/g, '\\');
  10300. }
  10301. // remove redundant slashes
  10302. return p.replace(/\/\/+/g, '/');
  10303. }
  10304. // on Mac/Linux, test the execute bit
  10305. // R W X R W X R W X
  10306. // 256 128 64 32 16 8 4 2 1
  10307. function isUnixExecutable(stats) {
  10308. return ((stats.mode & 1) > 0 ||
  10309. ((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||
  10310. ((stats.mode & 64) > 0 && stats.uid === process.getuid()));
  10311. }
  10312. //# sourceMappingURL=io-util.js.map
  10313. /***/ }),
  10314. /***/ 674:
  10315. /***/ (function(module, __unusedexports, __webpack_require__) {
  10316. module.exports = authenticate;
  10317. const { Deprecation } = __webpack_require__(692);
  10318. const once = __webpack_require__(969);
  10319. const deprecateAuthenticate = once((log, deprecation) => log.warn(deprecation));
  10320. function authenticate(state, options) {
  10321. deprecateAuthenticate(
  10322. state.octokit.log,
  10323. new Deprecation(
  10324. '[@octokit/rest] octokit.authenticate() is deprecated. Use "auth" constructor option instead.'
  10325. )
  10326. );
  10327. if (!options) {
  10328. state.auth = false;
  10329. return;
  10330. }
  10331. switch (options.type) {
  10332. case "basic":
  10333. if (!options.username || !options.password) {
  10334. throw new Error(
  10335. "Basic authentication requires both a username and password to be set"
  10336. );
  10337. }
  10338. break;
  10339. case "oauth":
  10340. if (!options.token && !(options.key && options.secret)) {
  10341. throw new Error(
  10342. "OAuth2 authentication requires a token or key & secret to be set"
  10343. );
  10344. }
  10345. break;
  10346. case "token":
  10347. case "app":
  10348. if (!options.token) {
  10349. throw new Error("Token authentication requires a token to be set");
  10350. }
  10351. break;
  10352. default:
  10353. throw new Error(
  10354. "Invalid authentication type, must be 'basic', 'oauth', 'token' or 'app'"
  10355. );
  10356. }
  10357. state.auth = options;
  10358. }
  10359. /***/ }),
  10360. /***/ 675:
  10361. /***/ (function(module) {
  10362. module.exports = function btoa(str) {
  10363. return new Buffer(str).toString('base64')
  10364. }
  10365. /***/ }),
  10366. /***/ 692:
  10367. /***/ (function(__unusedmodule, exports) {
  10368. "use strict";
  10369. Object.defineProperty(exports, '__esModule', { value: true });
  10370. class Deprecation extends Error {
  10371. constructor(message) {
  10372. super(message); // Maintains proper stack trace (only available on V8)
  10373. /* istanbul ignore next */
  10374. if (Error.captureStackTrace) {
  10375. Error.captureStackTrace(this, this.constructor);
  10376. }
  10377. this.name = 'Deprecation';
  10378. }
  10379. }
  10380. exports.Deprecation = Deprecation;
  10381. /***/ }),
  10382. /***/ 696:
  10383. /***/ (function(module) {
  10384. "use strict";
  10385. /*!
  10386. * isobject <https://github.com/jonschlinkert/isobject>
  10387. *
  10388. * Copyright (c) 2014-2017, Jon Schlinkert.
  10389. * Released under the MIT License.
  10390. */
  10391. function isObject(val) {
  10392. return val != null && typeof val === 'object' && Array.isArray(val) === false;
  10393. }
  10394. /*!
  10395. * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
  10396. *
  10397. * Copyright (c) 2014-2017, Jon Schlinkert.
  10398. * Released under the MIT License.
  10399. */
  10400. function isObjectObject(o) {
  10401. return isObject(o) === true
  10402. && Object.prototype.toString.call(o) === '[object Object]';
  10403. }
  10404. function isPlainObject(o) {
  10405. var ctor,prot;
  10406. if (isObjectObject(o) === false) return false;
  10407. // If has modified constructor
  10408. ctor = o.constructor;
  10409. if (typeof ctor !== 'function') return false;
  10410. // If has modified prototype
  10411. prot = ctor.prototype;
  10412. if (isObjectObject(prot) === false) return false;
  10413. // If constructor does not have an Object-specific method
  10414. if (prot.hasOwnProperty('isPrototypeOf') === false) {
  10415. return false;
  10416. }
  10417. // Most likely a plain Object
  10418. return true;
  10419. }
  10420. module.exports = isPlainObject;
  10421. /***/ }),
  10422. /***/ 697:
  10423. /***/ (function(module) {
  10424. "use strict";
  10425. module.exports = (promise, onFinally) => {
  10426. onFinally = onFinally || (() => {});
  10427. return promise.then(
  10428. val => new Promise(resolve => {
  10429. resolve(onFinally());
  10430. }).then(() => val),
  10431. err => new Promise(resolve => {
  10432. resolve(onFinally());
  10433. }).then(() => {
  10434. throw err;
  10435. })
  10436. );
  10437. };
  10438. /***/ }),
  10439. /***/ 705:
  10440. /***/ (function(module) {
  10441. module.exports = {"activity":{"checkStarringRepo":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/user/starred/:owner/:repo"},"deleteRepoSubscription":{"method":"DELETE","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/subscription"},"deleteThreadSubscription":{"method":"DELETE","params":{"thread_id":{"required":true,"type":"integer"}},"url":"/notifications/threads/:thread_id/subscription"},"getRepoSubscription":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/subscription"},"getThread":{"method":"GET","params":{"thread_id":{"required":true,"type":"integer"}},"url":"/notifications/threads/:thread_id"},"getThreadSubscription":{"method":"GET","params":{"thread_id":{"required":true,"type":"integer"}},"url":"/notifications/threads/:thread_id/subscription"},"listEventsForOrg":{"method":"GET","params":{"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/users/:username/events/orgs/:org"},"listEventsForUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/users/:username/events"},"listFeeds":{"method":"GET","params":{},"url":"/feeds"},"listNotifications":{"method":"GET","params":{"all":{"type":"boolean"},"before":{"type":"string"},"page":{"type":"integer"},"participating":{"type":"boolean"},"per_page":{"type":"integer"},"since":{"type":"string"}},"url":"/notifications"},"listNotificationsForRepo":{"method":"GET","params":{"all":{"type":"boolean"},"before":{"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"participating":{"type":"boolean"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"},"since":{"type":"string"}},"url":"/repos/:owner/:repo/notifications"},"listPublicEvents":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/events"},"listPublicEventsForOrg":{"method":"GET","params":{"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/orgs/:org/events"},"listPublicEventsForRepoNetwork":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/networks/:owner/:repo/events"},"listPublicEventsForUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/users/:username/events/public"},"listReceivedEventsForUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/users/:username/received_events"},"listReceivedPublicEventsForUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/users/:username/received_events/public"},"listRepoEvents":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/events"},"listReposStarredByAuthenticatedUser":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"sort":{"enum":["created","updated"],"type":"string"}},"url":"/user/starred"},"listReposStarredByUser":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"sort":{"enum":["created","updated"],"type":"string"},"username":{"required":true,"type":"string"}},"url":"/users/:username/starred"},"listReposWatchedByUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/users/:username/subscriptions"},"listStargazersForRepo":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/stargazers"},"listWatchedReposForAuthenticatedUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/subscriptions"},"listWatchersForRepo":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/subscribers"},"markAsRead":{"method":"PUT","params":{"last_read_at":{"type":"string"}},"url":"/notifications"},"markNotificationsAsReadForRepo":{"method":"PUT","params":{"last_read_at":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/notifications"},"markThreadAsRead":{"method":"PATCH","params":{"thread_id":{"required":true,"type":"integer"}},"url":"/notifications/threads/:thread_id"},"setRepoSubscription":{"method":"PUT","params":{"ignored":{"type":"boolean"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"subscribed":{"type":"boolean"}},"url":"/repos/:owner/:repo/subscription"},"setThreadSubscription":{"method":"PUT","params":{"ignored":{"type":"boolean"},"thread_id":{"required":true,"type":"integer"}},"url":"/notifications/threads/:thread_id/subscription"},"starRepo":{"method":"PUT","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/user/starred/:owner/:repo"},"unstarRepo":{"method":"DELETE","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/user/starred/:owner/:repo"}},"apps":{"addRepoToInstallation":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"PUT","params":{"installation_id":{"required":true,"type":"integer"},"repository_id":{"required":true,"type":"integer"}},"url":"/user/installations/:installation_id/repositories/:repository_id"},"checkAccountIsAssociatedWithAny":{"method":"GET","params":{"account_id":{"required":true,"type":"integer"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/marketplace_listing/accounts/:account_id"},"checkAccountIsAssociatedWithAnyStubbed":{"method":"GET","params":{"account_id":{"required":true,"type":"integer"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/marketplace_listing/stubbed/accounts/:account_id"},"checkAuthorization":{"deprecated":"octokit.oauthAuthorizations.checkAuthorization() has been renamed to octokit.apps.checkAuthorization() (2019-11-05)","method":"GET","params":{"access_token":{"required":true,"type":"string"},"client_id":{"required":true,"type":"string"}},"url":"/applications/:client_id/tokens/:access_token"},"checkToken":{"headers":{"accept":"application/vnd.github.doctor-strange-preview+json"},"method":"POST","params":{"access_token":{"type":"string"},"client_id":{"required":true,"type":"string"}},"url":"/applications/:client_id/token"},"createContentAttachment":{"headers":{"accept":"application/vnd.github.corsair-preview+json"},"method":"POST","params":{"body":{"required":true,"type":"string"},"content_reference_id":{"required":true,"type":"integer"},"title":{"required":true,"type":"string"}},"url":"/content_references/:content_reference_id/attachments"},"createFromManifest":{"headers":{"accept":"application/vnd.github.fury-preview+json"},"method":"POST","params":{"code":{"required":true,"type":"string"}},"url":"/app-manifests/:code/conversions"},"createInstallationToken":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"POST","params":{"installation_id":{"required":true,"type":"integer"},"permissions":{"type":"object"},"repository_ids":{"type":"integer[]"}},"url":"/app/installations/:installation_id/access_tokens"},"deleteAuthorization":{"headers":{"accept":"application/vnd.github.doctor-strange-preview+json"},"method":"DELETE","params":{"access_token":{"type":"string"},"client_id":{"required":true,"type":"string"}},"url":"/applications/:client_id/grant"},"deleteInstallation":{"headers":{"accept":"application/vnd.github.gambit-preview+json,application/vnd.github.machine-man-preview+json"},"method":"DELETE","params":{"installation_id":{"required":true,"type":"integer"}},"url":"/app/installations/:installation_id"},"deleteToken":{"headers":{"accept":"application/vnd.github.doctor-strange-preview+json"},"method":"DELETE","params":{"access_token":{"type":"string"},"client_id":{"required":true,"type":"string"}},"url":"/applications/:client_id/token"},"findOrgInstallation":{"deprecated":"octokit.apps.findOrgInstallation() has been renamed to octokit.apps.getOrgInstallation() (2019-04-10)","headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"org":{"required":true,"type":"string"}},"url":"/orgs/:org/installation"},"findRepoInstallation":{"deprecated":"octokit.apps.findRepoInstallation() has been renamed to octokit.apps.getRepoInstallation() (2019-04-10)","headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/installation"},"findUserInstallation":{"deprecated":"octokit.apps.findUserInstallation() has been renamed to octokit.apps.getUserInstallation() (2019-04-10)","headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"username":{"required":true,"type":"string"}},"url":"/users/:username/installation"},"getAuthenticated":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{},"url":"/app"},"getBySlug":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"app_slug":{"required":true,"type":"string"}},"url":"/apps/:app_slug"},"getInstallation":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"installation_id":{"required":true,"type":"integer"}},"url":"/app/installations/:installation_id"},"getOrgInstallation":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"org":{"required":true,"type":"string"}},"url":"/orgs/:org/installation"},"getRepoInstallation":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/installation"},"getUserInstallation":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"username":{"required":true,"type":"string"}},"url":"/users/:username/installation"},"listAccountsUserOrOrgOnPlan":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"plan_id":{"required":true,"type":"integer"},"sort":{"enum":["created","updated"],"type":"string"}},"url":"/marketplace_listing/plans/:plan_id/accounts"},"listAccountsUserOrOrgOnPlanStubbed":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"plan_id":{"required":true,"type":"integer"},"sort":{"enum":["created","updated"],"type":"string"}},"url":"/marketplace_listing/stubbed/plans/:plan_id/accounts"},"listInstallationReposForAuthenticatedUser":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"installation_id":{"required":true,"type":"integer"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/installations/:installation_id/repositories"},"listInstallations":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/app/installations"},"listInstallationsForAuthenticatedUser":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/installations"},"listMarketplacePurchasesForAuthenticatedUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/marketplace_purchases"},"listMarketplacePurchasesForAuthenticatedUserStubbed":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/marketplace_purchases/stubbed"},"listPlans":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/marketplace_listing/plans"},"listPlansStubbed":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/marketplace_listing/stubbed/plans"},"listRepos":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/installation/repositories"},"removeRepoFromInstallation":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"DELETE","params":{"installation_id":{"required":true,"type":"integer"},"repository_id":{"required":true,"type":"integer"}},"url":"/user/installations/:installation_id/repositories/:repository_id"},"resetAuthorization":{"deprecated":"octokit.oauthAuthorizations.resetAuthorization() has been renamed to octokit.apps.resetAuthorization() (2019-11-05)","method":"POST","params":{"access_token":{"required":true,"type":"string"},"client_id":{"required":true,"type":"string"}},"url":"/applications/:client_id/tokens/:access_token"},"resetToken":{"headers":{"accept":"application/vnd.github.doctor-strange-preview+json"},"method":"PATCH","params":{"access_token":{"type":"string"},"client_id":{"required":true,"type":"string"}},"url":"/applications/:client_id/token"},"revokeAuthorizationForApplication":{"deprecated":"octokit.oauthAuthorizations.revokeAuthorizationForApplication() has been renamed to octokit.apps.revokeAuthorizationForApplication() (2019-11-05)","method":"DELETE","params":{"access_token":{"required":true,"type":"string"},"client_id":{"required":true,"type":"string"}},"url":"/applications/:client_id/tokens/:access_token"},"revokeGrantForApplication":{"deprecated":"octokit.oauthAuthorizations.revokeGrantForApplication() has been renamed to octokit.apps.revokeGrantForApplication() (2019-11-05)","method":"DELETE","params":{"access_token":{"required":true,"type":"string"},"client_id":{"required":true,"type":"string"}},"url":"/applications/:client_id/grants/:access_token"}},"checks":{"create":{"headers":{"accept":"application/vnd.github.antiope-preview+json"},"method":"POST","params":{"actions":{"type":"object[]"},"actions[].description":{"required":true,"type":"string"},"actions[].identifier":{"required":true,"type":"string"},"actions[].label":{"required":true,"type":"string"},"completed_at":{"type":"string"},"conclusion":{"enum":["success","failure","neutral","cancelled","timed_out","action_required"],"type":"string"},"details_url":{"type":"string"},"external_id":{"type":"string"},"head_sha":{"required":true,"type":"string"},"name":{"required":true,"type":"string"},"output":{"type":"object"},"output.annotations":{"type":"object[]"},"output.annotations[].annotation_level":{"enum":["notice","warning","failure"],"required":true,"type":"string"},"output.annotations[].end_column":{"type":"integer"},"output.annotations[].end_line":{"required":true,"type":"integer"},"output.annotations[].message":{"required":true,"type":"string"},"output.annotations[].path":{"required":true,"type":"string"},"output.annotations[].raw_details":{"type":"string"},"output.annotations[].start_column":{"type":"integer"},"output.annotations[].start_line":{"required":true,"type":"integer"},"output.annotations[].title":{"type":"string"},"output.images":{"type":"object[]"},"output.images[].alt":{"required":true,"type":"string"},"output.images[].caption":{"type":"string"},"output.images[].image_url":{"required":true,"type":"string"},"output.summary":{"required":true,"type":"string"},"output.text":{"type":"string"},"output.title":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"started_at":{"type":"string"},"status":{"enum":["queued","in_progress","completed"],"type":"string"}},"url":"/repos/:owner/:repo/check-runs"},"createSuite":{"headers":{"accept":"application/vnd.github.antiope-preview+json"},"method":"POST","params":{"head_sha":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/check-suites"},"get":{"headers":{"accept":"application/vnd.github.antiope-preview+json"},"method":"GET","params":{"check_run_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/check-runs/:check_run_id"},"getSuite":{"headers":{"accept":"application/vnd.github.antiope-preview+json"},"method":"GET","params":{"check_suite_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/check-suites/:check_suite_id"},"listAnnotations":{"headers":{"accept":"application/vnd.github.antiope-preview+json"},"method":"GET","params":{"check_run_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/check-runs/:check_run_id/annotations"},"listForRef":{"headers":{"accept":"application/vnd.github.antiope-preview+json"},"method":"GET","params":{"check_name":{"type":"string"},"filter":{"enum":["latest","all"],"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"status":{"enum":["queued","in_progress","completed"],"type":"string"}},"url":"/repos/:owner/:repo/commits/:ref/check-runs"},"listForSuite":{"headers":{"accept":"application/vnd.github.antiope-preview+json"},"method":"GET","params":{"check_name":{"type":"string"},"check_suite_id":{"required":true,"type":"integer"},"filter":{"enum":["latest","all"],"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"},"status":{"enum":["queued","in_progress","completed"],"type":"string"}},"url":"/repos/:owner/:repo/check-suites/:check_suite_id/check-runs"},"listSuitesForRef":{"headers":{"accept":"application/vnd.github.antiope-preview+json"},"method":"GET","params":{"app_id":{"type":"integer"},"check_name":{"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/commits/:ref/check-suites"},"rerequestSuite":{"headers":{"accept":"application/vnd.github.antiope-preview+json"},"method":"POST","params":{"check_suite_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/check-suites/:check_suite_id/rerequest"},"setSuitesPreferences":{"headers":{"accept":"application/vnd.github.antiope-preview+json"},"method":"PATCH","params":{"auto_trigger_checks":{"type":"object[]"},"auto_trigger_checks[].app_id":{"required":true,"type":"integer"},"auto_trigger_checks[].setting":{"required":true,"type":"boolean"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/check-suites/preferences"},"update":{"headers":{"accept":"application/vnd.github.antiope-preview+json"},"method":"PATCH","params":{"actions":{"type":"object[]"},"actions[].description":{"required":true,"type":"string"},"actions[].identifier":{"required":true,"type":"string"},"actions[].label":{"required":true,"type":"string"},"check_run_id":{"required":true,"type":"integer"},"completed_at":{"type":"string"},"conclusion":{"enum":["success","failure","neutral","cancelled","timed_out","action_required"],"type":"string"},"details_url":{"type":"string"},"external_id":{"type":"string"},"name":{"type":"string"},"output":{"type":"object"},"output.annotations":{"type":"object[]"},"output.annotations[].annotation_level":{"enum":["notice","warning","failure"],"required":true,"type":"string"},"output.annotations[].end_column":{"type":"integer"},"output.annotations[].end_line":{"required":true,"type":"integer"},"output.annotations[].message":{"required":true,"type":"string"},"output.annotations[].path":{"required":true,"type":"string"},"output.annotations[].raw_details":{"type":"string"},"output.annotations[].start_column":{"type":"integer"},"output.annotations[].start_line":{"required":true,"type":"integer"},"output.annotations[].title":{"type":"string"},"output.images":{"type":"object[]"},"output.images[].alt":{"required":true,"type":"string"},"output.images[].caption":{"type":"string"},"output.images[].image_url":{"required":true,"type":"string"},"output.summary":{"required":true,"type":"string"},"output.text":{"type":"string"},"output.title":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"started_at":{"type":"string"},"status":{"enum":["queued","in_progress","completed"],"type":"string"}},"url":"/repos/:owner/:repo/check-runs/:check_run_id"}},"codesOfConduct":{"getConductCode":{"headers":{"accept":"application/vnd.github.scarlet-witch-preview+json"},"method":"GET","params":{"key":{"required":true,"type":"string"}},"url":"/codes_of_conduct/:key"},"getForRepo":{"headers":{"accept":"application/vnd.github.scarlet-witch-preview+json"},"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/community/code_of_conduct"},"listConductCodes":{"headers":{"accept":"application/vnd.github.scarlet-witch-preview+json"},"method":"GET","params":{},"url":"/codes_of_conduct"}},"emojis":{"get":{"method":"GET","params":{},"url":"/emojis"}},"gists":{"checkIsStarred":{"method":"GET","params":{"gist_id":{"required":true,"type":"string"}},"url":"/gists/:gist_id/star"},"create":{"method":"POST","params":{"description":{"type":"string"},"files":{"required":true,"type":"object"},"files.content":{"type":"string"},"public":{"type":"boolean"}},"url":"/gists"},"createComment":{"method":"POST","params":{"body":{"required":true,"type":"string"},"gist_id":{"required":true,"type":"string"}},"url":"/gists/:gist_id/comments"},"delete":{"method":"DELETE","params":{"gist_id":{"required":true,"type":"string"}},"url":"/gists/:gist_id"},"deleteComment":{"method":"DELETE","params":{"comment_id":{"required":true,"type":"integer"},"gist_id":{"required":true,"type":"string"}},"url":"/gists/:gist_id/comments/:comment_id"},"fork":{"method":"POST","params":{"gist_id":{"required":true,"type":"string"}},"url":"/gists/:gist_id/forks"},"get":{"method":"GET","params":{"gist_id":{"required":true,"type":"string"}},"url":"/gists/:gist_id"},"getComment":{"method":"GET","params":{"comment_id":{"required":true,"type":"integer"},"gist_id":{"required":true,"type":"string"}},"url":"/gists/:gist_id/comments/:comment_id"},"getRevision":{"method":"GET","params":{"gist_id":{"required":true,"type":"string"},"sha":{"required":true,"type":"string"}},"url":"/gists/:gist_id/:sha"},"list":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"since":{"type":"string"}},"url":"/gists"},"listComments":{"method":"GET","params":{"gist_id":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/gists/:gist_id/comments"},"listCommits":{"method":"GET","params":{"gist_id":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/gists/:gist_id/commits"},"listForks":{"method":"GET","params":{"gist_id":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/gists/:gist_id/forks"},"listPublic":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"since":{"type":"string"}},"url":"/gists/public"},"listPublicForUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"since":{"type":"string"},"username":{"required":true,"type":"string"}},"url":"/users/:username/gists"},"listStarred":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"since":{"type":"string"}},"url":"/gists/starred"},"star":{"method":"PUT","params":{"gist_id":{"required":true,"type":"string"}},"url":"/gists/:gist_id/star"},"unstar":{"method":"DELETE","params":{"gist_id":{"required":true,"type":"string"}},"url":"/gists/:gist_id/star"},"update":{"method":"PATCH","params":{"description":{"type":"string"},"files":{"type":"object"},"files.content":{"type":"string"},"files.filename":{"type":"string"},"gist_id":{"required":true,"type":"string"}},"url":"/gists/:gist_id"},"updateComment":{"method":"PATCH","params":{"body":{"required":true,"type":"string"},"comment_id":{"required":true,"type":"integer"},"gist_id":{"required":true,"type":"string"}},"url":"/gists/:gist_id/comments/:comment_id"}},"git":{"createBlob":{"method":"POST","params":{"content":{"required":true,"type":"string"},"encoding":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/blobs"},"createCommit":{"method":"POST","params":{"author":{"type":"object"},"author.date":{"type":"string"},"author.email":{"type":"string"},"author.name":{"type":"string"},"committer":{"type":"object"},"committer.date":{"type":"string"},"committer.email":{"type":"string"},"committer.name":{"type":"string"},"message":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"parents":{"required":true,"type":"string[]"},"repo":{"required":true,"type":"string"},"signature":{"type":"string"},"tree":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/commits"},"createRef":{"method":"POST","params":{"owner":{"required":true,"type":"string"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"sha":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/refs"},"createTag":{"method":"POST","params":{"message":{"required":true,"type":"string"},"object":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"tag":{"required":true,"type":"string"},"tagger":{"type":"object"},"tagger.date":{"type":"string"},"tagger.email":{"type":"string"},"tagger.name":{"type":"string"},"type":{"enum":["commit","tree","blob"],"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/tags"},"createTree":{"method":"POST","params":{"base_tree":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"tree":{"required":true,"type":"object[]"},"tree[].content":{"type":"string"},"tree[].mode":{"enum":["100644","100755","040000","160000","120000"],"type":"string"},"tree[].path":{"type":"string"},"tree[].sha":{"allowNull":true,"type":"string"},"tree[].type":{"enum":["blob","tree","commit"],"type":"string"}},"url":"/repos/:owner/:repo/git/trees"},"deleteRef":{"method":"DELETE","params":{"owner":{"required":true,"type":"string"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/refs/:ref"},"getBlob":{"method":"GET","params":{"file_sha":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/blobs/:file_sha"},"getCommit":{"method":"GET","params":{"commit_sha":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/commits/:commit_sha"},"getRef":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/ref/:ref"},"getTag":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"tag_sha":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/tags/:tag_sha"},"getTree":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"recursive":{"enum":["1"],"type":"integer"},"repo":{"required":true,"type":"string"},"tree_sha":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/trees/:tree_sha"},"listMatchingRefs":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/matching-refs/:ref"},"listRefs":{"method":"GET","params":{"namespace":{"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/refs/:namespace"},"updateRef":{"method":"PATCH","params":{"force":{"type":"boolean"},"owner":{"required":true,"type":"string"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"sha":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/refs/:ref"}},"gitignore":{"getTemplate":{"method":"GET","params":{"name":{"required":true,"type":"string"}},"url":"/gitignore/templates/:name"},"listTemplates":{"method":"GET","params":{},"url":"/gitignore/templates"}},"interactions":{"addOrUpdateRestrictionsForOrg":{"headers":{"accept":"application/vnd.github.sombra-preview+json"},"method":"PUT","params":{"limit":{"enum":["existing_users","contributors_only","collaborators_only"],"required":true,"type":"string"},"org":{"required":true,"type":"string"}},"url":"/orgs/:org/interaction-limits"},"addOrUpdateRestrictionsForRepo":{"headers":{"accept":"application/vnd.github.sombra-preview+json"},"method":"PUT","params":{"limit":{"enum":["existing_users","contributors_only","collaborators_only"],"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/interaction-limits"},"getRestrictionsForOrg":{"headers":{"accept":"application/vnd.github.sombra-preview+json"},"method":"GET","params":{"org":{"required":true,"type":"string"}},"url":"/orgs/:org/interaction-limits"},"getRestrictionsForRepo":{"headers":{"accept":"application/vnd.github.sombra-preview+json"},"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/interaction-limits"},"removeRestrictionsForOrg":{"headers":{"accept":"application/vnd.github.sombra-preview+json"},"method":"DELETE","params":{"org":{"required":true,"type":"string"}},"url":"/orgs/:org/interaction-limits"},"removeRestrictionsForRepo":{"headers":{"accept":"application/vnd.github.sombra-preview+json"},"method":"DELETE","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/interaction-limits"}},"issues":{"addAssignees":{"method":"POST","params":{"assignees":{"type":"string[]"},"issue_number":{"required":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/assignees"},"addLabels":{"method":"POST","params":{"issue_number":{"required":true,"type":"integer"},"labels":{"required":true,"type":"string[]"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/labels"},"checkAssignee":{"method":"GET","params":{"assignee":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/assignees/:assignee"},"create":{"method":"POST","params":{"assignee":{"type":"string"},"assignees":{"type":"string[]"},"body":{"type":"string"},"labels":{"type":"string[]"},"milestone":{"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"title":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues"},"createComment":{"method":"POST","params":{"body":{"required":true,"type":"string"},"issue_number":{"required":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/comments"},"createLabel":{"method":"POST","params":{"color":{"required":true,"type":"string"},"description":{"type":"string"},"name":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/labels"},"createMilestone":{"method":"POST","params":{"description":{"type":"string"},"due_on":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"state":{"enum":["open","closed"],"type":"string"},"title":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/milestones"},"deleteComment":{"method":"DELETE","params":{"comment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/comments/:comment_id"},"deleteLabel":{"method":"DELETE","params":{"name":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/labels/:name"},"deleteMilestone":{"method":"DELETE","params":{"milestone_number":{"required":true,"type":"integer"},"number":{"alias":"milestone_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/milestones/:milestone_number"},"get":{"method":"GET","params":{"issue_number":{"required":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number"},"getComment":{"method":"GET","params":{"comment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/comments/:comment_id"},"getEvent":{"method":"GET","params":{"event_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/events/:event_id"},"getLabel":{"method":"GET","params":{"name":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/labels/:name"},"getMilestone":{"method":"GET","params":{"milestone_number":{"required":true,"type":"integer"},"number":{"alias":"milestone_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/milestones/:milestone_number"},"list":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"filter":{"enum":["assigned","created","mentioned","subscribed","all"],"type":"string"},"labels":{"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"since":{"type":"string"},"sort":{"enum":["created","updated","comments"],"type":"string"},"state":{"enum":["open","closed","all"],"type":"string"}},"url":"/issues"},"listAssignees":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/assignees"},"listComments":{"method":"GET","params":{"issue_number":{"required":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"},"since":{"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/comments"},"listCommentsForRepo":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"since":{"type":"string"},"sort":{"enum":["created","updated"],"type":"string"}},"url":"/repos/:owner/:repo/issues/comments"},"listEvents":{"method":"GET","params":{"issue_number":{"required":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/events"},"listEventsForRepo":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/events"},"listEventsForTimeline":{"headers":{"accept":"application/vnd.github.mockingbird-preview+json"},"method":"GET","params":{"issue_number":{"required":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/timeline"},"listForAuthenticatedUser":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"filter":{"enum":["assigned","created","mentioned","subscribed","all"],"type":"string"},"labels":{"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"since":{"type":"string"},"sort":{"enum":["created","updated","comments"],"type":"string"},"state":{"enum":["open","closed","all"],"type":"string"}},"url":"/user/issues"},"listForOrg":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"filter":{"enum":["assigned","created","mentioned","subscribed","all"],"type":"string"},"labels":{"type":"string"},"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"since":{"type":"string"},"sort":{"enum":["created","updated","comments"],"type":"string"},"state":{"enum":["open","closed","all"],"type":"string"}},"url":"/orgs/:org/issues"},"listForRepo":{"method":"GET","params":{"assignee":{"type":"string"},"creator":{"type":"string"},"direction":{"enum":["asc","desc"],"type":"string"},"labels":{"type":"string"},"mentioned":{"type":"string"},"milestone":{"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"},"since":{"type":"string"},"sort":{"enum":["created","updated","comments"],"type":"string"},"state":{"enum":["open","closed","all"],"type":"string"}},"url":"/repos/:owner/:repo/issues"},"listLabelsForMilestone":{"method":"GET","params":{"milestone_number":{"required":true,"type":"integer"},"number":{"alias":"milestone_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/milestones/:milestone_number/labels"},"listLabelsForRepo":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/labels"},"listLabelsOnIssue":{"method":"GET","params":{"issue_number":{"required":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/labels"},"listMilestonesForRepo":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"},"sort":{"enum":["due_on","completeness"],"type":"string"},"state":{"enum":["open","closed","all"],"type":"string"}},"url":"/repos/:owner/:repo/milestones"},"lock":{"method":"PUT","params":{"issue_number":{"required":true,"type":"integer"},"lock_reason":{"enum":["off-topic","too heated","resolved","spam"],"type":"string"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/lock"},"removeAssignees":{"method":"DELETE","params":{"assignees":{"type":"string[]"},"issue_number":{"required":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/assignees"},"removeLabel":{"method":"DELETE","params":{"issue_number":{"required":true,"type":"integer"},"name":{"required":true,"type":"string"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/labels/:name"},"removeLabels":{"method":"DELETE","params":{"issue_number":{"required":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/labels"},"replaceLabels":{"method":"PUT","params":{"issue_number":{"required":true,"type":"integer"},"labels":{"type":"string[]"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/labels"},"unlock":{"method":"DELETE","params":{"issue_number":{"required":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/lock"},"update":{"method":"PATCH","params":{"assignee":{"type":"string"},"assignees":{"type":"string[]"},"body":{"type":"string"},"issue_number":{"required":true,"type":"integer"},"labels":{"type":"string[]"},"milestone":{"allowNull":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"state":{"enum":["open","closed"],"type":"string"},"title":{"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number"},"updateComment":{"method":"PATCH","params":{"body":{"required":true,"type":"string"},"comment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/comments/:comment_id"},"updateLabel":{"method":"PATCH","params":{"color":{"type":"string"},"current_name":{"required":true,"type":"string"},"description":{"type":"string"},"name":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/labels/:current_name"},"updateMilestone":{"method":"PATCH","params":{"description":{"type":"string"},"due_on":{"type":"string"},"milestone_number":{"required":true,"type":"integer"},"number":{"alias":"milestone_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"state":{"enum":["open","closed"],"type":"string"},"title":{"type":"string"}},"url":"/repos/:owner/:repo/milestones/:milestone_number"}},"licenses":{"get":{"method":"GET","params":{"license":{"required":true,"type":"string"}},"url":"/licenses/:license"},"getForRepo":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/license"},"list":{"deprecated":"octokit.licenses.list() has been renamed to octokit.licenses.listCommonlyUsed() (2019-03-05)","method":"GET","params":{},"url":"/licenses"},"listCommonlyUsed":{"method":"GET","params":{},"url":"/licenses"}},"markdown":{"render":{"method":"POST","params":{"context":{"type":"string"},"mode":{"enum":["markdown","gfm"],"type":"string"},"text":{"required":true,"type":"string"}},"url":"/markdown"},"renderRaw":{"headers":{"content-type":"text/plain; charset=utf-8"},"method":"POST","params":{"data":{"mapTo":"data","required":true,"type":"string"}},"url":"/markdown/raw"}},"meta":{"get":{"method":"GET","params":{},"url":"/meta"}},"migrations":{"cancelImport":{"headers":{"accept":"application/vnd.github.barred-rock-preview+json"},"method":"DELETE","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/import"},"deleteArchiveForAuthenticatedUser":{"headers":{"accept":"application/vnd.github.wyandotte-preview+json"},"method":"DELETE","params":{"migration_id":{"required":true,"type":"integer"}},"url":"/user/migrations/:migration_id/archive"},"deleteArchiveForOrg":{"headers":{"accept":"application/vnd.github.wyandotte-preview+json"},"method":"DELETE","params":{"migration_id":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"}},"url":"/orgs/:org/migrations/:migration_id/archive"},"getArchiveForAuthenticatedUser":{"headers":{"accept":"application/vnd.github.wyandotte-preview+json"},"method":"GET","params":{"migration_id":{"required":true,"type":"integer"}},"url":"/user/migrations/:migration_id/archive"},"getArchiveForOrg":{"headers":{"accept":"application/vnd.github.wyandotte-preview+json"},"method":"GET","params":{"migration_id":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"}},"url":"/orgs/:org/migrations/:migration_id/archive"},"getCommitAuthors":{"headers":{"accept":"application/vnd.github.barred-rock-preview+json"},"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"since":{"type":"string"}},"url":"/repos/:owner/:repo/import/authors"},"getImportProgress":{"headers":{"accept":"application/vnd.github.barred-rock-preview+json"},"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/import"},"getLargeFiles":{"headers":{"accept":"application/vnd.github.barred-rock-preview+json"},"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/import/large_files"},"getStatusForAuthenticatedUser":{"headers":{"accept":"application/vnd.github.wyandotte-preview+json"},"method":"GET","params":{"migration_id":{"required":true,"type":"integer"}},"url":"/user/migrations/:migration_id"},"getStatusForOrg":{"headers":{"accept":"application/vnd.github.wyandotte-preview+json"},"method":"GET","params":{"migration_id":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"}},"url":"/orgs/:org/migrations/:migration_id"},"listForAuthenticatedUser":{"headers":{"accept":"application/vnd.github.wyandotte-preview+json"},"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/migrations"},"listForOrg":{"headers":{"accept":"application/vnd.github.wyandotte-preview+json"},"method":"GET","params":{"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/orgs/:org/migrations"},"mapCommitAuthor":{"headers":{"accept":"application/vnd.github.barred-rock-preview+json"},"method":"PATCH","params":{"author_id":{"required":true,"type":"integer"},"email":{"type":"string"},"name":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/import/authors/:author_id"},"setLfsPreference":{"headers":{"accept":"application/vnd.github.barred-rock-preview+json"},"method":"PATCH","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"use_lfs":{"enum":["opt_in","opt_out"],"required":true,"type":"string"}},"url":"/repos/:owner/:repo/import/lfs"},"startForAuthenticatedUser":{"method":"POST","params":{"exclude_attachments":{"type":"boolean"},"lock_repositories":{"type":"boolean"},"repositories":{"required":true,"type":"string[]"}},"url":"/user/migrations"},"startForOrg":{"method":"POST","params":{"exclude_attachments":{"type":"boolean"},"lock_repositories":{"type":"boolean"},"org":{"required":true,"type":"string"},"repositories":{"required":true,"type":"string[]"}},"url":"/orgs/:org/migrations"},"startImport":{"headers":{"accept":"application/vnd.github.barred-rock-preview+json"},"method":"PUT","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"tfvc_project":{"type":"string"},"vcs":{"enum":["subversion","git","mercurial","tfvc"],"type":"string"},"vcs_password":{"type":"string"},"vcs_url":{"required":true,"type":"string"},"vcs_username":{"type":"string"}},"url":"/repos/:owner/:repo/import"},"unlockRepoForAuthenticatedUser":{"headers":{"accept":"application/vnd.github.wyandotte-preview+json"},"method":"DELETE","params":{"migration_id":{"required":true,"type":"integer"},"repo_name":{"required":true,"type":"string"}},"url":"/user/migrations/:migration_id/repos/:repo_name/lock"},"unlockRepoForOrg":{"headers":{"accept":"application/vnd.github.wyandotte-preview+json"},"method":"DELETE","params":{"migration_id":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"},"repo_name":{"required":true,"type":"string"}},"url":"/orgs/:org/migrations/:migration_id/repos/:repo_name/lock"},"updateImport":{"headers":{"accept":"application/vnd.github.barred-rock-preview+json"},"method":"PATCH","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"vcs_password":{"type":"string"},"vcs_username":{"type":"string"}},"url":"/repos/:owner/:repo/import"}},"oauthAuthorizations":{"checkAuthorization":{"deprecated":"octokit.oauthAuthorizations.checkAuthorization() has been renamed to octokit.apps.checkAuthorization() (2019-11-05)","method":"GET","params":{"access_token":{"required":true,"type":"string"},"client_id":{"required":true,"type":"string"}},"url":"/applications/:client_id/tokens/:access_token"},"createAuthorization":{"deprecated":"octokit.oauthAuthorizations.createAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#create-a-new-authorization","method":"POST","params":{"client_id":{"type":"string"},"client_secret":{"type":"string"},"fingerprint":{"type":"string"},"note":{"required":true,"type":"string"},"note_url":{"type":"string"},"scopes":{"type":"string[]"}},"url":"/authorizations"},"deleteAuthorization":{"deprecated":"octokit.oauthAuthorizations.deleteAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#delete-an-authorization","method":"DELETE","params":{"authorization_id":{"required":true,"type":"integer"}},"url":"/authorizations/:authorization_id"},"deleteGrant":{"deprecated":"octokit.oauthAuthorizations.deleteGrant() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#delete-a-grant","method":"DELETE","params":{"grant_id":{"required":true,"type":"integer"}},"url":"/applications/grants/:grant_id"},"getAuthorization":{"deprecated":"octokit.oauthAuthorizations.getAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#get-a-single-authorization","method":"GET","params":{"authorization_id":{"required":true,"type":"integer"}},"url":"/authorizations/:authorization_id"},"getGrant":{"deprecated":"octokit.oauthAuthorizations.getGrant() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#get-a-single-grant","method":"GET","params":{"grant_id":{"required":true,"type":"integer"}},"url":"/applications/grants/:grant_id"},"getOrCreateAuthorizationForApp":{"deprecated":"octokit.oauthAuthorizations.getOrCreateAuthorizationForApp() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#get-or-create-an-authorization-for-a-specific-app","method":"PUT","params":{"client_id":{"required":true,"type":"string"},"client_secret":{"required":true,"type":"string"},"fingerprint":{"type":"string"},"note":{"type":"string"},"note_url":{"type":"string"},"scopes":{"type":"string[]"}},"url":"/authorizations/clients/:client_id"},"getOrCreateAuthorizationForAppAndFingerprint":{"deprecated":"octokit.oauthAuthorizations.getOrCreateAuthorizationForAppAndFingerprint() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#get-or-create-an-authorization-for-a-specific-app-and-fingerprint","method":"PUT","params":{"client_id":{"required":true,"type":"string"},"client_secret":{"required":true,"type":"string"},"fingerprint":{"required":true,"type":"string"},"note":{"type":"string"},"note_url":{"type":"string"},"scopes":{"type":"string[]"}},"url":"/authorizations/clients/:client_id/:fingerprint"},"getOrCreateAuthorizationForAppFingerprint":{"deprecated":"octokit.oauthAuthorizations.getOrCreateAuthorizationForAppFingerprint() has been renamed to octokit.oauthAuthorizations.getOrCreateAuthorizationForAppAndFingerprint() (2018-12-27)","method":"PUT","params":{"client_id":{"required":true,"type":"string"},"client_secret":{"required":true,"type":"string"},"fingerprint":{"required":true,"type":"string"},"note":{"type":"string"},"note_url":{"type":"string"},"scopes":{"type":"string[]"}},"url":"/authorizations/clients/:client_id/:fingerprint"},"listAuthorizations":{"deprecated":"octokit.oauthAuthorizations.listAuthorizations() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#list-your-authorizations","method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/authorizations"},"listGrants":{"deprecated":"octokit.oauthAuthorizations.listGrants() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#list-your-grants","method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/applications/grants"},"resetAuthorization":{"deprecated":"octokit.oauthAuthorizations.resetAuthorization() has been renamed to octokit.apps.resetAuthorization() (2019-11-05)","method":"POST","params":{"access_token":{"required":true,"type":"string"},"client_id":{"required":true,"type":"string"}},"url":"/applications/:client_id/tokens/:access_token"},"revokeAuthorizationForApplication":{"deprecated":"octokit.oauthAuthorizations.revokeAuthorizationForApplication() has been renamed to octokit.apps.revokeAuthorizationForApplication() (2019-11-05)","method":"DELETE","params":{"access_token":{"required":true,"type":"string"},"client_id":{"required":true,"type":"string"}},"url":"/applications/:client_id/tokens/:access_token"},"revokeGrantForApplication":{"deprecated":"octokit.oauthAuthorizations.revokeGrantForApplication() has been renamed to octokit.apps.revokeGrantForApplication() (2019-11-05)","method":"DELETE","params":{"access_token":{"required":true,"type":"string"},"client_id":{"required":true,"type":"string"}},"url":"/applications/:client_id/grants/:access_token"},"updateAuthorization":{"deprecated":"octokit.oauthAuthorizations.updateAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#update-an-existing-authorization","method":"PATCH","params":{"add_scopes":{"type":"string[]"},"authorization_id":{"required":true,"type":"integer"},"fingerprint":{"type":"string"},"note":{"type":"string"},"note_url":{"type":"string"},"remove_scopes":{"type":"string[]"},"scopes":{"type":"string[]"}},"url":"/authorizations/:authorization_id"}},"orgs":{"addOrUpdateMembership":{"method":"PUT","params":{"org":{"required":true,"type":"string"},"role":{"enum":["admin","member"],"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/memberships/:username"},"blockUser":{"method":"PUT","params":{"org":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/blocks/:username"},"checkBlockedUser":{"method":"GET","params":{"org":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/blocks/:username"},"checkMembership":{"method":"GET","params":{"org":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/members/:username"},"checkPublicMembership":{"method":"GET","params":{"org":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/public_members/:username"},"concealMembership":{"method":"DELETE","params":{"org":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/public_members/:username"},"convertMemberToOutsideCollaborator":{"method":"PUT","params":{"org":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/outside_collaborators/:username"},"createHook":{"method":"POST","params":{"active":{"type":"boolean"},"config":{"required":true,"type":"object"},"config.content_type":{"type":"string"},"config.insecure_ssl":{"type":"string"},"config.secret":{"type":"string"},"config.url":{"required":true,"type":"string"},"events":{"type":"string[]"},"name":{"required":true,"type":"string"},"org":{"required":true,"type":"string"}},"url":"/orgs/:org/hooks"},"createInvitation":{"method":"POST","params":{"email":{"type":"string"},"invitee_id":{"type":"integer"},"org":{"required":true,"type":"string"},"role":{"enum":["admin","direct_member","billing_manager"],"type":"string"},"team_ids":{"type":"integer[]"}},"url":"/orgs/:org/invitations"},"deleteHook":{"method":"DELETE","params":{"hook_id":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"}},"url":"/orgs/:org/hooks/:hook_id"},"get":{"method":"GET","params":{"org":{"required":true,"type":"string"}},"url":"/orgs/:org"},"getHook":{"method":"GET","params":{"hook_id":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"}},"url":"/orgs/:org/hooks/:hook_id"},"getMembership":{"method":"GET","params":{"org":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/memberships/:username"},"getMembershipForAuthenticatedUser":{"method":"GET","params":{"org":{"required":true,"type":"string"}},"url":"/user/memberships/orgs/:org"},"list":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"since":{"type":"string"}},"url":"/organizations"},"listBlockedUsers":{"method":"GET","params":{"org":{"required":true,"type":"string"}},"url":"/orgs/:org/blocks"},"listForAuthenticatedUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/orgs"},"listForUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/users/:username/orgs"},"listHooks":{"method":"GET","params":{"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/orgs/:org/hooks"},"listInstallations":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/orgs/:org/installations"},"listInvitationTeams":{"method":"GET","params":{"invitation_id":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/orgs/:org/invitations/:invitation_id/teams"},"listMembers":{"method":"GET","params":{"filter":{"enum":["2fa_disabled","all"],"type":"string"},"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"role":{"enum":["all","admin","member"],"type":"string"}},"url":"/orgs/:org/members"},"listMemberships":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"state":{"enum":["active","pending"],"type":"string"}},"url":"/user/memberships/orgs"},"listOutsideCollaborators":{"method":"GET","params":{"filter":{"enum":["2fa_disabled","all"],"type":"string"},"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/orgs/:org/outside_collaborators"},"listPendingInvitations":{"method":"GET","params":{"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/orgs/:org/invitations"},"listPublicMembers":{"method":"GET","params":{"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/orgs/:org/public_members"},"pingHook":{"method":"POST","params":{"hook_id":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"}},"url":"/orgs/:org/hooks/:hook_id/pings"},"publicizeMembership":{"method":"PUT","params":{"org":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/public_members/:username"},"removeMember":{"method":"DELETE","params":{"org":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/members/:username"},"removeMembership":{"method":"DELETE","params":{"org":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/memberships/:username"},"removeOutsideCollaborator":{"method":"DELETE","params":{"org":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/outside_collaborators/:username"},"unblockUser":{"method":"DELETE","params":{"org":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/blocks/:username"},"update":{"method":"PATCH","params":{"billing_email":{"type":"string"},"company":{"type":"string"},"default_repository_permission":{"enum":["read","write","admin","none"],"type":"string"},"description":{"type":"string"},"email":{"type":"string"},"has_organization_projects":{"type":"boolean"},"has_repository_projects":{"type":"boolean"},"location":{"type":"string"},"members_allowed_repository_creation_type":{"enum":["all","private","none"],"type":"string"},"members_can_create_repositories":{"type":"boolean"},"name":{"type":"string"},"org":{"required":true,"type":"string"}},"url":"/orgs/:org"},"updateHook":{"method":"PATCH","params":{"active":{"type":"boolean"},"config":{"type":"object"},"config.content_type":{"type":"string"},"config.insecure_ssl":{"type":"string"},"config.secret":{"type":"string"},"config.url":{"required":true,"type":"string"},"events":{"type":"string[]"},"hook_id":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"}},"url":"/orgs/:org/hooks/:hook_id"},"updateMembership":{"method":"PATCH","params":{"org":{"required":true,"type":"string"},"state":{"enum":["active"],"required":true,"type":"string"}},"url":"/user/memberships/orgs/:org"}},"projects":{"addCollaborator":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"PUT","params":{"permission":{"enum":["read","write","admin"],"type":"string"},"project_id":{"required":true,"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/projects/:project_id/collaborators/:username"},"createCard":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"POST","params":{"column_id":{"required":true,"type":"integer"},"content_id":{"type":"integer"},"content_type":{"type":"string"},"note":{"type":"string"}},"url":"/projects/columns/:column_id/cards"},"createColumn":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"POST","params":{"name":{"required":true,"type":"string"},"project_id":{"required":true,"type":"integer"}},"url":"/projects/:project_id/columns"},"createForAuthenticatedUser":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"POST","params":{"body":{"type":"string"},"name":{"required":true,"type":"string"}},"url":"/user/projects"},"createForOrg":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"POST","params":{"body":{"type":"string"},"name":{"required":true,"type":"string"},"org":{"required":true,"type":"string"}},"url":"/orgs/:org/projects"},"createForRepo":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"POST","params":{"body":{"type":"string"},"name":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/projects"},"delete":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"DELETE","params":{"project_id":{"required":true,"type":"integer"}},"url":"/projects/:project_id"},"deleteCard":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"DELETE","params":{"card_id":{"required":true,"type":"integer"}},"url":"/projects/columns/cards/:card_id"},"deleteColumn":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"DELETE","params":{"column_id":{"required":true,"type":"integer"}},"url":"/projects/columns/:column_id"},"get":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"project_id":{"required":true,"type":"integer"}},"url":"/projects/:project_id"},"getCard":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"card_id":{"required":true,"type":"integer"}},"url":"/projects/columns/cards/:card_id"},"getColumn":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"column_id":{"required":true,"type":"integer"}},"url":"/projects/columns/:column_id"},"listCards":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"archived_state":{"enum":["all","archived","not_archived"],"type":"string"},"column_id":{"required":true,"type":"integer"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/projects/columns/:column_id/cards"},"listCollaborators":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"affiliation":{"enum":["outside","direct","all"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"project_id":{"required":true,"type":"integer"}},"url":"/projects/:project_id/collaborators"},"listColumns":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"project_id":{"required":true,"type":"integer"}},"url":"/projects/:project_id/columns"},"listForOrg":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"state":{"enum":["open","closed","all"],"type":"string"}},"url":"/orgs/:org/projects"},"listForRepo":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"},"state":{"enum":["open","closed","all"],"type":"string"}},"url":"/repos/:owner/:repo/projects"},"listForUser":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"state":{"enum":["open","closed","all"],"type":"string"},"username":{"required":true,"type":"string"}},"url":"/users/:username/projects"},"moveCard":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"POST","params":{"card_id":{"required":true,"type":"integer"},"column_id":{"type":"integer"},"position":{"required":true,"type":"string","validation":"^(top|bottom|after:\\d+)$"}},"url":"/projects/columns/cards/:card_id/moves"},"moveColumn":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"POST","params":{"column_id":{"required":true,"type":"integer"},"position":{"required":true,"type":"string","validation":"^(first|last|after:\\d+)$"}},"url":"/projects/columns/:column_id/moves"},"removeCollaborator":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"DELETE","params":{"project_id":{"required":true,"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/projects/:project_id/collaborators/:username"},"reviewUserPermissionLevel":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"project_id":{"required":true,"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/projects/:project_id/collaborators/:username/permission"},"update":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"PATCH","params":{"body":{"type":"string"},"name":{"type":"string"},"organization_permission":{"type":"string"},"private":{"type":"boolean"},"project_id":{"required":true,"type":"integer"},"state":{"enum":["open","closed"],"type":"string"}},"url":"/projects/:project_id"},"updateCard":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"PATCH","params":{"archived":{"type":"boolean"},"card_id":{"required":true,"type":"integer"},"note":{"type":"string"}},"url":"/projects/columns/cards/:card_id"},"updateColumn":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"PATCH","params":{"column_id":{"required":true,"type":"integer"},"name":{"required":true,"type":"string"}},"url":"/projects/columns/:column_id"}},"pulls":{"checkIfMerged":{"method":"GET","params":{"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number/merge"},"create":{"method":"POST","params":{"base":{"required":true,"type":"string"},"body":{"type":"string"},"draft":{"type":"boolean"},"head":{"required":true,"type":"string"},"maintainer_can_modify":{"type":"boolean"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"title":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls"},"createComment":{"method":"POST","params":{"body":{"required":true,"type":"string"},"commit_id":{"required":true,"type":"string"},"in_reply_to":{"deprecated":true,"description":"The comment ID to reply to. **Note**: This must be the ID of a top-level comment, not a reply to that comment. Replies to replies are not supported.","type":"integer"},"line":{"type":"integer"},"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"path":{"required":true,"type":"string"},"position":{"type":"integer"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"side":{"enum":["LEFT","RIGHT"],"type":"string"},"start_line":{"type":"integer"},"start_side":{"enum":["LEFT","RIGHT","side"],"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number/comments"},"createCommentReply":{"deprecated":"octokit.pulls.createCommentReply() has been renamed to octokit.pulls.createComment() (2019-09-09)","method":"POST","params":{"body":{"required":true,"type":"string"},"commit_id":{"required":true,"type":"string"},"in_reply_to":{"deprecated":true,"description":"The comment ID to reply to. **Note**: This must be the ID of a top-level comment, not a reply to that comment. Replies to replies are not supported.","type":"integer"},"line":{"type":"integer"},"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"path":{"required":true,"type":"string"},"position":{"type":"integer"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"side":{"enum":["LEFT","RIGHT"],"type":"string"},"start_line":{"type":"integer"},"start_side":{"enum":["LEFT","RIGHT","side"],"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number/comments"},"createFromIssue":{"deprecated":"octokit.pulls.createFromIssue() is deprecated, see https://developer.github.com/v3/pulls/#create-a-pull-request","method":"POST","params":{"base":{"required":true,"type":"string"},"draft":{"type":"boolean"},"head":{"required":true,"type":"string"},"issue":{"required":true,"type":"integer"},"maintainer_can_modify":{"type":"boolean"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls"},"createReview":{"method":"POST","params":{"body":{"type":"string"},"comments":{"type":"object[]"},"comments[].body":{"required":true,"type":"string"},"comments[].path":{"required":true,"type":"string"},"comments[].position":{"required":true,"type":"integer"},"commit_id":{"type":"string"},"event":{"enum":["APPROVE","REQUEST_CHANGES","COMMENT"],"type":"string"},"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number/reviews"},"createReviewCommentReply":{"method":"POST","params":{"body":{"required":true,"type":"string"},"comment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number/comments/:comment_id/replies"},"createReviewRequest":{"method":"POST","params":{"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"reviewers":{"type":"string[]"},"team_reviewers":{"type":"string[]"}},"url":"/repos/:owner/:repo/pulls/:pull_number/requested_reviewers"},"deleteComment":{"method":"DELETE","params":{"comment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/comments/:comment_id"},"deletePendingReview":{"method":"DELETE","params":{"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"review_id":{"required":true,"type":"integer"}},"url":"/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id"},"deleteReviewRequest":{"method":"DELETE","params":{"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"reviewers":{"type":"string[]"},"team_reviewers":{"type":"string[]"}},"url":"/repos/:owner/:repo/pulls/:pull_number/requested_reviewers"},"dismissReview":{"method":"PUT","params":{"message":{"required":true,"type":"string"},"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"review_id":{"required":true,"type":"integer"}},"url":"/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/dismissals"},"get":{"method":"GET","params":{"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number"},"getComment":{"method":"GET","params":{"comment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/comments/:comment_id"},"getCommentsForReview":{"method":"GET","params":{"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"review_id":{"required":true,"type":"integer"}},"url":"/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/comments"},"getReview":{"method":"GET","params":{"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"review_id":{"required":true,"type":"integer"}},"url":"/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id"},"list":{"method":"GET","params":{"base":{"type":"string"},"direction":{"enum":["asc","desc"],"type":"string"},"head":{"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"},"sort":{"enum":["created","updated","popularity","long-running"],"type":"string"},"state":{"enum":["open","closed","all"],"type":"string"}},"url":"/repos/:owner/:repo/pulls"},"listComments":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"since":{"type":"string"},"sort":{"enum":["created","updated"],"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number/comments"},"listCommentsForRepo":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"},"since":{"type":"string"},"sort":{"enum":["created","updated"],"type":"string"}},"url":"/repos/:owner/:repo/pulls/comments"},"listCommits":{"method":"GET","params":{"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number/commits"},"listFiles":{"method":"GET","params":{"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number/files"},"listReviewRequests":{"method":"GET","params":{"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number/requested_reviewers"},"listReviews":{"method":"GET","params":{"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number/reviews"},"merge":{"method":"PUT","params":{"commit_message":{"type":"string"},"commit_title":{"type":"string"},"merge_method":{"enum":["merge","squash","rebase"],"type":"string"},"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"sha":{"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number/merge"},"submitReview":{"method":"POST","params":{"body":{"type":"string"},"event":{"enum":["APPROVE","REQUEST_CHANGES","COMMENT"],"required":true,"type":"string"},"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"review_id":{"required":true,"type":"integer"}},"url":"/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/events"},"update":{"method":"PATCH","params":{"base":{"type":"string"},"body":{"type":"string"},"maintainer_can_modify":{"type":"boolean"},"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"state":{"enum":["open","closed"],"type":"string"},"title":{"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number"},"updateBranch":{"headers":{"accept":"application/vnd.github.lydian-preview+json"},"method":"PUT","params":{"expected_head_sha":{"type":"string"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number/update-branch"},"updateComment":{"method":"PATCH","params":{"body":{"required":true,"type":"string"},"comment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/comments/:comment_id"},"updateReview":{"method":"PUT","params":{"body":{"required":true,"type":"string"},"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"review_id":{"required":true,"type":"integer"}},"url":"/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id"}},"rateLimit":{"get":{"method":"GET","params":{},"url":"/rate_limit"}},"reactions":{"createForCommitComment":{"headers":{"accept":"application/vnd.github.squirrel-girl-preview+json"},"method":"POST","params":{"comment_id":{"required":true,"type":"integer"},"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/comments/:comment_id/reactions"},"createForIssue":{"headers":{"accept":"application/vnd.github.squirrel-girl-preview+json"},"method":"POST","params":{"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"required":true,"type":"string"},"issue_number":{"required":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/reactions"},"createForIssueComment":{"headers":{"accept":"application/vnd.github.squirrel-girl-preview+json"},"method":"POST","params":{"comment_id":{"required":true,"type":"integer"},"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/comments/:comment_id/reactions"},"createForPullRequestReviewComment":{"headers":{"accept":"application/vnd.github.squirrel-girl-preview+json"},"method":"POST","params":{"comment_id":{"required":true,"type":"integer"},"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/comments/:comment_id/reactions"},"createForTeamDiscussion":{"headers":{"accept":"application/vnd.github.echo-preview+json,application/vnd.github.squirrel-girl-preview+json"},"method":"POST","params":{"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"required":true,"type":"string"},"discussion_number":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number/reactions"},"createForTeamDiscussionComment":{"headers":{"accept":"application/vnd.github.echo-preview+json,application/vnd.github.squirrel-girl-preview+json"},"method":"POST","params":{"comment_number":{"required":true,"type":"integer"},"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"required":true,"type":"string"},"discussion_number":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions"},"delete":{"headers":{"accept":"application/vnd.github.echo-preview+json,application/vnd.github.squirrel-girl-preview+json"},"method":"DELETE","params":{"reaction_id":{"required":true,"type":"integer"}},"url":"/reactions/:reaction_id"},"listForCommitComment":{"headers":{"accept":"application/vnd.github.squirrel-girl-preview+json"},"method":"GET","params":{"comment_id":{"required":true,"type":"integer"},"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/comments/:comment_id/reactions"},"listForIssue":{"headers":{"accept":"application/vnd.github.squirrel-girl-preview+json"},"method":"GET","params":{"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"type":"string"},"issue_number":{"required":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/reactions"},"listForIssueComment":{"headers":{"accept":"application/vnd.github.squirrel-girl-preview+json"},"method":"GET","params":{"comment_id":{"required":true,"type":"integer"},"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/comments/:comment_id/reactions"},"listForPullRequestReviewComment":{"headers":{"accept":"application/vnd.github.squirrel-girl-preview+json"},"method":"GET","params":{"comment_id":{"required":true,"type":"integer"},"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/comments/:comment_id/reactions"},"listForTeamDiscussion":{"headers":{"accept":"application/vnd.github.echo-preview+json,application/vnd.github.squirrel-girl-preview+json"},"method":"GET","params":{"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"type":"string"},"discussion_number":{"required":true,"type":"integer"},"page":{"type":"integer"},"per_page":{"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number/reactions"},"listForTeamDiscussionComment":{"headers":{"accept":"application/vnd.github.echo-preview+json,application/vnd.github.squirrel-girl-preview+json"},"method":"GET","params":{"comment_number":{"required":true,"type":"integer"},"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"type":"string"},"discussion_number":{"required":true,"type":"integer"},"page":{"type":"integer"},"per_page":{"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions"}},"repos":{"acceptInvitation":{"method":"PATCH","params":{"invitation_id":{"required":true,"type":"integer"}},"url":"/user/repository_invitations/:invitation_id"},"addCollaborator":{"method":"PUT","params":{"owner":{"required":true,"type":"string"},"permission":{"enum":["pull","push","admin"],"type":"string"},"repo":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/collaborators/:username"},"addDeployKey":{"method":"POST","params":{"key":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"read_only":{"type":"boolean"},"repo":{"required":true,"type":"string"},"title":{"type":"string"}},"url":"/repos/:owner/:repo/keys"},"addProtectedBranchAdminEnforcement":{"method":"POST","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/enforce_admins"},"addProtectedBranchAppRestrictions":{"method":"POST","params":{"apps":{"mapTo":"data","required":true,"type":"string[]"},"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"},"addProtectedBranchRequiredSignatures":{"headers":{"accept":"application/vnd.github.zzzax-preview+json"},"method":"POST","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_signatures"},"addProtectedBranchRequiredStatusChecksContexts":{"method":"POST","params":{"branch":{"required":true,"type":"string"},"contexts":{"mapTo":"data","required":true,"type":"string[]"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"},"addProtectedBranchTeamRestrictions":{"method":"POST","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"teams":{"mapTo":"data","required":true,"type":"string[]"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"},"addProtectedBranchUserRestrictions":{"method":"POST","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"users":{"mapTo":"data","required":true,"type":"string[]"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/users"},"checkCollaborator":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/collaborators/:username"},"checkVulnerabilityAlerts":{"headers":{"accept":"application/vnd.github.dorian-preview+json"},"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/vulnerability-alerts"},"compareCommits":{"method":"GET","params":{"base":{"required":true,"type":"string"},"head":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/compare/:base...:head"},"createCommitComment":{"method":"POST","params":{"body":{"required":true,"type":"string"},"commit_sha":{"required":true,"type":"string"},"line":{"type":"integer"},"owner":{"required":true,"type":"string"},"path":{"type":"string"},"position":{"type":"integer"},"repo":{"required":true,"type":"string"},"sha":{"alias":"commit_sha","deprecated":true,"type":"string"}},"url":"/repos/:owner/:repo/commits/:commit_sha/comments"},"createDeployment":{"method":"POST","params":{"auto_merge":{"type":"boolean"},"description":{"type":"string"},"environment":{"type":"string"},"owner":{"required":true,"type":"string"},"payload":{"type":"string"},"production_environment":{"type":"boolean"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"required_contexts":{"type":"string[]"},"task":{"type":"string"},"transient_environment":{"type":"boolean"}},"url":"/repos/:owner/:repo/deployments"},"createDeploymentStatus":{"method":"POST","params":{"auto_inactive":{"type":"boolean"},"deployment_id":{"required":true,"type":"integer"},"description":{"type":"string"},"environment":{"enum":["production","staging","qa"],"type":"string"},"environment_url":{"type":"string"},"log_url":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"state":{"enum":["error","failure","inactive","in_progress","queued","pending","success"],"required":true,"type":"string"},"target_url":{"type":"string"}},"url":"/repos/:owner/:repo/deployments/:deployment_id/statuses"},"createDispatchEvent":{"headers":{"accept":"application/vnd.github.everest-preview+json"},"method":"POST","params":{"client_payload":{"type":"object"},"event_type":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/dispatches"},"createFile":{"deprecated":"octokit.repos.createFile() has been renamed to octokit.repos.createOrUpdateFile() (2019-06-07)","method":"PUT","params":{"author":{"type":"object"},"author.email":{"required":true,"type":"string"},"author.name":{"required":true,"type":"string"},"branch":{"type":"string"},"committer":{"type":"object"},"committer.email":{"required":true,"type":"string"},"committer.name":{"required":true,"type":"string"},"content":{"required":true,"type":"string"},"message":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"path":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"sha":{"type":"string"}},"url":"/repos/:owner/:repo/contents/:path"},"createForAuthenticatedUser":{"method":"POST","params":{"allow_merge_commit":{"type":"boolean"},"allow_rebase_merge":{"type":"boolean"},"allow_squash_merge":{"type":"boolean"},"auto_init":{"type":"boolean"},"description":{"type":"string"},"gitignore_template":{"type":"string"},"has_issues":{"type":"boolean"},"has_projects":{"type":"boolean"},"has_wiki":{"type":"boolean"},"homepage":{"type":"string"},"is_template":{"type":"boolean"},"license_template":{"type":"string"},"name":{"required":true,"type":"string"},"private":{"type":"boolean"},"team_id":{"type":"integer"}},"url":"/user/repos"},"createFork":{"method":"POST","params":{"organization":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/forks"},"createHook":{"method":"POST","params":{"active":{"type":"boolean"},"config":{"required":true,"type":"object"},"config.content_type":{"type":"string"},"config.insecure_ssl":{"type":"string"},"config.secret":{"type":"string"},"config.url":{"required":true,"type":"string"},"events":{"type":"string[]"},"name":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/hooks"},"createInOrg":{"method":"POST","params":{"allow_merge_commit":{"type":"boolean"},"allow_rebase_merge":{"type":"boolean"},"allow_squash_merge":{"type":"boolean"},"auto_init":{"type":"boolean"},"description":{"type":"string"},"gitignore_template":{"type":"string"},"has_issues":{"type":"boolean"},"has_projects":{"type":"boolean"},"has_wiki":{"type":"boolean"},"homepage":{"type":"string"},"is_template":{"type":"boolean"},"license_template":{"type":"string"},"name":{"required":true,"type":"string"},"org":{"required":true,"type":"string"},"private":{"type":"boolean"},"team_id":{"type":"integer"}},"url":"/orgs/:org/repos"},"createOrUpdateFile":{"method":"PUT","params":{"author":{"type":"object"},"author.email":{"required":true,"type":"string"},"author.name":{"required":true,"type":"string"},"branch":{"type":"string"},"committer":{"type":"object"},"committer.email":{"required":true,"type":"string"},"committer.name":{"required":true,"type":"string"},"content":{"required":true,"type":"string"},"message":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"path":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"sha":{"type":"string"}},"url":"/repos/:owner/:repo/contents/:path"},"createRelease":{"method":"POST","params":{"body":{"type":"string"},"draft":{"type":"boolean"},"name":{"type":"string"},"owner":{"required":true,"type":"string"},"prerelease":{"type":"boolean"},"repo":{"required":true,"type":"string"},"tag_name":{"required":true,"type":"string"},"target_commitish":{"type":"string"}},"url":"/repos/:owner/:repo/releases"},"createStatus":{"method":"POST","params":{"context":{"type":"string"},"description":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"sha":{"required":true,"type":"string"},"state":{"enum":["error","failure","pending","success"],"required":true,"type":"string"},"target_url":{"type":"string"}},"url":"/repos/:owner/:repo/statuses/:sha"},"createUsingTemplate":{"headers":{"accept":"application/vnd.github.baptiste-preview+json"},"method":"POST","params":{"description":{"type":"string"},"name":{"required":true,"type":"string"},"owner":{"type":"string"},"private":{"type":"boolean"},"template_owner":{"required":true,"type":"string"},"template_repo":{"required":true,"type":"string"}},"url":"/repos/:template_owner/:template_repo/generate"},"declineInvitation":{"method":"DELETE","params":{"invitation_id":{"required":true,"type":"integer"}},"url":"/user/repository_invitations/:invitation_id"},"delete":{"method":"DELETE","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo"},"deleteCommitComment":{"method":"DELETE","params":{"comment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/comments/:comment_id"},"deleteDownload":{"method":"DELETE","params":{"download_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/downloads/:download_id"},"deleteFile":{"method":"DELETE","params":{"author":{"type":"object"},"author.email":{"type":"string"},"author.name":{"type":"string"},"branch":{"type":"string"},"committer":{"type":"object"},"committer.email":{"type":"string"},"committer.name":{"type":"string"},"message":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"path":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"sha":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/contents/:path"},"deleteHook":{"method":"DELETE","params":{"hook_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/hooks/:hook_id"},"deleteInvitation":{"method":"DELETE","params":{"invitation_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/invitations/:invitation_id"},"deleteRelease":{"method":"DELETE","params":{"owner":{"required":true,"type":"string"},"release_id":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/releases/:release_id"},"deleteReleaseAsset":{"method":"DELETE","params":{"asset_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/releases/assets/:asset_id"},"disableAutomatedSecurityFixes":{"headers":{"accept":"application/vnd.github.london-preview+json"},"method":"DELETE","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/automated-security-fixes"},"disablePagesSite":{"headers":{"accept":"application/vnd.github.switcheroo-preview+json"},"method":"DELETE","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pages"},"disableVulnerabilityAlerts":{"headers":{"accept":"application/vnd.github.dorian-preview+json"},"method":"DELETE","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/vulnerability-alerts"},"enableAutomatedSecurityFixes":{"headers":{"accept":"application/vnd.github.london-preview+json"},"method":"PUT","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/automated-security-fixes"},"enablePagesSite":{"headers":{"accept":"application/vnd.github.switcheroo-preview+json"},"method":"POST","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"source":{"type":"object"},"source.branch":{"enum":["master","gh-pages"],"type":"string"},"source.path":{"type":"string"}},"url":"/repos/:owner/:repo/pages"},"enableVulnerabilityAlerts":{"headers":{"accept":"application/vnd.github.dorian-preview+json"},"method":"PUT","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/vulnerability-alerts"},"get":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo"},"getAppsWithAccessToProtectedBranch":{"method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"},"getArchiveLink":{"method":"GET","params":{"archive_format":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/:archive_format/:ref"},"getBranch":{"method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch"},"getBranchProtection":{"method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection"},"getClones":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"per":{"enum":["day","week"],"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/traffic/clones"},"getCodeFrequencyStats":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/stats/code_frequency"},"getCollaboratorPermissionLevel":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/collaborators/:username/permission"},"getCombinedStatusForRef":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/commits/:ref/status"},"getCommit":{"method":"GET","params":{"commit_sha":{"alias":"ref","deprecated":true,"type":"string"},"owner":{"required":true,"type":"string"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"sha":{"alias":"ref","deprecated":true,"type":"string"}},"url":"/repos/:owner/:repo/commits/:ref"},"getCommitActivityStats":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/stats/commit_activity"},"getCommitComment":{"method":"GET","params":{"comment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/comments/:comment_id"},"getCommitRefSha":{"deprecated":"octokit.repos.getCommitRefSha() is deprecated, see https://developer.github.com/v3/repos/commits/#get-a-single-commit","headers":{"accept":"application/vnd.github.v3.sha"},"method":"GET","params":{"owner":{"required":true,"type":"string"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/commits/:ref"},"getContents":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"path":{"required":true,"type":"string"},"ref":{"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/contents/:path"},"getContributorsStats":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/stats/contributors"},"getDeployKey":{"method":"GET","params":{"key_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/keys/:key_id"},"getDeployment":{"method":"GET","params":{"deployment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/deployments/:deployment_id"},"getDeploymentStatus":{"method":"GET","params":{"deployment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"status_id":{"required":true,"type":"integer"}},"url":"/repos/:owner/:repo/deployments/:deployment_id/statuses/:status_id"},"getDownload":{"method":"GET","params":{"download_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/downloads/:download_id"},"getHook":{"method":"GET","params":{"hook_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/hooks/:hook_id"},"getLatestPagesBuild":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pages/builds/latest"},"getLatestRelease":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/releases/latest"},"getPages":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pages"},"getPagesBuild":{"method":"GET","params":{"build_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pages/builds/:build_id"},"getParticipationStats":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/stats/participation"},"getProtectedBranchAdminEnforcement":{"method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/enforce_admins"},"getProtectedBranchPullRequestReviewEnforcement":{"method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews"},"getProtectedBranchRequiredSignatures":{"headers":{"accept":"application/vnd.github.zzzax-preview+json"},"method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_signatures"},"getProtectedBranchRequiredStatusChecks":{"method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_status_checks"},"getProtectedBranchRestrictions":{"method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions"},"getPunchCardStats":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/stats/punch_card"},"getReadme":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"ref":{"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/readme"},"getRelease":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"release_id":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/releases/:release_id"},"getReleaseAsset":{"method":"GET","params":{"asset_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/releases/assets/:asset_id"},"getReleaseByTag":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"tag":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/releases/tags/:tag"},"getTeamsWithAccessToProtectedBranch":{"method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"},"getTopPaths":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/traffic/popular/paths"},"getTopReferrers":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/traffic/popular/referrers"},"getUsersWithAccessToProtectedBranch":{"method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/users"},"getViews":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"per":{"enum":["day","week"],"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/traffic/views"},"list":{"method":"GET","params":{"affiliation":{"type":"string"},"direction":{"enum":["asc","desc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"sort":{"enum":["created","updated","pushed","full_name"],"type":"string"},"type":{"enum":["all","owner","public","private","member"],"type":"string"},"visibility":{"enum":["all","public","private"],"type":"string"}},"url":"/user/repos"},"listAppsWithAccessToProtectedBranch":{"deprecated":"octokit.repos.listAppsWithAccessToProtectedBranch() has been renamed to octokit.repos.getAppsWithAccessToProtectedBranch() (2019-09-13)","method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"},"listAssetsForRelease":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"release_id":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/releases/:release_id/assets"},"listBranches":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"protected":{"type":"boolean"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches"},"listBranchesForHeadCommit":{"headers":{"accept":"application/vnd.github.groot-preview+json"},"method":"GET","params":{"commit_sha":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/commits/:commit_sha/branches-where-head"},"listCollaborators":{"method":"GET","params":{"affiliation":{"enum":["outside","direct","all"],"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/collaborators"},"listCommentsForCommit":{"method":"GET","params":{"commit_sha":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"ref":{"alias":"commit_sha","deprecated":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/commits/:commit_sha/comments"},"listCommitComments":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/comments"},"listCommits":{"method":"GET","params":{"author":{"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"path":{"type":"string"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"},"sha":{"type":"string"},"since":{"type":"string"},"until":{"type":"string"}},"url":"/repos/:owner/:repo/commits"},"listContributors":{"method":"GET","params":{"anon":{"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/contributors"},"listDeployKeys":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/keys"},"listDeploymentStatuses":{"method":"GET","params":{"deployment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/deployments/:deployment_id/statuses"},"listDeployments":{"method":"GET","params":{"environment":{"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"ref":{"type":"string"},"repo":{"required":true,"type":"string"},"sha":{"type":"string"},"task":{"type":"string"}},"url":"/repos/:owner/:repo/deployments"},"listDownloads":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/downloads"},"listForOrg":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"sort":{"enum":["created","updated","pushed","full_name"],"type":"string"},"type":{"enum":["all","public","private","forks","sources","member"],"type":"string"}},"url":"/orgs/:org/repos"},"listForUser":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"sort":{"enum":["created","updated","pushed","full_name"],"type":"string"},"type":{"enum":["all","owner","member"],"type":"string"},"username":{"required":true,"type":"string"}},"url":"/users/:username/repos"},"listForks":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"},"sort":{"enum":["newest","oldest","stargazers"],"type":"string"}},"url":"/repos/:owner/:repo/forks"},"listHooks":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/hooks"},"listInvitations":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/invitations"},"listInvitationsForAuthenticatedUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/repository_invitations"},"listLanguages":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/languages"},"listPagesBuilds":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pages/builds"},"listProtectedBranchRequiredStatusChecksContexts":{"method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"},"listProtectedBranchTeamRestrictions":{"deprecated":"octokit.repos.listProtectedBranchTeamRestrictions() has been renamed to octokit.repos.getTeamsWithAccessToProtectedBranch() (2019-09-09)","method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"},"listProtectedBranchUserRestrictions":{"deprecated":"octokit.repos.listProtectedBranchUserRestrictions() has been renamed to octokit.repos.getUsersWithAccessToProtectedBranch() (2019-09-09)","method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/users"},"listPublic":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"since":{"type":"string"}},"url":"/repositories"},"listPullRequestsAssociatedWithCommit":{"headers":{"accept":"application/vnd.github.groot-preview+json"},"method":"GET","params":{"commit_sha":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/commits/:commit_sha/pulls"},"listReleases":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/releases"},"listStatusesForRef":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/commits/:ref/statuses"},"listTags":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/tags"},"listTeams":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/teams"},"listTeamsWithAccessToProtectedBranch":{"deprecated":"octokit.repos.listTeamsWithAccessToProtectedBranch() has been renamed to octokit.repos.getTeamsWithAccessToProtectedBranch() (2019-09-13)","method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"},"listTopics":{"headers":{"accept":"application/vnd.github.mercy-preview+json"},"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/topics"},"listUsersWithAccessToProtectedBranch":{"deprecated":"octokit.repos.listUsersWithAccessToProtectedBranch() has been renamed to octokit.repos.getUsersWithAccessToProtectedBranch() (2019-09-13)","method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/users"},"merge":{"method":"POST","params":{"base":{"required":true,"type":"string"},"commit_message":{"type":"string"},"head":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/merges"},"pingHook":{"method":"POST","params":{"hook_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/hooks/:hook_id/pings"},"removeBranchProtection":{"method":"DELETE","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection"},"removeCollaborator":{"method":"DELETE","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/collaborators/:username"},"removeDeployKey":{"method":"DELETE","params":{"key_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/keys/:key_id"},"removeProtectedBranchAdminEnforcement":{"method":"DELETE","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/enforce_admins"},"removeProtectedBranchAppRestrictions":{"method":"DELETE","params":{"apps":{"mapTo":"data","required":true,"type":"string[]"},"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"},"removeProtectedBranchPullRequestReviewEnforcement":{"method":"DELETE","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews"},"removeProtectedBranchRequiredSignatures":{"headers":{"accept":"application/vnd.github.zzzax-preview+json"},"method":"DELETE","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_signatures"},"removeProtectedBranchRequiredStatusChecks":{"method":"DELETE","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_status_checks"},"removeProtectedBranchRequiredStatusChecksContexts":{"method":"DELETE","params":{"branch":{"required":true,"type":"string"},"contexts":{"mapTo":"data","required":true,"type":"string[]"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"},"removeProtectedBranchRestrictions":{"method":"DELETE","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions"},"removeProtectedBranchTeamRestrictions":{"method":"DELETE","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"teams":{"mapTo":"data","required":true,"type":"string[]"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"},"removeProtectedBranchUserRestrictions":{"method":"DELETE","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"users":{"mapTo":"data","required":true,"type":"string[]"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/users"},"replaceProtectedBranchAppRestrictions":{"method":"PUT","params":{"apps":{"mapTo":"data","required":true,"type":"string[]"},"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"},"replaceProtectedBranchRequiredStatusChecksContexts":{"method":"PUT","params":{"branch":{"required":true,"type":"string"},"contexts":{"mapTo":"data","required":true,"type":"string[]"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"},"replaceProtectedBranchTeamRestrictions":{"method":"PUT","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"teams":{"mapTo":"data","required":true,"type":"string[]"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"},"replaceProtectedBranchUserRestrictions":{"method":"PUT","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"users":{"mapTo":"data","required":true,"type":"string[]"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/users"},"replaceTopics":{"headers":{"accept":"application/vnd.github.mercy-preview+json"},"method":"PUT","params":{"names":{"required":true,"type":"string[]"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/topics"},"requestPageBuild":{"method":"POST","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pages/builds"},"retrieveCommunityProfileMetrics":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/community/profile"},"testPushHook":{"method":"POST","params":{"hook_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/hooks/:hook_id/tests"},"transfer":{"headers":{"accept":"application/vnd.github.nightshade-preview+json"},"method":"POST","params":{"new_owner":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"team_ids":{"type":"integer[]"}},"url":"/repos/:owner/:repo/transfer"},"update":{"method":"PATCH","params":{"allow_merge_commit":{"type":"boolean"},"allow_rebase_merge":{"type":"boolean"},"allow_squash_merge":{"type":"boolean"},"archived":{"type":"boolean"},"default_branch":{"type":"string"},"description":{"type":"string"},"has_issues":{"type":"boolean"},"has_projects":{"type":"boolean"},"has_wiki":{"type":"boolean"},"homepage":{"type":"string"},"is_template":{"type":"boolean"},"name":{"type":"string"},"owner":{"required":true,"type":"string"},"private":{"type":"boolean"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo"},"updateBranchProtection":{"method":"PUT","params":{"branch":{"required":true,"type":"string"},"enforce_admins":{"allowNull":true,"required":true,"type":"boolean"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"required_pull_request_reviews":{"allowNull":true,"required":true,"type":"object"},"required_pull_request_reviews.dismiss_stale_reviews":{"type":"boolean"},"required_pull_request_reviews.dismissal_restrictions":{"type":"object"},"required_pull_request_reviews.dismissal_restrictions.teams":{"type":"string[]"},"required_pull_request_reviews.dismissal_restrictions.users":{"type":"string[]"},"required_pull_request_reviews.require_code_owner_reviews":{"type":"boolean"},"required_pull_request_reviews.required_approving_review_count":{"type":"integer"},"required_status_checks":{"allowNull":true,"required":true,"type":"object"},"required_status_checks.contexts":{"required":true,"type":"string[]"},"required_status_checks.strict":{"required":true,"type":"boolean"},"restrictions":{"allowNull":true,"required":true,"type":"object"},"restrictions.apps":{"type":"string[]"},"restrictions.teams":{"required":true,"type":"string[]"},"restrictions.users":{"required":true,"type":"string[]"}},"url":"/repos/:owner/:repo/branches/:branch/protection"},"updateCommitComment":{"method":"PATCH","params":{"body":{"required":true,"type":"string"},"comment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/comments/:comment_id"},"updateFile":{"deprecated":"octokit.repos.updateFile() has been renamed to octokit.repos.createOrUpdateFile() (2019-06-07)","method":"PUT","params":{"author":{"type":"object"},"author.email":{"required":true,"type":"string"},"author.name":{"required":true,"type":"string"},"branch":{"type":"string"},"committer":{"type":"object"},"committer.email":{"required":true,"type":"string"},"committer.name":{"required":true,"type":"string"},"content":{"required":true,"type":"string"},"message":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"path":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"sha":{"type":"string"}},"url":"/repos/:owner/:repo/contents/:path"},"updateHook":{"method":"PATCH","params":{"active":{"type":"boolean"},"add_events":{"type":"string[]"},"config":{"type":"object"},"config.content_type":{"type":"string"},"config.insecure_ssl":{"type":"string"},"config.secret":{"type":"string"},"config.url":{"required":true,"type":"string"},"events":{"type":"string[]"},"hook_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"remove_events":{"type":"string[]"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/hooks/:hook_id"},"updateInformationAboutPagesSite":{"method":"PUT","params":{"cname":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"source":{"enum":["\"gh-pages\"","\"master\"","\"master /docs\""],"type":"string"}},"url":"/repos/:owner/:repo/pages"},"updateInvitation":{"method":"PATCH","params":{"invitation_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"permissions":{"enum":["read","write","admin"],"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/invitations/:invitation_id"},"updateProtectedBranchPullRequestReviewEnforcement":{"method":"PATCH","params":{"branch":{"required":true,"type":"string"},"dismiss_stale_reviews":{"type":"boolean"},"dismissal_restrictions":{"type":"object"},"dismissal_restrictions.teams":{"type":"string[]"},"dismissal_restrictions.users":{"type":"string[]"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"require_code_owner_reviews":{"type":"boolean"},"required_approving_review_count":{"type":"integer"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews"},"updateProtectedBranchRequiredStatusChecks":{"method":"PATCH","params":{"branch":{"required":true,"type":"string"},"contexts":{"type":"string[]"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"strict":{"type":"boolean"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_status_checks"},"updateRelease":{"method":"PATCH","params":{"body":{"type":"string"},"draft":{"type":"boolean"},"name":{"type":"string"},"owner":{"required":true,"type":"string"},"prerelease":{"type":"boolean"},"release_id":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"tag_name":{"type":"string"},"target_commitish":{"type":"string"}},"url":"/repos/:owner/:repo/releases/:release_id"},"updateReleaseAsset":{"method":"PATCH","params":{"asset_id":{"required":true,"type":"integer"},"label":{"type":"string"},"name":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/releases/assets/:asset_id"},"uploadReleaseAsset":{"method":"POST","params":{"file":{"mapTo":"data","required":true,"type":"string | object"},"headers":{"required":true,"type":"object"},"headers.content-length":{"required":true,"type":"integer"},"headers.content-type":{"required":true,"type":"string"},"label":{"type":"string"},"name":{"required":true,"type":"string"},"url":{"required":true,"type":"string"}},"url":":url"}},"search":{"code":{"method":"GET","params":{"order":{"enum":["desc","asc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"q":{"required":true,"type":"string"},"sort":{"enum":["indexed"],"type":"string"}},"url":"/search/code"},"commits":{"headers":{"accept":"application/vnd.github.cloak-preview+json"},"method":"GET","params":{"order":{"enum":["desc","asc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"q":{"required":true,"type":"string"},"sort":{"enum":["author-date","committer-date"],"type":"string"}},"url":"/search/commits"},"issues":{"deprecated":"octokit.search.issues() has been renamed to octokit.search.issuesAndPullRequests() (2018-12-27)","method":"GET","params":{"order":{"enum":["desc","asc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"q":{"required":true,"type":"string"},"sort":{"enum":["comments","reactions","reactions-+1","reactions--1","reactions-smile","reactions-thinking_face","reactions-heart","reactions-tada","interactions","created","updated"],"type":"string"}},"url":"/search/issues"},"issuesAndPullRequests":{"method":"GET","params":{"order":{"enum":["desc","asc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"q":{"required":true,"type":"string"},"sort":{"enum":["comments","reactions","reactions-+1","reactions--1","reactions-smile","reactions-thinking_face","reactions-heart","reactions-tada","interactions","created","updated"],"type":"string"}},"url":"/search/issues"},"labels":{"method":"GET","params":{"order":{"enum":["desc","asc"],"type":"string"},"q":{"required":true,"type":"string"},"repository_id":{"required":true,"type":"integer"},"sort":{"enum":["created","updated"],"type":"string"}},"url":"/search/labels"},"repos":{"method":"GET","params":{"order":{"enum":["desc","asc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"q":{"required":true,"type":"string"},"sort":{"enum":["stars","forks","help-wanted-issues","updated"],"type":"string"}},"url":"/search/repositories"},"topics":{"method":"GET","params":{"q":{"required":true,"type":"string"}},"url":"/search/topics"},"users":{"method":"GET","params":{"order":{"enum":["desc","asc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"q":{"required":true,"type":"string"},"sort":{"enum":["followers","repositories","joined"],"type":"string"}},"url":"/search/users"}},"teams":{"addMember":{"deprecated":"octokit.teams.addMember() is deprecated, see https://developer.github.com/v3/teams/members/#add-team-member","method":"PUT","params":{"team_id":{"required":true,"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/teams/:team_id/members/:username"},"addOrUpdateMembership":{"method":"PUT","params":{"role":{"enum":["member","maintainer"],"type":"string"},"team_id":{"required":true,"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/teams/:team_id/memberships/:username"},"addOrUpdateProject":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"PUT","params":{"permission":{"enum":["read","write","admin"],"type":"string"},"project_id":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/projects/:project_id"},"addOrUpdateRepo":{"method":"PUT","params":{"owner":{"required":true,"type":"string"},"permission":{"enum":["pull","push","admin"],"type":"string"},"repo":{"required":true,"type":"string"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/repos/:owner/:repo"},"checkManagesRepo":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/repos/:owner/:repo"},"create":{"method":"POST","params":{"description":{"type":"string"},"maintainers":{"type":"string[]"},"name":{"required":true,"type":"string"},"org":{"required":true,"type":"string"},"parent_team_id":{"type":"integer"},"permission":{"enum":["pull","push","admin"],"type":"string"},"privacy":{"enum":["secret","closed"],"type":"string"},"repo_names":{"type":"string[]"}},"url":"/orgs/:org/teams"},"createDiscussion":{"headers":{"accept":"application/vnd.github.echo-preview+json"},"method":"POST","params":{"body":{"required":true,"type":"string"},"private":{"type":"boolean"},"team_id":{"required":true,"type":"integer"},"title":{"required":true,"type":"string"}},"url":"/teams/:team_id/discussions"},"createDiscussionComment":{"headers":{"accept":"application/vnd.github.echo-preview+json"},"method":"POST","params":{"body":{"required":true,"type":"string"},"discussion_number":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number/comments"},"delete":{"method":"DELETE","params":{"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id"},"deleteDiscussion":{"headers":{"accept":"application/vnd.github.echo-preview+json"},"method":"DELETE","params":{"discussion_number":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number"},"deleteDiscussionComment":{"headers":{"accept":"application/vnd.github.echo-preview+json"},"method":"DELETE","params":{"comment_number":{"required":true,"type":"integer"},"discussion_number":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number/comments/:comment_number"},"get":{"method":"GET","params":{"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id"},"getByName":{"method":"GET","params":{"org":{"required":true,"type":"string"},"team_slug":{"required":true,"type":"string"}},"url":"/orgs/:org/teams/:team_slug"},"getDiscussion":{"headers":{"accept":"application/vnd.github.echo-preview+json"},"method":"GET","params":{"discussion_number":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number"},"getDiscussionComment":{"headers":{"accept":"application/vnd.github.echo-preview+json"},"method":"GET","params":{"comment_number":{"required":true,"type":"integer"},"discussion_number":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number/comments/:comment_number"},"getMember":{"deprecated":"octokit.teams.getMember() is deprecated, see https://developer.github.com/v3/teams/members/#get-team-member","method":"GET","params":{"team_id":{"required":true,"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/teams/:team_id/members/:username"},"getMembership":{"method":"GET","params":{"team_id":{"required":true,"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/teams/:team_id/memberships/:username"},"list":{"method":"GET","params":{"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/orgs/:org/teams"},"listChild":{"headers":{"accept":"application/vnd.github.hellcat-preview+json"},"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/teams"},"listDiscussionComments":{"headers":{"accept":"application/vnd.github.echo-preview+json"},"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"discussion_number":{"required":true,"type":"integer"},"page":{"type":"integer"},"per_page":{"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number/comments"},"listDiscussions":{"headers":{"accept":"application/vnd.github.echo-preview+json"},"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions"},"listForAuthenticatedUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/teams"},"listMembers":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"role":{"enum":["member","maintainer","all"],"type":"string"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/members"},"listPendingInvitations":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/invitations"},"listProjects":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/projects"},"listRepos":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/repos"},"removeMember":{"deprecated":"octokit.teams.removeMember() is deprecated, see https://developer.github.com/v3/teams/members/#remove-team-member","method":"DELETE","params":{"team_id":{"required":true,"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/teams/:team_id/members/:username"},"removeMembership":{"method":"DELETE","params":{"team_id":{"required":true,"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/teams/:team_id/memberships/:username"},"removeProject":{"method":"DELETE","params":{"project_id":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/projects/:project_id"},"removeRepo":{"method":"DELETE","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/repos/:owner/:repo"},"reviewProject":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"project_id":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/projects/:project_id"},"update":{"method":"PATCH","params":{"description":{"type":"string"},"name":{"required":true,"type":"string"},"parent_team_id":{"type":"integer"},"permission":{"enum":["pull","push","admin"],"type":"string"},"privacy":{"enum":["secret","closed"],"type":"string"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id"},"updateDiscussion":{"headers":{"accept":"application/vnd.github.echo-preview+json"},"method":"PATCH","params":{"body":{"type":"string"},"discussion_number":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"},"title":{"type":"string"}},"url":"/teams/:team_id/discussions/:discussion_number"},"updateDiscussionComment":{"headers":{"accept":"application/vnd.github.echo-preview+json"},"method":"PATCH","params":{"body":{"required":true,"type":"string"},"comment_number":{"required":true,"type":"integer"},"discussion_number":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number/comments/:comment_number"}},"users":{"addEmails":{"method":"POST","params":{"emails":{"required":true,"type":"string[]"}},"url":"/user/emails"},"block":{"method":"PUT","params":{"username":{"required":true,"type":"string"}},"url":"/user/blocks/:username"},"checkBlocked":{"method":"GET","params":{"username":{"required":true,"type":"string"}},"url":"/user/blocks/:username"},"checkFollowing":{"method":"GET","params":{"username":{"required":true,"type":"string"}},"url":"/user/following/:username"},"checkFollowingForUser":{"method":"GET","params":{"target_user":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/users/:username/following/:target_user"},"createGpgKey":{"method":"POST","params":{"armored_public_key":{"type":"string"}},"url":"/user/gpg_keys"},"createPublicKey":{"method":"POST","params":{"key":{"type":"string"},"title":{"type":"string"}},"url":"/user/keys"},"deleteEmails":{"method":"DELETE","params":{"emails":{"required":true,"type":"string[]"}},"url":"/user/emails"},"deleteGpgKey":{"method":"DELETE","params":{"gpg_key_id":{"required":true,"type":"integer"}},"url":"/user/gpg_keys/:gpg_key_id"},"deletePublicKey":{"method":"DELETE","params":{"key_id":{"required":true,"type":"integer"}},"url":"/user/keys/:key_id"},"follow":{"method":"PUT","params":{"username":{"required":true,"type":"string"}},"url":"/user/following/:username"},"getAuthenticated":{"method":"GET","params":{},"url":"/user"},"getByUsername":{"method":"GET","params":{"username":{"required":true,"type":"string"}},"url":"/users/:username"},"getContextForUser":{"headers":{"accept":"application/vnd.github.hagar-preview+json"},"method":"GET","params":{"subject_id":{"type":"string"},"subject_type":{"enum":["organization","repository","issue","pull_request"],"type":"string"},"username":{"required":true,"type":"string"}},"url":"/users/:username/hovercard"},"getGpgKey":{"method":"GET","params":{"gpg_key_id":{"required":true,"type":"integer"}},"url":"/user/gpg_keys/:gpg_key_id"},"getPublicKey":{"method":"GET","params":{"key_id":{"required":true,"type":"integer"}},"url":"/user/keys/:key_id"},"list":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"since":{"type":"string"}},"url":"/users"},"listBlocked":{"method":"GET","params":{},"url":"/user/blocks"},"listEmails":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/emails"},"listFollowersForAuthenticatedUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/followers"},"listFollowersForUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/users/:username/followers"},"listFollowingForAuthenticatedUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/following"},"listFollowingForUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/users/:username/following"},"listGpgKeys":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/gpg_keys"},"listGpgKeysForUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/users/:username/gpg_keys"},"listPublicEmails":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/public_emails"},"listPublicKeys":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/keys"},"listPublicKeysForUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/users/:username/keys"},"togglePrimaryEmailVisibility":{"method":"PATCH","params":{"email":{"required":true,"type":"string"},"visibility":{"required":true,"type":"string"}},"url":"/user/email/visibility"},"unblock":{"method":"DELETE","params":{"username":{"required":true,"type":"string"}},"url":"/user/blocks/:username"},"unfollow":{"method":"DELETE","params":{"username":{"required":true,"type":"string"}},"url":"/user/following/:username"},"updateAuthenticated":{"method":"PATCH","params":{"bio":{"type":"string"},"blog":{"type":"string"},"company":{"type":"string"},"email":{"type":"string"},"hireable":{"type":"boolean"},"location":{"type":"string"},"name":{"type":"string"}},"url":"/user"}}};
  10442. /***/ }),
  10443. /***/ 722:
  10444. /***/ (function(module) {
  10445. /**
  10446. * Convert array of 16 byte values to UUID string format of the form:
  10447. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  10448. */
  10449. var byteToHex = [];
  10450. for (var i = 0; i < 256; ++i) {
  10451. byteToHex[i] = (i + 0x100).toString(16).substr(1);
  10452. }
  10453. function bytesToUuid(buf, offset) {
  10454. var i = offset || 0;
  10455. var bth = byteToHex;
  10456. // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
  10457. return ([bth[buf[i++]], bth[buf[i++]],
  10458. bth[buf[i++]], bth[buf[i++]], '-',
  10459. bth[buf[i++]], bth[buf[i++]], '-',
  10460. bth[buf[i++]], bth[buf[i++]], '-',
  10461. bth[buf[i++]], bth[buf[i++]], '-',
  10462. bth[buf[i++]], bth[buf[i++]],
  10463. bth[buf[i++]], bth[buf[i++]],
  10464. bth[buf[i++]], bth[buf[i++]]]).join('');
  10465. }
  10466. module.exports = bytesToUuid;
  10467. /***/ }),
  10468. /***/ 742:
  10469. /***/ (function(module, __unusedexports, __webpack_require__) {
  10470. var fs = __webpack_require__(747)
  10471. var core
  10472. if (process.platform === 'win32' || global.TESTING_WINDOWS) {
  10473. core = __webpack_require__(818)
  10474. } else {
  10475. core = __webpack_require__(197)
  10476. }
  10477. module.exports = isexe
  10478. isexe.sync = sync
  10479. function isexe (path, options, cb) {
  10480. if (typeof options === 'function') {
  10481. cb = options
  10482. options = {}
  10483. }
  10484. if (!cb) {
  10485. if (typeof Promise !== 'function') {
  10486. throw new TypeError('callback not provided')
  10487. }
  10488. return new Promise(function (resolve, reject) {
  10489. isexe(path, options || {}, function (er, is) {
  10490. if (er) {
  10491. reject(er)
  10492. } else {
  10493. resolve(is)
  10494. }
  10495. })
  10496. })
  10497. }
  10498. core(path, options || {}, function (er, is) {
  10499. // ignore EACCES because that just means we aren't allowed to run it
  10500. if (er) {
  10501. if (er.code === 'EACCES' || options && options.ignoreErrors) {
  10502. er = null
  10503. is = false
  10504. }
  10505. }
  10506. cb(er, is)
  10507. })
  10508. }
  10509. function sync (path, options) {
  10510. // my kingdom for a filtered catch
  10511. try {
  10512. return core.sync(path, options || {})
  10513. } catch (er) {
  10514. if (options && options.ignoreErrors || er.code === 'EACCES') {
  10515. return false
  10516. } else {
  10517. throw er
  10518. }
  10519. }
  10520. }
  10521. /***/ }),
  10522. /***/ 747:
  10523. /***/ (function(module) {
  10524. module.exports = require("fs");
  10525. /***/ }),
  10526. /***/ 753:
  10527. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  10528. "use strict";
  10529. Object.defineProperty(exports, '__esModule', { value: true });
  10530. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  10531. var endpoint = __webpack_require__(385);
  10532. var universalUserAgent = __webpack_require__(796);
  10533. var isPlainObject = _interopDefault(__webpack_require__(696));
  10534. var nodeFetch = _interopDefault(__webpack_require__(454));
  10535. var requestError = __webpack_require__(463);
  10536. const VERSION = "5.3.1";
  10537. function getBufferResponse(response) {
  10538. return response.arrayBuffer();
  10539. }
  10540. function fetchWrapper(requestOptions) {
  10541. if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {
  10542. requestOptions.body = JSON.stringify(requestOptions.body);
  10543. }
  10544. let headers = {};
  10545. let status;
  10546. let url;
  10547. const fetch = requestOptions.request && requestOptions.request.fetch || nodeFetch;
  10548. return fetch(requestOptions.url, Object.assign({
  10549. method: requestOptions.method,
  10550. body: requestOptions.body,
  10551. headers: requestOptions.headers,
  10552. redirect: requestOptions.redirect
  10553. }, requestOptions.request)).then(response => {
  10554. url = response.url;
  10555. status = response.status;
  10556. for (const keyAndValue of response.headers) {
  10557. headers[keyAndValue[0]] = keyAndValue[1];
  10558. }
  10559. if (status === 204 || status === 205) {
  10560. return;
  10561. } // GitHub API returns 200 for HEAD requsets
  10562. if (requestOptions.method === "HEAD") {
  10563. if (status < 400) {
  10564. return;
  10565. }
  10566. throw new requestError.RequestError(response.statusText, status, {
  10567. headers,
  10568. request: requestOptions
  10569. });
  10570. }
  10571. if (status === 304) {
  10572. throw new requestError.RequestError("Not modified", status, {
  10573. headers,
  10574. request: requestOptions
  10575. });
  10576. }
  10577. if (status >= 400) {
  10578. return response.text().then(message => {
  10579. const error = new requestError.RequestError(message, status, {
  10580. headers,
  10581. request: requestOptions
  10582. });
  10583. try {
  10584. let responseBody = JSON.parse(error.message);
  10585. Object.assign(error, responseBody);
  10586. let errors = responseBody.errors; // Assumption `errors` would always be in Array Fotmat
  10587. error.message = error.message + ": " + errors.map(JSON.stringify).join(", ");
  10588. } catch (e) {// ignore, see octokit/rest.js#684
  10589. }
  10590. throw error;
  10591. });
  10592. }
  10593. const contentType = response.headers.get("content-type");
  10594. if (/application\/json/.test(contentType)) {
  10595. return response.json();
  10596. }
  10597. if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) {
  10598. return response.text();
  10599. }
  10600. return getBufferResponse(response);
  10601. }).then(data => {
  10602. return {
  10603. status,
  10604. url,
  10605. headers,
  10606. data
  10607. };
  10608. }).catch(error => {
  10609. if (error instanceof requestError.RequestError) {
  10610. throw error;
  10611. }
  10612. throw new requestError.RequestError(error.message, 500, {
  10613. headers,
  10614. request: requestOptions
  10615. });
  10616. });
  10617. }
  10618. function withDefaults(oldEndpoint, newDefaults) {
  10619. const endpoint = oldEndpoint.defaults(newDefaults);
  10620. const newApi = function (route, parameters) {
  10621. const endpointOptions = endpoint.merge(route, parameters);
  10622. if (!endpointOptions.request || !endpointOptions.request.hook) {
  10623. return fetchWrapper(endpoint.parse(endpointOptions));
  10624. }
  10625. const request = (route, parameters) => {
  10626. return fetchWrapper(endpoint.parse(endpoint.merge(route, parameters)));
  10627. };
  10628. Object.assign(request, {
  10629. endpoint,
  10630. defaults: withDefaults.bind(null, endpoint)
  10631. });
  10632. return endpointOptions.request.hook(request, endpointOptions);
  10633. };
  10634. return Object.assign(newApi, {
  10635. endpoint,
  10636. defaults: withDefaults.bind(null, endpoint)
  10637. });
  10638. }
  10639. const request = withDefaults(endpoint.endpoint, {
  10640. headers: {
  10641. "user-agent": `octokit-request.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  10642. }
  10643. });
  10644. exports.request = request;
  10645. //# sourceMappingURL=index.js.map
  10646. /***/ }),
  10647. /***/ 761:
  10648. /***/ (function(module) {
  10649. module.exports = require("zlib");
  10650. /***/ }),
  10651. /***/ 763:
  10652. /***/ (function(module) {
  10653. module.exports = removeHook
  10654. function removeHook (state, name, method) {
  10655. if (!state.registry[name]) {
  10656. return
  10657. }
  10658. var index = state.registry[name]
  10659. .map(function (registered) { return registered.orig })
  10660. .indexOf(method)
  10661. if (index === -1) {
  10662. return
  10663. }
  10664. state.registry[name].splice(index, 1)
  10665. }
  10666. /***/ }),
  10667. /***/ 768:
  10668. /***/ (function(module) {
  10669. "use strict";
  10670. module.exports = function (x) {
  10671. var lf = typeof x === 'string' ? '\n' : '\n'.charCodeAt();
  10672. var cr = typeof x === 'string' ? '\r' : '\r'.charCodeAt();
  10673. if (x[x.length - 1] === lf) {
  10674. x = x.slice(0, x.length - 1);
  10675. }
  10676. if (x[x.length - 1] === cr) {
  10677. x = x.slice(0, x.length - 1);
  10678. }
  10679. return x;
  10680. };
  10681. /***/ }),
  10682. /***/ 777:
  10683. /***/ (function(module, __unusedexports, __webpack_require__) {
  10684. module.exports = getFirstPage
  10685. const getPage = __webpack_require__(265)
  10686. function getFirstPage (octokit, link, headers) {
  10687. return getPage(octokit, link, 'first', headers)
  10688. }
  10689. /***/ }),
  10690. /***/ 796:
  10691. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  10692. "use strict";
  10693. Object.defineProperty(exports, '__esModule', { value: true });
  10694. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  10695. var osName = _interopDefault(__webpack_require__(2));
  10696. function getUserAgent() {
  10697. try {
  10698. return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
  10699. } catch (error) {
  10700. if (/wmic os get Caption/.test(error.message)) {
  10701. return "Windows <version undetectable>";
  10702. }
  10703. throw error;
  10704. }
  10705. }
  10706. exports.getUserAgent = getUserAgent;
  10707. //# sourceMappingURL=index.js.map
  10708. /***/ }),
  10709. /***/ 807:
  10710. /***/ (function(module, __unusedexports, __webpack_require__) {
  10711. module.exports = paginate;
  10712. const iterator = __webpack_require__(8);
  10713. function paginate(octokit, route, options, mapFn) {
  10714. if (typeof options === "function") {
  10715. mapFn = options;
  10716. options = undefined;
  10717. }
  10718. options = octokit.request.endpoint.merge(route, options);
  10719. return gather(
  10720. octokit,
  10721. [],
  10722. iterator(octokit, options)[Symbol.asyncIterator](),
  10723. mapFn
  10724. );
  10725. }
  10726. function gather(octokit, results, iterator, mapFn) {
  10727. return iterator.next().then(result => {
  10728. if (result.done) {
  10729. return results;
  10730. }
  10731. let earlyExit = false;
  10732. function done() {
  10733. earlyExit = true;
  10734. }
  10735. results = results.concat(
  10736. mapFn ? mapFn(result.value, done) : result.value.data
  10737. );
  10738. if (earlyExit) {
  10739. return results;
  10740. }
  10741. return gather(octokit, results, iterator, mapFn);
  10742. });
  10743. }
  10744. /***/ }),
  10745. /***/ 814:
  10746. /***/ (function(module, __unusedexports, __webpack_require__) {
  10747. module.exports = which
  10748. which.sync = whichSync
  10749. var isWindows = process.platform === 'win32' ||
  10750. process.env.OSTYPE === 'cygwin' ||
  10751. process.env.OSTYPE === 'msys'
  10752. var path = __webpack_require__(622)
  10753. var COLON = isWindows ? ';' : ':'
  10754. var isexe = __webpack_require__(742)
  10755. function getNotFoundError (cmd) {
  10756. var er = new Error('not found: ' + cmd)
  10757. er.code = 'ENOENT'
  10758. return er
  10759. }
  10760. function getPathInfo (cmd, opt) {
  10761. var colon = opt.colon || COLON
  10762. var pathEnv = opt.path || process.env.PATH || ''
  10763. var pathExt = ['']
  10764. pathEnv = pathEnv.split(colon)
  10765. var pathExtExe = ''
  10766. if (isWindows) {
  10767. pathEnv.unshift(process.cwd())
  10768. pathExtExe = (opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM')
  10769. pathExt = pathExtExe.split(colon)
  10770. // Always test the cmd itself first. isexe will check to make sure
  10771. // it's found in the pathExt set.
  10772. if (cmd.indexOf('.') !== -1 && pathExt[0] !== '')
  10773. pathExt.unshift('')
  10774. }
  10775. // If it has a slash, then we don't bother searching the pathenv.
  10776. // just check the file itself, and that's it.
  10777. if (cmd.match(/\//) || isWindows && cmd.match(/\\/))
  10778. pathEnv = ['']
  10779. return {
  10780. env: pathEnv,
  10781. ext: pathExt,
  10782. extExe: pathExtExe
  10783. }
  10784. }
  10785. function which (cmd, opt, cb) {
  10786. if (typeof opt === 'function') {
  10787. cb = opt
  10788. opt = {}
  10789. }
  10790. var info = getPathInfo(cmd, opt)
  10791. var pathEnv = info.env
  10792. var pathExt = info.ext
  10793. var pathExtExe = info.extExe
  10794. var found = []
  10795. ;(function F (i, l) {
  10796. if (i === l) {
  10797. if (opt.all && found.length)
  10798. return cb(null, found)
  10799. else
  10800. return cb(getNotFoundError(cmd))
  10801. }
  10802. var pathPart = pathEnv[i]
  10803. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  10804. pathPart = pathPart.slice(1, -1)
  10805. var p = path.join(pathPart, cmd)
  10806. if (!pathPart && (/^\.[\\\/]/).test(cmd)) {
  10807. p = cmd.slice(0, 2) + p
  10808. }
  10809. ;(function E (ii, ll) {
  10810. if (ii === ll) return F(i + 1, l)
  10811. var ext = pathExt[ii]
  10812. isexe(p + ext, { pathExt: pathExtExe }, function (er, is) {
  10813. if (!er && is) {
  10814. if (opt.all)
  10815. found.push(p + ext)
  10816. else
  10817. return cb(null, p + ext)
  10818. }
  10819. return E(ii + 1, ll)
  10820. })
  10821. })(0, pathExt.length)
  10822. })(0, pathEnv.length)
  10823. }
  10824. function whichSync (cmd, opt) {
  10825. opt = opt || {}
  10826. var info = getPathInfo(cmd, opt)
  10827. var pathEnv = info.env
  10828. var pathExt = info.ext
  10829. var pathExtExe = info.extExe
  10830. var found = []
  10831. for (var i = 0, l = pathEnv.length; i < l; i ++) {
  10832. var pathPart = pathEnv[i]
  10833. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  10834. pathPart = pathPart.slice(1, -1)
  10835. var p = path.join(pathPart, cmd)
  10836. if (!pathPart && /^\.[\\\/]/.test(cmd)) {
  10837. p = cmd.slice(0, 2) + p
  10838. }
  10839. for (var j = 0, ll = pathExt.length; j < ll; j ++) {
  10840. var cur = p + pathExt[j]
  10841. var is
  10842. try {
  10843. is = isexe.sync(cur, { pathExt: pathExtExe })
  10844. if (is) {
  10845. if (opt.all)
  10846. found.push(cur)
  10847. else
  10848. return cur
  10849. }
  10850. } catch (ex) {}
  10851. }
  10852. }
  10853. if (opt.all && found.length)
  10854. return found
  10855. if (opt.nothrow)
  10856. return null
  10857. throw getNotFoundError(cmd)
  10858. }
  10859. /***/ }),
  10860. /***/ 816:
  10861. /***/ (function(module) {
  10862. "use strict";
  10863. module.exports = /^#!.*/;
  10864. /***/ }),
  10865. /***/ 818:
  10866. /***/ (function(module, __unusedexports, __webpack_require__) {
  10867. module.exports = isexe
  10868. isexe.sync = sync
  10869. var fs = __webpack_require__(747)
  10870. function checkPathExt (path, options) {
  10871. var pathext = options.pathExt !== undefined ?
  10872. options.pathExt : process.env.PATHEXT
  10873. if (!pathext) {
  10874. return true
  10875. }
  10876. pathext = pathext.split(';')
  10877. if (pathext.indexOf('') !== -1) {
  10878. return true
  10879. }
  10880. for (var i = 0; i < pathext.length; i++) {
  10881. var p = pathext[i].toLowerCase()
  10882. if (p && path.substr(-p.length).toLowerCase() === p) {
  10883. return true
  10884. }
  10885. }
  10886. return false
  10887. }
  10888. function checkStat (stat, path, options) {
  10889. if (!stat.isSymbolicLink() && !stat.isFile()) {
  10890. return false
  10891. }
  10892. return checkPathExt(path, options)
  10893. }
  10894. function isexe (path, options, cb) {
  10895. fs.stat(path, function (er, stat) {
  10896. cb(er, er ? false : checkStat(stat, path, options))
  10897. })
  10898. }
  10899. function sync (path, options) {
  10900. return checkStat(fs.statSync(path), path, options)
  10901. }
  10902. /***/ }),
  10903. /***/ 821:
  10904. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  10905. "use strict";
  10906. var __importStar = (this && this.__importStar) || function (mod) {
  10907. if (mod && mod.__esModule) return mod;
  10908. var result = {};
  10909. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  10910. result["default"] = mod;
  10911. return result;
  10912. };
  10913. Object.defineProperty(exports, "__esModule", { value: true });
  10914. const core = __importStar(__webpack_require__(470));
  10915. const fsHelper = __importStar(__webpack_require__(618));
  10916. const github = __importStar(__webpack_require__(469));
  10917. const path = __importStar(__webpack_require__(622));
  10918. function getInputs() {
  10919. const result = {};
  10920. // GitHub workspace
  10921. let githubWorkspacePath = process.env['GITHUB_WORKSPACE'];
  10922. if (!githubWorkspacePath) {
  10923. throw new Error('GITHUB_WORKSPACE not defined');
  10924. }
  10925. githubWorkspacePath = path.resolve(githubWorkspacePath);
  10926. core.debug(`GITHUB_WORKSPACE = '${githubWorkspacePath}'`);
  10927. fsHelper.directoryExistsSync(githubWorkspacePath, true);
  10928. // Qualified repository
  10929. const qualifiedRepository = core.getInput('repository') ||
  10930. `${github.context.repo.owner}/${github.context.repo.repo}`;
  10931. core.debug(`qualified repository = '${qualifiedRepository}'`);
  10932. const splitRepository = qualifiedRepository.split('/');
  10933. if (splitRepository.length !== 2 ||
  10934. !splitRepository[0] ||
  10935. !splitRepository[1]) {
  10936. throw new Error(`Invalid repository '${qualifiedRepository}'. Expected format {owner}/{repo}.`);
  10937. }
  10938. result.repositoryOwner = splitRepository[0];
  10939. result.repositoryName = splitRepository[1];
  10940. // Repository path
  10941. result.repositoryPath = core.getInput('path') || '.';
  10942. result.repositoryPath = path.resolve(githubWorkspacePath, result.repositoryPath);
  10943. if (!(result.repositoryPath + path.sep).startsWith(githubWorkspacePath + path.sep)) {
  10944. throw new Error(`Repository path '${result.repositoryPath}' is not under '${githubWorkspacePath}'`);
  10945. }
  10946. // Workflow repository?
  10947. const isWorkflowRepository = qualifiedRepository.toUpperCase() ===
  10948. `${github.context.repo.owner}/${github.context.repo.repo}`.toUpperCase();
  10949. // Source branch, source version
  10950. result.ref = core.getInput('ref');
  10951. if (!result.ref) {
  10952. if (isWorkflowRepository) {
  10953. result.ref = github.context.ref;
  10954. result.commit = github.context.sha;
  10955. }
  10956. if (!result.ref && !result.commit) {
  10957. result.ref = 'refs/heads/master';
  10958. }
  10959. }
  10960. // SHA?
  10961. else if (result.ref.match(/^[0-9a-fA-F]{40}$/)) {
  10962. result.commit = result.ref;
  10963. result.ref = '';
  10964. }
  10965. core.debug(`ref = '${result.ref}'`);
  10966. core.debug(`commit = '${result.commit}'`);
  10967. // Clean
  10968. result.clean = (core.getInput('clean') || 'true').toUpperCase() === 'TRUE';
  10969. core.debug(`clean = ${result.clean}`);
  10970. // Submodules
  10971. if (core.getInput('submodules')) {
  10972. throw new Error("The input 'submodules' is not supported in actions/checkout@v2");
  10973. }
  10974. // Fetch depth
  10975. result.fetchDepth = Math.floor(Number(core.getInput('fetch-depth') || '1'));
  10976. if (isNaN(result.fetchDepth) || result.fetchDepth < 0) {
  10977. result.fetchDepth = 0;
  10978. }
  10979. core.debug(`fetch depth = ${result.fetchDepth}`);
  10980. // LFS
  10981. result.lfs = (core.getInput('lfs') || 'false').toUpperCase() === 'TRUE';
  10982. core.debug(`lfs = ${result.lfs}`);
  10983. // Access token
  10984. result.accessToken = core.getInput('token');
  10985. return result;
  10986. }
  10987. exports.getInputs = getInputs;
  10988. /***/ }),
  10989. /***/ 826:
  10990. /***/ (function(module, __unusedexports, __webpack_require__) {
  10991. var rng = __webpack_require__(139);
  10992. var bytesToUuid = __webpack_require__(722);
  10993. function v4(options, buf, offset) {
  10994. var i = buf && offset || 0;
  10995. if (typeof(options) == 'string') {
  10996. buf = options === 'binary' ? new Array(16) : null;
  10997. options = null;
  10998. }
  10999. options = options || {};
  11000. var rnds = options.random || (options.rng || rng)();
  11001. // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  11002. rnds[6] = (rnds[6] & 0x0f) | 0x40;
  11003. rnds[8] = (rnds[8] & 0x3f) | 0x80;
  11004. // Copy bytes to buffer, if provided
  11005. if (buf) {
  11006. for (var ii = 0; ii < 16; ++ii) {
  11007. buf[i + ii] = rnds[ii];
  11008. }
  11009. }
  11010. return buf || bytesToUuid(rnds);
  11011. }
  11012. module.exports = v4;
  11013. /***/ }),
  11014. /***/ 835:
  11015. /***/ (function(module) {
  11016. module.exports = require("url");
  11017. /***/ }),
  11018. /***/ 850:
  11019. /***/ (function(module, __unusedexports, __webpack_require__) {
  11020. module.exports = paginationMethodsPlugin
  11021. function paginationMethodsPlugin (octokit) {
  11022. octokit.getFirstPage = __webpack_require__(777).bind(null, octokit)
  11023. octokit.getLastPage = __webpack_require__(649).bind(null, octokit)
  11024. octokit.getNextPage = __webpack_require__(550).bind(null, octokit)
  11025. octokit.getPreviousPage = __webpack_require__(563).bind(null, octokit)
  11026. octokit.hasFirstPage = __webpack_require__(536)
  11027. octokit.hasLastPage = __webpack_require__(336)
  11028. octokit.hasNextPage = __webpack_require__(929)
  11029. octokit.hasPreviousPage = __webpack_require__(558)
  11030. }
  11031. /***/ }),
  11032. /***/ 854:
  11033. /***/ (function(module) {
  11034. /**
  11035. * lodash (Custom Build) <https://lodash.com/>
  11036. * Build: `lodash modularize exports="npm" -o ./`
  11037. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  11038. * Released under MIT license <https://lodash.com/license>
  11039. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  11040. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  11041. */
  11042. /** Used as the `TypeError` message for "Functions" methods. */
  11043. var FUNC_ERROR_TEXT = 'Expected a function';
  11044. /** Used to stand-in for `undefined` hash values. */
  11045. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  11046. /** Used as references for various `Number` constants. */
  11047. var INFINITY = 1 / 0;
  11048. /** `Object#toString` result references. */
  11049. var funcTag = '[object Function]',
  11050. genTag = '[object GeneratorFunction]',
  11051. symbolTag = '[object Symbol]';
  11052. /** Used to match property names within property paths. */
  11053. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  11054. reIsPlainProp = /^\w*$/,
  11055. reLeadingDot = /^\./,
  11056. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  11057. /**
  11058. * Used to match `RegExp`
  11059. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  11060. */
  11061. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  11062. /** Used to match backslashes in property paths. */
  11063. var reEscapeChar = /\\(\\)?/g;
  11064. /** Used to detect host constructors (Safari). */
  11065. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  11066. /** Detect free variable `global` from Node.js. */
  11067. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  11068. /** Detect free variable `self`. */
  11069. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  11070. /** Used as a reference to the global object. */
  11071. var root = freeGlobal || freeSelf || Function('return this')();
  11072. /**
  11073. * Gets the value at `key` of `object`.
  11074. *
  11075. * @private
  11076. * @param {Object} [object] The object to query.
  11077. * @param {string} key The key of the property to get.
  11078. * @returns {*} Returns the property value.
  11079. */
  11080. function getValue(object, key) {
  11081. return object == null ? undefined : object[key];
  11082. }
  11083. /**
  11084. * Checks if `value` is a host object in IE < 9.
  11085. *
  11086. * @private
  11087. * @param {*} value The value to check.
  11088. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  11089. */
  11090. function isHostObject(value) {
  11091. // Many host objects are `Object` objects that can coerce to strings
  11092. // despite having improperly defined `toString` methods.
  11093. var result = false;
  11094. if (value != null && typeof value.toString != 'function') {
  11095. try {
  11096. result = !!(value + '');
  11097. } catch (e) {}
  11098. }
  11099. return result;
  11100. }
  11101. /** Used for built-in method references. */
  11102. var arrayProto = Array.prototype,
  11103. funcProto = Function.prototype,
  11104. objectProto = Object.prototype;
  11105. /** Used to detect overreaching core-js shims. */
  11106. var coreJsData = root['__core-js_shared__'];
  11107. /** Used to detect methods masquerading as native. */
  11108. var maskSrcKey = (function() {
  11109. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  11110. return uid ? ('Symbol(src)_1.' + uid) : '';
  11111. }());
  11112. /** Used to resolve the decompiled source of functions. */
  11113. var funcToString = funcProto.toString;
  11114. /** Used to check objects for own properties. */
  11115. var hasOwnProperty = objectProto.hasOwnProperty;
  11116. /**
  11117. * Used to resolve the
  11118. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  11119. * of values.
  11120. */
  11121. var objectToString = objectProto.toString;
  11122. /** Used to detect if a method is native. */
  11123. var reIsNative = RegExp('^' +
  11124. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  11125. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  11126. );
  11127. /** Built-in value references. */
  11128. var Symbol = root.Symbol,
  11129. splice = arrayProto.splice;
  11130. /* Built-in method references that are verified to be native. */
  11131. var Map = getNative(root, 'Map'),
  11132. nativeCreate = getNative(Object, 'create');
  11133. /** Used to convert symbols to primitives and strings. */
  11134. var symbolProto = Symbol ? Symbol.prototype : undefined,
  11135. symbolToString = symbolProto ? symbolProto.toString : undefined;
  11136. /**
  11137. * Creates a hash object.
  11138. *
  11139. * @private
  11140. * @constructor
  11141. * @param {Array} [entries] The key-value pairs to cache.
  11142. */
  11143. function Hash(entries) {
  11144. var index = -1,
  11145. length = entries ? entries.length : 0;
  11146. this.clear();
  11147. while (++index < length) {
  11148. var entry = entries[index];
  11149. this.set(entry[0], entry[1]);
  11150. }
  11151. }
  11152. /**
  11153. * Removes all key-value entries from the hash.
  11154. *
  11155. * @private
  11156. * @name clear
  11157. * @memberOf Hash
  11158. */
  11159. function hashClear() {
  11160. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  11161. }
  11162. /**
  11163. * Removes `key` and its value from the hash.
  11164. *
  11165. * @private
  11166. * @name delete
  11167. * @memberOf Hash
  11168. * @param {Object} hash The hash to modify.
  11169. * @param {string} key The key of the value to remove.
  11170. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  11171. */
  11172. function hashDelete(key) {
  11173. return this.has(key) && delete this.__data__[key];
  11174. }
  11175. /**
  11176. * Gets the hash value for `key`.
  11177. *
  11178. * @private
  11179. * @name get
  11180. * @memberOf Hash
  11181. * @param {string} key The key of the value to get.
  11182. * @returns {*} Returns the entry value.
  11183. */
  11184. function hashGet(key) {
  11185. var data = this.__data__;
  11186. if (nativeCreate) {
  11187. var result = data[key];
  11188. return result === HASH_UNDEFINED ? undefined : result;
  11189. }
  11190. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  11191. }
  11192. /**
  11193. * Checks if a hash value for `key` exists.
  11194. *
  11195. * @private
  11196. * @name has
  11197. * @memberOf Hash
  11198. * @param {string} key The key of the entry to check.
  11199. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  11200. */
  11201. function hashHas(key) {
  11202. var data = this.__data__;
  11203. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  11204. }
  11205. /**
  11206. * Sets the hash `key` to `value`.
  11207. *
  11208. * @private
  11209. * @name set
  11210. * @memberOf Hash
  11211. * @param {string} key The key of the value to set.
  11212. * @param {*} value The value to set.
  11213. * @returns {Object} Returns the hash instance.
  11214. */
  11215. function hashSet(key, value) {
  11216. var data = this.__data__;
  11217. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  11218. return this;
  11219. }
  11220. // Add methods to `Hash`.
  11221. Hash.prototype.clear = hashClear;
  11222. Hash.prototype['delete'] = hashDelete;
  11223. Hash.prototype.get = hashGet;
  11224. Hash.prototype.has = hashHas;
  11225. Hash.prototype.set = hashSet;
  11226. /**
  11227. * Creates an list cache object.
  11228. *
  11229. * @private
  11230. * @constructor
  11231. * @param {Array} [entries] The key-value pairs to cache.
  11232. */
  11233. function ListCache(entries) {
  11234. var index = -1,
  11235. length = entries ? entries.length : 0;
  11236. this.clear();
  11237. while (++index < length) {
  11238. var entry = entries[index];
  11239. this.set(entry[0], entry[1]);
  11240. }
  11241. }
  11242. /**
  11243. * Removes all key-value entries from the list cache.
  11244. *
  11245. * @private
  11246. * @name clear
  11247. * @memberOf ListCache
  11248. */
  11249. function listCacheClear() {
  11250. this.__data__ = [];
  11251. }
  11252. /**
  11253. * Removes `key` and its value from the list cache.
  11254. *
  11255. * @private
  11256. * @name delete
  11257. * @memberOf ListCache
  11258. * @param {string} key The key of the value to remove.
  11259. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  11260. */
  11261. function listCacheDelete(key) {
  11262. var data = this.__data__,
  11263. index = assocIndexOf(data, key);
  11264. if (index < 0) {
  11265. return false;
  11266. }
  11267. var lastIndex = data.length - 1;
  11268. if (index == lastIndex) {
  11269. data.pop();
  11270. } else {
  11271. splice.call(data, index, 1);
  11272. }
  11273. return true;
  11274. }
  11275. /**
  11276. * Gets the list cache value for `key`.
  11277. *
  11278. * @private
  11279. * @name get
  11280. * @memberOf ListCache
  11281. * @param {string} key The key of the value to get.
  11282. * @returns {*} Returns the entry value.
  11283. */
  11284. function listCacheGet(key) {
  11285. var data = this.__data__,
  11286. index = assocIndexOf(data, key);
  11287. return index < 0 ? undefined : data[index][1];
  11288. }
  11289. /**
  11290. * Checks if a list cache value for `key` exists.
  11291. *
  11292. * @private
  11293. * @name has
  11294. * @memberOf ListCache
  11295. * @param {string} key The key of the entry to check.
  11296. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  11297. */
  11298. function listCacheHas(key) {
  11299. return assocIndexOf(this.__data__, key) > -1;
  11300. }
  11301. /**
  11302. * Sets the list cache `key` to `value`.
  11303. *
  11304. * @private
  11305. * @name set
  11306. * @memberOf ListCache
  11307. * @param {string} key The key of the value to set.
  11308. * @param {*} value The value to set.
  11309. * @returns {Object} Returns the list cache instance.
  11310. */
  11311. function listCacheSet(key, value) {
  11312. var data = this.__data__,
  11313. index = assocIndexOf(data, key);
  11314. if (index < 0) {
  11315. data.push([key, value]);
  11316. } else {
  11317. data[index][1] = value;
  11318. }
  11319. return this;
  11320. }
  11321. // Add methods to `ListCache`.
  11322. ListCache.prototype.clear = listCacheClear;
  11323. ListCache.prototype['delete'] = listCacheDelete;
  11324. ListCache.prototype.get = listCacheGet;
  11325. ListCache.prototype.has = listCacheHas;
  11326. ListCache.prototype.set = listCacheSet;
  11327. /**
  11328. * Creates a map cache object to store key-value pairs.
  11329. *
  11330. * @private
  11331. * @constructor
  11332. * @param {Array} [entries] The key-value pairs to cache.
  11333. */
  11334. function MapCache(entries) {
  11335. var index = -1,
  11336. length = entries ? entries.length : 0;
  11337. this.clear();
  11338. while (++index < length) {
  11339. var entry = entries[index];
  11340. this.set(entry[0], entry[1]);
  11341. }
  11342. }
  11343. /**
  11344. * Removes all key-value entries from the map.
  11345. *
  11346. * @private
  11347. * @name clear
  11348. * @memberOf MapCache
  11349. */
  11350. function mapCacheClear() {
  11351. this.__data__ = {
  11352. 'hash': new Hash,
  11353. 'map': new (Map || ListCache),
  11354. 'string': new Hash
  11355. };
  11356. }
  11357. /**
  11358. * Removes `key` and its value from the map.
  11359. *
  11360. * @private
  11361. * @name delete
  11362. * @memberOf MapCache
  11363. * @param {string} key The key of the value to remove.
  11364. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  11365. */
  11366. function mapCacheDelete(key) {
  11367. return getMapData(this, key)['delete'](key);
  11368. }
  11369. /**
  11370. * Gets the map value for `key`.
  11371. *
  11372. * @private
  11373. * @name get
  11374. * @memberOf MapCache
  11375. * @param {string} key The key of the value to get.
  11376. * @returns {*} Returns the entry value.
  11377. */
  11378. function mapCacheGet(key) {
  11379. return getMapData(this, key).get(key);
  11380. }
  11381. /**
  11382. * Checks if a map value for `key` exists.
  11383. *
  11384. * @private
  11385. * @name has
  11386. * @memberOf MapCache
  11387. * @param {string} key The key of the entry to check.
  11388. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  11389. */
  11390. function mapCacheHas(key) {
  11391. return getMapData(this, key).has(key);
  11392. }
  11393. /**
  11394. * Sets the map `key` to `value`.
  11395. *
  11396. * @private
  11397. * @name set
  11398. * @memberOf MapCache
  11399. * @param {string} key The key of the value to set.
  11400. * @param {*} value The value to set.
  11401. * @returns {Object} Returns the map cache instance.
  11402. */
  11403. function mapCacheSet(key, value) {
  11404. getMapData(this, key).set(key, value);
  11405. return this;
  11406. }
  11407. // Add methods to `MapCache`.
  11408. MapCache.prototype.clear = mapCacheClear;
  11409. MapCache.prototype['delete'] = mapCacheDelete;
  11410. MapCache.prototype.get = mapCacheGet;
  11411. MapCache.prototype.has = mapCacheHas;
  11412. MapCache.prototype.set = mapCacheSet;
  11413. /**
  11414. * Gets the index at which the `key` is found in `array` of key-value pairs.
  11415. *
  11416. * @private
  11417. * @param {Array} array The array to inspect.
  11418. * @param {*} key The key to search for.
  11419. * @returns {number} Returns the index of the matched value, else `-1`.
  11420. */
  11421. function assocIndexOf(array, key) {
  11422. var length = array.length;
  11423. while (length--) {
  11424. if (eq(array[length][0], key)) {
  11425. return length;
  11426. }
  11427. }
  11428. return -1;
  11429. }
  11430. /**
  11431. * The base implementation of `_.get` without support for default values.
  11432. *
  11433. * @private
  11434. * @param {Object} object The object to query.
  11435. * @param {Array|string} path The path of the property to get.
  11436. * @returns {*} Returns the resolved value.
  11437. */
  11438. function baseGet(object, path) {
  11439. path = isKey(path, object) ? [path] : castPath(path);
  11440. var index = 0,
  11441. length = path.length;
  11442. while (object != null && index < length) {
  11443. object = object[toKey(path[index++])];
  11444. }
  11445. return (index && index == length) ? object : undefined;
  11446. }
  11447. /**
  11448. * The base implementation of `_.isNative` without bad shim checks.
  11449. *
  11450. * @private
  11451. * @param {*} value The value to check.
  11452. * @returns {boolean} Returns `true` if `value` is a native function,
  11453. * else `false`.
  11454. */
  11455. function baseIsNative(value) {
  11456. if (!isObject(value) || isMasked(value)) {
  11457. return false;
  11458. }
  11459. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  11460. return pattern.test(toSource(value));
  11461. }
  11462. /**
  11463. * The base implementation of `_.toString` which doesn't convert nullish
  11464. * values to empty strings.
  11465. *
  11466. * @private
  11467. * @param {*} value The value to process.
  11468. * @returns {string} Returns the string.
  11469. */
  11470. function baseToString(value) {
  11471. // Exit early for strings to avoid a performance hit in some environments.
  11472. if (typeof value == 'string') {
  11473. return value;
  11474. }
  11475. if (isSymbol(value)) {
  11476. return symbolToString ? symbolToString.call(value) : '';
  11477. }
  11478. var result = (value + '');
  11479. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  11480. }
  11481. /**
  11482. * Casts `value` to a path array if it's not one.
  11483. *
  11484. * @private
  11485. * @param {*} value The value to inspect.
  11486. * @returns {Array} Returns the cast property path array.
  11487. */
  11488. function castPath(value) {
  11489. return isArray(value) ? value : stringToPath(value);
  11490. }
  11491. /**
  11492. * Gets the data for `map`.
  11493. *
  11494. * @private
  11495. * @param {Object} map The map to query.
  11496. * @param {string} key The reference key.
  11497. * @returns {*} Returns the map data.
  11498. */
  11499. function getMapData(map, key) {
  11500. var data = map.__data__;
  11501. return isKeyable(key)
  11502. ? data[typeof key == 'string' ? 'string' : 'hash']
  11503. : data.map;
  11504. }
  11505. /**
  11506. * Gets the native function at `key` of `object`.
  11507. *
  11508. * @private
  11509. * @param {Object} object The object to query.
  11510. * @param {string} key The key of the method to get.
  11511. * @returns {*} Returns the function if it's native, else `undefined`.
  11512. */
  11513. function getNative(object, key) {
  11514. var value = getValue(object, key);
  11515. return baseIsNative(value) ? value : undefined;
  11516. }
  11517. /**
  11518. * Checks if `value` is a property name and not a property path.
  11519. *
  11520. * @private
  11521. * @param {*} value The value to check.
  11522. * @param {Object} [object] The object to query keys on.
  11523. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  11524. */
  11525. function isKey(value, object) {
  11526. if (isArray(value)) {
  11527. return false;
  11528. }
  11529. var type = typeof value;
  11530. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  11531. value == null || isSymbol(value)) {
  11532. return true;
  11533. }
  11534. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  11535. (object != null && value in Object(object));
  11536. }
  11537. /**
  11538. * Checks if `value` is suitable for use as unique object key.
  11539. *
  11540. * @private
  11541. * @param {*} value The value to check.
  11542. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  11543. */
  11544. function isKeyable(value) {
  11545. var type = typeof value;
  11546. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  11547. ? (value !== '__proto__')
  11548. : (value === null);
  11549. }
  11550. /**
  11551. * Checks if `func` has its source masked.
  11552. *
  11553. * @private
  11554. * @param {Function} func The function to check.
  11555. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  11556. */
  11557. function isMasked(func) {
  11558. return !!maskSrcKey && (maskSrcKey in func);
  11559. }
  11560. /**
  11561. * Converts `string` to a property path array.
  11562. *
  11563. * @private
  11564. * @param {string} string The string to convert.
  11565. * @returns {Array} Returns the property path array.
  11566. */
  11567. var stringToPath = memoize(function(string) {
  11568. string = toString(string);
  11569. var result = [];
  11570. if (reLeadingDot.test(string)) {
  11571. result.push('');
  11572. }
  11573. string.replace(rePropName, function(match, number, quote, string) {
  11574. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  11575. });
  11576. return result;
  11577. });
  11578. /**
  11579. * Converts `value` to a string key if it's not a string or symbol.
  11580. *
  11581. * @private
  11582. * @param {*} value The value to inspect.
  11583. * @returns {string|symbol} Returns the key.
  11584. */
  11585. function toKey(value) {
  11586. if (typeof value == 'string' || isSymbol(value)) {
  11587. return value;
  11588. }
  11589. var result = (value + '');
  11590. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  11591. }
  11592. /**
  11593. * Converts `func` to its source code.
  11594. *
  11595. * @private
  11596. * @param {Function} func The function to process.
  11597. * @returns {string} Returns the source code.
  11598. */
  11599. function toSource(func) {
  11600. if (func != null) {
  11601. try {
  11602. return funcToString.call(func);
  11603. } catch (e) {}
  11604. try {
  11605. return (func + '');
  11606. } catch (e) {}
  11607. }
  11608. return '';
  11609. }
  11610. /**
  11611. * Creates a function that memoizes the result of `func`. If `resolver` is
  11612. * provided, it determines the cache key for storing the result based on the
  11613. * arguments provided to the memoized function. By default, the first argument
  11614. * provided to the memoized function is used as the map cache key. The `func`
  11615. * is invoked with the `this` binding of the memoized function.
  11616. *
  11617. * **Note:** The cache is exposed as the `cache` property on the memoized
  11618. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  11619. * constructor with one whose instances implement the
  11620. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  11621. * method interface of `delete`, `get`, `has`, and `set`.
  11622. *
  11623. * @static
  11624. * @memberOf _
  11625. * @since 0.1.0
  11626. * @category Function
  11627. * @param {Function} func The function to have its output memoized.
  11628. * @param {Function} [resolver] The function to resolve the cache key.
  11629. * @returns {Function} Returns the new memoized function.
  11630. * @example
  11631. *
  11632. * var object = { 'a': 1, 'b': 2 };
  11633. * var other = { 'c': 3, 'd': 4 };
  11634. *
  11635. * var values = _.memoize(_.values);
  11636. * values(object);
  11637. * // => [1, 2]
  11638. *
  11639. * values(other);
  11640. * // => [3, 4]
  11641. *
  11642. * object.a = 2;
  11643. * values(object);
  11644. * // => [1, 2]
  11645. *
  11646. * // Modify the result cache.
  11647. * values.cache.set(object, ['a', 'b']);
  11648. * values(object);
  11649. * // => ['a', 'b']
  11650. *
  11651. * // Replace `_.memoize.Cache`.
  11652. * _.memoize.Cache = WeakMap;
  11653. */
  11654. function memoize(func, resolver) {
  11655. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  11656. throw new TypeError(FUNC_ERROR_TEXT);
  11657. }
  11658. var memoized = function() {
  11659. var args = arguments,
  11660. key = resolver ? resolver.apply(this, args) : args[0],
  11661. cache = memoized.cache;
  11662. if (cache.has(key)) {
  11663. return cache.get(key);
  11664. }
  11665. var result = func.apply(this, args);
  11666. memoized.cache = cache.set(key, result);
  11667. return result;
  11668. };
  11669. memoized.cache = new (memoize.Cache || MapCache);
  11670. return memoized;
  11671. }
  11672. // Assign cache to `_.memoize`.
  11673. memoize.Cache = MapCache;
  11674. /**
  11675. * Performs a
  11676. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  11677. * comparison between two values to determine if they are equivalent.
  11678. *
  11679. * @static
  11680. * @memberOf _
  11681. * @since 4.0.0
  11682. * @category Lang
  11683. * @param {*} value The value to compare.
  11684. * @param {*} other The other value to compare.
  11685. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11686. * @example
  11687. *
  11688. * var object = { 'a': 1 };
  11689. * var other = { 'a': 1 };
  11690. *
  11691. * _.eq(object, object);
  11692. * // => true
  11693. *
  11694. * _.eq(object, other);
  11695. * // => false
  11696. *
  11697. * _.eq('a', 'a');
  11698. * // => true
  11699. *
  11700. * _.eq('a', Object('a'));
  11701. * // => false
  11702. *
  11703. * _.eq(NaN, NaN);
  11704. * // => true
  11705. */
  11706. function eq(value, other) {
  11707. return value === other || (value !== value && other !== other);
  11708. }
  11709. /**
  11710. * Checks if `value` is classified as an `Array` object.
  11711. *
  11712. * @static
  11713. * @memberOf _
  11714. * @since 0.1.0
  11715. * @category Lang
  11716. * @param {*} value The value to check.
  11717. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  11718. * @example
  11719. *
  11720. * _.isArray([1, 2, 3]);
  11721. * // => true
  11722. *
  11723. * _.isArray(document.body.children);
  11724. * // => false
  11725. *
  11726. * _.isArray('abc');
  11727. * // => false
  11728. *
  11729. * _.isArray(_.noop);
  11730. * // => false
  11731. */
  11732. var isArray = Array.isArray;
  11733. /**
  11734. * Checks if `value` is classified as a `Function` object.
  11735. *
  11736. * @static
  11737. * @memberOf _
  11738. * @since 0.1.0
  11739. * @category Lang
  11740. * @param {*} value The value to check.
  11741. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  11742. * @example
  11743. *
  11744. * _.isFunction(_);
  11745. * // => true
  11746. *
  11747. * _.isFunction(/abc/);
  11748. * // => false
  11749. */
  11750. function isFunction(value) {
  11751. // The use of `Object#toString` avoids issues with the `typeof` operator
  11752. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  11753. var tag = isObject(value) ? objectToString.call(value) : '';
  11754. return tag == funcTag || tag == genTag;
  11755. }
  11756. /**
  11757. * Checks if `value` is the
  11758. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  11759. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  11760. *
  11761. * @static
  11762. * @memberOf _
  11763. * @since 0.1.0
  11764. * @category Lang
  11765. * @param {*} value The value to check.
  11766. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  11767. * @example
  11768. *
  11769. * _.isObject({});
  11770. * // => true
  11771. *
  11772. * _.isObject([1, 2, 3]);
  11773. * // => true
  11774. *
  11775. * _.isObject(_.noop);
  11776. * // => true
  11777. *
  11778. * _.isObject(null);
  11779. * // => false
  11780. */
  11781. function isObject(value) {
  11782. var type = typeof value;
  11783. return !!value && (type == 'object' || type == 'function');
  11784. }
  11785. /**
  11786. * Checks if `value` is object-like. A value is object-like if it's not `null`
  11787. * and has a `typeof` result of "object".
  11788. *
  11789. * @static
  11790. * @memberOf _
  11791. * @since 4.0.0
  11792. * @category Lang
  11793. * @param {*} value The value to check.
  11794. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  11795. * @example
  11796. *
  11797. * _.isObjectLike({});
  11798. * // => true
  11799. *
  11800. * _.isObjectLike([1, 2, 3]);
  11801. * // => true
  11802. *
  11803. * _.isObjectLike(_.noop);
  11804. * // => false
  11805. *
  11806. * _.isObjectLike(null);
  11807. * // => false
  11808. */
  11809. function isObjectLike(value) {
  11810. return !!value && typeof value == 'object';
  11811. }
  11812. /**
  11813. * Checks if `value` is classified as a `Symbol` primitive or object.
  11814. *
  11815. * @static
  11816. * @memberOf _
  11817. * @since 4.0.0
  11818. * @category Lang
  11819. * @param {*} value The value to check.
  11820. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  11821. * @example
  11822. *
  11823. * _.isSymbol(Symbol.iterator);
  11824. * // => true
  11825. *
  11826. * _.isSymbol('abc');
  11827. * // => false
  11828. */
  11829. function isSymbol(value) {
  11830. return typeof value == 'symbol' ||
  11831. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  11832. }
  11833. /**
  11834. * Converts `value` to a string. An empty string is returned for `null`
  11835. * and `undefined` values. The sign of `-0` is preserved.
  11836. *
  11837. * @static
  11838. * @memberOf _
  11839. * @since 4.0.0
  11840. * @category Lang
  11841. * @param {*} value The value to process.
  11842. * @returns {string} Returns the string.
  11843. * @example
  11844. *
  11845. * _.toString(null);
  11846. * // => ''
  11847. *
  11848. * _.toString(-0);
  11849. * // => '-0'
  11850. *
  11851. * _.toString([1, 2, 3]);
  11852. * // => '1,2,3'
  11853. */
  11854. function toString(value) {
  11855. return value == null ? '' : baseToString(value);
  11856. }
  11857. /**
  11858. * Gets the value at `path` of `object`. If the resolved value is
  11859. * `undefined`, the `defaultValue` is returned in its place.
  11860. *
  11861. * @static
  11862. * @memberOf _
  11863. * @since 3.7.0
  11864. * @category Object
  11865. * @param {Object} object The object to query.
  11866. * @param {Array|string} path The path of the property to get.
  11867. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  11868. * @returns {*} Returns the resolved value.
  11869. * @example
  11870. *
  11871. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  11872. *
  11873. * _.get(object, 'a[0].b.c');
  11874. * // => 3
  11875. *
  11876. * _.get(object, ['a', '0', 'b', 'c']);
  11877. * // => 3
  11878. *
  11879. * _.get(object, 'a.b.c', 'default');
  11880. * // => 'default'
  11881. */
  11882. function get(object, path, defaultValue) {
  11883. var result = object == null ? undefined : baseGet(object, path);
  11884. return result === undefined ? defaultValue : result;
  11885. }
  11886. module.exports = get;
  11887. /***/ }),
  11888. /***/ 855:
  11889. /***/ (function(module, __unusedexports, __webpack_require__) {
  11890. module.exports = registerPlugin;
  11891. const factory = __webpack_require__(47);
  11892. function registerPlugin(plugins, pluginFunction) {
  11893. return factory(
  11894. plugins.includes(pluginFunction) ? plugins : plugins.concat(pluginFunction)
  11895. );
  11896. }
  11897. /***/ }),
  11898. /***/ 856:
  11899. /***/ (function(module, __unusedexports, __webpack_require__) {
  11900. module.exports = __webpack_require__(141);
  11901. /***/ }),
  11902. /***/ 863:
  11903. /***/ (function(module, __unusedexports, __webpack_require__) {
  11904. module.exports = authenticationBeforeRequest;
  11905. const btoa = __webpack_require__(675);
  11906. const withAuthorizationPrefix = __webpack_require__(143);
  11907. function authenticationBeforeRequest(state, options) {
  11908. if (typeof state.auth === "string") {
  11909. options.headers.authorization = withAuthorizationPrefix(state.auth);
  11910. // https://developer.github.com/v3/previews/#integrations
  11911. if (
  11912. /^bearer /i.test(state.auth) &&
  11913. !/machine-man/.test(options.headers.accept)
  11914. ) {
  11915. const acceptHeaders = options.headers.accept
  11916. .split(",")
  11917. .concat("application/vnd.github.machine-man-preview+json");
  11918. options.headers.accept = acceptHeaders.filter(Boolean).join(",");
  11919. }
  11920. return;
  11921. }
  11922. if (state.auth.username) {
  11923. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  11924. options.headers.authorization = `Basic ${hash}`;
  11925. if (state.otp) {
  11926. options.headers["x-github-otp"] = state.otp;
  11927. }
  11928. return;
  11929. }
  11930. if (state.auth.clientId) {
  11931. // There is a special case for OAuth applications, when `clientId` and `clientSecret` is passed as
  11932. // Basic Authorization instead of query parameters. The only routes where that applies share the same
  11933. // URL though: `/applications/:client_id/tokens/:access_token`.
  11934. //
  11935. // 1. [Check an authorization](https://developer.github.com/v3/oauth_authorizations/#check-an-authorization)
  11936. // 2. [Reset an authorization](https://developer.github.com/v3/oauth_authorizations/#reset-an-authorization)
  11937. // 3. [Revoke an authorization for an application](https://developer.github.com/v3/oauth_authorizations/#revoke-an-authorization-for-an-application)
  11938. //
  11939. // We identify by checking the URL. It must merge both "/applications/:client_id/tokens/:access_token"
  11940. // as well as "/applications/123/tokens/token456"
  11941. if (/\/applications\/:?[\w_]+\/tokens\/:?[\w_]+($|\?)/.test(options.url)) {
  11942. const hash = btoa(`${state.auth.clientId}:${state.auth.clientSecret}`);
  11943. options.headers.authorization = `Basic ${hash}`;
  11944. return;
  11945. }
  11946. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  11947. options.url += `client_id=${state.auth.clientId}&client_secret=${state.auth.clientSecret}`;
  11948. return;
  11949. }
  11950. return Promise.resolve()
  11951. .then(() => {
  11952. return state.auth();
  11953. })
  11954. .then(authorization => {
  11955. options.headers.authorization = withAuthorizationPrefix(authorization);
  11956. });
  11957. }
  11958. /***/ }),
  11959. /***/ 866:
  11960. /***/ (function(module, __unusedexports, __webpack_require__) {
  11961. "use strict";
  11962. var shebangRegex = __webpack_require__(816);
  11963. module.exports = function (str) {
  11964. var match = str.match(shebangRegex);
  11965. if (!match) {
  11966. return null;
  11967. }
  11968. var arr = match[0].replace(/#! ?/, '').split(' ');
  11969. var bin = arr[0].split('/').pop();
  11970. var arg = arr[1];
  11971. return (bin === 'env' ?
  11972. arg :
  11973. bin + (arg ? ' ' + arg : '')
  11974. );
  11975. };
  11976. /***/ }),
  11977. /***/ 874:
  11978. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  11979. "use strict";
  11980. // Copyright (c) Microsoft. All rights reserved.
  11981. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
  11982. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  11983. return new (P || (P = Promise))(function (resolve, reject) {
  11984. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  11985. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  11986. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  11987. step((generator = generator.apply(thisArg, _arguments || [])).next());
  11988. });
  11989. };
  11990. Object.defineProperty(exports, "__esModule", { value: true });
  11991. const url = __webpack_require__(835);
  11992. const http = __webpack_require__(605);
  11993. const https = __webpack_require__(211);
  11994. let fs;
  11995. let tunnel;
  11996. var HttpCodes;
  11997. (function (HttpCodes) {
  11998. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  11999. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  12000. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  12001. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  12002. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  12003. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  12004. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  12005. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  12006. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  12007. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  12008. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  12009. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  12010. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  12011. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  12012. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  12013. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  12014. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  12015. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  12016. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  12017. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  12018. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  12019. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  12020. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  12021. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  12022. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  12023. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  12024. })(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
  12025. const HttpRedirectCodes = [HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect];
  12026. const HttpResponseRetryCodes = [HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout];
  12027. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  12028. const ExponentialBackoffCeiling = 10;
  12029. const ExponentialBackoffTimeSlice = 5;
  12030. class HttpClientResponse {
  12031. constructor(message) {
  12032. this.message = message;
  12033. }
  12034. readBody() {
  12035. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  12036. let output = '';
  12037. this.message.on('data', (chunk) => {
  12038. output += chunk;
  12039. });
  12040. this.message.on('end', () => {
  12041. resolve(output);
  12042. });
  12043. }));
  12044. }
  12045. }
  12046. exports.HttpClientResponse = HttpClientResponse;
  12047. function isHttps(requestUrl) {
  12048. let parsedUrl = url.parse(requestUrl);
  12049. return parsedUrl.protocol === 'https:';
  12050. }
  12051. exports.isHttps = isHttps;
  12052. var EnvironmentVariables;
  12053. (function (EnvironmentVariables) {
  12054. EnvironmentVariables["HTTP_PROXY"] = "HTTP_PROXY";
  12055. EnvironmentVariables["HTTPS_PROXY"] = "HTTPS_PROXY";
  12056. })(EnvironmentVariables || (EnvironmentVariables = {}));
  12057. class HttpClient {
  12058. constructor(userAgent, handlers, requestOptions) {
  12059. this._ignoreSslError = false;
  12060. this._allowRedirects = true;
  12061. this._maxRedirects = 50;
  12062. this._allowRetries = false;
  12063. this._maxRetries = 1;
  12064. this._keepAlive = false;
  12065. this._disposed = false;
  12066. this.userAgent = userAgent;
  12067. this.handlers = handlers || [];
  12068. this.requestOptions = requestOptions;
  12069. if (requestOptions) {
  12070. if (requestOptions.ignoreSslError != null) {
  12071. this._ignoreSslError = requestOptions.ignoreSslError;
  12072. }
  12073. this._socketTimeout = requestOptions.socketTimeout;
  12074. this._httpProxy = requestOptions.proxy;
  12075. if (requestOptions.proxy && requestOptions.proxy.proxyBypassHosts) {
  12076. this._httpProxyBypassHosts = [];
  12077. requestOptions.proxy.proxyBypassHosts.forEach(bypass => {
  12078. this._httpProxyBypassHosts.push(new RegExp(bypass, 'i'));
  12079. });
  12080. }
  12081. this._certConfig = requestOptions.cert;
  12082. if (this._certConfig) {
  12083. // If using cert, need fs
  12084. fs = __webpack_require__(747);
  12085. // cache the cert content into memory, so we don't have to read it from disk every time
  12086. if (this._certConfig.caFile && fs.existsSync(this._certConfig.caFile)) {
  12087. this._ca = fs.readFileSync(this._certConfig.caFile, 'utf8');
  12088. }
  12089. if (this._certConfig.certFile && fs.existsSync(this._certConfig.certFile)) {
  12090. this._cert = fs.readFileSync(this._certConfig.certFile, 'utf8');
  12091. }
  12092. if (this._certConfig.keyFile && fs.existsSync(this._certConfig.keyFile)) {
  12093. this._key = fs.readFileSync(this._certConfig.keyFile, 'utf8');
  12094. }
  12095. }
  12096. if (requestOptions.allowRedirects != null) {
  12097. this._allowRedirects = requestOptions.allowRedirects;
  12098. }
  12099. if (requestOptions.maxRedirects != null) {
  12100. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  12101. }
  12102. if (requestOptions.keepAlive != null) {
  12103. this._keepAlive = requestOptions.keepAlive;
  12104. }
  12105. if (requestOptions.allowRetries != null) {
  12106. this._allowRetries = requestOptions.allowRetries;
  12107. }
  12108. if (requestOptions.maxRetries != null) {
  12109. this._maxRetries = requestOptions.maxRetries;
  12110. }
  12111. }
  12112. }
  12113. options(requestUrl, additionalHeaders) {
  12114. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  12115. }
  12116. get(requestUrl, additionalHeaders) {
  12117. return this.request('GET', requestUrl, null, additionalHeaders || {});
  12118. }
  12119. del(requestUrl, additionalHeaders) {
  12120. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  12121. }
  12122. post(requestUrl, data, additionalHeaders) {
  12123. return this.request('POST', requestUrl, data, additionalHeaders || {});
  12124. }
  12125. patch(requestUrl, data, additionalHeaders) {
  12126. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  12127. }
  12128. put(requestUrl, data, additionalHeaders) {
  12129. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  12130. }
  12131. head(requestUrl, additionalHeaders) {
  12132. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  12133. }
  12134. sendStream(verb, requestUrl, stream, additionalHeaders) {
  12135. return this.request(verb, requestUrl, stream, additionalHeaders);
  12136. }
  12137. /**
  12138. * Makes a raw http request.
  12139. * All other methods such as get, post, patch, and request ultimately call this.
  12140. * Prefer get, del, post and patch
  12141. */
  12142. request(verb, requestUrl, data, headers) {
  12143. return __awaiter(this, void 0, void 0, function* () {
  12144. if (this._disposed) {
  12145. throw new Error("Client has already been disposed.");
  12146. }
  12147. let info = this._prepareRequest(verb, requestUrl, headers);
  12148. // Only perform retries on reads since writes may not be idempotent.
  12149. let maxTries = (this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1) ? this._maxRetries + 1 : 1;
  12150. let numTries = 0;
  12151. let response;
  12152. while (numTries < maxTries) {
  12153. response = yield this.requestRaw(info, data);
  12154. // Check if it's an authentication challenge
  12155. if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) {
  12156. let authenticationHandler;
  12157. for (let i = 0; i < this.handlers.length; i++) {
  12158. if (this.handlers[i].canHandleAuthentication(response)) {
  12159. authenticationHandler = this.handlers[i];
  12160. break;
  12161. }
  12162. }
  12163. if (authenticationHandler) {
  12164. return authenticationHandler.handleAuthentication(this, info, data);
  12165. }
  12166. else {
  12167. // We have received an unauthorized response but have no handlers to handle it.
  12168. // Let the response return to the caller.
  12169. return response;
  12170. }
  12171. }
  12172. let redirectsRemaining = this._maxRedirects;
  12173. while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1
  12174. && this._allowRedirects
  12175. && redirectsRemaining > 0) {
  12176. const redirectUrl = response.message.headers["location"];
  12177. if (!redirectUrl) {
  12178. // if there's no location to redirect to, we won't
  12179. break;
  12180. }
  12181. // we need to finish reading the response before reassigning response
  12182. // which will leak the open socket.
  12183. yield response.readBody();
  12184. // let's make the request with the new redirectUrl
  12185. info = this._prepareRequest(verb, redirectUrl, headers);
  12186. response = yield this.requestRaw(info, data);
  12187. redirectsRemaining--;
  12188. }
  12189. if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {
  12190. // If not a retry code, return immediately instead of retrying
  12191. return response;
  12192. }
  12193. numTries += 1;
  12194. if (numTries < maxTries) {
  12195. yield response.readBody();
  12196. yield this._performExponentialBackoff(numTries);
  12197. }
  12198. }
  12199. return response;
  12200. });
  12201. }
  12202. /**
  12203. * Needs to be called if keepAlive is set to true in request options.
  12204. */
  12205. dispose() {
  12206. if (this._agent) {
  12207. this._agent.destroy();
  12208. }
  12209. this._disposed = true;
  12210. }
  12211. /**
  12212. * Raw request.
  12213. * @param info
  12214. * @param data
  12215. */
  12216. requestRaw(info, data) {
  12217. return new Promise((resolve, reject) => {
  12218. let callbackForResult = function (err, res) {
  12219. if (err) {
  12220. reject(err);
  12221. }
  12222. resolve(res);
  12223. };
  12224. this.requestRawWithCallback(info, data, callbackForResult);
  12225. });
  12226. }
  12227. /**
  12228. * Raw request with callback.
  12229. * @param info
  12230. * @param data
  12231. * @param onResult
  12232. */
  12233. requestRawWithCallback(info, data, onResult) {
  12234. let socket;
  12235. let isDataString = typeof (data) === 'string';
  12236. if (typeof (data) === 'string') {
  12237. info.options.headers["Content-Length"] = Buffer.byteLength(data, 'utf8');
  12238. }
  12239. let callbackCalled = false;
  12240. let handleResult = (err, res) => {
  12241. if (!callbackCalled) {
  12242. callbackCalled = true;
  12243. onResult(err, res);
  12244. }
  12245. };
  12246. let req = info.httpModule.request(info.options, (msg) => {
  12247. let res = new HttpClientResponse(msg);
  12248. handleResult(null, res);
  12249. });
  12250. req.on('socket', (sock) => {
  12251. socket = sock;
  12252. });
  12253. // If we ever get disconnected, we want the socket to timeout eventually
  12254. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  12255. if (socket) {
  12256. socket.end();
  12257. }
  12258. handleResult(new Error('Request timeout: ' + info.options.path), null);
  12259. });
  12260. req.on('error', function (err) {
  12261. // err has statusCode property
  12262. // res should have headers
  12263. handleResult(err, null);
  12264. });
  12265. if (data && typeof (data) === 'string') {
  12266. req.write(data, 'utf8');
  12267. }
  12268. if (data && typeof (data) !== 'string') {
  12269. data.on('close', function () {
  12270. req.end();
  12271. });
  12272. data.pipe(req);
  12273. }
  12274. else {
  12275. req.end();
  12276. }
  12277. }
  12278. _prepareRequest(method, requestUrl, headers) {
  12279. const info = {};
  12280. info.parsedUrl = url.parse(requestUrl);
  12281. const usingSsl = info.parsedUrl.protocol === 'https:';
  12282. info.httpModule = usingSsl ? https : http;
  12283. const defaultPort = usingSsl ? 443 : 80;
  12284. info.options = {};
  12285. info.options.host = info.parsedUrl.hostname;
  12286. info.options.port = info.parsedUrl.port ? parseInt(info.parsedUrl.port) : defaultPort;
  12287. info.options.path = (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  12288. info.options.method = method;
  12289. info.options.headers = this._mergeHeaders(headers);
  12290. info.options.headers["user-agent"] = this.userAgent;
  12291. info.options.agent = this._getAgent(requestUrl);
  12292. // gives handlers an opportunity to participate
  12293. if (this.handlers && !this._isPresigned(requestUrl)) {
  12294. this.handlers.forEach((handler) => {
  12295. handler.prepareRequest(info.options);
  12296. });
  12297. }
  12298. return info;
  12299. }
  12300. _isPresigned(requestUrl) {
  12301. if (this.requestOptions && this.requestOptions.presignedUrlPatterns) {
  12302. const patterns = this.requestOptions.presignedUrlPatterns;
  12303. for (let i = 0; i < patterns.length; i++) {
  12304. if (requestUrl.match(patterns[i])) {
  12305. return true;
  12306. }
  12307. }
  12308. }
  12309. return false;
  12310. }
  12311. _mergeHeaders(headers) {
  12312. const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {});
  12313. if (this.requestOptions && this.requestOptions.headers) {
  12314. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
  12315. }
  12316. return lowercaseKeys(headers || {});
  12317. }
  12318. _getAgent(requestUrl) {
  12319. let agent;
  12320. let proxy = this._getProxy(requestUrl);
  12321. let useProxy = proxy.proxyUrl && proxy.proxyUrl.hostname && !this._isBypassProxy(requestUrl);
  12322. if (this._keepAlive && useProxy) {
  12323. agent = this._proxyAgent;
  12324. }
  12325. if (this._keepAlive && !useProxy) {
  12326. agent = this._agent;
  12327. }
  12328. // if agent is already assigned use that agent.
  12329. if (!!agent) {
  12330. return agent;
  12331. }
  12332. let parsedUrl = url.parse(requestUrl);
  12333. const usingSsl = parsedUrl.protocol === 'https:';
  12334. let maxSockets = 100;
  12335. if (!!this.requestOptions) {
  12336. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  12337. }
  12338. if (useProxy) {
  12339. // If using proxy, need tunnel
  12340. if (!tunnel) {
  12341. tunnel = __webpack_require__(856);
  12342. }
  12343. const agentOptions = {
  12344. maxSockets: maxSockets,
  12345. keepAlive: this._keepAlive,
  12346. proxy: {
  12347. proxyAuth: proxy.proxyAuth,
  12348. host: proxy.proxyUrl.hostname,
  12349. port: proxy.proxyUrl.port
  12350. },
  12351. };
  12352. let tunnelAgent;
  12353. const overHttps = proxy.proxyUrl.protocol === 'https:';
  12354. if (usingSsl) {
  12355. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  12356. }
  12357. else {
  12358. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  12359. }
  12360. agent = tunnelAgent(agentOptions);
  12361. this._proxyAgent = agent;
  12362. }
  12363. // if reusing agent across request and tunneling agent isn't assigned create a new agent
  12364. if (this._keepAlive && !agent) {
  12365. const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };
  12366. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  12367. this._agent = agent;
  12368. }
  12369. // if not using private agent and tunnel agent isn't setup then use global agent
  12370. if (!agent) {
  12371. agent = usingSsl ? https.globalAgent : http.globalAgent;
  12372. }
  12373. if (usingSsl && this._ignoreSslError) {
  12374. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  12375. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  12376. // we have to cast it to any and change it directly
  12377. agent.options = Object.assign(agent.options || {}, { rejectUnauthorized: false });
  12378. }
  12379. if (usingSsl && this._certConfig) {
  12380. agent.options = Object.assign(agent.options || {}, { ca: this._ca, cert: this._cert, key: this._key, passphrase: this._certConfig.passphrase });
  12381. }
  12382. return agent;
  12383. }
  12384. _getProxy(requestUrl) {
  12385. const parsedUrl = url.parse(requestUrl);
  12386. let usingSsl = parsedUrl.protocol === 'https:';
  12387. let proxyConfig = this._httpProxy;
  12388. // fallback to http_proxy and https_proxy env
  12389. let https_proxy = process.env[EnvironmentVariables.HTTPS_PROXY];
  12390. let http_proxy = process.env[EnvironmentVariables.HTTP_PROXY];
  12391. if (!proxyConfig) {
  12392. if (https_proxy && usingSsl) {
  12393. proxyConfig = {
  12394. proxyUrl: https_proxy
  12395. };
  12396. }
  12397. else if (http_proxy) {
  12398. proxyConfig = {
  12399. proxyUrl: http_proxy
  12400. };
  12401. }
  12402. }
  12403. let proxyUrl;
  12404. let proxyAuth;
  12405. if (proxyConfig) {
  12406. if (proxyConfig.proxyUrl.length > 0) {
  12407. proxyUrl = url.parse(proxyConfig.proxyUrl);
  12408. }
  12409. if (proxyConfig.proxyUsername || proxyConfig.proxyPassword) {
  12410. proxyAuth = proxyConfig.proxyUsername + ":" + proxyConfig.proxyPassword;
  12411. }
  12412. }
  12413. return { proxyUrl: proxyUrl, proxyAuth: proxyAuth };
  12414. }
  12415. _isBypassProxy(requestUrl) {
  12416. if (!this._httpProxyBypassHosts) {
  12417. return false;
  12418. }
  12419. let bypass = false;
  12420. this._httpProxyBypassHosts.forEach(bypassHost => {
  12421. if (bypassHost.test(requestUrl)) {
  12422. bypass = true;
  12423. }
  12424. });
  12425. return bypass;
  12426. }
  12427. _performExponentialBackoff(retryNumber) {
  12428. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  12429. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  12430. return new Promise(resolve => setTimeout(() => resolve(), ms));
  12431. }
  12432. }
  12433. exports.HttpClient = HttpClient;
  12434. /***/ }),
  12435. /***/ 881:
  12436. /***/ (function(module) {
  12437. "use strict";
  12438. const isWin = process.platform === 'win32';
  12439. function notFoundError(original, syscall) {
  12440. return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
  12441. code: 'ENOENT',
  12442. errno: 'ENOENT',
  12443. syscall: `${syscall} ${original.command}`,
  12444. path: original.command,
  12445. spawnargs: original.args,
  12446. });
  12447. }
  12448. function hookChildProcess(cp, parsed) {
  12449. if (!isWin) {
  12450. return;
  12451. }
  12452. const originalEmit = cp.emit;
  12453. cp.emit = function (name, arg1) {
  12454. // If emitting "exit" event and exit code is 1, we need to check if
  12455. // the command exists and emit an "error" instead
  12456. // See https://github.com/IndigoUnited/node-cross-spawn/issues/16
  12457. if (name === 'exit') {
  12458. const err = verifyENOENT(arg1, parsed, 'spawn');
  12459. if (err) {
  12460. return originalEmit.call(cp, 'error', err);
  12461. }
  12462. }
  12463. return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params
  12464. };
  12465. }
  12466. function verifyENOENT(status, parsed) {
  12467. if (isWin && status === 1 && !parsed.file) {
  12468. return notFoundError(parsed.original, 'spawn');
  12469. }
  12470. return null;
  12471. }
  12472. function verifyENOENTSync(status, parsed) {
  12473. if (isWin && status === 1 && !parsed.file) {
  12474. return notFoundError(parsed.original, 'spawnSync');
  12475. }
  12476. return null;
  12477. }
  12478. module.exports = {
  12479. hookChildProcess,
  12480. verifyENOENT,
  12481. verifyENOENTSync,
  12482. notFoundError,
  12483. };
  12484. /***/ }),
  12485. /***/ 883:
  12486. /***/ (function(module) {
  12487. /**
  12488. * lodash (Custom Build) <https://lodash.com/>
  12489. * Build: `lodash modularize exports="npm" -o ./`
  12490. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  12491. * Released under MIT license <https://lodash.com/license>
  12492. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  12493. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  12494. */
  12495. /** Used as the `TypeError` message for "Functions" methods. */
  12496. var FUNC_ERROR_TEXT = 'Expected a function';
  12497. /** Used to stand-in for `undefined` hash values. */
  12498. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  12499. /** Used as references for various `Number` constants. */
  12500. var INFINITY = 1 / 0,
  12501. MAX_SAFE_INTEGER = 9007199254740991;
  12502. /** `Object#toString` result references. */
  12503. var funcTag = '[object Function]',
  12504. genTag = '[object GeneratorFunction]',
  12505. symbolTag = '[object Symbol]';
  12506. /** Used to match property names within property paths. */
  12507. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  12508. reIsPlainProp = /^\w*$/,
  12509. reLeadingDot = /^\./,
  12510. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  12511. /**
  12512. * Used to match `RegExp`
  12513. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  12514. */
  12515. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  12516. /** Used to match backslashes in property paths. */
  12517. var reEscapeChar = /\\(\\)?/g;
  12518. /** Used to detect host constructors (Safari). */
  12519. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  12520. /** Used to detect unsigned integer values. */
  12521. var reIsUint = /^(?:0|[1-9]\d*)$/;
  12522. /** Detect free variable `global` from Node.js. */
  12523. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  12524. /** Detect free variable `self`. */
  12525. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  12526. /** Used as a reference to the global object. */
  12527. var root = freeGlobal || freeSelf || Function('return this')();
  12528. /**
  12529. * Gets the value at `key` of `object`.
  12530. *
  12531. * @private
  12532. * @param {Object} [object] The object to query.
  12533. * @param {string} key The key of the property to get.
  12534. * @returns {*} Returns the property value.
  12535. */
  12536. function getValue(object, key) {
  12537. return object == null ? undefined : object[key];
  12538. }
  12539. /**
  12540. * Checks if `value` is a host object in IE < 9.
  12541. *
  12542. * @private
  12543. * @param {*} value The value to check.
  12544. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  12545. */
  12546. function isHostObject(value) {
  12547. // Many host objects are `Object` objects that can coerce to strings
  12548. // despite having improperly defined `toString` methods.
  12549. var result = false;
  12550. if (value != null && typeof value.toString != 'function') {
  12551. try {
  12552. result = !!(value + '');
  12553. } catch (e) {}
  12554. }
  12555. return result;
  12556. }
  12557. /** Used for built-in method references. */
  12558. var arrayProto = Array.prototype,
  12559. funcProto = Function.prototype,
  12560. objectProto = Object.prototype;
  12561. /** Used to detect overreaching core-js shims. */
  12562. var coreJsData = root['__core-js_shared__'];
  12563. /** Used to detect methods masquerading as native. */
  12564. var maskSrcKey = (function() {
  12565. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  12566. return uid ? ('Symbol(src)_1.' + uid) : '';
  12567. }());
  12568. /** Used to resolve the decompiled source of functions. */
  12569. var funcToString = funcProto.toString;
  12570. /** Used to check objects for own properties. */
  12571. var hasOwnProperty = objectProto.hasOwnProperty;
  12572. /**
  12573. * Used to resolve the
  12574. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  12575. * of values.
  12576. */
  12577. var objectToString = objectProto.toString;
  12578. /** Used to detect if a method is native. */
  12579. var reIsNative = RegExp('^' +
  12580. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  12581. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  12582. );
  12583. /** Built-in value references. */
  12584. var Symbol = root.Symbol,
  12585. splice = arrayProto.splice;
  12586. /* Built-in method references that are verified to be native. */
  12587. var Map = getNative(root, 'Map'),
  12588. nativeCreate = getNative(Object, 'create');
  12589. /** Used to convert symbols to primitives and strings. */
  12590. var symbolProto = Symbol ? Symbol.prototype : undefined,
  12591. symbolToString = symbolProto ? symbolProto.toString : undefined;
  12592. /**
  12593. * Creates a hash object.
  12594. *
  12595. * @private
  12596. * @constructor
  12597. * @param {Array} [entries] The key-value pairs to cache.
  12598. */
  12599. function Hash(entries) {
  12600. var index = -1,
  12601. length = entries ? entries.length : 0;
  12602. this.clear();
  12603. while (++index < length) {
  12604. var entry = entries[index];
  12605. this.set(entry[0], entry[1]);
  12606. }
  12607. }
  12608. /**
  12609. * Removes all key-value entries from the hash.
  12610. *
  12611. * @private
  12612. * @name clear
  12613. * @memberOf Hash
  12614. */
  12615. function hashClear() {
  12616. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  12617. }
  12618. /**
  12619. * Removes `key` and its value from the hash.
  12620. *
  12621. * @private
  12622. * @name delete
  12623. * @memberOf Hash
  12624. * @param {Object} hash The hash to modify.
  12625. * @param {string} key The key of the value to remove.
  12626. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  12627. */
  12628. function hashDelete(key) {
  12629. return this.has(key) && delete this.__data__[key];
  12630. }
  12631. /**
  12632. * Gets the hash value for `key`.
  12633. *
  12634. * @private
  12635. * @name get
  12636. * @memberOf Hash
  12637. * @param {string} key The key of the value to get.
  12638. * @returns {*} Returns the entry value.
  12639. */
  12640. function hashGet(key) {
  12641. var data = this.__data__;
  12642. if (nativeCreate) {
  12643. var result = data[key];
  12644. return result === HASH_UNDEFINED ? undefined : result;
  12645. }
  12646. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  12647. }
  12648. /**
  12649. * Checks if a hash value for `key` exists.
  12650. *
  12651. * @private
  12652. * @name has
  12653. * @memberOf Hash
  12654. * @param {string} key The key of the entry to check.
  12655. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  12656. */
  12657. function hashHas(key) {
  12658. var data = this.__data__;
  12659. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  12660. }
  12661. /**
  12662. * Sets the hash `key` to `value`.
  12663. *
  12664. * @private
  12665. * @name set
  12666. * @memberOf Hash
  12667. * @param {string} key The key of the value to set.
  12668. * @param {*} value The value to set.
  12669. * @returns {Object} Returns the hash instance.
  12670. */
  12671. function hashSet(key, value) {
  12672. var data = this.__data__;
  12673. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  12674. return this;
  12675. }
  12676. // Add methods to `Hash`.
  12677. Hash.prototype.clear = hashClear;
  12678. Hash.prototype['delete'] = hashDelete;
  12679. Hash.prototype.get = hashGet;
  12680. Hash.prototype.has = hashHas;
  12681. Hash.prototype.set = hashSet;
  12682. /**
  12683. * Creates an list cache object.
  12684. *
  12685. * @private
  12686. * @constructor
  12687. * @param {Array} [entries] The key-value pairs to cache.
  12688. */
  12689. function ListCache(entries) {
  12690. var index = -1,
  12691. length = entries ? entries.length : 0;
  12692. this.clear();
  12693. while (++index < length) {
  12694. var entry = entries[index];
  12695. this.set(entry[0], entry[1]);
  12696. }
  12697. }
  12698. /**
  12699. * Removes all key-value entries from the list cache.
  12700. *
  12701. * @private
  12702. * @name clear
  12703. * @memberOf ListCache
  12704. */
  12705. function listCacheClear() {
  12706. this.__data__ = [];
  12707. }
  12708. /**
  12709. * Removes `key` and its value from the list cache.
  12710. *
  12711. * @private
  12712. * @name delete
  12713. * @memberOf ListCache
  12714. * @param {string} key The key of the value to remove.
  12715. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  12716. */
  12717. function listCacheDelete(key) {
  12718. var data = this.__data__,
  12719. index = assocIndexOf(data, key);
  12720. if (index < 0) {
  12721. return false;
  12722. }
  12723. var lastIndex = data.length - 1;
  12724. if (index == lastIndex) {
  12725. data.pop();
  12726. } else {
  12727. splice.call(data, index, 1);
  12728. }
  12729. return true;
  12730. }
  12731. /**
  12732. * Gets the list cache value for `key`.
  12733. *
  12734. * @private
  12735. * @name get
  12736. * @memberOf ListCache
  12737. * @param {string} key The key of the value to get.
  12738. * @returns {*} Returns the entry value.
  12739. */
  12740. function listCacheGet(key) {
  12741. var data = this.__data__,
  12742. index = assocIndexOf(data, key);
  12743. return index < 0 ? undefined : data[index][1];
  12744. }
  12745. /**
  12746. * Checks if a list cache value for `key` exists.
  12747. *
  12748. * @private
  12749. * @name has
  12750. * @memberOf ListCache
  12751. * @param {string} key The key of the entry to check.
  12752. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  12753. */
  12754. function listCacheHas(key) {
  12755. return assocIndexOf(this.__data__, key) > -1;
  12756. }
  12757. /**
  12758. * Sets the list cache `key` to `value`.
  12759. *
  12760. * @private
  12761. * @name set
  12762. * @memberOf ListCache
  12763. * @param {string} key The key of the value to set.
  12764. * @param {*} value The value to set.
  12765. * @returns {Object} Returns the list cache instance.
  12766. */
  12767. function listCacheSet(key, value) {
  12768. var data = this.__data__,
  12769. index = assocIndexOf(data, key);
  12770. if (index < 0) {
  12771. data.push([key, value]);
  12772. } else {
  12773. data[index][1] = value;
  12774. }
  12775. return this;
  12776. }
  12777. // Add methods to `ListCache`.
  12778. ListCache.prototype.clear = listCacheClear;
  12779. ListCache.prototype['delete'] = listCacheDelete;
  12780. ListCache.prototype.get = listCacheGet;
  12781. ListCache.prototype.has = listCacheHas;
  12782. ListCache.prototype.set = listCacheSet;
  12783. /**
  12784. * Creates a map cache object to store key-value pairs.
  12785. *
  12786. * @private
  12787. * @constructor
  12788. * @param {Array} [entries] The key-value pairs to cache.
  12789. */
  12790. function MapCache(entries) {
  12791. var index = -1,
  12792. length = entries ? entries.length : 0;
  12793. this.clear();
  12794. while (++index < length) {
  12795. var entry = entries[index];
  12796. this.set(entry[0], entry[1]);
  12797. }
  12798. }
  12799. /**
  12800. * Removes all key-value entries from the map.
  12801. *
  12802. * @private
  12803. * @name clear
  12804. * @memberOf MapCache
  12805. */
  12806. function mapCacheClear() {
  12807. this.__data__ = {
  12808. 'hash': new Hash,
  12809. 'map': new (Map || ListCache),
  12810. 'string': new Hash
  12811. };
  12812. }
  12813. /**
  12814. * Removes `key` and its value from the map.
  12815. *
  12816. * @private
  12817. * @name delete
  12818. * @memberOf MapCache
  12819. * @param {string} key The key of the value to remove.
  12820. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  12821. */
  12822. function mapCacheDelete(key) {
  12823. return getMapData(this, key)['delete'](key);
  12824. }
  12825. /**
  12826. * Gets the map value for `key`.
  12827. *
  12828. * @private
  12829. * @name get
  12830. * @memberOf MapCache
  12831. * @param {string} key The key of the value to get.
  12832. * @returns {*} Returns the entry value.
  12833. */
  12834. function mapCacheGet(key) {
  12835. return getMapData(this, key).get(key);
  12836. }
  12837. /**
  12838. * Checks if a map value for `key` exists.
  12839. *
  12840. * @private
  12841. * @name has
  12842. * @memberOf MapCache
  12843. * @param {string} key The key of the entry to check.
  12844. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  12845. */
  12846. function mapCacheHas(key) {
  12847. return getMapData(this, key).has(key);
  12848. }
  12849. /**
  12850. * Sets the map `key` to `value`.
  12851. *
  12852. * @private
  12853. * @name set
  12854. * @memberOf MapCache
  12855. * @param {string} key The key of the value to set.
  12856. * @param {*} value The value to set.
  12857. * @returns {Object} Returns the map cache instance.
  12858. */
  12859. function mapCacheSet(key, value) {
  12860. getMapData(this, key).set(key, value);
  12861. return this;
  12862. }
  12863. // Add methods to `MapCache`.
  12864. MapCache.prototype.clear = mapCacheClear;
  12865. MapCache.prototype['delete'] = mapCacheDelete;
  12866. MapCache.prototype.get = mapCacheGet;
  12867. MapCache.prototype.has = mapCacheHas;
  12868. MapCache.prototype.set = mapCacheSet;
  12869. /**
  12870. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  12871. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  12872. * for equality comparisons.
  12873. *
  12874. * @private
  12875. * @param {Object} object The object to modify.
  12876. * @param {string} key The key of the property to assign.
  12877. * @param {*} value The value to assign.
  12878. */
  12879. function assignValue(object, key, value) {
  12880. var objValue = object[key];
  12881. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  12882. (value === undefined && !(key in object))) {
  12883. object[key] = value;
  12884. }
  12885. }
  12886. /**
  12887. * Gets the index at which the `key` is found in `array` of key-value pairs.
  12888. *
  12889. * @private
  12890. * @param {Array} array The array to inspect.
  12891. * @param {*} key The key to search for.
  12892. * @returns {number} Returns the index of the matched value, else `-1`.
  12893. */
  12894. function assocIndexOf(array, key) {
  12895. var length = array.length;
  12896. while (length--) {
  12897. if (eq(array[length][0], key)) {
  12898. return length;
  12899. }
  12900. }
  12901. return -1;
  12902. }
  12903. /**
  12904. * The base implementation of `_.isNative` without bad shim checks.
  12905. *
  12906. * @private
  12907. * @param {*} value The value to check.
  12908. * @returns {boolean} Returns `true` if `value` is a native function,
  12909. * else `false`.
  12910. */
  12911. function baseIsNative(value) {
  12912. if (!isObject(value) || isMasked(value)) {
  12913. return false;
  12914. }
  12915. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  12916. return pattern.test(toSource(value));
  12917. }
  12918. /**
  12919. * The base implementation of `_.set`.
  12920. *
  12921. * @private
  12922. * @param {Object} object The object to modify.
  12923. * @param {Array|string} path The path of the property to set.
  12924. * @param {*} value The value to set.
  12925. * @param {Function} [customizer] The function to customize path creation.
  12926. * @returns {Object} Returns `object`.
  12927. */
  12928. function baseSet(object, path, value, customizer) {
  12929. if (!isObject(object)) {
  12930. return object;
  12931. }
  12932. path = isKey(path, object) ? [path] : castPath(path);
  12933. var index = -1,
  12934. length = path.length,
  12935. lastIndex = length - 1,
  12936. nested = object;
  12937. while (nested != null && ++index < length) {
  12938. var key = toKey(path[index]),
  12939. newValue = value;
  12940. if (index != lastIndex) {
  12941. var objValue = nested[key];
  12942. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  12943. if (newValue === undefined) {
  12944. newValue = isObject(objValue)
  12945. ? objValue
  12946. : (isIndex(path[index + 1]) ? [] : {});
  12947. }
  12948. }
  12949. assignValue(nested, key, newValue);
  12950. nested = nested[key];
  12951. }
  12952. return object;
  12953. }
  12954. /**
  12955. * The base implementation of `_.toString` which doesn't convert nullish
  12956. * values to empty strings.
  12957. *
  12958. * @private
  12959. * @param {*} value The value to process.
  12960. * @returns {string} Returns the string.
  12961. */
  12962. function baseToString(value) {
  12963. // Exit early for strings to avoid a performance hit in some environments.
  12964. if (typeof value == 'string') {
  12965. return value;
  12966. }
  12967. if (isSymbol(value)) {
  12968. return symbolToString ? symbolToString.call(value) : '';
  12969. }
  12970. var result = (value + '');
  12971. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  12972. }
  12973. /**
  12974. * Casts `value` to a path array if it's not one.
  12975. *
  12976. * @private
  12977. * @param {*} value The value to inspect.
  12978. * @returns {Array} Returns the cast property path array.
  12979. */
  12980. function castPath(value) {
  12981. return isArray(value) ? value : stringToPath(value);
  12982. }
  12983. /**
  12984. * Gets the data for `map`.
  12985. *
  12986. * @private
  12987. * @param {Object} map The map to query.
  12988. * @param {string} key The reference key.
  12989. * @returns {*} Returns the map data.
  12990. */
  12991. function getMapData(map, key) {
  12992. var data = map.__data__;
  12993. return isKeyable(key)
  12994. ? data[typeof key == 'string' ? 'string' : 'hash']
  12995. : data.map;
  12996. }
  12997. /**
  12998. * Gets the native function at `key` of `object`.
  12999. *
  13000. * @private
  13001. * @param {Object} object The object to query.
  13002. * @param {string} key The key of the method to get.
  13003. * @returns {*} Returns the function if it's native, else `undefined`.
  13004. */
  13005. function getNative(object, key) {
  13006. var value = getValue(object, key);
  13007. return baseIsNative(value) ? value : undefined;
  13008. }
  13009. /**
  13010. * Checks if `value` is a valid array-like index.
  13011. *
  13012. * @private
  13013. * @param {*} value The value to check.
  13014. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  13015. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  13016. */
  13017. function isIndex(value, length) {
  13018. length = length == null ? MAX_SAFE_INTEGER : length;
  13019. return !!length &&
  13020. (typeof value == 'number' || reIsUint.test(value)) &&
  13021. (value > -1 && value % 1 == 0 && value < length);
  13022. }
  13023. /**
  13024. * Checks if `value` is a property name and not a property path.
  13025. *
  13026. * @private
  13027. * @param {*} value The value to check.
  13028. * @param {Object} [object] The object to query keys on.
  13029. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  13030. */
  13031. function isKey(value, object) {
  13032. if (isArray(value)) {
  13033. return false;
  13034. }
  13035. var type = typeof value;
  13036. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  13037. value == null || isSymbol(value)) {
  13038. return true;
  13039. }
  13040. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  13041. (object != null && value in Object(object));
  13042. }
  13043. /**
  13044. * Checks if `value` is suitable for use as unique object key.
  13045. *
  13046. * @private
  13047. * @param {*} value The value to check.
  13048. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  13049. */
  13050. function isKeyable(value) {
  13051. var type = typeof value;
  13052. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  13053. ? (value !== '__proto__')
  13054. : (value === null);
  13055. }
  13056. /**
  13057. * Checks if `func` has its source masked.
  13058. *
  13059. * @private
  13060. * @param {Function} func The function to check.
  13061. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  13062. */
  13063. function isMasked(func) {
  13064. return !!maskSrcKey && (maskSrcKey in func);
  13065. }
  13066. /**
  13067. * Converts `string` to a property path array.
  13068. *
  13069. * @private
  13070. * @param {string} string The string to convert.
  13071. * @returns {Array} Returns the property path array.
  13072. */
  13073. var stringToPath = memoize(function(string) {
  13074. string = toString(string);
  13075. var result = [];
  13076. if (reLeadingDot.test(string)) {
  13077. result.push('');
  13078. }
  13079. string.replace(rePropName, function(match, number, quote, string) {
  13080. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  13081. });
  13082. return result;
  13083. });
  13084. /**
  13085. * Converts `value` to a string key if it's not a string or symbol.
  13086. *
  13087. * @private
  13088. * @param {*} value The value to inspect.
  13089. * @returns {string|symbol} Returns the key.
  13090. */
  13091. function toKey(value) {
  13092. if (typeof value == 'string' || isSymbol(value)) {
  13093. return value;
  13094. }
  13095. var result = (value + '');
  13096. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  13097. }
  13098. /**
  13099. * Converts `func` to its source code.
  13100. *
  13101. * @private
  13102. * @param {Function} func The function to process.
  13103. * @returns {string} Returns the source code.
  13104. */
  13105. function toSource(func) {
  13106. if (func != null) {
  13107. try {
  13108. return funcToString.call(func);
  13109. } catch (e) {}
  13110. try {
  13111. return (func + '');
  13112. } catch (e) {}
  13113. }
  13114. return '';
  13115. }
  13116. /**
  13117. * Creates a function that memoizes the result of `func`. If `resolver` is
  13118. * provided, it determines the cache key for storing the result based on the
  13119. * arguments provided to the memoized function. By default, the first argument
  13120. * provided to the memoized function is used as the map cache key. The `func`
  13121. * is invoked with the `this` binding of the memoized function.
  13122. *
  13123. * **Note:** The cache is exposed as the `cache` property on the memoized
  13124. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  13125. * constructor with one whose instances implement the
  13126. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  13127. * method interface of `delete`, `get`, `has`, and `set`.
  13128. *
  13129. * @static
  13130. * @memberOf _
  13131. * @since 0.1.0
  13132. * @category Function
  13133. * @param {Function} func The function to have its output memoized.
  13134. * @param {Function} [resolver] The function to resolve the cache key.
  13135. * @returns {Function} Returns the new memoized function.
  13136. * @example
  13137. *
  13138. * var object = { 'a': 1, 'b': 2 };
  13139. * var other = { 'c': 3, 'd': 4 };
  13140. *
  13141. * var values = _.memoize(_.values);
  13142. * values(object);
  13143. * // => [1, 2]
  13144. *
  13145. * values(other);
  13146. * // => [3, 4]
  13147. *
  13148. * object.a = 2;
  13149. * values(object);
  13150. * // => [1, 2]
  13151. *
  13152. * // Modify the result cache.
  13153. * values.cache.set(object, ['a', 'b']);
  13154. * values(object);
  13155. * // => ['a', 'b']
  13156. *
  13157. * // Replace `_.memoize.Cache`.
  13158. * _.memoize.Cache = WeakMap;
  13159. */
  13160. function memoize(func, resolver) {
  13161. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  13162. throw new TypeError(FUNC_ERROR_TEXT);
  13163. }
  13164. var memoized = function() {
  13165. var args = arguments,
  13166. key = resolver ? resolver.apply(this, args) : args[0],
  13167. cache = memoized.cache;
  13168. if (cache.has(key)) {
  13169. return cache.get(key);
  13170. }
  13171. var result = func.apply(this, args);
  13172. memoized.cache = cache.set(key, result);
  13173. return result;
  13174. };
  13175. memoized.cache = new (memoize.Cache || MapCache);
  13176. return memoized;
  13177. }
  13178. // Assign cache to `_.memoize`.
  13179. memoize.Cache = MapCache;
  13180. /**
  13181. * Performs a
  13182. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  13183. * comparison between two values to determine if they are equivalent.
  13184. *
  13185. * @static
  13186. * @memberOf _
  13187. * @since 4.0.0
  13188. * @category Lang
  13189. * @param {*} value The value to compare.
  13190. * @param {*} other The other value to compare.
  13191. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  13192. * @example
  13193. *
  13194. * var object = { 'a': 1 };
  13195. * var other = { 'a': 1 };
  13196. *
  13197. * _.eq(object, object);
  13198. * // => true
  13199. *
  13200. * _.eq(object, other);
  13201. * // => false
  13202. *
  13203. * _.eq('a', 'a');
  13204. * // => true
  13205. *
  13206. * _.eq('a', Object('a'));
  13207. * // => false
  13208. *
  13209. * _.eq(NaN, NaN);
  13210. * // => true
  13211. */
  13212. function eq(value, other) {
  13213. return value === other || (value !== value && other !== other);
  13214. }
  13215. /**
  13216. * Checks if `value` is classified as an `Array` object.
  13217. *
  13218. * @static
  13219. * @memberOf _
  13220. * @since 0.1.0
  13221. * @category Lang
  13222. * @param {*} value The value to check.
  13223. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  13224. * @example
  13225. *
  13226. * _.isArray([1, 2, 3]);
  13227. * // => true
  13228. *
  13229. * _.isArray(document.body.children);
  13230. * // => false
  13231. *
  13232. * _.isArray('abc');
  13233. * // => false
  13234. *
  13235. * _.isArray(_.noop);
  13236. * // => false
  13237. */
  13238. var isArray = Array.isArray;
  13239. /**
  13240. * Checks if `value` is classified as a `Function` object.
  13241. *
  13242. * @static
  13243. * @memberOf _
  13244. * @since 0.1.0
  13245. * @category Lang
  13246. * @param {*} value The value to check.
  13247. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  13248. * @example
  13249. *
  13250. * _.isFunction(_);
  13251. * // => true
  13252. *
  13253. * _.isFunction(/abc/);
  13254. * // => false
  13255. */
  13256. function isFunction(value) {
  13257. // The use of `Object#toString` avoids issues with the `typeof` operator
  13258. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  13259. var tag = isObject(value) ? objectToString.call(value) : '';
  13260. return tag == funcTag || tag == genTag;
  13261. }
  13262. /**
  13263. * Checks if `value` is the
  13264. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  13265. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  13266. *
  13267. * @static
  13268. * @memberOf _
  13269. * @since 0.1.0
  13270. * @category Lang
  13271. * @param {*} value The value to check.
  13272. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  13273. * @example
  13274. *
  13275. * _.isObject({});
  13276. * // => true
  13277. *
  13278. * _.isObject([1, 2, 3]);
  13279. * // => true
  13280. *
  13281. * _.isObject(_.noop);
  13282. * // => true
  13283. *
  13284. * _.isObject(null);
  13285. * // => false
  13286. */
  13287. function isObject(value) {
  13288. var type = typeof value;
  13289. return !!value && (type == 'object' || type == 'function');
  13290. }
  13291. /**
  13292. * Checks if `value` is object-like. A value is object-like if it's not `null`
  13293. * and has a `typeof` result of "object".
  13294. *
  13295. * @static
  13296. * @memberOf _
  13297. * @since 4.0.0
  13298. * @category Lang
  13299. * @param {*} value The value to check.
  13300. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  13301. * @example
  13302. *
  13303. * _.isObjectLike({});
  13304. * // => true
  13305. *
  13306. * _.isObjectLike([1, 2, 3]);
  13307. * // => true
  13308. *
  13309. * _.isObjectLike(_.noop);
  13310. * // => false
  13311. *
  13312. * _.isObjectLike(null);
  13313. * // => false
  13314. */
  13315. function isObjectLike(value) {
  13316. return !!value && typeof value == 'object';
  13317. }
  13318. /**
  13319. * Checks if `value` is classified as a `Symbol` primitive or object.
  13320. *
  13321. * @static
  13322. * @memberOf _
  13323. * @since 4.0.0
  13324. * @category Lang
  13325. * @param {*} value The value to check.
  13326. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  13327. * @example
  13328. *
  13329. * _.isSymbol(Symbol.iterator);
  13330. * // => true
  13331. *
  13332. * _.isSymbol('abc');
  13333. * // => false
  13334. */
  13335. function isSymbol(value) {
  13336. return typeof value == 'symbol' ||
  13337. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  13338. }
  13339. /**
  13340. * Converts `value` to a string. An empty string is returned for `null`
  13341. * and `undefined` values. The sign of `-0` is preserved.
  13342. *
  13343. * @static
  13344. * @memberOf _
  13345. * @since 4.0.0
  13346. * @category Lang
  13347. * @param {*} value The value to process.
  13348. * @returns {string} Returns the string.
  13349. * @example
  13350. *
  13351. * _.toString(null);
  13352. * // => ''
  13353. *
  13354. * _.toString(-0);
  13355. * // => '-0'
  13356. *
  13357. * _.toString([1, 2, 3]);
  13358. * // => '1,2,3'
  13359. */
  13360. function toString(value) {
  13361. return value == null ? '' : baseToString(value);
  13362. }
  13363. /**
  13364. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  13365. * it's created. Arrays are created for missing index properties while objects
  13366. * are created for all other missing properties. Use `_.setWith` to customize
  13367. * `path` creation.
  13368. *
  13369. * **Note:** This method mutates `object`.
  13370. *
  13371. * @static
  13372. * @memberOf _
  13373. * @since 3.7.0
  13374. * @category Object
  13375. * @param {Object} object The object to modify.
  13376. * @param {Array|string} path The path of the property to set.
  13377. * @param {*} value The value to set.
  13378. * @returns {Object} Returns `object`.
  13379. * @example
  13380. *
  13381. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13382. *
  13383. * _.set(object, 'a[0].b.c', 4);
  13384. * console.log(object.a[0].b.c);
  13385. * // => 4
  13386. *
  13387. * _.set(object, ['x', '0', 'y', 'z'], 5);
  13388. * console.log(object.x[0].y.z);
  13389. * // => 5
  13390. */
  13391. function set(object, path, value) {
  13392. return object == null ? object : baseSet(object, path, value);
  13393. }
  13394. module.exports = set;
  13395. /***/ }),
  13396. /***/ 898:
  13397. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  13398. "use strict";
  13399. Object.defineProperty(exports, '__esModule', { value: true });
  13400. var request = __webpack_require__(753);
  13401. var universalUserAgent = __webpack_require__(796);
  13402. const VERSION = "4.3.1";
  13403. class GraphqlError extends Error {
  13404. constructor(request, response) {
  13405. const message = response.data.errors[0].message;
  13406. super(message);
  13407. Object.assign(this, response.data);
  13408. this.name = "GraphqlError";
  13409. this.request = request; // Maintains proper stack trace (only available on V8)
  13410. /* istanbul ignore next */
  13411. if (Error.captureStackTrace) {
  13412. Error.captureStackTrace(this, this.constructor);
  13413. }
  13414. }
  13415. }
  13416. const NON_VARIABLE_OPTIONS = ["method", "baseUrl", "url", "headers", "request", "query"];
  13417. function graphql(request, query, options) {
  13418. options = typeof query === "string" ? options = Object.assign({
  13419. query
  13420. }, options) : options = query;
  13421. const requestOptions = Object.keys(options).reduce((result, key) => {
  13422. if (NON_VARIABLE_OPTIONS.includes(key)) {
  13423. result[key] = options[key];
  13424. return result;
  13425. }
  13426. if (!result.variables) {
  13427. result.variables = {};
  13428. }
  13429. result.variables[key] = options[key];
  13430. return result;
  13431. }, {});
  13432. return request(requestOptions).then(response => {
  13433. if (response.data.errors) {
  13434. throw new GraphqlError(requestOptions, {
  13435. data: response.data
  13436. });
  13437. }
  13438. return response.data.data;
  13439. });
  13440. }
  13441. function withDefaults(request$1, newDefaults) {
  13442. const newRequest = request$1.defaults(newDefaults);
  13443. const newApi = (query, options) => {
  13444. return graphql(newRequest, query, options);
  13445. };
  13446. return Object.assign(newApi, {
  13447. defaults: withDefaults.bind(null, newRequest),
  13448. endpoint: request.request.endpoint
  13449. });
  13450. }
  13451. const graphql$1 = withDefaults(request.request, {
  13452. headers: {
  13453. "user-agent": `octokit-graphql.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  13454. },
  13455. method: "POST",
  13456. url: "/graphql"
  13457. });
  13458. function withCustomRequest(customRequest) {
  13459. return withDefaults(customRequest, {
  13460. method: "POST",
  13461. url: "/graphql"
  13462. });
  13463. }
  13464. exports.graphql = graphql$1;
  13465. exports.withCustomRequest = withCustomRequest;
  13466. //# sourceMappingURL=index.js.map
  13467. /***/ }),
  13468. /***/ 899:
  13469. /***/ (function(module, __unusedexports, __webpack_require__) {
  13470. module.exports = registerEndpoints;
  13471. const { Deprecation } = __webpack_require__(692);
  13472. function registerEndpoints(octokit, routes) {
  13473. Object.keys(routes).forEach(namespaceName => {
  13474. if (!octokit[namespaceName]) {
  13475. octokit[namespaceName] = {};
  13476. }
  13477. Object.keys(routes[namespaceName]).forEach(apiName => {
  13478. const apiOptions = routes[namespaceName][apiName];
  13479. const endpointDefaults = ["method", "url", "headers"].reduce(
  13480. (map, key) => {
  13481. if (typeof apiOptions[key] !== "undefined") {
  13482. map[key] = apiOptions[key];
  13483. }
  13484. return map;
  13485. },
  13486. {}
  13487. );
  13488. endpointDefaults.request = {
  13489. validate: apiOptions.params
  13490. };
  13491. let request = octokit.request.defaults(endpointDefaults);
  13492. // patch request & endpoint methods to support deprecated parameters.
  13493. // Not the most elegant solution, but we don’t want to move deprecation
  13494. // logic into octokit/endpoint.js as it’s out of scope
  13495. const hasDeprecatedParam = Object.keys(apiOptions.params || {}).find(
  13496. key => apiOptions.params[key].deprecated
  13497. );
  13498. if (hasDeprecatedParam) {
  13499. const patch = patchForDeprecation.bind(null, octokit, apiOptions);
  13500. request = patch(
  13501. octokit.request.defaults(endpointDefaults),
  13502. `.${namespaceName}.${apiName}()`
  13503. );
  13504. request.endpoint = patch(
  13505. request.endpoint,
  13506. `.${namespaceName}.${apiName}.endpoint()`
  13507. );
  13508. request.endpoint.merge = patch(
  13509. request.endpoint.merge,
  13510. `.${namespaceName}.${apiName}.endpoint.merge()`
  13511. );
  13512. }
  13513. if (apiOptions.deprecated) {
  13514. octokit[namespaceName][apiName] = function deprecatedEndpointMethod() {
  13515. octokit.log.warn(
  13516. new Deprecation(`[@octokit/rest] ${apiOptions.deprecated}`)
  13517. );
  13518. octokit[namespaceName][apiName] = request;
  13519. return request.apply(null, arguments);
  13520. };
  13521. return;
  13522. }
  13523. octokit[namespaceName][apiName] = request;
  13524. });
  13525. });
  13526. }
  13527. function patchForDeprecation(octokit, apiOptions, method, methodName) {
  13528. const patchedMethod = options => {
  13529. options = Object.assign({}, options);
  13530. Object.keys(options).forEach(key => {
  13531. if (apiOptions.params[key] && apiOptions.params[key].deprecated) {
  13532. const aliasKey = apiOptions.params[key].alias;
  13533. octokit.log.warn(
  13534. new Deprecation(
  13535. `[@octokit/rest] "${key}" parameter is deprecated for "${methodName}". Use "${aliasKey}" instead`
  13536. )
  13537. );
  13538. if (!(aliasKey in options)) {
  13539. options[aliasKey] = options[key];
  13540. }
  13541. delete options[key];
  13542. }
  13543. });
  13544. return method(options);
  13545. };
  13546. Object.keys(method).forEach(key => {
  13547. patchedMethod[key] = method[key];
  13548. });
  13549. return patchedMethod;
  13550. }
  13551. /***/ }),
  13552. /***/ 929:
  13553. /***/ (function(module, __unusedexports, __webpack_require__) {
  13554. module.exports = hasNextPage
  13555. const deprecate = __webpack_require__(370)
  13556. const getPageLinks = __webpack_require__(577)
  13557. function hasNextPage (link) {
  13558. deprecate(`octokit.hasNextPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  13559. return getPageLinks(link).next
  13560. }
  13561. /***/ }),
  13562. /***/ 948:
  13563. /***/ (function(module) {
  13564. "use strict";
  13565. /**
  13566. * Tries to execute a function and discards any error that occurs.
  13567. * @param {Function} fn - Function that might or might not throw an error.
  13568. * @returns {?*} Return-value of the function when no error occurred.
  13569. */
  13570. module.exports = function(fn) {
  13571. try { return fn() } catch (e) {}
  13572. }
  13573. /***/ }),
  13574. /***/ 954:
  13575. /***/ (function(module) {
  13576. module.exports = validateAuth;
  13577. function validateAuth(auth) {
  13578. if (typeof auth === "string") {
  13579. return;
  13580. }
  13581. if (typeof auth === "function") {
  13582. return;
  13583. }
  13584. if (auth.username && auth.password) {
  13585. return;
  13586. }
  13587. if (auth.clientId && auth.clientSecret) {
  13588. return;
  13589. }
  13590. throw new Error(`Invalid "auth" option: ${JSON.stringify(auth)}`);
  13591. }
  13592. /***/ }),
  13593. /***/ 955:
  13594. /***/ (function(module, __unusedexports, __webpack_require__) {
  13595. "use strict";
  13596. const path = __webpack_require__(622);
  13597. const childProcess = __webpack_require__(129);
  13598. const crossSpawn = __webpack_require__(20);
  13599. const stripEof = __webpack_require__(768);
  13600. const npmRunPath = __webpack_require__(621);
  13601. const isStream = __webpack_require__(323);
  13602. const _getStream = __webpack_require__(145);
  13603. const pFinally = __webpack_require__(697);
  13604. const onExit = __webpack_require__(260);
  13605. const errname = __webpack_require__(427);
  13606. const stdio = __webpack_require__(168);
  13607. const TEN_MEGABYTES = 1000 * 1000 * 10;
  13608. function handleArgs(cmd, args, opts) {
  13609. let parsed;
  13610. opts = Object.assign({
  13611. extendEnv: true,
  13612. env: {}
  13613. }, opts);
  13614. if (opts.extendEnv) {
  13615. opts.env = Object.assign({}, process.env, opts.env);
  13616. }
  13617. if (opts.__winShell === true) {
  13618. delete opts.__winShell;
  13619. parsed = {
  13620. command: cmd,
  13621. args,
  13622. options: opts,
  13623. file: cmd,
  13624. original: {
  13625. cmd,
  13626. args
  13627. }
  13628. };
  13629. } else {
  13630. parsed = crossSpawn._parse(cmd, args, opts);
  13631. }
  13632. opts = Object.assign({
  13633. maxBuffer: TEN_MEGABYTES,
  13634. buffer: true,
  13635. stripEof: true,
  13636. preferLocal: true,
  13637. localDir: parsed.options.cwd || process.cwd(),
  13638. encoding: 'utf8',
  13639. reject: true,
  13640. cleanup: true
  13641. }, parsed.options);
  13642. opts.stdio = stdio(opts);
  13643. if (opts.preferLocal) {
  13644. opts.env = npmRunPath.env(Object.assign({}, opts, {cwd: opts.localDir}));
  13645. }
  13646. if (opts.detached) {
  13647. // #115
  13648. opts.cleanup = false;
  13649. }
  13650. if (process.platform === 'win32' && path.basename(parsed.command) === 'cmd.exe') {
  13651. // #116
  13652. parsed.args.unshift('/q');
  13653. }
  13654. return {
  13655. cmd: parsed.command,
  13656. args: parsed.args,
  13657. opts,
  13658. parsed
  13659. };
  13660. }
  13661. function handleInput(spawned, input) {
  13662. if (input === null || input === undefined) {
  13663. return;
  13664. }
  13665. if (isStream(input)) {
  13666. input.pipe(spawned.stdin);
  13667. } else {
  13668. spawned.stdin.end(input);
  13669. }
  13670. }
  13671. function handleOutput(opts, val) {
  13672. if (val && opts.stripEof) {
  13673. val = stripEof(val);
  13674. }
  13675. return val;
  13676. }
  13677. function handleShell(fn, cmd, opts) {
  13678. let file = '/bin/sh';
  13679. let args = ['-c', cmd];
  13680. opts = Object.assign({}, opts);
  13681. if (process.platform === 'win32') {
  13682. opts.__winShell = true;
  13683. file = process.env.comspec || 'cmd.exe';
  13684. args = ['/s', '/c', `"${cmd}"`];
  13685. opts.windowsVerbatimArguments = true;
  13686. }
  13687. if (opts.shell) {
  13688. file = opts.shell;
  13689. delete opts.shell;
  13690. }
  13691. return fn(file, args, opts);
  13692. }
  13693. function getStream(process, stream, {encoding, buffer, maxBuffer}) {
  13694. if (!process[stream]) {
  13695. return null;
  13696. }
  13697. let ret;
  13698. if (!buffer) {
  13699. // TODO: Use `ret = util.promisify(stream.finished)(process[stream]);` when targeting Node.js 10
  13700. ret = new Promise((resolve, reject) => {
  13701. process[stream]
  13702. .once('end', resolve)
  13703. .once('error', reject);
  13704. });
  13705. } else if (encoding) {
  13706. ret = _getStream(process[stream], {
  13707. encoding,
  13708. maxBuffer
  13709. });
  13710. } else {
  13711. ret = _getStream.buffer(process[stream], {maxBuffer});
  13712. }
  13713. return ret.catch(err => {
  13714. err.stream = stream;
  13715. err.message = `${stream} ${err.message}`;
  13716. throw err;
  13717. });
  13718. }
  13719. function makeError(result, options) {
  13720. const {stdout, stderr} = result;
  13721. let err = result.error;
  13722. const {code, signal} = result;
  13723. const {parsed, joinedCmd} = options;
  13724. const timedOut = options.timedOut || false;
  13725. if (!err) {
  13726. let output = '';
  13727. if (Array.isArray(parsed.opts.stdio)) {
  13728. if (parsed.opts.stdio[2] !== 'inherit') {
  13729. output += output.length > 0 ? stderr : `\n${stderr}`;
  13730. }
  13731. if (parsed.opts.stdio[1] !== 'inherit') {
  13732. output += `\n${stdout}`;
  13733. }
  13734. } else if (parsed.opts.stdio !== 'inherit') {
  13735. output = `\n${stderr}${stdout}`;
  13736. }
  13737. err = new Error(`Command failed: ${joinedCmd}${output}`);
  13738. err.code = code < 0 ? errname(code) : code;
  13739. }
  13740. err.stdout = stdout;
  13741. err.stderr = stderr;
  13742. err.failed = true;
  13743. err.signal = signal || null;
  13744. err.cmd = joinedCmd;
  13745. err.timedOut = timedOut;
  13746. return err;
  13747. }
  13748. function joinCmd(cmd, args) {
  13749. let joinedCmd = cmd;
  13750. if (Array.isArray(args) && args.length > 0) {
  13751. joinedCmd += ' ' + args.join(' ');
  13752. }
  13753. return joinedCmd;
  13754. }
  13755. module.exports = (cmd, args, opts) => {
  13756. const parsed = handleArgs(cmd, args, opts);
  13757. const {encoding, buffer, maxBuffer} = parsed.opts;
  13758. const joinedCmd = joinCmd(cmd, args);
  13759. let spawned;
  13760. try {
  13761. spawned = childProcess.spawn(parsed.cmd, parsed.args, parsed.opts);
  13762. } catch (err) {
  13763. return Promise.reject(err);
  13764. }
  13765. let removeExitHandler;
  13766. if (parsed.opts.cleanup) {
  13767. removeExitHandler = onExit(() => {
  13768. spawned.kill();
  13769. });
  13770. }
  13771. let timeoutId = null;
  13772. let timedOut = false;
  13773. const cleanup = () => {
  13774. if (timeoutId) {
  13775. clearTimeout(timeoutId);
  13776. timeoutId = null;
  13777. }
  13778. if (removeExitHandler) {
  13779. removeExitHandler();
  13780. }
  13781. };
  13782. if (parsed.opts.timeout > 0) {
  13783. timeoutId = setTimeout(() => {
  13784. timeoutId = null;
  13785. timedOut = true;
  13786. spawned.kill(parsed.opts.killSignal);
  13787. }, parsed.opts.timeout);
  13788. }
  13789. const processDone = new Promise(resolve => {
  13790. spawned.on('exit', (code, signal) => {
  13791. cleanup();
  13792. resolve({code, signal});
  13793. });
  13794. spawned.on('error', err => {
  13795. cleanup();
  13796. resolve({error: err});
  13797. });
  13798. if (spawned.stdin) {
  13799. spawned.stdin.on('error', err => {
  13800. cleanup();
  13801. resolve({error: err});
  13802. });
  13803. }
  13804. });
  13805. function destroy() {
  13806. if (spawned.stdout) {
  13807. spawned.stdout.destroy();
  13808. }
  13809. if (spawned.stderr) {
  13810. spawned.stderr.destroy();
  13811. }
  13812. }
  13813. const handlePromise = () => pFinally(Promise.all([
  13814. processDone,
  13815. getStream(spawned, 'stdout', {encoding, buffer, maxBuffer}),
  13816. getStream(spawned, 'stderr', {encoding, buffer, maxBuffer})
  13817. ]).then(arr => {
  13818. const result = arr[0];
  13819. result.stdout = arr[1];
  13820. result.stderr = arr[2];
  13821. if (result.error || result.code !== 0 || result.signal !== null) {
  13822. const err = makeError(result, {
  13823. joinedCmd,
  13824. parsed,
  13825. timedOut
  13826. });
  13827. // TODO: missing some timeout logic for killed
  13828. // https://github.com/nodejs/node/blob/master/lib/child_process.js#L203
  13829. // err.killed = spawned.killed || killed;
  13830. err.killed = err.killed || spawned.killed;
  13831. if (!parsed.opts.reject) {
  13832. return err;
  13833. }
  13834. throw err;
  13835. }
  13836. return {
  13837. stdout: handleOutput(parsed.opts, result.stdout),
  13838. stderr: handleOutput(parsed.opts, result.stderr),
  13839. code: 0,
  13840. failed: false,
  13841. killed: false,
  13842. signal: null,
  13843. cmd: joinedCmd,
  13844. timedOut: false
  13845. };
  13846. }), destroy);
  13847. crossSpawn._enoent.hookChildProcess(spawned, parsed.parsed);
  13848. handleInput(spawned, parsed.opts.input);
  13849. spawned.then = (onfulfilled, onrejected) => handlePromise().then(onfulfilled, onrejected);
  13850. spawned.catch = onrejected => handlePromise().catch(onrejected);
  13851. return spawned;
  13852. };
  13853. // TODO: set `stderr: 'ignore'` when that option is implemented
  13854. module.exports.stdout = (...args) => module.exports(...args).then(x => x.stdout);
  13855. // TODO: set `stdout: 'ignore'` when that option is implemented
  13856. module.exports.stderr = (...args) => module.exports(...args).then(x => x.stderr);
  13857. module.exports.shell = (cmd, opts) => handleShell(module.exports, cmd, opts);
  13858. module.exports.sync = (cmd, args, opts) => {
  13859. const parsed = handleArgs(cmd, args, opts);
  13860. const joinedCmd = joinCmd(cmd, args);
  13861. if (isStream(parsed.opts.input)) {
  13862. throw new TypeError('The `input` option cannot be a stream in sync mode');
  13863. }
  13864. const result = childProcess.spawnSync(parsed.cmd, parsed.args, parsed.opts);
  13865. result.code = result.status;
  13866. if (result.error || result.status !== 0 || result.signal !== null) {
  13867. const err = makeError(result, {
  13868. joinedCmd,
  13869. parsed
  13870. });
  13871. if (!parsed.opts.reject) {
  13872. return err;
  13873. }
  13874. throw err;
  13875. }
  13876. return {
  13877. stdout: handleOutput(parsed.opts, result.stdout),
  13878. stderr: handleOutput(parsed.opts, result.stderr),
  13879. code: 0,
  13880. failed: false,
  13881. signal: null,
  13882. cmd: joinedCmd,
  13883. timedOut: false
  13884. };
  13885. };
  13886. module.exports.shellSync = (cmd, opts) => handleShell(module.exports.sync, cmd, opts);
  13887. /***/ }),
  13888. /***/ 966:
  13889. /***/ (function(module, __unusedexports, __webpack_require__) {
  13890. "use strict";
  13891. const {PassThrough} = __webpack_require__(413);
  13892. module.exports = options => {
  13893. options = Object.assign({}, options);
  13894. const {array} = options;
  13895. let {encoding} = options;
  13896. const buffer = encoding === 'buffer';
  13897. let objectMode = false;
  13898. if (array) {
  13899. objectMode = !(encoding || buffer);
  13900. } else {
  13901. encoding = encoding || 'utf8';
  13902. }
  13903. if (buffer) {
  13904. encoding = null;
  13905. }
  13906. let len = 0;
  13907. const ret = [];
  13908. const stream = new PassThrough({objectMode});
  13909. if (encoding) {
  13910. stream.setEncoding(encoding);
  13911. }
  13912. stream.on('data', chunk => {
  13913. ret.push(chunk);
  13914. if (objectMode) {
  13915. len = ret.length;
  13916. } else {
  13917. len += chunk.length;
  13918. }
  13919. });
  13920. stream.getBufferedValue = () => {
  13921. if (array) {
  13922. return ret;
  13923. }
  13924. return buffer ? Buffer.concat(ret, len) : ret.join('');
  13925. };
  13926. stream.getBufferedLength = () => len;
  13927. return stream;
  13928. };
  13929. /***/ }),
  13930. /***/ 969:
  13931. /***/ (function(module, __unusedexports, __webpack_require__) {
  13932. var wrappy = __webpack_require__(11)
  13933. module.exports = wrappy(once)
  13934. module.exports.strict = wrappy(onceStrict)
  13935. once.proto = once(function () {
  13936. Object.defineProperty(Function.prototype, 'once', {
  13937. value: function () {
  13938. return once(this)
  13939. },
  13940. configurable: true
  13941. })
  13942. Object.defineProperty(Function.prototype, 'onceStrict', {
  13943. value: function () {
  13944. return onceStrict(this)
  13945. },
  13946. configurable: true
  13947. })
  13948. })
  13949. function once (fn) {
  13950. var f = function () {
  13951. if (f.called) return f.value
  13952. f.called = true
  13953. return f.value = fn.apply(this, arguments)
  13954. }
  13955. f.called = false
  13956. return f
  13957. }
  13958. function onceStrict (fn) {
  13959. var f = function () {
  13960. if (f.called)
  13961. throw new Error(f.onceError)
  13962. f.called = true
  13963. return f.value = fn.apply(this, arguments)
  13964. }
  13965. var name = fn.name || 'Function wrapped with `once`'
  13966. f.onceError = name + " shouldn't be called more than once"
  13967. f.called = false
  13968. return f
  13969. }
  13970. /***/ }),
  13971. /***/ 986:
  13972. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  13973. "use strict";
  13974. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  13975. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  13976. return new (P || (P = Promise))(function (resolve, reject) {
  13977. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  13978. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  13979. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  13980. step((generator = generator.apply(thisArg, _arguments || [])).next());
  13981. });
  13982. };
  13983. Object.defineProperty(exports, "__esModule", { value: true });
  13984. const tr = __webpack_require__(9);
  13985. /**
  13986. * Exec a command.
  13987. * Output will be streamed to the live console.
  13988. * Returns promise with return code
  13989. *
  13990. * @param commandLine command to execute (can include additional args). Must be correctly escaped.
  13991. * @param args optional arguments for tool. Escaping is handled by the lib.
  13992. * @param options optional exec options. See ExecOptions
  13993. * @returns Promise<number> exit code
  13994. */
  13995. function exec(commandLine, args, options) {
  13996. return __awaiter(this, void 0, void 0, function* () {
  13997. const commandArgs = tr.argStringToArray(commandLine);
  13998. if (commandArgs.length === 0) {
  13999. throw new Error(`Parameter 'commandLine' cannot be null or empty.`);
  14000. }
  14001. // Path to tool to execute should be first arg
  14002. const toolPath = commandArgs[0];
  14003. args = commandArgs.slice(1).concat(args || []);
  14004. const runner = new tr.ToolRunner(toolPath, args, options);
  14005. return runner.exec();
  14006. });
  14007. }
  14008. exports.exec = exec;
  14009. //# sourceMappingURL=exec.js.map
  14010. /***/ }),
  14011. /***/ 991:
  14012. /***/ (function(module, __unusedexports, __webpack_require__) {
  14013. module.exports = authenticationRequestError;
  14014. const { RequestError } = __webpack_require__(463);
  14015. function authenticationRequestError(state, error, options) {
  14016. if (!error.headers) throw error;
  14017. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  14018. // handle "2FA required" error only
  14019. if (error.status !== 401 || !otpRequired) {
  14020. throw error;
  14021. }
  14022. if (
  14023. error.status === 401 &&
  14024. otpRequired &&
  14025. error.request &&
  14026. error.request.headers["x-github-otp"]
  14027. ) {
  14028. if (state.otp) {
  14029. delete state.otp; // no longer valid, request again
  14030. } else {
  14031. throw new RequestError(
  14032. "Invalid one-time password for two-factor authentication",
  14033. 401,
  14034. {
  14035. headers: error.headers,
  14036. request: options
  14037. }
  14038. );
  14039. }
  14040. }
  14041. if (typeof state.auth.on2fa !== "function") {
  14042. throw new RequestError(
  14043. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  14044. 401,
  14045. {
  14046. headers: error.headers,
  14047. request: options
  14048. }
  14049. );
  14050. }
  14051. return Promise.resolve()
  14052. .then(() => {
  14053. return state.auth.on2fa();
  14054. })
  14055. .then(oneTimePassword => {
  14056. const newOptions = Object.assign(options, {
  14057. headers: Object.assign(options.headers, {
  14058. "x-github-otp": oneTimePassword
  14059. })
  14060. });
  14061. return state.octokit.request(newOptions).then(response => {
  14062. // If OTP still valid, then persist it for following requests
  14063. state.otp = oneTimePassword;
  14064. return response;
  14065. });
  14066. });
  14067. }
  14068. /***/ })
  14069. /******/ });