index.js 598 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289
  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. yield fileStreamClosed;
  7261. }
  7262. // return Buffer.from(response.data) // response.data is ArrayBuffer
  7263. }));
  7264. // // Download the archive
  7265. // core.info('Downloading the archive') // Do not print the URL since it contains a token to download the archive
  7266. // await downloadFile(archiveUrl, archivePath)
  7267. // // console.log(`status=${response.status}`)
  7268. // // console.log(`headers=${JSON.stringify(response.headers)}`)
  7269. // // console.log(`data=${response.data}`)
  7270. // // console.log(`data=${JSON.stringify(response.data)}`)
  7271. // // for (const key of Object.keys(response.data)) {
  7272. // // console.log(`data['${key}']=${response.data[key]}`)
  7273. // // }
  7274. // // Write archive to file
  7275. // const runnerTemp = process.env['RUNNER_TEMP'] as string
  7276. // assert.ok(runnerTemp, 'RUNNER_TEMP not defined')
  7277. // const archivePath = path.join(runnerTemp, 'checkout.tar.gz')
  7278. // await io.rmRF(archivePath)
  7279. // await fs.promises.writeFile(archivePath, raw)
  7280. // // await exec.exec(`ls -la "${archiveFile}"`, [], {
  7281. // // cwd: repositoryPath
  7282. // // } as ExecOptions)
  7283. // Extract archive
  7284. const extractPath = path.join(runnerTemp, `checkout-archive${IS_WINDOWS ? '.zip' : '.tar.gz'}`);
  7285. yield io.rmRF(extractPath);
  7286. yield io.mkdirP(extractPath);
  7287. if (IS_WINDOWS) {
  7288. yield toolCache.extractZip(archivePath, extractPath);
  7289. }
  7290. else {
  7291. yield toolCache.extractTar(archivePath, extractPath);
  7292. }
  7293. // await exec.exec(`tar -xzf "${archiveFile}"`, [], {
  7294. // cwd: extractPath
  7295. // } as ExecOptions)
  7296. // Determine the real directory to copy (ignore extra dir at root of the archive)
  7297. const archiveFileNames = yield fs.promises.readdir(extractPath);
  7298. assert.ok(archiveFileNames.length == 1, 'Expected exactly one directory inside archive');
  7299. const extraDirectoryName = archiveFileNames[0];
  7300. core.info(`Resolved ${extraDirectoryName}`); // contains the short SHA
  7301. const tempRepositoryPath = path.join(extractPath, extraDirectoryName);
  7302. // Move the files
  7303. for (const fileName of yield fs.promises.readdir(tempRepositoryPath)) {
  7304. const sourcePath = path.join(tempRepositoryPath, fileName);
  7305. const targetPath = path.join(repositoryPath, fileName);
  7306. yield io.mv(sourcePath, targetPath);
  7307. }
  7308. yield exec.exec(`find .`, [], {
  7309. cwd: repositoryPath
  7310. });
  7311. });
  7312. }
  7313. exports.downloadRepository = downloadRepository;
  7314. function downloadFile(url, fileStream) {
  7315. return new Promise((resolve, reject) => {
  7316. try {
  7317. https.get(url, (response) => {
  7318. if (response.statusCode != 200) {
  7319. reject(`Request failed with status '${response.statusCode}'`);
  7320. response.resume(); // Consume response data to free up memory
  7321. return;
  7322. }
  7323. response.on('data', chunk => {
  7324. fileStream.write(chunk);
  7325. });
  7326. response.on('end', () => {
  7327. resolve();
  7328. });
  7329. response.on('error', err => {
  7330. reject(err);
  7331. });
  7332. // response.pipe(fileStream)
  7333. });
  7334. }
  7335. catch (err) {
  7336. reject(err);
  7337. }
  7338. });
  7339. }
  7340. function getFileClosedPromise(stream) {
  7341. return new Promise((resolve, reject) => {
  7342. stream.on('error', err => {
  7343. reject(err);
  7344. });
  7345. stream.on('finish', () => {
  7346. resolve();
  7347. });
  7348. });
  7349. }
  7350. /***/ }),
  7351. /***/ 469:
  7352. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7353. "use strict";
  7354. var __importDefault = (this && this.__importDefault) || function (mod) {
  7355. return (mod && mod.__esModule) ? mod : { "default": mod };
  7356. };
  7357. var __importStar = (this && this.__importStar) || function (mod) {
  7358. if (mod && mod.__esModule) return mod;
  7359. var result = {};
  7360. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  7361. result["default"] = mod;
  7362. return result;
  7363. };
  7364. Object.defineProperty(exports, "__esModule", { value: true });
  7365. // Originally pulled from https://github.com/JasonEtco/actions-toolkit/blob/master/src/github.ts
  7366. const graphql_1 = __webpack_require__(898);
  7367. const rest_1 = __importDefault(__webpack_require__(0));
  7368. const Context = __importStar(__webpack_require__(262));
  7369. // We need this in order to extend Octokit
  7370. rest_1.default.prototype = new rest_1.default();
  7371. exports.context = new Context.Context();
  7372. class GitHub extends rest_1.default {
  7373. constructor(token, opts = {}) {
  7374. super(Object.assign(Object.assign({}, opts), { auth: `token ${token}` }));
  7375. this.graphql = graphql_1.graphql.defaults({
  7376. headers: { authorization: `token ${token}` }
  7377. });
  7378. }
  7379. }
  7380. exports.GitHub = GitHub;
  7381. //# sourceMappingURL=github.js.map
  7382. /***/ }),
  7383. /***/ 470:
  7384. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7385. "use strict";
  7386. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  7387. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  7388. return new (P || (P = Promise))(function (resolve, reject) {
  7389. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  7390. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  7391. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  7392. step((generator = generator.apply(thisArg, _arguments || [])).next());
  7393. });
  7394. };
  7395. Object.defineProperty(exports, "__esModule", { value: true });
  7396. const command_1 = __webpack_require__(431);
  7397. const os = __webpack_require__(87);
  7398. const path = __webpack_require__(622);
  7399. /**
  7400. * The code to exit an action
  7401. */
  7402. var ExitCode;
  7403. (function (ExitCode) {
  7404. /**
  7405. * A code indicating that the action was successful
  7406. */
  7407. ExitCode[ExitCode["Success"] = 0] = "Success";
  7408. /**
  7409. * A code indicating that the action was a failure
  7410. */
  7411. ExitCode[ExitCode["Failure"] = 1] = "Failure";
  7412. })(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
  7413. //-----------------------------------------------------------------------
  7414. // Variables
  7415. //-----------------------------------------------------------------------
  7416. /**
  7417. * Sets env variable for this action and future actions in the job
  7418. * @param name the name of the variable to set
  7419. * @param val the value of the variable
  7420. */
  7421. function exportVariable(name, val) {
  7422. process.env[name] = val;
  7423. command_1.issueCommand('set-env', { name }, val);
  7424. }
  7425. exports.exportVariable = exportVariable;
  7426. /**
  7427. * Registers a secret which will get masked from logs
  7428. * @param secret value of the secret
  7429. */
  7430. function setSecret(secret) {
  7431. command_1.issueCommand('add-mask', {}, secret);
  7432. }
  7433. exports.setSecret = setSecret;
  7434. /**
  7435. * Prepends inputPath to the PATH (for this action and future actions)
  7436. * @param inputPath
  7437. */
  7438. function addPath(inputPath) {
  7439. command_1.issueCommand('add-path', {}, inputPath);
  7440. process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
  7441. }
  7442. exports.addPath = addPath;
  7443. /**
  7444. * Gets the value of an input. The value is also trimmed.
  7445. *
  7446. * @param name name of the input to get
  7447. * @param options optional. See InputOptions.
  7448. * @returns string
  7449. */
  7450. function getInput(name, options) {
  7451. const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';
  7452. if (options && options.required && !val) {
  7453. throw new Error(`Input required and not supplied: ${name}`);
  7454. }
  7455. return val.trim();
  7456. }
  7457. exports.getInput = getInput;
  7458. /**
  7459. * Sets the value of an output.
  7460. *
  7461. * @param name name of the output to set
  7462. * @param value value to store
  7463. */
  7464. function setOutput(name, value) {
  7465. command_1.issueCommand('set-output', { name }, value);
  7466. }
  7467. exports.setOutput = setOutput;
  7468. //-----------------------------------------------------------------------
  7469. // Results
  7470. //-----------------------------------------------------------------------
  7471. /**
  7472. * Sets the action status to failed.
  7473. * When the action exits it will be with an exit code of 1
  7474. * @param message add error issue message
  7475. */
  7476. function setFailed(message) {
  7477. process.exitCode = ExitCode.Failure;
  7478. error(message);
  7479. }
  7480. exports.setFailed = setFailed;
  7481. //-----------------------------------------------------------------------
  7482. // Logging Commands
  7483. //-----------------------------------------------------------------------
  7484. /**
  7485. * Writes debug message to user log
  7486. * @param message debug message
  7487. */
  7488. function debug(message) {
  7489. command_1.issueCommand('debug', {}, message);
  7490. }
  7491. exports.debug = debug;
  7492. /**
  7493. * Adds an error issue
  7494. * @param message error issue message
  7495. */
  7496. function error(message) {
  7497. command_1.issue('error', message);
  7498. }
  7499. exports.error = error;
  7500. /**
  7501. * Adds an warning issue
  7502. * @param message warning issue message
  7503. */
  7504. function warning(message) {
  7505. command_1.issue('warning', message);
  7506. }
  7507. exports.warning = warning;
  7508. /**
  7509. * Writes info to log with console.log.
  7510. * @param message info message
  7511. */
  7512. function info(message) {
  7513. process.stdout.write(message + os.EOL);
  7514. }
  7515. exports.info = info;
  7516. /**
  7517. * Begin an output group.
  7518. *
  7519. * Output until the next `groupEnd` will be foldable in this group
  7520. *
  7521. * @param name The name of the output group
  7522. */
  7523. function startGroup(name) {
  7524. command_1.issue('group', name);
  7525. }
  7526. exports.startGroup = startGroup;
  7527. /**
  7528. * End an output group.
  7529. */
  7530. function endGroup() {
  7531. command_1.issue('endgroup');
  7532. }
  7533. exports.endGroup = endGroup;
  7534. /**
  7535. * Wrap an asynchronous function call in a group.
  7536. *
  7537. * Returns the same type as the function itself.
  7538. *
  7539. * @param name The name of the group
  7540. * @param fn The function to wrap in the group
  7541. */
  7542. function group(name, fn) {
  7543. return __awaiter(this, void 0, void 0, function* () {
  7544. startGroup(name);
  7545. let result;
  7546. try {
  7547. result = yield fn();
  7548. }
  7549. finally {
  7550. endGroup();
  7551. }
  7552. return result;
  7553. });
  7554. }
  7555. exports.group = group;
  7556. //# sourceMappingURL=core.js.map
  7557. /***/ }),
  7558. /***/ 471:
  7559. /***/ (function(module, __unusedexports, __webpack_require__) {
  7560. module.exports = authenticationBeforeRequest;
  7561. const btoa = __webpack_require__(675);
  7562. const uniq = __webpack_require__(126);
  7563. function authenticationBeforeRequest(state, options) {
  7564. if (!state.auth.type) {
  7565. return;
  7566. }
  7567. if (state.auth.type === "basic") {
  7568. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  7569. options.headers.authorization = `Basic ${hash}`;
  7570. return;
  7571. }
  7572. if (state.auth.type === "token") {
  7573. options.headers.authorization = `token ${state.auth.token}`;
  7574. return;
  7575. }
  7576. if (state.auth.type === "app") {
  7577. options.headers.authorization = `Bearer ${state.auth.token}`;
  7578. const acceptHeaders = options.headers.accept
  7579. .split(",")
  7580. .concat("application/vnd.github.machine-man-preview+json");
  7581. options.headers.accept = uniq(acceptHeaders)
  7582. .filter(Boolean)
  7583. .join(",");
  7584. return;
  7585. }
  7586. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  7587. if (state.auth.token) {
  7588. options.url += `access_token=${encodeURIComponent(state.auth.token)}`;
  7589. return;
  7590. }
  7591. const key = encodeURIComponent(state.auth.key);
  7592. const secret = encodeURIComponent(state.auth.secret);
  7593. options.url += `client_id=${key}&client_secret=${secret}`;
  7594. }
  7595. /***/ }),
  7596. /***/ 489:
  7597. /***/ (function(module, __unusedexports, __webpack_require__) {
  7598. "use strict";
  7599. const path = __webpack_require__(622);
  7600. const which = __webpack_require__(814);
  7601. const pathKey = __webpack_require__(39)();
  7602. function resolveCommandAttempt(parsed, withoutPathExt) {
  7603. const cwd = process.cwd();
  7604. const hasCustomCwd = parsed.options.cwd != null;
  7605. // If a custom `cwd` was specified, we need to change the process cwd
  7606. // because `which` will do stat calls but does not support a custom cwd
  7607. if (hasCustomCwd) {
  7608. try {
  7609. process.chdir(parsed.options.cwd);
  7610. } catch (err) {
  7611. /* Empty */
  7612. }
  7613. }
  7614. let resolved;
  7615. try {
  7616. resolved = which.sync(parsed.command, {
  7617. path: (parsed.options.env || process.env)[pathKey],
  7618. pathExt: withoutPathExt ? path.delimiter : undefined,
  7619. });
  7620. } catch (e) {
  7621. /* Empty */
  7622. } finally {
  7623. process.chdir(cwd);
  7624. }
  7625. // If we successfully resolved, ensure that an absolute path is returned
  7626. // Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it
  7627. if (resolved) {
  7628. resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved);
  7629. }
  7630. return resolved;
  7631. }
  7632. function resolveCommand(parsed) {
  7633. return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
  7634. }
  7635. module.exports = resolveCommand;
  7636. /***/ }),
  7637. /***/ 510:
  7638. /***/ (function(module) {
  7639. module.exports = addHook
  7640. function addHook (state, kind, name, hook) {
  7641. var orig = hook
  7642. if (!state.registry[name]) {
  7643. state.registry[name] = []
  7644. }
  7645. if (kind === 'before') {
  7646. hook = function (method, options) {
  7647. return Promise.resolve()
  7648. .then(orig.bind(null, options))
  7649. .then(method.bind(null, options))
  7650. }
  7651. }
  7652. if (kind === 'after') {
  7653. hook = function (method, options) {
  7654. var result
  7655. return Promise.resolve()
  7656. .then(method.bind(null, options))
  7657. .then(function (result_) {
  7658. result = result_
  7659. return orig(result, options)
  7660. })
  7661. .then(function () {
  7662. return result
  7663. })
  7664. }
  7665. }
  7666. if (kind === 'error') {
  7667. hook = function (method, options) {
  7668. return Promise.resolve()
  7669. .then(method.bind(null, options))
  7670. .catch(function (error) {
  7671. return orig(error, options)
  7672. })
  7673. }
  7674. }
  7675. state.registry[name].push({
  7676. hook: hook,
  7677. orig: orig
  7678. })
  7679. }
  7680. /***/ }),
  7681. /***/ 523:
  7682. /***/ (function(module, __unusedexports, __webpack_require__) {
  7683. var register = __webpack_require__(363)
  7684. var addHook = __webpack_require__(510)
  7685. var removeHook = __webpack_require__(763)
  7686. // bind with array of arguments: https://stackoverflow.com/a/21792913
  7687. var bind = Function.bind
  7688. var bindable = bind.bind(bind)
  7689. function bindApi (hook, state, name) {
  7690. var removeHookRef = bindable(removeHook, null).apply(null, name ? [state, name] : [state])
  7691. hook.api = { remove: removeHookRef }
  7692. hook.remove = removeHookRef
  7693. ;['before', 'error', 'after', 'wrap'].forEach(function (kind) {
  7694. var args = name ? [state, kind, name] : [state, kind]
  7695. hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args)
  7696. })
  7697. }
  7698. function HookSingular () {
  7699. var singularHookName = 'h'
  7700. var singularHookState = {
  7701. registry: {}
  7702. }
  7703. var singularHook = register.bind(null, singularHookState, singularHookName)
  7704. bindApi(singularHook, singularHookState, singularHookName)
  7705. return singularHook
  7706. }
  7707. function HookCollection () {
  7708. var state = {
  7709. registry: {}
  7710. }
  7711. var hook = register.bind(null, state)
  7712. bindApi(hook, state)
  7713. return hook
  7714. }
  7715. var collectionHookDeprecationMessageDisplayed = false
  7716. function Hook () {
  7717. if (!collectionHookDeprecationMessageDisplayed) {
  7718. console.warn('[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4')
  7719. collectionHookDeprecationMessageDisplayed = true
  7720. }
  7721. return HookCollection()
  7722. }
  7723. Hook.Singular = HookSingular.bind()
  7724. Hook.Collection = HookCollection.bind()
  7725. module.exports = Hook
  7726. // expose constructors as a named property for TypeScript
  7727. module.exports.Hook = Hook
  7728. module.exports.Singular = Hook.Singular
  7729. module.exports.Collection = Hook.Collection
  7730. /***/ }),
  7731. /***/ 529:
  7732. /***/ (function(module, __unusedexports, __webpack_require__) {
  7733. const factory = __webpack_require__(47);
  7734. module.exports = factory();
  7735. /***/ }),
  7736. /***/ 533:
  7737. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7738. "use strict";
  7739. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  7740. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  7741. return new (P || (P = Promise))(function (resolve, reject) {
  7742. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  7743. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  7744. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  7745. step((generator = generator.apply(thisArg, _arguments || [])).next());
  7746. });
  7747. };
  7748. Object.defineProperty(exports, "__esModule", { value: true });
  7749. const core = __webpack_require__(470);
  7750. const io = __webpack_require__(1);
  7751. const fs = __webpack_require__(747);
  7752. const os = __webpack_require__(87);
  7753. const path = __webpack_require__(622);
  7754. const httpm = __webpack_require__(874);
  7755. const semver = __webpack_require__(656);
  7756. const uuidV4 = __webpack_require__(826);
  7757. const exec_1 = __webpack_require__(986);
  7758. const assert_1 = __webpack_require__(357);
  7759. class HTTPError extends Error {
  7760. constructor(httpStatusCode) {
  7761. super(`Unexpected HTTP response: ${httpStatusCode}`);
  7762. this.httpStatusCode = httpStatusCode;
  7763. Object.setPrototypeOf(this, new.target.prototype);
  7764. }
  7765. }
  7766. exports.HTTPError = HTTPError;
  7767. const IS_WINDOWS = process.platform === 'win32';
  7768. const userAgent = 'actions/tool-cache';
  7769. // On load grab temp directory and cache directory and remove them from env (currently don't want to expose this)
  7770. let tempDirectory = process.env['RUNNER_TEMP'] || '';
  7771. let cacheRoot = process.env['RUNNER_TOOL_CACHE'] || '';
  7772. // If directories not found, place them in common temp locations
  7773. if (!tempDirectory || !cacheRoot) {
  7774. let baseLocation;
  7775. if (IS_WINDOWS) {
  7776. // On windows use the USERPROFILE env variable
  7777. baseLocation = process.env['USERPROFILE'] || 'C:\\';
  7778. }
  7779. else {
  7780. if (process.platform === 'darwin') {
  7781. baseLocation = '/Users';
  7782. }
  7783. else {
  7784. baseLocation = '/home';
  7785. }
  7786. }
  7787. if (!tempDirectory) {
  7788. tempDirectory = path.join(baseLocation, 'actions', 'temp');
  7789. }
  7790. if (!cacheRoot) {
  7791. cacheRoot = path.join(baseLocation, 'actions', 'cache');
  7792. }
  7793. }
  7794. /**
  7795. * Download a tool from an url and stream it into a file
  7796. *
  7797. * @param url url of tool to download
  7798. * @returns path to downloaded tool
  7799. */
  7800. function downloadTool(url) {
  7801. return __awaiter(this, void 0, void 0, function* () {
  7802. // Wrap in a promise so that we can resolve from within stream callbacks
  7803. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  7804. try {
  7805. const http = new httpm.HttpClient(userAgent, [], {
  7806. allowRetries: true,
  7807. maxRetries: 3
  7808. });
  7809. const destPath = path.join(tempDirectory, uuidV4());
  7810. yield io.mkdirP(tempDirectory);
  7811. core.debug(`Downloading ${url}`);
  7812. core.debug(`Downloading ${destPath}`);
  7813. if (fs.existsSync(destPath)) {
  7814. throw new Error(`Destination file path ${destPath} already exists`);
  7815. }
  7816. const response = yield http.get(url);
  7817. if (response.message.statusCode !== 200) {
  7818. const err = new HTTPError(response.message.statusCode);
  7819. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  7820. throw err;
  7821. }
  7822. const file = fs.createWriteStream(destPath);
  7823. file.on('open', () => __awaiter(this, void 0, void 0, function* () {
  7824. try {
  7825. const stream = response.message.pipe(file);
  7826. stream.on('close', () => {
  7827. core.debug('download complete');
  7828. resolve(destPath);
  7829. });
  7830. }
  7831. catch (err) {
  7832. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  7833. reject(err);
  7834. }
  7835. }));
  7836. file.on('error', err => {
  7837. file.end();
  7838. reject(err);
  7839. });
  7840. }
  7841. catch (err) {
  7842. reject(err);
  7843. }
  7844. }));
  7845. });
  7846. }
  7847. exports.downloadTool = downloadTool;
  7848. /**
  7849. * Extract a .7z file
  7850. *
  7851. * @param file path to the .7z file
  7852. * @param dest destination directory. Optional.
  7853. * @param _7zPath path to 7zr.exe. Optional, for long path support. Most .7z archives do not have this
  7854. * problem. If your .7z archive contains very long paths, you can pass the path to 7zr.exe which will
  7855. * gracefully handle long paths. By default 7zdec.exe is used because it is a very small program and is
  7856. * bundled with the tool lib. However it does not support long paths. 7zr.exe is the reduced command line
  7857. * interface, it is smaller than the full command line interface, and it does support long paths. At the
  7858. * time of this writing, it is freely available from the LZMA SDK that is available on the 7zip website.
  7859. * Be sure to check the current license agreement. If 7zr.exe is bundled with your action, then the path
  7860. * to 7zr.exe can be pass to this function.
  7861. * @returns path to the destination directory
  7862. */
  7863. function extract7z(file, dest, _7zPath) {
  7864. return __awaiter(this, void 0, void 0, function* () {
  7865. assert_1.ok(IS_WINDOWS, 'extract7z() not supported on current OS');
  7866. assert_1.ok(file, 'parameter "file" is required');
  7867. dest = dest || (yield _createExtractFolder(dest));
  7868. const originalCwd = process.cwd();
  7869. process.chdir(dest);
  7870. if (_7zPath) {
  7871. try {
  7872. const args = [
  7873. 'x',
  7874. '-bb1',
  7875. '-bd',
  7876. '-sccUTF-8',
  7877. file
  7878. ];
  7879. const options = {
  7880. silent: true
  7881. };
  7882. yield exec_1.exec(`"${_7zPath}"`, args, options);
  7883. }
  7884. finally {
  7885. process.chdir(originalCwd);
  7886. }
  7887. }
  7888. else {
  7889. const escapedScript = path
  7890. .join(__dirname, '..', 'scripts', 'Invoke-7zdec.ps1')
  7891. .replace(/'/g, "''")
  7892. .replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  7893. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  7894. const escapedTarget = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  7895. const command = `& '${escapedScript}' -Source '${escapedFile}' -Target '${escapedTarget}'`;
  7896. const args = [
  7897. '-NoLogo',
  7898. '-Sta',
  7899. '-NoProfile',
  7900. '-NonInteractive',
  7901. '-ExecutionPolicy',
  7902. 'Unrestricted',
  7903. '-Command',
  7904. command
  7905. ];
  7906. const options = {
  7907. silent: true
  7908. };
  7909. try {
  7910. const powershellPath = yield io.which('powershell', true);
  7911. yield exec_1.exec(`"${powershellPath}"`, args, options);
  7912. }
  7913. finally {
  7914. process.chdir(originalCwd);
  7915. }
  7916. }
  7917. return dest;
  7918. });
  7919. }
  7920. exports.extract7z = extract7z;
  7921. /**
  7922. * Extract a tar
  7923. *
  7924. * @param file path to the tar
  7925. * @param dest destination directory. Optional.
  7926. * @param flags flags for the tar. Optional.
  7927. * @returns path to the destination directory
  7928. */
  7929. function extractTar(file, dest, flags = 'xz') {
  7930. return __awaiter(this, void 0, void 0, function* () {
  7931. if (!file) {
  7932. throw new Error("parameter 'file' is required");
  7933. }
  7934. dest = dest || (yield _createExtractFolder(dest));
  7935. const tarPath = yield io.which('tar', true);
  7936. yield exec_1.exec(`"${tarPath}"`, [flags, '-C', dest, '-f', file]);
  7937. return dest;
  7938. });
  7939. }
  7940. exports.extractTar = extractTar;
  7941. /**
  7942. * Extract a zip
  7943. *
  7944. * @param file path to the zip
  7945. * @param dest destination directory. Optional.
  7946. * @returns path to the destination directory
  7947. */
  7948. function extractZip(file, dest) {
  7949. return __awaiter(this, void 0, void 0, function* () {
  7950. if (!file) {
  7951. throw new Error("parameter 'file' is required");
  7952. }
  7953. dest = dest || (yield _createExtractFolder(dest));
  7954. if (IS_WINDOWS) {
  7955. yield extractZipWin(file, dest);
  7956. }
  7957. else {
  7958. yield extractZipNix(file, dest);
  7959. }
  7960. return dest;
  7961. });
  7962. }
  7963. exports.extractZip = extractZip;
  7964. function extractZipWin(file, dest) {
  7965. return __awaiter(this, void 0, void 0, function* () {
  7966. // build the powershell command
  7967. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  7968. const escapedDest = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  7969. const command = `$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ; [System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}')`;
  7970. // run powershell
  7971. const powershellPath = yield io.which('powershell');
  7972. const args = [
  7973. '-NoLogo',
  7974. '-Sta',
  7975. '-NoProfile',
  7976. '-NonInteractive',
  7977. '-ExecutionPolicy',
  7978. 'Unrestricted',
  7979. '-Command',
  7980. command
  7981. ];
  7982. yield exec_1.exec(`"${powershellPath}"`, args);
  7983. });
  7984. }
  7985. function extractZipNix(file, dest) {
  7986. return __awaiter(this, void 0, void 0, function* () {
  7987. const unzipPath = yield io.which('unzip');
  7988. yield exec_1.exec(`"${unzipPath}"`, [file], { cwd: dest });
  7989. });
  7990. }
  7991. /**
  7992. * Caches a directory and installs it into the tool cacheDir
  7993. *
  7994. * @param sourceDir the directory to cache into tools
  7995. * @param tool tool name
  7996. * @param version version of the tool. semver format
  7997. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  7998. */
  7999. function cacheDir(sourceDir, tool, version, arch) {
  8000. return __awaiter(this, void 0, void 0, function* () {
  8001. version = semver.clean(version) || version;
  8002. arch = arch || os.arch();
  8003. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  8004. core.debug(`source dir: ${sourceDir}`);
  8005. if (!fs.statSync(sourceDir).isDirectory()) {
  8006. throw new Error('sourceDir is not a directory');
  8007. }
  8008. // Create the tool dir
  8009. const destPath = yield _createToolPath(tool, version, arch);
  8010. // copy each child item. do not move. move can fail on Windows
  8011. // due to anti-virus software having an open handle on a file.
  8012. for (const itemName of fs.readdirSync(sourceDir)) {
  8013. const s = path.join(sourceDir, itemName);
  8014. yield io.cp(s, destPath, { recursive: true });
  8015. }
  8016. // write .complete
  8017. _completeToolPath(tool, version, arch);
  8018. return destPath;
  8019. });
  8020. }
  8021. exports.cacheDir = cacheDir;
  8022. /**
  8023. * Caches a downloaded file (GUID) and installs it
  8024. * into the tool cache with a given targetName
  8025. *
  8026. * @param sourceFile the file to cache into tools. Typically a result of downloadTool which is a guid.
  8027. * @param targetFile the name of the file name in the tools directory
  8028. * @param tool tool name
  8029. * @param version version of the tool. semver format
  8030. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  8031. */
  8032. function cacheFile(sourceFile, targetFile, tool, version, arch) {
  8033. return __awaiter(this, void 0, void 0, function* () {
  8034. version = semver.clean(version) || version;
  8035. arch = arch || os.arch();
  8036. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  8037. core.debug(`source file: ${sourceFile}`);
  8038. if (!fs.statSync(sourceFile).isFile()) {
  8039. throw new Error('sourceFile is not a file');
  8040. }
  8041. // create the tool dir
  8042. const destFolder = yield _createToolPath(tool, version, arch);
  8043. // copy instead of move. move can fail on Windows due to
  8044. // anti-virus software having an open handle on a file.
  8045. const destPath = path.join(destFolder, targetFile);
  8046. core.debug(`destination file ${destPath}`);
  8047. yield io.cp(sourceFile, destPath);
  8048. // write .complete
  8049. _completeToolPath(tool, version, arch);
  8050. return destFolder;
  8051. });
  8052. }
  8053. exports.cacheFile = cacheFile;
  8054. /**
  8055. * Finds the path to a tool version in the local installed tool cache
  8056. *
  8057. * @param toolName name of the tool
  8058. * @param versionSpec version of the tool
  8059. * @param arch optional arch. defaults to arch of computer
  8060. */
  8061. function find(toolName, versionSpec, arch) {
  8062. if (!toolName) {
  8063. throw new Error('toolName parameter is required');
  8064. }
  8065. if (!versionSpec) {
  8066. throw new Error('versionSpec parameter is required');
  8067. }
  8068. arch = arch || os.arch();
  8069. // attempt to resolve an explicit version
  8070. if (!_isExplicitVersion(versionSpec)) {
  8071. const localVersions = findAllVersions(toolName, arch);
  8072. const match = _evaluateVersions(localVersions, versionSpec);
  8073. versionSpec = match;
  8074. }
  8075. // check for the explicit version in the cache
  8076. let toolPath = '';
  8077. if (versionSpec) {
  8078. versionSpec = semver.clean(versionSpec) || '';
  8079. const cachePath = path.join(cacheRoot, toolName, versionSpec, arch);
  8080. core.debug(`checking cache: ${cachePath}`);
  8081. if (fs.existsSync(cachePath) && fs.existsSync(`${cachePath}.complete`)) {
  8082. core.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`);
  8083. toolPath = cachePath;
  8084. }
  8085. else {
  8086. core.debug('not found');
  8087. }
  8088. }
  8089. return toolPath;
  8090. }
  8091. exports.find = find;
  8092. /**
  8093. * Finds the paths to all versions of a tool that are installed in the local tool cache
  8094. *
  8095. * @param toolName name of the tool
  8096. * @param arch optional arch. defaults to arch of computer
  8097. */
  8098. function findAllVersions(toolName, arch) {
  8099. const versions = [];
  8100. arch = arch || os.arch();
  8101. const toolPath = path.join(cacheRoot, toolName);
  8102. if (fs.existsSync(toolPath)) {
  8103. const children = fs.readdirSync(toolPath);
  8104. for (const child of children) {
  8105. if (_isExplicitVersion(child)) {
  8106. const fullPath = path.join(toolPath, child, arch || '');
  8107. if (fs.existsSync(fullPath) && fs.existsSync(`${fullPath}.complete`)) {
  8108. versions.push(child);
  8109. }
  8110. }
  8111. }
  8112. }
  8113. return versions;
  8114. }
  8115. exports.findAllVersions = findAllVersions;
  8116. function _createExtractFolder(dest) {
  8117. return __awaiter(this, void 0, void 0, function* () {
  8118. if (!dest) {
  8119. // create a temp dir
  8120. dest = path.join(tempDirectory, uuidV4());
  8121. }
  8122. yield io.mkdirP(dest);
  8123. return dest;
  8124. });
  8125. }
  8126. function _createToolPath(tool, version, arch) {
  8127. return __awaiter(this, void 0, void 0, function* () {
  8128. const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
  8129. core.debug(`destination ${folderPath}`);
  8130. const markerPath = `${folderPath}.complete`;
  8131. yield io.rmRF(folderPath);
  8132. yield io.rmRF(markerPath);
  8133. yield io.mkdirP(folderPath);
  8134. return folderPath;
  8135. });
  8136. }
  8137. function _completeToolPath(tool, version, arch) {
  8138. const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
  8139. const markerPath = `${folderPath}.complete`;
  8140. fs.writeFileSync(markerPath, '');
  8141. core.debug('finished caching tool');
  8142. }
  8143. function _isExplicitVersion(versionSpec) {
  8144. const c = semver.clean(versionSpec) || '';
  8145. core.debug(`isExplicit: ${c}`);
  8146. const valid = semver.valid(c) != null;
  8147. core.debug(`explicit? ${valid}`);
  8148. return valid;
  8149. }
  8150. function _evaluateVersions(versions, versionSpec) {
  8151. let version = '';
  8152. core.debug(`evaluating ${versions.length} versions`);
  8153. versions = versions.sort((a, b) => {
  8154. if (semver.gt(a, b)) {
  8155. return 1;
  8156. }
  8157. return -1;
  8158. });
  8159. for (let i = versions.length - 1; i >= 0; i--) {
  8160. const potential = versions[i];
  8161. const satisfied = semver.satisfies(potential, versionSpec);
  8162. if (satisfied) {
  8163. version = potential;
  8164. break;
  8165. }
  8166. }
  8167. if (version) {
  8168. core.debug(`matched: ${version}`);
  8169. }
  8170. else {
  8171. core.debug('match not found');
  8172. }
  8173. return version;
  8174. }
  8175. //# sourceMappingURL=tool-cache.js.map
  8176. /***/ }),
  8177. /***/ 536:
  8178. /***/ (function(module, __unusedexports, __webpack_require__) {
  8179. module.exports = hasFirstPage
  8180. const deprecate = __webpack_require__(370)
  8181. const getPageLinks = __webpack_require__(577)
  8182. function hasFirstPage (link) {
  8183. deprecate(`octokit.hasFirstPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  8184. return getPageLinks(link).first
  8185. }
  8186. /***/ }),
  8187. /***/ 550:
  8188. /***/ (function(module, __unusedexports, __webpack_require__) {
  8189. module.exports = getNextPage
  8190. const getPage = __webpack_require__(265)
  8191. function getNextPage (octokit, link, headers) {
  8192. return getPage(octokit, link, 'next', headers)
  8193. }
  8194. /***/ }),
  8195. /***/ 558:
  8196. /***/ (function(module, __unusedexports, __webpack_require__) {
  8197. module.exports = hasPreviousPage
  8198. const deprecate = __webpack_require__(370)
  8199. const getPageLinks = __webpack_require__(577)
  8200. function hasPreviousPage (link) {
  8201. deprecate(`octokit.hasPreviousPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  8202. return getPageLinks(link).prev
  8203. }
  8204. /***/ }),
  8205. /***/ 559:
  8206. /***/ (function(__unusedmodule, exports) {
  8207. "use strict";
  8208. Object.defineProperty(exports, "__esModule", { value: true });
  8209. class GitVersion {
  8210. /**
  8211. * Used for comparing the version of git and git-lfs against the minimum required version
  8212. * @param version the version string, e.g. 1.2 or 1.2.3
  8213. */
  8214. constructor(version) {
  8215. this.major = NaN;
  8216. this.minor = NaN;
  8217. this.patch = NaN;
  8218. if (version) {
  8219. const match = version.match(/^(\d+)\.(\d+)(\.(\d+))?$/);
  8220. if (match) {
  8221. this.major = Number(match[1]);
  8222. this.minor = Number(match[2]);
  8223. if (match[4]) {
  8224. this.patch = Number(match[4]);
  8225. }
  8226. }
  8227. }
  8228. }
  8229. /**
  8230. * Compares the instance against a minimum required version
  8231. * @param minimum Minimum version
  8232. */
  8233. checkMinimum(minimum) {
  8234. if (!minimum.isValid()) {
  8235. throw new Error('Arg minimum is not a valid version');
  8236. }
  8237. // Major is insufficient
  8238. if (this.major < minimum.major) {
  8239. return false;
  8240. }
  8241. // Major is equal
  8242. if (this.major === minimum.major) {
  8243. // Minor is insufficient
  8244. if (this.minor < minimum.minor) {
  8245. return false;
  8246. }
  8247. // Minor is equal
  8248. if (this.minor === minimum.minor) {
  8249. // Patch is insufficient
  8250. if (this.patch && this.patch < (minimum.patch || 0)) {
  8251. return false;
  8252. }
  8253. }
  8254. }
  8255. return true;
  8256. }
  8257. /**
  8258. * Indicates whether the instance was constructed from a valid version string
  8259. */
  8260. isValid() {
  8261. return !isNaN(this.major);
  8262. }
  8263. /**
  8264. * Returns the version as a string, e.g. 1.2 or 1.2.3
  8265. */
  8266. toString() {
  8267. let result = '';
  8268. if (this.isValid()) {
  8269. result = `${this.major}.${this.minor}`;
  8270. if (!isNaN(this.patch)) {
  8271. result += `.${this.patch}`;
  8272. }
  8273. }
  8274. return result;
  8275. }
  8276. }
  8277. exports.GitVersion = GitVersion;
  8278. /***/ }),
  8279. /***/ 562:
  8280. /***/ (function(module, __unusedexports, __webpack_require__) {
  8281. var once = __webpack_require__(969);
  8282. var noop = function() {};
  8283. var isRequest = function(stream) {
  8284. return stream.setHeader && typeof stream.abort === 'function';
  8285. };
  8286. var isChildProcess = function(stream) {
  8287. return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3
  8288. };
  8289. var eos = function(stream, opts, callback) {
  8290. if (typeof opts === 'function') return eos(stream, null, opts);
  8291. if (!opts) opts = {};
  8292. callback = once(callback || noop);
  8293. var ws = stream._writableState;
  8294. var rs = stream._readableState;
  8295. var readable = opts.readable || (opts.readable !== false && stream.readable);
  8296. var writable = opts.writable || (opts.writable !== false && stream.writable);
  8297. var cancelled = false;
  8298. var onlegacyfinish = function() {
  8299. if (!stream.writable) onfinish();
  8300. };
  8301. var onfinish = function() {
  8302. writable = false;
  8303. if (!readable) callback.call(stream);
  8304. };
  8305. var onend = function() {
  8306. readable = false;
  8307. if (!writable) callback.call(stream);
  8308. };
  8309. var onexit = function(exitCode) {
  8310. callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null);
  8311. };
  8312. var onerror = function(err) {
  8313. callback.call(stream, err);
  8314. };
  8315. var onclose = function() {
  8316. process.nextTick(onclosenexttick);
  8317. };
  8318. var onclosenexttick = function() {
  8319. if (cancelled) return;
  8320. if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error('premature close'));
  8321. if (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error('premature close'));
  8322. };
  8323. var onrequest = function() {
  8324. stream.req.on('finish', onfinish);
  8325. };
  8326. if (isRequest(stream)) {
  8327. stream.on('complete', onfinish);
  8328. stream.on('abort', onclose);
  8329. if (stream.req) onrequest();
  8330. else stream.on('request', onrequest);
  8331. } else if (writable && !ws) { // legacy streams
  8332. stream.on('end', onlegacyfinish);
  8333. stream.on('close', onlegacyfinish);
  8334. }
  8335. if (isChildProcess(stream)) stream.on('exit', onexit);
  8336. stream.on('end', onend);
  8337. stream.on('finish', onfinish);
  8338. if (opts.error !== false) stream.on('error', onerror);
  8339. stream.on('close', onclose);
  8340. return function() {
  8341. cancelled = true;
  8342. stream.removeListener('complete', onfinish);
  8343. stream.removeListener('abort', onclose);
  8344. stream.removeListener('request', onrequest);
  8345. if (stream.req) stream.req.removeListener('finish', onfinish);
  8346. stream.removeListener('end', onlegacyfinish);
  8347. stream.removeListener('close', onlegacyfinish);
  8348. stream.removeListener('finish', onfinish);
  8349. stream.removeListener('exit', onexit);
  8350. stream.removeListener('end', onend);
  8351. stream.removeListener('error', onerror);
  8352. stream.removeListener('close', onclose);
  8353. };
  8354. };
  8355. module.exports = eos;
  8356. /***/ }),
  8357. /***/ 563:
  8358. /***/ (function(module, __unusedexports, __webpack_require__) {
  8359. module.exports = getPreviousPage
  8360. const getPage = __webpack_require__(265)
  8361. function getPreviousPage (octokit, link, headers) {
  8362. return getPage(octokit, link, 'prev', headers)
  8363. }
  8364. /***/ }),
  8365. /***/ 568:
  8366. /***/ (function(module, __unusedexports, __webpack_require__) {
  8367. "use strict";
  8368. const path = __webpack_require__(622);
  8369. const niceTry = __webpack_require__(948);
  8370. const resolveCommand = __webpack_require__(489);
  8371. const escape = __webpack_require__(462);
  8372. const readShebang = __webpack_require__(389);
  8373. const semver = __webpack_require__(280);
  8374. const isWin = process.platform === 'win32';
  8375. const isExecutableRegExp = /\.(?:com|exe)$/i;
  8376. const isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
  8377. // `options.shell` is supported in Node ^4.8.0, ^5.7.0 and >= 6.0.0
  8378. const supportsShellOption = niceTry(() => semver.satisfies(process.version, '^4.8.0 || ^5.7.0 || >= 6.0.0', true)) || false;
  8379. function detectShebang(parsed) {
  8380. parsed.file = resolveCommand(parsed);
  8381. const shebang = parsed.file && readShebang(parsed.file);
  8382. if (shebang) {
  8383. parsed.args.unshift(parsed.file);
  8384. parsed.command = shebang;
  8385. return resolveCommand(parsed);
  8386. }
  8387. return parsed.file;
  8388. }
  8389. function parseNonShell(parsed) {
  8390. if (!isWin) {
  8391. return parsed;
  8392. }
  8393. // Detect & add support for shebangs
  8394. const commandFile = detectShebang(parsed);
  8395. // We don't need a shell if the command filename is an executable
  8396. const needsShell = !isExecutableRegExp.test(commandFile);
  8397. // If a shell is required, use cmd.exe and take care of escaping everything correctly
  8398. // Note that `forceShell` is an hidden option used only in tests
  8399. if (parsed.options.forceShell || needsShell) {
  8400. // Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/`
  8401. // The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument
  8402. // Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called,
  8403. // we need to double escape them
  8404. const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
  8405. // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\bar)
  8406. // This is necessary otherwise it will always fail with ENOENT in those cases
  8407. parsed.command = path.normalize(parsed.command);
  8408. // Escape command & arguments
  8409. parsed.command = escape.command(parsed.command);
  8410. parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
  8411. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  8412. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  8413. parsed.command = process.env.comspec || 'cmd.exe';
  8414. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  8415. }
  8416. return parsed;
  8417. }
  8418. function parseShell(parsed) {
  8419. // If node supports the shell option, there's no need to mimic its behavior
  8420. if (supportsShellOption) {
  8421. return parsed;
  8422. }
  8423. // Mimic node shell option
  8424. // See https://github.com/nodejs/node/blob/b9f6a2dc059a1062776133f3d4fd848c4da7d150/lib/child_process.js#L335
  8425. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  8426. if (isWin) {
  8427. parsed.command = typeof parsed.options.shell === 'string' ? parsed.options.shell : process.env.comspec || 'cmd.exe';
  8428. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  8429. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  8430. } else {
  8431. if (typeof parsed.options.shell === 'string') {
  8432. parsed.command = parsed.options.shell;
  8433. } else if (process.platform === 'android') {
  8434. parsed.command = '/system/bin/sh';
  8435. } else {
  8436. parsed.command = '/bin/sh';
  8437. }
  8438. parsed.args = ['-c', shellCommand];
  8439. }
  8440. return parsed;
  8441. }
  8442. function parse(command, args, options) {
  8443. // Normalize arguments, similar to nodejs
  8444. if (args && !Array.isArray(args)) {
  8445. options = args;
  8446. args = null;
  8447. }
  8448. args = args ? args.slice(0) : []; // Clone array to avoid changing the original
  8449. options = Object.assign({}, options); // Clone object to avoid changing the original
  8450. // Build our parsed object
  8451. const parsed = {
  8452. command,
  8453. args,
  8454. options,
  8455. file: undefined,
  8456. original: {
  8457. command,
  8458. args,
  8459. },
  8460. };
  8461. // Delegate further parsing to shell or non-shell
  8462. return options.shell ? parseShell(parsed) : parseNonShell(parsed);
  8463. }
  8464. module.exports = parse;
  8465. /***/ }),
  8466. /***/ 577:
  8467. /***/ (function(module) {
  8468. module.exports = getPageLinks
  8469. function getPageLinks (link) {
  8470. link = link.link || link.headers.link || ''
  8471. const links = {}
  8472. // link format:
  8473. // '<https://api.github.com/users/aseemk/followers?page=2>; rel="next", <https://api.github.com/users/aseemk/followers?page=2>; rel="last"'
  8474. link.replace(/<([^>]*)>;\s*rel="([\w]*)"/g, (m, uri, type) => {
  8475. links[type] = uri
  8476. })
  8477. return links
  8478. }
  8479. /***/ }),
  8480. /***/ 586:
  8481. /***/ (function(module, __unusedexports, __webpack_require__) {
  8482. module.exports = octokitRestApiEndpoints;
  8483. const ROUTES = __webpack_require__(705);
  8484. function octokitRestApiEndpoints(octokit) {
  8485. // Aliasing scopes for backward compatibility
  8486. // See https://github.com/octokit/rest.js/pull/1134
  8487. ROUTES.gitdata = ROUTES.git;
  8488. ROUTES.authorization = ROUTES.oauthAuthorizations;
  8489. ROUTES.pullRequests = ROUTES.pulls;
  8490. octokit.registerEndpoints(ROUTES);
  8491. }
  8492. /***/ }),
  8493. /***/ 587:
  8494. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8495. "use strict";
  8496. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  8497. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  8498. return new (P || (P = Promise))(function (resolve, reject) {
  8499. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  8500. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  8501. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  8502. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8503. });
  8504. };
  8505. var __importStar = (this && this.__importStar) || function (mod) {
  8506. if (mod && mod.__esModule) return mod;
  8507. var result = {};
  8508. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  8509. result["default"] = mod;
  8510. return result;
  8511. };
  8512. Object.defineProperty(exports, "__esModule", { value: true });
  8513. const core = __importStar(__webpack_require__(470));
  8514. const maxAttempts = 3;
  8515. const minSeconds = 10;
  8516. const maxSeconds = 20;
  8517. function execute(action) {
  8518. return __awaiter(this, void 0, void 0, function* () {
  8519. let attempt = 1;
  8520. while (attempt < maxAttempts) {
  8521. // Try
  8522. try {
  8523. return yield action();
  8524. }
  8525. catch (err) {
  8526. core.info(err.message);
  8527. }
  8528. // Sleep
  8529. const seconds = getRandomIntInclusive(minSeconds, maxSeconds);
  8530. core.info(`Waiting ${seconds} before trying again`);
  8531. yield sleep(seconds * 1000);
  8532. attempt++;
  8533. }
  8534. // Last attempt
  8535. return yield action();
  8536. });
  8537. }
  8538. exports.execute = execute;
  8539. function getRandomIntInclusive(minimum, maximum) {
  8540. minimum = Math.floor(minimum);
  8541. maximum = Math.floor(maximum);
  8542. return Math.floor(Math.random() * (maximum - minimum + 1)) + minimum;
  8543. }
  8544. function sleep(milliseconds) {
  8545. return __awaiter(this, void 0, void 0, function* () {
  8546. return new Promise(resolve => setTimeout(resolve, milliseconds));
  8547. });
  8548. }
  8549. /***/ }),
  8550. /***/ 605:
  8551. /***/ (function(module) {
  8552. module.exports = require("http");
  8553. /***/ }),
  8554. /***/ 614:
  8555. /***/ (function(module) {
  8556. module.exports = require("events");
  8557. /***/ }),
  8558. /***/ 618:
  8559. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8560. "use strict";
  8561. var __importStar = (this && this.__importStar) || function (mod) {
  8562. if (mod && mod.__esModule) return mod;
  8563. var result = {};
  8564. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  8565. result["default"] = mod;
  8566. return result;
  8567. };
  8568. Object.defineProperty(exports, "__esModule", { value: true });
  8569. const fs = __importStar(__webpack_require__(747));
  8570. function directoryExistsSync(path, required) {
  8571. if (!path) {
  8572. throw new Error("Arg 'path' must not be empty");
  8573. }
  8574. let stats;
  8575. try {
  8576. stats = fs.statSync(path);
  8577. }
  8578. catch (error) {
  8579. if (error.code === 'ENOENT') {
  8580. if (!required) {
  8581. return false;
  8582. }
  8583. throw new Error(`Directory '${path}' does not exist`);
  8584. }
  8585. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  8586. }
  8587. if (stats.isDirectory()) {
  8588. return true;
  8589. }
  8590. else if (!required) {
  8591. return false;
  8592. }
  8593. throw new Error(`Directory '${path}' does not exist`);
  8594. }
  8595. exports.directoryExistsSync = directoryExistsSync;
  8596. function existsSync(path) {
  8597. if (!path) {
  8598. throw new Error("Arg 'path' must not be empty");
  8599. }
  8600. try {
  8601. fs.statSync(path);
  8602. }
  8603. catch (error) {
  8604. if (error.code === 'ENOENT') {
  8605. return false;
  8606. }
  8607. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  8608. }
  8609. return true;
  8610. }
  8611. exports.existsSync = existsSync;
  8612. function fileExistsSync(path) {
  8613. if (!path) {
  8614. throw new Error("Arg 'path' must not be empty");
  8615. }
  8616. let stats;
  8617. try {
  8618. stats = fs.statSync(path);
  8619. }
  8620. catch (error) {
  8621. if (error.code === 'ENOENT') {
  8622. return false;
  8623. }
  8624. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  8625. }
  8626. if (!stats.isDirectory()) {
  8627. return true;
  8628. }
  8629. return false;
  8630. }
  8631. exports.fileExistsSync = fileExistsSync;
  8632. /***/ }),
  8633. /***/ 621:
  8634. /***/ (function(module, __unusedexports, __webpack_require__) {
  8635. "use strict";
  8636. const path = __webpack_require__(622);
  8637. const pathKey = __webpack_require__(39);
  8638. module.exports = opts => {
  8639. opts = Object.assign({
  8640. cwd: process.cwd(),
  8641. path: process.env[pathKey()]
  8642. }, opts);
  8643. let prev;
  8644. let pth = path.resolve(opts.cwd);
  8645. const ret = [];
  8646. while (prev !== pth) {
  8647. ret.push(path.join(pth, 'node_modules/.bin'));
  8648. prev = pth;
  8649. pth = path.resolve(pth, '..');
  8650. }
  8651. // ensure the running `node` binary is used
  8652. ret.push(path.dirname(process.execPath));
  8653. return ret.concat(opts.path).join(path.delimiter);
  8654. };
  8655. module.exports.env = opts => {
  8656. opts = Object.assign({
  8657. env: process.env
  8658. }, opts);
  8659. const env = Object.assign({}, opts.env);
  8660. const path = pathKey({env});
  8661. opts.path = env[path];
  8662. env[path] = module.exports(opts);
  8663. return env;
  8664. };
  8665. /***/ }),
  8666. /***/ 622:
  8667. /***/ (function(module) {
  8668. module.exports = require("path");
  8669. /***/ }),
  8670. /***/ 631:
  8671. /***/ (function(module) {
  8672. module.exports = require("net");
  8673. /***/ }),
  8674. /***/ 649:
  8675. /***/ (function(module, __unusedexports, __webpack_require__) {
  8676. module.exports = getLastPage
  8677. const getPage = __webpack_require__(265)
  8678. function getLastPage (octokit, link, headers) {
  8679. return getPage(octokit, link, 'last', headers)
  8680. }
  8681. /***/ }),
  8682. /***/ 654:
  8683. /***/ (function(module) {
  8684. // This is not the set of all possible signals.
  8685. //
  8686. // It IS, however, the set of all signals that trigger
  8687. // an exit on either Linux or BSD systems. Linux is a
  8688. // superset of the signal names supported on BSD, and
  8689. // the unknown signals just fail to register, so we can
  8690. // catch that easily enough.
  8691. //
  8692. // Don't bother with SIGKILL. It's uncatchable, which
  8693. // means that we can't fire any callbacks anyway.
  8694. //
  8695. // If a user does happen to register a handler on a non-
  8696. // fatal signal like SIGWINCH or something, and then
  8697. // exit, it'll end up firing `process.emit('exit')`, so
  8698. // the handler will be fired anyway.
  8699. //
  8700. // SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised
  8701. // artificially, inherently leave the process in a
  8702. // state from which it is not safe to try and enter JS
  8703. // listeners.
  8704. module.exports = [
  8705. 'SIGABRT',
  8706. 'SIGALRM',
  8707. 'SIGHUP',
  8708. 'SIGINT',
  8709. 'SIGTERM'
  8710. ]
  8711. if (process.platform !== 'win32') {
  8712. module.exports.push(
  8713. 'SIGVTALRM',
  8714. 'SIGXCPU',
  8715. 'SIGXFSZ',
  8716. 'SIGUSR2',
  8717. 'SIGTRAP',
  8718. 'SIGSYS',
  8719. 'SIGQUIT',
  8720. 'SIGIOT'
  8721. // should detect profiler and enable/disable accordingly.
  8722. // see #21
  8723. // 'SIGPROF'
  8724. )
  8725. }
  8726. if (process.platform === 'linux') {
  8727. module.exports.push(
  8728. 'SIGIO',
  8729. 'SIGPOLL',
  8730. 'SIGPWR',
  8731. 'SIGSTKFLT',
  8732. 'SIGUNUSED'
  8733. )
  8734. }
  8735. /***/ }),
  8736. /***/ 656:
  8737. /***/ (function(module, exports) {
  8738. exports = module.exports = SemVer
  8739. var debug
  8740. /* istanbul ignore next */
  8741. if (typeof process === 'object' &&
  8742. process.env &&
  8743. process.env.NODE_DEBUG &&
  8744. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  8745. debug = function () {
  8746. var args = Array.prototype.slice.call(arguments, 0)
  8747. args.unshift('SEMVER')
  8748. console.log.apply(console, args)
  8749. }
  8750. } else {
  8751. debug = function () {}
  8752. }
  8753. // Note: this is the semver.org version of the spec that it implements
  8754. // Not necessarily the package version of this code.
  8755. exports.SEMVER_SPEC_VERSION = '2.0.0'
  8756. var MAX_LENGTH = 256
  8757. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  8758. /* istanbul ignore next */ 9007199254740991
  8759. // Max safe segment length for coercion.
  8760. var MAX_SAFE_COMPONENT_LENGTH = 16
  8761. // The actual regexps go on exports.re
  8762. var re = exports.re = []
  8763. var src = exports.src = []
  8764. var t = exports.tokens = {}
  8765. var R = 0
  8766. function tok (n) {
  8767. t[n] = R++
  8768. }
  8769. // The following Regular Expressions can be used for tokenizing,
  8770. // validating, and parsing SemVer version strings.
  8771. // ## Numeric Identifier
  8772. // A single `0`, or a non-zero digit followed by zero or more digits.
  8773. tok('NUMERICIDENTIFIER')
  8774. src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  8775. tok('NUMERICIDENTIFIERLOOSE')
  8776. src[t.NUMERICIDENTIFIERLOOSE] = '[0-9]+'
  8777. // ## Non-numeric Identifier
  8778. // Zero or more digits, followed by a letter or hyphen, and then zero or
  8779. // more letters, digits, or hyphens.
  8780. tok('NONNUMERICIDENTIFIER')
  8781. src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
  8782. // ## Main Version
  8783. // Three dot-separated numeric identifiers.
  8784. tok('MAINVERSION')
  8785. src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  8786. '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  8787. '(' + src[t.NUMERICIDENTIFIER] + ')'
  8788. tok('MAINVERSIONLOOSE')
  8789. src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  8790. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  8791. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')'
  8792. // ## Pre-release Version Identifier
  8793. // A numeric identifier, or a non-numeric identifier.
  8794. tok('PRERELEASEIDENTIFIER')
  8795. src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] +
  8796. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  8797. tok('PRERELEASEIDENTIFIERLOOSE')
  8798. src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] +
  8799. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  8800. // ## Pre-release Version
  8801. // Hyphen, followed by one or more dot-separated pre-release version
  8802. // identifiers.
  8803. tok('PRERELEASE')
  8804. src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] +
  8805. '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))'
  8806. tok('PRERELEASELOOSE')
  8807. src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] +
  8808. '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))'
  8809. // ## Build Metadata Identifier
  8810. // Any combination of digits, letters, or hyphens.
  8811. tok('BUILDIDENTIFIER')
  8812. src[t.BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
  8813. // ## Build Metadata
  8814. // Plus sign, followed by one or more period-separated build metadata
  8815. // identifiers.
  8816. tok('BUILD')
  8817. src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] +
  8818. '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))'
  8819. // ## Full Version String
  8820. // A main version, followed optionally by a pre-release version and
  8821. // build metadata.
  8822. // Note that the only major, minor, patch, and pre-release sections of
  8823. // the version string are capturing groups. The build metadata is not a
  8824. // capturing group, because it should not ever be used in version
  8825. // comparison.
  8826. tok('FULL')
  8827. tok('FULLPLAIN')
  8828. src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] +
  8829. src[t.PRERELEASE] + '?' +
  8830. src[t.BUILD] + '?'
  8831. src[t.FULL] = '^' + src[t.FULLPLAIN] + '$'
  8832. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  8833. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  8834. // common in the npm registry.
  8835. tok('LOOSEPLAIN')
  8836. src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] +
  8837. src[t.PRERELEASELOOSE] + '?' +
  8838. src[t.BUILD] + '?'
  8839. tok('LOOSE')
  8840. src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$'
  8841. tok('GTLT')
  8842. src[t.GTLT] = '((?:<|>)?=?)'
  8843. // Something like "2.*" or "1.2.x".
  8844. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  8845. // Only the first item is strictly required.
  8846. tok('XRANGEIDENTIFIERLOOSE')
  8847. src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  8848. tok('XRANGEIDENTIFIER')
  8849. src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*'
  8850. tok('XRANGEPLAIN')
  8851. src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' +
  8852. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  8853. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  8854. '(?:' + src[t.PRERELEASE] + ')?' +
  8855. src[t.BUILD] + '?' +
  8856. ')?)?'
  8857. tok('XRANGEPLAINLOOSE')
  8858. src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  8859. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  8860. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  8861. '(?:' + src[t.PRERELEASELOOSE] + ')?' +
  8862. src[t.BUILD] + '?' +
  8863. ')?)?'
  8864. tok('XRANGE')
  8865. src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$'
  8866. tok('XRANGELOOSE')
  8867. src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$'
  8868. // Coercion.
  8869. // Extract anything that could conceivably be a part of a valid semver
  8870. tok('COERCE')
  8871. src[t.COERCE] = '(^|[^\\d])' +
  8872. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  8873. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  8874. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  8875. '(?:$|[^\\d])'
  8876. tok('COERCERTL')
  8877. re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g')
  8878. // Tilde ranges.
  8879. // Meaning is "reasonably at or greater than"
  8880. tok('LONETILDE')
  8881. src[t.LONETILDE] = '(?:~>?)'
  8882. tok('TILDETRIM')
  8883. src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+'
  8884. re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g')
  8885. var tildeTrimReplace = '$1~'
  8886. tok('TILDE')
  8887. src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$'
  8888. tok('TILDELOOSE')
  8889. src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$'
  8890. // Caret ranges.
  8891. // Meaning is "at least and backwards compatible with"
  8892. tok('LONECARET')
  8893. src[t.LONECARET] = '(?:\\^)'
  8894. tok('CARETTRIM')
  8895. src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+'
  8896. re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g')
  8897. var caretTrimReplace = '$1^'
  8898. tok('CARET')
  8899. src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$'
  8900. tok('CARETLOOSE')
  8901. src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$'
  8902. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  8903. tok('COMPARATORLOOSE')
  8904. src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$'
  8905. tok('COMPARATOR')
  8906. src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$'
  8907. // An expression to strip any whitespace between the gtlt and the thing
  8908. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  8909. tok('COMPARATORTRIM')
  8910. src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] +
  8911. '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')'
  8912. // this one has to use the /g flag
  8913. re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g')
  8914. var comparatorTrimReplace = '$1$2$3'
  8915. // Something like `1.2.3 - 1.2.4`
  8916. // Note that these all use the loose form, because they'll be
  8917. // checked against either the strict or loose comparator form
  8918. // later.
  8919. tok('HYPHENRANGE')
  8920. src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' +
  8921. '\\s+-\\s+' +
  8922. '(' + src[t.XRANGEPLAIN] + ')' +
  8923. '\\s*$'
  8924. tok('HYPHENRANGELOOSE')
  8925. src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' +
  8926. '\\s+-\\s+' +
  8927. '(' + src[t.XRANGEPLAINLOOSE] + ')' +
  8928. '\\s*$'
  8929. // Star ranges basically just allow anything at all.
  8930. tok('STAR')
  8931. src[t.STAR] = '(<|>)?=?\\s*\\*'
  8932. // Compile to actual regexp objects.
  8933. // All are flag-free, unless they were created above with a flag.
  8934. for (var i = 0; i < R; i++) {
  8935. debug(i, src[i])
  8936. if (!re[i]) {
  8937. re[i] = new RegExp(src[i])
  8938. }
  8939. }
  8940. exports.parse = parse
  8941. function parse (version, options) {
  8942. if (!options || typeof options !== 'object') {
  8943. options = {
  8944. loose: !!options,
  8945. includePrerelease: false
  8946. }
  8947. }
  8948. if (version instanceof SemVer) {
  8949. return version
  8950. }
  8951. if (typeof version !== 'string') {
  8952. return null
  8953. }
  8954. if (version.length > MAX_LENGTH) {
  8955. return null
  8956. }
  8957. var r = options.loose ? re[t.LOOSE] : re[t.FULL]
  8958. if (!r.test(version)) {
  8959. return null
  8960. }
  8961. try {
  8962. return new SemVer(version, options)
  8963. } catch (er) {
  8964. return null
  8965. }
  8966. }
  8967. exports.valid = valid
  8968. function valid (version, options) {
  8969. var v = parse(version, options)
  8970. return v ? v.version : null
  8971. }
  8972. exports.clean = clean
  8973. function clean (version, options) {
  8974. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  8975. return s ? s.version : null
  8976. }
  8977. exports.SemVer = SemVer
  8978. function SemVer (version, options) {
  8979. if (!options || typeof options !== 'object') {
  8980. options = {
  8981. loose: !!options,
  8982. includePrerelease: false
  8983. }
  8984. }
  8985. if (version instanceof SemVer) {
  8986. if (version.loose === options.loose) {
  8987. return version
  8988. } else {
  8989. version = version.version
  8990. }
  8991. } else if (typeof version !== 'string') {
  8992. throw new TypeError('Invalid Version: ' + version)
  8993. }
  8994. if (version.length > MAX_LENGTH) {
  8995. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  8996. }
  8997. if (!(this instanceof SemVer)) {
  8998. return new SemVer(version, options)
  8999. }
  9000. debug('SemVer', version, options)
  9001. this.options = options
  9002. this.loose = !!options.loose
  9003. var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])
  9004. if (!m) {
  9005. throw new TypeError('Invalid Version: ' + version)
  9006. }
  9007. this.raw = version
  9008. // these are actually numbers
  9009. this.major = +m[1]
  9010. this.minor = +m[2]
  9011. this.patch = +m[3]
  9012. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  9013. throw new TypeError('Invalid major version')
  9014. }
  9015. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  9016. throw new TypeError('Invalid minor version')
  9017. }
  9018. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  9019. throw new TypeError('Invalid patch version')
  9020. }
  9021. // numberify any prerelease numeric ids
  9022. if (!m[4]) {
  9023. this.prerelease = []
  9024. } else {
  9025. this.prerelease = m[4].split('.').map(function (id) {
  9026. if (/^[0-9]+$/.test(id)) {
  9027. var num = +id
  9028. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  9029. return num
  9030. }
  9031. }
  9032. return id
  9033. })
  9034. }
  9035. this.build = m[5] ? m[5].split('.') : []
  9036. this.format()
  9037. }
  9038. SemVer.prototype.format = function () {
  9039. this.version = this.major + '.' + this.minor + '.' + this.patch
  9040. if (this.prerelease.length) {
  9041. this.version += '-' + this.prerelease.join('.')
  9042. }
  9043. return this.version
  9044. }
  9045. SemVer.prototype.toString = function () {
  9046. return this.version
  9047. }
  9048. SemVer.prototype.compare = function (other) {
  9049. debug('SemVer.compare', this.version, this.options, other)
  9050. if (!(other instanceof SemVer)) {
  9051. other = new SemVer(other, this.options)
  9052. }
  9053. return this.compareMain(other) || this.comparePre(other)
  9054. }
  9055. SemVer.prototype.compareMain = function (other) {
  9056. if (!(other instanceof SemVer)) {
  9057. other = new SemVer(other, this.options)
  9058. }
  9059. return compareIdentifiers(this.major, other.major) ||
  9060. compareIdentifiers(this.minor, other.minor) ||
  9061. compareIdentifiers(this.patch, other.patch)
  9062. }
  9063. SemVer.prototype.comparePre = function (other) {
  9064. if (!(other instanceof SemVer)) {
  9065. other = new SemVer(other, this.options)
  9066. }
  9067. // NOT having a prerelease is > having one
  9068. if (this.prerelease.length && !other.prerelease.length) {
  9069. return -1
  9070. } else if (!this.prerelease.length && other.prerelease.length) {
  9071. return 1
  9072. } else if (!this.prerelease.length && !other.prerelease.length) {
  9073. return 0
  9074. }
  9075. var i = 0
  9076. do {
  9077. var a = this.prerelease[i]
  9078. var b = other.prerelease[i]
  9079. debug('prerelease compare', i, a, b)
  9080. if (a === undefined && b === undefined) {
  9081. return 0
  9082. } else if (b === undefined) {
  9083. return 1
  9084. } else if (a === undefined) {
  9085. return -1
  9086. } else if (a === b) {
  9087. continue
  9088. } else {
  9089. return compareIdentifiers(a, b)
  9090. }
  9091. } while (++i)
  9092. }
  9093. SemVer.prototype.compareBuild = function (other) {
  9094. if (!(other instanceof SemVer)) {
  9095. other = new SemVer(other, this.options)
  9096. }
  9097. var i = 0
  9098. do {
  9099. var a = this.build[i]
  9100. var b = other.build[i]
  9101. debug('prerelease compare', i, a, b)
  9102. if (a === undefined && b === undefined) {
  9103. return 0
  9104. } else if (b === undefined) {
  9105. return 1
  9106. } else if (a === undefined) {
  9107. return -1
  9108. } else if (a === b) {
  9109. continue
  9110. } else {
  9111. return compareIdentifiers(a, b)
  9112. }
  9113. } while (++i)
  9114. }
  9115. // preminor will bump the version up to the next minor release, and immediately
  9116. // down to pre-release. premajor and prepatch work the same way.
  9117. SemVer.prototype.inc = function (release, identifier) {
  9118. switch (release) {
  9119. case 'premajor':
  9120. this.prerelease.length = 0
  9121. this.patch = 0
  9122. this.minor = 0
  9123. this.major++
  9124. this.inc('pre', identifier)
  9125. break
  9126. case 'preminor':
  9127. this.prerelease.length = 0
  9128. this.patch = 0
  9129. this.minor++
  9130. this.inc('pre', identifier)
  9131. break
  9132. case 'prepatch':
  9133. // If this is already a prerelease, it will bump to the next version
  9134. // drop any prereleases that might already exist, since they are not
  9135. // relevant at this point.
  9136. this.prerelease.length = 0
  9137. this.inc('patch', identifier)
  9138. this.inc('pre', identifier)
  9139. break
  9140. // If the input is a non-prerelease version, this acts the same as
  9141. // prepatch.
  9142. case 'prerelease':
  9143. if (this.prerelease.length === 0) {
  9144. this.inc('patch', identifier)
  9145. }
  9146. this.inc('pre', identifier)
  9147. break
  9148. case 'major':
  9149. // If this is a pre-major version, bump up to the same major version.
  9150. // Otherwise increment major.
  9151. // 1.0.0-5 bumps to 1.0.0
  9152. // 1.1.0 bumps to 2.0.0
  9153. if (this.minor !== 0 ||
  9154. this.patch !== 0 ||
  9155. this.prerelease.length === 0) {
  9156. this.major++
  9157. }
  9158. this.minor = 0
  9159. this.patch = 0
  9160. this.prerelease = []
  9161. break
  9162. case 'minor':
  9163. // If this is a pre-minor version, bump up to the same minor version.
  9164. // Otherwise increment minor.
  9165. // 1.2.0-5 bumps to 1.2.0
  9166. // 1.2.1 bumps to 1.3.0
  9167. if (this.patch !== 0 || this.prerelease.length === 0) {
  9168. this.minor++
  9169. }
  9170. this.patch = 0
  9171. this.prerelease = []
  9172. break
  9173. case 'patch':
  9174. // If this is not a pre-release version, it will increment the patch.
  9175. // If it is a pre-release it will bump up to the same patch version.
  9176. // 1.2.0-5 patches to 1.2.0
  9177. // 1.2.0 patches to 1.2.1
  9178. if (this.prerelease.length === 0) {
  9179. this.patch++
  9180. }
  9181. this.prerelease = []
  9182. break
  9183. // This probably shouldn't be used publicly.
  9184. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  9185. case 'pre':
  9186. if (this.prerelease.length === 0) {
  9187. this.prerelease = [0]
  9188. } else {
  9189. var i = this.prerelease.length
  9190. while (--i >= 0) {
  9191. if (typeof this.prerelease[i] === 'number') {
  9192. this.prerelease[i]++
  9193. i = -2
  9194. }
  9195. }
  9196. if (i === -1) {
  9197. // didn't increment anything
  9198. this.prerelease.push(0)
  9199. }
  9200. }
  9201. if (identifier) {
  9202. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  9203. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  9204. if (this.prerelease[0] === identifier) {
  9205. if (isNaN(this.prerelease[1])) {
  9206. this.prerelease = [identifier, 0]
  9207. }
  9208. } else {
  9209. this.prerelease = [identifier, 0]
  9210. }
  9211. }
  9212. break
  9213. default:
  9214. throw new Error('invalid increment argument: ' + release)
  9215. }
  9216. this.format()
  9217. this.raw = this.version
  9218. return this
  9219. }
  9220. exports.inc = inc
  9221. function inc (version, release, loose, identifier) {
  9222. if (typeof (loose) === 'string') {
  9223. identifier = loose
  9224. loose = undefined
  9225. }
  9226. try {
  9227. return new SemVer(version, loose).inc(release, identifier).version
  9228. } catch (er) {
  9229. return null
  9230. }
  9231. }
  9232. exports.diff = diff
  9233. function diff (version1, version2) {
  9234. if (eq(version1, version2)) {
  9235. return null
  9236. } else {
  9237. var v1 = parse(version1)
  9238. var v2 = parse(version2)
  9239. var prefix = ''
  9240. if (v1.prerelease.length || v2.prerelease.length) {
  9241. prefix = 'pre'
  9242. var defaultResult = 'prerelease'
  9243. }
  9244. for (var key in v1) {
  9245. if (key === 'major' || key === 'minor' || key === 'patch') {
  9246. if (v1[key] !== v2[key]) {
  9247. return prefix + key
  9248. }
  9249. }
  9250. }
  9251. return defaultResult // may be undefined
  9252. }
  9253. }
  9254. exports.compareIdentifiers = compareIdentifiers
  9255. var numeric = /^[0-9]+$/
  9256. function compareIdentifiers (a, b) {
  9257. var anum = numeric.test(a)
  9258. var bnum = numeric.test(b)
  9259. if (anum && bnum) {
  9260. a = +a
  9261. b = +b
  9262. }
  9263. return a === b ? 0
  9264. : (anum && !bnum) ? -1
  9265. : (bnum && !anum) ? 1
  9266. : a < b ? -1
  9267. : 1
  9268. }
  9269. exports.rcompareIdentifiers = rcompareIdentifiers
  9270. function rcompareIdentifiers (a, b) {
  9271. return compareIdentifiers(b, a)
  9272. }
  9273. exports.major = major
  9274. function major (a, loose) {
  9275. return new SemVer(a, loose).major
  9276. }
  9277. exports.minor = minor
  9278. function minor (a, loose) {
  9279. return new SemVer(a, loose).minor
  9280. }
  9281. exports.patch = patch
  9282. function patch (a, loose) {
  9283. return new SemVer(a, loose).patch
  9284. }
  9285. exports.compare = compare
  9286. function compare (a, b, loose) {
  9287. return new SemVer(a, loose).compare(new SemVer(b, loose))
  9288. }
  9289. exports.compareLoose = compareLoose
  9290. function compareLoose (a, b) {
  9291. return compare(a, b, true)
  9292. }
  9293. exports.compareBuild = compareBuild
  9294. function compareBuild (a, b, loose) {
  9295. var versionA = new SemVer(a, loose)
  9296. var versionB = new SemVer(b, loose)
  9297. return versionA.compare(versionB) || versionA.compareBuild(versionB)
  9298. }
  9299. exports.rcompare = rcompare
  9300. function rcompare (a, b, loose) {
  9301. return compare(b, a, loose)
  9302. }
  9303. exports.sort = sort
  9304. function sort (list, loose) {
  9305. return list.sort(function (a, b) {
  9306. return exports.compareBuild(a, b, loose)
  9307. })
  9308. }
  9309. exports.rsort = rsort
  9310. function rsort (list, loose) {
  9311. return list.sort(function (a, b) {
  9312. return exports.compareBuild(b, a, loose)
  9313. })
  9314. }
  9315. exports.gt = gt
  9316. function gt (a, b, loose) {
  9317. return compare(a, b, loose) > 0
  9318. }
  9319. exports.lt = lt
  9320. function lt (a, b, loose) {
  9321. return compare(a, b, loose) < 0
  9322. }
  9323. exports.eq = eq
  9324. function eq (a, b, loose) {
  9325. return compare(a, b, loose) === 0
  9326. }
  9327. exports.neq = neq
  9328. function neq (a, b, loose) {
  9329. return compare(a, b, loose) !== 0
  9330. }
  9331. exports.gte = gte
  9332. function gte (a, b, loose) {
  9333. return compare(a, b, loose) >= 0
  9334. }
  9335. exports.lte = lte
  9336. function lte (a, b, loose) {
  9337. return compare(a, b, loose) <= 0
  9338. }
  9339. exports.cmp = cmp
  9340. function cmp (a, op, b, loose) {
  9341. switch (op) {
  9342. case '===':
  9343. if (typeof a === 'object')
  9344. a = a.version
  9345. if (typeof b === 'object')
  9346. b = b.version
  9347. return a === b
  9348. case '!==':
  9349. if (typeof a === 'object')
  9350. a = a.version
  9351. if (typeof b === 'object')
  9352. b = b.version
  9353. return a !== b
  9354. case '':
  9355. case '=':
  9356. case '==':
  9357. return eq(a, b, loose)
  9358. case '!=':
  9359. return neq(a, b, loose)
  9360. case '>':
  9361. return gt(a, b, loose)
  9362. case '>=':
  9363. return gte(a, b, loose)
  9364. case '<':
  9365. return lt(a, b, loose)
  9366. case '<=':
  9367. return lte(a, b, loose)
  9368. default:
  9369. throw new TypeError('Invalid operator: ' + op)
  9370. }
  9371. }
  9372. exports.Comparator = Comparator
  9373. function Comparator (comp, options) {
  9374. if (!options || typeof options !== 'object') {
  9375. options = {
  9376. loose: !!options,
  9377. includePrerelease: false
  9378. }
  9379. }
  9380. if (comp instanceof Comparator) {
  9381. if (comp.loose === !!options.loose) {
  9382. return comp
  9383. } else {
  9384. comp = comp.value
  9385. }
  9386. }
  9387. if (!(this instanceof Comparator)) {
  9388. return new Comparator(comp, options)
  9389. }
  9390. debug('comparator', comp, options)
  9391. this.options = options
  9392. this.loose = !!options.loose
  9393. this.parse(comp)
  9394. if (this.semver === ANY) {
  9395. this.value = ''
  9396. } else {
  9397. this.value = this.operator + this.semver.version
  9398. }
  9399. debug('comp', this)
  9400. }
  9401. var ANY = {}
  9402. Comparator.prototype.parse = function (comp) {
  9403. var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
  9404. var m = comp.match(r)
  9405. if (!m) {
  9406. throw new TypeError('Invalid comparator: ' + comp)
  9407. }
  9408. this.operator = m[1] !== undefined ? m[1] : ''
  9409. if (this.operator === '=') {
  9410. this.operator = ''
  9411. }
  9412. // if it literally is just '>' or '' then allow anything.
  9413. if (!m[2]) {
  9414. this.semver = ANY
  9415. } else {
  9416. this.semver = new SemVer(m[2], this.options.loose)
  9417. }
  9418. }
  9419. Comparator.prototype.toString = function () {
  9420. return this.value
  9421. }
  9422. Comparator.prototype.test = function (version) {
  9423. debug('Comparator.test', version, this.options.loose)
  9424. if (this.semver === ANY || version === ANY) {
  9425. return true
  9426. }
  9427. if (typeof version === 'string') {
  9428. try {
  9429. version = new SemVer(version, this.options)
  9430. } catch (er) {
  9431. return false
  9432. }
  9433. }
  9434. return cmp(version, this.operator, this.semver, this.options)
  9435. }
  9436. Comparator.prototype.intersects = function (comp, options) {
  9437. if (!(comp instanceof Comparator)) {
  9438. throw new TypeError('a Comparator is required')
  9439. }
  9440. if (!options || typeof options !== 'object') {
  9441. options = {
  9442. loose: !!options,
  9443. includePrerelease: false
  9444. }
  9445. }
  9446. var rangeTmp
  9447. if (this.operator === '') {
  9448. if (this.value === '') {
  9449. return true
  9450. }
  9451. rangeTmp = new Range(comp.value, options)
  9452. return satisfies(this.value, rangeTmp, options)
  9453. } else if (comp.operator === '') {
  9454. if (comp.value === '') {
  9455. return true
  9456. }
  9457. rangeTmp = new Range(this.value, options)
  9458. return satisfies(comp.semver, rangeTmp, options)
  9459. }
  9460. var sameDirectionIncreasing =
  9461. (this.operator === '>=' || this.operator === '>') &&
  9462. (comp.operator === '>=' || comp.operator === '>')
  9463. var sameDirectionDecreasing =
  9464. (this.operator === '<=' || this.operator === '<') &&
  9465. (comp.operator === '<=' || comp.operator === '<')
  9466. var sameSemVer = this.semver.version === comp.semver.version
  9467. var differentDirectionsInclusive =
  9468. (this.operator === '>=' || this.operator === '<=') &&
  9469. (comp.operator === '>=' || comp.operator === '<=')
  9470. var oppositeDirectionsLessThan =
  9471. cmp(this.semver, '<', comp.semver, options) &&
  9472. ((this.operator === '>=' || this.operator === '>') &&
  9473. (comp.operator === '<=' || comp.operator === '<'))
  9474. var oppositeDirectionsGreaterThan =
  9475. cmp(this.semver, '>', comp.semver, options) &&
  9476. ((this.operator === '<=' || this.operator === '<') &&
  9477. (comp.operator === '>=' || comp.operator === '>'))
  9478. return sameDirectionIncreasing || sameDirectionDecreasing ||
  9479. (sameSemVer && differentDirectionsInclusive) ||
  9480. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  9481. }
  9482. exports.Range = Range
  9483. function Range (range, options) {
  9484. if (!options || typeof options !== 'object') {
  9485. options = {
  9486. loose: !!options,
  9487. includePrerelease: false
  9488. }
  9489. }
  9490. if (range instanceof Range) {
  9491. if (range.loose === !!options.loose &&
  9492. range.includePrerelease === !!options.includePrerelease) {
  9493. return range
  9494. } else {
  9495. return new Range(range.raw, options)
  9496. }
  9497. }
  9498. if (range instanceof Comparator) {
  9499. return new Range(range.value, options)
  9500. }
  9501. if (!(this instanceof Range)) {
  9502. return new Range(range, options)
  9503. }
  9504. this.options = options
  9505. this.loose = !!options.loose
  9506. this.includePrerelease = !!options.includePrerelease
  9507. // First, split based on boolean or ||
  9508. this.raw = range
  9509. this.set = range.split(/\s*\|\|\s*/).map(function (range) {
  9510. return this.parseRange(range.trim())
  9511. }, this).filter(function (c) {
  9512. // throw out any that are not relevant for whatever reason
  9513. return c.length
  9514. })
  9515. if (!this.set.length) {
  9516. throw new TypeError('Invalid SemVer Range: ' + range)
  9517. }
  9518. this.format()
  9519. }
  9520. Range.prototype.format = function () {
  9521. this.range = this.set.map(function (comps) {
  9522. return comps.join(' ').trim()
  9523. }).join('||').trim()
  9524. return this.range
  9525. }
  9526. Range.prototype.toString = function () {
  9527. return this.range
  9528. }
  9529. Range.prototype.parseRange = function (range) {
  9530. var loose = this.options.loose
  9531. range = range.trim()
  9532. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  9533. var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]
  9534. range = range.replace(hr, hyphenReplace)
  9535. debug('hyphen replace', range)
  9536. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  9537. range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)
  9538. debug('comparator trim', range, re[t.COMPARATORTRIM])
  9539. // `~ 1.2.3` => `~1.2.3`
  9540. range = range.replace(re[t.TILDETRIM], tildeTrimReplace)
  9541. // `^ 1.2.3` => `^1.2.3`
  9542. range = range.replace(re[t.CARETTRIM], caretTrimReplace)
  9543. // normalize spaces
  9544. range = range.split(/\s+/).join(' ')
  9545. // At this point, the range is completely trimmed and
  9546. // ready to be split into comparators.
  9547. var compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
  9548. var set = range.split(' ').map(function (comp) {
  9549. return parseComparator(comp, this.options)
  9550. }, this).join(' ').split(/\s+/)
  9551. if (this.options.loose) {
  9552. // in loose mode, throw out any that are not valid comparators
  9553. set = set.filter(function (comp) {
  9554. return !!comp.match(compRe)
  9555. })
  9556. }
  9557. set = set.map(function (comp) {
  9558. return new Comparator(comp, this.options)
  9559. }, this)
  9560. return set
  9561. }
  9562. Range.prototype.intersects = function (range, options) {
  9563. if (!(range instanceof Range)) {
  9564. throw new TypeError('a Range is required')
  9565. }
  9566. return this.set.some(function (thisComparators) {
  9567. return (
  9568. isSatisfiable(thisComparators, options) &&
  9569. range.set.some(function (rangeComparators) {
  9570. return (
  9571. isSatisfiable(rangeComparators, options) &&
  9572. thisComparators.every(function (thisComparator) {
  9573. return rangeComparators.every(function (rangeComparator) {
  9574. return thisComparator.intersects(rangeComparator, options)
  9575. })
  9576. })
  9577. )
  9578. })
  9579. )
  9580. })
  9581. }
  9582. // take a set of comparators and determine whether there
  9583. // exists a version which can satisfy it
  9584. function isSatisfiable (comparators, options) {
  9585. var result = true
  9586. var remainingComparators = comparators.slice()
  9587. var testComparator = remainingComparators.pop()
  9588. while (result && remainingComparators.length) {
  9589. result = remainingComparators.every(function (otherComparator) {
  9590. return testComparator.intersects(otherComparator, options)
  9591. })
  9592. testComparator = remainingComparators.pop()
  9593. }
  9594. return result
  9595. }
  9596. // Mostly just for testing and legacy API reasons
  9597. exports.toComparators = toComparators
  9598. function toComparators (range, options) {
  9599. return new Range(range, options).set.map(function (comp) {
  9600. return comp.map(function (c) {
  9601. return c.value
  9602. }).join(' ').trim().split(' ')
  9603. })
  9604. }
  9605. // comprised of xranges, tildes, stars, and gtlt's at this point.
  9606. // already replaced the hyphen ranges
  9607. // turn into a set of JUST comparators.
  9608. function parseComparator (comp, options) {
  9609. debug('comp', comp, options)
  9610. comp = replaceCarets(comp, options)
  9611. debug('caret', comp)
  9612. comp = replaceTildes(comp, options)
  9613. debug('tildes', comp)
  9614. comp = replaceXRanges(comp, options)
  9615. debug('xrange', comp)
  9616. comp = replaceStars(comp, options)
  9617. debug('stars', comp)
  9618. return comp
  9619. }
  9620. function isX (id) {
  9621. return !id || id.toLowerCase() === 'x' || id === '*'
  9622. }
  9623. // ~, ~> --> * (any, kinda silly)
  9624. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  9625. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  9626. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  9627. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  9628. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  9629. function replaceTildes (comp, options) {
  9630. return comp.trim().split(/\s+/).map(function (comp) {
  9631. return replaceTilde(comp, options)
  9632. }).join(' ')
  9633. }
  9634. function replaceTilde (comp, options) {
  9635. var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]
  9636. return comp.replace(r, function (_, M, m, p, pr) {
  9637. debug('tilde', comp, _, M, m, p, pr)
  9638. var ret
  9639. if (isX(M)) {
  9640. ret = ''
  9641. } else if (isX(m)) {
  9642. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  9643. } else if (isX(p)) {
  9644. // ~1.2 == >=1.2.0 <1.3.0
  9645. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  9646. } else if (pr) {
  9647. debug('replaceTilde pr', pr)
  9648. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  9649. ' <' + M + '.' + (+m + 1) + '.0'
  9650. } else {
  9651. // ~1.2.3 == >=1.2.3 <1.3.0
  9652. ret = '>=' + M + '.' + m + '.' + p +
  9653. ' <' + M + '.' + (+m + 1) + '.0'
  9654. }
  9655. debug('tilde return', ret)
  9656. return ret
  9657. })
  9658. }
  9659. // ^ --> * (any, kinda silly)
  9660. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  9661. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  9662. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  9663. // ^1.2.3 --> >=1.2.3 <2.0.0
  9664. // ^1.2.0 --> >=1.2.0 <2.0.0
  9665. function replaceCarets (comp, options) {
  9666. return comp.trim().split(/\s+/).map(function (comp) {
  9667. return replaceCaret(comp, options)
  9668. }).join(' ')
  9669. }
  9670. function replaceCaret (comp, options) {
  9671. debug('caret', comp, options)
  9672. var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]
  9673. return comp.replace(r, function (_, M, m, p, pr) {
  9674. debug('caret', comp, _, M, m, p, pr)
  9675. var ret
  9676. if (isX(M)) {
  9677. ret = ''
  9678. } else if (isX(m)) {
  9679. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  9680. } else if (isX(p)) {
  9681. if (M === '0') {
  9682. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  9683. } else {
  9684. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  9685. }
  9686. } else if (pr) {
  9687. debug('replaceCaret pr', pr)
  9688. if (M === '0') {
  9689. if (m === '0') {
  9690. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  9691. ' <' + M + '.' + m + '.' + (+p + 1)
  9692. } else {
  9693. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  9694. ' <' + M + '.' + (+m + 1) + '.0'
  9695. }
  9696. } else {
  9697. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  9698. ' <' + (+M + 1) + '.0.0'
  9699. }
  9700. } else {
  9701. debug('no pr')
  9702. if (M === '0') {
  9703. if (m === '0') {
  9704. ret = '>=' + M + '.' + m + '.' + p +
  9705. ' <' + M + '.' + m + '.' + (+p + 1)
  9706. } else {
  9707. ret = '>=' + M + '.' + m + '.' + p +
  9708. ' <' + M + '.' + (+m + 1) + '.0'
  9709. }
  9710. } else {
  9711. ret = '>=' + M + '.' + m + '.' + p +
  9712. ' <' + (+M + 1) + '.0.0'
  9713. }
  9714. }
  9715. debug('caret return', ret)
  9716. return ret
  9717. })
  9718. }
  9719. function replaceXRanges (comp, options) {
  9720. debug('replaceXRanges', comp, options)
  9721. return comp.split(/\s+/).map(function (comp) {
  9722. return replaceXRange(comp, options)
  9723. }).join(' ')
  9724. }
  9725. function replaceXRange (comp, options) {
  9726. comp = comp.trim()
  9727. var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]
  9728. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  9729. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  9730. var xM = isX(M)
  9731. var xm = xM || isX(m)
  9732. var xp = xm || isX(p)
  9733. var anyX = xp
  9734. if (gtlt === '=' && anyX) {
  9735. gtlt = ''
  9736. }
  9737. // if we're including prereleases in the match, then we need
  9738. // to fix this to -0, the lowest possible prerelease value
  9739. pr = options.includePrerelease ? '-0' : ''
  9740. if (xM) {
  9741. if (gtlt === '>' || gtlt === '<') {
  9742. // nothing is allowed
  9743. ret = '<0.0.0-0'
  9744. } else {
  9745. // nothing is forbidden
  9746. ret = '*'
  9747. }
  9748. } else if (gtlt && anyX) {
  9749. // we know patch is an x, because we have any x at all.
  9750. // replace X with 0
  9751. if (xm) {
  9752. m = 0
  9753. }
  9754. p = 0
  9755. if (gtlt === '>') {
  9756. // >1 => >=2.0.0
  9757. // >1.2 => >=1.3.0
  9758. // >1.2.3 => >= 1.2.4
  9759. gtlt = '>='
  9760. if (xm) {
  9761. M = +M + 1
  9762. m = 0
  9763. p = 0
  9764. } else {
  9765. m = +m + 1
  9766. p = 0
  9767. }
  9768. } else if (gtlt === '<=') {
  9769. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  9770. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  9771. gtlt = '<'
  9772. if (xm) {
  9773. M = +M + 1
  9774. } else {
  9775. m = +m + 1
  9776. }
  9777. }
  9778. ret = gtlt + M + '.' + m + '.' + p + pr
  9779. } else if (xm) {
  9780. ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr
  9781. } else if (xp) {
  9782. ret = '>=' + M + '.' + m + '.0' + pr +
  9783. ' <' + M + '.' + (+m + 1) + '.0' + pr
  9784. }
  9785. debug('xRange return', ret)
  9786. return ret
  9787. })
  9788. }
  9789. // Because * is AND-ed with everything else in the comparator,
  9790. // and '' means "any version", just remove the *s entirely.
  9791. function replaceStars (comp, options) {
  9792. debug('replaceStars', comp, options)
  9793. // Looseness is ignored here. star is always as loose as it gets!
  9794. return comp.trim().replace(re[t.STAR], '')
  9795. }
  9796. // This function is passed to string.replace(re[t.HYPHENRANGE])
  9797. // M, m, patch, prerelease, build
  9798. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  9799. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  9800. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  9801. function hyphenReplace ($0,
  9802. from, fM, fm, fp, fpr, fb,
  9803. to, tM, tm, tp, tpr, tb) {
  9804. if (isX(fM)) {
  9805. from = ''
  9806. } else if (isX(fm)) {
  9807. from = '>=' + fM + '.0.0'
  9808. } else if (isX(fp)) {
  9809. from = '>=' + fM + '.' + fm + '.0'
  9810. } else {
  9811. from = '>=' + from
  9812. }
  9813. if (isX(tM)) {
  9814. to = ''
  9815. } else if (isX(tm)) {
  9816. to = '<' + (+tM + 1) + '.0.0'
  9817. } else if (isX(tp)) {
  9818. to = '<' + tM + '.' + (+tm + 1) + '.0'
  9819. } else if (tpr) {
  9820. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  9821. } else {
  9822. to = '<=' + to
  9823. }
  9824. return (from + ' ' + to).trim()
  9825. }
  9826. // if ANY of the sets match ALL of its comparators, then pass
  9827. Range.prototype.test = function (version) {
  9828. if (!version) {
  9829. return false
  9830. }
  9831. if (typeof version === 'string') {
  9832. try {
  9833. version = new SemVer(version, this.options)
  9834. } catch (er) {
  9835. return false
  9836. }
  9837. }
  9838. for (var i = 0; i < this.set.length; i++) {
  9839. if (testSet(this.set[i], version, this.options)) {
  9840. return true
  9841. }
  9842. }
  9843. return false
  9844. }
  9845. function testSet (set, version, options) {
  9846. for (var i = 0; i < set.length; i++) {
  9847. if (!set[i].test(version)) {
  9848. return false
  9849. }
  9850. }
  9851. if (version.prerelease.length && !options.includePrerelease) {
  9852. // Find the set of versions that are allowed to have prereleases
  9853. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  9854. // That should allow `1.2.3-pr.2` to pass.
  9855. // However, `1.2.4-alpha.notready` should NOT be allowed,
  9856. // even though it's within the range set by the comparators.
  9857. for (i = 0; i < set.length; i++) {
  9858. debug(set[i].semver)
  9859. if (set[i].semver === ANY) {
  9860. continue
  9861. }
  9862. if (set[i].semver.prerelease.length > 0) {
  9863. var allowed = set[i].semver
  9864. if (allowed.major === version.major &&
  9865. allowed.minor === version.minor &&
  9866. allowed.patch === version.patch) {
  9867. return true
  9868. }
  9869. }
  9870. }
  9871. // Version has a -pre, but it's not one of the ones we like.
  9872. return false
  9873. }
  9874. return true
  9875. }
  9876. exports.satisfies = satisfies
  9877. function satisfies (version, range, options) {
  9878. try {
  9879. range = new Range(range, options)
  9880. } catch (er) {
  9881. return false
  9882. }
  9883. return range.test(version)
  9884. }
  9885. exports.maxSatisfying = maxSatisfying
  9886. function maxSatisfying (versions, range, options) {
  9887. var max = null
  9888. var maxSV = null
  9889. try {
  9890. var rangeObj = new Range(range, options)
  9891. } catch (er) {
  9892. return null
  9893. }
  9894. versions.forEach(function (v) {
  9895. if (rangeObj.test(v)) {
  9896. // satisfies(v, range, options)
  9897. if (!max || maxSV.compare(v) === -1) {
  9898. // compare(max, v, true)
  9899. max = v
  9900. maxSV = new SemVer(max, options)
  9901. }
  9902. }
  9903. })
  9904. return max
  9905. }
  9906. exports.minSatisfying = minSatisfying
  9907. function minSatisfying (versions, range, options) {
  9908. var min = null
  9909. var minSV = null
  9910. try {
  9911. var rangeObj = new Range(range, options)
  9912. } catch (er) {
  9913. return null
  9914. }
  9915. versions.forEach(function (v) {
  9916. if (rangeObj.test(v)) {
  9917. // satisfies(v, range, options)
  9918. if (!min || minSV.compare(v) === 1) {
  9919. // compare(min, v, true)
  9920. min = v
  9921. minSV = new SemVer(min, options)
  9922. }
  9923. }
  9924. })
  9925. return min
  9926. }
  9927. exports.minVersion = minVersion
  9928. function minVersion (range, loose) {
  9929. range = new Range(range, loose)
  9930. var minver = new SemVer('0.0.0')
  9931. if (range.test(minver)) {
  9932. return minver
  9933. }
  9934. minver = new SemVer('0.0.0-0')
  9935. if (range.test(minver)) {
  9936. return minver
  9937. }
  9938. minver = null
  9939. for (var i = 0; i < range.set.length; ++i) {
  9940. var comparators = range.set[i]
  9941. comparators.forEach(function (comparator) {
  9942. // Clone to avoid manipulating the comparator's semver object.
  9943. var compver = new SemVer(comparator.semver.version)
  9944. switch (comparator.operator) {
  9945. case '>':
  9946. if (compver.prerelease.length === 0) {
  9947. compver.patch++
  9948. } else {
  9949. compver.prerelease.push(0)
  9950. }
  9951. compver.raw = compver.format()
  9952. /* fallthrough */
  9953. case '':
  9954. case '>=':
  9955. if (!minver || gt(minver, compver)) {
  9956. minver = compver
  9957. }
  9958. break
  9959. case '<':
  9960. case '<=':
  9961. /* Ignore maximum versions */
  9962. break
  9963. /* istanbul ignore next */
  9964. default:
  9965. throw new Error('Unexpected operation: ' + comparator.operator)
  9966. }
  9967. })
  9968. }
  9969. if (minver && range.test(minver)) {
  9970. return minver
  9971. }
  9972. return null
  9973. }
  9974. exports.validRange = validRange
  9975. function validRange (range, options) {
  9976. try {
  9977. // Return '*' instead of '' so that truthiness works.
  9978. // This will throw if it's invalid anyway
  9979. return new Range(range, options).range || '*'
  9980. } catch (er) {
  9981. return null
  9982. }
  9983. }
  9984. // Determine if version is less than all the versions possible in the range
  9985. exports.ltr = ltr
  9986. function ltr (version, range, options) {
  9987. return outside(version, range, '<', options)
  9988. }
  9989. // Determine if version is greater than all the versions possible in the range.
  9990. exports.gtr = gtr
  9991. function gtr (version, range, options) {
  9992. return outside(version, range, '>', options)
  9993. }
  9994. exports.outside = outside
  9995. function outside (version, range, hilo, options) {
  9996. version = new SemVer(version, options)
  9997. range = new Range(range, options)
  9998. var gtfn, ltefn, ltfn, comp, ecomp
  9999. switch (hilo) {
  10000. case '>':
  10001. gtfn = gt
  10002. ltefn = lte
  10003. ltfn = lt
  10004. comp = '>'
  10005. ecomp = '>='
  10006. break
  10007. case '<':
  10008. gtfn = lt
  10009. ltefn = gte
  10010. ltfn = gt
  10011. comp = '<'
  10012. ecomp = '<='
  10013. break
  10014. default:
  10015. throw new TypeError('Must provide a hilo val of "<" or ">"')
  10016. }
  10017. // If it satisifes the range it is not outside
  10018. if (satisfies(version, range, options)) {
  10019. return false
  10020. }
  10021. // From now on, variable terms are as if we're in "gtr" mode.
  10022. // but note that everything is flipped for the "ltr" function.
  10023. for (var i = 0; i < range.set.length; ++i) {
  10024. var comparators = range.set[i]
  10025. var high = null
  10026. var low = null
  10027. comparators.forEach(function (comparator) {
  10028. if (comparator.semver === ANY) {
  10029. comparator = new Comparator('>=0.0.0')
  10030. }
  10031. high = high || comparator
  10032. low = low || comparator
  10033. if (gtfn(comparator.semver, high.semver, options)) {
  10034. high = comparator
  10035. } else if (ltfn(comparator.semver, low.semver, options)) {
  10036. low = comparator
  10037. }
  10038. })
  10039. // If the edge version comparator has a operator then our version
  10040. // isn't outside it
  10041. if (high.operator === comp || high.operator === ecomp) {
  10042. return false
  10043. }
  10044. // If the lowest version comparator has an operator and our version
  10045. // is less than it then it isn't higher than the range
  10046. if ((!low.operator || low.operator === comp) &&
  10047. ltefn(version, low.semver)) {
  10048. return false
  10049. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  10050. return false
  10051. }
  10052. }
  10053. return true
  10054. }
  10055. exports.prerelease = prerelease
  10056. function prerelease (version, options) {
  10057. var parsed = parse(version, options)
  10058. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  10059. }
  10060. exports.intersects = intersects
  10061. function intersects (r1, r2, options) {
  10062. r1 = new Range(r1, options)
  10063. r2 = new Range(r2, options)
  10064. return r1.intersects(r2)
  10065. }
  10066. exports.coerce = coerce
  10067. function coerce (version, options) {
  10068. if (version instanceof SemVer) {
  10069. return version
  10070. }
  10071. if (typeof version === 'number') {
  10072. version = String(version)
  10073. }
  10074. if (typeof version !== 'string') {
  10075. return null
  10076. }
  10077. options = options || {}
  10078. var match = null
  10079. if (!options.rtl) {
  10080. match = version.match(re[t.COERCE])
  10081. } else {
  10082. // Find the right-most coercible string that does not share
  10083. // a terminus with a more left-ward coercible string.
  10084. // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
  10085. //
  10086. // Walk through the string checking with a /g regexp
  10087. // Manually set the index so as to pick up overlapping matches.
  10088. // Stop when we get a match that ends at the string end, since no
  10089. // coercible string can be more right-ward without the same terminus.
  10090. var next
  10091. while ((next = re[t.COERCERTL].exec(version)) &&
  10092. (!match || match.index + match[0].length !== version.length)
  10093. ) {
  10094. if (!match ||
  10095. next.index + next[0].length !== match.index + match[0].length) {
  10096. match = next
  10097. }
  10098. re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length
  10099. }
  10100. // leave it in a clean state
  10101. re[t.COERCERTL].lastIndex = -1
  10102. }
  10103. if (match === null) {
  10104. return null
  10105. }
  10106. return parse(match[2] +
  10107. '.' + (match[3] || '0') +
  10108. '.' + (match[4] || '0'), options)
  10109. }
  10110. /***/ }),
  10111. /***/ 669:
  10112. /***/ (function(module) {
  10113. module.exports = require("util");
  10114. /***/ }),
  10115. /***/ 672:
  10116. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  10117. "use strict";
  10118. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  10119. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  10120. return new (P || (P = Promise))(function (resolve, reject) {
  10121. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  10122. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  10123. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  10124. step((generator = generator.apply(thisArg, _arguments || [])).next());
  10125. });
  10126. };
  10127. var _a;
  10128. Object.defineProperty(exports, "__esModule", { value: true });
  10129. const assert_1 = __webpack_require__(357);
  10130. const fs = __webpack_require__(747);
  10131. const path = __webpack_require__(622);
  10132. _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;
  10133. exports.IS_WINDOWS = process.platform === 'win32';
  10134. function exists(fsPath) {
  10135. return __awaiter(this, void 0, void 0, function* () {
  10136. try {
  10137. yield exports.stat(fsPath);
  10138. }
  10139. catch (err) {
  10140. if (err.code === 'ENOENT') {
  10141. return false;
  10142. }
  10143. throw err;
  10144. }
  10145. return true;
  10146. });
  10147. }
  10148. exports.exists = exists;
  10149. function isDirectory(fsPath, useStat = false) {
  10150. return __awaiter(this, void 0, void 0, function* () {
  10151. const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath);
  10152. return stats.isDirectory();
  10153. });
  10154. }
  10155. exports.isDirectory = isDirectory;
  10156. /**
  10157. * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:
  10158. * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases).
  10159. */
  10160. function isRooted(p) {
  10161. p = normalizeSeparators(p);
  10162. if (!p) {
  10163. throw new Error('isRooted() parameter "p" cannot be empty');
  10164. }
  10165. if (exports.IS_WINDOWS) {
  10166. return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello
  10167. ); // e.g. C: or C:\hello
  10168. }
  10169. return p.startsWith('/');
  10170. }
  10171. exports.isRooted = isRooted;
  10172. /**
  10173. * Recursively create a directory at `fsPath`.
  10174. *
  10175. * This implementation is optimistic, meaning it attempts to create the full
  10176. * path first, and backs up the path stack from there.
  10177. *
  10178. * @param fsPath The path to create
  10179. * @param maxDepth The maximum recursion depth
  10180. * @param depth The current recursion depth
  10181. */
  10182. function mkdirP(fsPath, maxDepth = 1000, depth = 1) {
  10183. return __awaiter(this, void 0, void 0, function* () {
  10184. assert_1.ok(fsPath, 'a path argument must be provided');
  10185. fsPath = path.resolve(fsPath);
  10186. if (depth >= maxDepth)
  10187. return exports.mkdir(fsPath);
  10188. try {
  10189. yield exports.mkdir(fsPath);
  10190. return;
  10191. }
  10192. catch (err) {
  10193. switch (err.code) {
  10194. case 'ENOENT': {
  10195. yield mkdirP(path.dirname(fsPath), maxDepth, depth + 1);
  10196. yield exports.mkdir(fsPath);
  10197. return;
  10198. }
  10199. default: {
  10200. let stats;
  10201. try {
  10202. stats = yield exports.stat(fsPath);
  10203. }
  10204. catch (err2) {
  10205. throw err;
  10206. }
  10207. if (!stats.isDirectory())
  10208. throw err;
  10209. }
  10210. }
  10211. }
  10212. });
  10213. }
  10214. exports.mkdirP = mkdirP;
  10215. /**
  10216. * Best effort attempt to determine whether a file exists and is executable.
  10217. * @param filePath file path to check
  10218. * @param extensions additional file extensions to try
  10219. * @return if file exists and is executable, returns the file path. otherwise empty string.
  10220. */
  10221. function tryGetExecutablePath(filePath, extensions) {
  10222. return __awaiter(this, void 0, void 0, function* () {
  10223. let stats = undefined;
  10224. try {
  10225. // test file exists
  10226. stats = yield exports.stat(filePath);
  10227. }
  10228. catch (err) {
  10229. if (err.code !== 'ENOENT') {
  10230. // eslint-disable-next-line no-console
  10231. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  10232. }
  10233. }
  10234. if (stats && stats.isFile()) {
  10235. if (exports.IS_WINDOWS) {
  10236. // on Windows, test for valid extension
  10237. const upperExt = path.extname(filePath).toUpperCase();
  10238. if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) {
  10239. return filePath;
  10240. }
  10241. }
  10242. else {
  10243. if (isUnixExecutable(stats)) {
  10244. return filePath;
  10245. }
  10246. }
  10247. }
  10248. // try each extension
  10249. const originalFilePath = filePath;
  10250. for (const extension of extensions) {
  10251. filePath = originalFilePath + extension;
  10252. stats = undefined;
  10253. try {
  10254. stats = yield exports.stat(filePath);
  10255. }
  10256. catch (err) {
  10257. if (err.code !== 'ENOENT') {
  10258. // eslint-disable-next-line no-console
  10259. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  10260. }
  10261. }
  10262. if (stats && stats.isFile()) {
  10263. if (exports.IS_WINDOWS) {
  10264. // preserve the case of the actual file (since an extension was appended)
  10265. try {
  10266. const directory = path.dirname(filePath);
  10267. const upperName = path.basename(filePath).toUpperCase();
  10268. for (const actualName of yield exports.readdir(directory)) {
  10269. if (upperName === actualName.toUpperCase()) {
  10270. filePath = path.join(directory, actualName);
  10271. break;
  10272. }
  10273. }
  10274. }
  10275. catch (err) {
  10276. // eslint-disable-next-line no-console
  10277. console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`);
  10278. }
  10279. return filePath;
  10280. }
  10281. else {
  10282. if (isUnixExecutable(stats)) {
  10283. return filePath;
  10284. }
  10285. }
  10286. }
  10287. }
  10288. return '';
  10289. });
  10290. }
  10291. exports.tryGetExecutablePath = tryGetExecutablePath;
  10292. function normalizeSeparators(p) {
  10293. p = p || '';
  10294. if (exports.IS_WINDOWS) {
  10295. // convert slashes on Windows
  10296. p = p.replace(/\//g, '\\');
  10297. // remove redundant slashes
  10298. return p.replace(/\\\\+/g, '\\');
  10299. }
  10300. // remove redundant slashes
  10301. return p.replace(/\/\/+/g, '/');
  10302. }
  10303. // on Mac/Linux, test the execute bit
  10304. // R W X R W X R W X
  10305. // 256 128 64 32 16 8 4 2 1
  10306. function isUnixExecutable(stats) {
  10307. return ((stats.mode & 1) > 0 ||
  10308. ((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||
  10309. ((stats.mode & 64) > 0 && stats.uid === process.getuid()));
  10310. }
  10311. //# sourceMappingURL=io-util.js.map
  10312. /***/ }),
  10313. /***/ 674:
  10314. /***/ (function(module, __unusedexports, __webpack_require__) {
  10315. module.exports = authenticate;
  10316. const { Deprecation } = __webpack_require__(692);
  10317. const once = __webpack_require__(969);
  10318. const deprecateAuthenticate = once((log, deprecation) => log.warn(deprecation));
  10319. function authenticate(state, options) {
  10320. deprecateAuthenticate(
  10321. state.octokit.log,
  10322. new Deprecation(
  10323. '[@octokit/rest] octokit.authenticate() is deprecated. Use "auth" constructor option instead.'
  10324. )
  10325. );
  10326. if (!options) {
  10327. state.auth = false;
  10328. return;
  10329. }
  10330. switch (options.type) {
  10331. case "basic":
  10332. if (!options.username || !options.password) {
  10333. throw new Error(
  10334. "Basic authentication requires both a username and password to be set"
  10335. );
  10336. }
  10337. break;
  10338. case "oauth":
  10339. if (!options.token && !(options.key && options.secret)) {
  10340. throw new Error(
  10341. "OAuth2 authentication requires a token or key & secret to be set"
  10342. );
  10343. }
  10344. break;
  10345. case "token":
  10346. case "app":
  10347. if (!options.token) {
  10348. throw new Error("Token authentication requires a token to be set");
  10349. }
  10350. break;
  10351. default:
  10352. throw new Error(
  10353. "Invalid authentication type, must be 'basic', 'oauth', 'token' or 'app'"
  10354. );
  10355. }
  10356. state.auth = options;
  10357. }
  10358. /***/ }),
  10359. /***/ 675:
  10360. /***/ (function(module) {
  10361. module.exports = function btoa(str) {
  10362. return new Buffer(str).toString('base64')
  10363. }
  10364. /***/ }),
  10365. /***/ 692:
  10366. /***/ (function(__unusedmodule, exports) {
  10367. "use strict";
  10368. Object.defineProperty(exports, '__esModule', { value: true });
  10369. class Deprecation extends Error {
  10370. constructor(message) {
  10371. super(message); // Maintains proper stack trace (only available on V8)
  10372. /* istanbul ignore next */
  10373. if (Error.captureStackTrace) {
  10374. Error.captureStackTrace(this, this.constructor);
  10375. }
  10376. this.name = 'Deprecation';
  10377. }
  10378. }
  10379. exports.Deprecation = Deprecation;
  10380. /***/ }),
  10381. /***/ 696:
  10382. /***/ (function(module) {
  10383. "use strict";
  10384. /*!
  10385. * isobject <https://github.com/jonschlinkert/isobject>
  10386. *
  10387. * Copyright (c) 2014-2017, Jon Schlinkert.
  10388. * Released under the MIT License.
  10389. */
  10390. function isObject(val) {
  10391. return val != null && typeof val === 'object' && Array.isArray(val) === false;
  10392. }
  10393. /*!
  10394. * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
  10395. *
  10396. * Copyright (c) 2014-2017, Jon Schlinkert.
  10397. * Released under the MIT License.
  10398. */
  10399. function isObjectObject(o) {
  10400. return isObject(o) === true
  10401. && Object.prototype.toString.call(o) === '[object Object]';
  10402. }
  10403. function isPlainObject(o) {
  10404. var ctor,prot;
  10405. if (isObjectObject(o) === false) return false;
  10406. // If has modified constructor
  10407. ctor = o.constructor;
  10408. if (typeof ctor !== 'function') return false;
  10409. // If has modified prototype
  10410. prot = ctor.prototype;
  10411. if (isObjectObject(prot) === false) return false;
  10412. // If constructor does not have an Object-specific method
  10413. if (prot.hasOwnProperty('isPrototypeOf') === false) {
  10414. return false;
  10415. }
  10416. // Most likely a plain Object
  10417. return true;
  10418. }
  10419. module.exports = isPlainObject;
  10420. /***/ }),
  10421. /***/ 697:
  10422. /***/ (function(module) {
  10423. "use strict";
  10424. module.exports = (promise, onFinally) => {
  10425. onFinally = onFinally || (() => {});
  10426. return promise.then(
  10427. val => new Promise(resolve => {
  10428. resolve(onFinally());
  10429. }).then(() => val),
  10430. err => new Promise(resolve => {
  10431. resolve(onFinally());
  10432. }).then(() => {
  10433. throw err;
  10434. })
  10435. );
  10436. };
  10437. /***/ }),
  10438. /***/ 705:
  10439. /***/ (function(module) {
  10440. 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"}}};
  10441. /***/ }),
  10442. /***/ 722:
  10443. /***/ (function(module) {
  10444. /**
  10445. * Convert array of 16 byte values to UUID string format of the form:
  10446. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  10447. */
  10448. var byteToHex = [];
  10449. for (var i = 0; i < 256; ++i) {
  10450. byteToHex[i] = (i + 0x100).toString(16).substr(1);
  10451. }
  10452. function bytesToUuid(buf, offset) {
  10453. var i = offset || 0;
  10454. var bth = byteToHex;
  10455. // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
  10456. return ([bth[buf[i++]], bth[buf[i++]],
  10457. 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++]]]).join('');
  10464. }
  10465. module.exports = bytesToUuid;
  10466. /***/ }),
  10467. /***/ 742:
  10468. /***/ (function(module, __unusedexports, __webpack_require__) {
  10469. var fs = __webpack_require__(747)
  10470. var core
  10471. if (process.platform === 'win32' || global.TESTING_WINDOWS) {
  10472. core = __webpack_require__(818)
  10473. } else {
  10474. core = __webpack_require__(197)
  10475. }
  10476. module.exports = isexe
  10477. isexe.sync = sync
  10478. function isexe (path, options, cb) {
  10479. if (typeof options === 'function') {
  10480. cb = options
  10481. options = {}
  10482. }
  10483. if (!cb) {
  10484. if (typeof Promise !== 'function') {
  10485. throw new TypeError('callback not provided')
  10486. }
  10487. return new Promise(function (resolve, reject) {
  10488. isexe(path, options || {}, function (er, is) {
  10489. if (er) {
  10490. reject(er)
  10491. } else {
  10492. resolve(is)
  10493. }
  10494. })
  10495. })
  10496. }
  10497. core(path, options || {}, function (er, is) {
  10498. // ignore EACCES because that just means we aren't allowed to run it
  10499. if (er) {
  10500. if (er.code === 'EACCES' || options && options.ignoreErrors) {
  10501. er = null
  10502. is = false
  10503. }
  10504. }
  10505. cb(er, is)
  10506. })
  10507. }
  10508. function sync (path, options) {
  10509. // my kingdom for a filtered catch
  10510. try {
  10511. return core.sync(path, options || {})
  10512. } catch (er) {
  10513. if (options && options.ignoreErrors || er.code === 'EACCES') {
  10514. return false
  10515. } else {
  10516. throw er
  10517. }
  10518. }
  10519. }
  10520. /***/ }),
  10521. /***/ 747:
  10522. /***/ (function(module) {
  10523. module.exports = require("fs");
  10524. /***/ }),
  10525. /***/ 753:
  10526. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  10527. "use strict";
  10528. Object.defineProperty(exports, '__esModule', { value: true });
  10529. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  10530. var endpoint = __webpack_require__(385);
  10531. var universalUserAgent = __webpack_require__(796);
  10532. var isPlainObject = _interopDefault(__webpack_require__(696));
  10533. var nodeFetch = _interopDefault(__webpack_require__(454));
  10534. var requestError = __webpack_require__(463);
  10535. const VERSION = "5.3.1";
  10536. function getBufferResponse(response) {
  10537. return response.arrayBuffer();
  10538. }
  10539. function fetchWrapper(requestOptions) {
  10540. if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {
  10541. requestOptions.body = JSON.stringify(requestOptions.body);
  10542. }
  10543. let headers = {};
  10544. let status;
  10545. let url;
  10546. const fetch = requestOptions.request && requestOptions.request.fetch || nodeFetch;
  10547. return fetch(requestOptions.url, Object.assign({
  10548. method: requestOptions.method,
  10549. body: requestOptions.body,
  10550. headers: requestOptions.headers,
  10551. redirect: requestOptions.redirect
  10552. }, requestOptions.request)).then(response => {
  10553. url = response.url;
  10554. status = response.status;
  10555. for (const keyAndValue of response.headers) {
  10556. headers[keyAndValue[0]] = keyAndValue[1];
  10557. }
  10558. if (status === 204 || status === 205) {
  10559. return;
  10560. } // GitHub API returns 200 for HEAD requsets
  10561. if (requestOptions.method === "HEAD") {
  10562. if (status < 400) {
  10563. return;
  10564. }
  10565. throw new requestError.RequestError(response.statusText, status, {
  10566. headers,
  10567. request: requestOptions
  10568. });
  10569. }
  10570. if (status === 304) {
  10571. throw new requestError.RequestError("Not modified", status, {
  10572. headers,
  10573. request: requestOptions
  10574. });
  10575. }
  10576. if (status >= 400) {
  10577. return response.text().then(message => {
  10578. const error = new requestError.RequestError(message, status, {
  10579. headers,
  10580. request: requestOptions
  10581. });
  10582. try {
  10583. let responseBody = JSON.parse(error.message);
  10584. Object.assign(error, responseBody);
  10585. let errors = responseBody.errors; // Assumption `errors` would always be in Array Fotmat
  10586. error.message = error.message + ": " + errors.map(JSON.stringify).join(", ");
  10587. } catch (e) {// ignore, see octokit/rest.js#684
  10588. }
  10589. throw error;
  10590. });
  10591. }
  10592. const contentType = response.headers.get("content-type");
  10593. if (/application\/json/.test(contentType)) {
  10594. return response.json();
  10595. }
  10596. if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) {
  10597. return response.text();
  10598. }
  10599. return getBufferResponse(response);
  10600. }).then(data => {
  10601. return {
  10602. status,
  10603. url,
  10604. headers,
  10605. data
  10606. };
  10607. }).catch(error => {
  10608. if (error instanceof requestError.RequestError) {
  10609. throw error;
  10610. }
  10611. throw new requestError.RequestError(error.message, 500, {
  10612. headers,
  10613. request: requestOptions
  10614. });
  10615. });
  10616. }
  10617. function withDefaults(oldEndpoint, newDefaults) {
  10618. const endpoint = oldEndpoint.defaults(newDefaults);
  10619. const newApi = function (route, parameters) {
  10620. const endpointOptions = endpoint.merge(route, parameters);
  10621. if (!endpointOptions.request || !endpointOptions.request.hook) {
  10622. return fetchWrapper(endpoint.parse(endpointOptions));
  10623. }
  10624. const request = (route, parameters) => {
  10625. return fetchWrapper(endpoint.parse(endpoint.merge(route, parameters)));
  10626. };
  10627. Object.assign(request, {
  10628. endpoint,
  10629. defaults: withDefaults.bind(null, endpoint)
  10630. });
  10631. return endpointOptions.request.hook(request, endpointOptions);
  10632. };
  10633. return Object.assign(newApi, {
  10634. endpoint,
  10635. defaults: withDefaults.bind(null, endpoint)
  10636. });
  10637. }
  10638. const request = withDefaults(endpoint.endpoint, {
  10639. headers: {
  10640. "user-agent": `octokit-request.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  10641. }
  10642. });
  10643. exports.request = request;
  10644. //# sourceMappingURL=index.js.map
  10645. /***/ }),
  10646. /***/ 761:
  10647. /***/ (function(module) {
  10648. module.exports = require("zlib");
  10649. /***/ }),
  10650. /***/ 763:
  10651. /***/ (function(module) {
  10652. module.exports = removeHook
  10653. function removeHook (state, name, method) {
  10654. if (!state.registry[name]) {
  10655. return
  10656. }
  10657. var index = state.registry[name]
  10658. .map(function (registered) { return registered.orig })
  10659. .indexOf(method)
  10660. if (index === -1) {
  10661. return
  10662. }
  10663. state.registry[name].splice(index, 1)
  10664. }
  10665. /***/ }),
  10666. /***/ 768:
  10667. /***/ (function(module) {
  10668. "use strict";
  10669. module.exports = function (x) {
  10670. var lf = typeof x === 'string' ? '\n' : '\n'.charCodeAt();
  10671. var cr = typeof x === 'string' ? '\r' : '\r'.charCodeAt();
  10672. if (x[x.length - 1] === lf) {
  10673. x = x.slice(0, x.length - 1);
  10674. }
  10675. if (x[x.length - 1] === cr) {
  10676. x = x.slice(0, x.length - 1);
  10677. }
  10678. return x;
  10679. };
  10680. /***/ }),
  10681. /***/ 777:
  10682. /***/ (function(module, __unusedexports, __webpack_require__) {
  10683. module.exports = getFirstPage
  10684. const getPage = __webpack_require__(265)
  10685. function getFirstPage (octokit, link, headers) {
  10686. return getPage(octokit, link, 'first', headers)
  10687. }
  10688. /***/ }),
  10689. /***/ 796:
  10690. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  10691. "use strict";
  10692. Object.defineProperty(exports, '__esModule', { value: true });
  10693. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  10694. var osName = _interopDefault(__webpack_require__(2));
  10695. function getUserAgent() {
  10696. try {
  10697. return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
  10698. } catch (error) {
  10699. if (/wmic os get Caption/.test(error.message)) {
  10700. return "Windows <version undetectable>";
  10701. }
  10702. throw error;
  10703. }
  10704. }
  10705. exports.getUserAgent = getUserAgent;
  10706. //# sourceMappingURL=index.js.map
  10707. /***/ }),
  10708. /***/ 807:
  10709. /***/ (function(module, __unusedexports, __webpack_require__) {
  10710. module.exports = paginate;
  10711. const iterator = __webpack_require__(8);
  10712. function paginate(octokit, route, options, mapFn) {
  10713. if (typeof options === "function") {
  10714. mapFn = options;
  10715. options = undefined;
  10716. }
  10717. options = octokit.request.endpoint.merge(route, options);
  10718. return gather(
  10719. octokit,
  10720. [],
  10721. iterator(octokit, options)[Symbol.asyncIterator](),
  10722. mapFn
  10723. );
  10724. }
  10725. function gather(octokit, results, iterator, mapFn) {
  10726. return iterator.next().then(result => {
  10727. if (result.done) {
  10728. return results;
  10729. }
  10730. let earlyExit = false;
  10731. function done() {
  10732. earlyExit = true;
  10733. }
  10734. results = results.concat(
  10735. mapFn ? mapFn(result.value, done) : result.value.data
  10736. );
  10737. if (earlyExit) {
  10738. return results;
  10739. }
  10740. return gather(octokit, results, iterator, mapFn);
  10741. });
  10742. }
  10743. /***/ }),
  10744. /***/ 814:
  10745. /***/ (function(module, __unusedexports, __webpack_require__) {
  10746. module.exports = which
  10747. which.sync = whichSync
  10748. var isWindows = process.platform === 'win32' ||
  10749. process.env.OSTYPE === 'cygwin' ||
  10750. process.env.OSTYPE === 'msys'
  10751. var path = __webpack_require__(622)
  10752. var COLON = isWindows ? ';' : ':'
  10753. var isexe = __webpack_require__(742)
  10754. function getNotFoundError (cmd) {
  10755. var er = new Error('not found: ' + cmd)
  10756. er.code = 'ENOENT'
  10757. return er
  10758. }
  10759. function getPathInfo (cmd, opt) {
  10760. var colon = opt.colon || COLON
  10761. var pathEnv = opt.path || process.env.PATH || ''
  10762. var pathExt = ['']
  10763. pathEnv = pathEnv.split(colon)
  10764. var pathExtExe = ''
  10765. if (isWindows) {
  10766. pathEnv.unshift(process.cwd())
  10767. pathExtExe = (opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM')
  10768. pathExt = pathExtExe.split(colon)
  10769. // Always test the cmd itself first. isexe will check to make sure
  10770. // it's found in the pathExt set.
  10771. if (cmd.indexOf('.') !== -1 && pathExt[0] !== '')
  10772. pathExt.unshift('')
  10773. }
  10774. // If it has a slash, then we don't bother searching the pathenv.
  10775. // just check the file itself, and that's it.
  10776. if (cmd.match(/\//) || isWindows && cmd.match(/\\/))
  10777. pathEnv = ['']
  10778. return {
  10779. env: pathEnv,
  10780. ext: pathExt,
  10781. extExe: pathExtExe
  10782. }
  10783. }
  10784. function which (cmd, opt, cb) {
  10785. if (typeof opt === 'function') {
  10786. cb = opt
  10787. opt = {}
  10788. }
  10789. var info = getPathInfo(cmd, opt)
  10790. var pathEnv = info.env
  10791. var pathExt = info.ext
  10792. var pathExtExe = info.extExe
  10793. var found = []
  10794. ;(function F (i, l) {
  10795. if (i === l) {
  10796. if (opt.all && found.length)
  10797. return cb(null, found)
  10798. else
  10799. return cb(getNotFoundError(cmd))
  10800. }
  10801. var pathPart = pathEnv[i]
  10802. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  10803. pathPart = pathPart.slice(1, -1)
  10804. var p = path.join(pathPart, cmd)
  10805. if (!pathPart && (/^\.[\\\/]/).test(cmd)) {
  10806. p = cmd.slice(0, 2) + p
  10807. }
  10808. ;(function E (ii, ll) {
  10809. if (ii === ll) return F(i + 1, l)
  10810. var ext = pathExt[ii]
  10811. isexe(p + ext, { pathExt: pathExtExe }, function (er, is) {
  10812. if (!er && is) {
  10813. if (opt.all)
  10814. found.push(p + ext)
  10815. else
  10816. return cb(null, p + ext)
  10817. }
  10818. return E(ii + 1, ll)
  10819. })
  10820. })(0, pathExt.length)
  10821. })(0, pathEnv.length)
  10822. }
  10823. function whichSync (cmd, opt) {
  10824. opt = opt || {}
  10825. var info = getPathInfo(cmd, opt)
  10826. var pathEnv = info.env
  10827. var pathExt = info.ext
  10828. var pathExtExe = info.extExe
  10829. var found = []
  10830. for (var i = 0, l = pathEnv.length; i < l; i ++) {
  10831. var pathPart = pathEnv[i]
  10832. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  10833. pathPart = pathPart.slice(1, -1)
  10834. var p = path.join(pathPart, cmd)
  10835. if (!pathPart && /^\.[\\\/]/.test(cmd)) {
  10836. p = cmd.slice(0, 2) + p
  10837. }
  10838. for (var j = 0, ll = pathExt.length; j < ll; j ++) {
  10839. var cur = p + pathExt[j]
  10840. var is
  10841. try {
  10842. is = isexe.sync(cur, { pathExt: pathExtExe })
  10843. if (is) {
  10844. if (opt.all)
  10845. found.push(cur)
  10846. else
  10847. return cur
  10848. }
  10849. } catch (ex) {}
  10850. }
  10851. }
  10852. if (opt.all && found.length)
  10853. return found
  10854. if (opt.nothrow)
  10855. return null
  10856. throw getNotFoundError(cmd)
  10857. }
  10858. /***/ }),
  10859. /***/ 816:
  10860. /***/ (function(module) {
  10861. "use strict";
  10862. module.exports = /^#!.*/;
  10863. /***/ }),
  10864. /***/ 818:
  10865. /***/ (function(module, __unusedexports, __webpack_require__) {
  10866. module.exports = isexe
  10867. isexe.sync = sync
  10868. var fs = __webpack_require__(747)
  10869. function checkPathExt (path, options) {
  10870. var pathext = options.pathExt !== undefined ?
  10871. options.pathExt : process.env.PATHEXT
  10872. if (!pathext) {
  10873. return true
  10874. }
  10875. pathext = pathext.split(';')
  10876. if (pathext.indexOf('') !== -1) {
  10877. return true
  10878. }
  10879. for (var i = 0; i < pathext.length; i++) {
  10880. var p = pathext[i].toLowerCase()
  10881. if (p && path.substr(-p.length).toLowerCase() === p) {
  10882. return true
  10883. }
  10884. }
  10885. return false
  10886. }
  10887. function checkStat (stat, path, options) {
  10888. if (!stat.isSymbolicLink() && !stat.isFile()) {
  10889. return false
  10890. }
  10891. return checkPathExt(path, options)
  10892. }
  10893. function isexe (path, options, cb) {
  10894. fs.stat(path, function (er, stat) {
  10895. cb(er, er ? false : checkStat(stat, path, options))
  10896. })
  10897. }
  10898. function sync (path, options) {
  10899. return checkStat(fs.statSync(path), path, options)
  10900. }
  10901. /***/ }),
  10902. /***/ 821:
  10903. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  10904. "use strict";
  10905. var __importStar = (this && this.__importStar) || function (mod) {
  10906. if (mod && mod.__esModule) return mod;
  10907. var result = {};
  10908. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  10909. result["default"] = mod;
  10910. return result;
  10911. };
  10912. Object.defineProperty(exports, "__esModule", { value: true });
  10913. const core = __importStar(__webpack_require__(470));
  10914. const fsHelper = __importStar(__webpack_require__(618));
  10915. const github = __importStar(__webpack_require__(469));
  10916. const path = __importStar(__webpack_require__(622));
  10917. function getInputs() {
  10918. const result = {};
  10919. // GitHub workspace
  10920. let githubWorkspacePath = process.env['GITHUB_WORKSPACE'];
  10921. if (!githubWorkspacePath) {
  10922. throw new Error('GITHUB_WORKSPACE not defined');
  10923. }
  10924. githubWorkspacePath = path.resolve(githubWorkspacePath);
  10925. core.debug(`GITHUB_WORKSPACE = '${githubWorkspacePath}'`);
  10926. fsHelper.directoryExistsSync(githubWorkspacePath, true);
  10927. // Qualified repository
  10928. const qualifiedRepository = core.getInput('repository') ||
  10929. `${github.context.repo.owner}/${github.context.repo.repo}`;
  10930. core.debug(`qualified repository = '${qualifiedRepository}'`);
  10931. const splitRepository = qualifiedRepository.split('/');
  10932. if (splitRepository.length !== 2 ||
  10933. !splitRepository[0] ||
  10934. !splitRepository[1]) {
  10935. throw new Error(`Invalid repository '${qualifiedRepository}'. Expected format {owner}/{repo}.`);
  10936. }
  10937. result.repositoryOwner = splitRepository[0];
  10938. result.repositoryName = splitRepository[1];
  10939. // Repository path
  10940. result.repositoryPath = core.getInput('path') || '.';
  10941. result.repositoryPath = path.resolve(githubWorkspacePath, result.repositoryPath);
  10942. if (!(result.repositoryPath + path.sep).startsWith(githubWorkspacePath + path.sep)) {
  10943. throw new Error(`Repository path '${result.repositoryPath}' is not under '${githubWorkspacePath}'`);
  10944. }
  10945. // Workflow repository?
  10946. const isWorkflowRepository = qualifiedRepository.toUpperCase() ===
  10947. `${github.context.repo.owner}/${github.context.repo.repo}`.toUpperCase();
  10948. // Source branch, source version
  10949. result.ref = core.getInput('ref');
  10950. if (!result.ref) {
  10951. if (isWorkflowRepository) {
  10952. result.ref = github.context.ref;
  10953. result.commit = github.context.sha;
  10954. }
  10955. if (!result.ref && !result.commit) {
  10956. result.ref = 'refs/heads/master';
  10957. }
  10958. }
  10959. // SHA?
  10960. else if (result.ref.match(/^[0-9a-fA-F]{40}$/)) {
  10961. result.commit = result.ref;
  10962. result.ref = '';
  10963. }
  10964. core.debug(`ref = '${result.ref}'`);
  10965. core.debug(`commit = '${result.commit}'`);
  10966. // Clean
  10967. result.clean = (core.getInput('clean') || 'true').toUpperCase() === 'TRUE';
  10968. core.debug(`clean = ${result.clean}`);
  10969. // Submodules
  10970. if (core.getInput('submodules')) {
  10971. throw new Error("The input 'submodules' is not supported in actions/checkout@v2");
  10972. }
  10973. // Fetch depth
  10974. result.fetchDepth = Math.floor(Number(core.getInput('fetch-depth') || '1'));
  10975. if (isNaN(result.fetchDepth) || result.fetchDepth < 0) {
  10976. result.fetchDepth = 0;
  10977. }
  10978. core.debug(`fetch depth = ${result.fetchDepth}`);
  10979. // LFS
  10980. result.lfs = (core.getInput('lfs') || 'false').toUpperCase() === 'TRUE';
  10981. core.debug(`lfs = ${result.lfs}`);
  10982. // Access token
  10983. result.accessToken = core.getInput('token');
  10984. return result;
  10985. }
  10986. exports.getInputs = getInputs;
  10987. /***/ }),
  10988. /***/ 826:
  10989. /***/ (function(module, __unusedexports, __webpack_require__) {
  10990. var rng = __webpack_require__(139);
  10991. var bytesToUuid = __webpack_require__(722);
  10992. function v4(options, buf, offset) {
  10993. var i = buf && offset || 0;
  10994. if (typeof(options) == 'string') {
  10995. buf = options === 'binary' ? new Array(16) : null;
  10996. options = null;
  10997. }
  10998. options = options || {};
  10999. var rnds = options.random || (options.rng || rng)();
  11000. // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  11001. rnds[6] = (rnds[6] & 0x0f) | 0x40;
  11002. rnds[8] = (rnds[8] & 0x3f) | 0x80;
  11003. // Copy bytes to buffer, if provided
  11004. if (buf) {
  11005. for (var ii = 0; ii < 16; ++ii) {
  11006. buf[i + ii] = rnds[ii];
  11007. }
  11008. }
  11009. return buf || bytesToUuid(rnds);
  11010. }
  11011. module.exports = v4;
  11012. /***/ }),
  11013. /***/ 835:
  11014. /***/ (function(module) {
  11015. module.exports = require("url");
  11016. /***/ }),
  11017. /***/ 850:
  11018. /***/ (function(module, __unusedexports, __webpack_require__) {
  11019. module.exports = paginationMethodsPlugin
  11020. function paginationMethodsPlugin (octokit) {
  11021. octokit.getFirstPage = __webpack_require__(777).bind(null, octokit)
  11022. octokit.getLastPage = __webpack_require__(649).bind(null, octokit)
  11023. octokit.getNextPage = __webpack_require__(550).bind(null, octokit)
  11024. octokit.getPreviousPage = __webpack_require__(563).bind(null, octokit)
  11025. octokit.hasFirstPage = __webpack_require__(536)
  11026. octokit.hasLastPage = __webpack_require__(336)
  11027. octokit.hasNextPage = __webpack_require__(929)
  11028. octokit.hasPreviousPage = __webpack_require__(558)
  11029. }
  11030. /***/ }),
  11031. /***/ 854:
  11032. /***/ (function(module) {
  11033. /**
  11034. * lodash (Custom Build) <https://lodash.com/>
  11035. * Build: `lodash modularize exports="npm" -o ./`
  11036. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  11037. * Released under MIT license <https://lodash.com/license>
  11038. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  11039. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  11040. */
  11041. /** Used as the `TypeError` message for "Functions" methods. */
  11042. var FUNC_ERROR_TEXT = 'Expected a function';
  11043. /** Used to stand-in for `undefined` hash values. */
  11044. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  11045. /** Used as references for various `Number` constants. */
  11046. var INFINITY = 1 / 0;
  11047. /** `Object#toString` result references. */
  11048. var funcTag = '[object Function]',
  11049. genTag = '[object GeneratorFunction]',
  11050. symbolTag = '[object Symbol]';
  11051. /** Used to match property names within property paths. */
  11052. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  11053. reIsPlainProp = /^\w*$/,
  11054. reLeadingDot = /^\./,
  11055. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  11056. /**
  11057. * Used to match `RegExp`
  11058. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  11059. */
  11060. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  11061. /** Used to match backslashes in property paths. */
  11062. var reEscapeChar = /\\(\\)?/g;
  11063. /** Used to detect host constructors (Safari). */
  11064. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  11065. /** Detect free variable `global` from Node.js. */
  11066. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  11067. /** Detect free variable `self`. */
  11068. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  11069. /** Used as a reference to the global object. */
  11070. var root = freeGlobal || freeSelf || Function('return this')();
  11071. /**
  11072. * Gets the value at `key` of `object`.
  11073. *
  11074. * @private
  11075. * @param {Object} [object] The object to query.
  11076. * @param {string} key The key of the property to get.
  11077. * @returns {*} Returns the property value.
  11078. */
  11079. function getValue(object, key) {
  11080. return object == null ? undefined : object[key];
  11081. }
  11082. /**
  11083. * Checks if `value` is a host object in IE < 9.
  11084. *
  11085. * @private
  11086. * @param {*} value The value to check.
  11087. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  11088. */
  11089. function isHostObject(value) {
  11090. // Many host objects are `Object` objects that can coerce to strings
  11091. // despite having improperly defined `toString` methods.
  11092. var result = false;
  11093. if (value != null && typeof value.toString != 'function') {
  11094. try {
  11095. result = !!(value + '');
  11096. } catch (e) {}
  11097. }
  11098. return result;
  11099. }
  11100. /** Used for built-in method references. */
  11101. var arrayProto = Array.prototype,
  11102. funcProto = Function.prototype,
  11103. objectProto = Object.prototype;
  11104. /** Used to detect overreaching core-js shims. */
  11105. var coreJsData = root['__core-js_shared__'];
  11106. /** Used to detect methods masquerading as native. */
  11107. var maskSrcKey = (function() {
  11108. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  11109. return uid ? ('Symbol(src)_1.' + uid) : '';
  11110. }());
  11111. /** Used to resolve the decompiled source of functions. */
  11112. var funcToString = funcProto.toString;
  11113. /** Used to check objects for own properties. */
  11114. var hasOwnProperty = objectProto.hasOwnProperty;
  11115. /**
  11116. * Used to resolve the
  11117. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  11118. * of values.
  11119. */
  11120. var objectToString = objectProto.toString;
  11121. /** Used to detect if a method is native. */
  11122. var reIsNative = RegExp('^' +
  11123. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  11124. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  11125. );
  11126. /** Built-in value references. */
  11127. var Symbol = root.Symbol,
  11128. splice = arrayProto.splice;
  11129. /* Built-in method references that are verified to be native. */
  11130. var Map = getNative(root, 'Map'),
  11131. nativeCreate = getNative(Object, 'create');
  11132. /** Used to convert symbols to primitives and strings. */
  11133. var symbolProto = Symbol ? Symbol.prototype : undefined,
  11134. symbolToString = symbolProto ? symbolProto.toString : undefined;
  11135. /**
  11136. * Creates a hash object.
  11137. *
  11138. * @private
  11139. * @constructor
  11140. * @param {Array} [entries] The key-value pairs to cache.
  11141. */
  11142. function Hash(entries) {
  11143. var index = -1,
  11144. length = entries ? entries.length : 0;
  11145. this.clear();
  11146. while (++index < length) {
  11147. var entry = entries[index];
  11148. this.set(entry[0], entry[1]);
  11149. }
  11150. }
  11151. /**
  11152. * Removes all key-value entries from the hash.
  11153. *
  11154. * @private
  11155. * @name clear
  11156. * @memberOf Hash
  11157. */
  11158. function hashClear() {
  11159. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  11160. }
  11161. /**
  11162. * Removes `key` and its value from the hash.
  11163. *
  11164. * @private
  11165. * @name delete
  11166. * @memberOf Hash
  11167. * @param {Object} hash The hash to modify.
  11168. * @param {string} key The key of the value to remove.
  11169. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  11170. */
  11171. function hashDelete(key) {
  11172. return this.has(key) && delete this.__data__[key];
  11173. }
  11174. /**
  11175. * Gets the hash value for `key`.
  11176. *
  11177. * @private
  11178. * @name get
  11179. * @memberOf Hash
  11180. * @param {string} key The key of the value to get.
  11181. * @returns {*} Returns the entry value.
  11182. */
  11183. function hashGet(key) {
  11184. var data = this.__data__;
  11185. if (nativeCreate) {
  11186. var result = data[key];
  11187. return result === HASH_UNDEFINED ? undefined : result;
  11188. }
  11189. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  11190. }
  11191. /**
  11192. * Checks if a hash value for `key` exists.
  11193. *
  11194. * @private
  11195. * @name has
  11196. * @memberOf Hash
  11197. * @param {string} key The key of the entry to check.
  11198. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  11199. */
  11200. function hashHas(key) {
  11201. var data = this.__data__;
  11202. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  11203. }
  11204. /**
  11205. * Sets the hash `key` to `value`.
  11206. *
  11207. * @private
  11208. * @name set
  11209. * @memberOf Hash
  11210. * @param {string} key The key of the value to set.
  11211. * @param {*} value The value to set.
  11212. * @returns {Object} Returns the hash instance.
  11213. */
  11214. function hashSet(key, value) {
  11215. var data = this.__data__;
  11216. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  11217. return this;
  11218. }
  11219. // Add methods to `Hash`.
  11220. Hash.prototype.clear = hashClear;
  11221. Hash.prototype['delete'] = hashDelete;
  11222. Hash.prototype.get = hashGet;
  11223. Hash.prototype.has = hashHas;
  11224. Hash.prototype.set = hashSet;
  11225. /**
  11226. * Creates an list cache object.
  11227. *
  11228. * @private
  11229. * @constructor
  11230. * @param {Array} [entries] The key-value pairs to cache.
  11231. */
  11232. function ListCache(entries) {
  11233. var index = -1,
  11234. length = entries ? entries.length : 0;
  11235. this.clear();
  11236. while (++index < length) {
  11237. var entry = entries[index];
  11238. this.set(entry[0], entry[1]);
  11239. }
  11240. }
  11241. /**
  11242. * Removes all key-value entries from the list cache.
  11243. *
  11244. * @private
  11245. * @name clear
  11246. * @memberOf ListCache
  11247. */
  11248. function listCacheClear() {
  11249. this.__data__ = [];
  11250. }
  11251. /**
  11252. * Removes `key` and its value from the list cache.
  11253. *
  11254. * @private
  11255. * @name delete
  11256. * @memberOf ListCache
  11257. * @param {string} key The key of the value to remove.
  11258. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  11259. */
  11260. function listCacheDelete(key) {
  11261. var data = this.__data__,
  11262. index = assocIndexOf(data, key);
  11263. if (index < 0) {
  11264. return false;
  11265. }
  11266. var lastIndex = data.length - 1;
  11267. if (index == lastIndex) {
  11268. data.pop();
  11269. } else {
  11270. splice.call(data, index, 1);
  11271. }
  11272. return true;
  11273. }
  11274. /**
  11275. * Gets the list cache value for `key`.
  11276. *
  11277. * @private
  11278. * @name get
  11279. * @memberOf ListCache
  11280. * @param {string} key The key of the value to get.
  11281. * @returns {*} Returns the entry value.
  11282. */
  11283. function listCacheGet(key) {
  11284. var data = this.__data__,
  11285. index = assocIndexOf(data, key);
  11286. return index < 0 ? undefined : data[index][1];
  11287. }
  11288. /**
  11289. * Checks if a list cache value for `key` exists.
  11290. *
  11291. * @private
  11292. * @name has
  11293. * @memberOf ListCache
  11294. * @param {string} key The key of the entry to check.
  11295. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  11296. */
  11297. function listCacheHas(key) {
  11298. return assocIndexOf(this.__data__, key) > -1;
  11299. }
  11300. /**
  11301. * Sets the list cache `key` to `value`.
  11302. *
  11303. * @private
  11304. * @name set
  11305. * @memberOf ListCache
  11306. * @param {string} key The key of the value to set.
  11307. * @param {*} value The value to set.
  11308. * @returns {Object} Returns the list cache instance.
  11309. */
  11310. function listCacheSet(key, value) {
  11311. var data = this.__data__,
  11312. index = assocIndexOf(data, key);
  11313. if (index < 0) {
  11314. data.push([key, value]);
  11315. } else {
  11316. data[index][1] = value;
  11317. }
  11318. return this;
  11319. }
  11320. // Add methods to `ListCache`.
  11321. ListCache.prototype.clear = listCacheClear;
  11322. ListCache.prototype['delete'] = listCacheDelete;
  11323. ListCache.prototype.get = listCacheGet;
  11324. ListCache.prototype.has = listCacheHas;
  11325. ListCache.prototype.set = listCacheSet;
  11326. /**
  11327. * Creates a map cache object to store key-value pairs.
  11328. *
  11329. * @private
  11330. * @constructor
  11331. * @param {Array} [entries] The key-value pairs to cache.
  11332. */
  11333. function MapCache(entries) {
  11334. var index = -1,
  11335. length = entries ? entries.length : 0;
  11336. this.clear();
  11337. while (++index < length) {
  11338. var entry = entries[index];
  11339. this.set(entry[0], entry[1]);
  11340. }
  11341. }
  11342. /**
  11343. * Removes all key-value entries from the map.
  11344. *
  11345. * @private
  11346. * @name clear
  11347. * @memberOf MapCache
  11348. */
  11349. function mapCacheClear() {
  11350. this.__data__ = {
  11351. 'hash': new Hash,
  11352. 'map': new (Map || ListCache),
  11353. 'string': new Hash
  11354. };
  11355. }
  11356. /**
  11357. * Removes `key` and its value from the map.
  11358. *
  11359. * @private
  11360. * @name delete
  11361. * @memberOf MapCache
  11362. * @param {string} key The key of the value to remove.
  11363. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  11364. */
  11365. function mapCacheDelete(key) {
  11366. return getMapData(this, key)['delete'](key);
  11367. }
  11368. /**
  11369. * Gets the map value for `key`.
  11370. *
  11371. * @private
  11372. * @name get
  11373. * @memberOf MapCache
  11374. * @param {string} key The key of the value to get.
  11375. * @returns {*} Returns the entry value.
  11376. */
  11377. function mapCacheGet(key) {
  11378. return getMapData(this, key).get(key);
  11379. }
  11380. /**
  11381. * Checks if a map value for `key` exists.
  11382. *
  11383. * @private
  11384. * @name has
  11385. * @memberOf MapCache
  11386. * @param {string} key The key of the entry to check.
  11387. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  11388. */
  11389. function mapCacheHas(key) {
  11390. return getMapData(this, key).has(key);
  11391. }
  11392. /**
  11393. * Sets the map `key` to `value`.
  11394. *
  11395. * @private
  11396. * @name set
  11397. * @memberOf MapCache
  11398. * @param {string} key The key of the value to set.
  11399. * @param {*} value The value to set.
  11400. * @returns {Object} Returns the map cache instance.
  11401. */
  11402. function mapCacheSet(key, value) {
  11403. getMapData(this, key).set(key, value);
  11404. return this;
  11405. }
  11406. // Add methods to `MapCache`.
  11407. MapCache.prototype.clear = mapCacheClear;
  11408. MapCache.prototype['delete'] = mapCacheDelete;
  11409. MapCache.prototype.get = mapCacheGet;
  11410. MapCache.prototype.has = mapCacheHas;
  11411. MapCache.prototype.set = mapCacheSet;
  11412. /**
  11413. * Gets the index at which the `key` is found in `array` of key-value pairs.
  11414. *
  11415. * @private
  11416. * @param {Array} array The array to inspect.
  11417. * @param {*} key The key to search for.
  11418. * @returns {number} Returns the index of the matched value, else `-1`.
  11419. */
  11420. function assocIndexOf(array, key) {
  11421. var length = array.length;
  11422. while (length--) {
  11423. if (eq(array[length][0], key)) {
  11424. return length;
  11425. }
  11426. }
  11427. return -1;
  11428. }
  11429. /**
  11430. * The base implementation of `_.get` without support for default values.
  11431. *
  11432. * @private
  11433. * @param {Object} object The object to query.
  11434. * @param {Array|string} path The path of the property to get.
  11435. * @returns {*} Returns the resolved value.
  11436. */
  11437. function baseGet(object, path) {
  11438. path = isKey(path, object) ? [path] : castPath(path);
  11439. var index = 0,
  11440. length = path.length;
  11441. while (object != null && index < length) {
  11442. object = object[toKey(path[index++])];
  11443. }
  11444. return (index && index == length) ? object : undefined;
  11445. }
  11446. /**
  11447. * The base implementation of `_.isNative` without bad shim checks.
  11448. *
  11449. * @private
  11450. * @param {*} value The value to check.
  11451. * @returns {boolean} Returns `true` if `value` is a native function,
  11452. * else `false`.
  11453. */
  11454. function baseIsNative(value) {
  11455. if (!isObject(value) || isMasked(value)) {
  11456. return false;
  11457. }
  11458. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  11459. return pattern.test(toSource(value));
  11460. }
  11461. /**
  11462. * The base implementation of `_.toString` which doesn't convert nullish
  11463. * values to empty strings.
  11464. *
  11465. * @private
  11466. * @param {*} value The value to process.
  11467. * @returns {string} Returns the string.
  11468. */
  11469. function baseToString(value) {
  11470. // Exit early for strings to avoid a performance hit in some environments.
  11471. if (typeof value == 'string') {
  11472. return value;
  11473. }
  11474. if (isSymbol(value)) {
  11475. return symbolToString ? symbolToString.call(value) : '';
  11476. }
  11477. var result = (value + '');
  11478. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  11479. }
  11480. /**
  11481. * Casts `value` to a path array if it's not one.
  11482. *
  11483. * @private
  11484. * @param {*} value The value to inspect.
  11485. * @returns {Array} Returns the cast property path array.
  11486. */
  11487. function castPath(value) {
  11488. return isArray(value) ? value : stringToPath(value);
  11489. }
  11490. /**
  11491. * Gets the data for `map`.
  11492. *
  11493. * @private
  11494. * @param {Object} map The map to query.
  11495. * @param {string} key The reference key.
  11496. * @returns {*} Returns the map data.
  11497. */
  11498. function getMapData(map, key) {
  11499. var data = map.__data__;
  11500. return isKeyable(key)
  11501. ? data[typeof key == 'string' ? 'string' : 'hash']
  11502. : data.map;
  11503. }
  11504. /**
  11505. * Gets the native function at `key` of `object`.
  11506. *
  11507. * @private
  11508. * @param {Object} object The object to query.
  11509. * @param {string} key The key of the method to get.
  11510. * @returns {*} Returns the function if it's native, else `undefined`.
  11511. */
  11512. function getNative(object, key) {
  11513. var value = getValue(object, key);
  11514. return baseIsNative(value) ? value : undefined;
  11515. }
  11516. /**
  11517. * Checks if `value` is a property name and not a property path.
  11518. *
  11519. * @private
  11520. * @param {*} value The value to check.
  11521. * @param {Object} [object] The object to query keys on.
  11522. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  11523. */
  11524. function isKey(value, object) {
  11525. if (isArray(value)) {
  11526. return false;
  11527. }
  11528. var type = typeof value;
  11529. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  11530. value == null || isSymbol(value)) {
  11531. return true;
  11532. }
  11533. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  11534. (object != null && value in Object(object));
  11535. }
  11536. /**
  11537. * Checks if `value` is suitable for use as unique object key.
  11538. *
  11539. * @private
  11540. * @param {*} value The value to check.
  11541. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  11542. */
  11543. function isKeyable(value) {
  11544. var type = typeof value;
  11545. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  11546. ? (value !== '__proto__')
  11547. : (value === null);
  11548. }
  11549. /**
  11550. * Checks if `func` has its source masked.
  11551. *
  11552. * @private
  11553. * @param {Function} func The function to check.
  11554. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  11555. */
  11556. function isMasked(func) {
  11557. return !!maskSrcKey && (maskSrcKey in func);
  11558. }
  11559. /**
  11560. * Converts `string` to a property path array.
  11561. *
  11562. * @private
  11563. * @param {string} string The string to convert.
  11564. * @returns {Array} Returns the property path array.
  11565. */
  11566. var stringToPath = memoize(function(string) {
  11567. string = toString(string);
  11568. var result = [];
  11569. if (reLeadingDot.test(string)) {
  11570. result.push('');
  11571. }
  11572. string.replace(rePropName, function(match, number, quote, string) {
  11573. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  11574. });
  11575. return result;
  11576. });
  11577. /**
  11578. * Converts `value` to a string key if it's not a string or symbol.
  11579. *
  11580. * @private
  11581. * @param {*} value The value to inspect.
  11582. * @returns {string|symbol} Returns the key.
  11583. */
  11584. function toKey(value) {
  11585. if (typeof value == 'string' || isSymbol(value)) {
  11586. return value;
  11587. }
  11588. var result = (value + '');
  11589. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  11590. }
  11591. /**
  11592. * Converts `func` to its source code.
  11593. *
  11594. * @private
  11595. * @param {Function} func The function to process.
  11596. * @returns {string} Returns the source code.
  11597. */
  11598. function toSource(func) {
  11599. if (func != null) {
  11600. try {
  11601. return funcToString.call(func);
  11602. } catch (e) {}
  11603. try {
  11604. return (func + '');
  11605. } catch (e) {}
  11606. }
  11607. return '';
  11608. }
  11609. /**
  11610. * Creates a function that memoizes the result of `func`. If `resolver` is
  11611. * provided, it determines the cache key for storing the result based on the
  11612. * arguments provided to the memoized function. By default, the first argument
  11613. * provided to the memoized function is used as the map cache key. The `func`
  11614. * is invoked with the `this` binding of the memoized function.
  11615. *
  11616. * **Note:** The cache is exposed as the `cache` property on the memoized
  11617. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  11618. * constructor with one whose instances implement the
  11619. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  11620. * method interface of `delete`, `get`, `has`, and `set`.
  11621. *
  11622. * @static
  11623. * @memberOf _
  11624. * @since 0.1.0
  11625. * @category Function
  11626. * @param {Function} func The function to have its output memoized.
  11627. * @param {Function} [resolver] The function to resolve the cache key.
  11628. * @returns {Function} Returns the new memoized function.
  11629. * @example
  11630. *
  11631. * var object = { 'a': 1, 'b': 2 };
  11632. * var other = { 'c': 3, 'd': 4 };
  11633. *
  11634. * var values = _.memoize(_.values);
  11635. * values(object);
  11636. * // => [1, 2]
  11637. *
  11638. * values(other);
  11639. * // => [3, 4]
  11640. *
  11641. * object.a = 2;
  11642. * values(object);
  11643. * // => [1, 2]
  11644. *
  11645. * // Modify the result cache.
  11646. * values.cache.set(object, ['a', 'b']);
  11647. * values(object);
  11648. * // => ['a', 'b']
  11649. *
  11650. * // Replace `_.memoize.Cache`.
  11651. * _.memoize.Cache = WeakMap;
  11652. */
  11653. function memoize(func, resolver) {
  11654. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  11655. throw new TypeError(FUNC_ERROR_TEXT);
  11656. }
  11657. var memoized = function() {
  11658. var args = arguments,
  11659. key = resolver ? resolver.apply(this, args) : args[0],
  11660. cache = memoized.cache;
  11661. if (cache.has(key)) {
  11662. return cache.get(key);
  11663. }
  11664. var result = func.apply(this, args);
  11665. memoized.cache = cache.set(key, result);
  11666. return result;
  11667. };
  11668. memoized.cache = new (memoize.Cache || MapCache);
  11669. return memoized;
  11670. }
  11671. // Assign cache to `_.memoize`.
  11672. memoize.Cache = MapCache;
  11673. /**
  11674. * Performs a
  11675. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  11676. * comparison between two values to determine if they are equivalent.
  11677. *
  11678. * @static
  11679. * @memberOf _
  11680. * @since 4.0.0
  11681. * @category Lang
  11682. * @param {*} value The value to compare.
  11683. * @param {*} other The other value to compare.
  11684. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11685. * @example
  11686. *
  11687. * var object = { 'a': 1 };
  11688. * var other = { 'a': 1 };
  11689. *
  11690. * _.eq(object, object);
  11691. * // => true
  11692. *
  11693. * _.eq(object, other);
  11694. * // => false
  11695. *
  11696. * _.eq('a', 'a');
  11697. * // => true
  11698. *
  11699. * _.eq('a', Object('a'));
  11700. * // => false
  11701. *
  11702. * _.eq(NaN, NaN);
  11703. * // => true
  11704. */
  11705. function eq(value, other) {
  11706. return value === other || (value !== value && other !== other);
  11707. }
  11708. /**
  11709. * Checks if `value` is classified as an `Array` object.
  11710. *
  11711. * @static
  11712. * @memberOf _
  11713. * @since 0.1.0
  11714. * @category Lang
  11715. * @param {*} value The value to check.
  11716. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  11717. * @example
  11718. *
  11719. * _.isArray([1, 2, 3]);
  11720. * // => true
  11721. *
  11722. * _.isArray(document.body.children);
  11723. * // => false
  11724. *
  11725. * _.isArray('abc');
  11726. * // => false
  11727. *
  11728. * _.isArray(_.noop);
  11729. * // => false
  11730. */
  11731. var isArray = Array.isArray;
  11732. /**
  11733. * Checks if `value` is classified as a `Function` object.
  11734. *
  11735. * @static
  11736. * @memberOf _
  11737. * @since 0.1.0
  11738. * @category Lang
  11739. * @param {*} value The value to check.
  11740. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  11741. * @example
  11742. *
  11743. * _.isFunction(_);
  11744. * // => true
  11745. *
  11746. * _.isFunction(/abc/);
  11747. * // => false
  11748. */
  11749. function isFunction(value) {
  11750. // The use of `Object#toString` avoids issues with the `typeof` operator
  11751. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  11752. var tag = isObject(value) ? objectToString.call(value) : '';
  11753. return tag == funcTag || tag == genTag;
  11754. }
  11755. /**
  11756. * Checks if `value` is the
  11757. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  11758. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  11759. *
  11760. * @static
  11761. * @memberOf _
  11762. * @since 0.1.0
  11763. * @category Lang
  11764. * @param {*} value The value to check.
  11765. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  11766. * @example
  11767. *
  11768. * _.isObject({});
  11769. * // => true
  11770. *
  11771. * _.isObject([1, 2, 3]);
  11772. * // => true
  11773. *
  11774. * _.isObject(_.noop);
  11775. * // => true
  11776. *
  11777. * _.isObject(null);
  11778. * // => false
  11779. */
  11780. function isObject(value) {
  11781. var type = typeof value;
  11782. return !!value && (type == 'object' || type == 'function');
  11783. }
  11784. /**
  11785. * Checks if `value` is object-like. A value is object-like if it's not `null`
  11786. * and has a `typeof` result of "object".
  11787. *
  11788. * @static
  11789. * @memberOf _
  11790. * @since 4.0.0
  11791. * @category Lang
  11792. * @param {*} value The value to check.
  11793. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  11794. * @example
  11795. *
  11796. * _.isObjectLike({});
  11797. * // => true
  11798. *
  11799. * _.isObjectLike([1, 2, 3]);
  11800. * // => true
  11801. *
  11802. * _.isObjectLike(_.noop);
  11803. * // => false
  11804. *
  11805. * _.isObjectLike(null);
  11806. * // => false
  11807. */
  11808. function isObjectLike(value) {
  11809. return !!value && typeof value == 'object';
  11810. }
  11811. /**
  11812. * Checks if `value` is classified as a `Symbol` primitive or object.
  11813. *
  11814. * @static
  11815. * @memberOf _
  11816. * @since 4.0.0
  11817. * @category Lang
  11818. * @param {*} value The value to check.
  11819. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  11820. * @example
  11821. *
  11822. * _.isSymbol(Symbol.iterator);
  11823. * // => true
  11824. *
  11825. * _.isSymbol('abc');
  11826. * // => false
  11827. */
  11828. function isSymbol(value) {
  11829. return typeof value == 'symbol' ||
  11830. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  11831. }
  11832. /**
  11833. * Converts `value` to a string. An empty string is returned for `null`
  11834. * and `undefined` values. The sign of `-0` is preserved.
  11835. *
  11836. * @static
  11837. * @memberOf _
  11838. * @since 4.0.0
  11839. * @category Lang
  11840. * @param {*} value The value to process.
  11841. * @returns {string} Returns the string.
  11842. * @example
  11843. *
  11844. * _.toString(null);
  11845. * // => ''
  11846. *
  11847. * _.toString(-0);
  11848. * // => '-0'
  11849. *
  11850. * _.toString([1, 2, 3]);
  11851. * // => '1,2,3'
  11852. */
  11853. function toString(value) {
  11854. return value == null ? '' : baseToString(value);
  11855. }
  11856. /**
  11857. * Gets the value at `path` of `object`. If the resolved value is
  11858. * `undefined`, the `defaultValue` is returned in its place.
  11859. *
  11860. * @static
  11861. * @memberOf _
  11862. * @since 3.7.0
  11863. * @category Object
  11864. * @param {Object} object The object to query.
  11865. * @param {Array|string} path The path of the property to get.
  11866. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  11867. * @returns {*} Returns the resolved value.
  11868. * @example
  11869. *
  11870. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  11871. *
  11872. * _.get(object, 'a[0].b.c');
  11873. * // => 3
  11874. *
  11875. * _.get(object, ['a', '0', 'b', 'c']);
  11876. * // => 3
  11877. *
  11878. * _.get(object, 'a.b.c', 'default');
  11879. * // => 'default'
  11880. */
  11881. function get(object, path, defaultValue) {
  11882. var result = object == null ? undefined : baseGet(object, path);
  11883. return result === undefined ? defaultValue : result;
  11884. }
  11885. module.exports = get;
  11886. /***/ }),
  11887. /***/ 855:
  11888. /***/ (function(module, __unusedexports, __webpack_require__) {
  11889. module.exports = registerPlugin;
  11890. const factory = __webpack_require__(47);
  11891. function registerPlugin(plugins, pluginFunction) {
  11892. return factory(
  11893. plugins.includes(pluginFunction) ? plugins : plugins.concat(pluginFunction)
  11894. );
  11895. }
  11896. /***/ }),
  11897. /***/ 856:
  11898. /***/ (function(module, __unusedexports, __webpack_require__) {
  11899. module.exports = __webpack_require__(141);
  11900. /***/ }),
  11901. /***/ 863:
  11902. /***/ (function(module, __unusedexports, __webpack_require__) {
  11903. module.exports = authenticationBeforeRequest;
  11904. const btoa = __webpack_require__(675);
  11905. const withAuthorizationPrefix = __webpack_require__(143);
  11906. function authenticationBeforeRequest(state, options) {
  11907. if (typeof state.auth === "string") {
  11908. options.headers.authorization = withAuthorizationPrefix(state.auth);
  11909. // https://developer.github.com/v3/previews/#integrations
  11910. if (
  11911. /^bearer /i.test(state.auth) &&
  11912. !/machine-man/.test(options.headers.accept)
  11913. ) {
  11914. const acceptHeaders = options.headers.accept
  11915. .split(",")
  11916. .concat("application/vnd.github.machine-man-preview+json");
  11917. options.headers.accept = acceptHeaders.filter(Boolean).join(",");
  11918. }
  11919. return;
  11920. }
  11921. if (state.auth.username) {
  11922. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  11923. options.headers.authorization = `Basic ${hash}`;
  11924. if (state.otp) {
  11925. options.headers["x-github-otp"] = state.otp;
  11926. }
  11927. return;
  11928. }
  11929. if (state.auth.clientId) {
  11930. // There is a special case for OAuth applications, when `clientId` and `clientSecret` is passed as
  11931. // Basic Authorization instead of query parameters. The only routes where that applies share the same
  11932. // URL though: `/applications/:client_id/tokens/:access_token`.
  11933. //
  11934. // 1. [Check an authorization](https://developer.github.com/v3/oauth_authorizations/#check-an-authorization)
  11935. // 2. [Reset an authorization](https://developer.github.com/v3/oauth_authorizations/#reset-an-authorization)
  11936. // 3. [Revoke an authorization for an application](https://developer.github.com/v3/oauth_authorizations/#revoke-an-authorization-for-an-application)
  11937. //
  11938. // We identify by checking the URL. It must merge both "/applications/:client_id/tokens/:access_token"
  11939. // as well as "/applications/123/tokens/token456"
  11940. if (/\/applications\/:?[\w_]+\/tokens\/:?[\w_]+($|\?)/.test(options.url)) {
  11941. const hash = btoa(`${state.auth.clientId}:${state.auth.clientSecret}`);
  11942. options.headers.authorization = `Basic ${hash}`;
  11943. return;
  11944. }
  11945. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  11946. options.url += `client_id=${state.auth.clientId}&client_secret=${state.auth.clientSecret}`;
  11947. return;
  11948. }
  11949. return Promise.resolve()
  11950. .then(() => {
  11951. return state.auth();
  11952. })
  11953. .then(authorization => {
  11954. options.headers.authorization = withAuthorizationPrefix(authorization);
  11955. });
  11956. }
  11957. /***/ }),
  11958. /***/ 866:
  11959. /***/ (function(module, __unusedexports, __webpack_require__) {
  11960. "use strict";
  11961. var shebangRegex = __webpack_require__(816);
  11962. module.exports = function (str) {
  11963. var match = str.match(shebangRegex);
  11964. if (!match) {
  11965. return null;
  11966. }
  11967. var arr = match[0].replace(/#! ?/, '').split(' ');
  11968. var bin = arr[0].split('/').pop();
  11969. var arg = arr[1];
  11970. return (bin === 'env' ?
  11971. arg :
  11972. bin + (arg ? ' ' + arg : '')
  11973. );
  11974. };
  11975. /***/ }),
  11976. /***/ 874:
  11977. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  11978. "use strict";
  11979. // Copyright (c) Microsoft. All rights reserved.
  11980. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
  11981. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  11982. return new (P || (P = Promise))(function (resolve, reject) {
  11983. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  11984. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  11985. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  11986. step((generator = generator.apply(thisArg, _arguments || [])).next());
  11987. });
  11988. };
  11989. Object.defineProperty(exports, "__esModule", { value: true });
  11990. const url = __webpack_require__(835);
  11991. const http = __webpack_require__(605);
  11992. const https = __webpack_require__(211);
  11993. let fs;
  11994. let tunnel;
  11995. var HttpCodes;
  11996. (function (HttpCodes) {
  11997. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  11998. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  11999. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  12000. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  12001. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  12002. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  12003. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  12004. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  12005. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  12006. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  12007. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  12008. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  12009. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  12010. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  12011. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  12012. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  12013. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  12014. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  12015. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  12016. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  12017. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  12018. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  12019. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  12020. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  12021. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  12022. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  12023. })(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
  12024. const HttpRedirectCodes = [HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect];
  12025. const HttpResponseRetryCodes = [HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout];
  12026. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  12027. const ExponentialBackoffCeiling = 10;
  12028. const ExponentialBackoffTimeSlice = 5;
  12029. class HttpClientResponse {
  12030. constructor(message) {
  12031. this.message = message;
  12032. }
  12033. readBody() {
  12034. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  12035. let output = '';
  12036. this.message.on('data', (chunk) => {
  12037. output += chunk;
  12038. });
  12039. this.message.on('end', () => {
  12040. resolve(output);
  12041. });
  12042. }));
  12043. }
  12044. }
  12045. exports.HttpClientResponse = HttpClientResponse;
  12046. function isHttps(requestUrl) {
  12047. let parsedUrl = url.parse(requestUrl);
  12048. return parsedUrl.protocol === 'https:';
  12049. }
  12050. exports.isHttps = isHttps;
  12051. var EnvironmentVariables;
  12052. (function (EnvironmentVariables) {
  12053. EnvironmentVariables["HTTP_PROXY"] = "HTTP_PROXY";
  12054. EnvironmentVariables["HTTPS_PROXY"] = "HTTPS_PROXY";
  12055. })(EnvironmentVariables || (EnvironmentVariables = {}));
  12056. class HttpClient {
  12057. constructor(userAgent, handlers, requestOptions) {
  12058. this._ignoreSslError = false;
  12059. this._allowRedirects = true;
  12060. this._maxRedirects = 50;
  12061. this._allowRetries = false;
  12062. this._maxRetries = 1;
  12063. this._keepAlive = false;
  12064. this._disposed = false;
  12065. this.userAgent = userAgent;
  12066. this.handlers = handlers || [];
  12067. this.requestOptions = requestOptions;
  12068. if (requestOptions) {
  12069. if (requestOptions.ignoreSslError != null) {
  12070. this._ignoreSslError = requestOptions.ignoreSslError;
  12071. }
  12072. this._socketTimeout = requestOptions.socketTimeout;
  12073. this._httpProxy = requestOptions.proxy;
  12074. if (requestOptions.proxy && requestOptions.proxy.proxyBypassHosts) {
  12075. this._httpProxyBypassHosts = [];
  12076. requestOptions.proxy.proxyBypassHosts.forEach(bypass => {
  12077. this._httpProxyBypassHosts.push(new RegExp(bypass, 'i'));
  12078. });
  12079. }
  12080. this._certConfig = requestOptions.cert;
  12081. if (this._certConfig) {
  12082. // If using cert, need fs
  12083. fs = __webpack_require__(747);
  12084. // cache the cert content into memory, so we don't have to read it from disk every time
  12085. if (this._certConfig.caFile && fs.existsSync(this._certConfig.caFile)) {
  12086. this._ca = fs.readFileSync(this._certConfig.caFile, 'utf8');
  12087. }
  12088. if (this._certConfig.certFile && fs.existsSync(this._certConfig.certFile)) {
  12089. this._cert = fs.readFileSync(this._certConfig.certFile, 'utf8');
  12090. }
  12091. if (this._certConfig.keyFile && fs.existsSync(this._certConfig.keyFile)) {
  12092. this._key = fs.readFileSync(this._certConfig.keyFile, 'utf8');
  12093. }
  12094. }
  12095. if (requestOptions.allowRedirects != null) {
  12096. this._allowRedirects = requestOptions.allowRedirects;
  12097. }
  12098. if (requestOptions.maxRedirects != null) {
  12099. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  12100. }
  12101. if (requestOptions.keepAlive != null) {
  12102. this._keepAlive = requestOptions.keepAlive;
  12103. }
  12104. if (requestOptions.allowRetries != null) {
  12105. this._allowRetries = requestOptions.allowRetries;
  12106. }
  12107. if (requestOptions.maxRetries != null) {
  12108. this._maxRetries = requestOptions.maxRetries;
  12109. }
  12110. }
  12111. }
  12112. options(requestUrl, additionalHeaders) {
  12113. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  12114. }
  12115. get(requestUrl, additionalHeaders) {
  12116. return this.request('GET', requestUrl, null, additionalHeaders || {});
  12117. }
  12118. del(requestUrl, additionalHeaders) {
  12119. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  12120. }
  12121. post(requestUrl, data, additionalHeaders) {
  12122. return this.request('POST', requestUrl, data, additionalHeaders || {});
  12123. }
  12124. patch(requestUrl, data, additionalHeaders) {
  12125. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  12126. }
  12127. put(requestUrl, data, additionalHeaders) {
  12128. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  12129. }
  12130. head(requestUrl, additionalHeaders) {
  12131. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  12132. }
  12133. sendStream(verb, requestUrl, stream, additionalHeaders) {
  12134. return this.request(verb, requestUrl, stream, additionalHeaders);
  12135. }
  12136. /**
  12137. * Makes a raw http request.
  12138. * All other methods such as get, post, patch, and request ultimately call this.
  12139. * Prefer get, del, post and patch
  12140. */
  12141. request(verb, requestUrl, data, headers) {
  12142. return __awaiter(this, void 0, void 0, function* () {
  12143. if (this._disposed) {
  12144. throw new Error("Client has already been disposed.");
  12145. }
  12146. let info = this._prepareRequest(verb, requestUrl, headers);
  12147. // Only perform retries on reads since writes may not be idempotent.
  12148. let maxTries = (this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1) ? this._maxRetries + 1 : 1;
  12149. let numTries = 0;
  12150. let response;
  12151. while (numTries < maxTries) {
  12152. response = yield this.requestRaw(info, data);
  12153. // Check if it's an authentication challenge
  12154. if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) {
  12155. let authenticationHandler;
  12156. for (let i = 0; i < this.handlers.length; i++) {
  12157. if (this.handlers[i].canHandleAuthentication(response)) {
  12158. authenticationHandler = this.handlers[i];
  12159. break;
  12160. }
  12161. }
  12162. if (authenticationHandler) {
  12163. return authenticationHandler.handleAuthentication(this, info, data);
  12164. }
  12165. else {
  12166. // We have received an unauthorized response but have no handlers to handle it.
  12167. // Let the response return to the caller.
  12168. return response;
  12169. }
  12170. }
  12171. let redirectsRemaining = this._maxRedirects;
  12172. while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1
  12173. && this._allowRedirects
  12174. && redirectsRemaining > 0) {
  12175. const redirectUrl = response.message.headers["location"];
  12176. if (!redirectUrl) {
  12177. // if there's no location to redirect to, we won't
  12178. break;
  12179. }
  12180. // we need to finish reading the response before reassigning response
  12181. // which will leak the open socket.
  12182. yield response.readBody();
  12183. // let's make the request with the new redirectUrl
  12184. info = this._prepareRequest(verb, redirectUrl, headers);
  12185. response = yield this.requestRaw(info, data);
  12186. redirectsRemaining--;
  12187. }
  12188. if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {
  12189. // If not a retry code, return immediately instead of retrying
  12190. return response;
  12191. }
  12192. numTries += 1;
  12193. if (numTries < maxTries) {
  12194. yield response.readBody();
  12195. yield this._performExponentialBackoff(numTries);
  12196. }
  12197. }
  12198. return response;
  12199. });
  12200. }
  12201. /**
  12202. * Needs to be called if keepAlive is set to true in request options.
  12203. */
  12204. dispose() {
  12205. if (this._agent) {
  12206. this._agent.destroy();
  12207. }
  12208. this._disposed = true;
  12209. }
  12210. /**
  12211. * Raw request.
  12212. * @param info
  12213. * @param data
  12214. */
  12215. requestRaw(info, data) {
  12216. return new Promise((resolve, reject) => {
  12217. let callbackForResult = function (err, res) {
  12218. if (err) {
  12219. reject(err);
  12220. }
  12221. resolve(res);
  12222. };
  12223. this.requestRawWithCallback(info, data, callbackForResult);
  12224. });
  12225. }
  12226. /**
  12227. * Raw request with callback.
  12228. * @param info
  12229. * @param data
  12230. * @param onResult
  12231. */
  12232. requestRawWithCallback(info, data, onResult) {
  12233. let socket;
  12234. let isDataString = typeof (data) === 'string';
  12235. if (typeof (data) === 'string') {
  12236. info.options.headers["Content-Length"] = Buffer.byteLength(data, 'utf8');
  12237. }
  12238. let callbackCalled = false;
  12239. let handleResult = (err, res) => {
  12240. if (!callbackCalled) {
  12241. callbackCalled = true;
  12242. onResult(err, res);
  12243. }
  12244. };
  12245. let req = info.httpModule.request(info.options, (msg) => {
  12246. let res = new HttpClientResponse(msg);
  12247. handleResult(null, res);
  12248. });
  12249. req.on('socket', (sock) => {
  12250. socket = sock;
  12251. });
  12252. // If we ever get disconnected, we want the socket to timeout eventually
  12253. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  12254. if (socket) {
  12255. socket.end();
  12256. }
  12257. handleResult(new Error('Request timeout: ' + info.options.path), null);
  12258. });
  12259. req.on('error', function (err) {
  12260. // err has statusCode property
  12261. // res should have headers
  12262. handleResult(err, null);
  12263. });
  12264. if (data && typeof (data) === 'string') {
  12265. req.write(data, 'utf8');
  12266. }
  12267. if (data && typeof (data) !== 'string') {
  12268. data.on('close', function () {
  12269. req.end();
  12270. });
  12271. data.pipe(req);
  12272. }
  12273. else {
  12274. req.end();
  12275. }
  12276. }
  12277. _prepareRequest(method, requestUrl, headers) {
  12278. const info = {};
  12279. info.parsedUrl = url.parse(requestUrl);
  12280. const usingSsl = info.parsedUrl.protocol === 'https:';
  12281. info.httpModule = usingSsl ? https : http;
  12282. const defaultPort = usingSsl ? 443 : 80;
  12283. info.options = {};
  12284. info.options.host = info.parsedUrl.hostname;
  12285. info.options.port = info.parsedUrl.port ? parseInt(info.parsedUrl.port) : defaultPort;
  12286. info.options.path = (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  12287. info.options.method = method;
  12288. info.options.headers = this._mergeHeaders(headers);
  12289. info.options.headers["user-agent"] = this.userAgent;
  12290. info.options.agent = this._getAgent(requestUrl);
  12291. // gives handlers an opportunity to participate
  12292. if (this.handlers && !this._isPresigned(requestUrl)) {
  12293. this.handlers.forEach((handler) => {
  12294. handler.prepareRequest(info.options);
  12295. });
  12296. }
  12297. return info;
  12298. }
  12299. _isPresigned(requestUrl) {
  12300. if (this.requestOptions && this.requestOptions.presignedUrlPatterns) {
  12301. const patterns = this.requestOptions.presignedUrlPatterns;
  12302. for (let i = 0; i < patterns.length; i++) {
  12303. if (requestUrl.match(patterns[i])) {
  12304. return true;
  12305. }
  12306. }
  12307. }
  12308. return false;
  12309. }
  12310. _mergeHeaders(headers) {
  12311. const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {});
  12312. if (this.requestOptions && this.requestOptions.headers) {
  12313. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
  12314. }
  12315. return lowercaseKeys(headers || {});
  12316. }
  12317. _getAgent(requestUrl) {
  12318. let agent;
  12319. let proxy = this._getProxy(requestUrl);
  12320. let useProxy = proxy.proxyUrl && proxy.proxyUrl.hostname && !this._isBypassProxy(requestUrl);
  12321. if (this._keepAlive && useProxy) {
  12322. agent = this._proxyAgent;
  12323. }
  12324. if (this._keepAlive && !useProxy) {
  12325. agent = this._agent;
  12326. }
  12327. // if agent is already assigned use that agent.
  12328. if (!!agent) {
  12329. return agent;
  12330. }
  12331. let parsedUrl = url.parse(requestUrl);
  12332. const usingSsl = parsedUrl.protocol === 'https:';
  12333. let maxSockets = 100;
  12334. if (!!this.requestOptions) {
  12335. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  12336. }
  12337. if (useProxy) {
  12338. // If using proxy, need tunnel
  12339. if (!tunnel) {
  12340. tunnel = __webpack_require__(856);
  12341. }
  12342. const agentOptions = {
  12343. maxSockets: maxSockets,
  12344. keepAlive: this._keepAlive,
  12345. proxy: {
  12346. proxyAuth: proxy.proxyAuth,
  12347. host: proxy.proxyUrl.hostname,
  12348. port: proxy.proxyUrl.port
  12349. },
  12350. };
  12351. let tunnelAgent;
  12352. const overHttps = proxy.proxyUrl.protocol === 'https:';
  12353. if (usingSsl) {
  12354. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  12355. }
  12356. else {
  12357. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  12358. }
  12359. agent = tunnelAgent(agentOptions);
  12360. this._proxyAgent = agent;
  12361. }
  12362. // if reusing agent across request and tunneling agent isn't assigned create a new agent
  12363. if (this._keepAlive && !agent) {
  12364. const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };
  12365. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  12366. this._agent = agent;
  12367. }
  12368. // if not using private agent and tunnel agent isn't setup then use global agent
  12369. if (!agent) {
  12370. agent = usingSsl ? https.globalAgent : http.globalAgent;
  12371. }
  12372. if (usingSsl && this._ignoreSslError) {
  12373. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  12374. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  12375. // we have to cast it to any and change it directly
  12376. agent.options = Object.assign(agent.options || {}, { rejectUnauthorized: false });
  12377. }
  12378. if (usingSsl && this._certConfig) {
  12379. agent.options = Object.assign(agent.options || {}, { ca: this._ca, cert: this._cert, key: this._key, passphrase: this._certConfig.passphrase });
  12380. }
  12381. return agent;
  12382. }
  12383. _getProxy(requestUrl) {
  12384. const parsedUrl = url.parse(requestUrl);
  12385. let usingSsl = parsedUrl.protocol === 'https:';
  12386. let proxyConfig = this._httpProxy;
  12387. // fallback to http_proxy and https_proxy env
  12388. let https_proxy = process.env[EnvironmentVariables.HTTPS_PROXY];
  12389. let http_proxy = process.env[EnvironmentVariables.HTTP_PROXY];
  12390. if (!proxyConfig) {
  12391. if (https_proxy && usingSsl) {
  12392. proxyConfig = {
  12393. proxyUrl: https_proxy
  12394. };
  12395. }
  12396. else if (http_proxy) {
  12397. proxyConfig = {
  12398. proxyUrl: http_proxy
  12399. };
  12400. }
  12401. }
  12402. let proxyUrl;
  12403. let proxyAuth;
  12404. if (proxyConfig) {
  12405. if (proxyConfig.proxyUrl.length > 0) {
  12406. proxyUrl = url.parse(proxyConfig.proxyUrl);
  12407. }
  12408. if (proxyConfig.proxyUsername || proxyConfig.proxyPassword) {
  12409. proxyAuth = proxyConfig.proxyUsername + ":" + proxyConfig.proxyPassword;
  12410. }
  12411. }
  12412. return { proxyUrl: proxyUrl, proxyAuth: proxyAuth };
  12413. }
  12414. _isBypassProxy(requestUrl) {
  12415. if (!this._httpProxyBypassHosts) {
  12416. return false;
  12417. }
  12418. let bypass = false;
  12419. this._httpProxyBypassHosts.forEach(bypassHost => {
  12420. if (bypassHost.test(requestUrl)) {
  12421. bypass = true;
  12422. }
  12423. });
  12424. return bypass;
  12425. }
  12426. _performExponentialBackoff(retryNumber) {
  12427. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  12428. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  12429. return new Promise(resolve => setTimeout(() => resolve(), ms));
  12430. }
  12431. }
  12432. exports.HttpClient = HttpClient;
  12433. /***/ }),
  12434. /***/ 881:
  12435. /***/ (function(module) {
  12436. "use strict";
  12437. const isWin = process.platform === 'win32';
  12438. function notFoundError(original, syscall) {
  12439. return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
  12440. code: 'ENOENT',
  12441. errno: 'ENOENT',
  12442. syscall: `${syscall} ${original.command}`,
  12443. path: original.command,
  12444. spawnargs: original.args,
  12445. });
  12446. }
  12447. function hookChildProcess(cp, parsed) {
  12448. if (!isWin) {
  12449. return;
  12450. }
  12451. const originalEmit = cp.emit;
  12452. cp.emit = function (name, arg1) {
  12453. // If emitting "exit" event and exit code is 1, we need to check if
  12454. // the command exists and emit an "error" instead
  12455. // See https://github.com/IndigoUnited/node-cross-spawn/issues/16
  12456. if (name === 'exit') {
  12457. const err = verifyENOENT(arg1, parsed, 'spawn');
  12458. if (err) {
  12459. return originalEmit.call(cp, 'error', err);
  12460. }
  12461. }
  12462. return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params
  12463. };
  12464. }
  12465. function verifyENOENT(status, parsed) {
  12466. if (isWin && status === 1 && !parsed.file) {
  12467. return notFoundError(parsed.original, 'spawn');
  12468. }
  12469. return null;
  12470. }
  12471. function verifyENOENTSync(status, parsed) {
  12472. if (isWin && status === 1 && !parsed.file) {
  12473. return notFoundError(parsed.original, 'spawnSync');
  12474. }
  12475. return null;
  12476. }
  12477. module.exports = {
  12478. hookChildProcess,
  12479. verifyENOENT,
  12480. verifyENOENTSync,
  12481. notFoundError,
  12482. };
  12483. /***/ }),
  12484. /***/ 883:
  12485. /***/ (function(module) {
  12486. /**
  12487. * lodash (Custom Build) <https://lodash.com/>
  12488. * Build: `lodash modularize exports="npm" -o ./`
  12489. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  12490. * Released under MIT license <https://lodash.com/license>
  12491. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  12492. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  12493. */
  12494. /** Used as the `TypeError` message for "Functions" methods. */
  12495. var FUNC_ERROR_TEXT = 'Expected a function';
  12496. /** Used to stand-in for `undefined` hash values. */
  12497. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  12498. /** Used as references for various `Number` constants. */
  12499. var INFINITY = 1 / 0,
  12500. MAX_SAFE_INTEGER = 9007199254740991;
  12501. /** `Object#toString` result references. */
  12502. var funcTag = '[object Function]',
  12503. genTag = '[object GeneratorFunction]',
  12504. symbolTag = '[object Symbol]';
  12505. /** Used to match property names within property paths. */
  12506. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  12507. reIsPlainProp = /^\w*$/,
  12508. reLeadingDot = /^\./,
  12509. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  12510. /**
  12511. * Used to match `RegExp`
  12512. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  12513. */
  12514. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  12515. /** Used to match backslashes in property paths. */
  12516. var reEscapeChar = /\\(\\)?/g;
  12517. /** Used to detect host constructors (Safari). */
  12518. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  12519. /** Used to detect unsigned integer values. */
  12520. var reIsUint = /^(?:0|[1-9]\d*)$/;
  12521. /** Detect free variable `global` from Node.js. */
  12522. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  12523. /** Detect free variable `self`. */
  12524. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  12525. /** Used as a reference to the global object. */
  12526. var root = freeGlobal || freeSelf || Function('return this')();
  12527. /**
  12528. * Gets the value at `key` of `object`.
  12529. *
  12530. * @private
  12531. * @param {Object} [object] The object to query.
  12532. * @param {string} key The key of the property to get.
  12533. * @returns {*} Returns the property value.
  12534. */
  12535. function getValue(object, key) {
  12536. return object == null ? undefined : object[key];
  12537. }
  12538. /**
  12539. * Checks if `value` is a host object in IE < 9.
  12540. *
  12541. * @private
  12542. * @param {*} value The value to check.
  12543. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  12544. */
  12545. function isHostObject(value) {
  12546. // Many host objects are `Object` objects that can coerce to strings
  12547. // despite having improperly defined `toString` methods.
  12548. var result = false;
  12549. if (value != null && typeof value.toString != 'function') {
  12550. try {
  12551. result = !!(value + '');
  12552. } catch (e) {}
  12553. }
  12554. return result;
  12555. }
  12556. /** Used for built-in method references. */
  12557. var arrayProto = Array.prototype,
  12558. funcProto = Function.prototype,
  12559. objectProto = Object.prototype;
  12560. /** Used to detect overreaching core-js shims. */
  12561. var coreJsData = root['__core-js_shared__'];
  12562. /** Used to detect methods masquerading as native. */
  12563. var maskSrcKey = (function() {
  12564. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  12565. return uid ? ('Symbol(src)_1.' + uid) : '';
  12566. }());
  12567. /** Used to resolve the decompiled source of functions. */
  12568. var funcToString = funcProto.toString;
  12569. /** Used to check objects for own properties. */
  12570. var hasOwnProperty = objectProto.hasOwnProperty;
  12571. /**
  12572. * Used to resolve the
  12573. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  12574. * of values.
  12575. */
  12576. var objectToString = objectProto.toString;
  12577. /** Used to detect if a method is native. */
  12578. var reIsNative = RegExp('^' +
  12579. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  12580. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  12581. );
  12582. /** Built-in value references. */
  12583. var Symbol = root.Symbol,
  12584. splice = arrayProto.splice;
  12585. /* Built-in method references that are verified to be native. */
  12586. var Map = getNative(root, 'Map'),
  12587. nativeCreate = getNative(Object, 'create');
  12588. /** Used to convert symbols to primitives and strings. */
  12589. var symbolProto = Symbol ? Symbol.prototype : undefined,
  12590. symbolToString = symbolProto ? symbolProto.toString : undefined;
  12591. /**
  12592. * Creates a hash object.
  12593. *
  12594. * @private
  12595. * @constructor
  12596. * @param {Array} [entries] The key-value pairs to cache.
  12597. */
  12598. function Hash(entries) {
  12599. var index = -1,
  12600. length = entries ? entries.length : 0;
  12601. this.clear();
  12602. while (++index < length) {
  12603. var entry = entries[index];
  12604. this.set(entry[0], entry[1]);
  12605. }
  12606. }
  12607. /**
  12608. * Removes all key-value entries from the hash.
  12609. *
  12610. * @private
  12611. * @name clear
  12612. * @memberOf Hash
  12613. */
  12614. function hashClear() {
  12615. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  12616. }
  12617. /**
  12618. * Removes `key` and its value from the hash.
  12619. *
  12620. * @private
  12621. * @name delete
  12622. * @memberOf Hash
  12623. * @param {Object} hash The hash to modify.
  12624. * @param {string} key The key of the value to remove.
  12625. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  12626. */
  12627. function hashDelete(key) {
  12628. return this.has(key) && delete this.__data__[key];
  12629. }
  12630. /**
  12631. * Gets the hash value for `key`.
  12632. *
  12633. * @private
  12634. * @name get
  12635. * @memberOf Hash
  12636. * @param {string} key The key of the value to get.
  12637. * @returns {*} Returns the entry value.
  12638. */
  12639. function hashGet(key) {
  12640. var data = this.__data__;
  12641. if (nativeCreate) {
  12642. var result = data[key];
  12643. return result === HASH_UNDEFINED ? undefined : result;
  12644. }
  12645. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  12646. }
  12647. /**
  12648. * Checks if a hash value for `key` exists.
  12649. *
  12650. * @private
  12651. * @name has
  12652. * @memberOf Hash
  12653. * @param {string} key The key of the entry to check.
  12654. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  12655. */
  12656. function hashHas(key) {
  12657. var data = this.__data__;
  12658. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  12659. }
  12660. /**
  12661. * Sets the hash `key` to `value`.
  12662. *
  12663. * @private
  12664. * @name set
  12665. * @memberOf Hash
  12666. * @param {string} key The key of the value to set.
  12667. * @param {*} value The value to set.
  12668. * @returns {Object} Returns the hash instance.
  12669. */
  12670. function hashSet(key, value) {
  12671. var data = this.__data__;
  12672. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  12673. return this;
  12674. }
  12675. // Add methods to `Hash`.
  12676. Hash.prototype.clear = hashClear;
  12677. Hash.prototype['delete'] = hashDelete;
  12678. Hash.prototype.get = hashGet;
  12679. Hash.prototype.has = hashHas;
  12680. Hash.prototype.set = hashSet;
  12681. /**
  12682. * Creates an list cache object.
  12683. *
  12684. * @private
  12685. * @constructor
  12686. * @param {Array} [entries] The key-value pairs to cache.
  12687. */
  12688. function ListCache(entries) {
  12689. var index = -1,
  12690. length = entries ? entries.length : 0;
  12691. this.clear();
  12692. while (++index < length) {
  12693. var entry = entries[index];
  12694. this.set(entry[0], entry[1]);
  12695. }
  12696. }
  12697. /**
  12698. * Removes all key-value entries from the list cache.
  12699. *
  12700. * @private
  12701. * @name clear
  12702. * @memberOf ListCache
  12703. */
  12704. function listCacheClear() {
  12705. this.__data__ = [];
  12706. }
  12707. /**
  12708. * Removes `key` and its value from the list cache.
  12709. *
  12710. * @private
  12711. * @name delete
  12712. * @memberOf ListCache
  12713. * @param {string} key The key of the value to remove.
  12714. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  12715. */
  12716. function listCacheDelete(key) {
  12717. var data = this.__data__,
  12718. index = assocIndexOf(data, key);
  12719. if (index < 0) {
  12720. return false;
  12721. }
  12722. var lastIndex = data.length - 1;
  12723. if (index == lastIndex) {
  12724. data.pop();
  12725. } else {
  12726. splice.call(data, index, 1);
  12727. }
  12728. return true;
  12729. }
  12730. /**
  12731. * Gets the list cache value for `key`.
  12732. *
  12733. * @private
  12734. * @name get
  12735. * @memberOf ListCache
  12736. * @param {string} key The key of the value to get.
  12737. * @returns {*} Returns the entry value.
  12738. */
  12739. function listCacheGet(key) {
  12740. var data = this.__data__,
  12741. index = assocIndexOf(data, key);
  12742. return index < 0 ? undefined : data[index][1];
  12743. }
  12744. /**
  12745. * Checks if a list cache value for `key` exists.
  12746. *
  12747. * @private
  12748. * @name has
  12749. * @memberOf ListCache
  12750. * @param {string} key The key of the entry to check.
  12751. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  12752. */
  12753. function listCacheHas(key) {
  12754. return assocIndexOf(this.__data__, key) > -1;
  12755. }
  12756. /**
  12757. * Sets the list cache `key` to `value`.
  12758. *
  12759. * @private
  12760. * @name set
  12761. * @memberOf ListCache
  12762. * @param {string} key The key of the value to set.
  12763. * @param {*} value The value to set.
  12764. * @returns {Object} Returns the list cache instance.
  12765. */
  12766. function listCacheSet(key, value) {
  12767. var data = this.__data__,
  12768. index = assocIndexOf(data, key);
  12769. if (index < 0) {
  12770. data.push([key, value]);
  12771. } else {
  12772. data[index][1] = value;
  12773. }
  12774. return this;
  12775. }
  12776. // Add methods to `ListCache`.
  12777. ListCache.prototype.clear = listCacheClear;
  12778. ListCache.prototype['delete'] = listCacheDelete;
  12779. ListCache.prototype.get = listCacheGet;
  12780. ListCache.prototype.has = listCacheHas;
  12781. ListCache.prototype.set = listCacheSet;
  12782. /**
  12783. * Creates a map cache object to store key-value pairs.
  12784. *
  12785. * @private
  12786. * @constructor
  12787. * @param {Array} [entries] The key-value pairs to cache.
  12788. */
  12789. function MapCache(entries) {
  12790. var index = -1,
  12791. length = entries ? entries.length : 0;
  12792. this.clear();
  12793. while (++index < length) {
  12794. var entry = entries[index];
  12795. this.set(entry[0], entry[1]);
  12796. }
  12797. }
  12798. /**
  12799. * Removes all key-value entries from the map.
  12800. *
  12801. * @private
  12802. * @name clear
  12803. * @memberOf MapCache
  12804. */
  12805. function mapCacheClear() {
  12806. this.__data__ = {
  12807. 'hash': new Hash,
  12808. 'map': new (Map || ListCache),
  12809. 'string': new Hash
  12810. };
  12811. }
  12812. /**
  12813. * Removes `key` and its value from the map.
  12814. *
  12815. * @private
  12816. * @name delete
  12817. * @memberOf MapCache
  12818. * @param {string} key The key of the value to remove.
  12819. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  12820. */
  12821. function mapCacheDelete(key) {
  12822. return getMapData(this, key)['delete'](key);
  12823. }
  12824. /**
  12825. * Gets the map value for `key`.
  12826. *
  12827. * @private
  12828. * @name get
  12829. * @memberOf MapCache
  12830. * @param {string} key The key of the value to get.
  12831. * @returns {*} Returns the entry value.
  12832. */
  12833. function mapCacheGet(key) {
  12834. return getMapData(this, key).get(key);
  12835. }
  12836. /**
  12837. * Checks if a map value for `key` exists.
  12838. *
  12839. * @private
  12840. * @name has
  12841. * @memberOf MapCache
  12842. * @param {string} key The key of the entry to check.
  12843. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  12844. */
  12845. function mapCacheHas(key) {
  12846. return getMapData(this, key).has(key);
  12847. }
  12848. /**
  12849. * Sets the map `key` to `value`.
  12850. *
  12851. * @private
  12852. * @name set
  12853. * @memberOf MapCache
  12854. * @param {string} key The key of the value to set.
  12855. * @param {*} value The value to set.
  12856. * @returns {Object} Returns the map cache instance.
  12857. */
  12858. function mapCacheSet(key, value) {
  12859. getMapData(this, key).set(key, value);
  12860. return this;
  12861. }
  12862. // Add methods to `MapCache`.
  12863. MapCache.prototype.clear = mapCacheClear;
  12864. MapCache.prototype['delete'] = mapCacheDelete;
  12865. MapCache.prototype.get = mapCacheGet;
  12866. MapCache.prototype.has = mapCacheHas;
  12867. MapCache.prototype.set = mapCacheSet;
  12868. /**
  12869. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  12870. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  12871. * for equality comparisons.
  12872. *
  12873. * @private
  12874. * @param {Object} object The object to modify.
  12875. * @param {string} key The key of the property to assign.
  12876. * @param {*} value The value to assign.
  12877. */
  12878. function assignValue(object, key, value) {
  12879. var objValue = object[key];
  12880. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  12881. (value === undefined && !(key in object))) {
  12882. object[key] = value;
  12883. }
  12884. }
  12885. /**
  12886. * Gets the index at which the `key` is found in `array` of key-value pairs.
  12887. *
  12888. * @private
  12889. * @param {Array} array The array to inspect.
  12890. * @param {*} key The key to search for.
  12891. * @returns {number} Returns the index of the matched value, else `-1`.
  12892. */
  12893. function assocIndexOf(array, key) {
  12894. var length = array.length;
  12895. while (length--) {
  12896. if (eq(array[length][0], key)) {
  12897. return length;
  12898. }
  12899. }
  12900. return -1;
  12901. }
  12902. /**
  12903. * The base implementation of `_.isNative` without bad shim checks.
  12904. *
  12905. * @private
  12906. * @param {*} value The value to check.
  12907. * @returns {boolean} Returns `true` if `value` is a native function,
  12908. * else `false`.
  12909. */
  12910. function baseIsNative(value) {
  12911. if (!isObject(value) || isMasked(value)) {
  12912. return false;
  12913. }
  12914. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  12915. return pattern.test(toSource(value));
  12916. }
  12917. /**
  12918. * The base implementation of `_.set`.
  12919. *
  12920. * @private
  12921. * @param {Object} object The object to modify.
  12922. * @param {Array|string} path The path of the property to set.
  12923. * @param {*} value The value to set.
  12924. * @param {Function} [customizer] The function to customize path creation.
  12925. * @returns {Object} Returns `object`.
  12926. */
  12927. function baseSet(object, path, value, customizer) {
  12928. if (!isObject(object)) {
  12929. return object;
  12930. }
  12931. path = isKey(path, object) ? [path] : castPath(path);
  12932. var index = -1,
  12933. length = path.length,
  12934. lastIndex = length - 1,
  12935. nested = object;
  12936. while (nested != null && ++index < length) {
  12937. var key = toKey(path[index]),
  12938. newValue = value;
  12939. if (index != lastIndex) {
  12940. var objValue = nested[key];
  12941. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  12942. if (newValue === undefined) {
  12943. newValue = isObject(objValue)
  12944. ? objValue
  12945. : (isIndex(path[index + 1]) ? [] : {});
  12946. }
  12947. }
  12948. assignValue(nested, key, newValue);
  12949. nested = nested[key];
  12950. }
  12951. return object;
  12952. }
  12953. /**
  12954. * The base implementation of `_.toString` which doesn't convert nullish
  12955. * values to empty strings.
  12956. *
  12957. * @private
  12958. * @param {*} value The value to process.
  12959. * @returns {string} Returns the string.
  12960. */
  12961. function baseToString(value) {
  12962. // Exit early for strings to avoid a performance hit in some environments.
  12963. if (typeof value == 'string') {
  12964. return value;
  12965. }
  12966. if (isSymbol(value)) {
  12967. return symbolToString ? symbolToString.call(value) : '';
  12968. }
  12969. var result = (value + '');
  12970. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  12971. }
  12972. /**
  12973. * Casts `value` to a path array if it's not one.
  12974. *
  12975. * @private
  12976. * @param {*} value The value to inspect.
  12977. * @returns {Array} Returns the cast property path array.
  12978. */
  12979. function castPath(value) {
  12980. return isArray(value) ? value : stringToPath(value);
  12981. }
  12982. /**
  12983. * Gets the data for `map`.
  12984. *
  12985. * @private
  12986. * @param {Object} map The map to query.
  12987. * @param {string} key The reference key.
  12988. * @returns {*} Returns the map data.
  12989. */
  12990. function getMapData(map, key) {
  12991. var data = map.__data__;
  12992. return isKeyable(key)
  12993. ? data[typeof key == 'string' ? 'string' : 'hash']
  12994. : data.map;
  12995. }
  12996. /**
  12997. * Gets the native function at `key` of `object`.
  12998. *
  12999. * @private
  13000. * @param {Object} object The object to query.
  13001. * @param {string} key The key of the method to get.
  13002. * @returns {*} Returns the function if it's native, else `undefined`.
  13003. */
  13004. function getNative(object, key) {
  13005. var value = getValue(object, key);
  13006. return baseIsNative(value) ? value : undefined;
  13007. }
  13008. /**
  13009. * Checks if `value` is a valid array-like index.
  13010. *
  13011. * @private
  13012. * @param {*} value The value to check.
  13013. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  13014. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  13015. */
  13016. function isIndex(value, length) {
  13017. length = length == null ? MAX_SAFE_INTEGER : length;
  13018. return !!length &&
  13019. (typeof value == 'number' || reIsUint.test(value)) &&
  13020. (value > -1 && value % 1 == 0 && value < length);
  13021. }
  13022. /**
  13023. * Checks if `value` is a property name and not a property path.
  13024. *
  13025. * @private
  13026. * @param {*} value The value to check.
  13027. * @param {Object} [object] The object to query keys on.
  13028. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  13029. */
  13030. function isKey(value, object) {
  13031. if (isArray(value)) {
  13032. return false;
  13033. }
  13034. var type = typeof value;
  13035. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  13036. value == null || isSymbol(value)) {
  13037. return true;
  13038. }
  13039. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  13040. (object != null && value in Object(object));
  13041. }
  13042. /**
  13043. * Checks if `value` is suitable for use as unique object key.
  13044. *
  13045. * @private
  13046. * @param {*} value The value to check.
  13047. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  13048. */
  13049. function isKeyable(value) {
  13050. var type = typeof value;
  13051. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  13052. ? (value !== '__proto__')
  13053. : (value === null);
  13054. }
  13055. /**
  13056. * Checks if `func` has its source masked.
  13057. *
  13058. * @private
  13059. * @param {Function} func The function to check.
  13060. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  13061. */
  13062. function isMasked(func) {
  13063. return !!maskSrcKey && (maskSrcKey in func);
  13064. }
  13065. /**
  13066. * Converts `string` to a property path array.
  13067. *
  13068. * @private
  13069. * @param {string} string The string to convert.
  13070. * @returns {Array} Returns the property path array.
  13071. */
  13072. var stringToPath = memoize(function(string) {
  13073. string = toString(string);
  13074. var result = [];
  13075. if (reLeadingDot.test(string)) {
  13076. result.push('');
  13077. }
  13078. string.replace(rePropName, function(match, number, quote, string) {
  13079. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  13080. });
  13081. return result;
  13082. });
  13083. /**
  13084. * Converts `value` to a string key if it's not a string or symbol.
  13085. *
  13086. * @private
  13087. * @param {*} value The value to inspect.
  13088. * @returns {string|symbol} Returns the key.
  13089. */
  13090. function toKey(value) {
  13091. if (typeof value == 'string' || isSymbol(value)) {
  13092. return value;
  13093. }
  13094. var result = (value + '');
  13095. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  13096. }
  13097. /**
  13098. * Converts `func` to its source code.
  13099. *
  13100. * @private
  13101. * @param {Function} func The function to process.
  13102. * @returns {string} Returns the source code.
  13103. */
  13104. function toSource(func) {
  13105. if (func != null) {
  13106. try {
  13107. return funcToString.call(func);
  13108. } catch (e) {}
  13109. try {
  13110. return (func + '');
  13111. } catch (e) {}
  13112. }
  13113. return '';
  13114. }
  13115. /**
  13116. * Creates a function that memoizes the result of `func`. If `resolver` is
  13117. * provided, it determines the cache key for storing the result based on the
  13118. * arguments provided to the memoized function. By default, the first argument
  13119. * provided to the memoized function is used as the map cache key. The `func`
  13120. * is invoked with the `this` binding of the memoized function.
  13121. *
  13122. * **Note:** The cache is exposed as the `cache` property on the memoized
  13123. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  13124. * constructor with one whose instances implement the
  13125. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  13126. * method interface of `delete`, `get`, `has`, and `set`.
  13127. *
  13128. * @static
  13129. * @memberOf _
  13130. * @since 0.1.0
  13131. * @category Function
  13132. * @param {Function} func The function to have its output memoized.
  13133. * @param {Function} [resolver] The function to resolve the cache key.
  13134. * @returns {Function} Returns the new memoized function.
  13135. * @example
  13136. *
  13137. * var object = { 'a': 1, 'b': 2 };
  13138. * var other = { 'c': 3, 'd': 4 };
  13139. *
  13140. * var values = _.memoize(_.values);
  13141. * values(object);
  13142. * // => [1, 2]
  13143. *
  13144. * values(other);
  13145. * // => [3, 4]
  13146. *
  13147. * object.a = 2;
  13148. * values(object);
  13149. * // => [1, 2]
  13150. *
  13151. * // Modify the result cache.
  13152. * values.cache.set(object, ['a', 'b']);
  13153. * values(object);
  13154. * // => ['a', 'b']
  13155. *
  13156. * // Replace `_.memoize.Cache`.
  13157. * _.memoize.Cache = WeakMap;
  13158. */
  13159. function memoize(func, resolver) {
  13160. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  13161. throw new TypeError(FUNC_ERROR_TEXT);
  13162. }
  13163. var memoized = function() {
  13164. var args = arguments,
  13165. key = resolver ? resolver.apply(this, args) : args[0],
  13166. cache = memoized.cache;
  13167. if (cache.has(key)) {
  13168. return cache.get(key);
  13169. }
  13170. var result = func.apply(this, args);
  13171. memoized.cache = cache.set(key, result);
  13172. return result;
  13173. };
  13174. memoized.cache = new (memoize.Cache || MapCache);
  13175. return memoized;
  13176. }
  13177. // Assign cache to `_.memoize`.
  13178. memoize.Cache = MapCache;
  13179. /**
  13180. * Performs a
  13181. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  13182. * comparison between two values to determine if they are equivalent.
  13183. *
  13184. * @static
  13185. * @memberOf _
  13186. * @since 4.0.0
  13187. * @category Lang
  13188. * @param {*} value The value to compare.
  13189. * @param {*} other The other value to compare.
  13190. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  13191. * @example
  13192. *
  13193. * var object = { 'a': 1 };
  13194. * var other = { 'a': 1 };
  13195. *
  13196. * _.eq(object, object);
  13197. * // => true
  13198. *
  13199. * _.eq(object, other);
  13200. * // => false
  13201. *
  13202. * _.eq('a', 'a');
  13203. * // => true
  13204. *
  13205. * _.eq('a', Object('a'));
  13206. * // => false
  13207. *
  13208. * _.eq(NaN, NaN);
  13209. * // => true
  13210. */
  13211. function eq(value, other) {
  13212. return value === other || (value !== value && other !== other);
  13213. }
  13214. /**
  13215. * Checks if `value` is classified as an `Array` object.
  13216. *
  13217. * @static
  13218. * @memberOf _
  13219. * @since 0.1.0
  13220. * @category Lang
  13221. * @param {*} value The value to check.
  13222. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  13223. * @example
  13224. *
  13225. * _.isArray([1, 2, 3]);
  13226. * // => true
  13227. *
  13228. * _.isArray(document.body.children);
  13229. * // => false
  13230. *
  13231. * _.isArray('abc');
  13232. * // => false
  13233. *
  13234. * _.isArray(_.noop);
  13235. * // => false
  13236. */
  13237. var isArray = Array.isArray;
  13238. /**
  13239. * Checks if `value` is classified as a `Function` object.
  13240. *
  13241. * @static
  13242. * @memberOf _
  13243. * @since 0.1.0
  13244. * @category Lang
  13245. * @param {*} value The value to check.
  13246. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  13247. * @example
  13248. *
  13249. * _.isFunction(_);
  13250. * // => true
  13251. *
  13252. * _.isFunction(/abc/);
  13253. * // => false
  13254. */
  13255. function isFunction(value) {
  13256. // The use of `Object#toString` avoids issues with the `typeof` operator
  13257. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  13258. var tag = isObject(value) ? objectToString.call(value) : '';
  13259. return tag == funcTag || tag == genTag;
  13260. }
  13261. /**
  13262. * Checks if `value` is the
  13263. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  13264. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  13265. *
  13266. * @static
  13267. * @memberOf _
  13268. * @since 0.1.0
  13269. * @category Lang
  13270. * @param {*} value The value to check.
  13271. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  13272. * @example
  13273. *
  13274. * _.isObject({});
  13275. * // => true
  13276. *
  13277. * _.isObject([1, 2, 3]);
  13278. * // => true
  13279. *
  13280. * _.isObject(_.noop);
  13281. * // => true
  13282. *
  13283. * _.isObject(null);
  13284. * // => false
  13285. */
  13286. function isObject(value) {
  13287. var type = typeof value;
  13288. return !!value && (type == 'object' || type == 'function');
  13289. }
  13290. /**
  13291. * Checks if `value` is object-like. A value is object-like if it's not `null`
  13292. * and has a `typeof` result of "object".
  13293. *
  13294. * @static
  13295. * @memberOf _
  13296. * @since 4.0.0
  13297. * @category Lang
  13298. * @param {*} value The value to check.
  13299. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  13300. * @example
  13301. *
  13302. * _.isObjectLike({});
  13303. * // => true
  13304. *
  13305. * _.isObjectLike([1, 2, 3]);
  13306. * // => true
  13307. *
  13308. * _.isObjectLike(_.noop);
  13309. * // => false
  13310. *
  13311. * _.isObjectLike(null);
  13312. * // => false
  13313. */
  13314. function isObjectLike(value) {
  13315. return !!value && typeof value == 'object';
  13316. }
  13317. /**
  13318. * Checks if `value` is classified as a `Symbol` primitive or object.
  13319. *
  13320. * @static
  13321. * @memberOf _
  13322. * @since 4.0.0
  13323. * @category Lang
  13324. * @param {*} value The value to check.
  13325. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  13326. * @example
  13327. *
  13328. * _.isSymbol(Symbol.iterator);
  13329. * // => true
  13330. *
  13331. * _.isSymbol('abc');
  13332. * // => false
  13333. */
  13334. function isSymbol(value) {
  13335. return typeof value == 'symbol' ||
  13336. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  13337. }
  13338. /**
  13339. * Converts `value` to a string. An empty string is returned for `null`
  13340. * and `undefined` values. The sign of `-0` is preserved.
  13341. *
  13342. * @static
  13343. * @memberOf _
  13344. * @since 4.0.0
  13345. * @category Lang
  13346. * @param {*} value The value to process.
  13347. * @returns {string} Returns the string.
  13348. * @example
  13349. *
  13350. * _.toString(null);
  13351. * // => ''
  13352. *
  13353. * _.toString(-0);
  13354. * // => '-0'
  13355. *
  13356. * _.toString([1, 2, 3]);
  13357. * // => '1,2,3'
  13358. */
  13359. function toString(value) {
  13360. return value == null ? '' : baseToString(value);
  13361. }
  13362. /**
  13363. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  13364. * it's created. Arrays are created for missing index properties while objects
  13365. * are created for all other missing properties. Use `_.setWith` to customize
  13366. * `path` creation.
  13367. *
  13368. * **Note:** This method mutates `object`.
  13369. *
  13370. * @static
  13371. * @memberOf _
  13372. * @since 3.7.0
  13373. * @category Object
  13374. * @param {Object} object The object to modify.
  13375. * @param {Array|string} path The path of the property to set.
  13376. * @param {*} value The value to set.
  13377. * @returns {Object} Returns `object`.
  13378. * @example
  13379. *
  13380. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13381. *
  13382. * _.set(object, 'a[0].b.c', 4);
  13383. * console.log(object.a[0].b.c);
  13384. * // => 4
  13385. *
  13386. * _.set(object, ['x', '0', 'y', 'z'], 5);
  13387. * console.log(object.x[0].y.z);
  13388. * // => 5
  13389. */
  13390. function set(object, path, value) {
  13391. return object == null ? object : baseSet(object, path, value);
  13392. }
  13393. module.exports = set;
  13394. /***/ }),
  13395. /***/ 898:
  13396. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  13397. "use strict";
  13398. Object.defineProperty(exports, '__esModule', { value: true });
  13399. var request = __webpack_require__(753);
  13400. var universalUserAgent = __webpack_require__(796);
  13401. const VERSION = "4.3.1";
  13402. class GraphqlError extends Error {
  13403. constructor(request, response) {
  13404. const message = response.data.errors[0].message;
  13405. super(message);
  13406. Object.assign(this, response.data);
  13407. this.name = "GraphqlError";
  13408. this.request = request; // Maintains proper stack trace (only available on V8)
  13409. /* istanbul ignore next */
  13410. if (Error.captureStackTrace) {
  13411. Error.captureStackTrace(this, this.constructor);
  13412. }
  13413. }
  13414. }
  13415. const NON_VARIABLE_OPTIONS = ["method", "baseUrl", "url", "headers", "request", "query"];
  13416. function graphql(request, query, options) {
  13417. options = typeof query === "string" ? options = Object.assign({
  13418. query
  13419. }, options) : options = query;
  13420. const requestOptions = Object.keys(options).reduce((result, key) => {
  13421. if (NON_VARIABLE_OPTIONS.includes(key)) {
  13422. result[key] = options[key];
  13423. return result;
  13424. }
  13425. if (!result.variables) {
  13426. result.variables = {};
  13427. }
  13428. result.variables[key] = options[key];
  13429. return result;
  13430. }, {});
  13431. return request(requestOptions).then(response => {
  13432. if (response.data.errors) {
  13433. throw new GraphqlError(requestOptions, {
  13434. data: response.data
  13435. });
  13436. }
  13437. return response.data.data;
  13438. });
  13439. }
  13440. function withDefaults(request$1, newDefaults) {
  13441. const newRequest = request$1.defaults(newDefaults);
  13442. const newApi = (query, options) => {
  13443. return graphql(newRequest, query, options);
  13444. };
  13445. return Object.assign(newApi, {
  13446. defaults: withDefaults.bind(null, newRequest),
  13447. endpoint: request.request.endpoint
  13448. });
  13449. }
  13450. const graphql$1 = withDefaults(request.request, {
  13451. headers: {
  13452. "user-agent": `octokit-graphql.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  13453. },
  13454. method: "POST",
  13455. url: "/graphql"
  13456. });
  13457. function withCustomRequest(customRequest) {
  13458. return withDefaults(customRequest, {
  13459. method: "POST",
  13460. url: "/graphql"
  13461. });
  13462. }
  13463. exports.graphql = graphql$1;
  13464. exports.withCustomRequest = withCustomRequest;
  13465. //# sourceMappingURL=index.js.map
  13466. /***/ }),
  13467. /***/ 899:
  13468. /***/ (function(module, __unusedexports, __webpack_require__) {
  13469. module.exports = registerEndpoints;
  13470. const { Deprecation } = __webpack_require__(692);
  13471. function registerEndpoints(octokit, routes) {
  13472. Object.keys(routes).forEach(namespaceName => {
  13473. if (!octokit[namespaceName]) {
  13474. octokit[namespaceName] = {};
  13475. }
  13476. Object.keys(routes[namespaceName]).forEach(apiName => {
  13477. const apiOptions = routes[namespaceName][apiName];
  13478. const endpointDefaults = ["method", "url", "headers"].reduce(
  13479. (map, key) => {
  13480. if (typeof apiOptions[key] !== "undefined") {
  13481. map[key] = apiOptions[key];
  13482. }
  13483. return map;
  13484. },
  13485. {}
  13486. );
  13487. endpointDefaults.request = {
  13488. validate: apiOptions.params
  13489. };
  13490. let request = octokit.request.defaults(endpointDefaults);
  13491. // patch request & endpoint methods to support deprecated parameters.
  13492. // Not the most elegant solution, but we don’t want to move deprecation
  13493. // logic into octokit/endpoint.js as it’s out of scope
  13494. const hasDeprecatedParam = Object.keys(apiOptions.params || {}).find(
  13495. key => apiOptions.params[key].deprecated
  13496. );
  13497. if (hasDeprecatedParam) {
  13498. const patch = patchForDeprecation.bind(null, octokit, apiOptions);
  13499. request = patch(
  13500. octokit.request.defaults(endpointDefaults),
  13501. `.${namespaceName}.${apiName}()`
  13502. );
  13503. request.endpoint = patch(
  13504. request.endpoint,
  13505. `.${namespaceName}.${apiName}.endpoint()`
  13506. );
  13507. request.endpoint.merge = patch(
  13508. request.endpoint.merge,
  13509. `.${namespaceName}.${apiName}.endpoint.merge()`
  13510. );
  13511. }
  13512. if (apiOptions.deprecated) {
  13513. octokit[namespaceName][apiName] = function deprecatedEndpointMethod() {
  13514. octokit.log.warn(
  13515. new Deprecation(`[@octokit/rest] ${apiOptions.deprecated}`)
  13516. );
  13517. octokit[namespaceName][apiName] = request;
  13518. return request.apply(null, arguments);
  13519. };
  13520. return;
  13521. }
  13522. octokit[namespaceName][apiName] = request;
  13523. });
  13524. });
  13525. }
  13526. function patchForDeprecation(octokit, apiOptions, method, methodName) {
  13527. const patchedMethod = options => {
  13528. options = Object.assign({}, options);
  13529. Object.keys(options).forEach(key => {
  13530. if (apiOptions.params[key] && apiOptions.params[key].deprecated) {
  13531. const aliasKey = apiOptions.params[key].alias;
  13532. octokit.log.warn(
  13533. new Deprecation(
  13534. `[@octokit/rest] "${key}" parameter is deprecated for "${methodName}". Use "${aliasKey}" instead`
  13535. )
  13536. );
  13537. if (!(aliasKey in options)) {
  13538. options[aliasKey] = options[key];
  13539. }
  13540. delete options[key];
  13541. }
  13542. });
  13543. return method(options);
  13544. };
  13545. Object.keys(method).forEach(key => {
  13546. patchedMethod[key] = method[key];
  13547. });
  13548. return patchedMethod;
  13549. }
  13550. /***/ }),
  13551. /***/ 929:
  13552. /***/ (function(module, __unusedexports, __webpack_require__) {
  13553. module.exports = hasNextPage
  13554. const deprecate = __webpack_require__(370)
  13555. const getPageLinks = __webpack_require__(577)
  13556. function hasNextPage (link) {
  13557. deprecate(`octokit.hasNextPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  13558. return getPageLinks(link).next
  13559. }
  13560. /***/ }),
  13561. /***/ 948:
  13562. /***/ (function(module) {
  13563. "use strict";
  13564. /**
  13565. * Tries to execute a function and discards any error that occurs.
  13566. * @param {Function} fn - Function that might or might not throw an error.
  13567. * @returns {?*} Return-value of the function when no error occurred.
  13568. */
  13569. module.exports = function(fn) {
  13570. try { return fn() } catch (e) {}
  13571. }
  13572. /***/ }),
  13573. /***/ 954:
  13574. /***/ (function(module) {
  13575. module.exports = validateAuth;
  13576. function validateAuth(auth) {
  13577. if (typeof auth === "string") {
  13578. return;
  13579. }
  13580. if (typeof auth === "function") {
  13581. return;
  13582. }
  13583. if (auth.username && auth.password) {
  13584. return;
  13585. }
  13586. if (auth.clientId && auth.clientSecret) {
  13587. return;
  13588. }
  13589. throw new Error(`Invalid "auth" option: ${JSON.stringify(auth)}`);
  13590. }
  13591. /***/ }),
  13592. /***/ 955:
  13593. /***/ (function(module, __unusedexports, __webpack_require__) {
  13594. "use strict";
  13595. const path = __webpack_require__(622);
  13596. const childProcess = __webpack_require__(129);
  13597. const crossSpawn = __webpack_require__(20);
  13598. const stripEof = __webpack_require__(768);
  13599. const npmRunPath = __webpack_require__(621);
  13600. const isStream = __webpack_require__(323);
  13601. const _getStream = __webpack_require__(145);
  13602. const pFinally = __webpack_require__(697);
  13603. const onExit = __webpack_require__(260);
  13604. const errname = __webpack_require__(427);
  13605. const stdio = __webpack_require__(168);
  13606. const TEN_MEGABYTES = 1000 * 1000 * 10;
  13607. function handleArgs(cmd, args, opts) {
  13608. let parsed;
  13609. opts = Object.assign({
  13610. extendEnv: true,
  13611. env: {}
  13612. }, opts);
  13613. if (opts.extendEnv) {
  13614. opts.env = Object.assign({}, process.env, opts.env);
  13615. }
  13616. if (opts.__winShell === true) {
  13617. delete opts.__winShell;
  13618. parsed = {
  13619. command: cmd,
  13620. args,
  13621. options: opts,
  13622. file: cmd,
  13623. original: {
  13624. cmd,
  13625. args
  13626. }
  13627. };
  13628. } else {
  13629. parsed = crossSpawn._parse(cmd, args, opts);
  13630. }
  13631. opts = Object.assign({
  13632. maxBuffer: TEN_MEGABYTES,
  13633. buffer: true,
  13634. stripEof: true,
  13635. preferLocal: true,
  13636. localDir: parsed.options.cwd || process.cwd(),
  13637. encoding: 'utf8',
  13638. reject: true,
  13639. cleanup: true
  13640. }, parsed.options);
  13641. opts.stdio = stdio(opts);
  13642. if (opts.preferLocal) {
  13643. opts.env = npmRunPath.env(Object.assign({}, opts, {cwd: opts.localDir}));
  13644. }
  13645. if (opts.detached) {
  13646. // #115
  13647. opts.cleanup = false;
  13648. }
  13649. if (process.platform === 'win32' && path.basename(parsed.command) === 'cmd.exe') {
  13650. // #116
  13651. parsed.args.unshift('/q');
  13652. }
  13653. return {
  13654. cmd: parsed.command,
  13655. args: parsed.args,
  13656. opts,
  13657. parsed
  13658. };
  13659. }
  13660. function handleInput(spawned, input) {
  13661. if (input === null || input === undefined) {
  13662. return;
  13663. }
  13664. if (isStream(input)) {
  13665. input.pipe(spawned.stdin);
  13666. } else {
  13667. spawned.stdin.end(input);
  13668. }
  13669. }
  13670. function handleOutput(opts, val) {
  13671. if (val && opts.stripEof) {
  13672. val = stripEof(val);
  13673. }
  13674. return val;
  13675. }
  13676. function handleShell(fn, cmd, opts) {
  13677. let file = '/bin/sh';
  13678. let args = ['-c', cmd];
  13679. opts = Object.assign({}, opts);
  13680. if (process.platform === 'win32') {
  13681. opts.__winShell = true;
  13682. file = process.env.comspec || 'cmd.exe';
  13683. args = ['/s', '/c', `"${cmd}"`];
  13684. opts.windowsVerbatimArguments = true;
  13685. }
  13686. if (opts.shell) {
  13687. file = opts.shell;
  13688. delete opts.shell;
  13689. }
  13690. return fn(file, args, opts);
  13691. }
  13692. function getStream(process, stream, {encoding, buffer, maxBuffer}) {
  13693. if (!process[stream]) {
  13694. return null;
  13695. }
  13696. let ret;
  13697. if (!buffer) {
  13698. // TODO: Use `ret = util.promisify(stream.finished)(process[stream]);` when targeting Node.js 10
  13699. ret = new Promise((resolve, reject) => {
  13700. process[stream]
  13701. .once('end', resolve)
  13702. .once('error', reject);
  13703. });
  13704. } else if (encoding) {
  13705. ret = _getStream(process[stream], {
  13706. encoding,
  13707. maxBuffer
  13708. });
  13709. } else {
  13710. ret = _getStream.buffer(process[stream], {maxBuffer});
  13711. }
  13712. return ret.catch(err => {
  13713. err.stream = stream;
  13714. err.message = `${stream} ${err.message}`;
  13715. throw err;
  13716. });
  13717. }
  13718. function makeError(result, options) {
  13719. const {stdout, stderr} = result;
  13720. let err = result.error;
  13721. const {code, signal} = result;
  13722. const {parsed, joinedCmd} = options;
  13723. const timedOut = options.timedOut || false;
  13724. if (!err) {
  13725. let output = '';
  13726. if (Array.isArray(parsed.opts.stdio)) {
  13727. if (parsed.opts.stdio[2] !== 'inherit') {
  13728. output += output.length > 0 ? stderr : `\n${stderr}`;
  13729. }
  13730. if (parsed.opts.stdio[1] !== 'inherit') {
  13731. output += `\n${stdout}`;
  13732. }
  13733. } else if (parsed.opts.stdio !== 'inherit') {
  13734. output = `\n${stderr}${stdout}`;
  13735. }
  13736. err = new Error(`Command failed: ${joinedCmd}${output}`);
  13737. err.code = code < 0 ? errname(code) : code;
  13738. }
  13739. err.stdout = stdout;
  13740. err.stderr = stderr;
  13741. err.failed = true;
  13742. err.signal = signal || null;
  13743. err.cmd = joinedCmd;
  13744. err.timedOut = timedOut;
  13745. return err;
  13746. }
  13747. function joinCmd(cmd, args) {
  13748. let joinedCmd = cmd;
  13749. if (Array.isArray(args) && args.length > 0) {
  13750. joinedCmd += ' ' + args.join(' ');
  13751. }
  13752. return joinedCmd;
  13753. }
  13754. module.exports = (cmd, args, opts) => {
  13755. const parsed = handleArgs(cmd, args, opts);
  13756. const {encoding, buffer, maxBuffer} = parsed.opts;
  13757. const joinedCmd = joinCmd(cmd, args);
  13758. let spawned;
  13759. try {
  13760. spawned = childProcess.spawn(parsed.cmd, parsed.args, parsed.opts);
  13761. } catch (err) {
  13762. return Promise.reject(err);
  13763. }
  13764. let removeExitHandler;
  13765. if (parsed.opts.cleanup) {
  13766. removeExitHandler = onExit(() => {
  13767. spawned.kill();
  13768. });
  13769. }
  13770. let timeoutId = null;
  13771. let timedOut = false;
  13772. const cleanup = () => {
  13773. if (timeoutId) {
  13774. clearTimeout(timeoutId);
  13775. timeoutId = null;
  13776. }
  13777. if (removeExitHandler) {
  13778. removeExitHandler();
  13779. }
  13780. };
  13781. if (parsed.opts.timeout > 0) {
  13782. timeoutId = setTimeout(() => {
  13783. timeoutId = null;
  13784. timedOut = true;
  13785. spawned.kill(parsed.opts.killSignal);
  13786. }, parsed.opts.timeout);
  13787. }
  13788. const processDone = new Promise(resolve => {
  13789. spawned.on('exit', (code, signal) => {
  13790. cleanup();
  13791. resolve({code, signal});
  13792. });
  13793. spawned.on('error', err => {
  13794. cleanup();
  13795. resolve({error: err});
  13796. });
  13797. if (spawned.stdin) {
  13798. spawned.stdin.on('error', err => {
  13799. cleanup();
  13800. resolve({error: err});
  13801. });
  13802. }
  13803. });
  13804. function destroy() {
  13805. if (spawned.stdout) {
  13806. spawned.stdout.destroy();
  13807. }
  13808. if (spawned.stderr) {
  13809. spawned.stderr.destroy();
  13810. }
  13811. }
  13812. const handlePromise = () => pFinally(Promise.all([
  13813. processDone,
  13814. getStream(spawned, 'stdout', {encoding, buffer, maxBuffer}),
  13815. getStream(spawned, 'stderr', {encoding, buffer, maxBuffer})
  13816. ]).then(arr => {
  13817. const result = arr[0];
  13818. result.stdout = arr[1];
  13819. result.stderr = arr[2];
  13820. if (result.error || result.code !== 0 || result.signal !== null) {
  13821. const err = makeError(result, {
  13822. joinedCmd,
  13823. parsed,
  13824. timedOut
  13825. });
  13826. // TODO: missing some timeout logic for killed
  13827. // https://github.com/nodejs/node/blob/master/lib/child_process.js#L203
  13828. // err.killed = spawned.killed || killed;
  13829. err.killed = err.killed || spawned.killed;
  13830. if (!parsed.opts.reject) {
  13831. return err;
  13832. }
  13833. throw err;
  13834. }
  13835. return {
  13836. stdout: handleOutput(parsed.opts, result.stdout),
  13837. stderr: handleOutput(parsed.opts, result.stderr),
  13838. code: 0,
  13839. failed: false,
  13840. killed: false,
  13841. signal: null,
  13842. cmd: joinedCmd,
  13843. timedOut: false
  13844. };
  13845. }), destroy);
  13846. crossSpawn._enoent.hookChildProcess(spawned, parsed.parsed);
  13847. handleInput(spawned, parsed.opts.input);
  13848. spawned.then = (onfulfilled, onrejected) => handlePromise().then(onfulfilled, onrejected);
  13849. spawned.catch = onrejected => handlePromise().catch(onrejected);
  13850. return spawned;
  13851. };
  13852. // TODO: set `stderr: 'ignore'` when that option is implemented
  13853. module.exports.stdout = (...args) => module.exports(...args).then(x => x.stdout);
  13854. // TODO: set `stdout: 'ignore'` when that option is implemented
  13855. module.exports.stderr = (...args) => module.exports(...args).then(x => x.stderr);
  13856. module.exports.shell = (cmd, opts) => handleShell(module.exports, cmd, opts);
  13857. module.exports.sync = (cmd, args, opts) => {
  13858. const parsed = handleArgs(cmd, args, opts);
  13859. const joinedCmd = joinCmd(cmd, args);
  13860. if (isStream(parsed.opts.input)) {
  13861. throw new TypeError('The `input` option cannot be a stream in sync mode');
  13862. }
  13863. const result = childProcess.spawnSync(parsed.cmd, parsed.args, parsed.opts);
  13864. result.code = result.status;
  13865. if (result.error || result.status !== 0 || result.signal !== null) {
  13866. const err = makeError(result, {
  13867. joinedCmd,
  13868. parsed
  13869. });
  13870. if (!parsed.opts.reject) {
  13871. return err;
  13872. }
  13873. throw err;
  13874. }
  13875. return {
  13876. stdout: handleOutput(parsed.opts, result.stdout),
  13877. stderr: handleOutput(parsed.opts, result.stderr),
  13878. code: 0,
  13879. failed: false,
  13880. signal: null,
  13881. cmd: joinedCmd,
  13882. timedOut: false
  13883. };
  13884. };
  13885. module.exports.shellSync = (cmd, opts) => handleShell(module.exports.sync, cmd, opts);
  13886. /***/ }),
  13887. /***/ 966:
  13888. /***/ (function(module, __unusedexports, __webpack_require__) {
  13889. "use strict";
  13890. const {PassThrough} = __webpack_require__(413);
  13891. module.exports = options => {
  13892. options = Object.assign({}, options);
  13893. const {array} = options;
  13894. let {encoding} = options;
  13895. const buffer = encoding === 'buffer';
  13896. let objectMode = false;
  13897. if (array) {
  13898. objectMode = !(encoding || buffer);
  13899. } else {
  13900. encoding = encoding || 'utf8';
  13901. }
  13902. if (buffer) {
  13903. encoding = null;
  13904. }
  13905. let len = 0;
  13906. const ret = [];
  13907. const stream = new PassThrough({objectMode});
  13908. if (encoding) {
  13909. stream.setEncoding(encoding);
  13910. }
  13911. stream.on('data', chunk => {
  13912. ret.push(chunk);
  13913. if (objectMode) {
  13914. len = ret.length;
  13915. } else {
  13916. len += chunk.length;
  13917. }
  13918. });
  13919. stream.getBufferedValue = () => {
  13920. if (array) {
  13921. return ret;
  13922. }
  13923. return buffer ? Buffer.concat(ret, len) : ret.join('');
  13924. };
  13925. stream.getBufferedLength = () => len;
  13926. return stream;
  13927. };
  13928. /***/ }),
  13929. /***/ 969:
  13930. /***/ (function(module, __unusedexports, __webpack_require__) {
  13931. var wrappy = __webpack_require__(11)
  13932. module.exports = wrappy(once)
  13933. module.exports.strict = wrappy(onceStrict)
  13934. once.proto = once(function () {
  13935. Object.defineProperty(Function.prototype, 'once', {
  13936. value: function () {
  13937. return once(this)
  13938. },
  13939. configurable: true
  13940. })
  13941. Object.defineProperty(Function.prototype, 'onceStrict', {
  13942. value: function () {
  13943. return onceStrict(this)
  13944. },
  13945. configurable: true
  13946. })
  13947. })
  13948. function once (fn) {
  13949. var f = function () {
  13950. if (f.called) return f.value
  13951. f.called = true
  13952. return f.value = fn.apply(this, arguments)
  13953. }
  13954. f.called = false
  13955. return f
  13956. }
  13957. function onceStrict (fn) {
  13958. var f = function () {
  13959. if (f.called)
  13960. throw new Error(f.onceError)
  13961. f.called = true
  13962. return f.value = fn.apply(this, arguments)
  13963. }
  13964. var name = fn.name || 'Function wrapped with `once`'
  13965. f.onceError = name + " shouldn't be called more than once"
  13966. f.called = false
  13967. return f
  13968. }
  13969. /***/ }),
  13970. /***/ 986:
  13971. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  13972. "use strict";
  13973. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  13974. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  13975. return new (P || (P = Promise))(function (resolve, reject) {
  13976. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  13977. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  13978. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  13979. step((generator = generator.apply(thisArg, _arguments || [])).next());
  13980. });
  13981. };
  13982. Object.defineProperty(exports, "__esModule", { value: true });
  13983. const tr = __webpack_require__(9);
  13984. /**
  13985. * Exec a command.
  13986. * Output will be streamed to the live console.
  13987. * Returns promise with return code
  13988. *
  13989. * @param commandLine command to execute (can include additional args). Must be correctly escaped.
  13990. * @param args optional arguments for tool. Escaping is handled by the lib.
  13991. * @param options optional exec options. See ExecOptions
  13992. * @returns Promise<number> exit code
  13993. */
  13994. function exec(commandLine, args, options) {
  13995. return __awaiter(this, void 0, void 0, function* () {
  13996. const commandArgs = tr.argStringToArray(commandLine);
  13997. if (commandArgs.length === 0) {
  13998. throw new Error(`Parameter 'commandLine' cannot be null or empty.`);
  13999. }
  14000. // Path to tool to execute should be first arg
  14001. const toolPath = commandArgs[0];
  14002. args = commandArgs.slice(1).concat(args || []);
  14003. const runner = new tr.ToolRunner(toolPath, args, options);
  14004. return runner.exec();
  14005. });
  14006. }
  14007. exports.exec = exec;
  14008. //# sourceMappingURL=exec.js.map
  14009. /***/ }),
  14010. /***/ 991:
  14011. /***/ (function(module, __unusedexports, __webpack_require__) {
  14012. module.exports = authenticationRequestError;
  14013. const { RequestError } = __webpack_require__(463);
  14014. function authenticationRequestError(state, error, options) {
  14015. if (!error.headers) throw error;
  14016. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  14017. // handle "2FA required" error only
  14018. if (error.status !== 401 || !otpRequired) {
  14019. throw error;
  14020. }
  14021. if (
  14022. error.status === 401 &&
  14023. otpRequired &&
  14024. error.request &&
  14025. error.request.headers["x-github-otp"]
  14026. ) {
  14027. if (state.otp) {
  14028. delete state.otp; // no longer valid, request again
  14029. } else {
  14030. throw new RequestError(
  14031. "Invalid one-time password for two-factor authentication",
  14032. 401,
  14033. {
  14034. headers: error.headers,
  14035. request: options
  14036. }
  14037. );
  14038. }
  14039. }
  14040. if (typeof state.auth.on2fa !== "function") {
  14041. throw new RequestError(
  14042. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  14043. 401,
  14044. {
  14045. headers: error.headers,
  14046. request: options
  14047. }
  14048. );
  14049. }
  14050. return Promise.resolve()
  14051. .then(() => {
  14052. return state.auth.on2fa();
  14053. })
  14054. .then(oneTimePassword => {
  14055. const newOptions = Object.assign(options, {
  14056. headers: Object.assign(options.headers, {
  14057. "x-github-otp": oneTimePassword
  14058. })
  14059. });
  14060. return state.octokit.request(newOptions).then(response => {
  14061. // If OTP still valid, then persist it for following requests
  14062. state.otp = oneTimePassword;
  14063. return response;
  14064. });
  14065. });
  14066. }
  14067. /***/ })
  14068. /******/ });