index.js 636 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969
  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. /***/ 81:
  1164. /***/ (function(module, exports, __webpack_require__) {
  1165. /**
  1166. * Module dependencies.
  1167. */
  1168. const tty = __webpack_require__(867);
  1169. const util = __webpack_require__(669);
  1170. /**
  1171. * This is the Node.js implementation of `debug()`.
  1172. */
  1173. exports.init = init;
  1174. exports.log = log;
  1175. exports.formatArgs = formatArgs;
  1176. exports.save = save;
  1177. exports.load = load;
  1178. exports.useColors = useColors;
  1179. /**
  1180. * Colors.
  1181. */
  1182. exports.colors = [6, 2, 3, 4, 5, 1];
  1183. try {
  1184. // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)
  1185. // eslint-disable-next-line import/no-extraneous-dependencies
  1186. const supportsColor = __webpack_require__(247);
  1187. if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
  1188. exports.colors = [
  1189. 20,
  1190. 21,
  1191. 26,
  1192. 27,
  1193. 32,
  1194. 33,
  1195. 38,
  1196. 39,
  1197. 40,
  1198. 41,
  1199. 42,
  1200. 43,
  1201. 44,
  1202. 45,
  1203. 56,
  1204. 57,
  1205. 62,
  1206. 63,
  1207. 68,
  1208. 69,
  1209. 74,
  1210. 75,
  1211. 76,
  1212. 77,
  1213. 78,
  1214. 79,
  1215. 80,
  1216. 81,
  1217. 92,
  1218. 93,
  1219. 98,
  1220. 99,
  1221. 112,
  1222. 113,
  1223. 128,
  1224. 129,
  1225. 134,
  1226. 135,
  1227. 148,
  1228. 149,
  1229. 160,
  1230. 161,
  1231. 162,
  1232. 163,
  1233. 164,
  1234. 165,
  1235. 166,
  1236. 167,
  1237. 168,
  1238. 169,
  1239. 170,
  1240. 171,
  1241. 172,
  1242. 173,
  1243. 178,
  1244. 179,
  1245. 184,
  1246. 185,
  1247. 196,
  1248. 197,
  1249. 198,
  1250. 199,
  1251. 200,
  1252. 201,
  1253. 202,
  1254. 203,
  1255. 204,
  1256. 205,
  1257. 206,
  1258. 207,
  1259. 208,
  1260. 209,
  1261. 214,
  1262. 215,
  1263. 220,
  1264. 221
  1265. ];
  1266. }
  1267. } catch (error) {
  1268. // Swallow - we only care if `supports-color` is available; it doesn't have to be.
  1269. }
  1270. /**
  1271. * Build up the default `inspectOpts` object from the environment variables.
  1272. *
  1273. * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
  1274. */
  1275. exports.inspectOpts = Object.keys(process.env).filter(key => {
  1276. return /^debug_/i.test(key);
  1277. }).reduce((obj, key) => {
  1278. // Camel-case
  1279. const prop = key
  1280. .substring(6)
  1281. .toLowerCase()
  1282. .replace(/_([a-z])/g, (_, k) => {
  1283. return k.toUpperCase();
  1284. });
  1285. // Coerce string value into JS value
  1286. let val = process.env[key];
  1287. if (/^(yes|on|true|enabled)$/i.test(val)) {
  1288. val = true;
  1289. } else if (/^(no|off|false|disabled)$/i.test(val)) {
  1290. val = false;
  1291. } else if (val === 'null') {
  1292. val = null;
  1293. } else {
  1294. val = Number(val);
  1295. }
  1296. obj[prop] = val;
  1297. return obj;
  1298. }, {});
  1299. /**
  1300. * Is stdout a TTY? Colored output is enabled when `true`.
  1301. */
  1302. function useColors() {
  1303. return 'colors' in exports.inspectOpts ?
  1304. Boolean(exports.inspectOpts.colors) :
  1305. tty.isatty(process.stderr.fd);
  1306. }
  1307. /**
  1308. * Adds ANSI color escape codes if enabled.
  1309. *
  1310. * @api public
  1311. */
  1312. function formatArgs(args) {
  1313. const {namespace: name, useColors} = this;
  1314. if (useColors) {
  1315. const c = this.color;
  1316. const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c);
  1317. const prefix = ` ${colorCode};1m${name} \u001B[0m`;
  1318. args[0] = prefix + args[0].split('\n').join('\n' + prefix);
  1319. args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m');
  1320. } else {
  1321. args[0] = getDate() + name + ' ' + args[0];
  1322. }
  1323. }
  1324. function getDate() {
  1325. if (exports.inspectOpts.hideDate) {
  1326. return '';
  1327. }
  1328. return new Date().toISOString() + ' ';
  1329. }
  1330. /**
  1331. * Invokes `util.format()` with the specified arguments and writes to stderr.
  1332. */
  1333. function log(...args) {
  1334. return process.stderr.write(util.format(...args) + '\n');
  1335. }
  1336. /**
  1337. * Save `namespaces`.
  1338. *
  1339. * @param {String} namespaces
  1340. * @api private
  1341. */
  1342. function save(namespaces) {
  1343. if (namespaces) {
  1344. process.env.DEBUG = namespaces;
  1345. } else {
  1346. // If you set a process.env field to null or undefined, it gets cast to the
  1347. // string 'null' or 'undefined'. Just delete instead.
  1348. delete process.env.DEBUG;
  1349. }
  1350. }
  1351. /**
  1352. * Load `namespaces`.
  1353. *
  1354. * @return {String} returns the previously persisted debug modes
  1355. * @api private
  1356. */
  1357. function load() {
  1358. return process.env.DEBUG;
  1359. }
  1360. /**
  1361. * Init logic for `debug` instances.
  1362. *
  1363. * Create a new `inspectOpts` object in case `useColors` is set
  1364. * differently for a particular `debug` instance.
  1365. */
  1366. function init(debug) {
  1367. debug.inspectOpts = {};
  1368. const keys = Object.keys(exports.inspectOpts);
  1369. for (let i = 0; i < keys.length; i++) {
  1370. debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
  1371. }
  1372. }
  1373. module.exports = __webpack_require__(486)(exports);
  1374. const {formatters} = module.exports;
  1375. /**
  1376. * Map %o to `util.inspect()`, all on a single line.
  1377. */
  1378. formatters.o = function (v) {
  1379. this.inspectOpts.colors = this.useColors;
  1380. return util.inspect(v, this.inspectOpts)
  1381. .replace(/\s*\n\s*/g, ' ');
  1382. };
  1383. /**
  1384. * Map %O to `util.inspect()`, allowing multiple lines if needed.
  1385. */
  1386. formatters.O = function (v) {
  1387. this.inspectOpts.colors = this.useColors;
  1388. return util.inspect(v, this.inspectOpts);
  1389. };
  1390. /***/ }),
  1391. /***/ 87:
  1392. /***/ (function(module) {
  1393. module.exports = require("os");
  1394. /***/ }),
  1395. /***/ 118:
  1396. /***/ (function(module, __unusedexports, __webpack_require__) {
  1397. "use strict";
  1398. const os = __webpack_require__(87);
  1399. const nameMap = new Map([
  1400. [19, 'Catalina'],
  1401. [18, 'Mojave'],
  1402. [17, 'High Sierra'],
  1403. [16, 'Sierra'],
  1404. [15, 'El Capitan'],
  1405. [14, 'Yosemite'],
  1406. [13, 'Mavericks'],
  1407. [12, 'Mountain Lion'],
  1408. [11, 'Lion'],
  1409. [10, 'Snow Leopard'],
  1410. [9, 'Leopard'],
  1411. [8, 'Tiger'],
  1412. [7, 'Panther'],
  1413. [6, 'Jaguar'],
  1414. [5, 'Puma']
  1415. ]);
  1416. const macosRelease = release => {
  1417. release = Number((release || os.release()).split('.')[0]);
  1418. return {
  1419. name: nameMap.get(release),
  1420. version: '10.' + (release - 4)
  1421. };
  1422. };
  1423. module.exports = macosRelease;
  1424. // TODO: remove this in the next major version
  1425. module.exports.default = macosRelease;
  1426. /***/ }),
  1427. /***/ 126:
  1428. /***/ (function(module) {
  1429. /**
  1430. * lodash (Custom Build) <https://lodash.com/>
  1431. * Build: `lodash modularize exports="npm" -o ./`
  1432. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  1433. * Released under MIT license <https://lodash.com/license>
  1434. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1435. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1436. */
  1437. /** Used as the size to enable large array optimizations. */
  1438. var LARGE_ARRAY_SIZE = 200;
  1439. /** Used to stand-in for `undefined` hash values. */
  1440. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1441. /** Used as references for various `Number` constants. */
  1442. var INFINITY = 1 / 0;
  1443. /** `Object#toString` result references. */
  1444. var funcTag = '[object Function]',
  1445. genTag = '[object GeneratorFunction]';
  1446. /**
  1447. * Used to match `RegExp`
  1448. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1449. */
  1450. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  1451. /** Used to detect host constructors (Safari). */
  1452. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1453. /** Detect free variable `global` from Node.js. */
  1454. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  1455. /** Detect free variable `self`. */
  1456. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1457. /** Used as a reference to the global object. */
  1458. var root = freeGlobal || freeSelf || Function('return this')();
  1459. /**
  1460. * A specialized version of `_.includes` for arrays without support for
  1461. * specifying an index to search from.
  1462. *
  1463. * @private
  1464. * @param {Array} [array] The array to inspect.
  1465. * @param {*} target The value to search for.
  1466. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1467. */
  1468. function arrayIncludes(array, value) {
  1469. var length = array ? array.length : 0;
  1470. return !!length && baseIndexOf(array, value, 0) > -1;
  1471. }
  1472. /**
  1473. * This function is like `arrayIncludes` except that it accepts a comparator.
  1474. *
  1475. * @private
  1476. * @param {Array} [array] The array to inspect.
  1477. * @param {*} target The value to search for.
  1478. * @param {Function} comparator The comparator invoked per element.
  1479. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1480. */
  1481. function arrayIncludesWith(array, value, comparator) {
  1482. var index = -1,
  1483. length = array ? array.length : 0;
  1484. while (++index < length) {
  1485. if (comparator(value, array[index])) {
  1486. return true;
  1487. }
  1488. }
  1489. return false;
  1490. }
  1491. /**
  1492. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1493. * support for iteratee shorthands.
  1494. *
  1495. * @private
  1496. * @param {Array} array The array to inspect.
  1497. * @param {Function} predicate The function invoked per iteration.
  1498. * @param {number} fromIndex The index to search from.
  1499. * @param {boolean} [fromRight] Specify iterating from right to left.
  1500. * @returns {number} Returns the index of the matched value, else `-1`.
  1501. */
  1502. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  1503. var length = array.length,
  1504. index = fromIndex + (fromRight ? 1 : -1);
  1505. while ((fromRight ? index-- : ++index < length)) {
  1506. if (predicate(array[index], index, array)) {
  1507. return index;
  1508. }
  1509. }
  1510. return -1;
  1511. }
  1512. /**
  1513. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  1514. *
  1515. * @private
  1516. * @param {Array} array The array to inspect.
  1517. * @param {*} value The value to search for.
  1518. * @param {number} fromIndex The index to search from.
  1519. * @returns {number} Returns the index of the matched value, else `-1`.
  1520. */
  1521. function baseIndexOf(array, value, fromIndex) {
  1522. if (value !== value) {
  1523. return baseFindIndex(array, baseIsNaN, fromIndex);
  1524. }
  1525. var index = fromIndex - 1,
  1526. length = array.length;
  1527. while (++index < length) {
  1528. if (array[index] === value) {
  1529. return index;
  1530. }
  1531. }
  1532. return -1;
  1533. }
  1534. /**
  1535. * The base implementation of `_.isNaN` without support for number objects.
  1536. *
  1537. * @private
  1538. * @param {*} value The value to check.
  1539. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  1540. */
  1541. function baseIsNaN(value) {
  1542. return value !== value;
  1543. }
  1544. /**
  1545. * Checks if a cache value for `key` exists.
  1546. *
  1547. * @private
  1548. * @param {Object} cache The cache to query.
  1549. * @param {string} key The key of the entry to check.
  1550. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1551. */
  1552. function cacheHas(cache, key) {
  1553. return cache.has(key);
  1554. }
  1555. /**
  1556. * Gets the value at `key` of `object`.
  1557. *
  1558. * @private
  1559. * @param {Object} [object] The object to query.
  1560. * @param {string} key The key of the property to get.
  1561. * @returns {*} Returns the property value.
  1562. */
  1563. function getValue(object, key) {
  1564. return object == null ? undefined : object[key];
  1565. }
  1566. /**
  1567. * Checks if `value` is a host object in IE < 9.
  1568. *
  1569. * @private
  1570. * @param {*} value The value to check.
  1571. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  1572. */
  1573. function isHostObject(value) {
  1574. // Many host objects are `Object` objects that can coerce to strings
  1575. // despite having improperly defined `toString` methods.
  1576. var result = false;
  1577. if (value != null && typeof value.toString != 'function') {
  1578. try {
  1579. result = !!(value + '');
  1580. } catch (e) {}
  1581. }
  1582. return result;
  1583. }
  1584. /**
  1585. * Converts `set` to an array of its values.
  1586. *
  1587. * @private
  1588. * @param {Object} set The set to convert.
  1589. * @returns {Array} Returns the values.
  1590. */
  1591. function setToArray(set) {
  1592. var index = -1,
  1593. result = Array(set.size);
  1594. set.forEach(function(value) {
  1595. result[++index] = value;
  1596. });
  1597. return result;
  1598. }
  1599. /** Used for built-in method references. */
  1600. var arrayProto = Array.prototype,
  1601. funcProto = Function.prototype,
  1602. objectProto = Object.prototype;
  1603. /** Used to detect overreaching core-js shims. */
  1604. var coreJsData = root['__core-js_shared__'];
  1605. /** Used to detect methods masquerading as native. */
  1606. var maskSrcKey = (function() {
  1607. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  1608. return uid ? ('Symbol(src)_1.' + uid) : '';
  1609. }());
  1610. /** Used to resolve the decompiled source of functions. */
  1611. var funcToString = funcProto.toString;
  1612. /** Used to check objects for own properties. */
  1613. var hasOwnProperty = objectProto.hasOwnProperty;
  1614. /**
  1615. * Used to resolve the
  1616. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  1617. * of values.
  1618. */
  1619. var objectToString = objectProto.toString;
  1620. /** Used to detect if a method is native. */
  1621. var reIsNative = RegExp('^' +
  1622. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  1623. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  1624. );
  1625. /** Built-in value references. */
  1626. var splice = arrayProto.splice;
  1627. /* Built-in method references that are verified to be native. */
  1628. var Map = getNative(root, 'Map'),
  1629. Set = getNative(root, 'Set'),
  1630. nativeCreate = getNative(Object, 'create');
  1631. /**
  1632. * Creates a hash object.
  1633. *
  1634. * @private
  1635. * @constructor
  1636. * @param {Array} [entries] The key-value pairs to cache.
  1637. */
  1638. function Hash(entries) {
  1639. var index = -1,
  1640. length = entries ? entries.length : 0;
  1641. this.clear();
  1642. while (++index < length) {
  1643. var entry = entries[index];
  1644. this.set(entry[0], entry[1]);
  1645. }
  1646. }
  1647. /**
  1648. * Removes all key-value entries from the hash.
  1649. *
  1650. * @private
  1651. * @name clear
  1652. * @memberOf Hash
  1653. */
  1654. function hashClear() {
  1655. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  1656. }
  1657. /**
  1658. * Removes `key` and its value from the hash.
  1659. *
  1660. * @private
  1661. * @name delete
  1662. * @memberOf Hash
  1663. * @param {Object} hash The hash to modify.
  1664. * @param {string} key The key of the value to remove.
  1665. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1666. */
  1667. function hashDelete(key) {
  1668. return this.has(key) && delete this.__data__[key];
  1669. }
  1670. /**
  1671. * Gets the hash value for `key`.
  1672. *
  1673. * @private
  1674. * @name get
  1675. * @memberOf Hash
  1676. * @param {string} key The key of the value to get.
  1677. * @returns {*} Returns the entry value.
  1678. */
  1679. function hashGet(key) {
  1680. var data = this.__data__;
  1681. if (nativeCreate) {
  1682. var result = data[key];
  1683. return result === HASH_UNDEFINED ? undefined : result;
  1684. }
  1685. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  1686. }
  1687. /**
  1688. * Checks if a hash value for `key` exists.
  1689. *
  1690. * @private
  1691. * @name has
  1692. * @memberOf Hash
  1693. * @param {string} key The key of the entry to check.
  1694. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1695. */
  1696. function hashHas(key) {
  1697. var data = this.__data__;
  1698. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  1699. }
  1700. /**
  1701. * Sets the hash `key` to `value`.
  1702. *
  1703. * @private
  1704. * @name set
  1705. * @memberOf Hash
  1706. * @param {string} key The key of the value to set.
  1707. * @param {*} value The value to set.
  1708. * @returns {Object} Returns the hash instance.
  1709. */
  1710. function hashSet(key, value) {
  1711. var data = this.__data__;
  1712. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  1713. return this;
  1714. }
  1715. // Add methods to `Hash`.
  1716. Hash.prototype.clear = hashClear;
  1717. Hash.prototype['delete'] = hashDelete;
  1718. Hash.prototype.get = hashGet;
  1719. Hash.prototype.has = hashHas;
  1720. Hash.prototype.set = hashSet;
  1721. /**
  1722. * Creates an list cache object.
  1723. *
  1724. * @private
  1725. * @constructor
  1726. * @param {Array} [entries] The key-value pairs to cache.
  1727. */
  1728. function ListCache(entries) {
  1729. var index = -1,
  1730. length = entries ? entries.length : 0;
  1731. this.clear();
  1732. while (++index < length) {
  1733. var entry = entries[index];
  1734. this.set(entry[0], entry[1]);
  1735. }
  1736. }
  1737. /**
  1738. * Removes all key-value entries from the list cache.
  1739. *
  1740. * @private
  1741. * @name clear
  1742. * @memberOf ListCache
  1743. */
  1744. function listCacheClear() {
  1745. this.__data__ = [];
  1746. }
  1747. /**
  1748. * Removes `key` and its value from the list cache.
  1749. *
  1750. * @private
  1751. * @name delete
  1752. * @memberOf ListCache
  1753. * @param {string} key The key of the value to remove.
  1754. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1755. */
  1756. function listCacheDelete(key) {
  1757. var data = this.__data__,
  1758. index = assocIndexOf(data, key);
  1759. if (index < 0) {
  1760. return false;
  1761. }
  1762. var lastIndex = data.length - 1;
  1763. if (index == lastIndex) {
  1764. data.pop();
  1765. } else {
  1766. splice.call(data, index, 1);
  1767. }
  1768. return true;
  1769. }
  1770. /**
  1771. * Gets the list cache value for `key`.
  1772. *
  1773. * @private
  1774. * @name get
  1775. * @memberOf ListCache
  1776. * @param {string} key The key of the value to get.
  1777. * @returns {*} Returns the entry value.
  1778. */
  1779. function listCacheGet(key) {
  1780. var data = this.__data__,
  1781. index = assocIndexOf(data, key);
  1782. return index < 0 ? undefined : data[index][1];
  1783. }
  1784. /**
  1785. * Checks if a list cache value for `key` exists.
  1786. *
  1787. * @private
  1788. * @name has
  1789. * @memberOf ListCache
  1790. * @param {string} key The key of the entry to check.
  1791. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1792. */
  1793. function listCacheHas(key) {
  1794. return assocIndexOf(this.__data__, key) > -1;
  1795. }
  1796. /**
  1797. * Sets the list cache `key` to `value`.
  1798. *
  1799. * @private
  1800. * @name set
  1801. * @memberOf ListCache
  1802. * @param {string} key The key of the value to set.
  1803. * @param {*} value The value to set.
  1804. * @returns {Object} Returns the list cache instance.
  1805. */
  1806. function listCacheSet(key, value) {
  1807. var data = this.__data__,
  1808. index = assocIndexOf(data, key);
  1809. if (index < 0) {
  1810. data.push([key, value]);
  1811. } else {
  1812. data[index][1] = value;
  1813. }
  1814. return this;
  1815. }
  1816. // Add methods to `ListCache`.
  1817. ListCache.prototype.clear = listCacheClear;
  1818. ListCache.prototype['delete'] = listCacheDelete;
  1819. ListCache.prototype.get = listCacheGet;
  1820. ListCache.prototype.has = listCacheHas;
  1821. ListCache.prototype.set = listCacheSet;
  1822. /**
  1823. * Creates a map cache object to store key-value pairs.
  1824. *
  1825. * @private
  1826. * @constructor
  1827. * @param {Array} [entries] The key-value pairs to cache.
  1828. */
  1829. function MapCache(entries) {
  1830. var index = -1,
  1831. length = entries ? entries.length : 0;
  1832. this.clear();
  1833. while (++index < length) {
  1834. var entry = entries[index];
  1835. this.set(entry[0], entry[1]);
  1836. }
  1837. }
  1838. /**
  1839. * Removes all key-value entries from the map.
  1840. *
  1841. * @private
  1842. * @name clear
  1843. * @memberOf MapCache
  1844. */
  1845. function mapCacheClear() {
  1846. this.__data__ = {
  1847. 'hash': new Hash,
  1848. 'map': new (Map || ListCache),
  1849. 'string': new Hash
  1850. };
  1851. }
  1852. /**
  1853. * Removes `key` and its value from the map.
  1854. *
  1855. * @private
  1856. * @name delete
  1857. * @memberOf MapCache
  1858. * @param {string} key The key of the value to remove.
  1859. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1860. */
  1861. function mapCacheDelete(key) {
  1862. return getMapData(this, key)['delete'](key);
  1863. }
  1864. /**
  1865. * Gets the map value for `key`.
  1866. *
  1867. * @private
  1868. * @name get
  1869. * @memberOf MapCache
  1870. * @param {string} key The key of the value to get.
  1871. * @returns {*} Returns the entry value.
  1872. */
  1873. function mapCacheGet(key) {
  1874. return getMapData(this, key).get(key);
  1875. }
  1876. /**
  1877. * Checks if a map value for `key` exists.
  1878. *
  1879. * @private
  1880. * @name has
  1881. * @memberOf MapCache
  1882. * @param {string} key The key of the entry to check.
  1883. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1884. */
  1885. function mapCacheHas(key) {
  1886. return getMapData(this, key).has(key);
  1887. }
  1888. /**
  1889. * Sets the map `key` to `value`.
  1890. *
  1891. * @private
  1892. * @name set
  1893. * @memberOf MapCache
  1894. * @param {string} key The key of the value to set.
  1895. * @param {*} value The value to set.
  1896. * @returns {Object} Returns the map cache instance.
  1897. */
  1898. function mapCacheSet(key, value) {
  1899. getMapData(this, key).set(key, value);
  1900. return this;
  1901. }
  1902. // Add methods to `MapCache`.
  1903. MapCache.prototype.clear = mapCacheClear;
  1904. MapCache.prototype['delete'] = mapCacheDelete;
  1905. MapCache.prototype.get = mapCacheGet;
  1906. MapCache.prototype.has = mapCacheHas;
  1907. MapCache.prototype.set = mapCacheSet;
  1908. /**
  1909. *
  1910. * Creates an array cache object to store unique values.
  1911. *
  1912. * @private
  1913. * @constructor
  1914. * @param {Array} [values] The values to cache.
  1915. */
  1916. function SetCache(values) {
  1917. var index = -1,
  1918. length = values ? values.length : 0;
  1919. this.__data__ = new MapCache;
  1920. while (++index < length) {
  1921. this.add(values[index]);
  1922. }
  1923. }
  1924. /**
  1925. * Adds `value` to the array cache.
  1926. *
  1927. * @private
  1928. * @name add
  1929. * @memberOf SetCache
  1930. * @alias push
  1931. * @param {*} value The value to cache.
  1932. * @returns {Object} Returns the cache instance.
  1933. */
  1934. function setCacheAdd(value) {
  1935. this.__data__.set(value, HASH_UNDEFINED);
  1936. return this;
  1937. }
  1938. /**
  1939. * Checks if `value` is in the array cache.
  1940. *
  1941. * @private
  1942. * @name has
  1943. * @memberOf SetCache
  1944. * @param {*} value The value to search for.
  1945. * @returns {number} Returns `true` if `value` is found, else `false`.
  1946. */
  1947. function setCacheHas(value) {
  1948. return this.__data__.has(value);
  1949. }
  1950. // Add methods to `SetCache`.
  1951. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  1952. SetCache.prototype.has = setCacheHas;
  1953. /**
  1954. * Gets the index at which the `key` is found in `array` of key-value pairs.
  1955. *
  1956. * @private
  1957. * @param {Array} array The array to inspect.
  1958. * @param {*} key The key to search for.
  1959. * @returns {number} Returns the index of the matched value, else `-1`.
  1960. */
  1961. function assocIndexOf(array, key) {
  1962. var length = array.length;
  1963. while (length--) {
  1964. if (eq(array[length][0], key)) {
  1965. return length;
  1966. }
  1967. }
  1968. return -1;
  1969. }
  1970. /**
  1971. * The base implementation of `_.isNative` without bad shim checks.
  1972. *
  1973. * @private
  1974. * @param {*} value The value to check.
  1975. * @returns {boolean} Returns `true` if `value` is a native function,
  1976. * else `false`.
  1977. */
  1978. function baseIsNative(value) {
  1979. if (!isObject(value) || isMasked(value)) {
  1980. return false;
  1981. }
  1982. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  1983. return pattern.test(toSource(value));
  1984. }
  1985. /**
  1986. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  1987. *
  1988. * @private
  1989. * @param {Array} array The array to inspect.
  1990. * @param {Function} [iteratee] The iteratee invoked per element.
  1991. * @param {Function} [comparator] The comparator invoked per element.
  1992. * @returns {Array} Returns the new duplicate free array.
  1993. */
  1994. function baseUniq(array, iteratee, comparator) {
  1995. var index = -1,
  1996. includes = arrayIncludes,
  1997. length = array.length,
  1998. isCommon = true,
  1999. result = [],
  2000. seen = result;
  2001. if (comparator) {
  2002. isCommon = false;
  2003. includes = arrayIncludesWith;
  2004. }
  2005. else if (length >= LARGE_ARRAY_SIZE) {
  2006. var set = iteratee ? null : createSet(array);
  2007. if (set) {
  2008. return setToArray(set);
  2009. }
  2010. isCommon = false;
  2011. includes = cacheHas;
  2012. seen = new SetCache;
  2013. }
  2014. else {
  2015. seen = iteratee ? [] : result;
  2016. }
  2017. outer:
  2018. while (++index < length) {
  2019. var value = array[index],
  2020. computed = iteratee ? iteratee(value) : value;
  2021. value = (comparator || value !== 0) ? value : 0;
  2022. if (isCommon && computed === computed) {
  2023. var seenIndex = seen.length;
  2024. while (seenIndex--) {
  2025. if (seen[seenIndex] === computed) {
  2026. continue outer;
  2027. }
  2028. }
  2029. if (iteratee) {
  2030. seen.push(computed);
  2031. }
  2032. result.push(value);
  2033. }
  2034. else if (!includes(seen, computed, comparator)) {
  2035. if (seen !== result) {
  2036. seen.push(computed);
  2037. }
  2038. result.push(value);
  2039. }
  2040. }
  2041. return result;
  2042. }
  2043. /**
  2044. * Creates a set object of `values`.
  2045. *
  2046. * @private
  2047. * @param {Array} values The values to add to the set.
  2048. * @returns {Object} Returns the new set.
  2049. */
  2050. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  2051. return new Set(values);
  2052. };
  2053. /**
  2054. * Gets the data for `map`.
  2055. *
  2056. * @private
  2057. * @param {Object} map The map to query.
  2058. * @param {string} key The reference key.
  2059. * @returns {*} Returns the map data.
  2060. */
  2061. function getMapData(map, key) {
  2062. var data = map.__data__;
  2063. return isKeyable(key)
  2064. ? data[typeof key == 'string' ? 'string' : 'hash']
  2065. : data.map;
  2066. }
  2067. /**
  2068. * Gets the native function at `key` of `object`.
  2069. *
  2070. * @private
  2071. * @param {Object} object The object to query.
  2072. * @param {string} key The key of the method to get.
  2073. * @returns {*} Returns the function if it's native, else `undefined`.
  2074. */
  2075. function getNative(object, key) {
  2076. var value = getValue(object, key);
  2077. return baseIsNative(value) ? value : undefined;
  2078. }
  2079. /**
  2080. * Checks if `value` is suitable for use as unique object key.
  2081. *
  2082. * @private
  2083. * @param {*} value The value to check.
  2084. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  2085. */
  2086. function isKeyable(value) {
  2087. var type = typeof value;
  2088. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  2089. ? (value !== '__proto__')
  2090. : (value === null);
  2091. }
  2092. /**
  2093. * Checks if `func` has its source masked.
  2094. *
  2095. * @private
  2096. * @param {Function} func The function to check.
  2097. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  2098. */
  2099. function isMasked(func) {
  2100. return !!maskSrcKey && (maskSrcKey in func);
  2101. }
  2102. /**
  2103. * Converts `func` to its source code.
  2104. *
  2105. * @private
  2106. * @param {Function} func The function to process.
  2107. * @returns {string} Returns the source code.
  2108. */
  2109. function toSource(func) {
  2110. if (func != null) {
  2111. try {
  2112. return funcToString.call(func);
  2113. } catch (e) {}
  2114. try {
  2115. return (func + '');
  2116. } catch (e) {}
  2117. }
  2118. return '';
  2119. }
  2120. /**
  2121. * Creates a duplicate-free version of an array, using
  2122. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  2123. * for equality comparisons, in which only the first occurrence of each
  2124. * element is kept.
  2125. *
  2126. * @static
  2127. * @memberOf _
  2128. * @since 0.1.0
  2129. * @category Array
  2130. * @param {Array} array The array to inspect.
  2131. * @returns {Array} Returns the new duplicate free array.
  2132. * @example
  2133. *
  2134. * _.uniq([2, 1, 2]);
  2135. * // => [2, 1]
  2136. */
  2137. function uniq(array) {
  2138. return (array && array.length)
  2139. ? baseUniq(array)
  2140. : [];
  2141. }
  2142. /**
  2143. * Performs a
  2144. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  2145. * comparison between two values to determine if they are equivalent.
  2146. *
  2147. * @static
  2148. * @memberOf _
  2149. * @since 4.0.0
  2150. * @category Lang
  2151. * @param {*} value The value to compare.
  2152. * @param {*} other The other value to compare.
  2153. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  2154. * @example
  2155. *
  2156. * var object = { 'a': 1 };
  2157. * var other = { 'a': 1 };
  2158. *
  2159. * _.eq(object, object);
  2160. * // => true
  2161. *
  2162. * _.eq(object, other);
  2163. * // => false
  2164. *
  2165. * _.eq('a', 'a');
  2166. * // => true
  2167. *
  2168. * _.eq('a', Object('a'));
  2169. * // => false
  2170. *
  2171. * _.eq(NaN, NaN);
  2172. * // => true
  2173. */
  2174. function eq(value, other) {
  2175. return value === other || (value !== value && other !== other);
  2176. }
  2177. /**
  2178. * Checks if `value` is classified as a `Function` object.
  2179. *
  2180. * @static
  2181. * @memberOf _
  2182. * @since 0.1.0
  2183. * @category Lang
  2184. * @param {*} value The value to check.
  2185. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  2186. * @example
  2187. *
  2188. * _.isFunction(_);
  2189. * // => true
  2190. *
  2191. * _.isFunction(/abc/);
  2192. * // => false
  2193. */
  2194. function isFunction(value) {
  2195. // The use of `Object#toString` avoids issues with the `typeof` operator
  2196. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  2197. var tag = isObject(value) ? objectToString.call(value) : '';
  2198. return tag == funcTag || tag == genTag;
  2199. }
  2200. /**
  2201. * Checks if `value` is the
  2202. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  2203. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  2204. *
  2205. * @static
  2206. * @memberOf _
  2207. * @since 0.1.0
  2208. * @category Lang
  2209. * @param {*} value The value to check.
  2210. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  2211. * @example
  2212. *
  2213. * _.isObject({});
  2214. * // => true
  2215. *
  2216. * _.isObject([1, 2, 3]);
  2217. * // => true
  2218. *
  2219. * _.isObject(_.noop);
  2220. * // => true
  2221. *
  2222. * _.isObject(null);
  2223. * // => false
  2224. */
  2225. function isObject(value) {
  2226. var type = typeof value;
  2227. return !!value && (type == 'object' || type == 'function');
  2228. }
  2229. /**
  2230. * This method returns `undefined`.
  2231. *
  2232. * @static
  2233. * @memberOf _
  2234. * @since 2.3.0
  2235. * @category Util
  2236. * @example
  2237. *
  2238. * _.times(2, _.noop);
  2239. * // => [undefined, undefined]
  2240. */
  2241. function noop() {
  2242. // No operation performed.
  2243. }
  2244. module.exports = uniq;
  2245. /***/ }),
  2246. /***/ 129:
  2247. /***/ (function(module) {
  2248. module.exports = require("child_process");
  2249. /***/ }),
  2250. /***/ 139:
  2251. /***/ (function(module, __unusedexports, __webpack_require__) {
  2252. // Unique ID creation requires a high quality random # generator. In node.js
  2253. // this is pretty straight-forward - we use the crypto API.
  2254. var crypto = __webpack_require__(417);
  2255. module.exports = function nodeRNG() {
  2256. return crypto.randomBytes(16);
  2257. };
  2258. /***/ }),
  2259. /***/ 141:
  2260. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2261. "use strict";
  2262. var net = __webpack_require__(631);
  2263. var tls = __webpack_require__(16);
  2264. var http = __webpack_require__(605);
  2265. var https = __webpack_require__(211);
  2266. var events = __webpack_require__(614);
  2267. var assert = __webpack_require__(357);
  2268. var util = __webpack_require__(669);
  2269. exports.httpOverHttp = httpOverHttp;
  2270. exports.httpsOverHttp = httpsOverHttp;
  2271. exports.httpOverHttps = httpOverHttps;
  2272. exports.httpsOverHttps = httpsOverHttps;
  2273. function httpOverHttp(options) {
  2274. var agent = new TunnelingAgent(options);
  2275. agent.request = http.request;
  2276. return agent;
  2277. }
  2278. function httpsOverHttp(options) {
  2279. var agent = new TunnelingAgent(options);
  2280. agent.request = http.request;
  2281. agent.createSocket = createSecureSocket;
  2282. return agent;
  2283. }
  2284. function httpOverHttps(options) {
  2285. var agent = new TunnelingAgent(options);
  2286. agent.request = https.request;
  2287. return agent;
  2288. }
  2289. function httpsOverHttps(options) {
  2290. var agent = new TunnelingAgent(options);
  2291. agent.request = https.request;
  2292. agent.createSocket = createSecureSocket;
  2293. return agent;
  2294. }
  2295. function TunnelingAgent(options) {
  2296. var self = this;
  2297. self.options = options || {};
  2298. self.proxyOptions = self.options.proxy || {};
  2299. self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;
  2300. self.requests = [];
  2301. self.sockets = [];
  2302. self.on('free', function onFree(socket, host, port, localAddress) {
  2303. var options = toOptions(host, port, localAddress);
  2304. for (var i = 0, len = self.requests.length; i < len; ++i) {
  2305. var pending = self.requests[i];
  2306. if (pending.host === options.host && pending.port === options.port) {
  2307. // Detect the request to connect same origin server,
  2308. // reuse the connection.
  2309. self.requests.splice(i, 1);
  2310. pending.request.onSocket(socket);
  2311. return;
  2312. }
  2313. }
  2314. socket.destroy();
  2315. self.removeSocket(socket);
  2316. });
  2317. }
  2318. util.inherits(TunnelingAgent, events.EventEmitter);
  2319. TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {
  2320. var self = this;
  2321. var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));
  2322. if (self.sockets.length >= this.maxSockets) {
  2323. // We are over limit so we'll add it to the queue.
  2324. self.requests.push(options);
  2325. return;
  2326. }
  2327. // If we are under maxSockets create a new one.
  2328. self.createSocket(options, function(socket) {
  2329. socket.on('free', onFree);
  2330. socket.on('close', onCloseOrRemove);
  2331. socket.on('agentRemove', onCloseOrRemove);
  2332. req.onSocket(socket);
  2333. function onFree() {
  2334. self.emit('free', socket, options);
  2335. }
  2336. function onCloseOrRemove(err) {
  2337. self.removeSocket(socket);
  2338. socket.removeListener('free', onFree);
  2339. socket.removeListener('close', onCloseOrRemove);
  2340. socket.removeListener('agentRemove', onCloseOrRemove);
  2341. }
  2342. });
  2343. };
  2344. TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
  2345. var self = this;
  2346. var placeholder = {};
  2347. self.sockets.push(placeholder);
  2348. var connectOptions = mergeOptions({}, self.proxyOptions, {
  2349. method: 'CONNECT',
  2350. path: options.host + ':' + options.port,
  2351. agent: false
  2352. });
  2353. if (connectOptions.proxyAuth) {
  2354. connectOptions.headers = connectOptions.headers || {};
  2355. connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
  2356. new Buffer(connectOptions.proxyAuth).toString('base64');
  2357. }
  2358. debug('making CONNECT request');
  2359. var connectReq = self.request(connectOptions);
  2360. connectReq.useChunkedEncodingByDefault = false; // for v0.6
  2361. connectReq.once('response', onResponse); // for v0.6
  2362. connectReq.once('upgrade', onUpgrade); // for v0.6
  2363. connectReq.once('connect', onConnect); // for v0.7 or later
  2364. connectReq.once('error', onError);
  2365. connectReq.end();
  2366. function onResponse(res) {
  2367. // Very hacky. This is necessary to avoid http-parser leaks.
  2368. res.upgrade = true;
  2369. }
  2370. function onUpgrade(res, socket, head) {
  2371. // Hacky.
  2372. process.nextTick(function() {
  2373. onConnect(res, socket, head);
  2374. });
  2375. }
  2376. function onConnect(res, socket, head) {
  2377. connectReq.removeAllListeners();
  2378. socket.removeAllListeners();
  2379. if (res.statusCode === 200) {
  2380. assert.equal(head.length, 0);
  2381. debug('tunneling connection has established');
  2382. self.sockets[self.sockets.indexOf(placeholder)] = socket;
  2383. cb(socket);
  2384. } else {
  2385. debug('tunneling socket could not be established, statusCode=%d',
  2386. res.statusCode);
  2387. var error = new Error('tunneling socket could not be established, ' +
  2388. 'statusCode=' + res.statusCode);
  2389. error.code = 'ECONNRESET';
  2390. options.request.emit('error', error);
  2391. self.removeSocket(placeholder);
  2392. }
  2393. }
  2394. function onError(cause) {
  2395. connectReq.removeAllListeners();
  2396. debug('tunneling socket could not be established, cause=%s\n',
  2397. cause.message, cause.stack);
  2398. var error = new Error('tunneling socket could not be established, ' +
  2399. 'cause=' + cause.message);
  2400. error.code = 'ECONNRESET';
  2401. options.request.emit('error', error);
  2402. self.removeSocket(placeholder);
  2403. }
  2404. };
  2405. TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
  2406. var pos = this.sockets.indexOf(socket)
  2407. if (pos === -1) {
  2408. return;
  2409. }
  2410. this.sockets.splice(pos, 1);
  2411. var pending = this.requests.shift();
  2412. if (pending) {
  2413. // If we have pending requests and a socket gets closed a new one
  2414. // needs to be created to take over in the pool for the one that closed.
  2415. this.createSocket(pending, function(socket) {
  2416. pending.request.onSocket(socket);
  2417. });
  2418. }
  2419. };
  2420. function createSecureSocket(options, cb) {
  2421. var self = this;
  2422. TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
  2423. var hostHeader = options.request.getHeader('host');
  2424. var tlsOptions = mergeOptions({}, self.options, {
  2425. socket: socket,
  2426. servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host
  2427. });
  2428. // 0 is dummy port for v0.6
  2429. var secureSocket = tls.connect(0, tlsOptions);
  2430. self.sockets[self.sockets.indexOf(socket)] = secureSocket;
  2431. cb(secureSocket);
  2432. });
  2433. }
  2434. function toOptions(host, port, localAddress) {
  2435. if (typeof host === 'string') { // since v0.10
  2436. return {
  2437. host: host,
  2438. port: port,
  2439. localAddress: localAddress
  2440. };
  2441. }
  2442. return host; // for v0.11 or later
  2443. }
  2444. function mergeOptions(target) {
  2445. for (var i = 1, len = arguments.length; i < len; ++i) {
  2446. var overrides = arguments[i];
  2447. if (typeof overrides === 'object') {
  2448. var keys = Object.keys(overrides);
  2449. for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
  2450. var k = keys[j];
  2451. if (overrides[k] !== undefined) {
  2452. target[k] = overrides[k];
  2453. }
  2454. }
  2455. }
  2456. }
  2457. return target;
  2458. }
  2459. var debug;
  2460. if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
  2461. debug = function() {
  2462. var args = Array.prototype.slice.call(arguments);
  2463. if (typeof args[0] === 'string') {
  2464. args[0] = 'TUNNEL: ' + args[0];
  2465. } else {
  2466. args.unshift('TUNNEL:');
  2467. }
  2468. console.error.apply(console, args);
  2469. }
  2470. } else {
  2471. debug = function() {};
  2472. }
  2473. exports.debug = debug; // for test
  2474. /***/ }),
  2475. /***/ 143:
  2476. /***/ (function(module, __unusedexports, __webpack_require__) {
  2477. module.exports = withAuthorizationPrefix;
  2478. const atob = __webpack_require__(368);
  2479. const REGEX_IS_BASIC_AUTH = /^[\w-]+:/;
  2480. function withAuthorizationPrefix(authorization) {
  2481. if (/^(basic|bearer|token) /i.test(authorization)) {
  2482. return authorization;
  2483. }
  2484. try {
  2485. if (REGEX_IS_BASIC_AUTH.test(atob(authorization))) {
  2486. return `basic ${authorization}`;
  2487. }
  2488. } catch (error) {}
  2489. if (authorization.split(/\./).length === 3) {
  2490. return `bearer ${authorization}`;
  2491. }
  2492. return `token ${authorization}`;
  2493. }
  2494. /***/ }),
  2495. /***/ 145:
  2496. /***/ (function(module, __unusedexports, __webpack_require__) {
  2497. "use strict";
  2498. const pump = __webpack_require__(453);
  2499. const bufferStream = __webpack_require__(966);
  2500. class MaxBufferError extends Error {
  2501. constructor() {
  2502. super('maxBuffer exceeded');
  2503. this.name = 'MaxBufferError';
  2504. }
  2505. }
  2506. function getStream(inputStream, options) {
  2507. if (!inputStream) {
  2508. return Promise.reject(new Error('Expected a stream'));
  2509. }
  2510. options = Object.assign({maxBuffer: Infinity}, options);
  2511. const {maxBuffer} = options;
  2512. let stream;
  2513. return new Promise((resolve, reject) => {
  2514. const rejectPromise = error => {
  2515. if (error) { // A null check
  2516. error.bufferedData = stream.getBufferedValue();
  2517. }
  2518. reject(error);
  2519. };
  2520. stream = pump(inputStream, bufferStream(options), error => {
  2521. if (error) {
  2522. rejectPromise(error);
  2523. return;
  2524. }
  2525. resolve();
  2526. });
  2527. stream.on('data', () => {
  2528. if (stream.getBufferedLength() > maxBuffer) {
  2529. rejectPromise(new MaxBufferError());
  2530. }
  2531. });
  2532. }).then(() => stream.getBufferedValue());
  2533. }
  2534. module.exports = getStream;
  2535. module.exports.buffer = (stream, options) => getStream(stream, Object.assign({}, options, {encoding: 'buffer'}));
  2536. module.exports.array = (stream, options) => getStream(stream, Object.assign({}, options, {array: true}));
  2537. module.exports.MaxBufferError = MaxBufferError;
  2538. /***/ }),
  2539. /***/ 148:
  2540. /***/ (function(module, __unusedexports, __webpack_require__) {
  2541. module.exports = paginatePlugin;
  2542. const iterator = __webpack_require__(8);
  2543. const paginate = __webpack_require__(807);
  2544. function paginatePlugin(octokit) {
  2545. octokit.paginate = paginate.bind(null, octokit);
  2546. octokit.paginate.iterator = iterator.bind(null, octokit);
  2547. }
  2548. /***/ }),
  2549. /***/ 153:
  2550. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2551. "use strict";
  2552. var __importStar = (this && this.__importStar) || function (mod) {
  2553. if (mod && mod.__esModule) return mod;
  2554. var result = {};
  2555. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  2556. result["default"] = mod;
  2557. return result;
  2558. };
  2559. Object.defineProperty(exports, "__esModule", { value: true });
  2560. const coreCommand = __importStar(__webpack_require__(431));
  2561. /**
  2562. * Indicates whether the POST action is running
  2563. */
  2564. exports.IsPost = !!process.env['STATE_isPost'];
  2565. /**
  2566. * The repository path for the POST action. The value is empty during the MAIN action.
  2567. */
  2568. exports.RepositoryPath = process.env['STATE_repositoryPath'] || '';
  2569. /**
  2570. * Save the repository path so the POST action can retrieve the value.
  2571. */
  2572. function setRepositoryPath(repositoryPath) {
  2573. coreCommand.issueCommand('save-state', { name: 'repositoryPath' }, repositoryPath);
  2574. }
  2575. exports.setRepositoryPath = setRepositoryPath;
  2576. // Publish a variable so that when the POST action runs, it can determine it should run the cleanup logic.
  2577. // This is necessary since we don't have a separate entry point.
  2578. if (!exports.IsPost) {
  2579. coreCommand.issueCommand('save-state', { name: 'isPost' }, 'true');
  2580. }
  2581. /***/ }),
  2582. /***/ 168:
  2583. /***/ (function(module) {
  2584. "use strict";
  2585. const alias = ['stdin', 'stdout', 'stderr'];
  2586. const hasAlias = opts => alias.some(x => Boolean(opts[x]));
  2587. module.exports = opts => {
  2588. if (!opts) {
  2589. return null;
  2590. }
  2591. if (opts.stdio && hasAlias(opts)) {
  2592. throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${alias.map(x => `\`${x}\``).join(', ')}`);
  2593. }
  2594. if (typeof opts.stdio === 'string') {
  2595. return opts.stdio;
  2596. }
  2597. const stdio = opts.stdio || [];
  2598. if (!Array.isArray(stdio)) {
  2599. throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``);
  2600. }
  2601. const result = [];
  2602. const len = Math.max(stdio.length, alias.length);
  2603. for (let i = 0; i < len; i++) {
  2604. let value = null;
  2605. if (stdio[i] !== undefined) {
  2606. value = stdio[i];
  2607. } else if (opts[alias[i]] !== undefined) {
  2608. value = opts[alias[i]];
  2609. }
  2610. result[i] = value;
  2611. }
  2612. return result;
  2613. };
  2614. /***/ }),
  2615. /***/ 190:
  2616. /***/ (function(module, __unusedexports, __webpack_require__) {
  2617. module.exports = authenticationPlugin;
  2618. const beforeRequest = __webpack_require__(863);
  2619. const requestError = __webpack_require__(991);
  2620. const validate = __webpack_require__(954);
  2621. function authenticationPlugin(octokit, options) {
  2622. if (!options.auth) {
  2623. return;
  2624. }
  2625. validate(options.auth);
  2626. const state = {
  2627. octokit,
  2628. auth: options.auth
  2629. };
  2630. octokit.hook.before("request", beforeRequest.bind(null, state));
  2631. octokit.hook.error("request", requestError.bind(null, state));
  2632. }
  2633. /***/ }),
  2634. /***/ 197:
  2635. /***/ (function(module, __unusedexports, __webpack_require__) {
  2636. module.exports = isexe
  2637. isexe.sync = sync
  2638. var fs = __webpack_require__(747)
  2639. function isexe (path, options, cb) {
  2640. fs.stat(path, function (er, stat) {
  2641. cb(er, er ? false : checkStat(stat, options))
  2642. })
  2643. }
  2644. function sync (path, options) {
  2645. return checkStat(fs.statSync(path), options)
  2646. }
  2647. function checkStat (stat, options) {
  2648. return stat.isFile() && checkMode(stat, options)
  2649. }
  2650. function checkMode (stat, options) {
  2651. var mod = stat.mode
  2652. var uid = stat.uid
  2653. var gid = stat.gid
  2654. var myUid = options.uid !== undefined ?
  2655. options.uid : process.getuid && process.getuid()
  2656. var myGid = options.gid !== undefined ?
  2657. options.gid : process.getgid && process.getgid()
  2658. var u = parseInt('100', 8)
  2659. var g = parseInt('010', 8)
  2660. var o = parseInt('001', 8)
  2661. var ug = u | g
  2662. var ret = (mod & o) ||
  2663. (mod & g) && gid === myGid ||
  2664. (mod & u) && uid === myUid ||
  2665. (mod & ug) && myUid === 0
  2666. return ret
  2667. }
  2668. /***/ }),
  2669. /***/ 198:
  2670. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2671. "use strict";
  2672. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2673. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2674. return new (P || (P = Promise))(function (resolve, reject) {
  2675. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2676. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2677. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2678. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2679. });
  2680. };
  2681. var __importStar = (this && this.__importStar) || function (mod) {
  2682. if (mod && mod.__esModule) return mod;
  2683. var result = {};
  2684. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  2685. result["default"] = mod;
  2686. return result;
  2687. };
  2688. Object.defineProperty(exports, "__esModule", { value: true });
  2689. const core = __importStar(__webpack_require__(470));
  2690. const coreCommand = __importStar(__webpack_require__(431));
  2691. const gitSourceProvider = __importStar(__webpack_require__(293));
  2692. const inputHelper = __importStar(__webpack_require__(821));
  2693. const path = __importStar(__webpack_require__(622));
  2694. const stateHelper = __importStar(__webpack_require__(153));
  2695. function run() {
  2696. return __awaiter(this, void 0, void 0, function* () {
  2697. try {
  2698. const sourceSettings = inputHelper.getInputs();
  2699. try {
  2700. // Register problem matcher
  2701. coreCommand.issueCommand('add-matcher', {}, path.join(__dirname, 'problem-matcher.json'));
  2702. // Get sources
  2703. yield gitSourceProvider.getSource(sourceSettings);
  2704. }
  2705. finally {
  2706. // Unregister problem matcher
  2707. coreCommand.issueCommand('remove-matcher', { owner: 'checkout-git' }, '');
  2708. }
  2709. }
  2710. catch (error) {
  2711. core.setFailed(error.message);
  2712. }
  2713. });
  2714. }
  2715. function cleanup() {
  2716. return __awaiter(this, void 0, void 0, function* () {
  2717. try {
  2718. yield gitSourceProvider.cleanup(stateHelper.RepositoryPath);
  2719. }
  2720. catch (error) {
  2721. core.warning(error.message);
  2722. }
  2723. });
  2724. }
  2725. // Main
  2726. if (!stateHelper.IsPost) {
  2727. run();
  2728. }
  2729. // Post
  2730. else {
  2731. cleanup();
  2732. }
  2733. /***/ }),
  2734. /***/ 211:
  2735. /***/ (function(module) {
  2736. module.exports = require("https");
  2737. /***/ }),
  2738. /***/ 215:
  2739. /***/ (function(module) {
  2740. 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"};
  2741. /***/ }),
  2742. /***/ 227:
  2743. /***/ (function(__unusedmodule, exports) {
  2744. "use strict";
  2745. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2746. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2747. return new (P || (P = Promise))(function (resolve, reject) {
  2748. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2749. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2750. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2751. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2752. });
  2753. };
  2754. Object.defineProperty(exports, "__esModule", { value: true });
  2755. function getCheckoutInfo(git, ref, commit) {
  2756. return __awaiter(this, void 0, void 0, function* () {
  2757. if (!git) {
  2758. throw new Error('Arg git cannot be empty');
  2759. }
  2760. if (!ref && !commit) {
  2761. throw new Error('Args ref and commit cannot both be empty');
  2762. }
  2763. const result = {};
  2764. const upperRef = (ref || '').toUpperCase();
  2765. // SHA only
  2766. if (!ref) {
  2767. result.ref = commit;
  2768. }
  2769. // refs/heads/
  2770. else if (upperRef.startsWith('REFS/HEADS/')) {
  2771. const branch = ref.substring('refs/heads/'.length);
  2772. result.ref = branch;
  2773. result.startPoint = `refs/remotes/origin/${branch}`;
  2774. }
  2775. // refs/pull/
  2776. else if (upperRef.startsWith('REFS/PULL/')) {
  2777. const branch = ref.substring('refs/pull/'.length);
  2778. result.ref = `refs/remotes/pull/${branch}`;
  2779. }
  2780. // refs/tags/
  2781. else if (upperRef.startsWith('REFS/')) {
  2782. result.ref = ref;
  2783. }
  2784. // Unqualified ref, check for a matching branch or tag
  2785. else {
  2786. if (yield git.branchExists(true, `origin/${ref}`)) {
  2787. result.ref = ref;
  2788. result.startPoint = `refs/remotes/origin/${ref}`;
  2789. }
  2790. else if (yield git.tagExists(`${ref}`)) {
  2791. result.ref = `refs/tags/${ref}`;
  2792. }
  2793. else {
  2794. throw new Error(`A branch or tag with the name '${ref}' could not be found`);
  2795. }
  2796. }
  2797. return result;
  2798. });
  2799. }
  2800. exports.getCheckoutInfo = getCheckoutInfo;
  2801. function getRefSpec(ref, commit) {
  2802. if (!ref && !commit) {
  2803. throw new Error('Args ref and commit cannot both be empty');
  2804. }
  2805. const upperRef = (ref || '').toUpperCase();
  2806. // SHA
  2807. if (commit) {
  2808. // refs/heads
  2809. if (upperRef.startsWith('REFS/HEADS/')) {
  2810. const branch = ref.substring('refs/heads/'.length);
  2811. return [`+${commit}:refs/remotes/origin/${branch}`];
  2812. }
  2813. // refs/pull/
  2814. else if (upperRef.startsWith('REFS/PULL/')) {
  2815. const branch = ref.substring('refs/pull/'.length);
  2816. return [`+${commit}:refs/remotes/pull/${branch}`];
  2817. }
  2818. // refs/tags/
  2819. else if (upperRef.startsWith('REFS/TAGS/')) {
  2820. return [`+${commit}:${ref}`];
  2821. }
  2822. // Otherwise no destination ref
  2823. else {
  2824. return [commit];
  2825. }
  2826. }
  2827. // Unqualified ref, check for a matching branch or tag
  2828. else if (!upperRef.startsWith('REFS/')) {
  2829. return [
  2830. `+refs/heads/${ref}*:refs/remotes/origin/${ref}*`,
  2831. `+refs/tags/${ref}*:refs/tags/${ref}*`
  2832. ];
  2833. }
  2834. // refs/heads/
  2835. else if (upperRef.startsWith('REFS/HEADS/')) {
  2836. const branch = ref.substring('refs/heads/'.length);
  2837. return [`+${ref}:refs/remotes/origin/${branch}`];
  2838. }
  2839. // refs/pull/
  2840. else if (upperRef.startsWith('REFS/PULL/')) {
  2841. const branch = ref.substring('refs/pull/'.length);
  2842. return [`+${ref}:refs/remotes/pull/${branch}`];
  2843. }
  2844. // refs/tags/
  2845. else {
  2846. return [`+${ref}:${ref}`];
  2847. }
  2848. }
  2849. exports.getRefSpec = getRefSpec;
  2850. /***/ }),
  2851. /***/ 247:
  2852. /***/ (function(module, __unusedexports, __webpack_require__) {
  2853. "use strict";
  2854. const os = __webpack_require__(87);
  2855. const hasFlag = __webpack_require__(364);
  2856. const env = process.env;
  2857. let forceColor;
  2858. if (hasFlag('no-color') ||
  2859. hasFlag('no-colors') ||
  2860. hasFlag('color=false')) {
  2861. forceColor = false;
  2862. } else if (hasFlag('color') ||
  2863. hasFlag('colors') ||
  2864. hasFlag('color=true') ||
  2865. hasFlag('color=always')) {
  2866. forceColor = true;
  2867. }
  2868. if ('FORCE_COLOR' in env) {
  2869. forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0;
  2870. }
  2871. function translateLevel(level) {
  2872. if (level === 0) {
  2873. return false;
  2874. }
  2875. return {
  2876. level,
  2877. hasBasic: true,
  2878. has256: level >= 2,
  2879. has16m: level >= 3
  2880. };
  2881. }
  2882. function supportsColor(stream) {
  2883. if (forceColor === false) {
  2884. return 0;
  2885. }
  2886. if (hasFlag('color=16m') ||
  2887. hasFlag('color=full') ||
  2888. hasFlag('color=truecolor')) {
  2889. return 3;
  2890. }
  2891. if (hasFlag('color=256')) {
  2892. return 2;
  2893. }
  2894. if (stream && !stream.isTTY && forceColor !== true) {
  2895. return 0;
  2896. }
  2897. const min = forceColor ? 1 : 0;
  2898. if (process.platform === 'win32') {
  2899. // Node.js 7.5.0 is the first version of Node.js to include a patch to
  2900. // libuv that enables 256 color output on Windows. Anything earlier and it
  2901. // won't work. However, here we target Node.js 8 at minimum as it is an LTS
  2902. // release, and Node.js 7 is not. Windows 10 build 10586 is the first Windows
  2903. // release that supports 256 colors. Windows 10 build 14931 is the first release
  2904. // that supports 16m/TrueColor.
  2905. const osRelease = os.release().split('.');
  2906. if (
  2907. Number(process.versions.node.split('.')[0]) >= 8 &&
  2908. Number(osRelease[0]) >= 10 &&
  2909. Number(osRelease[2]) >= 10586
  2910. ) {
  2911. return Number(osRelease[2]) >= 14931 ? 3 : 2;
  2912. }
  2913. return 1;
  2914. }
  2915. if ('CI' in env) {
  2916. if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
  2917. return 1;
  2918. }
  2919. return min;
  2920. }
  2921. if ('TEAMCITY_VERSION' in env) {
  2922. return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
  2923. }
  2924. if (env.COLORTERM === 'truecolor') {
  2925. return 3;
  2926. }
  2927. if ('TERM_PROGRAM' in env) {
  2928. const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
  2929. switch (env.TERM_PROGRAM) {
  2930. case 'iTerm.app':
  2931. return version >= 3 ? 3 : 2;
  2932. case 'Apple_Terminal':
  2933. return 2;
  2934. // No default
  2935. }
  2936. }
  2937. if (/-256(color)?$/i.test(env.TERM)) {
  2938. return 2;
  2939. }
  2940. if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
  2941. return 1;
  2942. }
  2943. if ('COLORTERM' in env) {
  2944. return 1;
  2945. }
  2946. if (env.TERM === 'dumb') {
  2947. return min;
  2948. }
  2949. return min;
  2950. }
  2951. function getSupportLevel(stream) {
  2952. const level = supportsColor(stream);
  2953. return translateLevel(level);
  2954. }
  2955. module.exports = {
  2956. supportsColor: getSupportLevel,
  2957. stdout: getSupportLevel(process.stdout),
  2958. stderr: getSupportLevel(process.stderr)
  2959. };
  2960. /***/ }),
  2961. /***/ 248:
  2962. /***/ (function(module, __unusedexports, __webpack_require__) {
  2963. module.exports = octokitRegisterEndpoints;
  2964. const registerEndpoints = __webpack_require__(899);
  2965. function octokitRegisterEndpoints(octokit) {
  2966. octokit.registerEndpoints = registerEndpoints.bind(null, octokit);
  2967. }
  2968. /***/ }),
  2969. /***/ 260:
  2970. /***/ (function(module, __unusedexports, __webpack_require__) {
  2971. // Note: since nyc uses this module to output coverage, any lines
  2972. // that are in the direct sync flow of nyc's outputCoverage are
  2973. // ignored, since we can never get coverage for them.
  2974. var assert = __webpack_require__(357)
  2975. var signals = __webpack_require__(654)
  2976. var EE = __webpack_require__(614)
  2977. /* istanbul ignore if */
  2978. if (typeof EE !== 'function') {
  2979. EE = EE.EventEmitter
  2980. }
  2981. var emitter
  2982. if (process.__signal_exit_emitter__) {
  2983. emitter = process.__signal_exit_emitter__
  2984. } else {
  2985. emitter = process.__signal_exit_emitter__ = new EE()
  2986. emitter.count = 0
  2987. emitter.emitted = {}
  2988. }
  2989. // Because this emitter is a global, we have to check to see if a
  2990. // previous version of this library failed to enable infinite listeners.
  2991. // I know what you're about to say. But literally everything about
  2992. // signal-exit is a compromise with evil. Get used to it.
  2993. if (!emitter.infinite) {
  2994. emitter.setMaxListeners(Infinity)
  2995. emitter.infinite = true
  2996. }
  2997. module.exports = function (cb, opts) {
  2998. assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler')
  2999. if (loaded === false) {
  3000. load()
  3001. }
  3002. var ev = 'exit'
  3003. if (opts && opts.alwaysLast) {
  3004. ev = 'afterexit'
  3005. }
  3006. var remove = function () {
  3007. emitter.removeListener(ev, cb)
  3008. if (emitter.listeners('exit').length === 0 &&
  3009. emitter.listeners('afterexit').length === 0) {
  3010. unload()
  3011. }
  3012. }
  3013. emitter.on(ev, cb)
  3014. return remove
  3015. }
  3016. module.exports.unload = unload
  3017. function unload () {
  3018. if (!loaded) {
  3019. return
  3020. }
  3021. loaded = false
  3022. signals.forEach(function (sig) {
  3023. try {
  3024. process.removeListener(sig, sigListeners[sig])
  3025. } catch (er) {}
  3026. })
  3027. process.emit = originalProcessEmit
  3028. process.reallyExit = originalProcessReallyExit
  3029. emitter.count -= 1
  3030. }
  3031. function emit (event, code, signal) {
  3032. if (emitter.emitted[event]) {
  3033. return
  3034. }
  3035. emitter.emitted[event] = true
  3036. emitter.emit(event, code, signal)
  3037. }
  3038. // { <signal>: <listener fn>, ... }
  3039. var sigListeners = {}
  3040. signals.forEach(function (sig) {
  3041. sigListeners[sig] = function listener () {
  3042. // If there are no other listeners, an exit is coming!
  3043. // Simplest way: remove us and then re-send the signal.
  3044. // We know that this will kill the process, so we can
  3045. // safely emit now.
  3046. var listeners = process.listeners(sig)
  3047. if (listeners.length === emitter.count) {
  3048. unload()
  3049. emit('exit', null, sig)
  3050. /* istanbul ignore next */
  3051. emit('afterexit', null, sig)
  3052. /* istanbul ignore next */
  3053. process.kill(process.pid, sig)
  3054. }
  3055. }
  3056. })
  3057. module.exports.signals = function () {
  3058. return signals
  3059. }
  3060. module.exports.load = load
  3061. var loaded = false
  3062. function load () {
  3063. if (loaded) {
  3064. return
  3065. }
  3066. loaded = true
  3067. // This is the number of onSignalExit's that are in play.
  3068. // It's important so that we can count the correct number of
  3069. // listeners on signals, and don't wait for the other one to
  3070. // handle it instead of us.
  3071. emitter.count += 1
  3072. signals = signals.filter(function (sig) {
  3073. try {
  3074. process.on(sig, sigListeners[sig])
  3075. return true
  3076. } catch (er) {
  3077. return false
  3078. }
  3079. })
  3080. process.emit = processEmit
  3081. process.reallyExit = processReallyExit
  3082. }
  3083. var originalProcessReallyExit = process.reallyExit
  3084. function processReallyExit (code) {
  3085. process.exitCode = code || 0
  3086. emit('exit', process.exitCode, null)
  3087. /* istanbul ignore next */
  3088. emit('afterexit', process.exitCode, null)
  3089. /* istanbul ignore next */
  3090. originalProcessReallyExit.call(process, process.exitCode)
  3091. }
  3092. var originalProcessEmit = process.emit
  3093. function processEmit (ev, arg) {
  3094. if (ev === 'exit') {
  3095. if (arg !== undefined) {
  3096. process.exitCode = arg
  3097. }
  3098. var ret = originalProcessEmit.apply(this, arguments)
  3099. emit('exit', process.exitCode, null)
  3100. /* istanbul ignore next */
  3101. emit('afterexit', process.exitCode, null)
  3102. return ret
  3103. } else {
  3104. return originalProcessEmit.apply(this, arguments)
  3105. }
  3106. }
  3107. /***/ }),
  3108. /***/ 262:
  3109. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  3110. "use strict";
  3111. Object.defineProperty(exports, "__esModule", { value: true });
  3112. const fs_1 = __webpack_require__(747);
  3113. const os_1 = __webpack_require__(87);
  3114. class Context {
  3115. /**
  3116. * Hydrate the context from the environment
  3117. */
  3118. constructor() {
  3119. this.payload = {};
  3120. if (process.env.GITHUB_EVENT_PATH) {
  3121. if (fs_1.existsSync(process.env.GITHUB_EVENT_PATH)) {
  3122. this.payload = JSON.parse(fs_1.readFileSync(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' }));
  3123. }
  3124. else {
  3125. const path = process.env.GITHUB_EVENT_PATH;
  3126. process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${os_1.EOL}`);
  3127. }
  3128. }
  3129. this.eventName = process.env.GITHUB_EVENT_NAME;
  3130. this.sha = process.env.GITHUB_SHA;
  3131. this.ref = process.env.GITHUB_REF;
  3132. this.workflow = process.env.GITHUB_WORKFLOW;
  3133. this.action = process.env.GITHUB_ACTION;
  3134. this.actor = process.env.GITHUB_ACTOR;
  3135. }
  3136. get issue() {
  3137. const payload = this.payload;
  3138. return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pullRequest || payload).number });
  3139. }
  3140. get repo() {
  3141. if (process.env.GITHUB_REPOSITORY) {
  3142. const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');
  3143. return { owner, repo };
  3144. }
  3145. if (this.payload.repository) {
  3146. return {
  3147. owner: this.payload.repository.owner.login,
  3148. repo: this.payload.repository.name
  3149. };
  3150. }
  3151. throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'");
  3152. }
  3153. }
  3154. exports.Context = Context;
  3155. //# sourceMappingURL=context.js.map
  3156. /***/ }),
  3157. /***/ 265:
  3158. /***/ (function(module, __unusedexports, __webpack_require__) {
  3159. module.exports = getPage
  3160. const deprecate = __webpack_require__(370)
  3161. const getPageLinks = __webpack_require__(577)
  3162. const HttpError = __webpack_require__(297)
  3163. function getPage (octokit, link, which, headers) {
  3164. 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.`)
  3165. const url = getPageLinks(link)[which]
  3166. if (!url) {
  3167. const urlError = new HttpError(`No ${which} page found`, 404)
  3168. return Promise.reject(urlError)
  3169. }
  3170. const requestOptions = {
  3171. url,
  3172. headers: applyAcceptHeader(link, headers)
  3173. }
  3174. const promise = octokit.request(requestOptions)
  3175. return promise
  3176. }
  3177. function applyAcceptHeader (res, headers) {
  3178. const previous = res.headers && res.headers['x-github-media-type']
  3179. if (!previous || (headers && headers.accept)) {
  3180. return headers
  3181. }
  3182. headers = headers || {}
  3183. headers.accept = 'application/vnd.' + previous
  3184. .replace('; param=', '.')
  3185. .replace('; format=', '+')
  3186. return headers
  3187. }
  3188. /***/ }),
  3189. /***/ 280:
  3190. /***/ (function(module, exports) {
  3191. exports = module.exports = SemVer
  3192. var debug
  3193. /* istanbul ignore next */
  3194. if (typeof process === 'object' &&
  3195. process.env &&
  3196. process.env.NODE_DEBUG &&
  3197. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  3198. debug = function () {
  3199. var args = Array.prototype.slice.call(arguments, 0)
  3200. args.unshift('SEMVER')
  3201. console.log.apply(console, args)
  3202. }
  3203. } else {
  3204. debug = function () {}
  3205. }
  3206. // Note: this is the semver.org version of the spec that it implements
  3207. // Not necessarily the package version of this code.
  3208. exports.SEMVER_SPEC_VERSION = '2.0.0'
  3209. var MAX_LENGTH = 256
  3210. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  3211. /* istanbul ignore next */ 9007199254740991
  3212. // Max safe segment length for coercion.
  3213. var MAX_SAFE_COMPONENT_LENGTH = 16
  3214. // The actual regexps go on exports.re
  3215. var re = exports.re = []
  3216. var src = exports.src = []
  3217. var R = 0
  3218. // The following Regular Expressions can be used for tokenizing,
  3219. // validating, and parsing SemVer version strings.
  3220. // ## Numeric Identifier
  3221. // A single `0`, or a non-zero digit followed by zero or more digits.
  3222. var NUMERICIDENTIFIER = R++
  3223. src[NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  3224. var NUMERICIDENTIFIERLOOSE = R++
  3225. src[NUMERICIDENTIFIERLOOSE] = '[0-9]+'
  3226. // ## Non-numeric Identifier
  3227. // Zero or more digits, followed by a letter or hyphen, and then zero or
  3228. // more letters, digits, or hyphens.
  3229. var NONNUMERICIDENTIFIER = R++
  3230. src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
  3231. // ## Main Version
  3232. // Three dot-separated numeric identifiers.
  3233. var MAINVERSION = R++
  3234. src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' +
  3235. '(' + src[NUMERICIDENTIFIER] + ')\\.' +
  3236. '(' + src[NUMERICIDENTIFIER] + ')'
  3237. var MAINVERSIONLOOSE = R++
  3238. src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
  3239. '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
  3240. '(' + src[NUMERICIDENTIFIERLOOSE] + ')'
  3241. // ## Pre-release Version Identifier
  3242. // A numeric identifier, or a non-numeric identifier.
  3243. var PRERELEASEIDENTIFIER = R++
  3244. src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] +
  3245. '|' + src[NONNUMERICIDENTIFIER] + ')'
  3246. var PRERELEASEIDENTIFIERLOOSE = R++
  3247. src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] +
  3248. '|' + src[NONNUMERICIDENTIFIER] + ')'
  3249. // ## Pre-release Version
  3250. // Hyphen, followed by one or more dot-separated pre-release version
  3251. // identifiers.
  3252. var PRERELEASE = R++
  3253. src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] +
  3254. '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))'
  3255. var PRERELEASELOOSE = R++
  3256. src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] +
  3257. '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))'
  3258. // ## Build Metadata Identifier
  3259. // Any combination of digits, letters, or hyphens.
  3260. var BUILDIDENTIFIER = R++
  3261. src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
  3262. // ## Build Metadata
  3263. // Plus sign, followed by one or more period-separated build metadata
  3264. // identifiers.
  3265. var BUILD = R++
  3266. src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] +
  3267. '(?:\\.' + src[BUILDIDENTIFIER] + ')*))'
  3268. // ## Full Version String
  3269. // A main version, followed optionally by a pre-release version and
  3270. // build metadata.
  3271. // Note that the only major, minor, patch, and pre-release sections of
  3272. // the version string are capturing groups. The build metadata is not a
  3273. // capturing group, because it should not ever be used in version
  3274. // comparison.
  3275. var FULL = R++
  3276. var FULLPLAIN = 'v?' + src[MAINVERSION] +
  3277. src[PRERELEASE] + '?' +
  3278. src[BUILD] + '?'
  3279. src[FULL] = '^' + FULLPLAIN + '$'
  3280. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  3281. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  3282. // common in the npm registry.
  3283. var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] +
  3284. src[PRERELEASELOOSE] + '?' +
  3285. src[BUILD] + '?'
  3286. var LOOSE = R++
  3287. src[LOOSE] = '^' + LOOSEPLAIN + '$'
  3288. var GTLT = R++
  3289. src[GTLT] = '((?:<|>)?=?)'
  3290. // Something like "2.*" or "1.2.x".
  3291. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  3292. // Only the first item is strictly required.
  3293. var XRANGEIDENTIFIERLOOSE = R++
  3294. src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  3295. var XRANGEIDENTIFIER = R++
  3296. src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*'
  3297. var XRANGEPLAIN = R++
  3298. src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' +
  3299. '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
  3300. '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
  3301. '(?:' + src[PRERELEASE] + ')?' +
  3302. src[BUILD] + '?' +
  3303. ')?)?'
  3304. var XRANGEPLAINLOOSE = R++
  3305. src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  3306. '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  3307. '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  3308. '(?:' + src[PRERELEASELOOSE] + ')?' +
  3309. src[BUILD] + '?' +
  3310. ')?)?'
  3311. var XRANGE = R++
  3312. src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'
  3313. var XRANGELOOSE = R++
  3314. src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$'
  3315. // Coercion.
  3316. // Extract anything that could conceivably be a part of a valid semver
  3317. var COERCE = R++
  3318. src[COERCE] = '(?:^|[^\\d])' +
  3319. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  3320. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  3321. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  3322. '(?:$|[^\\d])'
  3323. // Tilde ranges.
  3324. // Meaning is "reasonably at or greater than"
  3325. var LONETILDE = R++
  3326. src[LONETILDE] = '(?:~>?)'
  3327. var TILDETRIM = R++
  3328. src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+'
  3329. re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g')
  3330. var tildeTrimReplace = '$1~'
  3331. var TILDE = R++
  3332. src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'
  3333. var TILDELOOSE = R++
  3334. src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'
  3335. // Caret ranges.
  3336. // Meaning is "at least and backwards compatible with"
  3337. var LONECARET = R++
  3338. src[LONECARET] = '(?:\\^)'
  3339. var CARETTRIM = R++
  3340. src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+'
  3341. re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g')
  3342. var caretTrimReplace = '$1^'
  3343. var CARET = R++
  3344. src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$'
  3345. var CARETLOOSE = R++
  3346. src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$'
  3347. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  3348. var COMPARATORLOOSE = R++
  3349. src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$'
  3350. var COMPARATOR = R++
  3351. src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$'
  3352. // An expression to strip any whitespace between the gtlt and the thing
  3353. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  3354. var COMPARATORTRIM = R++
  3355. src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] +
  3356. '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'
  3357. // this one has to use the /g flag
  3358. re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g')
  3359. var comparatorTrimReplace = '$1$2$3'
  3360. // Something like `1.2.3 - 1.2.4`
  3361. // Note that these all use the loose form, because they'll be
  3362. // checked against either the strict or loose comparator form
  3363. // later.
  3364. var HYPHENRANGE = R++
  3365. src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' +
  3366. '\\s+-\\s+' +
  3367. '(' + src[XRANGEPLAIN] + ')' +
  3368. '\\s*$'
  3369. var HYPHENRANGELOOSE = R++
  3370. src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' +
  3371. '\\s+-\\s+' +
  3372. '(' + src[XRANGEPLAINLOOSE] + ')' +
  3373. '\\s*$'
  3374. // Star ranges basically just allow anything at all.
  3375. var STAR = R++
  3376. src[STAR] = '(<|>)?=?\\s*\\*'
  3377. // Compile to actual regexp objects.
  3378. // All are flag-free, unless they were created above with a flag.
  3379. for (var i = 0; i < R; i++) {
  3380. debug(i, src[i])
  3381. if (!re[i]) {
  3382. re[i] = new RegExp(src[i])
  3383. }
  3384. }
  3385. exports.parse = parse
  3386. function parse (version, options) {
  3387. if (!options || typeof options !== 'object') {
  3388. options = {
  3389. loose: !!options,
  3390. includePrerelease: false
  3391. }
  3392. }
  3393. if (version instanceof SemVer) {
  3394. return version
  3395. }
  3396. if (typeof version !== 'string') {
  3397. return null
  3398. }
  3399. if (version.length > MAX_LENGTH) {
  3400. return null
  3401. }
  3402. var r = options.loose ? re[LOOSE] : re[FULL]
  3403. if (!r.test(version)) {
  3404. return null
  3405. }
  3406. try {
  3407. return new SemVer(version, options)
  3408. } catch (er) {
  3409. return null
  3410. }
  3411. }
  3412. exports.valid = valid
  3413. function valid (version, options) {
  3414. var v = parse(version, options)
  3415. return v ? v.version : null
  3416. }
  3417. exports.clean = clean
  3418. function clean (version, options) {
  3419. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  3420. return s ? s.version : null
  3421. }
  3422. exports.SemVer = SemVer
  3423. function SemVer (version, options) {
  3424. if (!options || typeof options !== 'object') {
  3425. options = {
  3426. loose: !!options,
  3427. includePrerelease: false
  3428. }
  3429. }
  3430. if (version instanceof SemVer) {
  3431. if (version.loose === options.loose) {
  3432. return version
  3433. } else {
  3434. version = version.version
  3435. }
  3436. } else if (typeof version !== 'string') {
  3437. throw new TypeError('Invalid Version: ' + version)
  3438. }
  3439. if (version.length > MAX_LENGTH) {
  3440. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  3441. }
  3442. if (!(this instanceof SemVer)) {
  3443. return new SemVer(version, options)
  3444. }
  3445. debug('SemVer', version, options)
  3446. this.options = options
  3447. this.loose = !!options.loose
  3448. var m = version.trim().match(options.loose ? re[LOOSE] : re[FULL])
  3449. if (!m) {
  3450. throw new TypeError('Invalid Version: ' + version)
  3451. }
  3452. this.raw = version
  3453. // these are actually numbers
  3454. this.major = +m[1]
  3455. this.minor = +m[2]
  3456. this.patch = +m[3]
  3457. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  3458. throw new TypeError('Invalid major version')
  3459. }
  3460. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  3461. throw new TypeError('Invalid minor version')
  3462. }
  3463. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  3464. throw new TypeError('Invalid patch version')
  3465. }
  3466. // numberify any prerelease numeric ids
  3467. if (!m[4]) {
  3468. this.prerelease = []
  3469. } else {
  3470. this.prerelease = m[4].split('.').map(function (id) {
  3471. if (/^[0-9]+$/.test(id)) {
  3472. var num = +id
  3473. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  3474. return num
  3475. }
  3476. }
  3477. return id
  3478. })
  3479. }
  3480. this.build = m[5] ? m[5].split('.') : []
  3481. this.format()
  3482. }
  3483. SemVer.prototype.format = function () {
  3484. this.version = this.major + '.' + this.minor + '.' + this.patch
  3485. if (this.prerelease.length) {
  3486. this.version += '-' + this.prerelease.join('.')
  3487. }
  3488. return this.version
  3489. }
  3490. SemVer.prototype.toString = function () {
  3491. return this.version
  3492. }
  3493. SemVer.prototype.compare = function (other) {
  3494. debug('SemVer.compare', this.version, this.options, other)
  3495. if (!(other instanceof SemVer)) {
  3496. other = new SemVer(other, this.options)
  3497. }
  3498. return this.compareMain(other) || this.comparePre(other)
  3499. }
  3500. SemVer.prototype.compareMain = function (other) {
  3501. if (!(other instanceof SemVer)) {
  3502. other = new SemVer(other, this.options)
  3503. }
  3504. return compareIdentifiers(this.major, other.major) ||
  3505. compareIdentifiers(this.minor, other.minor) ||
  3506. compareIdentifiers(this.patch, other.patch)
  3507. }
  3508. SemVer.prototype.comparePre = function (other) {
  3509. if (!(other instanceof SemVer)) {
  3510. other = new SemVer(other, this.options)
  3511. }
  3512. // NOT having a prerelease is > having one
  3513. if (this.prerelease.length && !other.prerelease.length) {
  3514. return -1
  3515. } else if (!this.prerelease.length && other.prerelease.length) {
  3516. return 1
  3517. } else if (!this.prerelease.length && !other.prerelease.length) {
  3518. return 0
  3519. }
  3520. var i = 0
  3521. do {
  3522. var a = this.prerelease[i]
  3523. var b = other.prerelease[i]
  3524. debug('prerelease compare', i, a, b)
  3525. if (a === undefined && b === undefined) {
  3526. return 0
  3527. } else if (b === undefined) {
  3528. return 1
  3529. } else if (a === undefined) {
  3530. return -1
  3531. } else if (a === b) {
  3532. continue
  3533. } else {
  3534. return compareIdentifiers(a, b)
  3535. }
  3536. } while (++i)
  3537. }
  3538. // preminor will bump the version up to the next minor release, and immediately
  3539. // down to pre-release. premajor and prepatch work the same way.
  3540. SemVer.prototype.inc = function (release, identifier) {
  3541. switch (release) {
  3542. case 'premajor':
  3543. this.prerelease.length = 0
  3544. this.patch = 0
  3545. this.minor = 0
  3546. this.major++
  3547. this.inc('pre', identifier)
  3548. break
  3549. case 'preminor':
  3550. this.prerelease.length = 0
  3551. this.patch = 0
  3552. this.minor++
  3553. this.inc('pre', identifier)
  3554. break
  3555. case 'prepatch':
  3556. // If this is already a prerelease, it will bump to the next version
  3557. // drop any prereleases that might already exist, since they are not
  3558. // relevant at this point.
  3559. this.prerelease.length = 0
  3560. this.inc('patch', identifier)
  3561. this.inc('pre', identifier)
  3562. break
  3563. // If the input is a non-prerelease version, this acts the same as
  3564. // prepatch.
  3565. case 'prerelease':
  3566. if (this.prerelease.length === 0) {
  3567. this.inc('patch', identifier)
  3568. }
  3569. this.inc('pre', identifier)
  3570. break
  3571. case 'major':
  3572. // If this is a pre-major version, bump up to the same major version.
  3573. // Otherwise increment major.
  3574. // 1.0.0-5 bumps to 1.0.0
  3575. // 1.1.0 bumps to 2.0.0
  3576. if (this.minor !== 0 ||
  3577. this.patch !== 0 ||
  3578. this.prerelease.length === 0) {
  3579. this.major++
  3580. }
  3581. this.minor = 0
  3582. this.patch = 0
  3583. this.prerelease = []
  3584. break
  3585. case 'minor':
  3586. // If this is a pre-minor version, bump up to the same minor version.
  3587. // Otherwise increment minor.
  3588. // 1.2.0-5 bumps to 1.2.0
  3589. // 1.2.1 bumps to 1.3.0
  3590. if (this.patch !== 0 || this.prerelease.length === 0) {
  3591. this.minor++
  3592. }
  3593. this.patch = 0
  3594. this.prerelease = []
  3595. break
  3596. case 'patch':
  3597. // If this is not a pre-release version, it will increment the patch.
  3598. // If it is a pre-release it will bump up to the same patch version.
  3599. // 1.2.0-5 patches to 1.2.0
  3600. // 1.2.0 patches to 1.2.1
  3601. if (this.prerelease.length === 0) {
  3602. this.patch++
  3603. }
  3604. this.prerelease = []
  3605. break
  3606. // This probably shouldn't be used publicly.
  3607. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  3608. case 'pre':
  3609. if (this.prerelease.length === 0) {
  3610. this.prerelease = [0]
  3611. } else {
  3612. var i = this.prerelease.length
  3613. while (--i >= 0) {
  3614. if (typeof this.prerelease[i] === 'number') {
  3615. this.prerelease[i]++
  3616. i = -2
  3617. }
  3618. }
  3619. if (i === -1) {
  3620. // didn't increment anything
  3621. this.prerelease.push(0)
  3622. }
  3623. }
  3624. if (identifier) {
  3625. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  3626. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  3627. if (this.prerelease[0] === identifier) {
  3628. if (isNaN(this.prerelease[1])) {
  3629. this.prerelease = [identifier, 0]
  3630. }
  3631. } else {
  3632. this.prerelease = [identifier, 0]
  3633. }
  3634. }
  3635. break
  3636. default:
  3637. throw new Error('invalid increment argument: ' + release)
  3638. }
  3639. this.format()
  3640. this.raw = this.version
  3641. return this
  3642. }
  3643. exports.inc = inc
  3644. function inc (version, release, loose, identifier) {
  3645. if (typeof (loose) === 'string') {
  3646. identifier = loose
  3647. loose = undefined
  3648. }
  3649. try {
  3650. return new SemVer(version, loose).inc(release, identifier).version
  3651. } catch (er) {
  3652. return null
  3653. }
  3654. }
  3655. exports.diff = diff
  3656. function diff (version1, version2) {
  3657. if (eq(version1, version2)) {
  3658. return null
  3659. } else {
  3660. var v1 = parse(version1)
  3661. var v2 = parse(version2)
  3662. var prefix = ''
  3663. if (v1.prerelease.length || v2.prerelease.length) {
  3664. prefix = 'pre'
  3665. var defaultResult = 'prerelease'
  3666. }
  3667. for (var key in v1) {
  3668. if (key === 'major' || key === 'minor' || key === 'patch') {
  3669. if (v1[key] !== v2[key]) {
  3670. return prefix + key
  3671. }
  3672. }
  3673. }
  3674. return defaultResult // may be undefined
  3675. }
  3676. }
  3677. exports.compareIdentifiers = compareIdentifiers
  3678. var numeric = /^[0-9]+$/
  3679. function compareIdentifiers (a, b) {
  3680. var anum = numeric.test(a)
  3681. var bnum = numeric.test(b)
  3682. if (anum && bnum) {
  3683. a = +a
  3684. b = +b
  3685. }
  3686. return a === b ? 0
  3687. : (anum && !bnum) ? -1
  3688. : (bnum && !anum) ? 1
  3689. : a < b ? -1
  3690. : 1
  3691. }
  3692. exports.rcompareIdentifiers = rcompareIdentifiers
  3693. function rcompareIdentifiers (a, b) {
  3694. return compareIdentifiers(b, a)
  3695. }
  3696. exports.major = major
  3697. function major (a, loose) {
  3698. return new SemVer(a, loose).major
  3699. }
  3700. exports.minor = minor
  3701. function minor (a, loose) {
  3702. return new SemVer(a, loose).minor
  3703. }
  3704. exports.patch = patch
  3705. function patch (a, loose) {
  3706. return new SemVer(a, loose).patch
  3707. }
  3708. exports.compare = compare
  3709. function compare (a, b, loose) {
  3710. return new SemVer(a, loose).compare(new SemVer(b, loose))
  3711. }
  3712. exports.compareLoose = compareLoose
  3713. function compareLoose (a, b) {
  3714. return compare(a, b, true)
  3715. }
  3716. exports.rcompare = rcompare
  3717. function rcompare (a, b, loose) {
  3718. return compare(b, a, loose)
  3719. }
  3720. exports.sort = sort
  3721. function sort (list, loose) {
  3722. return list.sort(function (a, b) {
  3723. return exports.compare(a, b, loose)
  3724. })
  3725. }
  3726. exports.rsort = rsort
  3727. function rsort (list, loose) {
  3728. return list.sort(function (a, b) {
  3729. return exports.rcompare(a, b, loose)
  3730. })
  3731. }
  3732. exports.gt = gt
  3733. function gt (a, b, loose) {
  3734. return compare(a, b, loose) > 0
  3735. }
  3736. exports.lt = lt
  3737. function lt (a, b, loose) {
  3738. return compare(a, b, loose) < 0
  3739. }
  3740. exports.eq = eq
  3741. function eq (a, b, loose) {
  3742. return compare(a, b, loose) === 0
  3743. }
  3744. exports.neq = neq
  3745. function neq (a, b, loose) {
  3746. return compare(a, b, loose) !== 0
  3747. }
  3748. exports.gte = gte
  3749. function gte (a, b, loose) {
  3750. return compare(a, b, loose) >= 0
  3751. }
  3752. exports.lte = lte
  3753. function lte (a, b, loose) {
  3754. return compare(a, b, loose) <= 0
  3755. }
  3756. exports.cmp = cmp
  3757. function cmp (a, op, b, loose) {
  3758. switch (op) {
  3759. case '===':
  3760. if (typeof a === 'object')
  3761. a = a.version
  3762. if (typeof b === 'object')
  3763. b = b.version
  3764. return a === b
  3765. case '!==':
  3766. if (typeof a === 'object')
  3767. a = a.version
  3768. if (typeof b === 'object')
  3769. b = b.version
  3770. return a !== b
  3771. case '':
  3772. case '=':
  3773. case '==':
  3774. return eq(a, b, loose)
  3775. case '!=':
  3776. return neq(a, b, loose)
  3777. case '>':
  3778. return gt(a, b, loose)
  3779. case '>=':
  3780. return gte(a, b, loose)
  3781. case '<':
  3782. return lt(a, b, loose)
  3783. case '<=':
  3784. return lte(a, b, loose)
  3785. default:
  3786. throw new TypeError('Invalid operator: ' + op)
  3787. }
  3788. }
  3789. exports.Comparator = Comparator
  3790. function Comparator (comp, options) {
  3791. if (!options || typeof options !== 'object') {
  3792. options = {
  3793. loose: !!options,
  3794. includePrerelease: false
  3795. }
  3796. }
  3797. if (comp instanceof Comparator) {
  3798. if (comp.loose === !!options.loose) {
  3799. return comp
  3800. } else {
  3801. comp = comp.value
  3802. }
  3803. }
  3804. if (!(this instanceof Comparator)) {
  3805. return new Comparator(comp, options)
  3806. }
  3807. debug('comparator', comp, options)
  3808. this.options = options
  3809. this.loose = !!options.loose
  3810. this.parse(comp)
  3811. if (this.semver === ANY) {
  3812. this.value = ''
  3813. } else {
  3814. this.value = this.operator + this.semver.version
  3815. }
  3816. debug('comp', this)
  3817. }
  3818. var ANY = {}
  3819. Comparator.prototype.parse = function (comp) {
  3820. var r = this.options.loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
  3821. var m = comp.match(r)
  3822. if (!m) {
  3823. throw new TypeError('Invalid comparator: ' + comp)
  3824. }
  3825. this.operator = m[1]
  3826. if (this.operator === '=') {
  3827. this.operator = ''
  3828. }
  3829. // if it literally is just '>' or '' then allow anything.
  3830. if (!m[2]) {
  3831. this.semver = ANY
  3832. } else {
  3833. this.semver = new SemVer(m[2], this.options.loose)
  3834. }
  3835. }
  3836. Comparator.prototype.toString = function () {
  3837. return this.value
  3838. }
  3839. Comparator.prototype.test = function (version) {
  3840. debug('Comparator.test', version, this.options.loose)
  3841. if (this.semver === ANY) {
  3842. return true
  3843. }
  3844. if (typeof version === 'string') {
  3845. version = new SemVer(version, this.options)
  3846. }
  3847. return cmp(version, this.operator, this.semver, this.options)
  3848. }
  3849. Comparator.prototype.intersects = function (comp, options) {
  3850. if (!(comp instanceof Comparator)) {
  3851. throw new TypeError('a Comparator is required')
  3852. }
  3853. if (!options || typeof options !== 'object') {
  3854. options = {
  3855. loose: !!options,
  3856. includePrerelease: false
  3857. }
  3858. }
  3859. var rangeTmp
  3860. if (this.operator === '') {
  3861. rangeTmp = new Range(comp.value, options)
  3862. return satisfies(this.value, rangeTmp, options)
  3863. } else if (comp.operator === '') {
  3864. rangeTmp = new Range(this.value, options)
  3865. return satisfies(comp.semver, rangeTmp, options)
  3866. }
  3867. var sameDirectionIncreasing =
  3868. (this.operator === '>=' || this.operator === '>') &&
  3869. (comp.operator === '>=' || comp.operator === '>')
  3870. var sameDirectionDecreasing =
  3871. (this.operator === '<=' || this.operator === '<') &&
  3872. (comp.operator === '<=' || comp.operator === '<')
  3873. var sameSemVer = this.semver.version === comp.semver.version
  3874. var differentDirectionsInclusive =
  3875. (this.operator === '>=' || this.operator === '<=') &&
  3876. (comp.operator === '>=' || comp.operator === '<=')
  3877. var oppositeDirectionsLessThan =
  3878. cmp(this.semver, '<', comp.semver, options) &&
  3879. ((this.operator === '>=' || this.operator === '>') &&
  3880. (comp.operator === '<=' || comp.operator === '<'))
  3881. var oppositeDirectionsGreaterThan =
  3882. cmp(this.semver, '>', comp.semver, options) &&
  3883. ((this.operator === '<=' || this.operator === '<') &&
  3884. (comp.operator === '>=' || comp.operator === '>'))
  3885. return sameDirectionIncreasing || sameDirectionDecreasing ||
  3886. (sameSemVer && differentDirectionsInclusive) ||
  3887. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  3888. }
  3889. exports.Range = Range
  3890. function Range (range, options) {
  3891. if (!options || typeof options !== 'object') {
  3892. options = {
  3893. loose: !!options,
  3894. includePrerelease: false
  3895. }
  3896. }
  3897. if (range instanceof Range) {
  3898. if (range.loose === !!options.loose &&
  3899. range.includePrerelease === !!options.includePrerelease) {
  3900. return range
  3901. } else {
  3902. return new Range(range.raw, options)
  3903. }
  3904. }
  3905. if (range instanceof Comparator) {
  3906. return new Range(range.value, options)
  3907. }
  3908. if (!(this instanceof Range)) {
  3909. return new Range(range, options)
  3910. }
  3911. this.options = options
  3912. this.loose = !!options.loose
  3913. this.includePrerelease = !!options.includePrerelease
  3914. // First, split based on boolean or ||
  3915. this.raw = range
  3916. this.set = range.split(/\s*\|\|\s*/).map(function (range) {
  3917. return this.parseRange(range.trim())
  3918. }, this).filter(function (c) {
  3919. // throw out any that are not relevant for whatever reason
  3920. return c.length
  3921. })
  3922. if (!this.set.length) {
  3923. throw new TypeError('Invalid SemVer Range: ' + range)
  3924. }
  3925. this.format()
  3926. }
  3927. Range.prototype.format = function () {
  3928. this.range = this.set.map(function (comps) {
  3929. return comps.join(' ').trim()
  3930. }).join('||').trim()
  3931. return this.range
  3932. }
  3933. Range.prototype.toString = function () {
  3934. return this.range
  3935. }
  3936. Range.prototype.parseRange = function (range) {
  3937. var loose = this.options.loose
  3938. range = range.trim()
  3939. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  3940. var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE]
  3941. range = range.replace(hr, hyphenReplace)
  3942. debug('hyphen replace', range)
  3943. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  3944. range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace)
  3945. debug('comparator trim', range, re[COMPARATORTRIM])
  3946. // `~ 1.2.3` => `~1.2.3`
  3947. range = range.replace(re[TILDETRIM], tildeTrimReplace)
  3948. // `^ 1.2.3` => `^1.2.3`
  3949. range = range.replace(re[CARETTRIM], caretTrimReplace)
  3950. // normalize spaces
  3951. range = range.split(/\s+/).join(' ')
  3952. // At this point, the range is completely trimmed and
  3953. // ready to be split into comparators.
  3954. var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
  3955. var set = range.split(' ').map(function (comp) {
  3956. return parseComparator(comp, this.options)
  3957. }, this).join(' ').split(/\s+/)
  3958. if (this.options.loose) {
  3959. // in loose mode, throw out any that are not valid comparators
  3960. set = set.filter(function (comp) {
  3961. return !!comp.match(compRe)
  3962. })
  3963. }
  3964. set = set.map(function (comp) {
  3965. return new Comparator(comp, this.options)
  3966. }, this)
  3967. return set
  3968. }
  3969. Range.prototype.intersects = function (range, options) {
  3970. if (!(range instanceof Range)) {
  3971. throw new TypeError('a Range is required')
  3972. }
  3973. return this.set.some(function (thisComparators) {
  3974. return thisComparators.every(function (thisComparator) {
  3975. return range.set.some(function (rangeComparators) {
  3976. return rangeComparators.every(function (rangeComparator) {
  3977. return thisComparator.intersects(rangeComparator, options)
  3978. })
  3979. })
  3980. })
  3981. })
  3982. }
  3983. // Mostly just for testing and legacy API reasons
  3984. exports.toComparators = toComparators
  3985. function toComparators (range, options) {
  3986. return new Range(range, options).set.map(function (comp) {
  3987. return comp.map(function (c) {
  3988. return c.value
  3989. }).join(' ').trim().split(' ')
  3990. })
  3991. }
  3992. // comprised of xranges, tildes, stars, and gtlt's at this point.
  3993. // already replaced the hyphen ranges
  3994. // turn into a set of JUST comparators.
  3995. function parseComparator (comp, options) {
  3996. debug('comp', comp, options)
  3997. comp = replaceCarets(comp, options)
  3998. debug('caret', comp)
  3999. comp = replaceTildes(comp, options)
  4000. debug('tildes', comp)
  4001. comp = replaceXRanges(comp, options)
  4002. debug('xrange', comp)
  4003. comp = replaceStars(comp, options)
  4004. debug('stars', comp)
  4005. return comp
  4006. }
  4007. function isX (id) {
  4008. return !id || id.toLowerCase() === 'x' || id === '*'
  4009. }
  4010. // ~, ~> --> * (any, kinda silly)
  4011. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  4012. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  4013. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  4014. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  4015. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  4016. function replaceTildes (comp, options) {
  4017. return comp.trim().split(/\s+/).map(function (comp) {
  4018. return replaceTilde(comp, options)
  4019. }).join(' ')
  4020. }
  4021. function replaceTilde (comp, options) {
  4022. var r = options.loose ? re[TILDELOOSE] : re[TILDE]
  4023. return comp.replace(r, function (_, M, m, p, pr) {
  4024. debug('tilde', comp, _, M, m, p, pr)
  4025. var ret
  4026. if (isX(M)) {
  4027. ret = ''
  4028. } else if (isX(m)) {
  4029. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  4030. } else if (isX(p)) {
  4031. // ~1.2 == >=1.2.0 <1.3.0
  4032. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  4033. } else if (pr) {
  4034. debug('replaceTilde pr', pr)
  4035. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4036. ' <' + M + '.' + (+m + 1) + '.0'
  4037. } else {
  4038. // ~1.2.3 == >=1.2.3 <1.3.0
  4039. ret = '>=' + M + '.' + m + '.' + p +
  4040. ' <' + M + '.' + (+m + 1) + '.0'
  4041. }
  4042. debug('tilde return', ret)
  4043. return ret
  4044. })
  4045. }
  4046. // ^ --> * (any, kinda silly)
  4047. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  4048. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  4049. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  4050. // ^1.2.3 --> >=1.2.3 <2.0.0
  4051. // ^1.2.0 --> >=1.2.0 <2.0.0
  4052. function replaceCarets (comp, options) {
  4053. return comp.trim().split(/\s+/).map(function (comp) {
  4054. return replaceCaret(comp, options)
  4055. }).join(' ')
  4056. }
  4057. function replaceCaret (comp, options) {
  4058. debug('caret', comp, options)
  4059. var r = options.loose ? re[CARETLOOSE] : re[CARET]
  4060. return comp.replace(r, function (_, M, m, p, pr) {
  4061. debug('caret', comp, _, M, m, p, pr)
  4062. var ret
  4063. if (isX(M)) {
  4064. ret = ''
  4065. } else if (isX(m)) {
  4066. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  4067. } else if (isX(p)) {
  4068. if (M === '0') {
  4069. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  4070. } else {
  4071. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  4072. }
  4073. } else if (pr) {
  4074. debug('replaceCaret pr', pr)
  4075. if (M === '0') {
  4076. if (m === '0') {
  4077. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4078. ' <' + M + '.' + m + '.' + (+p + 1)
  4079. } else {
  4080. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4081. ' <' + M + '.' + (+m + 1) + '.0'
  4082. }
  4083. } else {
  4084. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4085. ' <' + (+M + 1) + '.0.0'
  4086. }
  4087. } else {
  4088. debug('no pr')
  4089. if (M === '0') {
  4090. if (m === '0') {
  4091. ret = '>=' + M + '.' + m + '.' + p +
  4092. ' <' + M + '.' + m + '.' + (+p + 1)
  4093. } else {
  4094. ret = '>=' + M + '.' + m + '.' + p +
  4095. ' <' + M + '.' + (+m + 1) + '.0'
  4096. }
  4097. } else {
  4098. ret = '>=' + M + '.' + m + '.' + p +
  4099. ' <' + (+M + 1) + '.0.0'
  4100. }
  4101. }
  4102. debug('caret return', ret)
  4103. return ret
  4104. })
  4105. }
  4106. function replaceXRanges (comp, options) {
  4107. debug('replaceXRanges', comp, options)
  4108. return comp.split(/\s+/).map(function (comp) {
  4109. return replaceXRange(comp, options)
  4110. }).join(' ')
  4111. }
  4112. function replaceXRange (comp, options) {
  4113. comp = comp.trim()
  4114. var r = options.loose ? re[XRANGELOOSE] : re[XRANGE]
  4115. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  4116. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  4117. var xM = isX(M)
  4118. var xm = xM || isX(m)
  4119. var xp = xm || isX(p)
  4120. var anyX = xp
  4121. if (gtlt === '=' && anyX) {
  4122. gtlt = ''
  4123. }
  4124. if (xM) {
  4125. if (gtlt === '>' || gtlt === '<') {
  4126. // nothing is allowed
  4127. ret = '<0.0.0'
  4128. } else {
  4129. // nothing is forbidden
  4130. ret = '*'
  4131. }
  4132. } else if (gtlt && anyX) {
  4133. // we know patch is an x, because we have any x at all.
  4134. // replace X with 0
  4135. if (xm) {
  4136. m = 0
  4137. }
  4138. p = 0
  4139. if (gtlt === '>') {
  4140. // >1 => >=2.0.0
  4141. // >1.2 => >=1.3.0
  4142. // >1.2.3 => >= 1.2.4
  4143. gtlt = '>='
  4144. if (xm) {
  4145. M = +M + 1
  4146. m = 0
  4147. p = 0
  4148. } else {
  4149. m = +m + 1
  4150. p = 0
  4151. }
  4152. } else if (gtlt === '<=') {
  4153. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  4154. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  4155. gtlt = '<'
  4156. if (xm) {
  4157. M = +M + 1
  4158. } else {
  4159. m = +m + 1
  4160. }
  4161. }
  4162. ret = gtlt + M + '.' + m + '.' + p
  4163. } else if (xm) {
  4164. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  4165. } else if (xp) {
  4166. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  4167. }
  4168. debug('xRange return', ret)
  4169. return ret
  4170. })
  4171. }
  4172. // Because * is AND-ed with everything else in the comparator,
  4173. // and '' means "any version", just remove the *s entirely.
  4174. function replaceStars (comp, options) {
  4175. debug('replaceStars', comp, options)
  4176. // Looseness is ignored here. star is always as loose as it gets!
  4177. return comp.trim().replace(re[STAR], '')
  4178. }
  4179. // This function is passed to string.replace(re[HYPHENRANGE])
  4180. // M, m, patch, prerelease, build
  4181. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  4182. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  4183. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  4184. function hyphenReplace ($0,
  4185. from, fM, fm, fp, fpr, fb,
  4186. to, tM, tm, tp, tpr, tb) {
  4187. if (isX(fM)) {
  4188. from = ''
  4189. } else if (isX(fm)) {
  4190. from = '>=' + fM + '.0.0'
  4191. } else if (isX(fp)) {
  4192. from = '>=' + fM + '.' + fm + '.0'
  4193. } else {
  4194. from = '>=' + from
  4195. }
  4196. if (isX(tM)) {
  4197. to = ''
  4198. } else if (isX(tm)) {
  4199. to = '<' + (+tM + 1) + '.0.0'
  4200. } else if (isX(tp)) {
  4201. to = '<' + tM + '.' + (+tm + 1) + '.0'
  4202. } else if (tpr) {
  4203. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  4204. } else {
  4205. to = '<=' + to
  4206. }
  4207. return (from + ' ' + to).trim()
  4208. }
  4209. // if ANY of the sets match ALL of its comparators, then pass
  4210. Range.prototype.test = function (version) {
  4211. if (!version) {
  4212. return false
  4213. }
  4214. if (typeof version === 'string') {
  4215. version = new SemVer(version, this.options)
  4216. }
  4217. for (var i = 0; i < this.set.length; i++) {
  4218. if (testSet(this.set[i], version, this.options)) {
  4219. return true
  4220. }
  4221. }
  4222. return false
  4223. }
  4224. function testSet (set, version, options) {
  4225. for (var i = 0; i < set.length; i++) {
  4226. if (!set[i].test(version)) {
  4227. return false
  4228. }
  4229. }
  4230. if (version.prerelease.length && !options.includePrerelease) {
  4231. // Find the set of versions that are allowed to have prereleases
  4232. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  4233. // That should allow `1.2.3-pr.2` to pass.
  4234. // However, `1.2.4-alpha.notready` should NOT be allowed,
  4235. // even though it's within the range set by the comparators.
  4236. for (i = 0; i < set.length; i++) {
  4237. debug(set[i].semver)
  4238. if (set[i].semver === ANY) {
  4239. continue
  4240. }
  4241. if (set[i].semver.prerelease.length > 0) {
  4242. var allowed = set[i].semver
  4243. if (allowed.major === version.major &&
  4244. allowed.minor === version.minor &&
  4245. allowed.patch === version.patch) {
  4246. return true
  4247. }
  4248. }
  4249. }
  4250. // Version has a -pre, but it's not one of the ones we like.
  4251. return false
  4252. }
  4253. return true
  4254. }
  4255. exports.satisfies = satisfies
  4256. function satisfies (version, range, options) {
  4257. try {
  4258. range = new Range(range, options)
  4259. } catch (er) {
  4260. return false
  4261. }
  4262. return range.test(version)
  4263. }
  4264. exports.maxSatisfying = maxSatisfying
  4265. function maxSatisfying (versions, range, options) {
  4266. var max = null
  4267. var maxSV = null
  4268. try {
  4269. var rangeObj = new Range(range, options)
  4270. } catch (er) {
  4271. return null
  4272. }
  4273. versions.forEach(function (v) {
  4274. if (rangeObj.test(v)) {
  4275. // satisfies(v, range, options)
  4276. if (!max || maxSV.compare(v) === -1) {
  4277. // compare(max, v, true)
  4278. max = v
  4279. maxSV = new SemVer(max, options)
  4280. }
  4281. }
  4282. })
  4283. return max
  4284. }
  4285. exports.minSatisfying = minSatisfying
  4286. function minSatisfying (versions, range, options) {
  4287. var min = null
  4288. var minSV = null
  4289. try {
  4290. var rangeObj = new Range(range, options)
  4291. } catch (er) {
  4292. return null
  4293. }
  4294. versions.forEach(function (v) {
  4295. if (rangeObj.test(v)) {
  4296. // satisfies(v, range, options)
  4297. if (!min || minSV.compare(v) === 1) {
  4298. // compare(min, v, true)
  4299. min = v
  4300. minSV = new SemVer(min, options)
  4301. }
  4302. }
  4303. })
  4304. return min
  4305. }
  4306. exports.minVersion = minVersion
  4307. function minVersion (range, loose) {
  4308. range = new Range(range, loose)
  4309. var minver = new SemVer('0.0.0')
  4310. if (range.test(minver)) {
  4311. return minver
  4312. }
  4313. minver = new SemVer('0.0.0-0')
  4314. if (range.test(minver)) {
  4315. return minver
  4316. }
  4317. minver = null
  4318. for (var i = 0; i < range.set.length; ++i) {
  4319. var comparators = range.set[i]
  4320. comparators.forEach(function (comparator) {
  4321. // Clone to avoid manipulating the comparator's semver object.
  4322. var compver = new SemVer(comparator.semver.version)
  4323. switch (comparator.operator) {
  4324. case '>':
  4325. if (compver.prerelease.length === 0) {
  4326. compver.patch++
  4327. } else {
  4328. compver.prerelease.push(0)
  4329. }
  4330. compver.raw = compver.format()
  4331. /* fallthrough */
  4332. case '':
  4333. case '>=':
  4334. if (!minver || gt(minver, compver)) {
  4335. minver = compver
  4336. }
  4337. break
  4338. case '<':
  4339. case '<=':
  4340. /* Ignore maximum versions */
  4341. break
  4342. /* istanbul ignore next */
  4343. default:
  4344. throw new Error('Unexpected operation: ' + comparator.operator)
  4345. }
  4346. })
  4347. }
  4348. if (minver && range.test(minver)) {
  4349. return minver
  4350. }
  4351. return null
  4352. }
  4353. exports.validRange = validRange
  4354. function validRange (range, options) {
  4355. try {
  4356. // Return '*' instead of '' so that truthiness works.
  4357. // This will throw if it's invalid anyway
  4358. return new Range(range, options).range || '*'
  4359. } catch (er) {
  4360. return null
  4361. }
  4362. }
  4363. // Determine if version is less than all the versions possible in the range
  4364. exports.ltr = ltr
  4365. function ltr (version, range, options) {
  4366. return outside(version, range, '<', options)
  4367. }
  4368. // Determine if version is greater than all the versions possible in the range.
  4369. exports.gtr = gtr
  4370. function gtr (version, range, options) {
  4371. return outside(version, range, '>', options)
  4372. }
  4373. exports.outside = outside
  4374. function outside (version, range, hilo, options) {
  4375. version = new SemVer(version, options)
  4376. range = new Range(range, options)
  4377. var gtfn, ltefn, ltfn, comp, ecomp
  4378. switch (hilo) {
  4379. case '>':
  4380. gtfn = gt
  4381. ltefn = lte
  4382. ltfn = lt
  4383. comp = '>'
  4384. ecomp = '>='
  4385. break
  4386. case '<':
  4387. gtfn = lt
  4388. ltefn = gte
  4389. ltfn = gt
  4390. comp = '<'
  4391. ecomp = '<='
  4392. break
  4393. default:
  4394. throw new TypeError('Must provide a hilo val of "<" or ">"')
  4395. }
  4396. // If it satisifes the range it is not outside
  4397. if (satisfies(version, range, options)) {
  4398. return false
  4399. }
  4400. // From now on, variable terms are as if we're in "gtr" mode.
  4401. // but note that everything is flipped for the "ltr" function.
  4402. for (var i = 0; i < range.set.length; ++i) {
  4403. var comparators = range.set[i]
  4404. var high = null
  4405. var low = null
  4406. comparators.forEach(function (comparator) {
  4407. if (comparator.semver === ANY) {
  4408. comparator = new Comparator('>=0.0.0')
  4409. }
  4410. high = high || comparator
  4411. low = low || comparator
  4412. if (gtfn(comparator.semver, high.semver, options)) {
  4413. high = comparator
  4414. } else if (ltfn(comparator.semver, low.semver, options)) {
  4415. low = comparator
  4416. }
  4417. })
  4418. // If the edge version comparator has a operator then our version
  4419. // isn't outside it
  4420. if (high.operator === comp || high.operator === ecomp) {
  4421. return false
  4422. }
  4423. // If the lowest version comparator has an operator and our version
  4424. // is less than it then it isn't higher than the range
  4425. if ((!low.operator || low.operator === comp) &&
  4426. ltefn(version, low.semver)) {
  4427. return false
  4428. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  4429. return false
  4430. }
  4431. }
  4432. return true
  4433. }
  4434. exports.prerelease = prerelease
  4435. function prerelease (version, options) {
  4436. var parsed = parse(version, options)
  4437. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  4438. }
  4439. exports.intersects = intersects
  4440. function intersects (r1, r2, options) {
  4441. r1 = new Range(r1, options)
  4442. r2 = new Range(r2, options)
  4443. return r1.intersects(r2)
  4444. }
  4445. exports.coerce = coerce
  4446. function coerce (version) {
  4447. if (version instanceof SemVer) {
  4448. return version
  4449. }
  4450. if (typeof version !== 'string') {
  4451. return null
  4452. }
  4453. var match = version.match(re[COERCE])
  4454. if (match == null) {
  4455. return null
  4456. }
  4457. return parse(match[1] +
  4458. '.' + (match[2] || '0') +
  4459. '.' + (match[3] || '0'))
  4460. }
  4461. /***/ }),
  4462. /***/ 289:
  4463. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  4464. "use strict";
  4465. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4466. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4467. return new (P || (P = Promise))(function (resolve, reject) {
  4468. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4469. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4470. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4471. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4472. });
  4473. };
  4474. var __importStar = (this && this.__importStar) || function (mod) {
  4475. if (mod && mod.__esModule) return mod;
  4476. var result = {};
  4477. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  4478. result["default"] = mod;
  4479. return result;
  4480. };
  4481. Object.defineProperty(exports, "__esModule", { value: true });
  4482. const core = __importStar(__webpack_require__(470));
  4483. const exec = __importStar(__webpack_require__(986));
  4484. const fshelper = __importStar(__webpack_require__(618));
  4485. const io = __importStar(__webpack_require__(1));
  4486. const path = __importStar(__webpack_require__(622));
  4487. const retryHelper = __importStar(__webpack_require__(587));
  4488. const git_version_1 = __webpack_require__(559);
  4489. // Auth header not supported before 2.9
  4490. // Wire protocol v2 not supported before 2.18
  4491. exports.MinimumGitVersion = new git_version_1.GitVersion('2.18');
  4492. function CreateCommandManager(workingDirectory, lfs) {
  4493. return __awaiter(this, void 0, void 0, function* () {
  4494. return yield GitCommandManager.createCommandManager(workingDirectory, lfs);
  4495. });
  4496. }
  4497. exports.CreateCommandManager = CreateCommandManager;
  4498. class GitCommandManager {
  4499. // Private constructor; use createCommandManager()
  4500. constructor() {
  4501. this.gitEnv = {
  4502. GIT_TERMINAL_PROMPT: '0',
  4503. GCM_INTERACTIVE: 'Never' // Disable prompting for git credential manager
  4504. };
  4505. this.gitPath = '';
  4506. this.lfs = false;
  4507. this.workingDirectory = '';
  4508. }
  4509. branchDelete(remote, branch) {
  4510. return __awaiter(this, void 0, void 0, function* () {
  4511. const args = ['branch', '--delete', '--force'];
  4512. if (remote) {
  4513. args.push('--remote');
  4514. }
  4515. args.push(branch);
  4516. yield this.execGit(args);
  4517. });
  4518. }
  4519. branchExists(remote, pattern) {
  4520. return __awaiter(this, void 0, void 0, function* () {
  4521. const args = ['branch', '--list'];
  4522. if (remote) {
  4523. args.push('--remote');
  4524. }
  4525. args.push(pattern);
  4526. const output = yield this.execGit(args);
  4527. return !!output.stdout.trim();
  4528. });
  4529. }
  4530. branchList(remote) {
  4531. return __awaiter(this, void 0, void 0, function* () {
  4532. const result = [];
  4533. // Note, this implementation uses "rev-parse --symbolic-full-name" because the output from
  4534. // "branch --list" is more difficult when in a detached HEAD state.
  4535. // Note, this implementation uses "rev-parse --symbolic-full-name" because there is a bug
  4536. // in Git 2.18 that causes "rev-parse --symbolic" to output symbolic full names.
  4537. const args = ['rev-parse', '--symbolic-full-name'];
  4538. if (remote) {
  4539. args.push('--remotes=origin');
  4540. }
  4541. else {
  4542. args.push('--branches');
  4543. }
  4544. const output = yield this.execGit(args);
  4545. for (let branch of output.stdout.trim().split('\n')) {
  4546. branch = branch.trim();
  4547. if (branch) {
  4548. if (branch.startsWith('refs/heads/')) {
  4549. branch = branch.substr('refs/heads/'.length);
  4550. }
  4551. else if (branch.startsWith('refs/remotes/')) {
  4552. branch = branch.substr('refs/remotes/'.length);
  4553. }
  4554. result.push(branch);
  4555. }
  4556. }
  4557. return result;
  4558. });
  4559. }
  4560. checkout(ref, startPoint) {
  4561. return __awaiter(this, void 0, void 0, function* () {
  4562. const args = ['checkout', '--progress', '--force'];
  4563. if (startPoint) {
  4564. args.push('-B', ref, startPoint);
  4565. }
  4566. else {
  4567. args.push(ref);
  4568. }
  4569. yield this.execGit(args);
  4570. });
  4571. }
  4572. checkoutDetach() {
  4573. return __awaiter(this, void 0, void 0, function* () {
  4574. const args = ['checkout', '--detach'];
  4575. yield this.execGit(args);
  4576. });
  4577. }
  4578. config(configKey, configValue) {
  4579. return __awaiter(this, void 0, void 0, function* () {
  4580. yield this.execGit(['config', '--local', configKey, configValue]);
  4581. });
  4582. }
  4583. configExists(configKey) {
  4584. return __awaiter(this, void 0, void 0, function* () {
  4585. const pattern = configKey.replace(/[^a-zA-Z0-9_]/g, x => {
  4586. return `\\${x}`;
  4587. });
  4588. const output = yield this.execGit(['config', '--local', '--name-only', '--get-regexp', pattern], true);
  4589. return output.exitCode === 0;
  4590. });
  4591. }
  4592. fetch(fetchDepth, refSpec) {
  4593. return __awaiter(this, void 0, void 0, function* () {
  4594. const args = [
  4595. '-c',
  4596. 'protocol.version=2',
  4597. 'fetch',
  4598. '--no-tags',
  4599. '--prune',
  4600. '--progress',
  4601. '--no-recurse-submodules'
  4602. ];
  4603. if (fetchDepth > 0) {
  4604. args.push(`--depth=${fetchDepth}`);
  4605. }
  4606. else if (fshelper.fileExistsSync(path.join(this.workingDirectory, '.git', 'shallow'))) {
  4607. args.push('--unshallow');
  4608. }
  4609. args.push('origin');
  4610. for (const arg of refSpec) {
  4611. args.push(arg);
  4612. }
  4613. const that = this;
  4614. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  4615. yield that.execGit(args);
  4616. }));
  4617. });
  4618. }
  4619. getWorkingDirectory() {
  4620. return this.workingDirectory;
  4621. }
  4622. init() {
  4623. return __awaiter(this, void 0, void 0, function* () {
  4624. yield this.execGit(['init', this.workingDirectory]);
  4625. });
  4626. }
  4627. isDetached() {
  4628. return __awaiter(this, void 0, void 0, function* () {
  4629. // Note, "branch --show-current" would be simpler but isn't available until Git 2.22
  4630. const output = yield this.execGit(['rev-parse', '--symbolic-full-name', '--verify', '--quiet', 'HEAD'], true);
  4631. return !output.stdout.trim().startsWith('refs/heads/');
  4632. });
  4633. }
  4634. lfsFetch(ref) {
  4635. return __awaiter(this, void 0, void 0, function* () {
  4636. const args = ['lfs', 'fetch', 'origin', ref];
  4637. const that = this;
  4638. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  4639. yield that.execGit(args);
  4640. }));
  4641. });
  4642. }
  4643. lfsInstall() {
  4644. return __awaiter(this, void 0, void 0, function* () {
  4645. yield this.execGit(['lfs', 'install', '--local']);
  4646. });
  4647. }
  4648. log1() {
  4649. return __awaiter(this, void 0, void 0, function* () {
  4650. yield this.execGit(['log', '-1']);
  4651. });
  4652. }
  4653. remoteAdd(remoteName, remoteUrl) {
  4654. return __awaiter(this, void 0, void 0, function* () {
  4655. yield this.execGit(['remote', 'add', remoteName, remoteUrl]);
  4656. });
  4657. }
  4658. tagExists(pattern) {
  4659. return __awaiter(this, void 0, void 0, function* () {
  4660. const output = yield this.execGit(['tag', '--list', pattern]);
  4661. return !!output.stdout.trim();
  4662. });
  4663. }
  4664. tryClean() {
  4665. return __awaiter(this, void 0, void 0, function* () {
  4666. const output = yield this.execGit(['clean', '-ffdx'], true);
  4667. return output.exitCode === 0;
  4668. });
  4669. }
  4670. tryConfigUnset(configKey) {
  4671. return __awaiter(this, void 0, void 0, function* () {
  4672. const output = yield this.execGit(['config', '--local', '--unset-all', configKey], true);
  4673. return output.exitCode === 0;
  4674. });
  4675. }
  4676. tryDisableAutomaticGarbageCollection() {
  4677. return __awaiter(this, void 0, void 0, function* () {
  4678. const output = yield this.execGit(['config', '--local', 'gc.auto', '0'], true);
  4679. return output.exitCode === 0;
  4680. });
  4681. }
  4682. tryGetFetchUrl() {
  4683. return __awaiter(this, void 0, void 0, function* () {
  4684. const output = yield this.execGit(['config', '--local', '--get', 'remote.origin.url'], true);
  4685. if (output.exitCode !== 0) {
  4686. return '';
  4687. }
  4688. const stdout = output.stdout.trim();
  4689. if (stdout.includes('\n')) {
  4690. return '';
  4691. }
  4692. return stdout;
  4693. });
  4694. }
  4695. tryReset() {
  4696. return __awaiter(this, void 0, void 0, function* () {
  4697. const output = yield this.execGit(['reset', '--hard', 'HEAD'], true);
  4698. return output.exitCode === 0;
  4699. });
  4700. }
  4701. static createCommandManager(workingDirectory, lfs) {
  4702. return __awaiter(this, void 0, void 0, function* () {
  4703. const result = new GitCommandManager();
  4704. yield result.initializeCommandManager(workingDirectory, lfs);
  4705. return result;
  4706. });
  4707. }
  4708. execGit(args, allowAllExitCodes = false) {
  4709. return __awaiter(this, void 0, void 0, function* () {
  4710. fshelper.directoryExistsSync(this.workingDirectory, true);
  4711. const result = new GitOutput();
  4712. const env = {};
  4713. for (const key of Object.keys(process.env)) {
  4714. env[key] = process.env[key];
  4715. }
  4716. for (const key of Object.keys(this.gitEnv)) {
  4717. env[key] = this.gitEnv[key];
  4718. }
  4719. const stdout = [];
  4720. const options = {
  4721. cwd: this.workingDirectory,
  4722. env,
  4723. ignoreReturnCode: allowAllExitCodes,
  4724. listeners: {
  4725. stdout: (data) => {
  4726. stdout.push(data.toString());
  4727. }
  4728. }
  4729. };
  4730. result.exitCode = yield exec.exec(`"${this.gitPath}"`, args, options);
  4731. result.stdout = stdout.join('');
  4732. return result;
  4733. });
  4734. }
  4735. initializeCommandManager(workingDirectory, lfs) {
  4736. return __awaiter(this, void 0, void 0, function* () {
  4737. this.workingDirectory = workingDirectory;
  4738. // Git-lfs will try to pull down assets if any of the local/user/system setting exist.
  4739. // If the user didn't enable `LFS` in their pipeline definition, disable LFS fetch/checkout.
  4740. this.lfs = lfs;
  4741. if (!this.lfs) {
  4742. this.gitEnv['GIT_LFS_SKIP_SMUDGE'] = '1';
  4743. }
  4744. this.gitPath = yield io.which('git', true);
  4745. // Git version
  4746. core.debug('Getting git version');
  4747. let gitVersion = new git_version_1.GitVersion();
  4748. let gitOutput = yield this.execGit(['version']);
  4749. let stdout = gitOutput.stdout.trim();
  4750. if (!stdout.includes('\n')) {
  4751. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  4752. if (match) {
  4753. gitVersion = new git_version_1.GitVersion(match[0]);
  4754. }
  4755. }
  4756. if (!gitVersion.isValid()) {
  4757. throw new Error('Unable to determine git version');
  4758. }
  4759. // Minimum git version
  4760. if (!gitVersion.checkMinimum(exports.MinimumGitVersion)) {
  4761. throw new Error(`Minimum required git version is ${exports.MinimumGitVersion}. Your git ('${this.gitPath}') is ${gitVersion}`);
  4762. }
  4763. if (this.lfs) {
  4764. // Git-lfs version
  4765. core.debug('Getting git-lfs version');
  4766. let gitLfsVersion = new git_version_1.GitVersion();
  4767. const gitLfsPath = yield io.which('git-lfs', true);
  4768. gitOutput = yield this.execGit(['lfs', 'version']);
  4769. stdout = gitOutput.stdout.trim();
  4770. if (!stdout.includes('\n')) {
  4771. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  4772. if (match) {
  4773. gitLfsVersion = new git_version_1.GitVersion(match[0]);
  4774. }
  4775. }
  4776. if (!gitLfsVersion.isValid()) {
  4777. throw new Error('Unable to determine git-lfs version');
  4778. }
  4779. // Minimum git-lfs version
  4780. // Note:
  4781. // - Auth header not supported before 2.1
  4782. const minimumGitLfsVersion = new git_version_1.GitVersion('2.1');
  4783. if (!gitLfsVersion.checkMinimum(minimumGitLfsVersion)) {
  4784. throw new Error(`Minimum required git-lfs version is ${minimumGitLfsVersion}. Your git-lfs ('${gitLfsPath}') is ${gitLfsVersion}`);
  4785. }
  4786. }
  4787. // Set the user agent
  4788. const gitHttpUserAgent = `git/${gitVersion} (github-actions-checkout)`;
  4789. core.debug(`Set git useragent to: ${gitHttpUserAgent}`);
  4790. this.gitEnv['GIT_HTTP_USER_AGENT'] = gitHttpUserAgent;
  4791. });
  4792. }
  4793. }
  4794. class GitOutput {
  4795. constructor() {
  4796. this.stdout = '';
  4797. this.exitCode = 0;
  4798. }
  4799. }
  4800. /***/ }),
  4801. /***/ 293:
  4802. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  4803. "use strict";
  4804. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4805. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4806. return new (P || (P = Promise))(function (resolve, reject) {
  4807. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4808. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4809. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4810. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4811. });
  4812. };
  4813. var __importStar = (this && this.__importStar) || function (mod) {
  4814. if (mod && mod.__esModule) return mod;
  4815. var result = {};
  4816. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  4817. result["default"] = mod;
  4818. return result;
  4819. };
  4820. Object.defineProperty(exports, "__esModule", { value: true });
  4821. const core = __importStar(__webpack_require__(470));
  4822. const fs = __importStar(__webpack_require__(747));
  4823. const fsHelper = __importStar(__webpack_require__(618));
  4824. const gitCommandManager = __importStar(__webpack_require__(289));
  4825. const githubApiHelper = __importStar(__webpack_require__(464));
  4826. const io = __importStar(__webpack_require__(1));
  4827. const path = __importStar(__webpack_require__(622));
  4828. const refHelper = __importStar(__webpack_require__(227));
  4829. const stateHelper = __importStar(__webpack_require__(153));
  4830. const authConfigKey = `http.https://github.com/.extraheader`;
  4831. function getSource(settings) {
  4832. return __awaiter(this, void 0, void 0, function* () {
  4833. // Repository URL
  4834. core.info(`Syncing repository: ${settings.repositoryOwner}/${settings.repositoryName}`);
  4835. const repositoryUrl = `https://github.com/${encodeURIComponent(settings.repositoryOwner)}/${encodeURIComponent(settings.repositoryName)}`;
  4836. // Remove conflicting file path
  4837. if (fsHelper.fileExistsSync(settings.repositoryPath)) {
  4838. yield io.rmRF(settings.repositoryPath);
  4839. }
  4840. // Create directory
  4841. let isExisting = true;
  4842. if (!fsHelper.directoryExistsSync(settings.repositoryPath)) {
  4843. isExisting = false;
  4844. yield io.mkdirP(settings.repositoryPath);
  4845. }
  4846. // Git command manager
  4847. const git = yield getGitCommandManager(settings);
  4848. // Prepare existing directory, otherwise recreate
  4849. if (isExisting) {
  4850. yield prepareExistingDirectory(git, settings.repositoryPath, repositoryUrl, settings.clean);
  4851. }
  4852. if (!git) {
  4853. // Downloading using REST API
  4854. core.info(`The repository will be downloaded using the GitHub REST API`);
  4855. core.info(`To create a local Git repository instead, add Git ${gitCommandManager.MinimumGitVersion} or higher to the PATH`);
  4856. yield githubApiHelper.downloadRepository(settings.authToken, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit, settings.repositoryPath);
  4857. }
  4858. else {
  4859. // Save state for POST action
  4860. stateHelper.setRepositoryPath(settings.repositoryPath);
  4861. // Initialize the repository
  4862. if (!fsHelper.directoryExistsSync(path.join(settings.repositoryPath, '.git'))) {
  4863. yield git.init();
  4864. yield git.remoteAdd('origin', repositoryUrl);
  4865. }
  4866. // Disable automatic garbage collection
  4867. if (!(yield git.tryDisableAutomaticGarbageCollection())) {
  4868. core.warning(`Unable to turn off git automatic garbage collection. The git fetch operation may trigger garbage collection and cause a delay.`);
  4869. }
  4870. // Remove possible previous extraheader
  4871. yield removeGitConfig(git, authConfigKey);
  4872. try {
  4873. // Config auth token
  4874. yield configureAuthToken(git, settings.authToken);
  4875. // LFS install
  4876. if (settings.lfs) {
  4877. yield git.lfsInstall();
  4878. }
  4879. // Fetch
  4880. const refSpec = refHelper.getRefSpec(settings.ref, settings.commit);
  4881. yield git.fetch(settings.fetchDepth, refSpec);
  4882. // Checkout info
  4883. const checkoutInfo = yield refHelper.getCheckoutInfo(git, settings.ref, settings.commit);
  4884. // LFS fetch
  4885. // Explicit lfs-fetch to avoid slow checkout (fetches one lfs object at a time).
  4886. // Explicit lfs fetch will fetch lfs objects in parallel.
  4887. if (settings.lfs) {
  4888. yield git.lfsFetch(checkoutInfo.startPoint || checkoutInfo.ref);
  4889. }
  4890. // Checkout
  4891. yield git.checkout(checkoutInfo.ref, checkoutInfo.startPoint);
  4892. // Dump some info about the checked out commit
  4893. yield git.log1();
  4894. }
  4895. finally {
  4896. if (!settings.persistCredentials) {
  4897. yield removeGitConfig(git, authConfigKey);
  4898. }
  4899. }
  4900. }
  4901. });
  4902. }
  4903. exports.getSource = getSource;
  4904. function cleanup(repositoryPath) {
  4905. return __awaiter(this, void 0, void 0, function* () {
  4906. // Repo exists?
  4907. if (!fsHelper.fileExistsSync(path.join(repositoryPath, '.git', 'config'))) {
  4908. return;
  4909. }
  4910. fsHelper.directoryExistsSync(repositoryPath, true);
  4911. // Remove the config key
  4912. const git = yield gitCommandManager.CreateCommandManager(repositoryPath, false);
  4913. yield removeGitConfig(git, authConfigKey);
  4914. });
  4915. }
  4916. exports.cleanup = cleanup;
  4917. function getGitCommandManager(settings) {
  4918. return __awaiter(this, void 0, void 0, function* () {
  4919. core.info(`Working directory is '${settings.repositoryPath}'`);
  4920. let git = null;
  4921. try {
  4922. return yield gitCommandManager.CreateCommandManager(settings.repositoryPath, settings.lfs);
  4923. }
  4924. catch (err) {
  4925. // Git is required for LFS
  4926. if (settings.lfs) {
  4927. throw err;
  4928. }
  4929. // Otherwise fallback to REST API
  4930. return null;
  4931. }
  4932. });
  4933. }
  4934. function prepareExistingDirectory(git, repositoryPath, repositoryUrl, clean) {
  4935. return __awaiter(this, void 0, void 0, function* () {
  4936. let remove = false;
  4937. // Check whether using git or REST API
  4938. if (!git) {
  4939. remove = true;
  4940. }
  4941. // Fetch URL does not match
  4942. else if (!fsHelper.directoryExistsSync(path.join(repositoryPath, '.git')) ||
  4943. repositoryUrl !== (yield git.tryGetFetchUrl())) {
  4944. remove = true;
  4945. }
  4946. else {
  4947. // Delete any index.lock and shallow.lock left by a previously canceled run or crashed git process
  4948. const lockPaths = [
  4949. path.join(repositoryPath, '.git', 'index.lock'),
  4950. path.join(repositoryPath, '.git', 'shallow.lock')
  4951. ];
  4952. for (const lockPath of lockPaths) {
  4953. try {
  4954. yield io.rmRF(lockPath);
  4955. }
  4956. catch (error) {
  4957. core.debug(`Unable to delete '${lockPath}'. ${error.message}`);
  4958. }
  4959. }
  4960. try {
  4961. // Checkout detached HEAD
  4962. if (!(yield git.isDetached())) {
  4963. yield git.checkoutDetach();
  4964. }
  4965. // Remove all refs/heads/*
  4966. let branches = yield git.branchList(false);
  4967. for (const branch of branches) {
  4968. yield git.branchDelete(false, branch);
  4969. }
  4970. // Remove all refs/remotes/origin/* to avoid conflicts
  4971. branches = yield git.branchList(true);
  4972. for (const branch of branches) {
  4973. yield git.branchDelete(true, branch);
  4974. }
  4975. // Clean
  4976. if (clean) {
  4977. if (!(yield git.tryClean())) {
  4978. 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}'.`);
  4979. remove = true;
  4980. }
  4981. else if (!(yield git.tryReset())) {
  4982. remove = true;
  4983. }
  4984. if (remove) {
  4985. core.warning(`Unable to clean or reset the repository. The repository will be recreated instead.`);
  4986. }
  4987. }
  4988. }
  4989. catch (error) {
  4990. core.warning(`Unable to prepare the existing repository. The repository will be recreated instead.`);
  4991. remove = true;
  4992. }
  4993. }
  4994. if (remove) {
  4995. // Delete the contents of the directory. Don't delete the directory itself
  4996. // since it might be the current working directory.
  4997. core.info(`Deleting the contents of '${repositoryPath}'`);
  4998. for (const file of yield fs.promises.readdir(repositoryPath)) {
  4999. yield io.rmRF(path.join(repositoryPath, file));
  5000. }
  5001. }
  5002. });
  5003. }
  5004. function configureAuthToken(git, authToken) {
  5005. return __awaiter(this, void 0, void 0, function* () {
  5006. // Configure a placeholder value. This approach avoids the credential being captured
  5007. // by process creation audit events, which are commonly logged. For more information,
  5008. // refer to https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/manage/component-updates/command-line-process-auditing
  5009. const placeholder = `AUTHORIZATION: basic ***`;
  5010. yield git.config(authConfigKey, placeholder);
  5011. // Determine the basic credential value
  5012. const basicCredential = Buffer.from(`x-access-token:${authToken}`, 'utf8').toString('base64');
  5013. core.setSecret(basicCredential);
  5014. // Replace the value in the config file
  5015. const configPath = path.join(git.getWorkingDirectory(), '.git', 'config');
  5016. let content = (yield fs.promises.readFile(configPath)).toString();
  5017. const placeholderIndex = content.indexOf(placeholder);
  5018. if (placeholderIndex < 0 ||
  5019. placeholderIndex != content.lastIndexOf(placeholder)) {
  5020. throw new Error('Unable to replace auth placeholder in .git/config');
  5021. }
  5022. content = content.replace(placeholder, `AUTHORIZATION: basic ${basicCredential}`);
  5023. yield fs.promises.writeFile(configPath, content);
  5024. });
  5025. }
  5026. function removeGitConfig(git, configKey) {
  5027. return __awaiter(this, void 0, void 0, function* () {
  5028. if ((yield git.configExists(configKey)) &&
  5029. !(yield git.tryConfigUnset(configKey))) {
  5030. // Load the config contents
  5031. core.warning(`Failed to remove '${configKey}' from the git config`);
  5032. }
  5033. });
  5034. }
  5035. /***/ }),
  5036. /***/ 294:
  5037. /***/ (function(module, __unusedexports, __webpack_require__) {
  5038. module.exports = parseOptions;
  5039. const { Deprecation } = __webpack_require__(692);
  5040. const { getUserAgent } = __webpack_require__(796);
  5041. const once = __webpack_require__(969);
  5042. const pkg = __webpack_require__(215);
  5043. const deprecateOptionsTimeout = once((log, deprecation) =>
  5044. log.warn(deprecation)
  5045. );
  5046. const deprecateOptionsAgent = once((log, deprecation) => log.warn(deprecation));
  5047. const deprecateOptionsHeaders = once((log, deprecation) =>
  5048. log.warn(deprecation)
  5049. );
  5050. function parseOptions(options, log, hook) {
  5051. if (options.headers) {
  5052. options.headers = Object.keys(options.headers).reduce((newObj, key) => {
  5053. newObj[key.toLowerCase()] = options.headers[key];
  5054. return newObj;
  5055. }, {});
  5056. }
  5057. const clientDefaults = {
  5058. headers: options.headers || {},
  5059. request: options.request || {},
  5060. mediaType: {
  5061. previews: [],
  5062. format: ""
  5063. }
  5064. };
  5065. if (options.baseUrl) {
  5066. clientDefaults.baseUrl = options.baseUrl;
  5067. }
  5068. if (options.userAgent) {
  5069. clientDefaults.headers["user-agent"] = options.userAgent;
  5070. }
  5071. if (options.previews) {
  5072. clientDefaults.mediaType.previews = options.previews;
  5073. }
  5074. if (options.timeZone) {
  5075. clientDefaults.headers["time-zone"] = options.timeZone;
  5076. }
  5077. if (options.timeout) {
  5078. deprecateOptionsTimeout(
  5079. log,
  5080. new Deprecation(
  5081. "[@octokit/rest] new Octokit({timeout}) is deprecated. Use {request: {timeout}} instead. See https://github.com/octokit/request.js#request"
  5082. )
  5083. );
  5084. clientDefaults.request.timeout = options.timeout;
  5085. }
  5086. if (options.agent) {
  5087. deprecateOptionsAgent(
  5088. log,
  5089. new Deprecation(
  5090. "[@octokit/rest] new Octokit({agent}) is deprecated. Use {request: {agent}} instead. See https://github.com/octokit/request.js#request"
  5091. )
  5092. );
  5093. clientDefaults.request.agent = options.agent;
  5094. }
  5095. if (options.headers) {
  5096. deprecateOptionsHeaders(
  5097. log,
  5098. new Deprecation(
  5099. "[@octokit/rest] new Octokit({headers}) is deprecated. Use {userAgent, previews} instead. See https://github.com/octokit/request.js#request"
  5100. )
  5101. );
  5102. }
  5103. const userAgentOption = clientDefaults.headers["user-agent"];
  5104. const defaultUserAgent = `octokit.js/${pkg.version} ${getUserAgent()}`;
  5105. clientDefaults.headers["user-agent"] = [userAgentOption, defaultUserAgent]
  5106. .filter(Boolean)
  5107. .join(" ");
  5108. clientDefaults.request.hook = hook.bind(null, "request");
  5109. return clientDefaults;
  5110. }
  5111. /***/ }),
  5112. /***/ 297:
  5113. /***/ (function(module) {
  5114. module.exports = class HttpError extends Error {
  5115. constructor (message, code, headers) {
  5116. super(message)
  5117. // Maintains proper stack trace (only available on V8)
  5118. /* istanbul ignore next */
  5119. if (Error.captureStackTrace) {
  5120. Error.captureStackTrace(this, this.constructor)
  5121. }
  5122. this.name = 'HttpError'
  5123. this.code = code
  5124. this.headers = headers
  5125. }
  5126. }
  5127. /***/ }),
  5128. /***/ 301:
  5129. /***/ (function(module, __unusedexports, __webpack_require__) {
  5130. /**
  5131. * Some “list” response that can be paginated have a different response structure
  5132. *
  5133. * They have a `total_count` key in the response (search also has `incomplete_results`,
  5134. * /installation/repositories also has `repository_selection`), as well as a key with
  5135. * the list of the items which name varies from endpoint to endpoint:
  5136. *
  5137. * - https://developer.github.com/v3/search/#example (key `items`)
  5138. * - https://developer.github.com/v3/checks/runs/#response-3 (key: `check_runs`)
  5139. * - https://developer.github.com/v3/checks/suites/#response-1 (key: `check_suites`)
  5140. * - https://developer.github.com/v3/apps/installations/#list-repositories (key: `repositories`)
  5141. * - https://developer.github.com/v3/apps/installations/#list-installations-for-a-user (key `installations`)
  5142. * - https://developer.github.com/v3/orgs/#list-installations-for-an-organization (key `installations`)
  5143. *
  5144. * Octokit normalizes these responses so that paginated results are always returned following
  5145. * the same structure. One challenge is that if the list response has only one page, no Link
  5146. * header is provided, so this header alone is not sufficient to check wether a response is
  5147. * paginated or not. For the exceptions with the namespace, a fallback check for the route
  5148. * paths has to be added in order to normalize the response. We cannot check for the total_count
  5149. * property because it also exists in the response of Get the combined status for a specific ref.
  5150. */
  5151. module.exports = normalizePaginatedListResponse;
  5152. const { Deprecation } = __webpack_require__(692);
  5153. const once = __webpack_require__(969);
  5154. const deprecateIncompleteResults = once((log, deprecation) =>
  5155. log.warn(deprecation)
  5156. );
  5157. const deprecateTotalCount = once((log, deprecation) => log.warn(deprecation));
  5158. const deprecateNamespace = once((log, deprecation) => log.warn(deprecation));
  5159. const REGEX_IS_SEARCH_PATH = /^\/search\//;
  5160. const REGEX_IS_CHECKS_PATH = /^\/repos\/[^/]+\/[^/]+\/commits\/[^/]+\/(check-runs|check-suites)/;
  5161. const REGEX_IS_INSTALLATION_REPOSITORIES_PATH = /^\/installation\/repositories/;
  5162. const REGEX_IS_USER_INSTALLATIONS_PATH = /^\/user\/installations/;
  5163. const REGEX_IS_ORG_INSTALLATIONS_PATH = /^\/orgs\/[^/]+\/installations/;
  5164. function normalizePaginatedListResponse(octokit, url, response) {
  5165. const path = url.replace(octokit.request.endpoint.DEFAULTS.baseUrl, "");
  5166. if (
  5167. !REGEX_IS_SEARCH_PATH.test(path) &&
  5168. !REGEX_IS_CHECKS_PATH.test(path) &&
  5169. !REGEX_IS_INSTALLATION_REPOSITORIES_PATH.test(path) &&
  5170. !REGEX_IS_USER_INSTALLATIONS_PATH.test(path) &&
  5171. !REGEX_IS_ORG_INSTALLATIONS_PATH.test(path)
  5172. ) {
  5173. return;
  5174. }
  5175. // keep the additional properties intact to avoid a breaking change,
  5176. // but log a deprecation warning when accessed
  5177. const incompleteResults = response.data.incomplete_results;
  5178. const repositorySelection = response.data.repository_selection;
  5179. const totalCount = response.data.total_count;
  5180. delete response.data.incomplete_results;
  5181. delete response.data.repository_selection;
  5182. delete response.data.total_count;
  5183. const namespaceKey = Object.keys(response.data)[0];
  5184. response.data = response.data[namespaceKey];
  5185. Object.defineProperty(response.data, namespaceKey, {
  5186. get() {
  5187. deprecateNamespace(
  5188. octokit.log,
  5189. new Deprecation(
  5190. `[@octokit/rest] "result.data.${namespaceKey}" is deprecated. Use "result.data" instead`
  5191. )
  5192. );
  5193. return response.data;
  5194. }
  5195. });
  5196. if (typeof incompleteResults !== "undefined") {
  5197. Object.defineProperty(response.data, "incomplete_results", {
  5198. get() {
  5199. deprecateIncompleteResults(
  5200. octokit.log,
  5201. new Deprecation(
  5202. '[@octokit/rest] "result.data.incomplete_results" is deprecated.'
  5203. )
  5204. );
  5205. return incompleteResults;
  5206. }
  5207. });
  5208. }
  5209. if (typeof repositorySelection !== "undefined") {
  5210. Object.defineProperty(response.data, "repository_selection", {
  5211. get() {
  5212. deprecateTotalCount(
  5213. octokit.log,
  5214. new Deprecation(
  5215. '[@octokit/rest] "result.data.repository_selection" is deprecated.'
  5216. )
  5217. );
  5218. return repositorySelection;
  5219. }
  5220. });
  5221. }
  5222. Object.defineProperty(response.data, "total_count", {
  5223. get() {
  5224. deprecateTotalCount(
  5225. octokit.log,
  5226. new Deprecation(
  5227. '[@octokit/rest] "result.data.total_count" is deprecated.'
  5228. )
  5229. );
  5230. return totalCount;
  5231. }
  5232. });
  5233. }
  5234. /***/ }),
  5235. /***/ 317:
  5236. /***/ (function(module) {
  5237. /**
  5238. * Helpers.
  5239. */
  5240. var s = 1000;
  5241. var m = s * 60;
  5242. var h = m * 60;
  5243. var d = h * 24;
  5244. var w = d * 7;
  5245. var y = d * 365.25;
  5246. /**
  5247. * Parse or format the given `val`.
  5248. *
  5249. * Options:
  5250. *
  5251. * - `long` verbose formatting [false]
  5252. *
  5253. * @param {String|Number} val
  5254. * @param {Object} [options]
  5255. * @throws {Error} throw an error if val is not a non-empty string or a number
  5256. * @return {String|Number}
  5257. * @api public
  5258. */
  5259. module.exports = function(val, options) {
  5260. options = options || {};
  5261. var type = typeof val;
  5262. if (type === 'string' && val.length > 0) {
  5263. return parse(val);
  5264. } else if (type === 'number' && isFinite(val)) {
  5265. return options.long ? fmtLong(val) : fmtShort(val);
  5266. }
  5267. throw new Error(
  5268. 'val is not a non-empty string or a valid number. val=' +
  5269. JSON.stringify(val)
  5270. );
  5271. };
  5272. /**
  5273. * Parse the given `str` and return milliseconds.
  5274. *
  5275. * @param {String} str
  5276. * @return {Number}
  5277. * @api private
  5278. */
  5279. function parse(str) {
  5280. str = String(str);
  5281. if (str.length > 100) {
  5282. return;
  5283. }
  5284. var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
  5285. str
  5286. );
  5287. if (!match) {
  5288. return;
  5289. }
  5290. var n = parseFloat(match[1]);
  5291. var type = (match[2] || 'ms').toLowerCase();
  5292. switch (type) {
  5293. case 'years':
  5294. case 'year':
  5295. case 'yrs':
  5296. case 'yr':
  5297. case 'y':
  5298. return n * y;
  5299. case 'weeks':
  5300. case 'week':
  5301. case 'w':
  5302. return n * w;
  5303. case 'days':
  5304. case 'day':
  5305. case 'd':
  5306. return n * d;
  5307. case 'hours':
  5308. case 'hour':
  5309. case 'hrs':
  5310. case 'hr':
  5311. case 'h':
  5312. return n * h;
  5313. case 'minutes':
  5314. case 'minute':
  5315. case 'mins':
  5316. case 'min':
  5317. case 'm':
  5318. return n * m;
  5319. case 'seconds':
  5320. case 'second':
  5321. case 'secs':
  5322. case 'sec':
  5323. case 's':
  5324. return n * s;
  5325. case 'milliseconds':
  5326. case 'millisecond':
  5327. case 'msecs':
  5328. case 'msec':
  5329. case 'ms':
  5330. return n;
  5331. default:
  5332. return undefined;
  5333. }
  5334. }
  5335. /**
  5336. * Short format for `ms`.
  5337. *
  5338. * @param {Number} ms
  5339. * @return {String}
  5340. * @api private
  5341. */
  5342. function fmtShort(ms) {
  5343. var msAbs = Math.abs(ms);
  5344. if (msAbs >= d) {
  5345. return Math.round(ms / d) + 'd';
  5346. }
  5347. if (msAbs >= h) {
  5348. return Math.round(ms / h) + 'h';
  5349. }
  5350. if (msAbs >= m) {
  5351. return Math.round(ms / m) + 'm';
  5352. }
  5353. if (msAbs >= s) {
  5354. return Math.round(ms / s) + 's';
  5355. }
  5356. return ms + 'ms';
  5357. }
  5358. /**
  5359. * Long format for `ms`.
  5360. *
  5361. * @param {Number} ms
  5362. * @return {String}
  5363. * @api private
  5364. */
  5365. function fmtLong(ms) {
  5366. var msAbs = Math.abs(ms);
  5367. if (msAbs >= d) {
  5368. return plural(ms, msAbs, d, 'day');
  5369. }
  5370. if (msAbs >= h) {
  5371. return plural(ms, msAbs, h, 'hour');
  5372. }
  5373. if (msAbs >= m) {
  5374. return plural(ms, msAbs, m, 'minute');
  5375. }
  5376. if (msAbs >= s) {
  5377. return plural(ms, msAbs, s, 'second');
  5378. }
  5379. return ms + ' ms';
  5380. }
  5381. /**
  5382. * Pluralization helper.
  5383. */
  5384. function plural(ms, msAbs, n, name) {
  5385. var isPlural = msAbs >= n * 1.5;
  5386. return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
  5387. }
  5388. /***/ }),
  5389. /***/ 323:
  5390. /***/ (function(module) {
  5391. "use strict";
  5392. var isStream = module.exports = function (stream) {
  5393. return stream !== null && typeof stream === 'object' && typeof stream.pipe === 'function';
  5394. };
  5395. isStream.writable = function (stream) {
  5396. return isStream(stream) && stream.writable !== false && typeof stream._write === 'function' && typeof stream._writableState === 'object';
  5397. };
  5398. isStream.readable = function (stream) {
  5399. return isStream(stream) && stream.readable !== false && typeof stream._read === 'function' && typeof stream._readableState === 'object';
  5400. };
  5401. isStream.duplex = function (stream) {
  5402. return isStream.writable(stream) && isStream.readable(stream);
  5403. };
  5404. isStream.transform = function (stream) {
  5405. return isStream.duplex(stream) && typeof stream._transform === 'function' && typeof stream._transformState === 'object';
  5406. };
  5407. /***/ }),
  5408. /***/ 336:
  5409. /***/ (function(module, __unusedexports, __webpack_require__) {
  5410. module.exports = hasLastPage
  5411. const deprecate = __webpack_require__(370)
  5412. const getPageLinks = __webpack_require__(577)
  5413. function hasLastPage (link) {
  5414. deprecate(`octokit.hasLastPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  5415. return getPageLinks(link).last
  5416. }
  5417. /***/ }),
  5418. /***/ 348:
  5419. /***/ (function(module, __unusedexports, __webpack_require__) {
  5420. "use strict";
  5421. module.exports = validate;
  5422. const { RequestError } = __webpack_require__(463);
  5423. const get = __webpack_require__(854);
  5424. const set = __webpack_require__(883);
  5425. function validate(octokit, options) {
  5426. if (!options.request.validate) {
  5427. return;
  5428. }
  5429. const { validate: params } = options.request;
  5430. Object.keys(params).forEach(parameterName => {
  5431. const parameter = get(params, parameterName);
  5432. const expectedType = parameter.type;
  5433. let parentParameterName;
  5434. let parentValue;
  5435. let parentParamIsPresent = true;
  5436. let parentParameterIsArray = false;
  5437. if (/\./.test(parameterName)) {
  5438. parentParameterName = parameterName.replace(/\.[^.]+$/, "");
  5439. parentParameterIsArray = parentParameterName.slice(-2) === "[]";
  5440. if (parentParameterIsArray) {
  5441. parentParameterName = parentParameterName.slice(0, -2);
  5442. }
  5443. parentValue = get(options, parentParameterName);
  5444. parentParamIsPresent =
  5445. parentParameterName === "headers" ||
  5446. (typeof parentValue === "object" && parentValue !== null);
  5447. }
  5448. const values = parentParameterIsArray
  5449. ? (get(options, parentParameterName) || []).map(
  5450. value => value[parameterName.split(/\./).pop()]
  5451. )
  5452. : [get(options, parameterName)];
  5453. values.forEach((value, i) => {
  5454. const valueIsPresent = typeof value !== "undefined";
  5455. const valueIsNull = value === null;
  5456. const currentParameterName = parentParameterIsArray
  5457. ? parameterName.replace(/\[\]/, `[${i}]`)
  5458. : parameterName;
  5459. if (!parameter.required && !valueIsPresent) {
  5460. return;
  5461. }
  5462. // if the parent parameter is of type object but allows null
  5463. // then the child parameters can be ignored
  5464. if (!parentParamIsPresent) {
  5465. return;
  5466. }
  5467. if (parameter.allowNull && valueIsNull) {
  5468. return;
  5469. }
  5470. if (!parameter.allowNull && valueIsNull) {
  5471. throw new RequestError(
  5472. `'${currentParameterName}' cannot be null`,
  5473. 400,
  5474. {
  5475. request: options
  5476. }
  5477. );
  5478. }
  5479. if (parameter.required && !valueIsPresent) {
  5480. throw new RequestError(
  5481. `Empty value for parameter '${currentParameterName}': ${JSON.stringify(
  5482. value
  5483. )}`,
  5484. 400,
  5485. {
  5486. request: options
  5487. }
  5488. );
  5489. }
  5490. // parse to integer before checking for enum
  5491. // so that string "1" will match enum with number 1
  5492. if (expectedType === "integer") {
  5493. const unparsedValue = value;
  5494. value = parseInt(value, 10);
  5495. if (isNaN(value)) {
  5496. throw new RequestError(
  5497. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5498. unparsedValue
  5499. )} is NaN`,
  5500. 400,
  5501. {
  5502. request: options
  5503. }
  5504. );
  5505. }
  5506. }
  5507. if (parameter.enum && parameter.enum.indexOf(String(value)) === -1) {
  5508. throw new RequestError(
  5509. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5510. value
  5511. )}`,
  5512. 400,
  5513. {
  5514. request: options
  5515. }
  5516. );
  5517. }
  5518. if (parameter.validation) {
  5519. const regex = new RegExp(parameter.validation);
  5520. if (!regex.test(value)) {
  5521. throw new RequestError(
  5522. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5523. value
  5524. )}`,
  5525. 400,
  5526. {
  5527. request: options
  5528. }
  5529. );
  5530. }
  5531. }
  5532. if (expectedType === "object" && typeof value === "string") {
  5533. try {
  5534. value = JSON.parse(value);
  5535. } catch (exception) {
  5536. throw new RequestError(
  5537. `JSON parse error of value for parameter '${currentParameterName}': ${JSON.stringify(
  5538. value
  5539. )}`,
  5540. 400,
  5541. {
  5542. request: options
  5543. }
  5544. );
  5545. }
  5546. }
  5547. set(options, parameter.mapTo || currentParameterName, value);
  5548. });
  5549. });
  5550. return options;
  5551. }
  5552. /***/ }),
  5553. /***/ 349:
  5554. /***/ (function(module, __unusedexports, __webpack_require__) {
  5555. module.exports = authenticationRequestError;
  5556. const { RequestError } = __webpack_require__(463);
  5557. function authenticationRequestError(state, error, options) {
  5558. /* istanbul ignore next */
  5559. if (!error.headers) throw error;
  5560. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  5561. // handle "2FA required" error only
  5562. if (error.status !== 401 || !otpRequired) {
  5563. throw error;
  5564. }
  5565. if (
  5566. error.status === 401 &&
  5567. otpRequired &&
  5568. error.request &&
  5569. error.request.headers["x-github-otp"]
  5570. ) {
  5571. throw new RequestError(
  5572. "Invalid one-time password for two-factor authentication",
  5573. 401,
  5574. {
  5575. headers: error.headers,
  5576. request: options
  5577. }
  5578. );
  5579. }
  5580. if (typeof state.auth.on2fa !== "function") {
  5581. throw new RequestError(
  5582. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  5583. 401,
  5584. {
  5585. headers: error.headers,
  5586. request: options
  5587. }
  5588. );
  5589. }
  5590. return Promise.resolve()
  5591. .then(() => {
  5592. return state.auth.on2fa();
  5593. })
  5594. .then(oneTimePassword => {
  5595. const newOptions = Object.assign(options, {
  5596. headers: Object.assign(
  5597. { "x-github-otp": oneTimePassword },
  5598. options.headers
  5599. )
  5600. });
  5601. return state.octokit.request(newOptions);
  5602. });
  5603. }
  5604. /***/ }),
  5605. /***/ 357:
  5606. /***/ (function(module) {
  5607. module.exports = require("assert");
  5608. /***/ }),
  5609. /***/ 363:
  5610. /***/ (function(module) {
  5611. module.exports = register
  5612. function register (state, name, method, options) {
  5613. if (typeof method !== 'function') {
  5614. throw new Error('method for before hook must be a function')
  5615. }
  5616. if (!options) {
  5617. options = {}
  5618. }
  5619. if (Array.isArray(name)) {
  5620. return name.reverse().reduce(function (callback, name) {
  5621. return register.bind(null, state, name, callback, options)
  5622. }, method)()
  5623. }
  5624. return Promise.resolve()
  5625. .then(function () {
  5626. if (!state.registry[name]) {
  5627. return method(options)
  5628. }
  5629. return (state.registry[name]).reduce(function (method, registered) {
  5630. return registered.hook.bind(null, method, options)
  5631. }, method)()
  5632. })
  5633. }
  5634. /***/ }),
  5635. /***/ 364:
  5636. /***/ (function(module) {
  5637. "use strict";
  5638. module.exports = (flag, argv) => {
  5639. argv = argv || process.argv;
  5640. const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');
  5641. const pos = argv.indexOf(prefix + flag);
  5642. const terminatorPos = argv.indexOf('--');
  5643. return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
  5644. };
  5645. /***/ }),
  5646. /***/ 368:
  5647. /***/ (function(module) {
  5648. module.exports = function atob(str) {
  5649. return Buffer.from(str, 'base64').toString('binary')
  5650. }
  5651. /***/ }),
  5652. /***/ 370:
  5653. /***/ (function(module) {
  5654. module.exports = deprecate
  5655. const loggedMessages = {}
  5656. function deprecate (message) {
  5657. if (loggedMessages[message]) {
  5658. return
  5659. }
  5660. console.warn(`DEPRECATED (@octokit/rest): ${message}`)
  5661. loggedMessages[message] = 1
  5662. }
  5663. /***/ }),
  5664. /***/ 372:
  5665. /***/ (function(module) {
  5666. module.exports = octokitDebug;
  5667. function octokitDebug(octokit) {
  5668. octokit.hook.wrap("request", (request, options) => {
  5669. octokit.log.debug("request", options);
  5670. const start = Date.now();
  5671. const requestOptions = octokit.request.endpoint.parse(options);
  5672. const path = requestOptions.url.replace(options.baseUrl, "");
  5673. return request(options)
  5674. .then(response => {
  5675. octokit.log.info(
  5676. `${requestOptions.method} ${path} - ${
  5677. response.status
  5678. } in ${Date.now() - start}ms`
  5679. );
  5680. return response;
  5681. })
  5682. .catch(error => {
  5683. octokit.log.info(
  5684. `${requestOptions.method} ${path} - ${error.status} in ${Date.now() -
  5685. start}ms`
  5686. );
  5687. throw error;
  5688. });
  5689. });
  5690. }
  5691. /***/ }),
  5692. /***/ 385:
  5693. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  5694. "use strict";
  5695. Object.defineProperty(exports, '__esModule', { value: true });
  5696. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  5697. var isPlainObject = _interopDefault(__webpack_require__(696));
  5698. var universalUserAgent = __webpack_require__(796);
  5699. function lowercaseKeys(object) {
  5700. if (!object) {
  5701. return {};
  5702. }
  5703. return Object.keys(object).reduce((newObj, key) => {
  5704. newObj[key.toLowerCase()] = object[key];
  5705. return newObj;
  5706. }, {});
  5707. }
  5708. function mergeDeep(defaults, options) {
  5709. const result = Object.assign({}, defaults);
  5710. Object.keys(options).forEach(key => {
  5711. if (isPlainObject(options[key])) {
  5712. if (!(key in defaults)) Object.assign(result, {
  5713. [key]: options[key]
  5714. });else result[key] = mergeDeep(defaults[key], options[key]);
  5715. } else {
  5716. Object.assign(result, {
  5717. [key]: options[key]
  5718. });
  5719. }
  5720. });
  5721. return result;
  5722. }
  5723. function merge(defaults, route, options) {
  5724. if (typeof route === "string") {
  5725. let [method, url] = route.split(" ");
  5726. options = Object.assign(url ? {
  5727. method,
  5728. url
  5729. } : {
  5730. url: method
  5731. }, options);
  5732. } else {
  5733. options = Object.assign({}, route);
  5734. } // lowercase header names before merging with defaults to avoid duplicates
  5735. options.headers = lowercaseKeys(options.headers);
  5736. const mergedOptions = mergeDeep(defaults || {}, options); // mediaType.previews arrays are merged, instead of overwritten
  5737. if (defaults && defaults.mediaType.previews.length) {
  5738. mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(preview => !mergedOptions.mediaType.previews.includes(preview)).concat(mergedOptions.mediaType.previews);
  5739. }
  5740. mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map(preview => preview.replace(/-preview/, ""));
  5741. return mergedOptions;
  5742. }
  5743. function addQueryParameters(url, parameters) {
  5744. const separator = /\?/.test(url) ? "&" : "?";
  5745. const names = Object.keys(parameters);
  5746. if (names.length === 0) {
  5747. return url;
  5748. }
  5749. return url + separator + names.map(name => {
  5750. if (name === "q") {
  5751. return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+");
  5752. }
  5753. return `${name}=${encodeURIComponent(parameters[name])}`;
  5754. }).join("&");
  5755. }
  5756. const urlVariableRegex = /\{[^}]+\}/g;
  5757. function removeNonChars(variableName) {
  5758. return variableName.replace(/^\W+|\W+$/g, "").split(/,/);
  5759. }
  5760. function extractUrlVariableNames(url) {
  5761. const matches = url.match(urlVariableRegex);
  5762. if (!matches) {
  5763. return [];
  5764. }
  5765. return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
  5766. }
  5767. function omit(object, keysToOmit) {
  5768. return Object.keys(object).filter(option => !keysToOmit.includes(option)).reduce((obj, key) => {
  5769. obj[key] = object[key];
  5770. return obj;
  5771. }, {});
  5772. }
  5773. // Based on https://github.com/bramstein/url-template, licensed under BSD
  5774. // TODO: create separate package.
  5775. //
  5776. // Copyright (c) 2012-2014, Bram Stein
  5777. // All rights reserved.
  5778. // Redistribution and use in source and binary forms, with or without
  5779. // modification, are permitted provided that the following conditions
  5780. // are met:
  5781. // 1. Redistributions of source code must retain the above copyright
  5782. // notice, this list of conditions and the following disclaimer.
  5783. // 2. Redistributions in binary form must reproduce the above copyright
  5784. // notice, this list of conditions and the following disclaimer in the
  5785. // documentation and/or other materials provided with the distribution.
  5786. // 3. The name of the author may not be used to endorse or promote products
  5787. // derived from this software without specific prior written permission.
  5788. // THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
  5789. // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  5790. // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  5791. // EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  5792. // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  5793. // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  5794. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  5795. // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  5796. // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  5797. // EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  5798. /* istanbul ignore file */
  5799. function encodeReserved(str) {
  5800. return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) {
  5801. if (!/%[0-9A-Fa-f]/.test(part)) {
  5802. part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]");
  5803. }
  5804. return part;
  5805. }).join("");
  5806. }
  5807. function encodeUnreserved(str) {
  5808. return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {
  5809. return "%" + c.charCodeAt(0).toString(16).toUpperCase();
  5810. });
  5811. }
  5812. function encodeValue(operator, value, key) {
  5813. value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value);
  5814. if (key) {
  5815. return encodeUnreserved(key) + "=" + value;
  5816. } else {
  5817. return value;
  5818. }
  5819. }
  5820. function isDefined(value) {
  5821. return value !== undefined && value !== null;
  5822. }
  5823. function isKeyOperator(operator) {
  5824. return operator === ";" || operator === "&" || operator === "?";
  5825. }
  5826. function getValues(context, operator, key, modifier) {
  5827. var value = context[key],
  5828. result = [];
  5829. if (isDefined(value) && value !== "") {
  5830. if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
  5831. value = value.toString();
  5832. if (modifier && modifier !== "*") {
  5833. value = value.substring(0, parseInt(modifier, 10));
  5834. }
  5835. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  5836. } else {
  5837. if (modifier === "*") {
  5838. if (Array.isArray(value)) {
  5839. value.filter(isDefined).forEach(function (value) {
  5840. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  5841. });
  5842. } else {
  5843. Object.keys(value).forEach(function (k) {
  5844. if (isDefined(value[k])) {
  5845. result.push(encodeValue(operator, value[k], k));
  5846. }
  5847. });
  5848. }
  5849. } else {
  5850. const tmp = [];
  5851. if (Array.isArray(value)) {
  5852. value.filter(isDefined).forEach(function (value) {
  5853. tmp.push(encodeValue(operator, value));
  5854. });
  5855. } else {
  5856. Object.keys(value).forEach(function (k) {
  5857. if (isDefined(value[k])) {
  5858. tmp.push(encodeUnreserved(k));
  5859. tmp.push(encodeValue(operator, value[k].toString()));
  5860. }
  5861. });
  5862. }
  5863. if (isKeyOperator(operator)) {
  5864. result.push(encodeUnreserved(key) + "=" + tmp.join(","));
  5865. } else if (tmp.length !== 0) {
  5866. result.push(tmp.join(","));
  5867. }
  5868. }
  5869. }
  5870. } else {
  5871. if (operator === ";") {
  5872. if (isDefined(value)) {
  5873. result.push(encodeUnreserved(key));
  5874. }
  5875. } else if (value === "" && (operator === "&" || operator === "?")) {
  5876. result.push(encodeUnreserved(key) + "=");
  5877. } else if (value === "") {
  5878. result.push("");
  5879. }
  5880. }
  5881. return result;
  5882. }
  5883. function parseUrl(template) {
  5884. return {
  5885. expand: expand.bind(null, template)
  5886. };
  5887. }
  5888. function expand(template, context) {
  5889. var operators = ["+", "#", ".", "/", ";", "?", "&"];
  5890. return template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function (_, expression, literal) {
  5891. if (expression) {
  5892. let operator = "";
  5893. const values = [];
  5894. if (operators.indexOf(expression.charAt(0)) !== -1) {
  5895. operator = expression.charAt(0);
  5896. expression = expression.substr(1);
  5897. }
  5898. expression.split(/,/g).forEach(function (variable) {
  5899. var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
  5900. values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
  5901. });
  5902. if (operator && operator !== "+") {
  5903. var separator = ",";
  5904. if (operator === "?") {
  5905. separator = "&";
  5906. } else if (operator !== "#") {
  5907. separator = operator;
  5908. }
  5909. return (values.length !== 0 ? operator : "") + values.join(separator);
  5910. } else {
  5911. return values.join(",");
  5912. }
  5913. } else {
  5914. return encodeReserved(literal);
  5915. }
  5916. });
  5917. }
  5918. function parse(options) {
  5919. // https://fetch.spec.whatwg.org/#methods
  5920. let method = options.method.toUpperCase(); // replace :varname with {varname} to make it RFC 6570 compatible
  5921. let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{+$1}");
  5922. let headers = Object.assign({}, options.headers);
  5923. let body;
  5924. let parameters = omit(options, ["method", "baseUrl", "url", "headers", "request", "mediaType"]); // extract variable names from URL to calculate remaining variables later
  5925. const urlVariableNames = extractUrlVariableNames(url);
  5926. url = parseUrl(url).expand(parameters);
  5927. if (!/^http/.test(url)) {
  5928. url = options.baseUrl + url;
  5929. }
  5930. const omittedParameters = Object.keys(options).filter(option => urlVariableNames.includes(option)).concat("baseUrl");
  5931. const remainingParameters = omit(parameters, omittedParameters);
  5932. const isBinaryRequset = /application\/octet-stream/i.test(headers.accept);
  5933. if (!isBinaryRequset) {
  5934. if (options.mediaType.format) {
  5935. // e.g. application/vnd.github.v3+json => application/vnd.github.v3.raw
  5936. headers.accept = headers.accept.split(/,/).map(preview => preview.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`)).join(",");
  5937. }
  5938. if (options.mediaType.previews.length) {
  5939. const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || [];
  5940. headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map(preview => {
  5941. const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json";
  5942. return `application/vnd.github.${preview}-preview${format}`;
  5943. }).join(",");
  5944. }
  5945. } // for GET/HEAD requests, set URL query parameters from remaining parameters
  5946. // for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters
  5947. if (["GET", "HEAD"].includes(method)) {
  5948. url = addQueryParameters(url, remainingParameters);
  5949. } else {
  5950. if ("data" in remainingParameters) {
  5951. body = remainingParameters.data;
  5952. } else {
  5953. if (Object.keys(remainingParameters).length) {
  5954. body = remainingParameters;
  5955. } else {
  5956. headers["content-length"] = 0;
  5957. }
  5958. }
  5959. } // default content-type for JSON if body is set
  5960. if (!headers["content-type"] && typeof body !== "undefined") {
  5961. headers["content-type"] = "application/json; charset=utf-8";
  5962. } // GitHub expects 'content-length: 0' header for PUT/PATCH requests without body.
  5963. // fetch does not allow to set `content-length` header, but we can set body to an empty string
  5964. if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") {
  5965. body = "";
  5966. } // Only return body/request keys if present
  5967. return Object.assign({
  5968. method,
  5969. url,
  5970. headers
  5971. }, typeof body !== "undefined" ? {
  5972. body
  5973. } : null, options.request ? {
  5974. request: options.request
  5975. } : null);
  5976. }
  5977. function endpointWithDefaults(defaults, route, options) {
  5978. return parse(merge(defaults, route, options));
  5979. }
  5980. function withDefaults(oldDefaults, newDefaults) {
  5981. const DEFAULTS = merge(oldDefaults, newDefaults);
  5982. const endpoint = endpointWithDefaults.bind(null, DEFAULTS);
  5983. return Object.assign(endpoint, {
  5984. DEFAULTS,
  5985. defaults: withDefaults.bind(null, DEFAULTS),
  5986. merge: merge.bind(null, DEFAULTS),
  5987. parse
  5988. });
  5989. }
  5990. const VERSION = "5.5.1";
  5991. const userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`; // DEFAULTS has all properties set that EndpointOptions has, except url.
  5992. // So we use RequestParameters and add method as additional required property.
  5993. const DEFAULTS = {
  5994. method: "GET",
  5995. baseUrl: "https://api.github.com",
  5996. headers: {
  5997. accept: "application/vnd.github.v3+json",
  5998. "user-agent": userAgent
  5999. },
  6000. mediaType: {
  6001. format: "",
  6002. previews: []
  6003. }
  6004. };
  6005. const endpoint = withDefaults(null, DEFAULTS);
  6006. exports.endpoint = endpoint;
  6007. //# sourceMappingURL=index.js.map
  6008. /***/ }),
  6009. /***/ 389:
  6010. /***/ (function(module, __unusedexports, __webpack_require__) {
  6011. "use strict";
  6012. const fs = __webpack_require__(747);
  6013. const shebangCommand = __webpack_require__(866);
  6014. function readShebang(command) {
  6015. // Read the first 150 bytes from the file
  6016. const size = 150;
  6017. let buffer;
  6018. if (Buffer.alloc) {
  6019. // Node.js v4.5+ / v5.10+
  6020. buffer = Buffer.alloc(size);
  6021. } else {
  6022. // Old Node.js API
  6023. buffer = new Buffer(size);
  6024. buffer.fill(0); // zero-fill
  6025. }
  6026. let fd;
  6027. try {
  6028. fd = fs.openSync(command, 'r');
  6029. fs.readSync(fd, buffer, 0, size, 0);
  6030. fs.closeSync(fd);
  6031. } catch (e) { /* Empty */ }
  6032. // Attempt to extract shebang (null is returned if not a shebang)
  6033. return shebangCommand(buffer.toString());
  6034. }
  6035. module.exports = readShebang;
  6036. /***/ }),
  6037. /***/ 402:
  6038. /***/ (function(module, __unusedexports, __webpack_require__) {
  6039. module.exports = Octokit;
  6040. const { request } = __webpack_require__(753);
  6041. const Hook = __webpack_require__(523);
  6042. const parseClientOptions = __webpack_require__(294);
  6043. function Octokit(plugins, options) {
  6044. options = options || {};
  6045. const hook = new Hook.Collection();
  6046. const log = Object.assign(
  6047. {
  6048. debug: () => {},
  6049. info: () => {},
  6050. warn: console.warn,
  6051. error: console.error
  6052. },
  6053. options && options.log
  6054. );
  6055. const api = {
  6056. hook,
  6057. log,
  6058. request: request.defaults(parseClientOptions(options, log, hook))
  6059. };
  6060. plugins.forEach(pluginFunction => pluginFunction(api, options));
  6061. return api;
  6062. }
  6063. /***/ }),
  6064. /***/ 413:
  6065. /***/ (function(module) {
  6066. module.exports = require("stream");
  6067. /***/ }),
  6068. /***/ 417:
  6069. /***/ (function(module) {
  6070. module.exports = require("crypto");
  6071. /***/ }),
  6072. /***/ 427:
  6073. /***/ (function(module, __unusedexports, __webpack_require__) {
  6074. "use strict";
  6075. // Older verions of Node.js might not have `util.getSystemErrorName()`.
  6076. // In that case, fall back to a deprecated internal.
  6077. const util = __webpack_require__(669);
  6078. let uv;
  6079. if (typeof util.getSystemErrorName === 'function') {
  6080. module.exports = util.getSystemErrorName;
  6081. } else {
  6082. try {
  6083. uv = process.binding('uv');
  6084. if (typeof uv.errname !== 'function') {
  6085. throw new TypeError('uv.errname is not a function');
  6086. }
  6087. } catch (err) {
  6088. console.error('execa/lib/errname: unable to establish process.binding(\'uv\')', err);
  6089. uv = null;
  6090. }
  6091. module.exports = code => errname(uv, code);
  6092. }
  6093. // Used for testing the fallback behavior
  6094. module.exports.__test__ = errname;
  6095. function errname(uv, code) {
  6096. if (uv) {
  6097. return uv.errname(code);
  6098. }
  6099. if (!(code < 0)) {
  6100. throw new Error('err >= 0');
  6101. }
  6102. return `Unknown system error ${code}`;
  6103. }
  6104. /***/ }),
  6105. /***/ 430:
  6106. /***/ (function(module, __unusedexports, __webpack_require__) {
  6107. module.exports = octokitValidate;
  6108. const validate = __webpack_require__(348);
  6109. function octokitValidate(octokit) {
  6110. octokit.hook.before("request", validate.bind(null, octokit));
  6111. }
  6112. /***/ }),
  6113. /***/ 431:
  6114. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  6115. "use strict";
  6116. Object.defineProperty(exports, "__esModule", { value: true });
  6117. const os = __webpack_require__(87);
  6118. /**
  6119. * Commands
  6120. *
  6121. * Command Format:
  6122. * ##[name key=value;key=value]message
  6123. *
  6124. * Examples:
  6125. * ##[warning]This is the user warning message
  6126. * ##[set-secret name=mypassword]definitelyNotAPassword!
  6127. */
  6128. function issueCommand(command, properties, message) {
  6129. const cmd = new Command(command, properties, message);
  6130. process.stdout.write(cmd.toString() + os.EOL);
  6131. }
  6132. exports.issueCommand = issueCommand;
  6133. function issue(name, message = '') {
  6134. issueCommand(name, {}, message);
  6135. }
  6136. exports.issue = issue;
  6137. const CMD_STRING = '::';
  6138. class Command {
  6139. constructor(command, properties, message) {
  6140. if (!command) {
  6141. command = 'missing.command';
  6142. }
  6143. this.command = command;
  6144. this.properties = properties;
  6145. this.message = message;
  6146. }
  6147. toString() {
  6148. let cmdStr = CMD_STRING + this.command;
  6149. if (this.properties && Object.keys(this.properties).length > 0) {
  6150. cmdStr += ' ';
  6151. for (const key in this.properties) {
  6152. if (this.properties.hasOwnProperty(key)) {
  6153. const val = this.properties[key];
  6154. if (val) {
  6155. // safely append the val - avoid blowing up when attempting to
  6156. // call .replace() if message is not a string for some reason
  6157. cmdStr += `${key}=${escape(`${val || ''}`)},`;
  6158. }
  6159. }
  6160. }
  6161. }
  6162. cmdStr += CMD_STRING;
  6163. // safely append the message - avoid blowing up when attempting to
  6164. // call .replace() if message is not a string for some reason
  6165. const message = `${this.message || ''}`;
  6166. cmdStr += escapeData(message);
  6167. return cmdStr;
  6168. }
  6169. }
  6170. function escapeData(s) {
  6171. return s.replace(/\r/g, '%0D').replace(/\n/g, '%0A');
  6172. }
  6173. function escape(s) {
  6174. return s
  6175. .replace(/\r/g, '%0D')
  6176. .replace(/\n/g, '%0A')
  6177. .replace(/]/g, '%5D')
  6178. .replace(/;/g, '%3B');
  6179. }
  6180. //# sourceMappingURL=command.js.map
  6181. /***/ }),
  6182. /***/ 443:
  6183. /***/ (function(module, __unusedexports, __webpack_require__) {
  6184. "use strict";
  6185. var __importDefault = (this && this.__importDefault) || function (mod) {
  6186. return (mod && mod.__esModule) ? mod : { "default": mod };
  6187. };
  6188. const events_1 = __webpack_require__(614);
  6189. const promisify_1 = __importDefault(__webpack_require__(537));
  6190. function isAgentBase(v) {
  6191. return Boolean(v) && typeof v.addRequest === 'function';
  6192. }
  6193. function isHttpAgent(v) {
  6194. return Boolean(v) && typeof v.addRequest === 'function';
  6195. }
  6196. function isSecureEndpoint() {
  6197. const { stack } = new Error();
  6198. if (typeof stack !== 'string')
  6199. return false;
  6200. return stack.split('\n').some(l => l.indexOf('(https.js:') !== -1);
  6201. }
  6202. function createAgent(callback, opts) {
  6203. return new createAgent.Agent(callback, opts);
  6204. }
  6205. (function (createAgent) {
  6206. /**
  6207. * Base `http.Agent` implementation.
  6208. * No pooling/keep-alive is implemented by default.
  6209. *
  6210. * @param {Function} callback
  6211. * @api public
  6212. */
  6213. class Agent extends events_1.EventEmitter {
  6214. constructor(callback, _opts) {
  6215. super();
  6216. // The callback gets promisified lazily
  6217. this.promisifiedCallback = undefined;
  6218. let opts = _opts;
  6219. if (typeof callback === 'function') {
  6220. this.callback = callback;
  6221. }
  6222. else if (callback) {
  6223. opts = callback;
  6224. }
  6225. // timeout for the socket to be returned from the callback
  6226. this.timeout = null;
  6227. if (opts && typeof opts.timeout === 'number') {
  6228. this.timeout = opts.timeout;
  6229. }
  6230. this.options = opts || {};
  6231. this.maxFreeSockets = 1;
  6232. this.maxSockets = 1;
  6233. this.sockets = [];
  6234. this.requests = [];
  6235. }
  6236. get defaultPort() {
  6237. if (typeof this.explicitDefaultPort === 'number') {
  6238. return this.explicitDefaultPort;
  6239. }
  6240. else {
  6241. return isSecureEndpoint() ? 443 : 80;
  6242. }
  6243. }
  6244. set defaultPort(v) {
  6245. this.explicitDefaultPort = v;
  6246. }
  6247. get protocol() {
  6248. if (typeof this.explicitProtocol === 'string') {
  6249. return this.explicitProtocol;
  6250. }
  6251. else {
  6252. return isSecureEndpoint() ? 'https:' : 'http:';
  6253. }
  6254. }
  6255. set protocol(v) {
  6256. this.explicitProtocol = v;
  6257. }
  6258. callback(req, opts, fn) {
  6259. throw new Error('"agent-base" has no default implementation, you must subclass and override `callback()`');
  6260. }
  6261. /**
  6262. * Called by node-core's "_http_client.js" module when creating
  6263. * a new HTTP request with this Agent instance.
  6264. *
  6265. * @api public
  6266. */
  6267. addRequest(req, _opts) {
  6268. const ownOpts = Object.assign({}, _opts);
  6269. if (typeof ownOpts.secureEndpoint !== 'boolean') {
  6270. ownOpts.secureEndpoint = isSecureEndpoint();
  6271. }
  6272. // Set default `host` for HTTP to localhost
  6273. if (ownOpts.host == null) {
  6274. ownOpts.host = 'localhost';
  6275. }
  6276. // Set default `port` for HTTP if none was explicitly specified
  6277. if (ownOpts.port == null) {
  6278. ownOpts.port = ownOpts.secureEndpoint ? 443 : 80;
  6279. }
  6280. const opts = Object.assign(Object.assign({}, this.options), ownOpts);
  6281. if (opts.host && opts.path) {
  6282. // If both a `host` and `path` are specified then it's most likely the
  6283. // result of a `url.parse()` call... we need to remove the `path` portion so
  6284. // that `net.connect()` doesn't attempt to open that as a unix socket file.
  6285. delete opts.path;
  6286. }
  6287. delete opts.agent;
  6288. delete opts.hostname;
  6289. delete opts._defaultAgent;
  6290. delete opts.defaultPort;
  6291. delete opts.createConnection;
  6292. // Hint to use "Connection: close"
  6293. // XXX: non-documented `http` module API :(
  6294. req._last = true;
  6295. req.shouldKeepAlive = false;
  6296. // Create the `stream.Duplex` instance
  6297. let timedOut = false;
  6298. let timeout = null;
  6299. const timeoutMs = this.timeout;
  6300. const freeSocket = this.freeSocket;
  6301. function onerror(err) {
  6302. if (req._hadError)
  6303. return;
  6304. req.emit('error', err);
  6305. // For Safety. Some additional errors might fire later on
  6306. // and we need to make sure we don't double-fire the error event.
  6307. req._hadError = true;
  6308. }
  6309. function ontimeout() {
  6310. timeout = null;
  6311. timedOut = true;
  6312. const err = new Error(`A "socket" was not created for HTTP request before ${timeoutMs}ms`);
  6313. err.code = 'ETIMEOUT';
  6314. onerror(err);
  6315. }
  6316. function callbackError(err) {
  6317. if (timedOut)
  6318. return;
  6319. if (timeout !== null) {
  6320. clearTimeout(timeout);
  6321. timeout = null;
  6322. }
  6323. onerror(err);
  6324. }
  6325. function onsocket(socket) {
  6326. let sock;
  6327. function onfree() {
  6328. freeSocket(sock, opts);
  6329. }
  6330. if (timedOut)
  6331. return;
  6332. if (timeout != null) {
  6333. clearTimeout(timeout);
  6334. timeout = null;
  6335. }
  6336. if (isAgentBase(socket) || isHttpAgent(socket)) {
  6337. // `socket` is actually an `http.Agent` instance, so
  6338. // relinquish responsibility for this `req` to the Agent
  6339. // from here on
  6340. socket.addRequest(req, opts);
  6341. return;
  6342. }
  6343. if (socket) {
  6344. sock = socket;
  6345. sock.on('free', onfree);
  6346. req.onSocket(sock);
  6347. return;
  6348. }
  6349. const err = new Error(`no Duplex stream was returned to agent-base for \`${req.method} ${req.path}\``);
  6350. onerror(err);
  6351. }
  6352. if (typeof this.callback !== 'function') {
  6353. onerror(new Error('`callback` is not defined'));
  6354. return;
  6355. }
  6356. if (!this.promisifiedCallback) {
  6357. if (this.callback.length >= 3) {
  6358. // Legacy callback function - convert to a Promise
  6359. this.promisifiedCallback = promisify_1.default(this.callback);
  6360. }
  6361. else {
  6362. this.promisifiedCallback = this.callback;
  6363. }
  6364. }
  6365. if (typeof timeoutMs === 'number' && timeoutMs > 0) {
  6366. timeout = setTimeout(ontimeout, timeoutMs);
  6367. }
  6368. if ('port' in opts && typeof opts.port !== 'number') {
  6369. opts.port = Number(opts.port);
  6370. }
  6371. try {
  6372. Promise.resolve(this.promisifiedCallback(req, opts)).then(onsocket, callbackError);
  6373. }
  6374. catch (err) {
  6375. Promise.reject(err).catch(callbackError);
  6376. }
  6377. }
  6378. freeSocket(socket, opts) {
  6379. // TODO reuse sockets
  6380. socket.destroy();
  6381. }
  6382. destroy() { }
  6383. }
  6384. createAgent.Agent = Agent;
  6385. })(createAgent || (createAgent = {}));
  6386. // So that `instanceof` works correctly
  6387. createAgent.prototype = createAgent.Agent.prototype;
  6388. module.exports = createAgent;
  6389. //# sourceMappingURL=index.js.map
  6390. /***/ }),
  6391. /***/ 453:
  6392. /***/ (function(module, __unusedexports, __webpack_require__) {
  6393. var once = __webpack_require__(969)
  6394. var eos = __webpack_require__(562)
  6395. var fs = __webpack_require__(747) // we only need fs to get the ReadStream and WriteStream prototypes
  6396. var noop = function () {}
  6397. var ancient = /^v?\.0/.test(process.version)
  6398. var isFn = function (fn) {
  6399. return typeof fn === 'function'
  6400. }
  6401. var isFS = function (stream) {
  6402. if (!ancient) return false // newer node version do not need to care about fs is a special way
  6403. if (!fs) return false // browser
  6404. return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close)
  6405. }
  6406. var isRequest = function (stream) {
  6407. return stream.setHeader && isFn(stream.abort)
  6408. }
  6409. var destroyer = function (stream, reading, writing, callback) {
  6410. callback = once(callback)
  6411. var closed = false
  6412. stream.on('close', function () {
  6413. closed = true
  6414. })
  6415. eos(stream, {readable: reading, writable: writing}, function (err) {
  6416. if (err) return callback(err)
  6417. closed = true
  6418. callback()
  6419. })
  6420. var destroyed = false
  6421. return function (err) {
  6422. if (closed) return
  6423. if (destroyed) return
  6424. destroyed = true
  6425. if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks
  6426. if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want
  6427. if (isFn(stream.destroy)) return stream.destroy()
  6428. callback(err || new Error('stream was destroyed'))
  6429. }
  6430. }
  6431. var call = function (fn) {
  6432. fn()
  6433. }
  6434. var pipe = function (from, to) {
  6435. return from.pipe(to)
  6436. }
  6437. var pump = function () {
  6438. var streams = Array.prototype.slice.call(arguments)
  6439. var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop
  6440. if (Array.isArray(streams[0])) streams = streams[0]
  6441. if (streams.length < 2) throw new Error('pump requires two streams per minimum')
  6442. var error
  6443. var destroys = streams.map(function (stream, i) {
  6444. var reading = i < streams.length - 1
  6445. var writing = i > 0
  6446. return destroyer(stream, reading, writing, function (err) {
  6447. if (!error) error = err
  6448. if (err) destroys.forEach(call)
  6449. if (reading) return
  6450. destroys.forEach(call)
  6451. callback(error)
  6452. })
  6453. })
  6454. return streams.reduce(pipe)
  6455. }
  6456. module.exports = pump
  6457. /***/ }),
  6458. /***/ 454:
  6459. /***/ (function(module, exports, __webpack_require__) {
  6460. "use strict";
  6461. Object.defineProperty(exports, '__esModule', { value: true });
  6462. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  6463. var Stream = _interopDefault(__webpack_require__(413));
  6464. var http = _interopDefault(__webpack_require__(605));
  6465. var Url = _interopDefault(__webpack_require__(835));
  6466. var https = _interopDefault(__webpack_require__(211));
  6467. var zlib = _interopDefault(__webpack_require__(761));
  6468. // Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js
  6469. // fix for "Readable" isn't a named export issue
  6470. const Readable = Stream.Readable;
  6471. const BUFFER = Symbol('buffer');
  6472. const TYPE = Symbol('type');
  6473. class Blob {
  6474. constructor() {
  6475. this[TYPE] = '';
  6476. const blobParts = arguments[0];
  6477. const options = arguments[1];
  6478. const buffers = [];
  6479. let size = 0;
  6480. if (blobParts) {
  6481. const a = blobParts;
  6482. const length = Number(a.length);
  6483. for (let i = 0; i < length; i++) {
  6484. const element = a[i];
  6485. let buffer;
  6486. if (element instanceof Buffer) {
  6487. buffer = element;
  6488. } else if (ArrayBuffer.isView(element)) {
  6489. buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength);
  6490. } else if (element instanceof ArrayBuffer) {
  6491. buffer = Buffer.from(element);
  6492. } else if (element instanceof Blob) {
  6493. buffer = element[BUFFER];
  6494. } else {
  6495. buffer = Buffer.from(typeof element === 'string' ? element : String(element));
  6496. }
  6497. size += buffer.length;
  6498. buffers.push(buffer);
  6499. }
  6500. }
  6501. this[BUFFER] = Buffer.concat(buffers);
  6502. let type = options && options.type !== undefined && String(options.type).toLowerCase();
  6503. if (type && !/[^\u0020-\u007E]/.test(type)) {
  6504. this[TYPE] = type;
  6505. }
  6506. }
  6507. get size() {
  6508. return this[BUFFER].length;
  6509. }
  6510. get type() {
  6511. return this[TYPE];
  6512. }
  6513. text() {
  6514. return Promise.resolve(this[BUFFER].toString());
  6515. }
  6516. arrayBuffer() {
  6517. const buf = this[BUFFER];
  6518. const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  6519. return Promise.resolve(ab);
  6520. }
  6521. stream() {
  6522. const readable = new Readable();
  6523. readable._read = function () {};
  6524. readable.push(this[BUFFER]);
  6525. readable.push(null);
  6526. return readable;
  6527. }
  6528. toString() {
  6529. return '[object Blob]';
  6530. }
  6531. slice() {
  6532. const size = this.size;
  6533. const start = arguments[0];
  6534. const end = arguments[1];
  6535. let relativeStart, relativeEnd;
  6536. if (start === undefined) {
  6537. relativeStart = 0;
  6538. } else if (start < 0) {
  6539. relativeStart = Math.max(size + start, 0);
  6540. } else {
  6541. relativeStart = Math.min(start, size);
  6542. }
  6543. if (end === undefined) {
  6544. relativeEnd = size;
  6545. } else if (end < 0) {
  6546. relativeEnd = Math.max(size + end, 0);
  6547. } else {
  6548. relativeEnd = Math.min(end, size);
  6549. }
  6550. const span = Math.max(relativeEnd - relativeStart, 0);
  6551. const buffer = this[BUFFER];
  6552. const slicedBuffer = buffer.slice(relativeStart, relativeStart + span);
  6553. const blob = new Blob([], { type: arguments[2] });
  6554. blob[BUFFER] = slicedBuffer;
  6555. return blob;
  6556. }
  6557. }
  6558. Object.defineProperties(Blob.prototype, {
  6559. size: { enumerable: true },
  6560. type: { enumerable: true },
  6561. slice: { enumerable: true }
  6562. });
  6563. Object.defineProperty(Blob.prototype, Symbol.toStringTag, {
  6564. value: 'Blob',
  6565. writable: false,
  6566. enumerable: false,
  6567. configurable: true
  6568. });
  6569. /**
  6570. * fetch-error.js
  6571. *
  6572. * FetchError interface for operational errors
  6573. */
  6574. /**
  6575. * Create FetchError instance
  6576. *
  6577. * @param String message Error message for human
  6578. * @param String type Error type for machine
  6579. * @param String systemError For Node.js system error
  6580. * @return FetchError
  6581. */
  6582. function FetchError(message, type, systemError) {
  6583. Error.call(this, message);
  6584. this.message = message;
  6585. this.type = type;
  6586. // when err.type is `system`, err.code contains system error code
  6587. if (systemError) {
  6588. this.code = this.errno = systemError.code;
  6589. }
  6590. // hide custom error implementation details from end-users
  6591. Error.captureStackTrace(this, this.constructor);
  6592. }
  6593. FetchError.prototype = Object.create(Error.prototype);
  6594. FetchError.prototype.constructor = FetchError;
  6595. FetchError.prototype.name = 'FetchError';
  6596. let convert;
  6597. try {
  6598. convert = __webpack_require__(18).convert;
  6599. } catch (e) {}
  6600. const INTERNALS = Symbol('Body internals');
  6601. // fix an issue where "PassThrough" isn't a named export for node <10
  6602. const PassThrough = Stream.PassThrough;
  6603. /**
  6604. * Body mixin
  6605. *
  6606. * Ref: https://fetch.spec.whatwg.org/#body
  6607. *
  6608. * @param Stream body Readable stream
  6609. * @param Object opts Response options
  6610. * @return Void
  6611. */
  6612. function Body(body) {
  6613. var _this = this;
  6614. var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  6615. _ref$size = _ref.size;
  6616. let size = _ref$size === undefined ? 0 : _ref$size;
  6617. var _ref$timeout = _ref.timeout;
  6618. let timeout = _ref$timeout === undefined ? 0 : _ref$timeout;
  6619. if (body == null) {
  6620. // body is undefined or null
  6621. body = null;
  6622. } else if (isURLSearchParams(body)) {
  6623. // body is a URLSearchParams
  6624. body = Buffer.from(body.toString());
  6625. } else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  6626. // body is ArrayBuffer
  6627. body = Buffer.from(body);
  6628. } else if (ArrayBuffer.isView(body)) {
  6629. // body is ArrayBufferView
  6630. body = Buffer.from(body.buffer, body.byteOffset, body.byteLength);
  6631. } else if (body instanceof Stream) ; else {
  6632. // none of the above
  6633. // coerce to string then buffer
  6634. body = Buffer.from(String(body));
  6635. }
  6636. this[INTERNALS] = {
  6637. body,
  6638. disturbed: false,
  6639. error: null
  6640. };
  6641. this.size = size;
  6642. this.timeout = timeout;
  6643. if (body instanceof Stream) {
  6644. body.on('error', function (err) {
  6645. const error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err);
  6646. _this[INTERNALS].error = error;
  6647. });
  6648. }
  6649. }
  6650. Body.prototype = {
  6651. get body() {
  6652. return this[INTERNALS].body;
  6653. },
  6654. get bodyUsed() {
  6655. return this[INTERNALS].disturbed;
  6656. },
  6657. /**
  6658. * Decode response as ArrayBuffer
  6659. *
  6660. * @return Promise
  6661. */
  6662. arrayBuffer() {
  6663. return consumeBody.call(this).then(function (buf) {
  6664. return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  6665. });
  6666. },
  6667. /**
  6668. * Return raw response as Blob
  6669. *
  6670. * @return Promise
  6671. */
  6672. blob() {
  6673. let ct = this.headers && this.headers.get('content-type') || '';
  6674. return consumeBody.call(this).then(function (buf) {
  6675. return Object.assign(
  6676. // Prevent copying
  6677. new Blob([], {
  6678. type: ct.toLowerCase()
  6679. }), {
  6680. [BUFFER]: buf
  6681. });
  6682. });
  6683. },
  6684. /**
  6685. * Decode response as json
  6686. *
  6687. * @return Promise
  6688. */
  6689. json() {
  6690. var _this2 = this;
  6691. return consumeBody.call(this).then(function (buffer) {
  6692. try {
  6693. return JSON.parse(buffer.toString());
  6694. } catch (err) {
  6695. return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));
  6696. }
  6697. });
  6698. },
  6699. /**
  6700. * Decode response as text
  6701. *
  6702. * @return Promise
  6703. */
  6704. text() {
  6705. return consumeBody.call(this).then(function (buffer) {
  6706. return buffer.toString();
  6707. });
  6708. },
  6709. /**
  6710. * Decode response as buffer (non-spec api)
  6711. *
  6712. * @return Promise
  6713. */
  6714. buffer() {
  6715. return consumeBody.call(this);
  6716. },
  6717. /**
  6718. * Decode response as text, while automatically detecting the encoding and
  6719. * trying to decode to UTF-8 (non-spec api)
  6720. *
  6721. * @return Promise
  6722. */
  6723. textConverted() {
  6724. var _this3 = this;
  6725. return consumeBody.call(this).then(function (buffer) {
  6726. return convertBody(buffer, _this3.headers);
  6727. });
  6728. }
  6729. };
  6730. // In browsers, all properties are enumerable.
  6731. Object.defineProperties(Body.prototype, {
  6732. body: { enumerable: true },
  6733. bodyUsed: { enumerable: true },
  6734. arrayBuffer: { enumerable: true },
  6735. blob: { enumerable: true },
  6736. json: { enumerable: true },
  6737. text: { enumerable: true }
  6738. });
  6739. Body.mixIn = function (proto) {
  6740. for (const name of Object.getOwnPropertyNames(Body.prototype)) {
  6741. // istanbul ignore else: future proof
  6742. if (!(name in proto)) {
  6743. const desc = Object.getOwnPropertyDescriptor(Body.prototype, name);
  6744. Object.defineProperty(proto, name, desc);
  6745. }
  6746. }
  6747. };
  6748. /**
  6749. * Consume and convert an entire Body to a Buffer.
  6750. *
  6751. * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body
  6752. *
  6753. * @return Promise
  6754. */
  6755. function consumeBody() {
  6756. var _this4 = this;
  6757. if (this[INTERNALS].disturbed) {
  6758. return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`));
  6759. }
  6760. this[INTERNALS].disturbed = true;
  6761. if (this[INTERNALS].error) {
  6762. return Body.Promise.reject(this[INTERNALS].error);
  6763. }
  6764. let body = this.body;
  6765. // body is null
  6766. if (body === null) {
  6767. return Body.Promise.resolve(Buffer.alloc(0));
  6768. }
  6769. // body is blob
  6770. if (isBlob(body)) {
  6771. body = body.stream();
  6772. }
  6773. // body is buffer
  6774. if (Buffer.isBuffer(body)) {
  6775. return Body.Promise.resolve(body);
  6776. }
  6777. // istanbul ignore if: should never happen
  6778. if (!(body instanceof Stream)) {
  6779. return Body.Promise.resolve(Buffer.alloc(0));
  6780. }
  6781. // body is stream
  6782. // get ready to actually consume the body
  6783. let accum = [];
  6784. let accumBytes = 0;
  6785. let abort = false;
  6786. return new Body.Promise(function (resolve, reject) {
  6787. let resTimeout;
  6788. // allow timeout on slow response body
  6789. if (_this4.timeout) {
  6790. resTimeout = setTimeout(function () {
  6791. abort = true;
  6792. reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout'));
  6793. }, _this4.timeout);
  6794. }
  6795. // handle stream errors
  6796. body.on('error', function (err) {
  6797. if (err.name === 'AbortError') {
  6798. // if the request was aborted, reject with this Error
  6799. abort = true;
  6800. reject(err);
  6801. } else {
  6802. // other errors, such as incorrect content-encoding
  6803. reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err));
  6804. }
  6805. });
  6806. body.on('data', function (chunk) {
  6807. if (abort || chunk === null) {
  6808. return;
  6809. }
  6810. if (_this4.size && accumBytes + chunk.length > _this4.size) {
  6811. abort = true;
  6812. reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size'));
  6813. return;
  6814. }
  6815. accumBytes += chunk.length;
  6816. accum.push(chunk);
  6817. });
  6818. body.on('end', function () {
  6819. if (abort) {
  6820. return;
  6821. }
  6822. clearTimeout(resTimeout);
  6823. try {
  6824. resolve(Buffer.concat(accum, accumBytes));
  6825. } catch (err) {
  6826. // handle streams that have accumulated too much data (issue #414)
  6827. reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err));
  6828. }
  6829. });
  6830. });
  6831. }
  6832. /**
  6833. * Detect buffer encoding and convert to target encoding
  6834. * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding
  6835. *
  6836. * @param Buffer buffer Incoming buffer
  6837. * @param String encoding Target encoding
  6838. * @return String
  6839. */
  6840. function convertBody(buffer, headers) {
  6841. if (typeof convert !== 'function') {
  6842. throw new Error('The package `encoding` must be installed to use the textConverted() function');
  6843. }
  6844. const ct = headers.get('content-type');
  6845. let charset = 'utf-8';
  6846. let res, str;
  6847. // header
  6848. if (ct) {
  6849. res = /charset=([^;]*)/i.exec(ct);
  6850. }
  6851. // no charset in content type, peek at response body for at most 1024 bytes
  6852. str = buffer.slice(0, 1024).toString();
  6853. // html5
  6854. if (!res && str) {
  6855. res = /<meta.+?charset=(['"])(.+?)\1/i.exec(str);
  6856. }
  6857. // html4
  6858. if (!res && str) {
  6859. res = /<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(str);
  6860. if (res) {
  6861. res = /charset=(.*)/i.exec(res.pop());
  6862. }
  6863. }
  6864. // xml
  6865. if (!res && str) {
  6866. res = /<\?xml.+?encoding=(['"])(.+?)\1/i.exec(str);
  6867. }
  6868. // found charset
  6869. if (res) {
  6870. charset = res.pop();
  6871. // prevent decode issues when sites use incorrect encoding
  6872. // ref: https://hsivonen.fi/encoding-menu/
  6873. if (charset === 'gb2312' || charset === 'gbk') {
  6874. charset = 'gb18030';
  6875. }
  6876. }
  6877. // turn raw buffers into a single utf-8 buffer
  6878. return convert(buffer, 'UTF-8', charset).toString();
  6879. }
  6880. /**
  6881. * Detect a URLSearchParams object
  6882. * ref: https://github.com/bitinn/node-fetch/issues/296#issuecomment-307598143
  6883. *
  6884. * @param Object obj Object to detect by type or brand
  6885. * @return String
  6886. */
  6887. function isURLSearchParams(obj) {
  6888. // Duck-typing as a necessary condition.
  6889. 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') {
  6890. return false;
  6891. }
  6892. // Brand-checking and more duck-typing as optional condition.
  6893. return obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';
  6894. }
  6895. /**
  6896. * Check if `obj` is a W3C `Blob` object (which `File` inherits from)
  6897. * @param {*} obj
  6898. * @return {boolean}
  6899. */
  6900. function isBlob(obj) {
  6901. 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]);
  6902. }
  6903. /**
  6904. * Clone body given Res/Req instance
  6905. *
  6906. * @param Mixed instance Response or Request instance
  6907. * @return Mixed
  6908. */
  6909. function clone(instance) {
  6910. let p1, p2;
  6911. let body = instance.body;
  6912. // don't allow cloning a used body
  6913. if (instance.bodyUsed) {
  6914. throw new Error('cannot clone body after it is used');
  6915. }
  6916. // check that body is a stream and not form-data object
  6917. // note: we can't clone the form-data object without having it as a dependency
  6918. if (body instanceof Stream && typeof body.getBoundary !== 'function') {
  6919. // tee instance body
  6920. p1 = new PassThrough();
  6921. p2 = new PassThrough();
  6922. body.pipe(p1);
  6923. body.pipe(p2);
  6924. // set instance body to teed body and return the other teed body
  6925. instance[INTERNALS].body = p1;
  6926. body = p2;
  6927. }
  6928. return body;
  6929. }
  6930. /**
  6931. * Performs the operation "extract a `Content-Type` value from |object|" as
  6932. * specified in the specification:
  6933. * https://fetch.spec.whatwg.org/#concept-bodyinit-extract
  6934. *
  6935. * This function assumes that instance.body is present.
  6936. *
  6937. * @param Mixed instance Any options.body input
  6938. */
  6939. function extractContentType(body) {
  6940. if (body === null) {
  6941. // body is null
  6942. return null;
  6943. } else if (typeof body === 'string') {
  6944. // body is string
  6945. return 'text/plain;charset=UTF-8';
  6946. } else if (isURLSearchParams(body)) {
  6947. // body is a URLSearchParams
  6948. return 'application/x-www-form-urlencoded;charset=UTF-8';
  6949. } else if (isBlob(body)) {
  6950. // body is blob
  6951. return body.type || null;
  6952. } else if (Buffer.isBuffer(body)) {
  6953. // body is buffer
  6954. return null;
  6955. } else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  6956. // body is ArrayBuffer
  6957. return null;
  6958. } else if (ArrayBuffer.isView(body)) {
  6959. // body is ArrayBufferView
  6960. return null;
  6961. } else if (typeof body.getBoundary === 'function') {
  6962. // detect form data input from form-data module
  6963. return `multipart/form-data;boundary=${body.getBoundary()}`;
  6964. } else if (body instanceof Stream) {
  6965. // body is stream
  6966. // can't really do much about this
  6967. return null;
  6968. } else {
  6969. // Body constructor defaults other things to string
  6970. return 'text/plain;charset=UTF-8';
  6971. }
  6972. }
  6973. /**
  6974. * The Fetch Standard treats this as if "total bytes" is a property on the body.
  6975. * For us, we have to explicitly get it with a function.
  6976. *
  6977. * ref: https://fetch.spec.whatwg.org/#concept-body-total-bytes
  6978. *
  6979. * @param Body instance Instance of Body
  6980. * @return Number? Number of bytes, or null if not possible
  6981. */
  6982. function getTotalBytes(instance) {
  6983. const body = instance.body;
  6984. if (body === null) {
  6985. // body is null
  6986. return 0;
  6987. } else if (isBlob(body)) {
  6988. return body.size;
  6989. } else if (Buffer.isBuffer(body)) {
  6990. // body is buffer
  6991. return body.length;
  6992. } else if (body && typeof body.getLengthSync === 'function') {
  6993. // detect form data input from form-data module
  6994. if (body._lengthRetrievers && body._lengthRetrievers.length == 0 || // 1.x
  6995. body.hasKnownLength && body.hasKnownLength()) {
  6996. // 2.x
  6997. return body.getLengthSync();
  6998. }
  6999. return null;
  7000. } else {
  7001. // body is stream
  7002. return null;
  7003. }
  7004. }
  7005. /**
  7006. * Write a Body to a Node.js WritableStream (e.g. http.Request) object.
  7007. *
  7008. * @param Body instance Instance of Body
  7009. * @return Void
  7010. */
  7011. function writeToStream(dest, instance) {
  7012. const body = instance.body;
  7013. if (body === null) {
  7014. // body is null
  7015. dest.end();
  7016. } else if (isBlob(body)) {
  7017. body.stream().pipe(dest);
  7018. } else if (Buffer.isBuffer(body)) {
  7019. // body is buffer
  7020. dest.write(body);
  7021. dest.end();
  7022. } else {
  7023. // body is stream
  7024. body.pipe(dest);
  7025. }
  7026. }
  7027. // expose Promise
  7028. Body.Promise = global.Promise;
  7029. /**
  7030. * headers.js
  7031. *
  7032. * Headers class offers convenient helpers
  7033. */
  7034. const invalidTokenRegex = /[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/;
  7035. const invalidHeaderCharRegex = /[^\t\x20-\x7e\x80-\xff]/;
  7036. function validateName(name) {
  7037. name = `${name}`;
  7038. if (invalidTokenRegex.test(name) || name === '') {
  7039. throw new TypeError(`${name} is not a legal HTTP header name`);
  7040. }
  7041. }
  7042. function validateValue(value) {
  7043. value = `${value}`;
  7044. if (invalidHeaderCharRegex.test(value)) {
  7045. throw new TypeError(`${value} is not a legal HTTP header value`);
  7046. }
  7047. }
  7048. /**
  7049. * Find the key in the map object given a header name.
  7050. *
  7051. * Returns undefined if not found.
  7052. *
  7053. * @param String name Header name
  7054. * @return String|Undefined
  7055. */
  7056. function find(map, name) {
  7057. name = name.toLowerCase();
  7058. for (const key in map) {
  7059. if (key.toLowerCase() === name) {
  7060. return key;
  7061. }
  7062. }
  7063. return undefined;
  7064. }
  7065. const MAP = Symbol('map');
  7066. class Headers {
  7067. /**
  7068. * Headers class
  7069. *
  7070. * @param Object headers Response headers
  7071. * @return Void
  7072. */
  7073. constructor() {
  7074. let init = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
  7075. this[MAP] = Object.create(null);
  7076. if (init instanceof Headers) {
  7077. const rawHeaders = init.raw();
  7078. const headerNames = Object.keys(rawHeaders);
  7079. for (const headerName of headerNames) {
  7080. for (const value of rawHeaders[headerName]) {
  7081. this.append(headerName, value);
  7082. }
  7083. }
  7084. return;
  7085. }
  7086. // We don't worry about converting prop to ByteString here as append()
  7087. // will handle it.
  7088. if (init == null) ; else if (typeof init === 'object') {
  7089. const method = init[Symbol.iterator];
  7090. if (method != null) {
  7091. if (typeof method !== 'function') {
  7092. throw new TypeError('Header pairs must be iterable');
  7093. }
  7094. // sequence<sequence<ByteString>>
  7095. // Note: per spec we have to first exhaust the lists then process them
  7096. const pairs = [];
  7097. for (const pair of init) {
  7098. if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') {
  7099. throw new TypeError('Each header pair must be iterable');
  7100. }
  7101. pairs.push(Array.from(pair));
  7102. }
  7103. for (const pair of pairs) {
  7104. if (pair.length !== 2) {
  7105. throw new TypeError('Each header pair must be a name/value tuple');
  7106. }
  7107. this.append(pair[0], pair[1]);
  7108. }
  7109. } else {
  7110. // record<ByteString, ByteString>
  7111. for (const key of Object.keys(init)) {
  7112. const value = init[key];
  7113. this.append(key, value);
  7114. }
  7115. }
  7116. } else {
  7117. throw new TypeError('Provided initializer must be an object');
  7118. }
  7119. }
  7120. /**
  7121. * Return combined header value given name
  7122. *
  7123. * @param String name Header name
  7124. * @return Mixed
  7125. */
  7126. get(name) {
  7127. name = `${name}`;
  7128. validateName(name);
  7129. const key = find(this[MAP], name);
  7130. if (key === undefined) {
  7131. return null;
  7132. }
  7133. return this[MAP][key].join(', ');
  7134. }
  7135. /**
  7136. * Iterate over all headers
  7137. *
  7138. * @param Function callback Executed for each item with parameters (value, name, thisArg)
  7139. * @param Boolean thisArg `this` context for callback function
  7140. * @return Void
  7141. */
  7142. forEach(callback) {
  7143. let thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
  7144. let pairs = getHeaders(this);
  7145. let i = 0;
  7146. while (i < pairs.length) {
  7147. var _pairs$i = pairs[i];
  7148. const name = _pairs$i[0],
  7149. value = _pairs$i[1];
  7150. callback.call(thisArg, value, name, this);
  7151. pairs = getHeaders(this);
  7152. i++;
  7153. }
  7154. }
  7155. /**
  7156. * Overwrite header values given name
  7157. *
  7158. * @param String name Header name
  7159. * @param String value Header value
  7160. * @return Void
  7161. */
  7162. set(name, value) {
  7163. name = `${name}`;
  7164. value = `${value}`;
  7165. validateName(name);
  7166. validateValue(value);
  7167. const key = find(this[MAP], name);
  7168. this[MAP][key !== undefined ? key : name] = [value];
  7169. }
  7170. /**
  7171. * Append a value onto existing header
  7172. *
  7173. * @param String name Header name
  7174. * @param String value Header value
  7175. * @return Void
  7176. */
  7177. append(name, value) {
  7178. name = `${name}`;
  7179. value = `${value}`;
  7180. validateName(name);
  7181. validateValue(value);
  7182. const key = find(this[MAP], name);
  7183. if (key !== undefined) {
  7184. this[MAP][key].push(value);
  7185. } else {
  7186. this[MAP][name] = [value];
  7187. }
  7188. }
  7189. /**
  7190. * Check for header name existence
  7191. *
  7192. * @param String name Header name
  7193. * @return Boolean
  7194. */
  7195. has(name) {
  7196. name = `${name}`;
  7197. validateName(name);
  7198. return find(this[MAP], name) !== undefined;
  7199. }
  7200. /**
  7201. * Delete all header values given name
  7202. *
  7203. * @param String name Header name
  7204. * @return Void
  7205. */
  7206. delete(name) {
  7207. name = `${name}`;
  7208. validateName(name);
  7209. const key = find(this[MAP], name);
  7210. if (key !== undefined) {
  7211. delete this[MAP][key];
  7212. }
  7213. }
  7214. /**
  7215. * Return raw headers (non-spec api)
  7216. *
  7217. * @return Object
  7218. */
  7219. raw() {
  7220. return this[MAP];
  7221. }
  7222. /**
  7223. * Get an iterator on keys.
  7224. *
  7225. * @return Iterator
  7226. */
  7227. keys() {
  7228. return createHeadersIterator(this, 'key');
  7229. }
  7230. /**
  7231. * Get an iterator on values.
  7232. *
  7233. * @return Iterator
  7234. */
  7235. values() {
  7236. return createHeadersIterator(this, 'value');
  7237. }
  7238. /**
  7239. * Get an iterator on entries.
  7240. *
  7241. * This is the default iterator of the Headers object.
  7242. *
  7243. * @return Iterator
  7244. */
  7245. [Symbol.iterator]() {
  7246. return createHeadersIterator(this, 'key+value');
  7247. }
  7248. }
  7249. Headers.prototype.entries = Headers.prototype[Symbol.iterator];
  7250. Object.defineProperty(Headers.prototype, Symbol.toStringTag, {
  7251. value: 'Headers',
  7252. writable: false,
  7253. enumerable: false,
  7254. configurable: true
  7255. });
  7256. Object.defineProperties(Headers.prototype, {
  7257. get: { enumerable: true },
  7258. forEach: { enumerable: true },
  7259. set: { enumerable: true },
  7260. append: { enumerable: true },
  7261. has: { enumerable: true },
  7262. delete: { enumerable: true },
  7263. keys: { enumerable: true },
  7264. values: { enumerable: true },
  7265. entries: { enumerable: true }
  7266. });
  7267. function getHeaders(headers) {
  7268. let kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value';
  7269. const keys = Object.keys(headers[MAP]).sort();
  7270. return keys.map(kind === 'key' ? function (k) {
  7271. return k.toLowerCase();
  7272. } : kind === 'value' ? function (k) {
  7273. return headers[MAP][k].join(', ');
  7274. } : function (k) {
  7275. return [k.toLowerCase(), headers[MAP][k].join(', ')];
  7276. });
  7277. }
  7278. const INTERNAL = Symbol('internal');
  7279. function createHeadersIterator(target, kind) {
  7280. const iterator = Object.create(HeadersIteratorPrototype);
  7281. iterator[INTERNAL] = {
  7282. target,
  7283. kind,
  7284. index: 0
  7285. };
  7286. return iterator;
  7287. }
  7288. const HeadersIteratorPrototype = Object.setPrototypeOf({
  7289. next() {
  7290. // istanbul ignore if
  7291. if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) {
  7292. throw new TypeError('Value of `this` is not a HeadersIterator');
  7293. }
  7294. var _INTERNAL = this[INTERNAL];
  7295. const target = _INTERNAL.target,
  7296. kind = _INTERNAL.kind,
  7297. index = _INTERNAL.index;
  7298. const values = getHeaders(target, kind);
  7299. const len = values.length;
  7300. if (index >= len) {
  7301. return {
  7302. value: undefined,
  7303. done: true
  7304. };
  7305. }
  7306. this[INTERNAL].index = index + 1;
  7307. return {
  7308. value: values[index],
  7309. done: false
  7310. };
  7311. }
  7312. }, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));
  7313. Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, {
  7314. value: 'HeadersIterator',
  7315. writable: false,
  7316. enumerable: false,
  7317. configurable: true
  7318. });
  7319. /**
  7320. * Export the Headers object in a form that Node.js can consume.
  7321. *
  7322. * @param Headers headers
  7323. * @return Object
  7324. */
  7325. function exportNodeCompatibleHeaders(headers) {
  7326. const obj = Object.assign({ __proto__: null }, headers[MAP]);
  7327. // http.request() only supports string as Host header. This hack makes
  7328. // specifying custom Host header possible.
  7329. const hostHeaderKey = find(headers[MAP], 'Host');
  7330. if (hostHeaderKey !== undefined) {
  7331. obj[hostHeaderKey] = obj[hostHeaderKey][0];
  7332. }
  7333. return obj;
  7334. }
  7335. /**
  7336. * Create a Headers object from an object of headers, ignoring those that do
  7337. * not conform to HTTP grammar productions.
  7338. *
  7339. * @param Object obj Object of headers
  7340. * @return Headers
  7341. */
  7342. function createHeadersLenient(obj) {
  7343. const headers = new Headers();
  7344. for (const name of Object.keys(obj)) {
  7345. if (invalidTokenRegex.test(name)) {
  7346. continue;
  7347. }
  7348. if (Array.isArray(obj[name])) {
  7349. for (const val of obj[name]) {
  7350. if (invalidHeaderCharRegex.test(val)) {
  7351. continue;
  7352. }
  7353. if (headers[MAP][name] === undefined) {
  7354. headers[MAP][name] = [val];
  7355. } else {
  7356. headers[MAP][name].push(val);
  7357. }
  7358. }
  7359. } else if (!invalidHeaderCharRegex.test(obj[name])) {
  7360. headers[MAP][name] = [obj[name]];
  7361. }
  7362. }
  7363. return headers;
  7364. }
  7365. const INTERNALS$1 = Symbol('Response internals');
  7366. // fix an issue where "STATUS_CODES" aren't a named export for node <10
  7367. const STATUS_CODES = http.STATUS_CODES;
  7368. /**
  7369. * Response class
  7370. *
  7371. * @param Stream body Readable stream
  7372. * @param Object opts Response options
  7373. * @return Void
  7374. */
  7375. class Response {
  7376. constructor() {
  7377. let body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  7378. let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  7379. Body.call(this, body, opts);
  7380. const status = opts.status || 200;
  7381. const headers = new Headers(opts.headers);
  7382. if (body != null && !headers.has('Content-Type')) {
  7383. const contentType = extractContentType(body);
  7384. if (contentType) {
  7385. headers.append('Content-Type', contentType);
  7386. }
  7387. }
  7388. this[INTERNALS$1] = {
  7389. url: opts.url,
  7390. status,
  7391. statusText: opts.statusText || STATUS_CODES[status],
  7392. headers,
  7393. counter: opts.counter
  7394. };
  7395. }
  7396. get url() {
  7397. return this[INTERNALS$1].url || '';
  7398. }
  7399. get status() {
  7400. return this[INTERNALS$1].status;
  7401. }
  7402. /**
  7403. * Convenience property representing if the request ended normally
  7404. */
  7405. get ok() {
  7406. return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;
  7407. }
  7408. get redirected() {
  7409. return this[INTERNALS$1].counter > 0;
  7410. }
  7411. get statusText() {
  7412. return this[INTERNALS$1].statusText;
  7413. }
  7414. get headers() {
  7415. return this[INTERNALS$1].headers;
  7416. }
  7417. /**
  7418. * Clone this response
  7419. *
  7420. * @return Response
  7421. */
  7422. clone() {
  7423. return new Response(clone(this), {
  7424. url: this.url,
  7425. status: this.status,
  7426. statusText: this.statusText,
  7427. headers: this.headers,
  7428. ok: this.ok,
  7429. redirected: this.redirected
  7430. });
  7431. }
  7432. }
  7433. Body.mixIn(Response.prototype);
  7434. Object.defineProperties(Response.prototype, {
  7435. url: { enumerable: true },
  7436. status: { enumerable: true },
  7437. ok: { enumerable: true },
  7438. redirected: { enumerable: true },
  7439. statusText: { enumerable: true },
  7440. headers: { enumerable: true },
  7441. clone: { enumerable: true }
  7442. });
  7443. Object.defineProperty(Response.prototype, Symbol.toStringTag, {
  7444. value: 'Response',
  7445. writable: false,
  7446. enumerable: false,
  7447. configurable: true
  7448. });
  7449. const INTERNALS$2 = Symbol('Request internals');
  7450. // fix an issue where "format", "parse" aren't a named export for node <10
  7451. const parse_url = Url.parse;
  7452. const format_url = Url.format;
  7453. const streamDestructionSupported = 'destroy' in Stream.Readable.prototype;
  7454. /**
  7455. * Check if a value is an instance of Request.
  7456. *
  7457. * @param Mixed input
  7458. * @return Boolean
  7459. */
  7460. function isRequest(input) {
  7461. return typeof input === 'object' && typeof input[INTERNALS$2] === 'object';
  7462. }
  7463. function isAbortSignal(signal) {
  7464. const proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal);
  7465. return !!(proto && proto.constructor.name === 'AbortSignal');
  7466. }
  7467. /**
  7468. * Request class
  7469. *
  7470. * @param Mixed input Url or Request instance
  7471. * @param Object init Custom options
  7472. * @return Void
  7473. */
  7474. class Request {
  7475. constructor(input) {
  7476. let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  7477. let parsedURL;
  7478. // normalize input
  7479. if (!isRequest(input)) {
  7480. if (input && input.href) {
  7481. // in order to support Node.js' Url objects; though WHATWG's URL objects
  7482. // will fall into this branch also (since their `toString()` will return
  7483. // `href` property anyway)
  7484. parsedURL = parse_url(input.href);
  7485. } else {
  7486. // coerce input to a string before attempting to parse
  7487. parsedURL = parse_url(`${input}`);
  7488. }
  7489. input = {};
  7490. } else {
  7491. parsedURL = parse_url(input.url);
  7492. }
  7493. let method = init.method || input.method || 'GET';
  7494. method = method.toUpperCase();
  7495. if ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) {
  7496. throw new TypeError('Request with GET/HEAD method cannot have body');
  7497. }
  7498. let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null;
  7499. Body.call(this, inputBody, {
  7500. timeout: init.timeout || input.timeout || 0,
  7501. size: init.size || input.size || 0
  7502. });
  7503. const headers = new Headers(init.headers || input.headers || {});
  7504. if (inputBody != null && !headers.has('Content-Type')) {
  7505. const contentType = extractContentType(inputBody);
  7506. if (contentType) {
  7507. headers.append('Content-Type', contentType);
  7508. }
  7509. }
  7510. let signal = isRequest(input) ? input.signal : null;
  7511. if ('signal' in init) signal = init.signal;
  7512. if (signal != null && !isAbortSignal(signal)) {
  7513. throw new TypeError('Expected signal to be an instanceof AbortSignal');
  7514. }
  7515. this[INTERNALS$2] = {
  7516. method,
  7517. redirect: init.redirect || input.redirect || 'follow',
  7518. headers,
  7519. parsedURL,
  7520. signal
  7521. };
  7522. // node-fetch-only options
  7523. this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20;
  7524. this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true;
  7525. this.counter = init.counter || input.counter || 0;
  7526. this.agent = init.agent || input.agent;
  7527. }
  7528. get method() {
  7529. return this[INTERNALS$2].method;
  7530. }
  7531. get url() {
  7532. return format_url(this[INTERNALS$2].parsedURL);
  7533. }
  7534. get headers() {
  7535. return this[INTERNALS$2].headers;
  7536. }
  7537. get redirect() {
  7538. return this[INTERNALS$2].redirect;
  7539. }
  7540. get signal() {
  7541. return this[INTERNALS$2].signal;
  7542. }
  7543. /**
  7544. * Clone this request
  7545. *
  7546. * @return Request
  7547. */
  7548. clone() {
  7549. return new Request(this);
  7550. }
  7551. }
  7552. Body.mixIn(Request.prototype);
  7553. Object.defineProperty(Request.prototype, Symbol.toStringTag, {
  7554. value: 'Request',
  7555. writable: false,
  7556. enumerable: false,
  7557. configurable: true
  7558. });
  7559. Object.defineProperties(Request.prototype, {
  7560. method: { enumerable: true },
  7561. url: { enumerable: true },
  7562. headers: { enumerable: true },
  7563. redirect: { enumerable: true },
  7564. clone: { enumerable: true },
  7565. signal: { enumerable: true }
  7566. });
  7567. /**
  7568. * Convert a Request to Node.js http request options.
  7569. *
  7570. * @param Request A Request instance
  7571. * @return Object The options object to be passed to http.request
  7572. */
  7573. function getNodeRequestOptions(request) {
  7574. const parsedURL = request[INTERNALS$2].parsedURL;
  7575. const headers = new Headers(request[INTERNALS$2].headers);
  7576. // fetch step 1.3
  7577. if (!headers.has('Accept')) {
  7578. headers.set('Accept', '*/*');
  7579. }
  7580. // Basic fetch
  7581. if (!parsedURL.protocol || !parsedURL.hostname) {
  7582. throw new TypeError('Only absolute URLs are supported');
  7583. }
  7584. if (!/^https?:$/.test(parsedURL.protocol)) {
  7585. throw new TypeError('Only HTTP(S) protocols are supported');
  7586. }
  7587. if (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) {
  7588. throw new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8');
  7589. }
  7590. // HTTP-network-or-cache fetch steps 2.4-2.7
  7591. let contentLengthValue = null;
  7592. if (request.body == null && /^(POST|PUT)$/i.test(request.method)) {
  7593. contentLengthValue = '0';
  7594. }
  7595. if (request.body != null) {
  7596. const totalBytes = getTotalBytes(request);
  7597. if (typeof totalBytes === 'number') {
  7598. contentLengthValue = String(totalBytes);
  7599. }
  7600. }
  7601. if (contentLengthValue) {
  7602. headers.set('Content-Length', contentLengthValue);
  7603. }
  7604. // HTTP-network-or-cache fetch step 2.11
  7605. if (!headers.has('User-Agent')) {
  7606. headers.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)');
  7607. }
  7608. // HTTP-network-or-cache fetch step 2.15
  7609. if (request.compress && !headers.has('Accept-Encoding')) {
  7610. headers.set('Accept-Encoding', 'gzip,deflate');
  7611. }
  7612. let agent = request.agent;
  7613. if (typeof agent === 'function') {
  7614. agent = agent(parsedURL);
  7615. }
  7616. if (!headers.has('Connection') && !agent) {
  7617. headers.set('Connection', 'close');
  7618. }
  7619. // HTTP-network fetch step 4.2
  7620. // chunked encoding is handled by Node.js
  7621. return Object.assign({}, parsedURL, {
  7622. method: request.method,
  7623. headers: exportNodeCompatibleHeaders(headers),
  7624. agent
  7625. });
  7626. }
  7627. /**
  7628. * abort-error.js
  7629. *
  7630. * AbortError interface for cancelled requests
  7631. */
  7632. /**
  7633. * Create AbortError instance
  7634. *
  7635. * @param String message Error message for human
  7636. * @return AbortError
  7637. */
  7638. function AbortError(message) {
  7639. Error.call(this, message);
  7640. this.type = 'aborted';
  7641. this.message = message;
  7642. // hide custom error implementation details from end-users
  7643. Error.captureStackTrace(this, this.constructor);
  7644. }
  7645. AbortError.prototype = Object.create(Error.prototype);
  7646. AbortError.prototype.constructor = AbortError;
  7647. AbortError.prototype.name = 'AbortError';
  7648. // fix an issue where "PassThrough", "resolve" aren't a named export for node <10
  7649. const PassThrough$1 = Stream.PassThrough;
  7650. const resolve_url = Url.resolve;
  7651. /**
  7652. * Fetch function
  7653. *
  7654. * @param Mixed url Absolute url or Request instance
  7655. * @param Object opts Fetch options
  7656. * @return Promise
  7657. */
  7658. function fetch(url, opts) {
  7659. // allow custom promise
  7660. if (!fetch.Promise) {
  7661. throw new Error('native promise missing, set fetch.Promise to your favorite alternative');
  7662. }
  7663. Body.Promise = fetch.Promise;
  7664. // wrap http.request into fetch
  7665. return new fetch.Promise(function (resolve, reject) {
  7666. // build request object
  7667. const request = new Request(url, opts);
  7668. const options = getNodeRequestOptions(request);
  7669. const send = (options.protocol === 'https:' ? https : http).request;
  7670. const signal = request.signal;
  7671. let response = null;
  7672. const abort = function abort() {
  7673. let error = new AbortError('The user aborted a request.');
  7674. reject(error);
  7675. if (request.body && request.body instanceof Stream.Readable) {
  7676. request.body.destroy(error);
  7677. }
  7678. if (!response || !response.body) return;
  7679. response.body.emit('error', error);
  7680. };
  7681. if (signal && signal.aborted) {
  7682. abort();
  7683. return;
  7684. }
  7685. const abortAndFinalize = function abortAndFinalize() {
  7686. abort();
  7687. finalize();
  7688. };
  7689. // send request
  7690. const req = send(options);
  7691. let reqTimeout;
  7692. if (signal) {
  7693. signal.addEventListener('abort', abortAndFinalize);
  7694. }
  7695. function finalize() {
  7696. req.abort();
  7697. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  7698. clearTimeout(reqTimeout);
  7699. }
  7700. if (request.timeout) {
  7701. req.once('socket', function (socket) {
  7702. reqTimeout = setTimeout(function () {
  7703. reject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout'));
  7704. finalize();
  7705. }, request.timeout);
  7706. });
  7707. }
  7708. req.on('error', function (err) {
  7709. reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));
  7710. finalize();
  7711. });
  7712. req.on('response', function (res) {
  7713. clearTimeout(reqTimeout);
  7714. const headers = createHeadersLenient(res.headers);
  7715. // HTTP fetch step 5
  7716. if (fetch.isRedirect(res.statusCode)) {
  7717. // HTTP fetch step 5.2
  7718. const location = headers.get('Location');
  7719. // HTTP fetch step 5.3
  7720. const locationURL = location === null ? null : resolve_url(request.url, location);
  7721. // HTTP fetch step 5.5
  7722. switch (request.redirect) {
  7723. case 'error':
  7724. reject(new FetchError(`redirect mode is set to error: ${request.url}`, 'no-redirect'));
  7725. finalize();
  7726. return;
  7727. case 'manual':
  7728. // node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL.
  7729. if (locationURL !== null) {
  7730. // handle corrupted header
  7731. try {
  7732. headers.set('Location', locationURL);
  7733. } catch (err) {
  7734. // istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request
  7735. reject(err);
  7736. }
  7737. }
  7738. break;
  7739. case 'follow':
  7740. // HTTP-redirect fetch step 2
  7741. if (locationURL === null) {
  7742. break;
  7743. }
  7744. // HTTP-redirect fetch step 5
  7745. if (request.counter >= request.follow) {
  7746. reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));
  7747. finalize();
  7748. return;
  7749. }
  7750. // HTTP-redirect fetch step 6 (counter increment)
  7751. // Create a new Request object.
  7752. const requestOpts = {
  7753. headers: new Headers(request.headers),
  7754. follow: request.follow,
  7755. counter: request.counter + 1,
  7756. agent: request.agent,
  7757. compress: request.compress,
  7758. method: request.method,
  7759. body: request.body,
  7760. signal: request.signal,
  7761. timeout: request.timeout
  7762. };
  7763. // HTTP-redirect fetch step 9
  7764. if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {
  7765. reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));
  7766. finalize();
  7767. return;
  7768. }
  7769. // HTTP-redirect fetch step 11
  7770. if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') {
  7771. requestOpts.method = 'GET';
  7772. requestOpts.body = undefined;
  7773. requestOpts.headers.delete('content-length');
  7774. }
  7775. // HTTP-redirect fetch step 15
  7776. resolve(fetch(new Request(locationURL, requestOpts)));
  7777. finalize();
  7778. return;
  7779. }
  7780. }
  7781. // prepare response
  7782. res.once('end', function () {
  7783. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  7784. });
  7785. let body = res.pipe(new PassThrough$1());
  7786. const response_options = {
  7787. url: request.url,
  7788. status: res.statusCode,
  7789. statusText: res.statusMessage,
  7790. headers: headers,
  7791. size: request.size,
  7792. timeout: request.timeout,
  7793. counter: request.counter
  7794. };
  7795. // HTTP-network fetch step 12.1.1.3
  7796. const codings = headers.get('Content-Encoding');
  7797. // HTTP-network fetch step 12.1.1.4: handle content codings
  7798. // in following scenarios we ignore compression support
  7799. // 1. compression support is disabled
  7800. // 2. HEAD request
  7801. // 3. no Content-Encoding header
  7802. // 4. no content response (204)
  7803. // 5. content not modified response (304)
  7804. if (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) {
  7805. response = new Response(body, response_options);
  7806. resolve(response);
  7807. return;
  7808. }
  7809. // For Node v6+
  7810. // Be less strict when decoding compressed responses, since sometimes
  7811. // servers send slightly invalid responses that are still accepted
  7812. // by common browsers.
  7813. // Always using Z_SYNC_FLUSH is what cURL does.
  7814. const zlibOptions = {
  7815. flush: zlib.Z_SYNC_FLUSH,
  7816. finishFlush: zlib.Z_SYNC_FLUSH
  7817. };
  7818. // for gzip
  7819. if (codings == 'gzip' || codings == 'x-gzip') {
  7820. body = body.pipe(zlib.createGunzip(zlibOptions));
  7821. response = new Response(body, response_options);
  7822. resolve(response);
  7823. return;
  7824. }
  7825. // for deflate
  7826. if (codings == 'deflate' || codings == 'x-deflate') {
  7827. // handle the infamous raw deflate response from old servers
  7828. // a hack for old IIS and Apache servers
  7829. const raw = res.pipe(new PassThrough$1());
  7830. raw.once('data', function (chunk) {
  7831. // see http://stackoverflow.com/questions/37519828
  7832. if ((chunk[0] & 0x0F) === 0x08) {
  7833. body = body.pipe(zlib.createInflate());
  7834. } else {
  7835. body = body.pipe(zlib.createInflateRaw());
  7836. }
  7837. response = new Response(body, response_options);
  7838. resolve(response);
  7839. });
  7840. return;
  7841. }
  7842. // for br
  7843. if (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') {
  7844. body = body.pipe(zlib.createBrotliDecompress());
  7845. response = new Response(body, response_options);
  7846. resolve(response);
  7847. return;
  7848. }
  7849. // otherwise, use response as-is
  7850. response = new Response(body, response_options);
  7851. resolve(response);
  7852. });
  7853. writeToStream(req, request);
  7854. });
  7855. }
  7856. /**
  7857. * Redirect code matching
  7858. *
  7859. * @param Number code Status code
  7860. * @return Boolean
  7861. */
  7862. fetch.isRedirect = function (code) {
  7863. return code === 301 || code === 302 || code === 303 || code === 307 || code === 308;
  7864. };
  7865. // expose Promise
  7866. fetch.Promise = global.Promise;
  7867. module.exports = exports = fetch;
  7868. Object.defineProperty(exports, "__esModule", { value: true });
  7869. exports.default = exports;
  7870. exports.Headers = Headers;
  7871. exports.Request = Request;
  7872. exports.Response = Response;
  7873. exports.FetchError = FetchError;
  7874. /***/ }),
  7875. /***/ 462:
  7876. /***/ (function(module) {
  7877. "use strict";
  7878. // See http://www.robvanderwoude.com/escapechars.php
  7879. const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
  7880. function escapeCommand(arg) {
  7881. // Escape meta chars
  7882. arg = arg.replace(metaCharsRegExp, '^$1');
  7883. return arg;
  7884. }
  7885. function escapeArgument(arg, doubleEscapeMetaChars) {
  7886. // Convert to string
  7887. arg = `${arg}`;
  7888. // Algorithm below is based on https://qntm.org/cmd
  7889. // Sequence of backslashes followed by a double quote:
  7890. // double up all the backslashes and escape the double quote
  7891. arg = arg.replace(/(\\*)"/g, '$1$1\\"');
  7892. // Sequence of backslashes followed by the end of the string
  7893. // (which will become a double quote later):
  7894. // double up all the backslashes
  7895. arg = arg.replace(/(\\*)$/, '$1$1');
  7896. // All other backslashes occur literally
  7897. // Quote the whole thing:
  7898. arg = `"${arg}"`;
  7899. // Escape meta chars
  7900. arg = arg.replace(metaCharsRegExp, '^$1');
  7901. // Double escape meta chars if necessary
  7902. if (doubleEscapeMetaChars) {
  7903. arg = arg.replace(metaCharsRegExp, '^$1');
  7904. }
  7905. return arg;
  7906. }
  7907. module.exports.command = escapeCommand;
  7908. module.exports.argument = escapeArgument;
  7909. /***/ }),
  7910. /***/ 463:
  7911. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7912. "use strict";
  7913. Object.defineProperty(exports, '__esModule', { value: true });
  7914. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  7915. var deprecation = __webpack_require__(692);
  7916. var once = _interopDefault(__webpack_require__(969));
  7917. const logOnce = once(deprecation => console.warn(deprecation));
  7918. /**
  7919. * Error with extra properties to help with debugging
  7920. */
  7921. class RequestError extends Error {
  7922. constructor(message, statusCode, options) {
  7923. super(message); // Maintains proper stack trace (only available on V8)
  7924. /* istanbul ignore next */
  7925. if (Error.captureStackTrace) {
  7926. Error.captureStackTrace(this, this.constructor);
  7927. }
  7928. this.name = "HttpError";
  7929. this.status = statusCode;
  7930. Object.defineProperty(this, "code", {
  7931. get() {
  7932. logOnce(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`."));
  7933. return statusCode;
  7934. }
  7935. });
  7936. this.headers = options.headers || {}; // redact request credentials without mutating original request options
  7937. const requestCopy = Object.assign({}, options.request);
  7938. if (options.request.headers.authorization) {
  7939. requestCopy.headers = Object.assign({}, options.request.headers, {
  7940. authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]")
  7941. });
  7942. }
  7943. requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit
  7944. // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications
  7945. .replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]") // OAuth tokens can be passed as URL query parameters, although it is not recommended
  7946. // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header
  7947. .replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
  7948. this.request = requestCopy;
  7949. }
  7950. }
  7951. exports.RequestError = RequestError;
  7952. //# sourceMappingURL=index.js.map
  7953. /***/ }),
  7954. /***/ 464:
  7955. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7956. "use strict";
  7957. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  7958. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  7959. return new (P || (P = Promise))(function (resolve, reject) {
  7960. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  7961. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  7962. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  7963. step((generator = generator.apply(thisArg, _arguments || [])).next());
  7964. });
  7965. };
  7966. var __importStar = (this && this.__importStar) || function (mod) {
  7967. if (mod && mod.__esModule) return mod;
  7968. var result = {};
  7969. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  7970. result["default"] = mod;
  7971. return result;
  7972. };
  7973. var __importDefault = (this && this.__importDefault) || function (mod) {
  7974. return (mod && mod.__esModule) ? mod : { "default": mod };
  7975. };
  7976. Object.defineProperty(exports, "__esModule", { value: true });
  7977. const assert = __importStar(__webpack_require__(357));
  7978. const core = __importStar(__webpack_require__(470));
  7979. const fs = __importStar(__webpack_require__(747));
  7980. const github = __importStar(__webpack_require__(469));
  7981. const io = __importStar(__webpack_require__(1));
  7982. const path = __importStar(__webpack_require__(622));
  7983. const retryHelper = __importStar(__webpack_require__(587));
  7984. const toolCache = __importStar(__webpack_require__(533));
  7985. const v4_1 = __importDefault(__webpack_require__(826));
  7986. const https_proxy_agent_1 = __importDefault(__webpack_require__(717));
  7987. const IS_WINDOWS = process.platform === 'win32';
  7988. function downloadRepository(authToken, owner, repo, ref, commit, repositoryPath) {
  7989. return __awaiter(this, void 0, void 0, function* () {
  7990. // Download the archive
  7991. let archiveData = yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  7992. core.info('Downloading the archive');
  7993. return yield downloadArchive(authToken, owner, repo, ref, commit);
  7994. }));
  7995. // Write archive to disk
  7996. core.info('Writing archive to disk');
  7997. const uniqueId = v4_1.default();
  7998. const archivePath = path.join(repositoryPath, `${uniqueId}.tar.gz`);
  7999. yield fs.promises.writeFile(archivePath, archiveData);
  8000. archiveData = Buffer.from(''); // Free memory
  8001. // Extract archive
  8002. core.info('Extracting the archive');
  8003. const extractPath = path.join(repositoryPath, uniqueId);
  8004. yield io.mkdirP(extractPath);
  8005. if (IS_WINDOWS) {
  8006. yield toolCache.extractZip(archivePath, extractPath);
  8007. }
  8008. else {
  8009. yield toolCache.extractTar(archivePath, extractPath);
  8010. }
  8011. io.rmRF(archivePath);
  8012. // Determine the path of the repository content. The archive contains
  8013. // a top-level folder and the repository content is inside.
  8014. const archiveFileNames = yield fs.promises.readdir(extractPath);
  8015. assert.ok(archiveFileNames.length == 1, 'Expected exactly one directory inside archive');
  8016. const archiveVersion = archiveFileNames[0]; // The top-level folder name includes the short SHA
  8017. core.info(`Resolved version ${archiveVersion}`);
  8018. const tempRepositoryPath = path.join(extractPath, archiveVersion);
  8019. // Move the files
  8020. for (const fileName of yield fs.promises.readdir(tempRepositoryPath)) {
  8021. const sourcePath = path.join(tempRepositoryPath, fileName);
  8022. const targetPath = path.join(repositoryPath, fileName);
  8023. if (IS_WINDOWS) {
  8024. yield io.cp(sourcePath, targetPath, { recursive: true }); // Copy on Windows (Windows Defender may have a lock)
  8025. }
  8026. else {
  8027. yield io.mv(sourcePath, targetPath);
  8028. }
  8029. }
  8030. io.rmRF(extractPath);
  8031. });
  8032. }
  8033. exports.downloadRepository = downloadRepository;
  8034. function downloadArchive(authToken, owner, repo, ref, commit) {
  8035. return __awaiter(this, void 0, void 0, function* () {
  8036. const octokit = createOctokit(authToken);
  8037. const params = {
  8038. owner: owner,
  8039. repo: repo,
  8040. archive_format: IS_WINDOWS ? 'zipball' : 'tarball',
  8041. ref: commit || ref
  8042. };
  8043. const response = yield octokit.repos.getArchiveLink(params);
  8044. if (response.status != 200) {
  8045. throw new Error(`Unexpected response from GitHub API. Status: ${response.status}, Data: ${response.data}`);
  8046. }
  8047. return Buffer.from(response.data); // response.data is ArrayBuffer
  8048. });
  8049. }
  8050. function createOctokit(authToken) {
  8051. let proxyVar = process.env['https_proxy'] || process.env['HTTPS_PROXY'] || '';
  8052. if (!proxyVar) {
  8053. return new github.GitHub(authToken);
  8054. }
  8055. let noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';
  8056. let bypass = false;
  8057. if (noProxy) {
  8058. let bypassList = noProxy.split(',');
  8059. for (let i = 0; i < bypassList.length; i++) {
  8060. let item = bypassList[i];
  8061. if (item &&
  8062. typeof item === 'string' &&
  8063. item.trim().toLocaleLowerCase() === 'github.com') {
  8064. bypass = true;
  8065. break;
  8066. }
  8067. }
  8068. }
  8069. if (bypass) {
  8070. return new github.GitHub(authToken);
  8071. }
  8072. else {
  8073. return new github.GitHub(authToken, {
  8074. request: { agent: new https_proxy_agent_1.default(proxyVar) }
  8075. });
  8076. }
  8077. }
  8078. /***/ }),
  8079. /***/ 469:
  8080. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8081. "use strict";
  8082. var __importDefault = (this && this.__importDefault) || function (mod) {
  8083. return (mod && mod.__esModule) ? mod : { "default": mod };
  8084. };
  8085. var __importStar = (this && this.__importStar) || function (mod) {
  8086. if (mod && mod.__esModule) return mod;
  8087. var result = {};
  8088. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  8089. result["default"] = mod;
  8090. return result;
  8091. };
  8092. Object.defineProperty(exports, "__esModule", { value: true });
  8093. // Originally pulled from https://github.com/JasonEtco/actions-toolkit/blob/master/src/github.ts
  8094. const graphql_1 = __webpack_require__(898);
  8095. const rest_1 = __importDefault(__webpack_require__(0));
  8096. const Context = __importStar(__webpack_require__(262));
  8097. // We need this in order to extend Octokit
  8098. rest_1.default.prototype = new rest_1.default();
  8099. exports.context = new Context.Context();
  8100. class GitHub extends rest_1.default {
  8101. constructor(token, opts = {}) {
  8102. super(Object.assign(Object.assign({}, opts), { auth: `token ${token}` }));
  8103. this.graphql = graphql_1.graphql.defaults({
  8104. headers: { authorization: `token ${token}` }
  8105. });
  8106. }
  8107. }
  8108. exports.GitHub = GitHub;
  8109. //# sourceMappingURL=github.js.map
  8110. /***/ }),
  8111. /***/ 470:
  8112. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8113. "use strict";
  8114. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  8115. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  8116. return new (P || (P = Promise))(function (resolve, reject) {
  8117. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  8118. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  8119. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  8120. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8121. });
  8122. };
  8123. Object.defineProperty(exports, "__esModule", { value: true });
  8124. const command_1 = __webpack_require__(431);
  8125. const os = __webpack_require__(87);
  8126. const path = __webpack_require__(622);
  8127. /**
  8128. * The code to exit an action
  8129. */
  8130. var ExitCode;
  8131. (function (ExitCode) {
  8132. /**
  8133. * A code indicating that the action was successful
  8134. */
  8135. ExitCode[ExitCode["Success"] = 0] = "Success";
  8136. /**
  8137. * A code indicating that the action was a failure
  8138. */
  8139. ExitCode[ExitCode["Failure"] = 1] = "Failure";
  8140. })(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
  8141. //-----------------------------------------------------------------------
  8142. // Variables
  8143. //-----------------------------------------------------------------------
  8144. /**
  8145. * Sets env variable for this action and future actions in the job
  8146. * @param name the name of the variable to set
  8147. * @param val the value of the variable
  8148. */
  8149. function exportVariable(name, val) {
  8150. process.env[name] = val;
  8151. command_1.issueCommand('set-env', { name }, val);
  8152. }
  8153. exports.exportVariable = exportVariable;
  8154. /**
  8155. * Registers a secret which will get masked from logs
  8156. * @param secret value of the secret
  8157. */
  8158. function setSecret(secret) {
  8159. command_1.issueCommand('add-mask', {}, secret);
  8160. }
  8161. exports.setSecret = setSecret;
  8162. /**
  8163. * Prepends inputPath to the PATH (for this action and future actions)
  8164. * @param inputPath
  8165. */
  8166. function addPath(inputPath) {
  8167. command_1.issueCommand('add-path', {}, inputPath);
  8168. process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
  8169. }
  8170. exports.addPath = addPath;
  8171. /**
  8172. * Gets the value of an input. The value is also trimmed.
  8173. *
  8174. * @param name name of the input to get
  8175. * @param options optional. See InputOptions.
  8176. * @returns string
  8177. */
  8178. function getInput(name, options) {
  8179. const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';
  8180. if (options && options.required && !val) {
  8181. throw new Error(`Input required and not supplied: ${name}`);
  8182. }
  8183. return val.trim();
  8184. }
  8185. exports.getInput = getInput;
  8186. /**
  8187. * Sets the value of an output.
  8188. *
  8189. * @param name name of the output to set
  8190. * @param value value to store
  8191. */
  8192. function setOutput(name, value) {
  8193. command_1.issueCommand('set-output', { name }, value);
  8194. }
  8195. exports.setOutput = setOutput;
  8196. //-----------------------------------------------------------------------
  8197. // Results
  8198. //-----------------------------------------------------------------------
  8199. /**
  8200. * Sets the action status to failed.
  8201. * When the action exits it will be with an exit code of 1
  8202. * @param message add error issue message
  8203. */
  8204. function setFailed(message) {
  8205. process.exitCode = ExitCode.Failure;
  8206. error(message);
  8207. }
  8208. exports.setFailed = setFailed;
  8209. //-----------------------------------------------------------------------
  8210. // Logging Commands
  8211. //-----------------------------------------------------------------------
  8212. /**
  8213. * Writes debug message to user log
  8214. * @param message debug message
  8215. */
  8216. function debug(message) {
  8217. command_1.issueCommand('debug', {}, message);
  8218. }
  8219. exports.debug = debug;
  8220. /**
  8221. * Adds an error issue
  8222. * @param message error issue message
  8223. */
  8224. function error(message) {
  8225. command_1.issue('error', message);
  8226. }
  8227. exports.error = error;
  8228. /**
  8229. * Adds an warning issue
  8230. * @param message warning issue message
  8231. */
  8232. function warning(message) {
  8233. command_1.issue('warning', message);
  8234. }
  8235. exports.warning = warning;
  8236. /**
  8237. * Writes info to log with console.log.
  8238. * @param message info message
  8239. */
  8240. function info(message) {
  8241. process.stdout.write(message + os.EOL);
  8242. }
  8243. exports.info = info;
  8244. /**
  8245. * Begin an output group.
  8246. *
  8247. * Output until the next `groupEnd` will be foldable in this group
  8248. *
  8249. * @param name The name of the output group
  8250. */
  8251. function startGroup(name) {
  8252. command_1.issue('group', name);
  8253. }
  8254. exports.startGroup = startGroup;
  8255. /**
  8256. * End an output group.
  8257. */
  8258. function endGroup() {
  8259. command_1.issue('endgroup');
  8260. }
  8261. exports.endGroup = endGroup;
  8262. /**
  8263. * Wrap an asynchronous function call in a group.
  8264. *
  8265. * Returns the same type as the function itself.
  8266. *
  8267. * @param name The name of the group
  8268. * @param fn The function to wrap in the group
  8269. */
  8270. function group(name, fn) {
  8271. return __awaiter(this, void 0, void 0, function* () {
  8272. startGroup(name);
  8273. let result;
  8274. try {
  8275. result = yield fn();
  8276. }
  8277. finally {
  8278. endGroup();
  8279. }
  8280. return result;
  8281. });
  8282. }
  8283. exports.group = group;
  8284. //# sourceMappingURL=core.js.map
  8285. /***/ }),
  8286. /***/ 471:
  8287. /***/ (function(module, __unusedexports, __webpack_require__) {
  8288. module.exports = authenticationBeforeRequest;
  8289. const btoa = __webpack_require__(675);
  8290. const uniq = __webpack_require__(126);
  8291. function authenticationBeforeRequest(state, options) {
  8292. if (!state.auth.type) {
  8293. return;
  8294. }
  8295. if (state.auth.type === "basic") {
  8296. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  8297. options.headers.authorization = `Basic ${hash}`;
  8298. return;
  8299. }
  8300. if (state.auth.type === "token") {
  8301. options.headers.authorization = `token ${state.auth.token}`;
  8302. return;
  8303. }
  8304. if (state.auth.type === "app") {
  8305. options.headers.authorization = `Bearer ${state.auth.token}`;
  8306. const acceptHeaders = options.headers.accept
  8307. .split(",")
  8308. .concat("application/vnd.github.machine-man-preview+json");
  8309. options.headers.accept = uniq(acceptHeaders)
  8310. .filter(Boolean)
  8311. .join(",");
  8312. return;
  8313. }
  8314. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  8315. if (state.auth.token) {
  8316. options.url += `access_token=${encodeURIComponent(state.auth.token)}`;
  8317. return;
  8318. }
  8319. const key = encodeURIComponent(state.auth.key);
  8320. const secret = encodeURIComponent(state.auth.secret);
  8321. options.url += `client_id=${key}&client_secret=${secret}`;
  8322. }
  8323. /***/ }),
  8324. /***/ 486:
  8325. /***/ (function(module, __unusedexports, __webpack_require__) {
  8326. /**
  8327. * This is the common logic for both the Node.js and web browser
  8328. * implementations of `debug()`.
  8329. */
  8330. function setup(env) {
  8331. createDebug.debug = createDebug;
  8332. createDebug.default = createDebug;
  8333. createDebug.coerce = coerce;
  8334. createDebug.disable = disable;
  8335. createDebug.enable = enable;
  8336. createDebug.enabled = enabled;
  8337. createDebug.humanize = __webpack_require__(317);
  8338. Object.keys(env).forEach(key => {
  8339. createDebug[key] = env[key];
  8340. });
  8341. /**
  8342. * Active `debug` instances.
  8343. */
  8344. createDebug.instances = [];
  8345. /**
  8346. * The currently active debug mode names, and names to skip.
  8347. */
  8348. createDebug.names = [];
  8349. createDebug.skips = [];
  8350. /**
  8351. * Map of special "%n" handling functions, for the debug "format" argument.
  8352. *
  8353. * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
  8354. */
  8355. createDebug.formatters = {};
  8356. /**
  8357. * Selects a color for a debug namespace
  8358. * @param {String} namespace The namespace string for the for the debug instance to be colored
  8359. * @return {Number|String} An ANSI color code for the given namespace
  8360. * @api private
  8361. */
  8362. function selectColor(namespace) {
  8363. let hash = 0;
  8364. for (let i = 0; i < namespace.length; i++) {
  8365. hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
  8366. hash |= 0; // Convert to 32bit integer
  8367. }
  8368. return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
  8369. }
  8370. createDebug.selectColor = selectColor;
  8371. /**
  8372. * Create a debugger with the given `namespace`.
  8373. *
  8374. * @param {String} namespace
  8375. * @return {Function}
  8376. * @api public
  8377. */
  8378. function createDebug(namespace) {
  8379. let prevTime;
  8380. function debug(...args) {
  8381. // Disabled?
  8382. if (!debug.enabled) {
  8383. return;
  8384. }
  8385. const self = debug;
  8386. // Set `diff` timestamp
  8387. const curr = Number(new Date());
  8388. const ms = curr - (prevTime || curr);
  8389. self.diff = ms;
  8390. self.prev = prevTime;
  8391. self.curr = curr;
  8392. prevTime = curr;
  8393. args[0] = createDebug.coerce(args[0]);
  8394. if (typeof args[0] !== 'string') {
  8395. // Anything else let's inspect with %O
  8396. args.unshift('%O');
  8397. }
  8398. // Apply any `formatters` transformations
  8399. let index = 0;
  8400. args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
  8401. // If we encounter an escaped % then don't increase the array index
  8402. if (match === '%%') {
  8403. return match;
  8404. }
  8405. index++;
  8406. const formatter = createDebug.formatters[format];
  8407. if (typeof formatter === 'function') {
  8408. const val = args[index];
  8409. match = formatter.call(self, val);
  8410. // Now we need to remove `args[index]` since it's inlined in the `format`
  8411. args.splice(index, 1);
  8412. index--;
  8413. }
  8414. return match;
  8415. });
  8416. // Apply env-specific formatting (colors, etc.)
  8417. createDebug.formatArgs.call(self, args);
  8418. const logFn = self.log || createDebug.log;
  8419. logFn.apply(self, args);
  8420. }
  8421. debug.namespace = namespace;
  8422. debug.enabled = createDebug.enabled(namespace);
  8423. debug.useColors = createDebug.useColors();
  8424. debug.color = selectColor(namespace);
  8425. debug.destroy = destroy;
  8426. debug.extend = extend;
  8427. // Debug.formatArgs = formatArgs;
  8428. // debug.rawLog = rawLog;
  8429. // env-specific initialization logic for debug instances
  8430. if (typeof createDebug.init === 'function') {
  8431. createDebug.init(debug);
  8432. }
  8433. createDebug.instances.push(debug);
  8434. return debug;
  8435. }
  8436. function destroy() {
  8437. const index = createDebug.instances.indexOf(this);
  8438. if (index !== -1) {
  8439. createDebug.instances.splice(index, 1);
  8440. return true;
  8441. }
  8442. return false;
  8443. }
  8444. function extend(namespace, delimiter) {
  8445. const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
  8446. newDebug.log = this.log;
  8447. return newDebug;
  8448. }
  8449. /**
  8450. * Enables a debug mode by namespaces. This can include modes
  8451. * separated by a colon and wildcards.
  8452. *
  8453. * @param {String} namespaces
  8454. * @api public
  8455. */
  8456. function enable(namespaces) {
  8457. createDebug.save(namespaces);
  8458. createDebug.names = [];
  8459. createDebug.skips = [];
  8460. let i;
  8461. const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
  8462. const len = split.length;
  8463. for (i = 0; i < len; i++) {
  8464. if (!split[i]) {
  8465. // ignore empty strings
  8466. continue;
  8467. }
  8468. namespaces = split[i].replace(/\*/g, '.*?');
  8469. if (namespaces[0] === '-') {
  8470. createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
  8471. } else {
  8472. createDebug.names.push(new RegExp('^' + namespaces + '$'));
  8473. }
  8474. }
  8475. for (i = 0; i < createDebug.instances.length; i++) {
  8476. const instance = createDebug.instances[i];
  8477. instance.enabled = createDebug.enabled(instance.namespace);
  8478. }
  8479. }
  8480. /**
  8481. * Disable debug output.
  8482. *
  8483. * @return {String} namespaces
  8484. * @api public
  8485. */
  8486. function disable() {
  8487. const namespaces = [
  8488. ...createDebug.names.map(toNamespace),
  8489. ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)
  8490. ].join(',');
  8491. createDebug.enable('');
  8492. return namespaces;
  8493. }
  8494. /**
  8495. * Returns true if the given mode name is enabled, false otherwise.
  8496. *
  8497. * @param {String} name
  8498. * @return {Boolean}
  8499. * @api public
  8500. */
  8501. function enabled(name) {
  8502. if (name[name.length - 1] === '*') {
  8503. return true;
  8504. }
  8505. let i;
  8506. let len;
  8507. for (i = 0, len = createDebug.skips.length; i < len; i++) {
  8508. if (createDebug.skips[i].test(name)) {
  8509. return false;
  8510. }
  8511. }
  8512. for (i = 0, len = createDebug.names.length; i < len; i++) {
  8513. if (createDebug.names[i].test(name)) {
  8514. return true;
  8515. }
  8516. }
  8517. return false;
  8518. }
  8519. /**
  8520. * Convert regexp to namespace
  8521. *
  8522. * @param {RegExp} regxep
  8523. * @return {String} namespace
  8524. * @api private
  8525. */
  8526. function toNamespace(regexp) {
  8527. return regexp.toString()
  8528. .substring(2, regexp.toString().length - 2)
  8529. .replace(/\.\*\?$/, '*');
  8530. }
  8531. /**
  8532. * Coerce `val`.
  8533. *
  8534. * @param {Mixed} val
  8535. * @return {Mixed}
  8536. * @api private
  8537. */
  8538. function coerce(val) {
  8539. if (val instanceof Error) {
  8540. return val.stack || val.message;
  8541. }
  8542. return val;
  8543. }
  8544. createDebug.enable(createDebug.load());
  8545. return createDebug;
  8546. }
  8547. module.exports = setup;
  8548. /***/ }),
  8549. /***/ 489:
  8550. /***/ (function(module, __unusedexports, __webpack_require__) {
  8551. "use strict";
  8552. const path = __webpack_require__(622);
  8553. const which = __webpack_require__(814);
  8554. const pathKey = __webpack_require__(39)();
  8555. function resolveCommandAttempt(parsed, withoutPathExt) {
  8556. const cwd = process.cwd();
  8557. const hasCustomCwd = parsed.options.cwd != null;
  8558. // If a custom `cwd` was specified, we need to change the process cwd
  8559. // because `which` will do stat calls but does not support a custom cwd
  8560. if (hasCustomCwd) {
  8561. try {
  8562. process.chdir(parsed.options.cwd);
  8563. } catch (err) {
  8564. /* Empty */
  8565. }
  8566. }
  8567. let resolved;
  8568. try {
  8569. resolved = which.sync(parsed.command, {
  8570. path: (parsed.options.env || process.env)[pathKey],
  8571. pathExt: withoutPathExt ? path.delimiter : undefined,
  8572. });
  8573. } catch (e) {
  8574. /* Empty */
  8575. } finally {
  8576. process.chdir(cwd);
  8577. }
  8578. // If we successfully resolved, ensure that an absolute path is returned
  8579. // Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it
  8580. if (resolved) {
  8581. resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved);
  8582. }
  8583. return resolved;
  8584. }
  8585. function resolveCommand(parsed) {
  8586. return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
  8587. }
  8588. module.exports = resolveCommand;
  8589. /***/ }),
  8590. /***/ 510:
  8591. /***/ (function(module) {
  8592. module.exports = addHook
  8593. function addHook (state, kind, name, hook) {
  8594. var orig = hook
  8595. if (!state.registry[name]) {
  8596. state.registry[name] = []
  8597. }
  8598. if (kind === 'before') {
  8599. hook = function (method, options) {
  8600. return Promise.resolve()
  8601. .then(orig.bind(null, options))
  8602. .then(method.bind(null, options))
  8603. }
  8604. }
  8605. if (kind === 'after') {
  8606. hook = function (method, options) {
  8607. var result
  8608. return Promise.resolve()
  8609. .then(method.bind(null, options))
  8610. .then(function (result_) {
  8611. result = result_
  8612. return orig(result, options)
  8613. })
  8614. .then(function () {
  8615. return result
  8616. })
  8617. }
  8618. }
  8619. if (kind === 'error') {
  8620. hook = function (method, options) {
  8621. return Promise.resolve()
  8622. .then(method.bind(null, options))
  8623. .catch(function (error) {
  8624. return orig(error, options)
  8625. })
  8626. }
  8627. }
  8628. state.registry[name].push({
  8629. hook: hook,
  8630. orig: orig
  8631. })
  8632. }
  8633. /***/ }),
  8634. /***/ 523:
  8635. /***/ (function(module, __unusedexports, __webpack_require__) {
  8636. var register = __webpack_require__(363)
  8637. var addHook = __webpack_require__(510)
  8638. var removeHook = __webpack_require__(763)
  8639. // bind with array of arguments: https://stackoverflow.com/a/21792913
  8640. var bind = Function.bind
  8641. var bindable = bind.bind(bind)
  8642. function bindApi (hook, state, name) {
  8643. var removeHookRef = bindable(removeHook, null).apply(null, name ? [state, name] : [state])
  8644. hook.api = { remove: removeHookRef }
  8645. hook.remove = removeHookRef
  8646. ;['before', 'error', 'after', 'wrap'].forEach(function (kind) {
  8647. var args = name ? [state, kind, name] : [state, kind]
  8648. hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args)
  8649. })
  8650. }
  8651. function HookSingular () {
  8652. var singularHookName = 'h'
  8653. var singularHookState = {
  8654. registry: {}
  8655. }
  8656. var singularHook = register.bind(null, singularHookState, singularHookName)
  8657. bindApi(singularHook, singularHookState, singularHookName)
  8658. return singularHook
  8659. }
  8660. function HookCollection () {
  8661. var state = {
  8662. registry: {}
  8663. }
  8664. var hook = register.bind(null, state)
  8665. bindApi(hook, state)
  8666. return hook
  8667. }
  8668. var collectionHookDeprecationMessageDisplayed = false
  8669. function Hook () {
  8670. if (!collectionHookDeprecationMessageDisplayed) {
  8671. console.warn('[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4')
  8672. collectionHookDeprecationMessageDisplayed = true
  8673. }
  8674. return HookCollection()
  8675. }
  8676. Hook.Singular = HookSingular.bind()
  8677. Hook.Collection = HookCollection.bind()
  8678. module.exports = Hook
  8679. // expose constructors as a named property for TypeScript
  8680. module.exports.Hook = Hook
  8681. module.exports.Singular = Hook.Singular
  8682. module.exports.Collection = Hook.Collection
  8683. /***/ }),
  8684. /***/ 529:
  8685. /***/ (function(module, __unusedexports, __webpack_require__) {
  8686. const factory = __webpack_require__(47);
  8687. module.exports = factory();
  8688. /***/ }),
  8689. /***/ 533:
  8690. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8691. "use strict";
  8692. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  8693. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  8694. return new (P || (P = Promise))(function (resolve, reject) {
  8695. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  8696. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  8697. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  8698. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8699. });
  8700. };
  8701. Object.defineProperty(exports, "__esModule", { value: true });
  8702. const core = __webpack_require__(470);
  8703. const io = __webpack_require__(1);
  8704. const fs = __webpack_require__(747);
  8705. const os = __webpack_require__(87);
  8706. const path = __webpack_require__(622);
  8707. const httpm = __webpack_require__(874);
  8708. const semver = __webpack_require__(656);
  8709. const uuidV4 = __webpack_require__(826);
  8710. const exec_1 = __webpack_require__(986);
  8711. const assert_1 = __webpack_require__(357);
  8712. class HTTPError extends Error {
  8713. constructor(httpStatusCode) {
  8714. super(`Unexpected HTTP response: ${httpStatusCode}`);
  8715. this.httpStatusCode = httpStatusCode;
  8716. Object.setPrototypeOf(this, new.target.prototype);
  8717. }
  8718. }
  8719. exports.HTTPError = HTTPError;
  8720. const IS_WINDOWS = process.platform === 'win32';
  8721. const userAgent = 'actions/tool-cache';
  8722. // On load grab temp directory and cache directory and remove them from env (currently don't want to expose this)
  8723. let tempDirectory = process.env['RUNNER_TEMP'] || '';
  8724. let cacheRoot = process.env['RUNNER_TOOL_CACHE'] || '';
  8725. // If directories not found, place them in common temp locations
  8726. if (!tempDirectory || !cacheRoot) {
  8727. let baseLocation;
  8728. if (IS_WINDOWS) {
  8729. // On windows use the USERPROFILE env variable
  8730. baseLocation = process.env['USERPROFILE'] || 'C:\\';
  8731. }
  8732. else {
  8733. if (process.platform === 'darwin') {
  8734. baseLocation = '/Users';
  8735. }
  8736. else {
  8737. baseLocation = '/home';
  8738. }
  8739. }
  8740. if (!tempDirectory) {
  8741. tempDirectory = path.join(baseLocation, 'actions', 'temp');
  8742. }
  8743. if (!cacheRoot) {
  8744. cacheRoot = path.join(baseLocation, 'actions', 'cache');
  8745. }
  8746. }
  8747. /**
  8748. * Download a tool from an url and stream it into a file
  8749. *
  8750. * @param url url of tool to download
  8751. * @returns path to downloaded tool
  8752. */
  8753. function downloadTool(url) {
  8754. return __awaiter(this, void 0, void 0, function* () {
  8755. // Wrap in a promise so that we can resolve from within stream callbacks
  8756. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  8757. try {
  8758. const http = new httpm.HttpClient(userAgent, [], {
  8759. allowRetries: true,
  8760. maxRetries: 3
  8761. });
  8762. const destPath = path.join(tempDirectory, uuidV4());
  8763. yield io.mkdirP(tempDirectory);
  8764. core.debug(`Downloading ${url}`);
  8765. core.debug(`Downloading ${destPath}`);
  8766. if (fs.existsSync(destPath)) {
  8767. throw new Error(`Destination file path ${destPath} already exists`);
  8768. }
  8769. const response = yield http.get(url);
  8770. if (response.message.statusCode !== 200) {
  8771. const err = new HTTPError(response.message.statusCode);
  8772. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  8773. throw err;
  8774. }
  8775. const file = fs.createWriteStream(destPath);
  8776. file.on('open', () => __awaiter(this, void 0, void 0, function* () {
  8777. try {
  8778. const stream = response.message.pipe(file);
  8779. stream.on('close', () => {
  8780. core.debug('download complete');
  8781. resolve(destPath);
  8782. });
  8783. }
  8784. catch (err) {
  8785. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  8786. reject(err);
  8787. }
  8788. }));
  8789. file.on('error', err => {
  8790. file.end();
  8791. reject(err);
  8792. });
  8793. }
  8794. catch (err) {
  8795. reject(err);
  8796. }
  8797. }));
  8798. });
  8799. }
  8800. exports.downloadTool = downloadTool;
  8801. /**
  8802. * Extract a .7z file
  8803. *
  8804. * @param file path to the .7z file
  8805. * @param dest destination directory. Optional.
  8806. * @param _7zPath path to 7zr.exe. Optional, for long path support. Most .7z archives do not have this
  8807. * problem. If your .7z archive contains very long paths, you can pass the path to 7zr.exe which will
  8808. * gracefully handle long paths. By default 7zdec.exe is used because it is a very small program and is
  8809. * bundled with the tool lib. However it does not support long paths. 7zr.exe is the reduced command line
  8810. * interface, it is smaller than the full command line interface, and it does support long paths. At the
  8811. * time of this writing, it is freely available from the LZMA SDK that is available on the 7zip website.
  8812. * Be sure to check the current license agreement. If 7zr.exe is bundled with your action, then the path
  8813. * to 7zr.exe can be pass to this function.
  8814. * @returns path to the destination directory
  8815. */
  8816. function extract7z(file, dest, _7zPath) {
  8817. return __awaiter(this, void 0, void 0, function* () {
  8818. assert_1.ok(IS_WINDOWS, 'extract7z() not supported on current OS');
  8819. assert_1.ok(file, 'parameter "file" is required');
  8820. dest = dest || (yield _createExtractFolder(dest));
  8821. const originalCwd = process.cwd();
  8822. process.chdir(dest);
  8823. if (_7zPath) {
  8824. try {
  8825. const args = [
  8826. 'x',
  8827. '-bb1',
  8828. '-bd',
  8829. '-sccUTF-8',
  8830. file
  8831. ];
  8832. const options = {
  8833. silent: true
  8834. };
  8835. yield exec_1.exec(`"${_7zPath}"`, args, options);
  8836. }
  8837. finally {
  8838. process.chdir(originalCwd);
  8839. }
  8840. }
  8841. else {
  8842. const escapedScript = path
  8843. .join(__dirname, '..', 'scripts', 'Invoke-7zdec.ps1')
  8844. .replace(/'/g, "''")
  8845. .replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  8846. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  8847. const escapedTarget = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  8848. const command = `& '${escapedScript}' -Source '${escapedFile}' -Target '${escapedTarget}'`;
  8849. const args = [
  8850. '-NoLogo',
  8851. '-Sta',
  8852. '-NoProfile',
  8853. '-NonInteractive',
  8854. '-ExecutionPolicy',
  8855. 'Unrestricted',
  8856. '-Command',
  8857. command
  8858. ];
  8859. const options = {
  8860. silent: true
  8861. };
  8862. try {
  8863. const powershellPath = yield io.which('powershell', true);
  8864. yield exec_1.exec(`"${powershellPath}"`, args, options);
  8865. }
  8866. finally {
  8867. process.chdir(originalCwd);
  8868. }
  8869. }
  8870. return dest;
  8871. });
  8872. }
  8873. exports.extract7z = extract7z;
  8874. /**
  8875. * Extract a tar
  8876. *
  8877. * @param file path to the tar
  8878. * @param dest destination directory. Optional.
  8879. * @param flags flags for the tar. Optional.
  8880. * @returns path to the destination directory
  8881. */
  8882. function extractTar(file, dest, flags = 'xz') {
  8883. return __awaiter(this, void 0, void 0, function* () {
  8884. if (!file) {
  8885. throw new Error("parameter 'file' is required");
  8886. }
  8887. dest = dest || (yield _createExtractFolder(dest));
  8888. const tarPath = yield io.which('tar', true);
  8889. yield exec_1.exec(`"${tarPath}"`, [flags, '-C', dest, '-f', file]);
  8890. return dest;
  8891. });
  8892. }
  8893. exports.extractTar = extractTar;
  8894. /**
  8895. * Extract a zip
  8896. *
  8897. * @param file path to the zip
  8898. * @param dest destination directory. Optional.
  8899. * @returns path to the destination directory
  8900. */
  8901. function extractZip(file, dest) {
  8902. return __awaiter(this, void 0, void 0, function* () {
  8903. if (!file) {
  8904. throw new Error("parameter 'file' is required");
  8905. }
  8906. dest = dest || (yield _createExtractFolder(dest));
  8907. if (IS_WINDOWS) {
  8908. yield extractZipWin(file, dest);
  8909. }
  8910. else {
  8911. yield extractZipNix(file, dest);
  8912. }
  8913. return dest;
  8914. });
  8915. }
  8916. exports.extractZip = extractZip;
  8917. function extractZipWin(file, dest) {
  8918. return __awaiter(this, void 0, void 0, function* () {
  8919. // build the powershell command
  8920. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  8921. const escapedDest = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  8922. const command = `$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ; [System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}')`;
  8923. // run powershell
  8924. const powershellPath = yield io.which('powershell');
  8925. const args = [
  8926. '-NoLogo',
  8927. '-Sta',
  8928. '-NoProfile',
  8929. '-NonInteractive',
  8930. '-ExecutionPolicy',
  8931. 'Unrestricted',
  8932. '-Command',
  8933. command
  8934. ];
  8935. yield exec_1.exec(`"${powershellPath}"`, args);
  8936. });
  8937. }
  8938. function extractZipNix(file, dest) {
  8939. return __awaiter(this, void 0, void 0, function* () {
  8940. const unzipPath = yield io.which('unzip');
  8941. yield exec_1.exec(`"${unzipPath}"`, [file], { cwd: dest });
  8942. });
  8943. }
  8944. /**
  8945. * Caches a directory and installs it into the tool cacheDir
  8946. *
  8947. * @param sourceDir the directory to cache into tools
  8948. * @param tool tool name
  8949. * @param version version of the tool. semver format
  8950. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  8951. */
  8952. function cacheDir(sourceDir, tool, version, arch) {
  8953. return __awaiter(this, void 0, void 0, function* () {
  8954. version = semver.clean(version) || version;
  8955. arch = arch || os.arch();
  8956. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  8957. core.debug(`source dir: ${sourceDir}`);
  8958. if (!fs.statSync(sourceDir).isDirectory()) {
  8959. throw new Error('sourceDir is not a directory');
  8960. }
  8961. // Create the tool dir
  8962. const destPath = yield _createToolPath(tool, version, arch);
  8963. // copy each child item. do not move. move can fail on Windows
  8964. // due to anti-virus software having an open handle on a file.
  8965. for (const itemName of fs.readdirSync(sourceDir)) {
  8966. const s = path.join(sourceDir, itemName);
  8967. yield io.cp(s, destPath, { recursive: true });
  8968. }
  8969. // write .complete
  8970. _completeToolPath(tool, version, arch);
  8971. return destPath;
  8972. });
  8973. }
  8974. exports.cacheDir = cacheDir;
  8975. /**
  8976. * Caches a downloaded file (GUID) and installs it
  8977. * into the tool cache with a given targetName
  8978. *
  8979. * @param sourceFile the file to cache into tools. Typically a result of downloadTool which is a guid.
  8980. * @param targetFile the name of the file name in the tools directory
  8981. * @param tool tool name
  8982. * @param version version of the tool. semver format
  8983. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  8984. */
  8985. function cacheFile(sourceFile, targetFile, tool, version, arch) {
  8986. return __awaiter(this, void 0, void 0, function* () {
  8987. version = semver.clean(version) || version;
  8988. arch = arch || os.arch();
  8989. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  8990. core.debug(`source file: ${sourceFile}`);
  8991. if (!fs.statSync(sourceFile).isFile()) {
  8992. throw new Error('sourceFile is not a file');
  8993. }
  8994. // create the tool dir
  8995. const destFolder = yield _createToolPath(tool, version, arch);
  8996. // copy instead of move. move can fail on Windows due to
  8997. // anti-virus software having an open handle on a file.
  8998. const destPath = path.join(destFolder, targetFile);
  8999. core.debug(`destination file ${destPath}`);
  9000. yield io.cp(sourceFile, destPath);
  9001. // write .complete
  9002. _completeToolPath(tool, version, arch);
  9003. return destFolder;
  9004. });
  9005. }
  9006. exports.cacheFile = cacheFile;
  9007. /**
  9008. * Finds the path to a tool version in the local installed tool cache
  9009. *
  9010. * @param toolName name of the tool
  9011. * @param versionSpec version of the tool
  9012. * @param arch optional arch. defaults to arch of computer
  9013. */
  9014. function find(toolName, versionSpec, arch) {
  9015. if (!toolName) {
  9016. throw new Error('toolName parameter is required');
  9017. }
  9018. if (!versionSpec) {
  9019. throw new Error('versionSpec parameter is required');
  9020. }
  9021. arch = arch || os.arch();
  9022. // attempt to resolve an explicit version
  9023. if (!_isExplicitVersion(versionSpec)) {
  9024. const localVersions = findAllVersions(toolName, arch);
  9025. const match = _evaluateVersions(localVersions, versionSpec);
  9026. versionSpec = match;
  9027. }
  9028. // check for the explicit version in the cache
  9029. let toolPath = '';
  9030. if (versionSpec) {
  9031. versionSpec = semver.clean(versionSpec) || '';
  9032. const cachePath = path.join(cacheRoot, toolName, versionSpec, arch);
  9033. core.debug(`checking cache: ${cachePath}`);
  9034. if (fs.existsSync(cachePath) && fs.existsSync(`${cachePath}.complete`)) {
  9035. core.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`);
  9036. toolPath = cachePath;
  9037. }
  9038. else {
  9039. core.debug('not found');
  9040. }
  9041. }
  9042. return toolPath;
  9043. }
  9044. exports.find = find;
  9045. /**
  9046. * Finds the paths to all versions of a tool that are installed in the local tool cache
  9047. *
  9048. * @param toolName name of the tool
  9049. * @param arch optional arch. defaults to arch of computer
  9050. */
  9051. function findAllVersions(toolName, arch) {
  9052. const versions = [];
  9053. arch = arch || os.arch();
  9054. const toolPath = path.join(cacheRoot, toolName);
  9055. if (fs.existsSync(toolPath)) {
  9056. const children = fs.readdirSync(toolPath);
  9057. for (const child of children) {
  9058. if (_isExplicitVersion(child)) {
  9059. const fullPath = path.join(toolPath, child, arch || '');
  9060. if (fs.existsSync(fullPath) && fs.existsSync(`${fullPath}.complete`)) {
  9061. versions.push(child);
  9062. }
  9063. }
  9064. }
  9065. }
  9066. return versions;
  9067. }
  9068. exports.findAllVersions = findAllVersions;
  9069. function _createExtractFolder(dest) {
  9070. return __awaiter(this, void 0, void 0, function* () {
  9071. if (!dest) {
  9072. // create a temp dir
  9073. dest = path.join(tempDirectory, uuidV4());
  9074. }
  9075. yield io.mkdirP(dest);
  9076. return dest;
  9077. });
  9078. }
  9079. function _createToolPath(tool, version, arch) {
  9080. return __awaiter(this, void 0, void 0, function* () {
  9081. const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
  9082. core.debug(`destination ${folderPath}`);
  9083. const markerPath = `${folderPath}.complete`;
  9084. yield io.rmRF(folderPath);
  9085. yield io.rmRF(markerPath);
  9086. yield io.mkdirP(folderPath);
  9087. return folderPath;
  9088. });
  9089. }
  9090. function _completeToolPath(tool, version, arch) {
  9091. const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
  9092. const markerPath = `${folderPath}.complete`;
  9093. fs.writeFileSync(markerPath, '');
  9094. core.debug('finished caching tool');
  9095. }
  9096. function _isExplicitVersion(versionSpec) {
  9097. const c = semver.clean(versionSpec) || '';
  9098. core.debug(`isExplicit: ${c}`);
  9099. const valid = semver.valid(c) != null;
  9100. core.debug(`explicit? ${valid}`);
  9101. return valid;
  9102. }
  9103. function _evaluateVersions(versions, versionSpec) {
  9104. let version = '';
  9105. core.debug(`evaluating ${versions.length} versions`);
  9106. versions = versions.sort((a, b) => {
  9107. if (semver.gt(a, b)) {
  9108. return 1;
  9109. }
  9110. return -1;
  9111. });
  9112. for (let i = versions.length - 1; i >= 0; i--) {
  9113. const potential = versions[i];
  9114. const satisfied = semver.satisfies(potential, versionSpec);
  9115. if (satisfied) {
  9116. version = potential;
  9117. break;
  9118. }
  9119. }
  9120. if (version) {
  9121. core.debug(`matched: ${version}`);
  9122. }
  9123. else {
  9124. core.debug('match not found');
  9125. }
  9126. return version;
  9127. }
  9128. //# sourceMappingURL=tool-cache.js.map
  9129. /***/ }),
  9130. /***/ 536:
  9131. /***/ (function(module, __unusedexports, __webpack_require__) {
  9132. module.exports = hasFirstPage
  9133. const deprecate = __webpack_require__(370)
  9134. const getPageLinks = __webpack_require__(577)
  9135. function hasFirstPage (link) {
  9136. deprecate(`octokit.hasFirstPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  9137. return getPageLinks(link).first
  9138. }
  9139. /***/ }),
  9140. /***/ 537:
  9141. /***/ (function(__unusedmodule, exports) {
  9142. "use strict";
  9143. Object.defineProperty(exports, "__esModule", { value: true });
  9144. function promisify(fn) {
  9145. return function (req, opts) {
  9146. return new Promise((resolve, reject) => {
  9147. fn.call(this, req, opts, (err, rtn) => {
  9148. if (err) {
  9149. reject(err);
  9150. }
  9151. else {
  9152. resolve(rtn);
  9153. }
  9154. });
  9155. });
  9156. };
  9157. }
  9158. exports.default = promisify;
  9159. //# sourceMappingURL=promisify.js.map
  9160. /***/ }),
  9161. /***/ 550:
  9162. /***/ (function(module, __unusedexports, __webpack_require__) {
  9163. module.exports = getNextPage
  9164. const getPage = __webpack_require__(265)
  9165. function getNextPage (octokit, link, headers) {
  9166. return getPage(octokit, link, 'next', headers)
  9167. }
  9168. /***/ }),
  9169. /***/ 558:
  9170. /***/ (function(module, __unusedexports, __webpack_require__) {
  9171. module.exports = hasPreviousPage
  9172. const deprecate = __webpack_require__(370)
  9173. const getPageLinks = __webpack_require__(577)
  9174. function hasPreviousPage (link) {
  9175. deprecate(`octokit.hasPreviousPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  9176. return getPageLinks(link).prev
  9177. }
  9178. /***/ }),
  9179. /***/ 559:
  9180. /***/ (function(__unusedmodule, exports) {
  9181. "use strict";
  9182. Object.defineProperty(exports, "__esModule", { value: true });
  9183. class GitVersion {
  9184. /**
  9185. * Used for comparing the version of git and git-lfs against the minimum required version
  9186. * @param version the version string, e.g. 1.2 or 1.2.3
  9187. */
  9188. constructor(version) {
  9189. this.major = NaN;
  9190. this.minor = NaN;
  9191. this.patch = NaN;
  9192. if (version) {
  9193. const match = version.match(/^(\d+)\.(\d+)(\.(\d+))?$/);
  9194. if (match) {
  9195. this.major = Number(match[1]);
  9196. this.minor = Number(match[2]);
  9197. if (match[4]) {
  9198. this.patch = Number(match[4]);
  9199. }
  9200. }
  9201. }
  9202. }
  9203. /**
  9204. * Compares the instance against a minimum required version
  9205. * @param minimum Minimum version
  9206. */
  9207. checkMinimum(minimum) {
  9208. if (!minimum.isValid()) {
  9209. throw new Error('Arg minimum is not a valid version');
  9210. }
  9211. // Major is insufficient
  9212. if (this.major < minimum.major) {
  9213. return false;
  9214. }
  9215. // Major is equal
  9216. if (this.major === minimum.major) {
  9217. // Minor is insufficient
  9218. if (this.minor < minimum.minor) {
  9219. return false;
  9220. }
  9221. // Minor is equal
  9222. if (this.minor === minimum.minor) {
  9223. // Patch is insufficient
  9224. if (this.patch && this.patch < (minimum.patch || 0)) {
  9225. return false;
  9226. }
  9227. }
  9228. }
  9229. return true;
  9230. }
  9231. /**
  9232. * Indicates whether the instance was constructed from a valid version string
  9233. */
  9234. isValid() {
  9235. return !isNaN(this.major);
  9236. }
  9237. /**
  9238. * Returns the version as a string, e.g. 1.2 or 1.2.3
  9239. */
  9240. toString() {
  9241. let result = '';
  9242. if (this.isValid()) {
  9243. result = `${this.major}.${this.minor}`;
  9244. if (!isNaN(this.patch)) {
  9245. result += `.${this.patch}`;
  9246. }
  9247. }
  9248. return result;
  9249. }
  9250. }
  9251. exports.GitVersion = GitVersion;
  9252. /***/ }),
  9253. /***/ 562:
  9254. /***/ (function(module, __unusedexports, __webpack_require__) {
  9255. var once = __webpack_require__(969);
  9256. var noop = function() {};
  9257. var isRequest = function(stream) {
  9258. return stream.setHeader && typeof stream.abort === 'function';
  9259. };
  9260. var isChildProcess = function(stream) {
  9261. return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3
  9262. };
  9263. var eos = function(stream, opts, callback) {
  9264. if (typeof opts === 'function') return eos(stream, null, opts);
  9265. if (!opts) opts = {};
  9266. callback = once(callback || noop);
  9267. var ws = stream._writableState;
  9268. var rs = stream._readableState;
  9269. var readable = opts.readable || (opts.readable !== false && stream.readable);
  9270. var writable = opts.writable || (opts.writable !== false && stream.writable);
  9271. var cancelled = false;
  9272. var onlegacyfinish = function() {
  9273. if (!stream.writable) onfinish();
  9274. };
  9275. var onfinish = function() {
  9276. writable = false;
  9277. if (!readable) callback.call(stream);
  9278. };
  9279. var onend = function() {
  9280. readable = false;
  9281. if (!writable) callback.call(stream);
  9282. };
  9283. var onexit = function(exitCode) {
  9284. callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null);
  9285. };
  9286. var onerror = function(err) {
  9287. callback.call(stream, err);
  9288. };
  9289. var onclose = function() {
  9290. process.nextTick(onclosenexttick);
  9291. };
  9292. var onclosenexttick = function() {
  9293. if (cancelled) return;
  9294. if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error('premature close'));
  9295. if (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error('premature close'));
  9296. };
  9297. var onrequest = function() {
  9298. stream.req.on('finish', onfinish);
  9299. };
  9300. if (isRequest(stream)) {
  9301. stream.on('complete', onfinish);
  9302. stream.on('abort', onclose);
  9303. if (stream.req) onrequest();
  9304. else stream.on('request', onrequest);
  9305. } else if (writable && !ws) { // legacy streams
  9306. stream.on('end', onlegacyfinish);
  9307. stream.on('close', onlegacyfinish);
  9308. }
  9309. if (isChildProcess(stream)) stream.on('exit', onexit);
  9310. stream.on('end', onend);
  9311. stream.on('finish', onfinish);
  9312. if (opts.error !== false) stream.on('error', onerror);
  9313. stream.on('close', onclose);
  9314. return function() {
  9315. cancelled = true;
  9316. stream.removeListener('complete', onfinish);
  9317. stream.removeListener('abort', onclose);
  9318. stream.removeListener('request', onrequest);
  9319. if (stream.req) stream.req.removeListener('finish', onfinish);
  9320. stream.removeListener('end', onlegacyfinish);
  9321. stream.removeListener('close', onlegacyfinish);
  9322. stream.removeListener('finish', onfinish);
  9323. stream.removeListener('exit', onexit);
  9324. stream.removeListener('end', onend);
  9325. stream.removeListener('error', onerror);
  9326. stream.removeListener('close', onclose);
  9327. };
  9328. };
  9329. module.exports = eos;
  9330. /***/ }),
  9331. /***/ 563:
  9332. /***/ (function(module, __unusedexports, __webpack_require__) {
  9333. module.exports = getPreviousPage
  9334. const getPage = __webpack_require__(265)
  9335. function getPreviousPage (octokit, link, headers) {
  9336. return getPage(octokit, link, 'prev', headers)
  9337. }
  9338. /***/ }),
  9339. /***/ 568:
  9340. /***/ (function(module, __unusedexports, __webpack_require__) {
  9341. "use strict";
  9342. const path = __webpack_require__(622);
  9343. const niceTry = __webpack_require__(948);
  9344. const resolveCommand = __webpack_require__(489);
  9345. const escape = __webpack_require__(462);
  9346. const readShebang = __webpack_require__(389);
  9347. const semver = __webpack_require__(280);
  9348. const isWin = process.platform === 'win32';
  9349. const isExecutableRegExp = /\.(?:com|exe)$/i;
  9350. const isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
  9351. // `options.shell` is supported in Node ^4.8.0, ^5.7.0 and >= 6.0.0
  9352. const supportsShellOption = niceTry(() => semver.satisfies(process.version, '^4.8.0 || ^5.7.0 || >= 6.0.0', true)) || false;
  9353. function detectShebang(parsed) {
  9354. parsed.file = resolveCommand(parsed);
  9355. const shebang = parsed.file && readShebang(parsed.file);
  9356. if (shebang) {
  9357. parsed.args.unshift(parsed.file);
  9358. parsed.command = shebang;
  9359. return resolveCommand(parsed);
  9360. }
  9361. return parsed.file;
  9362. }
  9363. function parseNonShell(parsed) {
  9364. if (!isWin) {
  9365. return parsed;
  9366. }
  9367. // Detect & add support for shebangs
  9368. const commandFile = detectShebang(parsed);
  9369. // We don't need a shell if the command filename is an executable
  9370. const needsShell = !isExecutableRegExp.test(commandFile);
  9371. // If a shell is required, use cmd.exe and take care of escaping everything correctly
  9372. // Note that `forceShell` is an hidden option used only in tests
  9373. if (parsed.options.forceShell || needsShell) {
  9374. // Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/`
  9375. // The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument
  9376. // Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called,
  9377. // we need to double escape them
  9378. const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
  9379. // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\bar)
  9380. // This is necessary otherwise it will always fail with ENOENT in those cases
  9381. parsed.command = path.normalize(parsed.command);
  9382. // Escape command & arguments
  9383. parsed.command = escape.command(parsed.command);
  9384. parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
  9385. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  9386. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  9387. parsed.command = process.env.comspec || 'cmd.exe';
  9388. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  9389. }
  9390. return parsed;
  9391. }
  9392. function parseShell(parsed) {
  9393. // If node supports the shell option, there's no need to mimic its behavior
  9394. if (supportsShellOption) {
  9395. return parsed;
  9396. }
  9397. // Mimic node shell option
  9398. // See https://github.com/nodejs/node/blob/b9f6a2dc059a1062776133f3d4fd848c4da7d150/lib/child_process.js#L335
  9399. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  9400. if (isWin) {
  9401. parsed.command = typeof parsed.options.shell === 'string' ? parsed.options.shell : process.env.comspec || 'cmd.exe';
  9402. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  9403. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  9404. } else {
  9405. if (typeof parsed.options.shell === 'string') {
  9406. parsed.command = parsed.options.shell;
  9407. } else if (process.platform === 'android') {
  9408. parsed.command = '/system/bin/sh';
  9409. } else {
  9410. parsed.command = '/bin/sh';
  9411. }
  9412. parsed.args = ['-c', shellCommand];
  9413. }
  9414. return parsed;
  9415. }
  9416. function parse(command, args, options) {
  9417. // Normalize arguments, similar to nodejs
  9418. if (args && !Array.isArray(args)) {
  9419. options = args;
  9420. args = null;
  9421. }
  9422. args = args ? args.slice(0) : []; // Clone array to avoid changing the original
  9423. options = Object.assign({}, options); // Clone object to avoid changing the original
  9424. // Build our parsed object
  9425. const parsed = {
  9426. command,
  9427. args,
  9428. options,
  9429. file: undefined,
  9430. original: {
  9431. command,
  9432. args,
  9433. },
  9434. };
  9435. // Delegate further parsing to shell or non-shell
  9436. return options.shell ? parseShell(parsed) : parseNonShell(parsed);
  9437. }
  9438. module.exports = parse;
  9439. /***/ }),
  9440. /***/ 577:
  9441. /***/ (function(module) {
  9442. module.exports = getPageLinks
  9443. function getPageLinks (link) {
  9444. link = link.link || link.headers.link || ''
  9445. const links = {}
  9446. // link format:
  9447. // '<https://api.github.com/users/aseemk/followers?page=2>; rel="next", <https://api.github.com/users/aseemk/followers?page=2>; rel="last"'
  9448. link.replace(/<([^>]*)>;\s*rel="([\w]*)"/g, (m, uri, type) => {
  9449. links[type] = uri
  9450. })
  9451. return links
  9452. }
  9453. /***/ }),
  9454. /***/ 586:
  9455. /***/ (function(module, __unusedexports, __webpack_require__) {
  9456. module.exports = octokitRestApiEndpoints;
  9457. const ROUTES = __webpack_require__(705);
  9458. function octokitRestApiEndpoints(octokit) {
  9459. // Aliasing scopes for backward compatibility
  9460. // See https://github.com/octokit/rest.js/pull/1134
  9461. ROUTES.gitdata = ROUTES.git;
  9462. ROUTES.authorization = ROUTES.oauthAuthorizations;
  9463. ROUTES.pullRequests = ROUTES.pulls;
  9464. octokit.registerEndpoints(ROUTES);
  9465. }
  9466. /***/ }),
  9467. /***/ 587:
  9468. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  9469. "use strict";
  9470. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  9471. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  9472. return new (P || (P = Promise))(function (resolve, reject) {
  9473. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  9474. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  9475. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  9476. step((generator = generator.apply(thisArg, _arguments || [])).next());
  9477. });
  9478. };
  9479. var __importStar = (this && this.__importStar) || function (mod) {
  9480. if (mod && mod.__esModule) return mod;
  9481. var result = {};
  9482. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  9483. result["default"] = mod;
  9484. return result;
  9485. };
  9486. Object.defineProperty(exports, "__esModule", { value: true });
  9487. const core = __importStar(__webpack_require__(470));
  9488. const defaultMaxAttempts = 3;
  9489. const defaultMinSeconds = 10;
  9490. const defaultMaxSeconds = 20;
  9491. class RetryHelper {
  9492. constructor(maxAttempts = defaultMaxAttempts, minSeconds = defaultMinSeconds, maxSeconds = defaultMaxSeconds) {
  9493. this.maxAttempts = maxAttempts;
  9494. this.minSeconds = Math.floor(minSeconds);
  9495. this.maxSeconds = Math.floor(maxSeconds);
  9496. if (this.minSeconds > this.maxSeconds) {
  9497. throw new Error('min seconds should be less than or equal to max seconds');
  9498. }
  9499. }
  9500. execute(action) {
  9501. return __awaiter(this, void 0, void 0, function* () {
  9502. let attempt = 1;
  9503. while (attempt < this.maxAttempts) {
  9504. // Try
  9505. try {
  9506. return yield action();
  9507. }
  9508. catch (err) {
  9509. core.info(err.message);
  9510. }
  9511. // Sleep
  9512. const seconds = this.getSleepAmount();
  9513. core.info(`Waiting ${seconds} seconds before trying again`);
  9514. yield this.sleep(seconds);
  9515. attempt++;
  9516. }
  9517. // Last attempt
  9518. return yield action();
  9519. });
  9520. }
  9521. getSleepAmount() {
  9522. return (Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) +
  9523. this.minSeconds);
  9524. }
  9525. sleep(seconds) {
  9526. return __awaiter(this, void 0, void 0, function* () {
  9527. return new Promise(resolve => setTimeout(resolve, seconds * 1000));
  9528. });
  9529. }
  9530. }
  9531. exports.RetryHelper = RetryHelper;
  9532. function execute(action) {
  9533. return __awaiter(this, void 0, void 0, function* () {
  9534. const retryHelper = new RetryHelper();
  9535. return yield retryHelper.execute(action);
  9536. });
  9537. }
  9538. exports.execute = execute;
  9539. /***/ }),
  9540. /***/ 605:
  9541. /***/ (function(module) {
  9542. module.exports = require("http");
  9543. /***/ }),
  9544. /***/ 614:
  9545. /***/ (function(module) {
  9546. module.exports = require("events");
  9547. /***/ }),
  9548. /***/ 618:
  9549. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  9550. "use strict";
  9551. var __importStar = (this && this.__importStar) || function (mod) {
  9552. if (mod && mod.__esModule) return mod;
  9553. var result = {};
  9554. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  9555. result["default"] = mod;
  9556. return result;
  9557. };
  9558. Object.defineProperty(exports, "__esModule", { value: true });
  9559. const fs = __importStar(__webpack_require__(747));
  9560. function directoryExistsSync(path, required) {
  9561. if (!path) {
  9562. throw new Error("Arg 'path' must not be empty");
  9563. }
  9564. let stats;
  9565. try {
  9566. stats = fs.statSync(path);
  9567. }
  9568. catch (error) {
  9569. if (error.code === 'ENOENT') {
  9570. if (!required) {
  9571. return false;
  9572. }
  9573. throw new Error(`Directory '${path}' does not exist`);
  9574. }
  9575. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  9576. }
  9577. if (stats.isDirectory()) {
  9578. return true;
  9579. }
  9580. else if (!required) {
  9581. return false;
  9582. }
  9583. throw new Error(`Directory '${path}' does not exist`);
  9584. }
  9585. exports.directoryExistsSync = directoryExistsSync;
  9586. function existsSync(path) {
  9587. if (!path) {
  9588. throw new Error("Arg 'path' must not be empty");
  9589. }
  9590. try {
  9591. fs.statSync(path);
  9592. }
  9593. catch (error) {
  9594. if (error.code === 'ENOENT') {
  9595. return false;
  9596. }
  9597. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  9598. }
  9599. return true;
  9600. }
  9601. exports.existsSync = existsSync;
  9602. function fileExistsSync(path) {
  9603. if (!path) {
  9604. throw new Error("Arg 'path' must not be empty");
  9605. }
  9606. let stats;
  9607. try {
  9608. stats = fs.statSync(path);
  9609. }
  9610. catch (error) {
  9611. if (error.code === 'ENOENT') {
  9612. return false;
  9613. }
  9614. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  9615. }
  9616. if (!stats.isDirectory()) {
  9617. return true;
  9618. }
  9619. return false;
  9620. }
  9621. exports.fileExistsSync = fileExistsSync;
  9622. /***/ }),
  9623. /***/ 621:
  9624. /***/ (function(module, __unusedexports, __webpack_require__) {
  9625. "use strict";
  9626. const path = __webpack_require__(622);
  9627. const pathKey = __webpack_require__(39);
  9628. module.exports = opts => {
  9629. opts = Object.assign({
  9630. cwd: process.cwd(),
  9631. path: process.env[pathKey()]
  9632. }, opts);
  9633. let prev;
  9634. let pth = path.resolve(opts.cwd);
  9635. const ret = [];
  9636. while (prev !== pth) {
  9637. ret.push(path.join(pth, 'node_modules/.bin'));
  9638. prev = pth;
  9639. pth = path.resolve(pth, '..');
  9640. }
  9641. // ensure the running `node` binary is used
  9642. ret.push(path.dirname(process.execPath));
  9643. return ret.concat(opts.path).join(path.delimiter);
  9644. };
  9645. module.exports.env = opts => {
  9646. opts = Object.assign({
  9647. env: process.env
  9648. }, opts);
  9649. const env = Object.assign({}, opts.env);
  9650. const path = pathKey({env});
  9651. opts.path = env[path];
  9652. env[path] = module.exports(opts);
  9653. return env;
  9654. };
  9655. /***/ }),
  9656. /***/ 622:
  9657. /***/ (function(module) {
  9658. module.exports = require("path");
  9659. /***/ }),
  9660. /***/ 631:
  9661. /***/ (function(module) {
  9662. module.exports = require("net");
  9663. /***/ }),
  9664. /***/ 649:
  9665. /***/ (function(module, __unusedexports, __webpack_require__) {
  9666. module.exports = getLastPage
  9667. const getPage = __webpack_require__(265)
  9668. function getLastPage (octokit, link, headers) {
  9669. return getPage(octokit, link, 'last', headers)
  9670. }
  9671. /***/ }),
  9672. /***/ 654:
  9673. /***/ (function(module) {
  9674. // This is not the set of all possible signals.
  9675. //
  9676. // It IS, however, the set of all signals that trigger
  9677. // an exit on either Linux or BSD systems. Linux is a
  9678. // superset of the signal names supported on BSD, and
  9679. // the unknown signals just fail to register, so we can
  9680. // catch that easily enough.
  9681. //
  9682. // Don't bother with SIGKILL. It's uncatchable, which
  9683. // means that we can't fire any callbacks anyway.
  9684. //
  9685. // If a user does happen to register a handler on a non-
  9686. // fatal signal like SIGWINCH or something, and then
  9687. // exit, it'll end up firing `process.emit('exit')`, so
  9688. // the handler will be fired anyway.
  9689. //
  9690. // SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised
  9691. // artificially, inherently leave the process in a
  9692. // state from which it is not safe to try and enter JS
  9693. // listeners.
  9694. module.exports = [
  9695. 'SIGABRT',
  9696. 'SIGALRM',
  9697. 'SIGHUP',
  9698. 'SIGINT',
  9699. 'SIGTERM'
  9700. ]
  9701. if (process.platform !== 'win32') {
  9702. module.exports.push(
  9703. 'SIGVTALRM',
  9704. 'SIGXCPU',
  9705. 'SIGXFSZ',
  9706. 'SIGUSR2',
  9707. 'SIGTRAP',
  9708. 'SIGSYS',
  9709. 'SIGQUIT',
  9710. 'SIGIOT'
  9711. // should detect profiler and enable/disable accordingly.
  9712. // see #21
  9713. // 'SIGPROF'
  9714. )
  9715. }
  9716. if (process.platform === 'linux') {
  9717. module.exports.push(
  9718. 'SIGIO',
  9719. 'SIGPOLL',
  9720. 'SIGPWR',
  9721. 'SIGSTKFLT',
  9722. 'SIGUNUSED'
  9723. )
  9724. }
  9725. /***/ }),
  9726. /***/ 656:
  9727. /***/ (function(module, exports) {
  9728. exports = module.exports = SemVer
  9729. var debug
  9730. /* istanbul ignore next */
  9731. if (typeof process === 'object' &&
  9732. process.env &&
  9733. process.env.NODE_DEBUG &&
  9734. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  9735. debug = function () {
  9736. var args = Array.prototype.slice.call(arguments, 0)
  9737. args.unshift('SEMVER')
  9738. console.log.apply(console, args)
  9739. }
  9740. } else {
  9741. debug = function () {}
  9742. }
  9743. // Note: this is the semver.org version of the spec that it implements
  9744. // Not necessarily the package version of this code.
  9745. exports.SEMVER_SPEC_VERSION = '2.0.0'
  9746. var MAX_LENGTH = 256
  9747. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  9748. /* istanbul ignore next */ 9007199254740991
  9749. // Max safe segment length for coercion.
  9750. var MAX_SAFE_COMPONENT_LENGTH = 16
  9751. // The actual regexps go on exports.re
  9752. var re = exports.re = []
  9753. var src = exports.src = []
  9754. var t = exports.tokens = {}
  9755. var R = 0
  9756. function tok (n) {
  9757. t[n] = R++
  9758. }
  9759. // The following Regular Expressions can be used for tokenizing,
  9760. // validating, and parsing SemVer version strings.
  9761. // ## Numeric Identifier
  9762. // A single `0`, or a non-zero digit followed by zero or more digits.
  9763. tok('NUMERICIDENTIFIER')
  9764. src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  9765. tok('NUMERICIDENTIFIERLOOSE')
  9766. src[t.NUMERICIDENTIFIERLOOSE] = '[0-9]+'
  9767. // ## Non-numeric Identifier
  9768. // Zero or more digits, followed by a letter or hyphen, and then zero or
  9769. // more letters, digits, or hyphens.
  9770. tok('NONNUMERICIDENTIFIER')
  9771. src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
  9772. // ## Main Version
  9773. // Three dot-separated numeric identifiers.
  9774. tok('MAINVERSION')
  9775. src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  9776. '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  9777. '(' + src[t.NUMERICIDENTIFIER] + ')'
  9778. tok('MAINVERSIONLOOSE')
  9779. src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  9780. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  9781. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')'
  9782. // ## Pre-release Version Identifier
  9783. // A numeric identifier, or a non-numeric identifier.
  9784. tok('PRERELEASEIDENTIFIER')
  9785. src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] +
  9786. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  9787. tok('PRERELEASEIDENTIFIERLOOSE')
  9788. src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] +
  9789. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  9790. // ## Pre-release Version
  9791. // Hyphen, followed by one or more dot-separated pre-release version
  9792. // identifiers.
  9793. tok('PRERELEASE')
  9794. src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] +
  9795. '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))'
  9796. tok('PRERELEASELOOSE')
  9797. src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] +
  9798. '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))'
  9799. // ## Build Metadata Identifier
  9800. // Any combination of digits, letters, or hyphens.
  9801. tok('BUILDIDENTIFIER')
  9802. src[t.BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
  9803. // ## Build Metadata
  9804. // Plus sign, followed by one or more period-separated build metadata
  9805. // identifiers.
  9806. tok('BUILD')
  9807. src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] +
  9808. '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))'
  9809. // ## Full Version String
  9810. // A main version, followed optionally by a pre-release version and
  9811. // build metadata.
  9812. // Note that the only major, minor, patch, and pre-release sections of
  9813. // the version string are capturing groups. The build metadata is not a
  9814. // capturing group, because it should not ever be used in version
  9815. // comparison.
  9816. tok('FULL')
  9817. tok('FULLPLAIN')
  9818. src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] +
  9819. src[t.PRERELEASE] + '?' +
  9820. src[t.BUILD] + '?'
  9821. src[t.FULL] = '^' + src[t.FULLPLAIN] + '$'
  9822. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  9823. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  9824. // common in the npm registry.
  9825. tok('LOOSEPLAIN')
  9826. src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] +
  9827. src[t.PRERELEASELOOSE] + '?' +
  9828. src[t.BUILD] + '?'
  9829. tok('LOOSE')
  9830. src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$'
  9831. tok('GTLT')
  9832. src[t.GTLT] = '((?:<|>)?=?)'
  9833. // Something like "2.*" or "1.2.x".
  9834. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  9835. // Only the first item is strictly required.
  9836. tok('XRANGEIDENTIFIERLOOSE')
  9837. src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  9838. tok('XRANGEIDENTIFIER')
  9839. src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*'
  9840. tok('XRANGEPLAIN')
  9841. src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' +
  9842. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  9843. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  9844. '(?:' + src[t.PRERELEASE] + ')?' +
  9845. src[t.BUILD] + '?' +
  9846. ')?)?'
  9847. tok('XRANGEPLAINLOOSE')
  9848. src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  9849. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  9850. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  9851. '(?:' + src[t.PRERELEASELOOSE] + ')?' +
  9852. src[t.BUILD] + '?' +
  9853. ')?)?'
  9854. tok('XRANGE')
  9855. src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$'
  9856. tok('XRANGELOOSE')
  9857. src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$'
  9858. // Coercion.
  9859. // Extract anything that could conceivably be a part of a valid semver
  9860. tok('COERCE')
  9861. src[t.COERCE] = '(^|[^\\d])' +
  9862. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  9863. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  9864. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  9865. '(?:$|[^\\d])'
  9866. tok('COERCERTL')
  9867. re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g')
  9868. // Tilde ranges.
  9869. // Meaning is "reasonably at or greater than"
  9870. tok('LONETILDE')
  9871. src[t.LONETILDE] = '(?:~>?)'
  9872. tok('TILDETRIM')
  9873. src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+'
  9874. re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g')
  9875. var tildeTrimReplace = '$1~'
  9876. tok('TILDE')
  9877. src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$'
  9878. tok('TILDELOOSE')
  9879. src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$'
  9880. // Caret ranges.
  9881. // Meaning is "at least and backwards compatible with"
  9882. tok('LONECARET')
  9883. src[t.LONECARET] = '(?:\\^)'
  9884. tok('CARETTRIM')
  9885. src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+'
  9886. re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g')
  9887. var caretTrimReplace = '$1^'
  9888. tok('CARET')
  9889. src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$'
  9890. tok('CARETLOOSE')
  9891. src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$'
  9892. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  9893. tok('COMPARATORLOOSE')
  9894. src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$'
  9895. tok('COMPARATOR')
  9896. src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$'
  9897. // An expression to strip any whitespace between the gtlt and the thing
  9898. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  9899. tok('COMPARATORTRIM')
  9900. src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] +
  9901. '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')'
  9902. // this one has to use the /g flag
  9903. re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g')
  9904. var comparatorTrimReplace = '$1$2$3'
  9905. // Something like `1.2.3 - 1.2.4`
  9906. // Note that these all use the loose form, because they'll be
  9907. // checked against either the strict or loose comparator form
  9908. // later.
  9909. tok('HYPHENRANGE')
  9910. src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' +
  9911. '\\s+-\\s+' +
  9912. '(' + src[t.XRANGEPLAIN] + ')' +
  9913. '\\s*$'
  9914. tok('HYPHENRANGELOOSE')
  9915. src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' +
  9916. '\\s+-\\s+' +
  9917. '(' + src[t.XRANGEPLAINLOOSE] + ')' +
  9918. '\\s*$'
  9919. // Star ranges basically just allow anything at all.
  9920. tok('STAR')
  9921. src[t.STAR] = '(<|>)?=?\\s*\\*'
  9922. // Compile to actual regexp objects.
  9923. // All are flag-free, unless they were created above with a flag.
  9924. for (var i = 0; i < R; i++) {
  9925. debug(i, src[i])
  9926. if (!re[i]) {
  9927. re[i] = new RegExp(src[i])
  9928. }
  9929. }
  9930. exports.parse = parse
  9931. function parse (version, options) {
  9932. if (!options || typeof options !== 'object') {
  9933. options = {
  9934. loose: !!options,
  9935. includePrerelease: false
  9936. }
  9937. }
  9938. if (version instanceof SemVer) {
  9939. return version
  9940. }
  9941. if (typeof version !== 'string') {
  9942. return null
  9943. }
  9944. if (version.length > MAX_LENGTH) {
  9945. return null
  9946. }
  9947. var r = options.loose ? re[t.LOOSE] : re[t.FULL]
  9948. if (!r.test(version)) {
  9949. return null
  9950. }
  9951. try {
  9952. return new SemVer(version, options)
  9953. } catch (er) {
  9954. return null
  9955. }
  9956. }
  9957. exports.valid = valid
  9958. function valid (version, options) {
  9959. var v = parse(version, options)
  9960. return v ? v.version : null
  9961. }
  9962. exports.clean = clean
  9963. function clean (version, options) {
  9964. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  9965. return s ? s.version : null
  9966. }
  9967. exports.SemVer = SemVer
  9968. function SemVer (version, options) {
  9969. if (!options || typeof options !== 'object') {
  9970. options = {
  9971. loose: !!options,
  9972. includePrerelease: false
  9973. }
  9974. }
  9975. if (version instanceof SemVer) {
  9976. if (version.loose === options.loose) {
  9977. return version
  9978. } else {
  9979. version = version.version
  9980. }
  9981. } else if (typeof version !== 'string') {
  9982. throw new TypeError('Invalid Version: ' + version)
  9983. }
  9984. if (version.length > MAX_LENGTH) {
  9985. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  9986. }
  9987. if (!(this instanceof SemVer)) {
  9988. return new SemVer(version, options)
  9989. }
  9990. debug('SemVer', version, options)
  9991. this.options = options
  9992. this.loose = !!options.loose
  9993. var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])
  9994. if (!m) {
  9995. throw new TypeError('Invalid Version: ' + version)
  9996. }
  9997. this.raw = version
  9998. // these are actually numbers
  9999. this.major = +m[1]
  10000. this.minor = +m[2]
  10001. this.patch = +m[3]
  10002. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  10003. throw new TypeError('Invalid major version')
  10004. }
  10005. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  10006. throw new TypeError('Invalid minor version')
  10007. }
  10008. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  10009. throw new TypeError('Invalid patch version')
  10010. }
  10011. // numberify any prerelease numeric ids
  10012. if (!m[4]) {
  10013. this.prerelease = []
  10014. } else {
  10015. this.prerelease = m[4].split('.').map(function (id) {
  10016. if (/^[0-9]+$/.test(id)) {
  10017. var num = +id
  10018. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  10019. return num
  10020. }
  10021. }
  10022. return id
  10023. })
  10024. }
  10025. this.build = m[5] ? m[5].split('.') : []
  10026. this.format()
  10027. }
  10028. SemVer.prototype.format = function () {
  10029. this.version = this.major + '.' + this.minor + '.' + this.patch
  10030. if (this.prerelease.length) {
  10031. this.version += '-' + this.prerelease.join('.')
  10032. }
  10033. return this.version
  10034. }
  10035. SemVer.prototype.toString = function () {
  10036. return this.version
  10037. }
  10038. SemVer.prototype.compare = function (other) {
  10039. debug('SemVer.compare', this.version, this.options, other)
  10040. if (!(other instanceof SemVer)) {
  10041. other = new SemVer(other, this.options)
  10042. }
  10043. return this.compareMain(other) || this.comparePre(other)
  10044. }
  10045. SemVer.prototype.compareMain = function (other) {
  10046. if (!(other instanceof SemVer)) {
  10047. other = new SemVer(other, this.options)
  10048. }
  10049. return compareIdentifiers(this.major, other.major) ||
  10050. compareIdentifiers(this.minor, other.minor) ||
  10051. compareIdentifiers(this.patch, other.patch)
  10052. }
  10053. SemVer.prototype.comparePre = function (other) {
  10054. if (!(other instanceof SemVer)) {
  10055. other = new SemVer(other, this.options)
  10056. }
  10057. // NOT having a prerelease is > having one
  10058. if (this.prerelease.length && !other.prerelease.length) {
  10059. return -1
  10060. } else if (!this.prerelease.length && other.prerelease.length) {
  10061. return 1
  10062. } else if (!this.prerelease.length && !other.prerelease.length) {
  10063. return 0
  10064. }
  10065. var i = 0
  10066. do {
  10067. var a = this.prerelease[i]
  10068. var b = other.prerelease[i]
  10069. debug('prerelease compare', i, a, b)
  10070. if (a === undefined && b === undefined) {
  10071. return 0
  10072. } else if (b === undefined) {
  10073. return 1
  10074. } else if (a === undefined) {
  10075. return -1
  10076. } else if (a === b) {
  10077. continue
  10078. } else {
  10079. return compareIdentifiers(a, b)
  10080. }
  10081. } while (++i)
  10082. }
  10083. SemVer.prototype.compareBuild = function (other) {
  10084. if (!(other instanceof SemVer)) {
  10085. other = new SemVer(other, this.options)
  10086. }
  10087. var i = 0
  10088. do {
  10089. var a = this.build[i]
  10090. var b = other.build[i]
  10091. debug('prerelease compare', i, a, b)
  10092. if (a === undefined && b === undefined) {
  10093. return 0
  10094. } else if (b === undefined) {
  10095. return 1
  10096. } else if (a === undefined) {
  10097. return -1
  10098. } else if (a === b) {
  10099. continue
  10100. } else {
  10101. return compareIdentifiers(a, b)
  10102. }
  10103. } while (++i)
  10104. }
  10105. // preminor will bump the version up to the next minor release, and immediately
  10106. // down to pre-release. premajor and prepatch work the same way.
  10107. SemVer.prototype.inc = function (release, identifier) {
  10108. switch (release) {
  10109. case 'premajor':
  10110. this.prerelease.length = 0
  10111. this.patch = 0
  10112. this.minor = 0
  10113. this.major++
  10114. this.inc('pre', identifier)
  10115. break
  10116. case 'preminor':
  10117. this.prerelease.length = 0
  10118. this.patch = 0
  10119. this.minor++
  10120. this.inc('pre', identifier)
  10121. break
  10122. case 'prepatch':
  10123. // If this is already a prerelease, it will bump to the next version
  10124. // drop any prereleases that might already exist, since they are not
  10125. // relevant at this point.
  10126. this.prerelease.length = 0
  10127. this.inc('patch', identifier)
  10128. this.inc('pre', identifier)
  10129. break
  10130. // If the input is a non-prerelease version, this acts the same as
  10131. // prepatch.
  10132. case 'prerelease':
  10133. if (this.prerelease.length === 0) {
  10134. this.inc('patch', identifier)
  10135. }
  10136. this.inc('pre', identifier)
  10137. break
  10138. case 'major':
  10139. // If this is a pre-major version, bump up to the same major version.
  10140. // Otherwise increment major.
  10141. // 1.0.0-5 bumps to 1.0.0
  10142. // 1.1.0 bumps to 2.0.0
  10143. if (this.minor !== 0 ||
  10144. this.patch !== 0 ||
  10145. this.prerelease.length === 0) {
  10146. this.major++
  10147. }
  10148. this.minor = 0
  10149. this.patch = 0
  10150. this.prerelease = []
  10151. break
  10152. case 'minor':
  10153. // If this is a pre-minor version, bump up to the same minor version.
  10154. // Otherwise increment minor.
  10155. // 1.2.0-5 bumps to 1.2.0
  10156. // 1.2.1 bumps to 1.3.0
  10157. if (this.patch !== 0 || this.prerelease.length === 0) {
  10158. this.minor++
  10159. }
  10160. this.patch = 0
  10161. this.prerelease = []
  10162. break
  10163. case 'patch':
  10164. // If this is not a pre-release version, it will increment the patch.
  10165. // If it is a pre-release it will bump up to the same patch version.
  10166. // 1.2.0-5 patches to 1.2.0
  10167. // 1.2.0 patches to 1.2.1
  10168. if (this.prerelease.length === 0) {
  10169. this.patch++
  10170. }
  10171. this.prerelease = []
  10172. break
  10173. // This probably shouldn't be used publicly.
  10174. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  10175. case 'pre':
  10176. if (this.prerelease.length === 0) {
  10177. this.prerelease = [0]
  10178. } else {
  10179. var i = this.prerelease.length
  10180. while (--i >= 0) {
  10181. if (typeof this.prerelease[i] === 'number') {
  10182. this.prerelease[i]++
  10183. i = -2
  10184. }
  10185. }
  10186. if (i === -1) {
  10187. // didn't increment anything
  10188. this.prerelease.push(0)
  10189. }
  10190. }
  10191. if (identifier) {
  10192. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  10193. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  10194. if (this.prerelease[0] === identifier) {
  10195. if (isNaN(this.prerelease[1])) {
  10196. this.prerelease = [identifier, 0]
  10197. }
  10198. } else {
  10199. this.prerelease = [identifier, 0]
  10200. }
  10201. }
  10202. break
  10203. default:
  10204. throw new Error('invalid increment argument: ' + release)
  10205. }
  10206. this.format()
  10207. this.raw = this.version
  10208. return this
  10209. }
  10210. exports.inc = inc
  10211. function inc (version, release, loose, identifier) {
  10212. if (typeof (loose) === 'string') {
  10213. identifier = loose
  10214. loose = undefined
  10215. }
  10216. try {
  10217. return new SemVer(version, loose).inc(release, identifier).version
  10218. } catch (er) {
  10219. return null
  10220. }
  10221. }
  10222. exports.diff = diff
  10223. function diff (version1, version2) {
  10224. if (eq(version1, version2)) {
  10225. return null
  10226. } else {
  10227. var v1 = parse(version1)
  10228. var v2 = parse(version2)
  10229. var prefix = ''
  10230. if (v1.prerelease.length || v2.prerelease.length) {
  10231. prefix = 'pre'
  10232. var defaultResult = 'prerelease'
  10233. }
  10234. for (var key in v1) {
  10235. if (key === 'major' || key === 'minor' || key === 'patch') {
  10236. if (v1[key] !== v2[key]) {
  10237. return prefix + key
  10238. }
  10239. }
  10240. }
  10241. return defaultResult // may be undefined
  10242. }
  10243. }
  10244. exports.compareIdentifiers = compareIdentifiers
  10245. var numeric = /^[0-9]+$/
  10246. function compareIdentifiers (a, b) {
  10247. var anum = numeric.test(a)
  10248. var bnum = numeric.test(b)
  10249. if (anum && bnum) {
  10250. a = +a
  10251. b = +b
  10252. }
  10253. return a === b ? 0
  10254. : (anum && !bnum) ? -1
  10255. : (bnum && !anum) ? 1
  10256. : a < b ? -1
  10257. : 1
  10258. }
  10259. exports.rcompareIdentifiers = rcompareIdentifiers
  10260. function rcompareIdentifiers (a, b) {
  10261. return compareIdentifiers(b, a)
  10262. }
  10263. exports.major = major
  10264. function major (a, loose) {
  10265. return new SemVer(a, loose).major
  10266. }
  10267. exports.minor = minor
  10268. function minor (a, loose) {
  10269. return new SemVer(a, loose).minor
  10270. }
  10271. exports.patch = patch
  10272. function patch (a, loose) {
  10273. return new SemVer(a, loose).patch
  10274. }
  10275. exports.compare = compare
  10276. function compare (a, b, loose) {
  10277. return new SemVer(a, loose).compare(new SemVer(b, loose))
  10278. }
  10279. exports.compareLoose = compareLoose
  10280. function compareLoose (a, b) {
  10281. return compare(a, b, true)
  10282. }
  10283. exports.compareBuild = compareBuild
  10284. function compareBuild (a, b, loose) {
  10285. var versionA = new SemVer(a, loose)
  10286. var versionB = new SemVer(b, loose)
  10287. return versionA.compare(versionB) || versionA.compareBuild(versionB)
  10288. }
  10289. exports.rcompare = rcompare
  10290. function rcompare (a, b, loose) {
  10291. return compare(b, a, loose)
  10292. }
  10293. exports.sort = sort
  10294. function sort (list, loose) {
  10295. return list.sort(function (a, b) {
  10296. return exports.compareBuild(a, b, loose)
  10297. })
  10298. }
  10299. exports.rsort = rsort
  10300. function rsort (list, loose) {
  10301. return list.sort(function (a, b) {
  10302. return exports.compareBuild(b, a, loose)
  10303. })
  10304. }
  10305. exports.gt = gt
  10306. function gt (a, b, loose) {
  10307. return compare(a, b, loose) > 0
  10308. }
  10309. exports.lt = lt
  10310. function lt (a, b, loose) {
  10311. return compare(a, b, loose) < 0
  10312. }
  10313. exports.eq = eq
  10314. function eq (a, b, loose) {
  10315. return compare(a, b, loose) === 0
  10316. }
  10317. exports.neq = neq
  10318. function neq (a, b, loose) {
  10319. return compare(a, b, loose) !== 0
  10320. }
  10321. exports.gte = gte
  10322. function gte (a, b, loose) {
  10323. return compare(a, b, loose) >= 0
  10324. }
  10325. exports.lte = lte
  10326. function lte (a, b, loose) {
  10327. return compare(a, b, loose) <= 0
  10328. }
  10329. exports.cmp = cmp
  10330. function cmp (a, op, b, loose) {
  10331. switch (op) {
  10332. case '===':
  10333. if (typeof a === 'object')
  10334. a = a.version
  10335. if (typeof b === 'object')
  10336. b = b.version
  10337. return a === b
  10338. case '!==':
  10339. if (typeof a === 'object')
  10340. a = a.version
  10341. if (typeof b === 'object')
  10342. b = b.version
  10343. return a !== b
  10344. case '':
  10345. case '=':
  10346. case '==':
  10347. return eq(a, b, loose)
  10348. case '!=':
  10349. return neq(a, b, loose)
  10350. case '>':
  10351. return gt(a, b, loose)
  10352. case '>=':
  10353. return gte(a, b, loose)
  10354. case '<':
  10355. return lt(a, b, loose)
  10356. case '<=':
  10357. return lte(a, b, loose)
  10358. default:
  10359. throw new TypeError('Invalid operator: ' + op)
  10360. }
  10361. }
  10362. exports.Comparator = Comparator
  10363. function Comparator (comp, options) {
  10364. if (!options || typeof options !== 'object') {
  10365. options = {
  10366. loose: !!options,
  10367. includePrerelease: false
  10368. }
  10369. }
  10370. if (comp instanceof Comparator) {
  10371. if (comp.loose === !!options.loose) {
  10372. return comp
  10373. } else {
  10374. comp = comp.value
  10375. }
  10376. }
  10377. if (!(this instanceof Comparator)) {
  10378. return new Comparator(comp, options)
  10379. }
  10380. debug('comparator', comp, options)
  10381. this.options = options
  10382. this.loose = !!options.loose
  10383. this.parse(comp)
  10384. if (this.semver === ANY) {
  10385. this.value = ''
  10386. } else {
  10387. this.value = this.operator + this.semver.version
  10388. }
  10389. debug('comp', this)
  10390. }
  10391. var ANY = {}
  10392. Comparator.prototype.parse = function (comp) {
  10393. var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
  10394. var m = comp.match(r)
  10395. if (!m) {
  10396. throw new TypeError('Invalid comparator: ' + comp)
  10397. }
  10398. this.operator = m[1] !== undefined ? m[1] : ''
  10399. if (this.operator === '=') {
  10400. this.operator = ''
  10401. }
  10402. // if it literally is just '>' or '' then allow anything.
  10403. if (!m[2]) {
  10404. this.semver = ANY
  10405. } else {
  10406. this.semver = new SemVer(m[2], this.options.loose)
  10407. }
  10408. }
  10409. Comparator.prototype.toString = function () {
  10410. return this.value
  10411. }
  10412. Comparator.prototype.test = function (version) {
  10413. debug('Comparator.test', version, this.options.loose)
  10414. if (this.semver === ANY || version === ANY) {
  10415. return true
  10416. }
  10417. if (typeof version === 'string') {
  10418. try {
  10419. version = new SemVer(version, this.options)
  10420. } catch (er) {
  10421. return false
  10422. }
  10423. }
  10424. return cmp(version, this.operator, this.semver, this.options)
  10425. }
  10426. Comparator.prototype.intersects = function (comp, options) {
  10427. if (!(comp instanceof Comparator)) {
  10428. throw new TypeError('a Comparator is required')
  10429. }
  10430. if (!options || typeof options !== 'object') {
  10431. options = {
  10432. loose: !!options,
  10433. includePrerelease: false
  10434. }
  10435. }
  10436. var rangeTmp
  10437. if (this.operator === '') {
  10438. if (this.value === '') {
  10439. return true
  10440. }
  10441. rangeTmp = new Range(comp.value, options)
  10442. return satisfies(this.value, rangeTmp, options)
  10443. } else if (comp.operator === '') {
  10444. if (comp.value === '') {
  10445. return true
  10446. }
  10447. rangeTmp = new Range(this.value, options)
  10448. return satisfies(comp.semver, rangeTmp, options)
  10449. }
  10450. var sameDirectionIncreasing =
  10451. (this.operator === '>=' || this.operator === '>') &&
  10452. (comp.operator === '>=' || comp.operator === '>')
  10453. var sameDirectionDecreasing =
  10454. (this.operator === '<=' || this.operator === '<') &&
  10455. (comp.operator === '<=' || comp.operator === '<')
  10456. var sameSemVer = this.semver.version === comp.semver.version
  10457. var differentDirectionsInclusive =
  10458. (this.operator === '>=' || this.operator === '<=') &&
  10459. (comp.operator === '>=' || comp.operator === '<=')
  10460. var oppositeDirectionsLessThan =
  10461. cmp(this.semver, '<', comp.semver, options) &&
  10462. ((this.operator === '>=' || this.operator === '>') &&
  10463. (comp.operator === '<=' || comp.operator === '<'))
  10464. var oppositeDirectionsGreaterThan =
  10465. cmp(this.semver, '>', comp.semver, options) &&
  10466. ((this.operator === '<=' || this.operator === '<') &&
  10467. (comp.operator === '>=' || comp.operator === '>'))
  10468. return sameDirectionIncreasing || sameDirectionDecreasing ||
  10469. (sameSemVer && differentDirectionsInclusive) ||
  10470. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  10471. }
  10472. exports.Range = Range
  10473. function Range (range, options) {
  10474. if (!options || typeof options !== 'object') {
  10475. options = {
  10476. loose: !!options,
  10477. includePrerelease: false
  10478. }
  10479. }
  10480. if (range instanceof Range) {
  10481. if (range.loose === !!options.loose &&
  10482. range.includePrerelease === !!options.includePrerelease) {
  10483. return range
  10484. } else {
  10485. return new Range(range.raw, options)
  10486. }
  10487. }
  10488. if (range instanceof Comparator) {
  10489. return new Range(range.value, options)
  10490. }
  10491. if (!(this instanceof Range)) {
  10492. return new Range(range, options)
  10493. }
  10494. this.options = options
  10495. this.loose = !!options.loose
  10496. this.includePrerelease = !!options.includePrerelease
  10497. // First, split based on boolean or ||
  10498. this.raw = range
  10499. this.set = range.split(/\s*\|\|\s*/).map(function (range) {
  10500. return this.parseRange(range.trim())
  10501. }, this).filter(function (c) {
  10502. // throw out any that are not relevant for whatever reason
  10503. return c.length
  10504. })
  10505. if (!this.set.length) {
  10506. throw new TypeError('Invalid SemVer Range: ' + range)
  10507. }
  10508. this.format()
  10509. }
  10510. Range.prototype.format = function () {
  10511. this.range = this.set.map(function (comps) {
  10512. return comps.join(' ').trim()
  10513. }).join('||').trim()
  10514. return this.range
  10515. }
  10516. Range.prototype.toString = function () {
  10517. return this.range
  10518. }
  10519. Range.prototype.parseRange = function (range) {
  10520. var loose = this.options.loose
  10521. range = range.trim()
  10522. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  10523. var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]
  10524. range = range.replace(hr, hyphenReplace)
  10525. debug('hyphen replace', range)
  10526. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  10527. range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)
  10528. debug('comparator trim', range, re[t.COMPARATORTRIM])
  10529. // `~ 1.2.3` => `~1.2.3`
  10530. range = range.replace(re[t.TILDETRIM], tildeTrimReplace)
  10531. // `^ 1.2.3` => `^1.2.3`
  10532. range = range.replace(re[t.CARETTRIM], caretTrimReplace)
  10533. // normalize spaces
  10534. range = range.split(/\s+/).join(' ')
  10535. // At this point, the range is completely trimmed and
  10536. // ready to be split into comparators.
  10537. var compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
  10538. var set = range.split(' ').map(function (comp) {
  10539. return parseComparator(comp, this.options)
  10540. }, this).join(' ').split(/\s+/)
  10541. if (this.options.loose) {
  10542. // in loose mode, throw out any that are not valid comparators
  10543. set = set.filter(function (comp) {
  10544. return !!comp.match(compRe)
  10545. })
  10546. }
  10547. set = set.map(function (comp) {
  10548. return new Comparator(comp, this.options)
  10549. }, this)
  10550. return set
  10551. }
  10552. Range.prototype.intersects = function (range, options) {
  10553. if (!(range instanceof Range)) {
  10554. throw new TypeError('a Range is required')
  10555. }
  10556. return this.set.some(function (thisComparators) {
  10557. return (
  10558. isSatisfiable(thisComparators, options) &&
  10559. range.set.some(function (rangeComparators) {
  10560. return (
  10561. isSatisfiable(rangeComparators, options) &&
  10562. thisComparators.every(function (thisComparator) {
  10563. return rangeComparators.every(function (rangeComparator) {
  10564. return thisComparator.intersects(rangeComparator, options)
  10565. })
  10566. })
  10567. )
  10568. })
  10569. )
  10570. })
  10571. }
  10572. // take a set of comparators and determine whether there
  10573. // exists a version which can satisfy it
  10574. function isSatisfiable (comparators, options) {
  10575. var result = true
  10576. var remainingComparators = comparators.slice()
  10577. var testComparator = remainingComparators.pop()
  10578. while (result && remainingComparators.length) {
  10579. result = remainingComparators.every(function (otherComparator) {
  10580. return testComparator.intersects(otherComparator, options)
  10581. })
  10582. testComparator = remainingComparators.pop()
  10583. }
  10584. return result
  10585. }
  10586. // Mostly just for testing and legacy API reasons
  10587. exports.toComparators = toComparators
  10588. function toComparators (range, options) {
  10589. return new Range(range, options).set.map(function (comp) {
  10590. return comp.map(function (c) {
  10591. return c.value
  10592. }).join(' ').trim().split(' ')
  10593. })
  10594. }
  10595. // comprised of xranges, tildes, stars, and gtlt's at this point.
  10596. // already replaced the hyphen ranges
  10597. // turn into a set of JUST comparators.
  10598. function parseComparator (comp, options) {
  10599. debug('comp', comp, options)
  10600. comp = replaceCarets(comp, options)
  10601. debug('caret', comp)
  10602. comp = replaceTildes(comp, options)
  10603. debug('tildes', comp)
  10604. comp = replaceXRanges(comp, options)
  10605. debug('xrange', comp)
  10606. comp = replaceStars(comp, options)
  10607. debug('stars', comp)
  10608. return comp
  10609. }
  10610. function isX (id) {
  10611. return !id || id.toLowerCase() === 'x' || id === '*'
  10612. }
  10613. // ~, ~> --> * (any, kinda silly)
  10614. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  10615. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  10616. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  10617. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  10618. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  10619. function replaceTildes (comp, options) {
  10620. return comp.trim().split(/\s+/).map(function (comp) {
  10621. return replaceTilde(comp, options)
  10622. }).join(' ')
  10623. }
  10624. function replaceTilde (comp, options) {
  10625. var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]
  10626. return comp.replace(r, function (_, M, m, p, pr) {
  10627. debug('tilde', comp, _, M, m, p, pr)
  10628. var ret
  10629. if (isX(M)) {
  10630. ret = ''
  10631. } else if (isX(m)) {
  10632. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  10633. } else if (isX(p)) {
  10634. // ~1.2 == >=1.2.0 <1.3.0
  10635. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  10636. } else if (pr) {
  10637. debug('replaceTilde pr', pr)
  10638. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  10639. ' <' + M + '.' + (+m + 1) + '.0'
  10640. } else {
  10641. // ~1.2.3 == >=1.2.3 <1.3.0
  10642. ret = '>=' + M + '.' + m + '.' + p +
  10643. ' <' + M + '.' + (+m + 1) + '.0'
  10644. }
  10645. debug('tilde return', ret)
  10646. return ret
  10647. })
  10648. }
  10649. // ^ --> * (any, kinda silly)
  10650. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  10651. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  10652. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  10653. // ^1.2.3 --> >=1.2.3 <2.0.0
  10654. // ^1.2.0 --> >=1.2.0 <2.0.0
  10655. function replaceCarets (comp, options) {
  10656. return comp.trim().split(/\s+/).map(function (comp) {
  10657. return replaceCaret(comp, options)
  10658. }).join(' ')
  10659. }
  10660. function replaceCaret (comp, options) {
  10661. debug('caret', comp, options)
  10662. var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]
  10663. return comp.replace(r, function (_, M, m, p, pr) {
  10664. debug('caret', comp, _, M, m, p, pr)
  10665. var ret
  10666. if (isX(M)) {
  10667. ret = ''
  10668. } else if (isX(m)) {
  10669. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  10670. } else if (isX(p)) {
  10671. if (M === '0') {
  10672. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  10673. } else {
  10674. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  10675. }
  10676. } else if (pr) {
  10677. debug('replaceCaret pr', pr)
  10678. if (M === '0') {
  10679. if (m === '0') {
  10680. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  10681. ' <' + M + '.' + m + '.' + (+p + 1)
  10682. } else {
  10683. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  10684. ' <' + M + '.' + (+m + 1) + '.0'
  10685. }
  10686. } else {
  10687. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  10688. ' <' + (+M + 1) + '.0.0'
  10689. }
  10690. } else {
  10691. debug('no pr')
  10692. if (M === '0') {
  10693. if (m === '0') {
  10694. ret = '>=' + M + '.' + m + '.' + p +
  10695. ' <' + M + '.' + m + '.' + (+p + 1)
  10696. } else {
  10697. ret = '>=' + M + '.' + m + '.' + p +
  10698. ' <' + M + '.' + (+m + 1) + '.0'
  10699. }
  10700. } else {
  10701. ret = '>=' + M + '.' + m + '.' + p +
  10702. ' <' + (+M + 1) + '.0.0'
  10703. }
  10704. }
  10705. debug('caret return', ret)
  10706. return ret
  10707. })
  10708. }
  10709. function replaceXRanges (comp, options) {
  10710. debug('replaceXRanges', comp, options)
  10711. return comp.split(/\s+/).map(function (comp) {
  10712. return replaceXRange(comp, options)
  10713. }).join(' ')
  10714. }
  10715. function replaceXRange (comp, options) {
  10716. comp = comp.trim()
  10717. var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]
  10718. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  10719. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  10720. var xM = isX(M)
  10721. var xm = xM || isX(m)
  10722. var xp = xm || isX(p)
  10723. var anyX = xp
  10724. if (gtlt === '=' && anyX) {
  10725. gtlt = ''
  10726. }
  10727. // if we're including prereleases in the match, then we need
  10728. // to fix this to -0, the lowest possible prerelease value
  10729. pr = options.includePrerelease ? '-0' : ''
  10730. if (xM) {
  10731. if (gtlt === '>' || gtlt === '<') {
  10732. // nothing is allowed
  10733. ret = '<0.0.0-0'
  10734. } else {
  10735. // nothing is forbidden
  10736. ret = '*'
  10737. }
  10738. } else if (gtlt && anyX) {
  10739. // we know patch is an x, because we have any x at all.
  10740. // replace X with 0
  10741. if (xm) {
  10742. m = 0
  10743. }
  10744. p = 0
  10745. if (gtlt === '>') {
  10746. // >1 => >=2.0.0
  10747. // >1.2 => >=1.3.0
  10748. // >1.2.3 => >= 1.2.4
  10749. gtlt = '>='
  10750. if (xm) {
  10751. M = +M + 1
  10752. m = 0
  10753. p = 0
  10754. } else {
  10755. m = +m + 1
  10756. p = 0
  10757. }
  10758. } else if (gtlt === '<=') {
  10759. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  10760. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  10761. gtlt = '<'
  10762. if (xm) {
  10763. M = +M + 1
  10764. } else {
  10765. m = +m + 1
  10766. }
  10767. }
  10768. ret = gtlt + M + '.' + m + '.' + p + pr
  10769. } else if (xm) {
  10770. ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr
  10771. } else if (xp) {
  10772. ret = '>=' + M + '.' + m + '.0' + pr +
  10773. ' <' + M + '.' + (+m + 1) + '.0' + pr
  10774. }
  10775. debug('xRange return', ret)
  10776. return ret
  10777. })
  10778. }
  10779. // Because * is AND-ed with everything else in the comparator,
  10780. // and '' means "any version", just remove the *s entirely.
  10781. function replaceStars (comp, options) {
  10782. debug('replaceStars', comp, options)
  10783. // Looseness is ignored here. star is always as loose as it gets!
  10784. return comp.trim().replace(re[t.STAR], '')
  10785. }
  10786. // This function is passed to string.replace(re[t.HYPHENRANGE])
  10787. // M, m, patch, prerelease, build
  10788. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  10789. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  10790. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  10791. function hyphenReplace ($0,
  10792. from, fM, fm, fp, fpr, fb,
  10793. to, tM, tm, tp, tpr, tb) {
  10794. if (isX(fM)) {
  10795. from = ''
  10796. } else if (isX(fm)) {
  10797. from = '>=' + fM + '.0.0'
  10798. } else if (isX(fp)) {
  10799. from = '>=' + fM + '.' + fm + '.0'
  10800. } else {
  10801. from = '>=' + from
  10802. }
  10803. if (isX(tM)) {
  10804. to = ''
  10805. } else if (isX(tm)) {
  10806. to = '<' + (+tM + 1) + '.0.0'
  10807. } else if (isX(tp)) {
  10808. to = '<' + tM + '.' + (+tm + 1) + '.0'
  10809. } else if (tpr) {
  10810. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  10811. } else {
  10812. to = '<=' + to
  10813. }
  10814. return (from + ' ' + to).trim()
  10815. }
  10816. // if ANY of the sets match ALL of its comparators, then pass
  10817. Range.prototype.test = function (version) {
  10818. if (!version) {
  10819. return false
  10820. }
  10821. if (typeof version === 'string') {
  10822. try {
  10823. version = new SemVer(version, this.options)
  10824. } catch (er) {
  10825. return false
  10826. }
  10827. }
  10828. for (var i = 0; i < this.set.length; i++) {
  10829. if (testSet(this.set[i], version, this.options)) {
  10830. return true
  10831. }
  10832. }
  10833. return false
  10834. }
  10835. function testSet (set, version, options) {
  10836. for (var i = 0; i < set.length; i++) {
  10837. if (!set[i].test(version)) {
  10838. return false
  10839. }
  10840. }
  10841. if (version.prerelease.length && !options.includePrerelease) {
  10842. // Find the set of versions that are allowed to have prereleases
  10843. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  10844. // That should allow `1.2.3-pr.2` to pass.
  10845. // However, `1.2.4-alpha.notready` should NOT be allowed,
  10846. // even though it's within the range set by the comparators.
  10847. for (i = 0; i < set.length; i++) {
  10848. debug(set[i].semver)
  10849. if (set[i].semver === ANY) {
  10850. continue
  10851. }
  10852. if (set[i].semver.prerelease.length > 0) {
  10853. var allowed = set[i].semver
  10854. if (allowed.major === version.major &&
  10855. allowed.minor === version.minor &&
  10856. allowed.patch === version.patch) {
  10857. return true
  10858. }
  10859. }
  10860. }
  10861. // Version has a -pre, but it's not one of the ones we like.
  10862. return false
  10863. }
  10864. return true
  10865. }
  10866. exports.satisfies = satisfies
  10867. function satisfies (version, range, options) {
  10868. try {
  10869. range = new Range(range, options)
  10870. } catch (er) {
  10871. return false
  10872. }
  10873. return range.test(version)
  10874. }
  10875. exports.maxSatisfying = maxSatisfying
  10876. function maxSatisfying (versions, range, options) {
  10877. var max = null
  10878. var maxSV = null
  10879. try {
  10880. var rangeObj = new Range(range, options)
  10881. } catch (er) {
  10882. return null
  10883. }
  10884. versions.forEach(function (v) {
  10885. if (rangeObj.test(v)) {
  10886. // satisfies(v, range, options)
  10887. if (!max || maxSV.compare(v) === -1) {
  10888. // compare(max, v, true)
  10889. max = v
  10890. maxSV = new SemVer(max, options)
  10891. }
  10892. }
  10893. })
  10894. return max
  10895. }
  10896. exports.minSatisfying = minSatisfying
  10897. function minSatisfying (versions, range, options) {
  10898. var min = null
  10899. var minSV = null
  10900. try {
  10901. var rangeObj = new Range(range, options)
  10902. } catch (er) {
  10903. return null
  10904. }
  10905. versions.forEach(function (v) {
  10906. if (rangeObj.test(v)) {
  10907. // satisfies(v, range, options)
  10908. if (!min || minSV.compare(v) === 1) {
  10909. // compare(min, v, true)
  10910. min = v
  10911. minSV = new SemVer(min, options)
  10912. }
  10913. }
  10914. })
  10915. return min
  10916. }
  10917. exports.minVersion = minVersion
  10918. function minVersion (range, loose) {
  10919. range = new Range(range, loose)
  10920. var minver = new SemVer('0.0.0')
  10921. if (range.test(minver)) {
  10922. return minver
  10923. }
  10924. minver = new SemVer('0.0.0-0')
  10925. if (range.test(minver)) {
  10926. return minver
  10927. }
  10928. minver = null
  10929. for (var i = 0; i < range.set.length; ++i) {
  10930. var comparators = range.set[i]
  10931. comparators.forEach(function (comparator) {
  10932. // Clone to avoid manipulating the comparator's semver object.
  10933. var compver = new SemVer(comparator.semver.version)
  10934. switch (comparator.operator) {
  10935. case '>':
  10936. if (compver.prerelease.length === 0) {
  10937. compver.patch++
  10938. } else {
  10939. compver.prerelease.push(0)
  10940. }
  10941. compver.raw = compver.format()
  10942. /* fallthrough */
  10943. case '':
  10944. case '>=':
  10945. if (!minver || gt(minver, compver)) {
  10946. minver = compver
  10947. }
  10948. break
  10949. case '<':
  10950. case '<=':
  10951. /* Ignore maximum versions */
  10952. break
  10953. /* istanbul ignore next */
  10954. default:
  10955. throw new Error('Unexpected operation: ' + comparator.operator)
  10956. }
  10957. })
  10958. }
  10959. if (minver && range.test(minver)) {
  10960. return minver
  10961. }
  10962. return null
  10963. }
  10964. exports.validRange = validRange
  10965. function validRange (range, options) {
  10966. try {
  10967. // Return '*' instead of '' so that truthiness works.
  10968. // This will throw if it's invalid anyway
  10969. return new Range(range, options).range || '*'
  10970. } catch (er) {
  10971. return null
  10972. }
  10973. }
  10974. // Determine if version is less than all the versions possible in the range
  10975. exports.ltr = ltr
  10976. function ltr (version, range, options) {
  10977. return outside(version, range, '<', options)
  10978. }
  10979. // Determine if version is greater than all the versions possible in the range.
  10980. exports.gtr = gtr
  10981. function gtr (version, range, options) {
  10982. return outside(version, range, '>', options)
  10983. }
  10984. exports.outside = outside
  10985. function outside (version, range, hilo, options) {
  10986. version = new SemVer(version, options)
  10987. range = new Range(range, options)
  10988. var gtfn, ltefn, ltfn, comp, ecomp
  10989. switch (hilo) {
  10990. case '>':
  10991. gtfn = gt
  10992. ltefn = lte
  10993. ltfn = lt
  10994. comp = '>'
  10995. ecomp = '>='
  10996. break
  10997. case '<':
  10998. gtfn = lt
  10999. ltefn = gte
  11000. ltfn = gt
  11001. comp = '<'
  11002. ecomp = '<='
  11003. break
  11004. default:
  11005. throw new TypeError('Must provide a hilo val of "<" or ">"')
  11006. }
  11007. // If it satisifes the range it is not outside
  11008. if (satisfies(version, range, options)) {
  11009. return false
  11010. }
  11011. // From now on, variable terms are as if we're in "gtr" mode.
  11012. // but note that everything is flipped for the "ltr" function.
  11013. for (var i = 0; i < range.set.length; ++i) {
  11014. var comparators = range.set[i]
  11015. var high = null
  11016. var low = null
  11017. comparators.forEach(function (comparator) {
  11018. if (comparator.semver === ANY) {
  11019. comparator = new Comparator('>=0.0.0')
  11020. }
  11021. high = high || comparator
  11022. low = low || comparator
  11023. if (gtfn(comparator.semver, high.semver, options)) {
  11024. high = comparator
  11025. } else if (ltfn(comparator.semver, low.semver, options)) {
  11026. low = comparator
  11027. }
  11028. })
  11029. // If the edge version comparator has a operator then our version
  11030. // isn't outside it
  11031. if (high.operator === comp || high.operator === ecomp) {
  11032. return false
  11033. }
  11034. // If the lowest version comparator has an operator and our version
  11035. // is less than it then it isn't higher than the range
  11036. if ((!low.operator || low.operator === comp) &&
  11037. ltefn(version, low.semver)) {
  11038. return false
  11039. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  11040. return false
  11041. }
  11042. }
  11043. return true
  11044. }
  11045. exports.prerelease = prerelease
  11046. function prerelease (version, options) {
  11047. var parsed = parse(version, options)
  11048. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  11049. }
  11050. exports.intersects = intersects
  11051. function intersects (r1, r2, options) {
  11052. r1 = new Range(r1, options)
  11053. r2 = new Range(r2, options)
  11054. return r1.intersects(r2)
  11055. }
  11056. exports.coerce = coerce
  11057. function coerce (version, options) {
  11058. if (version instanceof SemVer) {
  11059. return version
  11060. }
  11061. if (typeof version === 'number') {
  11062. version = String(version)
  11063. }
  11064. if (typeof version !== 'string') {
  11065. return null
  11066. }
  11067. options = options || {}
  11068. var match = null
  11069. if (!options.rtl) {
  11070. match = version.match(re[t.COERCE])
  11071. } else {
  11072. // Find the right-most coercible string that does not share
  11073. // a terminus with a more left-ward coercible string.
  11074. // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
  11075. //
  11076. // Walk through the string checking with a /g regexp
  11077. // Manually set the index so as to pick up overlapping matches.
  11078. // Stop when we get a match that ends at the string end, since no
  11079. // coercible string can be more right-ward without the same terminus.
  11080. var next
  11081. while ((next = re[t.COERCERTL].exec(version)) &&
  11082. (!match || match.index + match[0].length !== version.length)
  11083. ) {
  11084. if (!match ||
  11085. next.index + next[0].length !== match.index + match[0].length) {
  11086. match = next
  11087. }
  11088. re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length
  11089. }
  11090. // leave it in a clean state
  11091. re[t.COERCERTL].lastIndex = -1
  11092. }
  11093. if (match === null) {
  11094. return null
  11095. }
  11096. return parse(match[2] +
  11097. '.' + (match[3] || '0') +
  11098. '.' + (match[4] || '0'), options)
  11099. }
  11100. /***/ }),
  11101. /***/ 669:
  11102. /***/ (function(module) {
  11103. module.exports = require("util");
  11104. /***/ }),
  11105. /***/ 672:
  11106. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  11107. "use strict";
  11108. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  11109. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  11110. return new (P || (P = Promise))(function (resolve, reject) {
  11111. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  11112. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  11113. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  11114. step((generator = generator.apply(thisArg, _arguments || [])).next());
  11115. });
  11116. };
  11117. var _a;
  11118. Object.defineProperty(exports, "__esModule", { value: true });
  11119. const assert_1 = __webpack_require__(357);
  11120. const fs = __webpack_require__(747);
  11121. const path = __webpack_require__(622);
  11122. _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;
  11123. exports.IS_WINDOWS = process.platform === 'win32';
  11124. function exists(fsPath) {
  11125. return __awaiter(this, void 0, void 0, function* () {
  11126. try {
  11127. yield exports.stat(fsPath);
  11128. }
  11129. catch (err) {
  11130. if (err.code === 'ENOENT') {
  11131. return false;
  11132. }
  11133. throw err;
  11134. }
  11135. return true;
  11136. });
  11137. }
  11138. exports.exists = exists;
  11139. function isDirectory(fsPath, useStat = false) {
  11140. return __awaiter(this, void 0, void 0, function* () {
  11141. const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath);
  11142. return stats.isDirectory();
  11143. });
  11144. }
  11145. exports.isDirectory = isDirectory;
  11146. /**
  11147. * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:
  11148. * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases).
  11149. */
  11150. function isRooted(p) {
  11151. p = normalizeSeparators(p);
  11152. if (!p) {
  11153. throw new Error('isRooted() parameter "p" cannot be empty');
  11154. }
  11155. if (exports.IS_WINDOWS) {
  11156. return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello
  11157. ); // e.g. C: or C:\hello
  11158. }
  11159. return p.startsWith('/');
  11160. }
  11161. exports.isRooted = isRooted;
  11162. /**
  11163. * Recursively create a directory at `fsPath`.
  11164. *
  11165. * This implementation is optimistic, meaning it attempts to create the full
  11166. * path first, and backs up the path stack from there.
  11167. *
  11168. * @param fsPath The path to create
  11169. * @param maxDepth The maximum recursion depth
  11170. * @param depth The current recursion depth
  11171. */
  11172. function mkdirP(fsPath, maxDepth = 1000, depth = 1) {
  11173. return __awaiter(this, void 0, void 0, function* () {
  11174. assert_1.ok(fsPath, 'a path argument must be provided');
  11175. fsPath = path.resolve(fsPath);
  11176. if (depth >= maxDepth)
  11177. return exports.mkdir(fsPath);
  11178. try {
  11179. yield exports.mkdir(fsPath);
  11180. return;
  11181. }
  11182. catch (err) {
  11183. switch (err.code) {
  11184. case 'ENOENT': {
  11185. yield mkdirP(path.dirname(fsPath), maxDepth, depth + 1);
  11186. yield exports.mkdir(fsPath);
  11187. return;
  11188. }
  11189. default: {
  11190. let stats;
  11191. try {
  11192. stats = yield exports.stat(fsPath);
  11193. }
  11194. catch (err2) {
  11195. throw err;
  11196. }
  11197. if (!stats.isDirectory())
  11198. throw err;
  11199. }
  11200. }
  11201. }
  11202. });
  11203. }
  11204. exports.mkdirP = mkdirP;
  11205. /**
  11206. * Best effort attempt to determine whether a file exists and is executable.
  11207. * @param filePath file path to check
  11208. * @param extensions additional file extensions to try
  11209. * @return if file exists and is executable, returns the file path. otherwise empty string.
  11210. */
  11211. function tryGetExecutablePath(filePath, extensions) {
  11212. return __awaiter(this, void 0, void 0, function* () {
  11213. let stats = undefined;
  11214. try {
  11215. // test file exists
  11216. stats = yield exports.stat(filePath);
  11217. }
  11218. catch (err) {
  11219. if (err.code !== 'ENOENT') {
  11220. // eslint-disable-next-line no-console
  11221. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  11222. }
  11223. }
  11224. if (stats && stats.isFile()) {
  11225. if (exports.IS_WINDOWS) {
  11226. // on Windows, test for valid extension
  11227. const upperExt = path.extname(filePath).toUpperCase();
  11228. if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) {
  11229. return filePath;
  11230. }
  11231. }
  11232. else {
  11233. if (isUnixExecutable(stats)) {
  11234. return filePath;
  11235. }
  11236. }
  11237. }
  11238. // try each extension
  11239. const originalFilePath = filePath;
  11240. for (const extension of extensions) {
  11241. filePath = originalFilePath + extension;
  11242. stats = undefined;
  11243. try {
  11244. stats = yield exports.stat(filePath);
  11245. }
  11246. catch (err) {
  11247. if (err.code !== 'ENOENT') {
  11248. // eslint-disable-next-line no-console
  11249. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  11250. }
  11251. }
  11252. if (stats && stats.isFile()) {
  11253. if (exports.IS_WINDOWS) {
  11254. // preserve the case of the actual file (since an extension was appended)
  11255. try {
  11256. const directory = path.dirname(filePath);
  11257. const upperName = path.basename(filePath).toUpperCase();
  11258. for (const actualName of yield exports.readdir(directory)) {
  11259. if (upperName === actualName.toUpperCase()) {
  11260. filePath = path.join(directory, actualName);
  11261. break;
  11262. }
  11263. }
  11264. }
  11265. catch (err) {
  11266. // eslint-disable-next-line no-console
  11267. console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`);
  11268. }
  11269. return filePath;
  11270. }
  11271. else {
  11272. if (isUnixExecutable(stats)) {
  11273. return filePath;
  11274. }
  11275. }
  11276. }
  11277. }
  11278. return '';
  11279. });
  11280. }
  11281. exports.tryGetExecutablePath = tryGetExecutablePath;
  11282. function normalizeSeparators(p) {
  11283. p = p || '';
  11284. if (exports.IS_WINDOWS) {
  11285. // convert slashes on Windows
  11286. p = p.replace(/\//g, '\\');
  11287. // remove redundant slashes
  11288. return p.replace(/\\\\+/g, '\\');
  11289. }
  11290. // remove redundant slashes
  11291. return p.replace(/\/\/+/g, '/');
  11292. }
  11293. // on Mac/Linux, test the execute bit
  11294. // R W X R W X R W X
  11295. // 256 128 64 32 16 8 4 2 1
  11296. function isUnixExecutable(stats) {
  11297. return ((stats.mode & 1) > 0 ||
  11298. ((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||
  11299. ((stats.mode & 64) > 0 && stats.uid === process.getuid()));
  11300. }
  11301. //# sourceMappingURL=io-util.js.map
  11302. /***/ }),
  11303. /***/ 674:
  11304. /***/ (function(module, __unusedexports, __webpack_require__) {
  11305. module.exports = authenticate;
  11306. const { Deprecation } = __webpack_require__(692);
  11307. const once = __webpack_require__(969);
  11308. const deprecateAuthenticate = once((log, deprecation) => log.warn(deprecation));
  11309. function authenticate(state, options) {
  11310. deprecateAuthenticate(
  11311. state.octokit.log,
  11312. new Deprecation(
  11313. '[@octokit/rest] octokit.authenticate() is deprecated. Use "auth" constructor option instead.'
  11314. )
  11315. );
  11316. if (!options) {
  11317. state.auth = false;
  11318. return;
  11319. }
  11320. switch (options.type) {
  11321. case "basic":
  11322. if (!options.username || !options.password) {
  11323. throw new Error(
  11324. "Basic authentication requires both a username and password to be set"
  11325. );
  11326. }
  11327. break;
  11328. case "oauth":
  11329. if (!options.token && !(options.key && options.secret)) {
  11330. throw new Error(
  11331. "OAuth2 authentication requires a token or key & secret to be set"
  11332. );
  11333. }
  11334. break;
  11335. case "token":
  11336. case "app":
  11337. if (!options.token) {
  11338. throw new Error("Token authentication requires a token to be set");
  11339. }
  11340. break;
  11341. default:
  11342. throw new Error(
  11343. "Invalid authentication type, must be 'basic', 'oauth', 'token' or 'app'"
  11344. );
  11345. }
  11346. state.auth = options;
  11347. }
  11348. /***/ }),
  11349. /***/ 675:
  11350. /***/ (function(module) {
  11351. module.exports = function btoa(str) {
  11352. return new Buffer(str).toString('base64')
  11353. }
  11354. /***/ }),
  11355. /***/ 692:
  11356. /***/ (function(__unusedmodule, exports) {
  11357. "use strict";
  11358. Object.defineProperty(exports, '__esModule', { value: true });
  11359. class Deprecation extends Error {
  11360. constructor(message) {
  11361. super(message); // Maintains proper stack trace (only available on V8)
  11362. /* istanbul ignore next */
  11363. if (Error.captureStackTrace) {
  11364. Error.captureStackTrace(this, this.constructor);
  11365. }
  11366. this.name = 'Deprecation';
  11367. }
  11368. }
  11369. exports.Deprecation = Deprecation;
  11370. /***/ }),
  11371. /***/ 696:
  11372. /***/ (function(module) {
  11373. "use strict";
  11374. /*!
  11375. * isobject <https://github.com/jonschlinkert/isobject>
  11376. *
  11377. * Copyright (c) 2014-2017, Jon Schlinkert.
  11378. * Released under the MIT License.
  11379. */
  11380. function isObject(val) {
  11381. return val != null && typeof val === 'object' && Array.isArray(val) === false;
  11382. }
  11383. /*!
  11384. * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
  11385. *
  11386. * Copyright (c) 2014-2017, Jon Schlinkert.
  11387. * Released under the MIT License.
  11388. */
  11389. function isObjectObject(o) {
  11390. return isObject(o) === true
  11391. && Object.prototype.toString.call(o) === '[object Object]';
  11392. }
  11393. function isPlainObject(o) {
  11394. var ctor,prot;
  11395. if (isObjectObject(o) === false) return false;
  11396. // If has modified constructor
  11397. ctor = o.constructor;
  11398. if (typeof ctor !== 'function') return false;
  11399. // If has modified prototype
  11400. prot = ctor.prototype;
  11401. if (isObjectObject(prot) === false) return false;
  11402. // If constructor does not have an Object-specific method
  11403. if (prot.hasOwnProperty('isPrototypeOf') === false) {
  11404. return false;
  11405. }
  11406. // Most likely a plain Object
  11407. return true;
  11408. }
  11409. module.exports = isPlainObject;
  11410. /***/ }),
  11411. /***/ 697:
  11412. /***/ (function(module) {
  11413. "use strict";
  11414. module.exports = (promise, onFinally) => {
  11415. onFinally = onFinally || (() => {});
  11416. return promise.then(
  11417. val => new Promise(resolve => {
  11418. resolve(onFinally());
  11419. }).then(() => val),
  11420. err => new Promise(resolve => {
  11421. resolve(onFinally());
  11422. }).then(() => {
  11423. throw err;
  11424. })
  11425. );
  11426. };
  11427. /***/ }),
  11428. /***/ 705:
  11429. /***/ (function(module) {
  11430. 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"}}};
  11431. /***/ }),
  11432. /***/ 717:
  11433. /***/ (function(module, __unusedexports, __webpack_require__) {
  11434. /**
  11435. * Module dependencies.
  11436. */
  11437. var net = __webpack_require__(631);
  11438. var tls = __webpack_require__(16);
  11439. var url = __webpack_require__(835);
  11440. var assert = __webpack_require__(357);
  11441. var Agent = __webpack_require__(443);
  11442. var inherits = __webpack_require__(669).inherits;
  11443. var debug = __webpack_require__(784)('https-proxy-agent');
  11444. /**
  11445. * Module exports.
  11446. */
  11447. module.exports = HttpsProxyAgent;
  11448. /**
  11449. * The `HttpsProxyAgent` implements an HTTP Agent subclass that connects to the
  11450. * specified "HTTP(s) proxy server" in order to proxy HTTPS requests.
  11451. *
  11452. * @api public
  11453. */
  11454. function HttpsProxyAgent(opts) {
  11455. if (!(this instanceof HttpsProxyAgent)) return new HttpsProxyAgent(opts);
  11456. if ('string' == typeof opts) opts = url.parse(opts);
  11457. if (!opts)
  11458. throw new Error(
  11459. 'an HTTP(S) proxy server `host` and `port` must be specified!'
  11460. );
  11461. debug('creating new HttpsProxyAgent instance: %o', opts);
  11462. Agent.call(this, opts);
  11463. var proxy = Object.assign({}, opts);
  11464. // if `true`, then connect to the proxy server over TLS. defaults to `false`.
  11465. this.secureProxy = proxy.protocol
  11466. ? /^https:?$/i.test(proxy.protocol)
  11467. : false;
  11468. // prefer `hostname` over `host`, and set the `port` if needed
  11469. proxy.host = proxy.hostname || proxy.host;
  11470. proxy.port = +proxy.port || (this.secureProxy ? 443 : 80);
  11471. // ALPN is supported by Node.js >= v5.
  11472. // attempt to negotiate http/1.1 for proxy servers that support http/2
  11473. if (this.secureProxy && !('ALPNProtocols' in proxy)) {
  11474. proxy.ALPNProtocols = ['http 1.1'];
  11475. }
  11476. if (proxy.host && proxy.path) {
  11477. // if both a `host` and `path` are specified then it's most likely the
  11478. // result of a `url.parse()` call... we need to remove the `path` portion so
  11479. // that `net.connect()` doesn't attempt to open that as a unix socket file.
  11480. delete proxy.path;
  11481. delete proxy.pathname;
  11482. }
  11483. this.proxy = proxy;
  11484. }
  11485. inherits(HttpsProxyAgent, Agent);
  11486. /**
  11487. * Called when the node-core HTTP client library is creating a new HTTP request.
  11488. *
  11489. * @api public
  11490. */
  11491. HttpsProxyAgent.prototype.callback = function connect(req, opts, fn) {
  11492. var proxy = this.proxy;
  11493. // create a socket connection to the proxy server
  11494. var socket;
  11495. if (this.secureProxy) {
  11496. socket = tls.connect(proxy);
  11497. } else {
  11498. socket = net.connect(proxy);
  11499. }
  11500. // we need to buffer any HTTP traffic that happens with the proxy before we get
  11501. // the CONNECT response, so that if the response is anything other than an "200"
  11502. // response code, then we can re-play the "data" events on the socket once the
  11503. // HTTP parser is hooked up...
  11504. var buffers = [];
  11505. var buffersLength = 0;
  11506. function read() {
  11507. var b = socket.read();
  11508. if (b) ondata(b);
  11509. else socket.once('readable', read);
  11510. }
  11511. function cleanup() {
  11512. socket.removeListener('end', onend);
  11513. socket.removeListener('error', onerror);
  11514. socket.removeListener('close', onclose);
  11515. socket.removeListener('readable', read);
  11516. }
  11517. function onclose(err) {
  11518. debug('onclose had error %o', err);
  11519. }
  11520. function onend() {
  11521. debug('onend');
  11522. }
  11523. function onerror(err) {
  11524. cleanup();
  11525. fn(err);
  11526. }
  11527. function ondata(b) {
  11528. buffers.push(b);
  11529. buffersLength += b.length;
  11530. var buffered = Buffer.concat(buffers, buffersLength);
  11531. var str = buffered.toString('ascii');
  11532. if (!~str.indexOf('\r\n\r\n')) {
  11533. // keep buffering
  11534. debug('have not received end of HTTP headers yet...');
  11535. read();
  11536. return;
  11537. }
  11538. var firstLine = str.substring(0, str.indexOf('\r\n'));
  11539. var statusCode = +firstLine.split(' ')[1];
  11540. debug('got proxy server response: %o', firstLine);
  11541. if (200 == statusCode) {
  11542. // 200 Connected status code!
  11543. var sock = socket;
  11544. // nullify the buffered data since we won't be needing it
  11545. buffers = buffered = null;
  11546. if (opts.secureEndpoint) {
  11547. // since the proxy is connecting to an SSL server, we have
  11548. // to upgrade this socket connection to an SSL connection
  11549. debug(
  11550. 'upgrading proxy-connected socket to TLS connection: %o',
  11551. opts.host
  11552. );
  11553. opts.socket = socket;
  11554. opts.servername = opts.servername || opts.host;
  11555. opts.host = null;
  11556. opts.hostname = null;
  11557. opts.port = null;
  11558. sock = tls.connect(opts);
  11559. }
  11560. cleanup();
  11561. req.once('socket', resume);
  11562. fn(null, sock);
  11563. } else {
  11564. // some other status code that's not 200... need to re-play the HTTP header
  11565. // "data" events onto the socket once the HTTP machinery is attached so
  11566. // that the node core `http` can parse and handle the error status code
  11567. cleanup();
  11568. // the original socket is closed, and a new closed socket is
  11569. // returned instead, so that the proxy doesn't get the HTTP request
  11570. // written to it (which may contain `Authorization` headers or other
  11571. // sensitive data).
  11572. //
  11573. // See: https://hackerone.com/reports/541502
  11574. socket.destroy();
  11575. socket = new net.Socket();
  11576. socket.readable = true;
  11577. // save a reference to the concat'd Buffer for the `onsocket` callback
  11578. buffers = buffered;
  11579. // need to wait for the "socket" event to re-play the "data" events
  11580. req.once('socket', onsocket);
  11581. fn(null, socket);
  11582. }
  11583. }
  11584. function onsocket(socket) {
  11585. debug('replaying proxy buffer for failed request');
  11586. assert(socket.listenerCount('data') > 0);
  11587. // replay the "buffers" Buffer onto the `socket`, since at this point
  11588. // the HTTP module machinery has been hooked up for the user
  11589. socket.push(buffers);
  11590. // nullify the cached Buffer instance
  11591. buffers = null;
  11592. }
  11593. socket.on('error', onerror);
  11594. socket.on('close', onclose);
  11595. socket.on('end', onend);
  11596. read();
  11597. var hostname = opts.host + ':' + opts.port;
  11598. var msg = 'CONNECT ' + hostname + ' HTTP/1.1\r\n';
  11599. var headers = Object.assign({}, proxy.headers);
  11600. if (proxy.auth) {
  11601. headers['Proxy-Authorization'] =
  11602. 'Basic ' + Buffer.from(proxy.auth).toString('base64');
  11603. }
  11604. // the Host header should only include the port
  11605. // number when it is a non-standard port
  11606. var host = opts.host;
  11607. if (!isDefaultPort(opts.port, opts.secureEndpoint)) {
  11608. host += ':' + opts.port;
  11609. }
  11610. headers['Host'] = host;
  11611. headers['Connection'] = 'close';
  11612. Object.keys(headers).forEach(function(name) {
  11613. msg += name + ': ' + headers[name] + '\r\n';
  11614. });
  11615. socket.write(msg + '\r\n');
  11616. };
  11617. /**
  11618. * Resumes a socket.
  11619. *
  11620. * @param {(net.Socket|tls.Socket)} socket The socket to resume
  11621. * @api public
  11622. */
  11623. function resume(socket) {
  11624. socket.resume();
  11625. }
  11626. function isDefaultPort(port, secure) {
  11627. return Boolean((!secure && port === 80) || (secure && port === 443));
  11628. }
  11629. /***/ }),
  11630. /***/ 722:
  11631. /***/ (function(module) {
  11632. /**
  11633. * Convert array of 16 byte values to UUID string format of the form:
  11634. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  11635. */
  11636. var byteToHex = [];
  11637. for (var i = 0; i < 256; ++i) {
  11638. byteToHex[i] = (i + 0x100).toString(16).substr(1);
  11639. }
  11640. function bytesToUuid(buf, offset) {
  11641. var i = offset || 0;
  11642. var bth = byteToHex;
  11643. // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
  11644. return ([bth[buf[i++]], bth[buf[i++]],
  11645. bth[buf[i++]], bth[buf[i++]], '-',
  11646. bth[buf[i++]], bth[buf[i++]], '-',
  11647. bth[buf[i++]], bth[buf[i++]], '-',
  11648. bth[buf[i++]], bth[buf[i++]], '-',
  11649. bth[buf[i++]], bth[buf[i++]],
  11650. bth[buf[i++]], bth[buf[i++]],
  11651. bth[buf[i++]], bth[buf[i++]]]).join('');
  11652. }
  11653. module.exports = bytesToUuid;
  11654. /***/ }),
  11655. /***/ 742:
  11656. /***/ (function(module, __unusedexports, __webpack_require__) {
  11657. var fs = __webpack_require__(747)
  11658. var core
  11659. if (process.platform === 'win32' || global.TESTING_WINDOWS) {
  11660. core = __webpack_require__(818)
  11661. } else {
  11662. core = __webpack_require__(197)
  11663. }
  11664. module.exports = isexe
  11665. isexe.sync = sync
  11666. function isexe (path, options, cb) {
  11667. if (typeof options === 'function') {
  11668. cb = options
  11669. options = {}
  11670. }
  11671. if (!cb) {
  11672. if (typeof Promise !== 'function') {
  11673. throw new TypeError('callback not provided')
  11674. }
  11675. return new Promise(function (resolve, reject) {
  11676. isexe(path, options || {}, function (er, is) {
  11677. if (er) {
  11678. reject(er)
  11679. } else {
  11680. resolve(is)
  11681. }
  11682. })
  11683. })
  11684. }
  11685. core(path, options || {}, function (er, is) {
  11686. // ignore EACCES because that just means we aren't allowed to run it
  11687. if (er) {
  11688. if (er.code === 'EACCES' || options && options.ignoreErrors) {
  11689. er = null
  11690. is = false
  11691. }
  11692. }
  11693. cb(er, is)
  11694. })
  11695. }
  11696. function sync (path, options) {
  11697. // my kingdom for a filtered catch
  11698. try {
  11699. return core.sync(path, options || {})
  11700. } catch (er) {
  11701. if (options && options.ignoreErrors || er.code === 'EACCES') {
  11702. return false
  11703. } else {
  11704. throw er
  11705. }
  11706. }
  11707. }
  11708. /***/ }),
  11709. /***/ 747:
  11710. /***/ (function(module) {
  11711. module.exports = require("fs");
  11712. /***/ }),
  11713. /***/ 753:
  11714. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  11715. "use strict";
  11716. Object.defineProperty(exports, '__esModule', { value: true });
  11717. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  11718. var endpoint = __webpack_require__(385);
  11719. var universalUserAgent = __webpack_require__(796);
  11720. var isPlainObject = _interopDefault(__webpack_require__(696));
  11721. var nodeFetch = _interopDefault(__webpack_require__(454));
  11722. var requestError = __webpack_require__(463);
  11723. const VERSION = "5.3.1";
  11724. function getBufferResponse(response) {
  11725. return response.arrayBuffer();
  11726. }
  11727. function fetchWrapper(requestOptions) {
  11728. if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {
  11729. requestOptions.body = JSON.stringify(requestOptions.body);
  11730. }
  11731. let headers = {};
  11732. let status;
  11733. let url;
  11734. const fetch = requestOptions.request && requestOptions.request.fetch || nodeFetch;
  11735. return fetch(requestOptions.url, Object.assign({
  11736. method: requestOptions.method,
  11737. body: requestOptions.body,
  11738. headers: requestOptions.headers,
  11739. redirect: requestOptions.redirect
  11740. }, requestOptions.request)).then(response => {
  11741. url = response.url;
  11742. status = response.status;
  11743. for (const keyAndValue of response.headers) {
  11744. headers[keyAndValue[0]] = keyAndValue[1];
  11745. }
  11746. if (status === 204 || status === 205) {
  11747. return;
  11748. } // GitHub API returns 200 for HEAD requsets
  11749. if (requestOptions.method === "HEAD") {
  11750. if (status < 400) {
  11751. return;
  11752. }
  11753. throw new requestError.RequestError(response.statusText, status, {
  11754. headers,
  11755. request: requestOptions
  11756. });
  11757. }
  11758. if (status === 304) {
  11759. throw new requestError.RequestError("Not modified", status, {
  11760. headers,
  11761. request: requestOptions
  11762. });
  11763. }
  11764. if (status >= 400) {
  11765. return response.text().then(message => {
  11766. const error = new requestError.RequestError(message, status, {
  11767. headers,
  11768. request: requestOptions
  11769. });
  11770. try {
  11771. let responseBody = JSON.parse(error.message);
  11772. Object.assign(error, responseBody);
  11773. let errors = responseBody.errors; // Assumption `errors` would always be in Array Fotmat
  11774. error.message = error.message + ": " + errors.map(JSON.stringify).join(", ");
  11775. } catch (e) {// ignore, see octokit/rest.js#684
  11776. }
  11777. throw error;
  11778. });
  11779. }
  11780. const contentType = response.headers.get("content-type");
  11781. if (/application\/json/.test(contentType)) {
  11782. return response.json();
  11783. }
  11784. if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) {
  11785. return response.text();
  11786. }
  11787. return getBufferResponse(response);
  11788. }).then(data => {
  11789. return {
  11790. status,
  11791. url,
  11792. headers,
  11793. data
  11794. };
  11795. }).catch(error => {
  11796. if (error instanceof requestError.RequestError) {
  11797. throw error;
  11798. }
  11799. throw new requestError.RequestError(error.message, 500, {
  11800. headers,
  11801. request: requestOptions
  11802. });
  11803. });
  11804. }
  11805. function withDefaults(oldEndpoint, newDefaults) {
  11806. const endpoint = oldEndpoint.defaults(newDefaults);
  11807. const newApi = function (route, parameters) {
  11808. const endpointOptions = endpoint.merge(route, parameters);
  11809. if (!endpointOptions.request || !endpointOptions.request.hook) {
  11810. return fetchWrapper(endpoint.parse(endpointOptions));
  11811. }
  11812. const request = (route, parameters) => {
  11813. return fetchWrapper(endpoint.parse(endpoint.merge(route, parameters)));
  11814. };
  11815. Object.assign(request, {
  11816. endpoint,
  11817. defaults: withDefaults.bind(null, endpoint)
  11818. });
  11819. return endpointOptions.request.hook(request, endpointOptions);
  11820. };
  11821. return Object.assign(newApi, {
  11822. endpoint,
  11823. defaults: withDefaults.bind(null, endpoint)
  11824. });
  11825. }
  11826. const request = withDefaults(endpoint.endpoint, {
  11827. headers: {
  11828. "user-agent": `octokit-request.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  11829. }
  11830. });
  11831. exports.request = request;
  11832. //# sourceMappingURL=index.js.map
  11833. /***/ }),
  11834. /***/ 761:
  11835. /***/ (function(module) {
  11836. module.exports = require("zlib");
  11837. /***/ }),
  11838. /***/ 763:
  11839. /***/ (function(module) {
  11840. module.exports = removeHook
  11841. function removeHook (state, name, method) {
  11842. if (!state.registry[name]) {
  11843. return
  11844. }
  11845. var index = state.registry[name]
  11846. .map(function (registered) { return registered.orig })
  11847. .indexOf(method)
  11848. if (index === -1) {
  11849. return
  11850. }
  11851. state.registry[name].splice(index, 1)
  11852. }
  11853. /***/ }),
  11854. /***/ 768:
  11855. /***/ (function(module) {
  11856. "use strict";
  11857. module.exports = function (x) {
  11858. var lf = typeof x === 'string' ? '\n' : '\n'.charCodeAt();
  11859. var cr = typeof x === 'string' ? '\r' : '\r'.charCodeAt();
  11860. if (x[x.length - 1] === lf) {
  11861. x = x.slice(0, x.length - 1);
  11862. }
  11863. if (x[x.length - 1] === cr) {
  11864. x = x.slice(0, x.length - 1);
  11865. }
  11866. return x;
  11867. };
  11868. /***/ }),
  11869. /***/ 777:
  11870. /***/ (function(module, __unusedexports, __webpack_require__) {
  11871. module.exports = getFirstPage
  11872. const getPage = __webpack_require__(265)
  11873. function getFirstPage (octokit, link, headers) {
  11874. return getPage(octokit, link, 'first', headers)
  11875. }
  11876. /***/ }),
  11877. /***/ 784:
  11878. /***/ (function(module, __unusedexports, __webpack_require__) {
  11879. /**
  11880. * Detect Electron renderer / nwjs process, which is node, but we should
  11881. * treat as a browser.
  11882. */
  11883. if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {
  11884. module.exports = __webpack_require__(794);
  11885. } else {
  11886. module.exports = __webpack_require__(81);
  11887. }
  11888. /***/ }),
  11889. /***/ 794:
  11890. /***/ (function(module, exports, __webpack_require__) {
  11891. /* eslint-env browser */
  11892. /**
  11893. * This is the web browser implementation of `debug()`.
  11894. */
  11895. exports.log = log;
  11896. exports.formatArgs = formatArgs;
  11897. exports.save = save;
  11898. exports.load = load;
  11899. exports.useColors = useColors;
  11900. exports.storage = localstorage();
  11901. /**
  11902. * Colors.
  11903. */
  11904. exports.colors = [
  11905. '#0000CC',
  11906. '#0000FF',
  11907. '#0033CC',
  11908. '#0033FF',
  11909. '#0066CC',
  11910. '#0066FF',
  11911. '#0099CC',
  11912. '#0099FF',
  11913. '#00CC00',
  11914. '#00CC33',
  11915. '#00CC66',
  11916. '#00CC99',
  11917. '#00CCCC',
  11918. '#00CCFF',
  11919. '#3300CC',
  11920. '#3300FF',
  11921. '#3333CC',
  11922. '#3333FF',
  11923. '#3366CC',
  11924. '#3366FF',
  11925. '#3399CC',
  11926. '#3399FF',
  11927. '#33CC00',
  11928. '#33CC33',
  11929. '#33CC66',
  11930. '#33CC99',
  11931. '#33CCCC',
  11932. '#33CCFF',
  11933. '#6600CC',
  11934. '#6600FF',
  11935. '#6633CC',
  11936. '#6633FF',
  11937. '#66CC00',
  11938. '#66CC33',
  11939. '#9900CC',
  11940. '#9900FF',
  11941. '#9933CC',
  11942. '#9933FF',
  11943. '#99CC00',
  11944. '#99CC33',
  11945. '#CC0000',
  11946. '#CC0033',
  11947. '#CC0066',
  11948. '#CC0099',
  11949. '#CC00CC',
  11950. '#CC00FF',
  11951. '#CC3300',
  11952. '#CC3333',
  11953. '#CC3366',
  11954. '#CC3399',
  11955. '#CC33CC',
  11956. '#CC33FF',
  11957. '#CC6600',
  11958. '#CC6633',
  11959. '#CC9900',
  11960. '#CC9933',
  11961. '#CCCC00',
  11962. '#CCCC33',
  11963. '#FF0000',
  11964. '#FF0033',
  11965. '#FF0066',
  11966. '#FF0099',
  11967. '#FF00CC',
  11968. '#FF00FF',
  11969. '#FF3300',
  11970. '#FF3333',
  11971. '#FF3366',
  11972. '#FF3399',
  11973. '#FF33CC',
  11974. '#FF33FF',
  11975. '#FF6600',
  11976. '#FF6633',
  11977. '#FF9900',
  11978. '#FF9933',
  11979. '#FFCC00',
  11980. '#FFCC33'
  11981. ];
  11982. /**
  11983. * Currently only WebKit-based Web Inspectors, Firefox >= v31,
  11984. * and the Firebug extension (any Firefox version) are known
  11985. * to support "%c" CSS customizations.
  11986. *
  11987. * TODO: add a `localStorage` variable to explicitly enable/disable colors
  11988. */
  11989. // eslint-disable-next-line complexity
  11990. function useColors() {
  11991. // NB: In an Electron preload script, document will be defined but not fully
  11992. // initialized. Since we know we're in Chrome, we'll just detect this case
  11993. // explicitly
  11994. if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
  11995. return true;
  11996. }
  11997. // Internet Explorer and Edge do not support colors.
  11998. if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
  11999. return false;
  12000. }
  12001. // Is webkit? http://stackoverflow.com/a/16459606/376773
  12002. // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
  12003. return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
  12004. // Is firebug? http://stackoverflow.com/a/398120/376773
  12005. (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
  12006. // Is firefox >= v31?
  12007. // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
  12008. (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
  12009. // Double check webkit in userAgent just in case we are in a worker
  12010. (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
  12011. }
  12012. /**
  12013. * Colorize log arguments if enabled.
  12014. *
  12015. * @api public
  12016. */
  12017. function formatArgs(args) {
  12018. args[0] = (this.useColors ? '%c' : '') +
  12019. this.namespace +
  12020. (this.useColors ? ' %c' : ' ') +
  12021. args[0] +
  12022. (this.useColors ? '%c ' : ' ') +
  12023. '+' + module.exports.humanize(this.diff);
  12024. if (!this.useColors) {
  12025. return;
  12026. }
  12027. const c = 'color: ' + this.color;
  12028. args.splice(1, 0, c, 'color: inherit');
  12029. // The final "%c" is somewhat tricky, because there could be other
  12030. // arguments passed either before or after the %c, so we need to
  12031. // figure out the correct index to insert the CSS into
  12032. let index = 0;
  12033. let lastC = 0;
  12034. args[0].replace(/%[a-zA-Z%]/g, match => {
  12035. if (match === '%%') {
  12036. return;
  12037. }
  12038. index++;
  12039. if (match === '%c') {
  12040. // We only are interested in the *last* %c
  12041. // (the user may have provided their own)
  12042. lastC = index;
  12043. }
  12044. });
  12045. args.splice(lastC, 0, c);
  12046. }
  12047. /**
  12048. * Invokes `console.log()` when available.
  12049. * No-op when `console.log` is not a "function".
  12050. *
  12051. * @api public
  12052. */
  12053. function log(...args) {
  12054. // This hackery is required for IE8/9, where
  12055. // the `console.log` function doesn't have 'apply'
  12056. return typeof console === 'object' &&
  12057. console.log &&
  12058. console.log(...args);
  12059. }
  12060. /**
  12061. * Save `namespaces`.
  12062. *
  12063. * @param {String} namespaces
  12064. * @api private
  12065. */
  12066. function save(namespaces) {
  12067. try {
  12068. if (namespaces) {
  12069. exports.storage.setItem('debug', namespaces);
  12070. } else {
  12071. exports.storage.removeItem('debug');
  12072. }
  12073. } catch (error) {
  12074. // Swallow
  12075. // XXX (@Qix-) should we be logging these?
  12076. }
  12077. }
  12078. /**
  12079. * Load `namespaces`.
  12080. *
  12081. * @return {String} returns the previously persisted debug modes
  12082. * @api private
  12083. */
  12084. function load() {
  12085. let r;
  12086. try {
  12087. r = exports.storage.getItem('debug');
  12088. } catch (error) {
  12089. // Swallow
  12090. // XXX (@Qix-) should we be logging these?
  12091. }
  12092. // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
  12093. if (!r && typeof process !== 'undefined' && 'env' in process) {
  12094. r = process.env.DEBUG;
  12095. }
  12096. return r;
  12097. }
  12098. /**
  12099. * Localstorage attempts to return the localstorage.
  12100. *
  12101. * This is necessary because safari throws
  12102. * when a user disables cookies/localstorage
  12103. * and you attempt to access it.
  12104. *
  12105. * @return {LocalStorage}
  12106. * @api private
  12107. */
  12108. function localstorage() {
  12109. try {
  12110. // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
  12111. // The Browser also has localStorage in the global context.
  12112. return localStorage;
  12113. } catch (error) {
  12114. // Swallow
  12115. // XXX (@Qix-) should we be logging these?
  12116. }
  12117. }
  12118. module.exports = __webpack_require__(486)(exports);
  12119. const {formatters} = module.exports;
  12120. /**
  12121. * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
  12122. */
  12123. formatters.j = function (v) {
  12124. try {
  12125. return JSON.stringify(v);
  12126. } catch (error) {
  12127. return '[UnexpectedJSONParseError]: ' + error.message;
  12128. }
  12129. };
  12130. /***/ }),
  12131. /***/ 796:
  12132. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  12133. "use strict";
  12134. Object.defineProperty(exports, '__esModule', { value: true });
  12135. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  12136. var osName = _interopDefault(__webpack_require__(2));
  12137. function getUserAgent() {
  12138. try {
  12139. return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
  12140. } catch (error) {
  12141. if (/wmic os get Caption/.test(error.message)) {
  12142. return "Windows <version undetectable>";
  12143. }
  12144. throw error;
  12145. }
  12146. }
  12147. exports.getUserAgent = getUserAgent;
  12148. //# sourceMappingURL=index.js.map
  12149. /***/ }),
  12150. /***/ 807:
  12151. /***/ (function(module, __unusedexports, __webpack_require__) {
  12152. module.exports = paginate;
  12153. const iterator = __webpack_require__(8);
  12154. function paginate(octokit, route, options, mapFn) {
  12155. if (typeof options === "function") {
  12156. mapFn = options;
  12157. options = undefined;
  12158. }
  12159. options = octokit.request.endpoint.merge(route, options);
  12160. return gather(
  12161. octokit,
  12162. [],
  12163. iterator(octokit, options)[Symbol.asyncIterator](),
  12164. mapFn
  12165. );
  12166. }
  12167. function gather(octokit, results, iterator, mapFn) {
  12168. return iterator.next().then(result => {
  12169. if (result.done) {
  12170. return results;
  12171. }
  12172. let earlyExit = false;
  12173. function done() {
  12174. earlyExit = true;
  12175. }
  12176. results = results.concat(
  12177. mapFn ? mapFn(result.value, done) : result.value.data
  12178. );
  12179. if (earlyExit) {
  12180. return results;
  12181. }
  12182. return gather(octokit, results, iterator, mapFn);
  12183. });
  12184. }
  12185. /***/ }),
  12186. /***/ 814:
  12187. /***/ (function(module, __unusedexports, __webpack_require__) {
  12188. module.exports = which
  12189. which.sync = whichSync
  12190. var isWindows = process.platform === 'win32' ||
  12191. process.env.OSTYPE === 'cygwin' ||
  12192. process.env.OSTYPE === 'msys'
  12193. var path = __webpack_require__(622)
  12194. var COLON = isWindows ? ';' : ':'
  12195. var isexe = __webpack_require__(742)
  12196. function getNotFoundError (cmd) {
  12197. var er = new Error('not found: ' + cmd)
  12198. er.code = 'ENOENT'
  12199. return er
  12200. }
  12201. function getPathInfo (cmd, opt) {
  12202. var colon = opt.colon || COLON
  12203. var pathEnv = opt.path || process.env.PATH || ''
  12204. var pathExt = ['']
  12205. pathEnv = pathEnv.split(colon)
  12206. var pathExtExe = ''
  12207. if (isWindows) {
  12208. pathEnv.unshift(process.cwd())
  12209. pathExtExe = (opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM')
  12210. pathExt = pathExtExe.split(colon)
  12211. // Always test the cmd itself first. isexe will check to make sure
  12212. // it's found in the pathExt set.
  12213. if (cmd.indexOf('.') !== -1 && pathExt[0] !== '')
  12214. pathExt.unshift('')
  12215. }
  12216. // If it has a slash, then we don't bother searching the pathenv.
  12217. // just check the file itself, and that's it.
  12218. if (cmd.match(/\//) || isWindows && cmd.match(/\\/))
  12219. pathEnv = ['']
  12220. return {
  12221. env: pathEnv,
  12222. ext: pathExt,
  12223. extExe: pathExtExe
  12224. }
  12225. }
  12226. function which (cmd, opt, cb) {
  12227. if (typeof opt === 'function') {
  12228. cb = opt
  12229. opt = {}
  12230. }
  12231. var info = getPathInfo(cmd, opt)
  12232. var pathEnv = info.env
  12233. var pathExt = info.ext
  12234. var pathExtExe = info.extExe
  12235. var found = []
  12236. ;(function F (i, l) {
  12237. if (i === l) {
  12238. if (opt.all && found.length)
  12239. return cb(null, found)
  12240. else
  12241. return cb(getNotFoundError(cmd))
  12242. }
  12243. var pathPart = pathEnv[i]
  12244. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  12245. pathPart = pathPart.slice(1, -1)
  12246. var p = path.join(pathPart, cmd)
  12247. if (!pathPart && (/^\.[\\\/]/).test(cmd)) {
  12248. p = cmd.slice(0, 2) + p
  12249. }
  12250. ;(function E (ii, ll) {
  12251. if (ii === ll) return F(i + 1, l)
  12252. var ext = pathExt[ii]
  12253. isexe(p + ext, { pathExt: pathExtExe }, function (er, is) {
  12254. if (!er && is) {
  12255. if (opt.all)
  12256. found.push(p + ext)
  12257. else
  12258. return cb(null, p + ext)
  12259. }
  12260. return E(ii + 1, ll)
  12261. })
  12262. })(0, pathExt.length)
  12263. })(0, pathEnv.length)
  12264. }
  12265. function whichSync (cmd, opt) {
  12266. opt = opt || {}
  12267. var info = getPathInfo(cmd, opt)
  12268. var pathEnv = info.env
  12269. var pathExt = info.ext
  12270. var pathExtExe = info.extExe
  12271. var found = []
  12272. for (var i = 0, l = pathEnv.length; i < l; i ++) {
  12273. var pathPart = pathEnv[i]
  12274. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  12275. pathPart = pathPart.slice(1, -1)
  12276. var p = path.join(pathPart, cmd)
  12277. if (!pathPart && /^\.[\\\/]/.test(cmd)) {
  12278. p = cmd.slice(0, 2) + p
  12279. }
  12280. for (var j = 0, ll = pathExt.length; j < ll; j ++) {
  12281. var cur = p + pathExt[j]
  12282. var is
  12283. try {
  12284. is = isexe.sync(cur, { pathExt: pathExtExe })
  12285. if (is) {
  12286. if (opt.all)
  12287. found.push(cur)
  12288. else
  12289. return cur
  12290. }
  12291. } catch (ex) {}
  12292. }
  12293. }
  12294. if (opt.all && found.length)
  12295. return found
  12296. if (opt.nothrow)
  12297. return null
  12298. throw getNotFoundError(cmd)
  12299. }
  12300. /***/ }),
  12301. /***/ 816:
  12302. /***/ (function(module) {
  12303. "use strict";
  12304. module.exports = /^#!.*/;
  12305. /***/ }),
  12306. /***/ 818:
  12307. /***/ (function(module, __unusedexports, __webpack_require__) {
  12308. module.exports = isexe
  12309. isexe.sync = sync
  12310. var fs = __webpack_require__(747)
  12311. function checkPathExt (path, options) {
  12312. var pathext = options.pathExt !== undefined ?
  12313. options.pathExt : process.env.PATHEXT
  12314. if (!pathext) {
  12315. return true
  12316. }
  12317. pathext = pathext.split(';')
  12318. if (pathext.indexOf('') !== -1) {
  12319. return true
  12320. }
  12321. for (var i = 0; i < pathext.length; i++) {
  12322. var p = pathext[i].toLowerCase()
  12323. if (p && path.substr(-p.length).toLowerCase() === p) {
  12324. return true
  12325. }
  12326. }
  12327. return false
  12328. }
  12329. function checkStat (stat, path, options) {
  12330. if (!stat.isSymbolicLink() && !stat.isFile()) {
  12331. return false
  12332. }
  12333. return checkPathExt(path, options)
  12334. }
  12335. function isexe (path, options, cb) {
  12336. fs.stat(path, function (er, stat) {
  12337. cb(er, er ? false : checkStat(stat, path, options))
  12338. })
  12339. }
  12340. function sync (path, options) {
  12341. return checkStat(fs.statSync(path), path, options)
  12342. }
  12343. /***/ }),
  12344. /***/ 821:
  12345. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  12346. "use strict";
  12347. var __importStar = (this && this.__importStar) || function (mod) {
  12348. if (mod && mod.__esModule) return mod;
  12349. var result = {};
  12350. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  12351. result["default"] = mod;
  12352. return result;
  12353. };
  12354. Object.defineProperty(exports, "__esModule", { value: true });
  12355. const core = __importStar(__webpack_require__(470));
  12356. const fsHelper = __importStar(__webpack_require__(618));
  12357. const github = __importStar(__webpack_require__(469));
  12358. const path = __importStar(__webpack_require__(622));
  12359. function getInputs() {
  12360. const result = {};
  12361. // GitHub workspace
  12362. let githubWorkspacePath = process.env['GITHUB_WORKSPACE'];
  12363. if (!githubWorkspacePath) {
  12364. throw new Error('GITHUB_WORKSPACE not defined');
  12365. }
  12366. githubWorkspacePath = path.resolve(githubWorkspacePath);
  12367. core.debug(`GITHUB_WORKSPACE = '${githubWorkspacePath}'`);
  12368. fsHelper.directoryExistsSync(githubWorkspacePath, true);
  12369. // Qualified repository
  12370. const qualifiedRepository = core.getInput('repository') ||
  12371. `${github.context.repo.owner}/${github.context.repo.repo}`;
  12372. core.debug(`qualified repository = '${qualifiedRepository}'`);
  12373. const splitRepository = qualifiedRepository.split('/');
  12374. if (splitRepository.length !== 2 ||
  12375. !splitRepository[0] ||
  12376. !splitRepository[1]) {
  12377. throw new Error(`Invalid repository '${qualifiedRepository}'. Expected format {owner}/{repo}.`);
  12378. }
  12379. result.repositoryOwner = splitRepository[0];
  12380. result.repositoryName = splitRepository[1];
  12381. // Repository path
  12382. result.repositoryPath = core.getInput('path') || '.';
  12383. result.repositoryPath = path.resolve(githubWorkspacePath, result.repositoryPath);
  12384. if (!(result.repositoryPath + path.sep).startsWith(githubWorkspacePath + path.sep)) {
  12385. throw new Error(`Repository path '${result.repositoryPath}' is not under '${githubWorkspacePath}'`);
  12386. }
  12387. // Workflow repository?
  12388. const isWorkflowRepository = qualifiedRepository.toUpperCase() ===
  12389. `${github.context.repo.owner}/${github.context.repo.repo}`.toUpperCase();
  12390. // Source branch, source version
  12391. result.ref = core.getInput('ref');
  12392. if (!result.ref) {
  12393. if (isWorkflowRepository) {
  12394. result.ref = github.context.ref;
  12395. result.commit = github.context.sha;
  12396. }
  12397. if (!result.ref && !result.commit) {
  12398. result.ref = 'refs/heads/master';
  12399. }
  12400. }
  12401. // SHA?
  12402. else if (result.ref.match(/^[0-9a-fA-F]{40}$/)) {
  12403. result.commit = result.ref;
  12404. result.ref = '';
  12405. }
  12406. core.debug(`ref = '${result.ref}'`);
  12407. core.debug(`commit = '${result.commit}'`);
  12408. // Clean
  12409. result.clean = (core.getInput('clean') || 'true').toUpperCase() === 'TRUE';
  12410. core.debug(`clean = ${result.clean}`);
  12411. // Submodules
  12412. if (core.getInput('submodules')) {
  12413. throw new Error("The input 'submodules' is not supported in actions/checkout@v2");
  12414. }
  12415. // Fetch depth
  12416. result.fetchDepth = Math.floor(Number(core.getInput('fetch-depth') || '1'));
  12417. if (isNaN(result.fetchDepth) || result.fetchDepth < 0) {
  12418. result.fetchDepth = 0;
  12419. }
  12420. core.debug(`fetch depth = ${result.fetchDepth}`);
  12421. // LFS
  12422. result.lfs = (core.getInput('lfs') || 'false').toUpperCase() === 'TRUE';
  12423. core.debug(`lfs = ${result.lfs}`);
  12424. // Auth token
  12425. result.authToken = core.getInput('token');
  12426. // Persist credentials
  12427. result.persistCredentials =
  12428. (core.getInput('persist-credentials') || 'false').toUpperCase() === 'TRUE';
  12429. return result;
  12430. }
  12431. exports.getInputs = getInputs;
  12432. /***/ }),
  12433. /***/ 826:
  12434. /***/ (function(module, __unusedexports, __webpack_require__) {
  12435. var rng = __webpack_require__(139);
  12436. var bytesToUuid = __webpack_require__(722);
  12437. function v4(options, buf, offset) {
  12438. var i = buf && offset || 0;
  12439. if (typeof(options) == 'string') {
  12440. buf = options === 'binary' ? new Array(16) : null;
  12441. options = null;
  12442. }
  12443. options = options || {};
  12444. var rnds = options.random || (options.rng || rng)();
  12445. // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  12446. rnds[6] = (rnds[6] & 0x0f) | 0x40;
  12447. rnds[8] = (rnds[8] & 0x3f) | 0x80;
  12448. // Copy bytes to buffer, if provided
  12449. if (buf) {
  12450. for (var ii = 0; ii < 16; ++ii) {
  12451. buf[i + ii] = rnds[ii];
  12452. }
  12453. }
  12454. return buf || bytesToUuid(rnds);
  12455. }
  12456. module.exports = v4;
  12457. /***/ }),
  12458. /***/ 835:
  12459. /***/ (function(module) {
  12460. module.exports = require("url");
  12461. /***/ }),
  12462. /***/ 850:
  12463. /***/ (function(module, __unusedexports, __webpack_require__) {
  12464. module.exports = paginationMethodsPlugin
  12465. function paginationMethodsPlugin (octokit) {
  12466. octokit.getFirstPage = __webpack_require__(777).bind(null, octokit)
  12467. octokit.getLastPage = __webpack_require__(649).bind(null, octokit)
  12468. octokit.getNextPage = __webpack_require__(550).bind(null, octokit)
  12469. octokit.getPreviousPage = __webpack_require__(563).bind(null, octokit)
  12470. octokit.hasFirstPage = __webpack_require__(536)
  12471. octokit.hasLastPage = __webpack_require__(336)
  12472. octokit.hasNextPage = __webpack_require__(929)
  12473. octokit.hasPreviousPage = __webpack_require__(558)
  12474. }
  12475. /***/ }),
  12476. /***/ 854:
  12477. /***/ (function(module) {
  12478. /**
  12479. * lodash (Custom Build) <https://lodash.com/>
  12480. * Build: `lodash modularize exports="npm" -o ./`
  12481. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  12482. * Released under MIT license <https://lodash.com/license>
  12483. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  12484. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  12485. */
  12486. /** Used as the `TypeError` message for "Functions" methods. */
  12487. var FUNC_ERROR_TEXT = 'Expected a function';
  12488. /** Used to stand-in for `undefined` hash values. */
  12489. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  12490. /** Used as references for various `Number` constants. */
  12491. var INFINITY = 1 / 0;
  12492. /** `Object#toString` result references. */
  12493. var funcTag = '[object Function]',
  12494. genTag = '[object GeneratorFunction]',
  12495. symbolTag = '[object Symbol]';
  12496. /** Used to match property names within property paths. */
  12497. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  12498. reIsPlainProp = /^\w*$/,
  12499. reLeadingDot = /^\./,
  12500. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  12501. /**
  12502. * Used to match `RegExp`
  12503. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  12504. */
  12505. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  12506. /** Used to match backslashes in property paths. */
  12507. var reEscapeChar = /\\(\\)?/g;
  12508. /** Used to detect host constructors (Safari). */
  12509. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  12510. /** Detect free variable `global` from Node.js. */
  12511. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  12512. /** Detect free variable `self`. */
  12513. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  12514. /** Used as a reference to the global object. */
  12515. var root = freeGlobal || freeSelf || Function('return this')();
  12516. /**
  12517. * Gets the value at `key` of `object`.
  12518. *
  12519. * @private
  12520. * @param {Object} [object] The object to query.
  12521. * @param {string} key The key of the property to get.
  12522. * @returns {*} Returns the property value.
  12523. */
  12524. function getValue(object, key) {
  12525. return object == null ? undefined : object[key];
  12526. }
  12527. /**
  12528. * Checks if `value` is a host object in IE < 9.
  12529. *
  12530. * @private
  12531. * @param {*} value The value to check.
  12532. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  12533. */
  12534. function isHostObject(value) {
  12535. // Many host objects are `Object` objects that can coerce to strings
  12536. // despite having improperly defined `toString` methods.
  12537. var result = false;
  12538. if (value != null && typeof value.toString != 'function') {
  12539. try {
  12540. result = !!(value + '');
  12541. } catch (e) {}
  12542. }
  12543. return result;
  12544. }
  12545. /** Used for built-in method references. */
  12546. var arrayProto = Array.prototype,
  12547. funcProto = Function.prototype,
  12548. objectProto = Object.prototype;
  12549. /** Used to detect overreaching core-js shims. */
  12550. var coreJsData = root['__core-js_shared__'];
  12551. /** Used to detect methods masquerading as native. */
  12552. var maskSrcKey = (function() {
  12553. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  12554. return uid ? ('Symbol(src)_1.' + uid) : '';
  12555. }());
  12556. /** Used to resolve the decompiled source of functions. */
  12557. var funcToString = funcProto.toString;
  12558. /** Used to check objects for own properties. */
  12559. var hasOwnProperty = objectProto.hasOwnProperty;
  12560. /**
  12561. * Used to resolve the
  12562. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  12563. * of values.
  12564. */
  12565. var objectToString = objectProto.toString;
  12566. /** Used to detect if a method is native. */
  12567. var reIsNative = RegExp('^' +
  12568. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  12569. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  12570. );
  12571. /** Built-in value references. */
  12572. var Symbol = root.Symbol,
  12573. splice = arrayProto.splice;
  12574. /* Built-in method references that are verified to be native. */
  12575. var Map = getNative(root, 'Map'),
  12576. nativeCreate = getNative(Object, 'create');
  12577. /** Used to convert symbols to primitives and strings. */
  12578. var symbolProto = Symbol ? Symbol.prototype : undefined,
  12579. symbolToString = symbolProto ? symbolProto.toString : undefined;
  12580. /**
  12581. * Creates a hash object.
  12582. *
  12583. * @private
  12584. * @constructor
  12585. * @param {Array} [entries] The key-value pairs to cache.
  12586. */
  12587. function Hash(entries) {
  12588. var index = -1,
  12589. length = entries ? entries.length : 0;
  12590. this.clear();
  12591. while (++index < length) {
  12592. var entry = entries[index];
  12593. this.set(entry[0], entry[1]);
  12594. }
  12595. }
  12596. /**
  12597. * Removes all key-value entries from the hash.
  12598. *
  12599. * @private
  12600. * @name clear
  12601. * @memberOf Hash
  12602. */
  12603. function hashClear() {
  12604. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  12605. }
  12606. /**
  12607. * Removes `key` and its value from the hash.
  12608. *
  12609. * @private
  12610. * @name delete
  12611. * @memberOf Hash
  12612. * @param {Object} hash The hash to modify.
  12613. * @param {string} key The key of the value to remove.
  12614. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  12615. */
  12616. function hashDelete(key) {
  12617. return this.has(key) && delete this.__data__[key];
  12618. }
  12619. /**
  12620. * Gets the hash value for `key`.
  12621. *
  12622. * @private
  12623. * @name get
  12624. * @memberOf Hash
  12625. * @param {string} key The key of the value to get.
  12626. * @returns {*} Returns the entry value.
  12627. */
  12628. function hashGet(key) {
  12629. var data = this.__data__;
  12630. if (nativeCreate) {
  12631. var result = data[key];
  12632. return result === HASH_UNDEFINED ? undefined : result;
  12633. }
  12634. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  12635. }
  12636. /**
  12637. * Checks if a hash value for `key` exists.
  12638. *
  12639. * @private
  12640. * @name has
  12641. * @memberOf Hash
  12642. * @param {string} key The key of the entry to check.
  12643. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  12644. */
  12645. function hashHas(key) {
  12646. var data = this.__data__;
  12647. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  12648. }
  12649. /**
  12650. * Sets the hash `key` to `value`.
  12651. *
  12652. * @private
  12653. * @name set
  12654. * @memberOf Hash
  12655. * @param {string} key The key of the value to set.
  12656. * @param {*} value The value to set.
  12657. * @returns {Object} Returns the hash instance.
  12658. */
  12659. function hashSet(key, value) {
  12660. var data = this.__data__;
  12661. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  12662. return this;
  12663. }
  12664. // Add methods to `Hash`.
  12665. Hash.prototype.clear = hashClear;
  12666. Hash.prototype['delete'] = hashDelete;
  12667. Hash.prototype.get = hashGet;
  12668. Hash.prototype.has = hashHas;
  12669. Hash.prototype.set = hashSet;
  12670. /**
  12671. * Creates an list cache object.
  12672. *
  12673. * @private
  12674. * @constructor
  12675. * @param {Array} [entries] The key-value pairs to cache.
  12676. */
  12677. function ListCache(entries) {
  12678. var index = -1,
  12679. length = entries ? entries.length : 0;
  12680. this.clear();
  12681. while (++index < length) {
  12682. var entry = entries[index];
  12683. this.set(entry[0], entry[1]);
  12684. }
  12685. }
  12686. /**
  12687. * Removes all key-value entries from the list cache.
  12688. *
  12689. * @private
  12690. * @name clear
  12691. * @memberOf ListCache
  12692. */
  12693. function listCacheClear() {
  12694. this.__data__ = [];
  12695. }
  12696. /**
  12697. * Removes `key` and its value from the list cache.
  12698. *
  12699. * @private
  12700. * @name delete
  12701. * @memberOf ListCache
  12702. * @param {string} key The key of the value to remove.
  12703. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  12704. */
  12705. function listCacheDelete(key) {
  12706. var data = this.__data__,
  12707. index = assocIndexOf(data, key);
  12708. if (index < 0) {
  12709. return false;
  12710. }
  12711. var lastIndex = data.length - 1;
  12712. if (index == lastIndex) {
  12713. data.pop();
  12714. } else {
  12715. splice.call(data, index, 1);
  12716. }
  12717. return true;
  12718. }
  12719. /**
  12720. * Gets the list cache value for `key`.
  12721. *
  12722. * @private
  12723. * @name get
  12724. * @memberOf ListCache
  12725. * @param {string} key The key of the value to get.
  12726. * @returns {*} Returns the entry value.
  12727. */
  12728. function listCacheGet(key) {
  12729. var data = this.__data__,
  12730. index = assocIndexOf(data, key);
  12731. return index < 0 ? undefined : data[index][1];
  12732. }
  12733. /**
  12734. * Checks if a list cache value for `key` exists.
  12735. *
  12736. * @private
  12737. * @name has
  12738. * @memberOf ListCache
  12739. * @param {string} key The key of the entry to check.
  12740. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  12741. */
  12742. function listCacheHas(key) {
  12743. return assocIndexOf(this.__data__, key) > -1;
  12744. }
  12745. /**
  12746. * Sets the list cache `key` to `value`.
  12747. *
  12748. * @private
  12749. * @name set
  12750. * @memberOf ListCache
  12751. * @param {string} key The key of the value to set.
  12752. * @param {*} value The value to set.
  12753. * @returns {Object} Returns the list cache instance.
  12754. */
  12755. function listCacheSet(key, value) {
  12756. var data = this.__data__,
  12757. index = assocIndexOf(data, key);
  12758. if (index < 0) {
  12759. data.push([key, value]);
  12760. } else {
  12761. data[index][1] = value;
  12762. }
  12763. return this;
  12764. }
  12765. // Add methods to `ListCache`.
  12766. ListCache.prototype.clear = listCacheClear;
  12767. ListCache.prototype['delete'] = listCacheDelete;
  12768. ListCache.prototype.get = listCacheGet;
  12769. ListCache.prototype.has = listCacheHas;
  12770. ListCache.prototype.set = listCacheSet;
  12771. /**
  12772. * Creates a map cache object to store key-value pairs.
  12773. *
  12774. * @private
  12775. * @constructor
  12776. * @param {Array} [entries] The key-value pairs to cache.
  12777. */
  12778. function MapCache(entries) {
  12779. var index = -1,
  12780. length = entries ? entries.length : 0;
  12781. this.clear();
  12782. while (++index < length) {
  12783. var entry = entries[index];
  12784. this.set(entry[0], entry[1]);
  12785. }
  12786. }
  12787. /**
  12788. * Removes all key-value entries from the map.
  12789. *
  12790. * @private
  12791. * @name clear
  12792. * @memberOf MapCache
  12793. */
  12794. function mapCacheClear() {
  12795. this.__data__ = {
  12796. 'hash': new Hash,
  12797. 'map': new (Map || ListCache),
  12798. 'string': new Hash
  12799. };
  12800. }
  12801. /**
  12802. * Removes `key` and its value from the map.
  12803. *
  12804. * @private
  12805. * @name delete
  12806. * @memberOf MapCache
  12807. * @param {string} key The key of the value to remove.
  12808. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  12809. */
  12810. function mapCacheDelete(key) {
  12811. return getMapData(this, key)['delete'](key);
  12812. }
  12813. /**
  12814. * Gets the map value for `key`.
  12815. *
  12816. * @private
  12817. * @name get
  12818. * @memberOf MapCache
  12819. * @param {string} key The key of the value to get.
  12820. * @returns {*} Returns the entry value.
  12821. */
  12822. function mapCacheGet(key) {
  12823. return getMapData(this, key).get(key);
  12824. }
  12825. /**
  12826. * Checks if a map value for `key` exists.
  12827. *
  12828. * @private
  12829. * @name has
  12830. * @memberOf MapCache
  12831. * @param {string} key The key of the entry to check.
  12832. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  12833. */
  12834. function mapCacheHas(key) {
  12835. return getMapData(this, key).has(key);
  12836. }
  12837. /**
  12838. * Sets the map `key` to `value`.
  12839. *
  12840. * @private
  12841. * @name set
  12842. * @memberOf MapCache
  12843. * @param {string} key The key of the value to set.
  12844. * @param {*} value The value to set.
  12845. * @returns {Object} Returns the map cache instance.
  12846. */
  12847. function mapCacheSet(key, value) {
  12848. getMapData(this, key).set(key, value);
  12849. return this;
  12850. }
  12851. // Add methods to `MapCache`.
  12852. MapCache.prototype.clear = mapCacheClear;
  12853. MapCache.prototype['delete'] = mapCacheDelete;
  12854. MapCache.prototype.get = mapCacheGet;
  12855. MapCache.prototype.has = mapCacheHas;
  12856. MapCache.prototype.set = mapCacheSet;
  12857. /**
  12858. * Gets the index at which the `key` is found in `array` of key-value pairs.
  12859. *
  12860. * @private
  12861. * @param {Array} array The array to inspect.
  12862. * @param {*} key The key to search for.
  12863. * @returns {number} Returns the index of the matched value, else `-1`.
  12864. */
  12865. function assocIndexOf(array, key) {
  12866. var length = array.length;
  12867. while (length--) {
  12868. if (eq(array[length][0], key)) {
  12869. return length;
  12870. }
  12871. }
  12872. return -1;
  12873. }
  12874. /**
  12875. * The base implementation of `_.get` without support for default values.
  12876. *
  12877. * @private
  12878. * @param {Object} object The object to query.
  12879. * @param {Array|string} path The path of the property to get.
  12880. * @returns {*} Returns the resolved value.
  12881. */
  12882. function baseGet(object, path) {
  12883. path = isKey(path, object) ? [path] : castPath(path);
  12884. var index = 0,
  12885. length = path.length;
  12886. while (object != null && index < length) {
  12887. object = object[toKey(path[index++])];
  12888. }
  12889. return (index && index == length) ? object : undefined;
  12890. }
  12891. /**
  12892. * The base implementation of `_.isNative` without bad shim checks.
  12893. *
  12894. * @private
  12895. * @param {*} value The value to check.
  12896. * @returns {boolean} Returns `true` if `value` is a native function,
  12897. * else `false`.
  12898. */
  12899. function baseIsNative(value) {
  12900. if (!isObject(value) || isMasked(value)) {
  12901. return false;
  12902. }
  12903. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  12904. return pattern.test(toSource(value));
  12905. }
  12906. /**
  12907. * The base implementation of `_.toString` which doesn't convert nullish
  12908. * values to empty strings.
  12909. *
  12910. * @private
  12911. * @param {*} value The value to process.
  12912. * @returns {string} Returns the string.
  12913. */
  12914. function baseToString(value) {
  12915. // Exit early for strings to avoid a performance hit in some environments.
  12916. if (typeof value == 'string') {
  12917. return value;
  12918. }
  12919. if (isSymbol(value)) {
  12920. return symbolToString ? symbolToString.call(value) : '';
  12921. }
  12922. var result = (value + '');
  12923. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  12924. }
  12925. /**
  12926. * Casts `value` to a path array if it's not one.
  12927. *
  12928. * @private
  12929. * @param {*} value The value to inspect.
  12930. * @returns {Array} Returns the cast property path array.
  12931. */
  12932. function castPath(value) {
  12933. return isArray(value) ? value : stringToPath(value);
  12934. }
  12935. /**
  12936. * Gets the data for `map`.
  12937. *
  12938. * @private
  12939. * @param {Object} map The map to query.
  12940. * @param {string} key The reference key.
  12941. * @returns {*} Returns the map data.
  12942. */
  12943. function getMapData(map, key) {
  12944. var data = map.__data__;
  12945. return isKeyable(key)
  12946. ? data[typeof key == 'string' ? 'string' : 'hash']
  12947. : data.map;
  12948. }
  12949. /**
  12950. * Gets the native function at `key` of `object`.
  12951. *
  12952. * @private
  12953. * @param {Object} object The object to query.
  12954. * @param {string} key The key of the method to get.
  12955. * @returns {*} Returns the function if it's native, else `undefined`.
  12956. */
  12957. function getNative(object, key) {
  12958. var value = getValue(object, key);
  12959. return baseIsNative(value) ? value : undefined;
  12960. }
  12961. /**
  12962. * Checks if `value` is a property name and not a property path.
  12963. *
  12964. * @private
  12965. * @param {*} value The value to check.
  12966. * @param {Object} [object] The object to query keys on.
  12967. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  12968. */
  12969. function isKey(value, object) {
  12970. if (isArray(value)) {
  12971. return false;
  12972. }
  12973. var type = typeof value;
  12974. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  12975. value == null || isSymbol(value)) {
  12976. return true;
  12977. }
  12978. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  12979. (object != null && value in Object(object));
  12980. }
  12981. /**
  12982. * Checks if `value` is suitable for use as unique object key.
  12983. *
  12984. * @private
  12985. * @param {*} value The value to check.
  12986. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  12987. */
  12988. function isKeyable(value) {
  12989. var type = typeof value;
  12990. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  12991. ? (value !== '__proto__')
  12992. : (value === null);
  12993. }
  12994. /**
  12995. * Checks if `func` has its source masked.
  12996. *
  12997. * @private
  12998. * @param {Function} func The function to check.
  12999. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  13000. */
  13001. function isMasked(func) {
  13002. return !!maskSrcKey && (maskSrcKey in func);
  13003. }
  13004. /**
  13005. * Converts `string` to a property path array.
  13006. *
  13007. * @private
  13008. * @param {string} string The string to convert.
  13009. * @returns {Array} Returns the property path array.
  13010. */
  13011. var stringToPath = memoize(function(string) {
  13012. string = toString(string);
  13013. var result = [];
  13014. if (reLeadingDot.test(string)) {
  13015. result.push('');
  13016. }
  13017. string.replace(rePropName, function(match, number, quote, string) {
  13018. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  13019. });
  13020. return result;
  13021. });
  13022. /**
  13023. * Converts `value` to a string key if it's not a string or symbol.
  13024. *
  13025. * @private
  13026. * @param {*} value The value to inspect.
  13027. * @returns {string|symbol} Returns the key.
  13028. */
  13029. function toKey(value) {
  13030. if (typeof value == 'string' || isSymbol(value)) {
  13031. return value;
  13032. }
  13033. var result = (value + '');
  13034. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  13035. }
  13036. /**
  13037. * Converts `func` to its source code.
  13038. *
  13039. * @private
  13040. * @param {Function} func The function to process.
  13041. * @returns {string} Returns the source code.
  13042. */
  13043. function toSource(func) {
  13044. if (func != null) {
  13045. try {
  13046. return funcToString.call(func);
  13047. } catch (e) {}
  13048. try {
  13049. return (func + '');
  13050. } catch (e) {}
  13051. }
  13052. return '';
  13053. }
  13054. /**
  13055. * Creates a function that memoizes the result of `func`. If `resolver` is
  13056. * provided, it determines the cache key for storing the result based on the
  13057. * arguments provided to the memoized function. By default, the first argument
  13058. * provided to the memoized function is used as the map cache key. The `func`
  13059. * is invoked with the `this` binding of the memoized function.
  13060. *
  13061. * **Note:** The cache is exposed as the `cache` property on the memoized
  13062. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  13063. * constructor with one whose instances implement the
  13064. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  13065. * method interface of `delete`, `get`, `has`, and `set`.
  13066. *
  13067. * @static
  13068. * @memberOf _
  13069. * @since 0.1.0
  13070. * @category Function
  13071. * @param {Function} func The function to have its output memoized.
  13072. * @param {Function} [resolver] The function to resolve the cache key.
  13073. * @returns {Function} Returns the new memoized function.
  13074. * @example
  13075. *
  13076. * var object = { 'a': 1, 'b': 2 };
  13077. * var other = { 'c': 3, 'd': 4 };
  13078. *
  13079. * var values = _.memoize(_.values);
  13080. * values(object);
  13081. * // => [1, 2]
  13082. *
  13083. * values(other);
  13084. * // => [3, 4]
  13085. *
  13086. * object.a = 2;
  13087. * values(object);
  13088. * // => [1, 2]
  13089. *
  13090. * // Modify the result cache.
  13091. * values.cache.set(object, ['a', 'b']);
  13092. * values(object);
  13093. * // => ['a', 'b']
  13094. *
  13095. * // Replace `_.memoize.Cache`.
  13096. * _.memoize.Cache = WeakMap;
  13097. */
  13098. function memoize(func, resolver) {
  13099. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  13100. throw new TypeError(FUNC_ERROR_TEXT);
  13101. }
  13102. var memoized = function() {
  13103. var args = arguments,
  13104. key = resolver ? resolver.apply(this, args) : args[0],
  13105. cache = memoized.cache;
  13106. if (cache.has(key)) {
  13107. return cache.get(key);
  13108. }
  13109. var result = func.apply(this, args);
  13110. memoized.cache = cache.set(key, result);
  13111. return result;
  13112. };
  13113. memoized.cache = new (memoize.Cache || MapCache);
  13114. return memoized;
  13115. }
  13116. // Assign cache to `_.memoize`.
  13117. memoize.Cache = MapCache;
  13118. /**
  13119. * Performs a
  13120. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  13121. * comparison between two values to determine if they are equivalent.
  13122. *
  13123. * @static
  13124. * @memberOf _
  13125. * @since 4.0.0
  13126. * @category Lang
  13127. * @param {*} value The value to compare.
  13128. * @param {*} other The other value to compare.
  13129. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  13130. * @example
  13131. *
  13132. * var object = { 'a': 1 };
  13133. * var other = { 'a': 1 };
  13134. *
  13135. * _.eq(object, object);
  13136. * // => true
  13137. *
  13138. * _.eq(object, other);
  13139. * // => false
  13140. *
  13141. * _.eq('a', 'a');
  13142. * // => true
  13143. *
  13144. * _.eq('a', Object('a'));
  13145. * // => false
  13146. *
  13147. * _.eq(NaN, NaN);
  13148. * // => true
  13149. */
  13150. function eq(value, other) {
  13151. return value === other || (value !== value && other !== other);
  13152. }
  13153. /**
  13154. * Checks if `value` is classified as an `Array` object.
  13155. *
  13156. * @static
  13157. * @memberOf _
  13158. * @since 0.1.0
  13159. * @category Lang
  13160. * @param {*} value The value to check.
  13161. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  13162. * @example
  13163. *
  13164. * _.isArray([1, 2, 3]);
  13165. * // => true
  13166. *
  13167. * _.isArray(document.body.children);
  13168. * // => false
  13169. *
  13170. * _.isArray('abc');
  13171. * // => false
  13172. *
  13173. * _.isArray(_.noop);
  13174. * // => false
  13175. */
  13176. var isArray = Array.isArray;
  13177. /**
  13178. * Checks if `value` is classified as a `Function` object.
  13179. *
  13180. * @static
  13181. * @memberOf _
  13182. * @since 0.1.0
  13183. * @category Lang
  13184. * @param {*} value The value to check.
  13185. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  13186. * @example
  13187. *
  13188. * _.isFunction(_);
  13189. * // => true
  13190. *
  13191. * _.isFunction(/abc/);
  13192. * // => false
  13193. */
  13194. function isFunction(value) {
  13195. // The use of `Object#toString` avoids issues with the `typeof` operator
  13196. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  13197. var tag = isObject(value) ? objectToString.call(value) : '';
  13198. return tag == funcTag || tag == genTag;
  13199. }
  13200. /**
  13201. * Checks if `value` is the
  13202. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  13203. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  13204. *
  13205. * @static
  13206. * @memberOf _
  13207. * @since 0.1.0
  13208. * @category Lang
  13209. * @param {*} value The value to check.
  13210. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  13211. * @example
  13212. *
  13213. * _.isObject({});
  13214. * // => true
  13215. *
  13216. * _.isObject([1, 2, 3]);
  13217. * // => true
  13218. *
  13219. * _.isObject(_.noop);
  13220. * // => true
  13221. *
  13222. * _.isObject(null);
  13223. * // => false
  13224. */
  13225. function isObject(value) {
  13226. var type = typeof value;
  13227. return !!value && (type == 'object' || type == 'function');
  13228. }
  13229. /**
  13230. * Checks if `value` is object-like. A value is object-like if it's not `null`
  13231. * and has a `typeof` result of "object".
  13232. *
  13233. * @static
  13234. * @memberOf _
  13235. * @since 4.0.0
  13236. * @category Lang
  13237. * @param {*} value The value to check.
  13238. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  13239. * @example
  13240. *
  13241. * _.isObjectLike({});
  13242. * // => true
  13243. *
  13244. * _.isObjectLike([1, 2, 3]);
  13245. * // => true
  13246. *
  13247. * _.isObjectLike(_.noop);
  13248. * // => false
  13249. *
  13250. * _.isObjectLike(null);
  13251. * // => false
  13252. */
  13253. function isObjectLike(value) {
  13254. return !!value && typeof value == 'object';
  13255. }
  13256. /**
  13257. * Checks if `value` is classified as a `Symbol` primitive or object.
  13258. *
  13259. * @static
  13260. * @memberOf _
  13261. * @since 4.0.0
  13262. * @category Lang
  13263. * @param {*} value The value to check.
  13264. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  13265. * @example
  13266. *
  13267. * _.isSymbol(Symbol.iterator);
  13268. * // => true
  13269. *
  13270. * _.isSymbol('abc');
  13271. * // => false
  13272. */
  13273. function isSymbol(value) {
  13274. return typeof value == 'symbol' ||
  13275. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  13276. }
  13277. /**
  13278. * Converts `value` to a string. An empty string is returned for `null`
  13279. * and `undefined` values. The sign of `-0` is preserved.
  13280. *
  13281. * @static
  13282. * @memberOf _
  13283. * @since 4.0.0
  13284. * @category Lang
  13285. * @param {*} value The value to process.
  13286. * @returns {string} Returns the string.
  13287. * @example
  13288. *
  13289. * _.toString(null);
  13290. * // => ''
  13291. *
  13292. * _.toString(-0);
  13293. * // => '-0'
  13294. *
  13295. * _.toString([1, 2, 3]);
  13296. * // => '1,2,3'
  13297. */
  13298. function toString(value) {
  13299. return value == null ? '' : baseToString(value);
  13300. }
  13301. /**
  13302. * Gets the value at `path` of `object`. If the resolved value is
  13303. * `undefined`, the `defaultValue` is returned in its place.
  13304. *
  13305. * @static
  13306. * @memberOf _
  13307. * @since 3.7.0
  13308. * @category Object
  13309. * @param {Object} object The object to query.
  13310. * @param {Array|string} path The path of the property to get.
  13311. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13312. * @returns {*} Returns the resolved value.
  13313. * @example
  13314. *
  13315. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13316. *
  13317. * _.get(object, 'a[0].b.c');
  13318. * // => 3
  13319. *
  13320. * _.get(object, ['a', '0', 'b', 'c']);
  13321. * // => 3
  13322. *
  13323. * _.get(object, 'a.b.c', 'default');
  13324. * // => 'default'
  13325. */
  13326. function get(object, path, defaultValue) {
  13327. var result = object == null ? undefined : baseGet(object, path);
  13328. return result === undefined ? defaultValue : result;
  13329. }
  13330. module.exports = get;
  13331. /***/ }),
  13332. /***/ 855:
  13333. /***/ (function(module, __unusedexports, __webpack_require__) {
  13334. module.exports = registerPlugin;
  13335. const factory = __webpack_require__(47);
  13336. function registerPlugin(plugins, pluginFunction) {
  13337. return factory(
  13338. plugins.includes(pluginFunction) ? plugins : plugins.concat(pluginFunction)
  13339. );
  13340. }
  13341. /***/ }),
  13342. /***/ 856:
  13343. /***/ (function(module, __unusedexports, __webpack_require__) {
  13344. module.exports = __webpack_require__(141);
  13345. /***/ }),
  13346. /***/ 863:
  13347. /***/ (function(module, __unusedexports, __webpack_require__) {
  13348. module.exports = authenticationBeforeRequest;
  13349. const btoa = __webpack_require__(675);
  13350. const withAuthorizationPrefix = __webpack_require__(143);
  13351. function authenticationBeforeRequest(state, options) {
  13352. if (typeof state.auth === "string") {
  13353. options.headers.authorization = withAuthorizationPrefix(state.auth);
  13354. // https://developer.github.com/v3/previews/#integrations
  13355. if (
  13356. /^bearer /i.test(state.auth) &&
  13357. !/machine-man/.test(options.headers.accept)
  13358. ) {
  13359. const acceptHeaders = options.headers.accept
  13360. .split(",")
  13361. .concat("application/vnd.github.machine-man-preview+json");
  13362. options.headers.accept = acceptHeaders.filter(Boolean).join(",");
  13363. }
  13364. return;
  13365. }
  13366. if (state.auth.username) {
  13367. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  13368. options.headers.authorization = `Basic ${hash}`;
  13369. if (state.otp) {
  13370. options.headers["x-github-otp"] = state.otp;
  13371. }
  13372. return;
  13373. }
  13374. if (state.auth.clientId) {
  13375. // There is a special case for OAuth applications, when `clientId` and `clientSecret` is passed as
  13376. // Basic Authorization instead of query parameters. The only routes where that applies share the same
  13377. // URL though: `/applications/:client_id/tokens/:access_token`.
  13378. //
  13379. // 1. [Check an authorization](https://developer.github.com/v3/oauth_authorizations/#check-an-authorization)
  13380. // 2. [Reset an authorization](https://developer.github.com/v3/oauth_authorizations/#reset-an-authorization)
  13381. // 3. [Revoke an authorization for an application](https://developer.github.com/v3/oauth_authorizations/#revoke-an-authorization-for-an-application)
  13382. //
  13383. // We identify by checking the URL. It must merge both "/applications/:client_id/tokens/:access_token"
  13384. // as well as "/applications/123/tokens/token456"
  13385. if (/\/applications\/:?[\w_]+\/tokens\/:?[\w_]+($|\?)/.test(options.url)) {
  13386. const hash = btoa(`${state.auth.clientId}:${state.auth.clientSecret}`);
  13387. options.headers.authorization = `Basic ${hash}`;
  13388. return;
  13389. }
  13390. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  13391. options.url += `client_id=${state.auth.clientId}&client_secret=${state.auth.clientSecret}`;
  13392. return;
  13393. }
  13394. return Promise.resolve()
  13395. .then(() => {
  13396. return state.auth();
  13397. })
  13398. .then(authorization => {
  13399. options.headers.authorization = withAuthorizationPrefix(authorization);
  13400. });
  13401. }
  13402. /***/ }),
  13403. /***/ 866:
  13404. /***/ (function(module, __unusedexports, __webpack_require__) {
  13405. "use strict";
  13406. var shebangRegex = __webpack_require__(816);
  13407. module.exports = function (str) {
  13408. var match = str.match(shebangRegex);
  13409. if (!match) {
  13410. return null;
  13411. }
  13412. var arr = match[0].replace(/#! ?/, '').split(' ');
  13413. var bin = arr[0].split('/').pop();
  13414. var arg = arr[1];
  13415. return (bin === 'env' ?
  13416. arg :
  13417. bin + (arg ? ' ' + arg : '')
  13418. );
  13419. };
  13420. /***/ }),
  13421. /***/ 867:
  13422. /***/ (function(module) {
  13423. module.exports = require("tty");
  13424. /***/ }),
  13425. /***/ 874:
  13426. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  13427. "use strict";
  13428. // Copyright (c) Microsoft. All rights reserved.
  13429. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
  13430. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  13431. return new (P || (P = Promise))(function (resolve, reject) {
  13432. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  13433. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  13434. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  13435. step((generator = generator.apply(thisArg, _arguments || [])).next());
  13436. });
  13437. };
  13438. Object.defineProperty(exports, "__esModule", { value: true });
  13439. const url = __webpack_require__(835);
  13440. const http = __webpack_require__(605);
  13441. const https = __webpack_require__(211);
  13442. let fs;
  13443. let tunnel;
  13444. var HttpCodes;
  13445. (function (HttpCodes) {
  13446. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  13447. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  13448. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  13449. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  13450. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  13451. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  13452. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  13453. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  13454. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  13455. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  13456. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  13457. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  13458. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  13459. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  13460. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  13461. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  13462. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  13463. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  13464. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  13465. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  13466. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  13467. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  13468. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  13469. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  13470. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  13471. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  13472. })(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
  13473. const HttpRedirectCodes = [HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect];
  13474. const HttpResponseRetryCodes = [HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout];
  13475. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  13476. const ExponentialBackoffCeiling = 10;
  13477. const ExponentialBackoffTimeSlice = 5;
  13478. class HttpClientResponse {
  13479. constructor(message) {
  13480. this.message = message;
  13481. }
  13482. readBody() {
  13483. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  13484. let output = '';
  13485. this.message.on('data', (chunk) => {
  13486. output += chunk;
  13487. });
  13488. this.message.on('end', () => {
  13489. resolve(output);
  13490. });
  13491. }));
  13492. }
  13493. }
  13494. exports.HttpClientResponse = HttpClientResponse;
  13495. function isHttps(requestUrl) {
  13496. let parsedUrl = url.parse(requestUrl);
  13497. return parsedUrl.protocol === 'https:';
  13498. }
  13499. exports.isHttps = isHttps;
  13500. var EnvironmentVariables;
  13501. (function (EnvironmentVariables) {
  13502. EnvironmentVariables["HTTP_PROXY"] = "HTTP_PROXY";
  13503. EnvironmentVariables["HTTPS_PROXY"] = "HTTPS_PROXY";
  13504. })(EnvironmentVariables || (EnvironmentVariables = {}));
  13505. class HttpClient {
  13506. constructor(userAgent, handlers, requestOptions) {
  13507. this._ignoreSslError = false;
  13508. this._allowRedirects = true;
  13509. this._maxRedirects = 50;
  13510. this._allowRetries = false;
  13511. this._maxRetries = 1;
  13512. this._keepAlive = false;
  13513. this._disposed = false;
  13514. this.userAgent = userAgent;
  13515. this.handlers = handlers || [];
  13516. this.requestOptions = requestOptions;
  13517. if (requestOptions) {
  13518. if (requestOptions.ignoreSslError != null) {
  13519. this._ignoreSslError = requestOptions.ignoreSslError;
  13520. }
  13521. this._socketTimeout = requestOptions.socketTimeout;
  13522. this._httpProxy = requestOptions.proxy;
  13523. if (requestOptions.proxy && requestOptions.proxy.proxyBypassHosts) {
  13524. this._httpProxyBypassHosts = [];
  13525. requestOptions.proxy.proxyBypassHosts.forEach(bypass => {
  13526. this._httpProxyBypassHosts.push(new RegExp(bypass, 'i'));
  13527. });
  13528. }
  13529. this._certConfig = requestOptions.cert;
  13530. if (this._certConfig) {
  13531. // If using cert, need fs
  13532. fs = __webpack_require__(747);
  13533. // cache the cert content into memory, so we don't have to read it from disk every time
  13534. if (this._certConfig.caFile && fs.existsSync(this._certConfig.caFile)) {
  13535. this._ca = fs.readFileSync(this._certConfig.caFile, 'utf8');
  13536. }
  13537. if (this._certConfig.certFile && fs.existsSync(this._certConfig.certFile)) {
  13538. this._cert = fs.readFileSync(this._certConfig.certFile, 'utf8');
  13539. }
  13540. if (this._certConfig.keyFile && fs.existsSync(this._certConfig.keyFile)) {
  13541. this._key = fs.readFileSync(this._certConfig.keyFile, 'utf8');
  13542. }
  13543. }
  13544. if (requestOptions.allowRedirects != null) {
  13545. this._allowRedirects = requestOptions.allowRedirects;
  13546. }
  13547. if (requestOptions.maxRedirects != null) {
  13548. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  13549. }
  13550. if (requestOptions.keepAlive != null) {
  13551. this._keepAlive = requestOptions.keepAlive;
  13552. }
  13553. if (requestOptions.allowRetries != null) {
  13554. this._allowRetries = requestOptions.allowRetries;
  13555. }
  13556. if (requestOptions.maxRetries != null) {
  13557. this._maxRetries = requestOptions.maxRetries;
  13558. }
  13559. }
  13560. }
  13561. options(requestUrl, additionalHeaders) {
  13562. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  13563. }
  13564. get(requestUrl, additionalHeaders) {
  13565. return this.request('GET', requestUrl, null, additionalHeaders || {});
  13566. }
  13567. del(requestUrl, additionalHeaders) {
  13568. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  13569. }
  13570. post(requestUrl, data, additionalHeaders) {
  13571. return this.request('POST', requestUrl, data, additionalHeaders || {});
  13572. }
  13573. patch(requestUrl, data, additionalHeaders) {
  13574. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  13575. }
  13576. put(requestUrl, data, additionalHeaders) {
  13577. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  13578. }
  13579. head(requestUrl, additionalHeaders) {
  13580. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  13581. }
  13582. sendStream(verb, requestUrl, stream, additionalHeaders) {
  13583. return this.request(verb, requestUrl, stream, additionalHeaders);
  13584. }
  13585. /**
  13586. * Makes a raw http request.
  13587. * All other methods such as get, post, patch, and request ultimately call this.
  13588. * Prefer get, del, post and patch
  13589. */
  13590. request(verb, requestUrl, data, headers) {
  13591. return __awaiter(this, void 0, void 0, function* () {
  13592. if (this._disposed) {
  13593. throw new Error("Client has already been disposed.");
  13594. }
  13595. let info = this._prepareRequest(verb, requestUrl, headers);
  13596. // Only perform retries on reads since writes may not be idempotent.
  13597. let maxTries = (this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1) ? this._maxRetries + 1 : 1;
  13598. let numTries = 0;
  13599. let response;
  13600. while (numTries < maxTries) {
  13601. response = yield this.requestRaw(info, data);
  13602. // Check if it's an authentication challenge
  13603. if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) {
  13604. let authenticationHandler;
  13605. for (let i = 0; i < this.handlers.length; i++) {
  13606. if (this.handlers[i].canHandleAuthentication(response)) {
  13607. authenticationHandler = this.handlers[i];
  13608. break;
  13609. }
  13610. }
  13611. if (authenticationHandler) {
  13612. return authenticationHandler.handleAuthentication(this, info, data);
  13613. }
  13614. else {
  13615. // We have received an unauthorized response but have no handlers to handle it.
  13616. // Let the response return to the caller.
  13617. return response;
  13618. }
  13619. }
  13620. let redirectsRemaining = this._maxRedirects;
  13621. while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1
  13622. && this._allowRedirects
  13623. && redirectsRemaining > 0) {
  13624. const redirectUrl = response.message.headers["location"];
  13625. if (!redirectUrl) {
  13626. // if there's no location to redirect to, we won't
  13627. break;
  13628. }
  13629. // we need to finish reading the response before reassigning response
  13630. // which will leak the open socket.
  13631. yield response.readBody();
  13632. // let's make the request with the new redirectUrl
  13633. info = this._prepareRequest(verb, redirectUrl, headers);
  13634. response = yield this.requestRaw(info, data);
  13635. redirectsRemaining--;
  13636. }
  13637. if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {
  13638. // If not a retry code, return immediately instead of retrying
  13639. return response;
  13640. }
  13641. numTries += 1;
  13642. if (numTries < maxTries) {
  13643. yield response.readBody();
  13644. yield this._performExponentialBackoff(numTries);
  13645. }
  13646. }
  13647. return response;
  13648. });
  13649. }
  13650. /**
  13651. * Needs to be called if keepAlive is set to true in request options.
  13652. */
  13653. dispose() {
  13654. if (this._agent) {
  13655. this._agent.destroy();
  13656. }
  13657. this._disposed = true;
  13658. }
  13659. /**
  13660. * Raw request.
  13661. * @param info
  13662. * @param data
  13663. */
  13664. requestRaw(info, data) {
  13665. return new Promise((resolve, reject) => {
  13666. let callbackForResult = function (err, res) {
  13667. if (err) {
  13668. reject(err);
  13669. }
  13670. resolve(res);
  13671. };
  13672. this.requestRawWithCallback(info, data, callbackForResult);
  13673. });
  13674. }
  13675. /**
  13676. * Raw request with callback.
  13677. * @param info
  13678. * @param data
  13679. * @param onResult
  13680. */
  13681. requestRawWithCallback(info, data, onResult) {
  13682. let socket;
  13683. let isDataString = typeof (data) === 'string';
  13684. if (typeof (data) === 'string') {
  13685. info.options.headers["Content-Length"] = Buffer.byteLength(data, 'utf8');
  13686. }
  13687. let callbackCalled = false;
  13688. let handleResult = (err, res) => {
  13689. if (!callbackCalled) {
  13690. callbackCalled = true;
  13691. onResult(err, res);
  13692. }
  13693. };
  13694. let req = info.httpModule.request(info.options, (msg) => {
  13695. let res = new HttpClientResponse(msg);
  13696. handleResult(null, res);
  13697. });
  13698. req.on('socket', (sock) => {
  13699. socket = sock;
  13700. });
  13701. // If we ever get disconnected, we want the socket to timeout eventually
  13702. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  13703. if (socket) {
  13704. socket.end();
  13705. }
  13706. handleResult(new Error('Request timeout: ' + info.options.path), null);
  13707. });
  13708. req.on('error', function (err) {
  13709. // err has statusCode property
  13710. // res should have headers
  13711. handleResult(err, null);
  13712. });
  13713. if (data && typeof (data) === 'string') {
  13714. req.write(data, 'utf8');
  13715. }
  13716. if (data && typeof (data) !== 'string') {
  13717. data.on('close', function () {
  13718. req.end();
  13719. });
  13720. data.pipe(req);
  13721. }
  13722. else {
  13723. req.end();
  13724. }
  13725. }
  13726. _prepareRequest(method, requestUrl, headers) {
  13727. const info = {};
  13728. info.parsedUrl = url.parse(requestUrl);
  13729. const usingSsl = info.parsedUrl.protocol === 'https:';
  13730. info.httpModule = usingSsl ? https : http;
  13731. const defaultPort = usingSsl ? 443 : 80;
  13732. info.options = {};
  13733. info.options.host = info.parsedUrl.hostname;
  13734. info.options.port = info.parsedUrl.port ? parseInt(info.parsedUrl.port) : defaultPort;
  13735. info.options.path = (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  13736. info.options.method = method;
  13737. info.options.headers = this._mergeHeaders(headers);
  13738. info.options.headers["user-agent"] = this.userAgent;
  13739. info.options.agent = this._getAgent(requestUrl);
  13740. // gives handlers an opportunity to participate
  13741. if (this.handlers && !this._isPresigned(requestUrl)) {
  13742. this.handlers.forEach((handler) => {
  13743. handler.prepareRequest(info.options);
  13744. });
  13745. }
  13746. return info;
  13747. }
  13748. _isPresigned(requestUrl) {
  13749. if (this.requestOptions && this.requestOptions.presignedUrlPatterns) {
  13750. const patterns = this.requestOptions.presignedUrlPatterns;
  13751. for (let i = 0; i < patterns.length; i++) {
  13752. if (requestUrl.match(patterns[i])) {
  13753. return true;
  13754. }
  13755. }
  13756. }
  13757. return false;
  13758. }
  13759. _mergeHeaders(headers) {
  13760. const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {});
  13761. if (this.requestOptions && this.requestOptions.headers) {
  13762. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
  13763. }
  13764. return lowercaseKeys(headers || {});
  13765. }
  13766. _getAgent(requestUrl) {
  13767. let agent;
  13768. let proxy = this._getProxy(requestUrl);
  13769. let useProxy = proxy.proxyUrl && proxy.proxyUrl.hostname && !this._isBypassProxy(requestUrl);
  13770. if (this._keepAlive && useProxy) {
  13771. agent = this._proxyAgent;
  13772. }
  13773. if (this._keepAlive && !useProxy) {
  13774. agent = this._agent;
  13775. }
  13776. // if agent is already assigned use that agent.
  13777. if (!!agent) {
  13778. return agent;
  13779. }
  13780. let parsedUrl = url.parse(requestUrl);
  13781. const usingSsl = parsedUrl.protocol === 'https:';
  13782. let maxSockets = 100;
  13783. if (!!this.requestOptions) {
  13784. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  13785. }
  13786. if (useProxy) {
  13787. // If using proxy, need tunnel
  13788. if (!tunnel) {
  13789. tunnel = __webpack_require__(856);
  13790. }
  13791. const agentOptions = {
  13792. maxSockets: maxSockets,
  13793. keepAlive: this._keepAlive,
  13794. proxy: {
  13795. proxyAuth: proxy.proxyAuth,
  13796. host: proxy.proxyUrl.hostname,
  13797. port: proxy.proxyUrl.port
  13798. },
  13799. };
  13800. let tunnelAgent;
  13801. const overHttps = proxy.proxyUrl.protocol === 'https:';
  13802. if (usingSsl) {
  13803. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  13804. }
  13805. else {
  13806. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  13807. }
  13808. agent = tunnelAgent(agentOptions);
  13809. this._proxyAgent = agent;
  13810. }
  13811. // if reusing agent across request and tunneling agent isn't assigned create a new agent
  13812. if (this._keepAlive && !agent) {
  13813. const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };
  13814. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  13815. this._agent = agent;
  13816. }
  13817. // if not using private agent and tunnel agent isn't setup then use global agent
  13818. if (!agent) {
  13819. agent = usingSsl ? https.globalAgent : http.globalAgent;
  13820. }
  13821. if (usingSsl && this._ignoreSslError) {
  13822. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  13823. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  13824. // we have to cast it to any and change it directly
  13825. agent.options = Object.assign(agent.options || {}, { rejectUnauthorized: false });
  13826. }
  13827. if (usingSsl && this._certConfig) {
  13828. agent.options = Object.assign(agent.options || {}, { ca: this._ca, cert: this._cert, key: this._key, passphrase: this._certConfig.passphrase });
  13829. }
  13830. return agent;
  13831. }
  13832. _getProxy(requestUrl) {
  13833. const parsedUrl = url.parse(requestUrl);
  13834. let usingSsl = parsedUrl.protocol === 'https:';
  13835. let proxyConfig = this._httpProxy;
  13836. // fallback to http_proxy and https_proxy env
  13837. let https_proxy = process.env[EnvironmentVariables.HTTPS_PROXY];
  13838. let http_proxy = process.env[EnvironmentVariables.HTTP_PROXY];
  13839. if (!proxyConfig) {
  13840. if (https_proxy && usingSsl) {
  13841. proxyConfig = {
  13842. proxyUrl: https_proxy
  13843. };
  13844. }
  13845. else if (http_proxy) {
  13846. proxyConfig = {
  13847. proxyUrl: http_proxy
  13848. };
  13849. }
  13850. }
  13851. let proxyUrl;
  13852. let proxyAuth;
  13853. if (proxyConfig) {
  13854. if (proxyConfig.proxyUrl.length > 0) {
  13855. proxyUrl = url.parse(proxyConfig.proxyUrl);
  13856. }
  13857. if (proxyConfig.proxyUsername || proxyConfig.proxyPassword) {
  13858. proxyAuth = proxyConfig.proxyUsername + ":" + proxyConfig.proxyPassword;
  13859. }
  13860. }
  13861. return { proxyUrl: proxyUrl, proxyAuth: proxyAuth };
  13862. }
  13863. _isBypassProxy(requestUrl) {
  13864. if (!this._httpProxyBypassHosts) {
  13865. return false;
  13866. }
  13867. let bypass = false;
  13868. this._httpProxyBypassHosts.forEach(bypassHost => {
  13869. if (bypassHost.test(requestUrl)) {
  13870. bypass = true;
  13871. }
  13872. });
  13873. return bypass;
  13874. }
  13875. _performExponentialBackoff(retryNumber) {
  13876. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  13877. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  13878. return new Promise(resolve => setTimeout(() => resolve(), ms));
  13879. }
  13880. }
  13881. exports.HttpClient = HttpClient;
  13882. /***/ }),
  13883. /***/ 881:
  13884. /***/ (function(module) {
  13885. "use strict";
  13886. const isWin = process.platform === 'win32';
  13887. function notFoundError(original, syscall) {
  13888. return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
  13889. code: 'ENOENT',
  13890. errno: 'ENOENT',
  13891. syscall: `${syscall} ${original.command}`,
  13892. path: original.command,
  13893. spawnargs: original.args,
  13894. });
  13895. }
  13896. function hookChildProcess(cp, parsed) {
  13897. if (!isWin) {
  13898. return;
  13899. }
  13900. const originalEmit = cp.emit;
  13901. cp.emit = function (name, arg1) {
  13902. // If emitting "exit" event and exit code is 1, we need to check if
  13903. // the command exists and emit an "error" instead
  13904. // See https://github.com/IndigoUnited/node-cross-spawn/issues/16
  13905. if (name === 'exit') {
  13906. const err = verifyENOENT(arg1, parsed, 'spawn');
  13907. if (err) {
  13908. return originalEmit.call(cp, 'error', err);
  13909. }
  13910. }
  13911. return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params
  13912. };
  13913. }
  13914. function verifyENOENT(status, parsed) {
  13915. if (isWin && status === 1 && !parsed.file) {
  13916. return notFoundError(parsed.original, 'spawn');
  13917. }
  13918. return null;
  13919. }
  13920. function verifyENOENTSync(status, parsed) {
  13921. if (isWin && status === 1 && !parsed.file) {
  13922. return notFoundError(parsed.original, 'spawnSync');
  13923. }
  13924. return null;
  13925. }
  13926. module.exports = {
  13927. hookChildProcess,
  13928. verifyENOENT,
  13929. verifyENOENTSync,
  13930. notFoundError,
  13931. };
  13932. /***/ }),
  13933. /***/ 883:
  13934. /***/ (function(module) {
  13935. /**
  13936. * lodash (Custom Build) <https://lodash.com/>
  13937. * Build: `lodash modularize exports="npm" -o ./`
  13938. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  13939. * Released under MIT license <https://lodash.com/license>
  13940. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  13941. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  13942. */
  13943. /** Used as the `TypeError` message for "Functions" methods. */
  13944. var FUNC_ERROR_TEXT = 'Expected a function';
  13945. /** Used to stand-in for `undefined` hash values. */
  13946. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  13947. /** Used as references for various `Number` constants. */
  13948. var INFINITY = 1 / 0,
  13949. MAX_SAFE_INTEGER = 9007199254740991;
  13950. /** `Object#toString` result references. */
  13951. var funcTag = '[object Function]',
  13952. genTag = '[object GeneratorFunction]',
  13953. symbolTag = '[object Symbol]';
  13954. /** Used to match property names within property paths. */
  13955. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  13956. reIsPlainProp = /^\w*$/,
  13957. reLeadingDot = /^\./,
  13958. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  13959. /**
  13960. * Used to match `RegExp`
  13961. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  13962. */
  13963. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  13964. /** Used to match backslashes in property paths. */
  13965. var reEscapeChar = /\\(\\)?/g;
  13966. /** Used to detect host constructors (Safari). */
  13967. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  13968. /** Used to detect unsigned integer values. */
  13969. var reIsUint = /^(?:0|[1-9]\d*)$/;
  13970. /** Detect free variable `global` from Node.js. */
  13971. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  13972. /** Detect free variable `self`. */
  13973. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  13974. /** Used as a reference to the global object. */
  13975. var root = freeGlobal || freeSelf || Function('return this')();
  13976. /**
  13977. * Gets the value at `key` of `object`.
  13978. *
  13979. * @private
  13980. * @param {Object} [object] The object to query.
  13981. * @param {string} key The key of the property to get.
  13982. * @returns {*} Returns the property value.
  13983. */
  13984. function getValue(object, key) {
  13985. return object == null ? undefined : object[key];
  13986. }
  13987. /**
  13988. * Checks if `value` is a host object in IE < 9.
  13989. *
  13990. * @private
  13991. * @param {*} value The value to check.
  13992. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  13993. */
  13994. function isHostObject(value) {
  13995. // Many host objects are `Object` objects that can coerce to strings
  13996. // despite having improperly defined `toString` methods.
  13997. var result = false;
  13998. if (value != null && typeof value.toString != 'function') {
  13999. try {
  14000. result = !!(value + '');
  14001. } catch (e) {}
  14002. }
  14003. return result;
  14004. }
  14005. /** Used for built-in method references. */
  14006. var arrayProto = Array.prototype,
  14007. funcProto = Function.prototype,
  14008. objectProto = Object.prototype;
  14009. /** Used to detect overreaching core-js shims. */
  14010. var coreJsData = root['__core-js_shared__'];
  14011. /** Used to detect methods masquerading as native. */
  14012. var maskSrcKey = (function() {
  14013. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  14014. return uid ? ('Symbol(src)_1.' + uid) : '';
  14015. }());
  14016. /** Used to resolve the decompiled source of functions. */
  14017. var funcToString = funcProto.toString;
  14018. /** Used to check objects for own properties. */
  14019. var hasOwnProperty = objectProto.hasOwnProperty;
  14020. /**
  14021. * Used to resolve the
  14022. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  14023. * of values.
  14024. */
  14025. var objectToString = objectProto.toString;
  14026. /** Used to detect if a method is native. */
  14027. var reIsNative = RegExp('^' +
  14028. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  14029. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  14030. );
  14031. /** Built-in value references. */
  14032. var Symbol = root.Symbol,
  14033. splice = arrayProto.splice;
  14034. /* Built-in method references that are verified to be native. */
  14035. var Map = getNative(root, 'Map'),
  14036. nativeCreate = getNative(Object, 'create');
  14037. /** Used to convert symbols to primitives and strings. */
  14038. var symbolProto = Symbol ? Symbol.prototype : undefined,
  14039. symbolToString = symbolProto ? symbolProto.toString : undefined;
  14040. /**
  14041. * Creates a hash object.
  14042. *
  14043. * @private
  14044. * @constructor
  14045. * @param {Array} [entries] The key-value pairs to cache.
  14046. */
  14047. function Hash(entries) {
  14048. var index = -1,
  14049. length = entries ? entries.length : 0;
  14050. this.clear();
  14051. while (++index < length) {
  14052. var entry = entries[index];
  14053. this.set(entry[0], entry[1]);
  14054. }
  14055. }
  14056. /**
  14057. * Removes all key-value entries from the hash.
  14058. *
  14059. * @private
  14060. * @name clear
  14061. * @memberOf Hash
  14062. */
  14063. function hashClear() {
  14064. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  14065. }
  14066. /**
  14067. * Removes `key` and its value from the hash.
  14068. *
  14069. * @private
  14070. * @name delete
  14071. * @memberOf Hash
  14072. * @param {Object} hash The hash to modify.
  14073. * @param {string} key The key of the value to remove.
  14074. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  14075. */
  14076. function hashDelete(key) {
  14077. return this.has(key) && delete this.__data__[key];
  14078. }
  14079. /**
  14080. * Gets the hash value for `key`.
  14081. *
  14082. * @private
  14083. * @name get
  14084. * @memberOf Hash
  14085. * @param {string} key The key of the value to get.
  14086. * @returns {*} Returns the entry value.
  14087. */
  14088. function hashGet(key) {
  14089. var data = this.__data__;
  14090. if (nativeCreate) {
  14091. var result = data[key];
  14092. return result === HASH_UNDEFINED ? undefined : result;
  14093. }
  14094. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  14095. }
  14096. /**
  14097. * Checks if a hash value for `key` exists.
  14098. *
  14099. * @private
  14100. * @name has
  14101. * @memberOf Hash
  14102. * @param {string} key The key of the entry to check.
  14103. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  14104. */
  14105. function hashHas(key) {
  14106. var data = this.__data__;
  14107. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  14108. }
  14109. /**
  14110. * Sets the hash `key` to `value`.
  14111. *
  14112. * @private
  14113. * @name set
  14114. * @memberOf Hash
  14115. * @param {string} key The key of the value to set.
  14116. * @param {*} value The value to set.
  14117. * @returns {Object} Returns the hash instance.
  14118. */
  14119. function hashSet(key, value) {
  14120. var data = this.__data__;
  14121. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  14122. return this;
  14123. }
  14124. // Add methods to `Hash`.
  14125. Hash.prototype.clear = hashClear;
  14126. Hash.prototype['delete'] = hashDelete;
  14127. Hash.prototype.get = hashGet;
  14128. Hash.prototype.has = hashHas;
  14129. Hash.prototype.set = hashSet;
  14130. /**
  14131. * Creates an list cache object.
  14132. *
  14133. * @private
  14134. * @constructor
  14135. * @param {Array} [entries] The key-value pairs to cache.
  14136. */
  14137. function ListCache(entries) {
  14138. var index = -1,
  14139. length = entries ? entries.length : 0;
  14140. this.clear();
  14141. while (++index < length) {
  14142. var entry = entries[index];
  14143. this.set(entry[0], entry[1]);
  14144. }
  14145. }
  14146. /**
  14147. * Removes all key-value entries from the list cache.
  14148. *
  14149. * @private
  14150. * @name clear
  14151. * @memberOf ListCache
  14152. */
  14153. function listCacheClear() {
  14154. this.__data__ = [];
  14155. }
  14156. /**
  14157. * Removes `key` and its value from the list cache.
  14158. *
  14159. * @private
  14160. * @name delete
  14161. * @memberOf ListCache
  14162. * @param {string} key The key of the value to remove.
  14163. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  14164. */
  14165. function listCacheDelete(key) {
  14166. var data = this.__data__,
  14167. index = assocIndexOf(data, key);
  14168. if (index < 0) {
  14169. return false;
  14170. }
  14171. var lastIndex = data.length - 1;
  14172. if (index == lastIndex) {
  14173. data.pop();
  14174. } else {
  14175. splice.call(data, index, 1);
  14176. }
  14177. return true;
  14178. }
  14179. /**
  14180. * Gets the list cache value for `key`.
  14181. *
  14182. * @private
  14183. * @name get
  14184. * @memberOf ListCache
  14185. * @param {string} key The key of the value to get.
  14186. * @returns {*} Returns the entry value.
  14187. */
  14188. function listCacheGet(key) {
  14189. var data = this.__data__,
  14190. index = assocIndexOf(data, key);
  14191. return index < 0 ? undefined : data[index][1];
  14192. }
  14193. /**
  14194. * Checks if a list cache value for `key` exists.
  14195. *
  14196. * @private
  14197. * @name has
  14198. * @memberOf ListCache
  14199. * @param {string} key The key of the entry to check.
  14200. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  14201. */
  14202. function listCacheHas(key) {
  14203. return assocIndexOf(this.__data__, key) > -1;
  14204. }
  14205. /**
  14206. * Sets the list cache `key` to `value`.
  14207. *
  14208. * @private
  14209. * @name set
  14210. * @memberOf ListCache
  14211. * @param {string} key The key of the value to set.
  14212. * @param {*} value The value to set.
  14213. * @returns {Object} Returns the list cache instance.
  14214. */
  14215. function listCacheSet(key, value) {
  14216. var data = this.__data__,
  14217. index = assocIndexOf(data, key);
  14218. if (index < 0) {
  14219. data.push([key, value]);
  14220. } else {
  14221. data[index][1] = value;
  14222. }
  14223. return this;
  14224. }
  14225. // Add methods to `ListCache`.
  14226. ListCache.prototype.clear = listCacheClear;
  14227. ListCache.prototype['delete'] = listCacheDelete;
  14228. ListCache.prototype.get = listCacheGet;
  14229. ListCache.prototype.has = listCacheHas;
  14230. ListCache.prototype.set = listCacheSet;
  14231. /**
  14232. * Creates a map cache object to store key-value pairs.
  14233. *
  14234. * @private
  14235. * @constructor
  14236. * @param {Array} [entries] The key-value pairs to cache.
  14237. */
  14238. function MapCache(entries) {
  14239. var index = -1,
  14240. length = entries ? entries.length : 0;
  14241. this.clear();
  14242. while (++index < length) {
  14243. var entry = entries[index];
  14244. this.set(entry[0], entry[1]);
  14245. }
  14246. }
  14247. /**
  14248. * Removes all key-value entries from the map.
  14249. *
  14250. * @private
  14251. * @name clear
  14252. * @memberOf MapCache
  14253. */
  14254. function mapCacheClear() {
  14255. this.__data__ = {
  14256. 'hash': new Hash,
  14257. 'map': new (Map || ListCache),
  14258. 'string': new Hash
  14259. };
  14260. }
  14261. /**
  14262. * Removes `key` and its value from the map.
  14263. *
  14264. * @private
  14265. * @name delete
  14266. * @memberOf MapCache
  14267. * @param {string} key The key of the value to remove.
  14268. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  14269. */
  14270. function mapCacheDelete(key) {
  14271. return getMapData(this, key)['delete'](key);
  14272. }
  14273. /**
  14274. * Gets the map value for `key`.
  14275. *
  14276. * @private
  14277. * @name get
  14278. * @memberOf MapCache
  14279. * @param {string} key The key of the value to get.
  14280. * @returns {*} Returns the entry value.
  14281. */
  14282. function mapCacheGet(key) {
  14283. return getMapData(this, key).get(key);
  14284. }
  14285. /**
  14286. * Checks if a map value for `key` exists.
  14287. *
  14288. * @private
  14289. * @name has
  14290. * @memberOf MapCache
  14291. * @param {string} key The key of the entry to check.
  14292. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  14293. */
  14294. function mapCacheHas(key) {
  14295. return getMapData(this, key).has(key);
  14296. }
  14297. /**
  14298. * Sets the map `key` to `value`.
  14299. *
  14300. * @private
  14301. * @name set
  14302. * @memberOf MapCache
  14303. * @param {string} key The key of the value to set.
  14304. * @param {*} value The value to set.
  14305. * @returns {Object} Returns the map cache instance.
  14306. */
  14307. function mapCacheSet(key, value) {
  14308. getMapData(this, key).set(key, value);
  14309. return this;
  14310. }
  14311. // Add methods to `MapCache`.
  14312. MapCache.prototype.clear = mapCacheClear;
  14313. MapCache.prototype['delete'] = mapCacheDelete;
  14314. MapCache.prototype.get = mapCacheGet;
  14315. MapCache.prototype.has = mapCacheHas;
  14316. MapCache.prototype.set = mapCacheSet;
  14317. /**
  14318. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  14319. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  14320. * for equality comparisons.
  14321. *
  14322. * @private
  14323. * @param {Object} object The object to modify.
  14324. * @param {string} key The key of the property to assign.
  14325. * @param {*} value The value to assign.
  14326. */
  14327. function assignValue(object, key, value) {
  14328. var objValue = object[key];
  14329. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  14330. (value === undefined && !(key in object))) {
  14331. object[key] = value;
  14332. }
  14333. }
  14334. /**
  14335. * Gets the index at which the `key` is found in `array` of key-value pairs.
  14336. *
  14337. * @private
  14338. * @param {Array} array The array to inspect.
  14339. * @param {*} key The key to search for.
  14340. * @returns {number} Returns the index of the matched value, else `-1`.
  14341. */
  14342. function assocIndexOf(array, key) {
  14343. var length = array.length;
  14344. while (length--) {
  14345. if (eq(array[length][0], key)) {
  14346. return length;
  14347. }
  14348. }
  14349. return -1;
  14350. }
  14351. /**
  14352. * The base implementation of `_.isNative` without bad shim checks.
  14353. *
  14354. * @private
  14355. * @param {*} value The value to check.
  14356. * @returns {boolean} Returns `true` if `value` is a native function,
  14357. * else `false`.
  14358. */
  14359. function baseIsNative(value) {
  14360. if (!isObject(value) || isMasked(value)) {
  14361. return false;
  14362. }
  14363. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  14364. return pattern.test(toSource(value));
  14365. }
  14366. /**
  14367. * The base implementation of `_.set`.
  14368. *
  14369. * @private
  14370. * @param {Object} object The object to modify.
  14371. * @param {Array|string} path The path of the property to set.
  14372. * @param {*} value The value to set.
  14373. * @param {Function} [customizer] The function to customize path creation.
  14374. * @returns {Object} Returns `object`.
  14375. */
  14376. function baseSet(object, path, value, customizer) {
  14377. if (!isObject(object)) {
  14378. return object;
  14379. }
  14380. path = isKey(path, object) ? [path] : castPath(path);
  14381. var index = -1,
  14382. length = path.length,
  14383. lastIndex = length - 1,
  14384. nested = object;
  14385. while (nested != null && ++index < length) {
  14386. var key = toKey(path[index]),
  14387. newValue = value;
  14388. if (index != lastIndex) {
  14389. var objValue = nested[key];
  14390. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  14391. if (newValue === undefined) {
  14392. newValue = isObject(objValue)
  14393. ? objValue
  14394. : (isIndex(path[index + 1]) ? [] : {});
  14395. }
  14396. }
  14397. assignValue(nested, key, newValue);
  14398. nested = nested[key];
  14399. }
  14400. return object;
  14401. }
  14402. /**
  14403. * The base implementation of `_.toString` which doesn't convert nullish
  14404. * values to empty strings.
  14405. *
  14406. * @private
  14407. * @param {*} value The value to process.
  14408. * @returns {string} Returns the string.
  14409. */
  14410. function baseToString(value) {
  14411. // Exit early for strings to avoid a performance hit in some environments.
  14412. if (typeof value == 'string') {
  14413. return value;
  14414. }
  14415. if (isSymbol(value)) {
  14416. return symbolToString ? symbolToString.call(value) : '';
  14417. }
  14418. var result = (value + '');
  14419. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  14420. }
  14421. /**
  14422. * Casts `value` to a path array if it's not one.
  14423. *
  14424. * @private
  14425. * @param {*} value The value to inspect.
  14426. * @returns {Array} Returns the cast property path array.
  14427. */
  14428. function castPath(value) {
  14429. return isArray(value) ? value : stringToPath(value);
  14430. }
  14431. /**
  14432. * Gets the data for `map`.
  14433. *
  14434. * @private
  14435. * @param {Object} map The map to query.
  14436. * @param {string} key The reference key.
  14437. * @returns {*} Returns the map data.
  14438. */
  14439. function getMapData(map, key) {
  14440. var data = map.__data__;
  14441. return isKeyable(key)
  14442. ? data[typeof key == 'string' ? 'string' : 'hash']
  14443. : data.map;
  14444. }
  14445. /**
  14446. * Gets the native function at `key` of `object`.
  14447. *
  14448. * @private
  14449. * @param {Object} object The object to query.
  14450. * @param {string} key The key of the method to get.
  14451. * @returns {*} Returns the function if it's native, else `undefined`.
  14452. */
  14453. function getNative(object, key) {
  14454. var value = getValue(object, key);
  14455. return baseIsNative(value) ? value : undefined;
  14456. }
  14457. /**
  14458. * Checks if `value` is a valid array-like index.
  14459. *
  14460. * @private
  14461. * @param {*} value The value to check.
  14462. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  14463. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  14464. */
  14465. function isIndex(value, length) {
  14466. length = length == null ? MAX_SAFE_INTEGER : length;
  14467. return !!length &&
  14468. (typeof value == 'number' || reIsUint.test(value)) &&
  14469. (value > -1 && value % 1 == 0 && value < length);
  14470. }
  14471. /**
  14472. * Checks if `value` is a property name and not a property path.
  14473. *
  14474. * @private
  14475. * @param {*} value The value to check.
  14476. * @param {Object} [object] The object to query keys on.
  14477. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  14478. */
  14479. function isKey(value, object) {
  14480. if (isArray(value)) {
  14481. return false;
  14482. }
  14483. var type = typeof value;
  14484. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  14485. value == null || isSymbol(value)) {
  14486. return true;
  14487. }
  14488. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  14489. (object != null && value in Object(object));
  14490. }
  14491. /**
  14492. * Checks if `value` is suitable for use as unique object key.
  14493. *
  14494. * @private
  14495. * @param {*} value The value to check.
  14496. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  14497. */
  14498. function isKeyable(value) {
  14499. var type = typeof value;
  14500. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  14501. ? (value !== '__proto__')
  14502. : (value === null);
  14503. }
  14504. /**
  14505. * Checks if `func` has its source masked.
  14506. *
  14507. * @private
  14508. * @param {Function} func The function to check.
  14509. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  14510. */
  14511. function isMasked(func) {
  14512. return !!maskSrcKey && (maskSrcKey in func);
  14513. }
  14514. /**
  14515. * Converts `string` to a property path array.
  14516. *
  14517. * @private
  14518. * @param {string} string The string to convert.
  14519. * @returns {Array} Returns the property path array.
  14520. */
  14521. var stringToPath = memoize(function(string) {
  14522. string = toString(string);
  14523. var result = [];
  14524. if (reLeadingDot.test(string)) {
  14525. result.push('');
  14526. }
  14527. string.replace(rePropName, function(match, number, quote, string) {
  14528. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  14529. });
  14530. return result;
  14531. });
  14532. /**
  14533. * Converts `value` to a string key if it's not a string or symbol.
  14534. *
  14535. * @private
  14536. * @param {*} value The value to inspect.
  14537. * @returns {string|symbol} Returns the key.
  14538. */
  14539. function toKey(value) {
  14540. if (typeof value == 'string' || isSymbol(value)) {
  14541. return value;
  14542. }
  14543. var result = (value + '');
  14544. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  14545. }
  14546. /**
  14547. * Converts `func` to its source code.
  14548. *
  14549. * @private
  14550. * @param {Function} func The function to process.
  14551. * @returns {string} Returns the source code.
  14552. */
  14553. function toSource(func) {
  14554. if (func != null) {
  14555. try {
  14556. return funcToString.call(func);
  14557. } catch (e) {}
  14558. try {
  14559. return (func + '');
  14560. } catch (e) {}
  14561. }
  14562. return '';
  14563. }
  14564. /**
  14565. * Creates a function that memoizes the result of `func`. If `resolver` is
  14566. * provided, it determines the cache key for storing the result based on the
  14567. * arguments provided to the memoized function. By default, the first argument
  14568. * provided to the memoized function is used as the map cache key. The `func`
  14569. * is invoked with the `this` binding of the memoized function.
  14570. *
  14571. * **Note:** The cache is exposed as the `cache` property on the memoized
  14572. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  14573. * constructor with one whose instances implement the
  14574. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  14575. * method interface of `delete`, `get`, `has`, and `set`.
  14576. *
  14577. * @static
  14578. * @memberOf _
  14579. * @since 0.1.0
  14580. * @category Function
  14581. * @param {Function} func The function to have its output memoized.
  14582. * @param {Function} [resolver] The function to resolve the cache key.
  14583. * @returns {Function} Returns the new memoized function.
  14584. * @example
  14585. *
  14586. * var object = { 'a': 1, 'b': 2 };
  14587. * var other = { 'c': 3, 'd': 4 };
  14588. *
  14589. * var values = _.memoize(_.values);
  14590. * values(object);
  14591. * // => [1, 2]
  14592. *
  14593. * values(other);
  14594. * // => [3, 4]
  14595. *
  14596. * object.a = 2;
  14597. * values(object);
  14598. * // => [1, 2]
  14599. *
  14600. * // Modify the result cache.
  14601. * values.cache.set(object, ['a', 'b']);
  14602. * values(object);
  14603. * // => ['a', 'b']
  14604. *
  14605. * // Replace `_.memoize.Cache`.
  14606. * _.memoize.Cache = WeakMap;
  14607. */
  14608. function memoize(func, resolver) {
  14609. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  14610. throw new TypeError(FUNC_ERROR_TEXT);
  14611. }
  14612. var memoized = function() {
  14613. var args = arguments,
  14614. key = resolver ? resolver.apply(this, args) : args[0],
  14615. cache = memoized.cache;
  14616. if (cache.has(key)) {
  14617. return cache.get(key);
  14618. }
  14619. var result = func.apply(this, args);
  14620. memoized.cache = cache.set(key, result);
  14621. return result;
  14622. };
  14623. memoized.cache = new (memoize.Cache || MapCache);
  14624. return memoized;
  14625. }
  14626. // Assign cache to `_.memoize`.
  14627. memoize.Cache = MapCache;
  14628. /**
  14629. * Performs a
  14630. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  14631. * comparison between two values to determine if they are equivalent.
  14632. *
  14633. * @static
  14634. * @memberOf _
  14635. * @since 4.0.0
  14636. * @category Lang
  14637. * @param {*} value The value to compare.
  14638. * @param {*} other The other value to compare.
  14639. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  14640. * @example
  14641. *
  14642. * var object = { 'a': 1 };
  14643. * var other = { 'a': 1 };
  14644. *
  14645. * _.eq(object, object);
  14646. * // => true
  14647. *
  14648. * _.eq(object, other);
  14649. * // => false
  14650. *
  14651. * _.eq('a', 'a');
  14652. * // => true
  14653. *
  14654. * _.eq('a', Object('a'));
  14655. * // => false
  14656. *
  14657. * _.eq(NaN, NaN);
  14658. * // => true
  14659. */
  14660. function eq(value, other) {
  14661. return value === other || (value !== value && other !== other);
  14662. }
  14663. /**
  14664. * Checks if `value` is classified as an `Array` object.
  14665. *
  14666. * @static
  14667. * @memberOf _
  14668. * @since 0.1.0
  14669. * @category Lang
  14670. * @param {*} value The value to check.
  14671. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  14672. * @example
  14673. *
  14674. * _.isArray([1, 2, 3]);
  14675. * // => true
  14676. *
  14677. * _.isArray(document.body.children);
  14678. * // => false
  14679. *
  14680. * _.isArray('abc');
  14681. * // => false
  14682. *
  14683. * _.isArray(_.noop);
  14684. * // => false
  14685. */
  14686. var isArray = Array.isArray;
  14687. /**
  14688. * Checks if `value` is classified as a `Function` object.
  14689. *
  14690. * @static
  14691. * @memberOf _
  14692. * @since 0.1.0
  14693. * @category Lang
  14694. * @param {*} value The value to check.
  14695. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  14696. * @example
  14697. *
  14698. * _.isFunction(_);
  14699. * // => true
  14700. *
  14701. * _.isFunction(/abc/);
  14702. * // => false
  14703. */
  14704. function isFunction(value) {
  14705. // The use of `Object#toString` avoids issues with the `typeof` operator
  14706. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  14707. var tag = isObject(value) ? objectToString.call(value) : '';
  14708. return tag == funcTag || tag == genTag;
  14709. }
  14710. /**
  14711. * Checks if `value` is the
  14712. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  14713. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  14714. *
  14715. * @static
  14716. * @memberOf _
  14717. * @since 0.1.0
  14718. * @category Lang
  14719. * @param {*} value The value to check.
  14720. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  14721. * @example
  14722. *
  14723. * _.isObject({});
  14724. * // => true
  14725. *
  14726. * _.isObject([1, 2, 3]);
  14727. * // => true
  14728. *
  14729. * _.isObject(_.noop);
  14730. * // => true
  14731. *
  14732. * _.isObject(null);
  14733. * // => false
  14734. */
  14735. function isObject(value) {
  14736. var type = typeof value;
  14737. return !!value && (type == 'object' || type == 'function');
  14738. }
  14739. /**
  14740. * Checks if `value` is object-like. A value is object-like if it's not `null`
  14741. * and has a `typeof` result of "object".
  14742. *
  14743. * @static
  14744. * @memberOf _
  14745. * @since 4.0.0
  14746. * @category Lang
  14747. * @param {*} value The value to check.
  14748. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  14749. * @example
  14750. *
  14751. * _.isObjectLike({});
  14752. * // => true
  14753. *
  14754. * _.isObjectLike([1, 2, 3]);
  14755. * // => true
  14756. *
  14757. * _.isObjectLike(_.noop);
  14758. * // => false
  14759. *
  14760. * _.isObjectLike(null);
  14761. * // => false
  14762. */
  14763. function isObjectLike(value) {
  14764. return !!value && typeof value == 'object';
  14765. }
  14766. /**
  14767. * Checks if `value` is classified as a `Symbol` primitive or object.
  14768. *
  14769. * @static
  14770. * @memberOf _
  14771. * @since 4.0.0
  14772. * @category Lang
  14773. * @param {*} value The value to check.
  14774. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  14775. * @example
  14776. *
  14777. * _.isSymbol(Symbol.iterator);
  14778. * // => true
  14779. *
  14780. * _.isSymbol('abc');
  14781. * // => false
  14782. */
  14783. function isSymbol(value) {
  14784. return typeof value == 'symbol' ||
  14785. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  14786. }
  14787. /**
  14788. * Converts `value` to a string. An empty string is returned for `null`
  14789. * and `undefined` values. The sign of `-0` is preserved.
  14790. *
  14791. * @static
  14792. * @memberOf _
  14793. * @since 4.0.0
  14794. * @category Lang
  14795. * @param {*} value The value to process.
  14796. * @returns {string} Returns the string.
  14797. * @example
  14798. *
  14799. * _.toString(null);
  14800. * // => ''
  14801. *
  14802. * _.toString(-0);
  14803. * // => '-0'
  14804. *
  14805. * _.toString([1, 2, 3]);
  14806. * // => '1,2,3'
  14807. */
  14808. function toString(value) {
  14809. return value == null ? '' : baseToString(value);
  14810. }
  14811. /**
  14812. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  14813. * it's created. Arrays are created for missing index properties while objects
  14814. * are created for all other missing properties. Use `_.setWith` to customize
  14815. * `path` creation.
  14816. *
  14817. * **Note:** This method mutates `object`.
  14818. *
  14819. * @static
  14820. * @memberOf _
  14821. * @since 3.7.0
  14822. * @category Object
  14823. * @param {Object} object The object to modify.
  14824. * @param {Array|string} path The path of the property to set.
  14825. * @param {*} value The value to set.
  14826. * @returns {Object} Returns `object`.
  14827. * @example
  14828. *
  14829. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14830. *
  14831. * _.set(object, 'a[0].b.c', 4);
  14832. * console.log(object.a[0].b.c);
  14833. * // => 4
  14834. *
  14835. * _.set(object, ['x', '0', 'y', 'z'], 5);
  14836. * console.log(object.x[0].y.z);
  14837. * // => 5
  14838. */
  14839. function set(object, path, value) {
  14840. return object == null ? object : baseSet(object, path, value);
  14841. }
  14842. module.exports = set;
  14843. /***/ }),
  14844. /***/ 898:
  14845. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  14846. "use strict";
  14847. Object.defineProperty(exports, '__esModule', { value: true });
  14848. var request = __webpack_require__(753);
  14849. var universalUserAgent = __webpack_require__(796);
  14850. const VERSION = "4.3.1";
  14851. class GraphqlError extends Error {
  14852. constructor(request, response) {
  14853. const message = response.data.errors[0].message;
  14854. super(message);
  14855. Object.assign(this, response.data);
  14856. this.name = "GraphqlError";
  14857. this.request = request; // Maintains proper stack trace (only available on V8)
  14858. /* istanbul ignore next */
  14859. if (Error.captureStackTrace) {
  14860. Error.captureStackTrace(this, this.constructor);
  14861. }
  14862. }
  14863. }
  14864. const NON_VARIABLE_OPTIONS = ["method", "baseUrl", "url", "headers", "request", "query"];
  14865. function graphql(request, query, options) {
  14866. options = typeof query === "string" ? options = Object.assign({
  14867. query
  14868. }, options) : options = query;
  14869. const requestOptions = Object.keys(options).reduce((result, key) => {
  14870. if (NON_VARIABLE_OPTIONS.includes(key)) {
  14871. result[key] = options[key];
  14872. return result;
  14873. }
  14874. if (!result.variables) {
  14875. result.variables = {};
  14876. }
  14877. result.variables[key] = options[key];
  14878. return result;
  14879. }, {});
  14880. return request(requestOptions).then(response => {
  14881. if (response.data.errors) {
  14882. throw new GraphqlError(requestOptions, {
  14883. data: response.data
  14884. });
  14885. }
  14886. return response.data.data;
  14887. });
  14888. }
  14889. function withDefaults(request$1, newDefaults) {
  14890. const newRequest = request$1.defaults(newDefaults);
  14891. const newApi = (query, options) => {
  14892. return graphql(newRequest, query, options);
  14893. };
  14894. return Object.assign(newApi, {
  14895. defaults: withDefaults.bind(null, newRequest),
  14896. endpoint: request.request.endpoint
  14897. });
  14898. }
  14899. const graphql$1 = withDefaults(request.request, {
  14900. headers: {
  14901. "user-agent": `octokit-graphql.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  14902. },
  14903. method: "POST",
  14904. url: "/graphql"
  14905. });
  14906. function withCustomRequest(customRequest) {
  14907. return withDefaults(customRequest, {
  14908. method: "POST",
  14909. url: "/graphql"
  14910. });
  14911. }
  14912. exports.graphql = graphql$1;
  14913. exports.withCustomRequest = withCustomRequest;
  14914. //# sourceMappingURL=index.js.map
  14915. /***/ }),
  14916. /***/ 899:
  14917. /***/ (function(module, __unusedexports, __webpack_require__) {
  14918. module.exports = registerEndpoints;
  14919. const { Deprecation } = __webpack_require__(692);
  14920. function registerEndpoints(octokit, routes) {
  14921. Object.keys(routes).forEach(namespaceName => {
  14922. if (!octokit[namespaceName]) {
  14923. octokit[namespaceName] = {};
  14924. }
  14925. Object.keys(routes[namespaceName]).forEach(apiName => {
  14926. const apiOptions = routes[namespaceName][apiName];
  14927. const endpointDefaults = ["method", "url", "headers"].reduce(
  14928. (map, key) => {
  14929. if (typeof apiOptions[key] !== "undefined") {
  14930. map[key] = apiOptions[key];
  14931. }
  14932. return map;
  14933. },
  14934. {}
  14935. );
  14936. endpointDefaults.request = {
  14937. validate: apiOptions.params
  14938. };
  14939. let request = octokit.request.defaults(endpointDefaults);
  14940. // patch request & endpoint methods to support deprecated parameters.
  14941. // Not the most elegant solution, but we don’t want to move deprecation
  14942. // logic into octokit/endpoint.js as it’s out of scope
  14943. const hasDeprecatedParam = Object.keys(apiOptions.params || {}).find(
  14944. key => apiOptions.params[key].deprecated
  14945. );
  14946. if (hasDeprecatedParam) {
  14947. const patch = patchForDeprecation.bind(null, octokit, apiOptions);
  14948. request = patch(
  14949. octokit.request.defaults(endpointDefaults),
  14950. `.${namespaceName}.${apiName}()`
  14951. );
  14952. request.endpoint = patch(
  14953. request.endpoint,
  14954. `.${namespaceName}.${apiName}.endpoint()`
  14955. );
  14956. request.endpoint.merge = patch(
  14957. request.endpoint.merge,
  14958. `.${namespaceName}.${apiName}.endpoint.merge()`
  14959. );
  14960. }
  14961. if (apiOptions.deprecated) {
  14962. octokit[namespaceName][apiName] = function deprecatedEndpointMethod() {
  14963. octokit.log.warn(
  14964. new Deprecation(`[@octokit/rest] ${apiOptions.deprecated}`)
  14965. );
  14966. octokit[namespaceName][apiName] = request;
  14967. return request.apply(null, arguments);
  14968. };
  14969. return;
  14970. }
  14971. octokit[namespaceName][apiName] = request;
  14972. });
  14973. });
  14974. }
  14975. function patchForDeprecation(octokit, apiOptions, method, methodName) {
  14976. const patchedMethod = options => {
  14977. options = Object.assign({}, options);
  14978. Object.keys(options).forEach(key => {
  14979. if (apiOptions.params[key] && apiOptions.params[key].deprecated) {
  14980. const aliasKey = apiOptions.params[key].alias;
  14981. octokit.log.warn(
  14982. new Deprecation(
  14983. `[@octokit/rest] "${key}" parameter is deprecated for "${methodName}". Use "${aliasKey}" instead`
  14984. )
  14985. );
  14986. if (!(aliasKey in options)) {
  14987. options[aliasKey] = options[key];
  14988. }
  14989. delete options[key];
  14990. }
  14991. });
  14992. return method(options);
  14993. };
  14994. Object.keys(method).forEach(key => {
  14995. patchedMethod[key] = method[key];
  14996. });
  14997. return patchedMethod;
  14998. }
  14999. /***/ }),
  15000. /***/ 929:
  15001. /***/ (function(module, __unusedexports, __webpack_require__) {
  15002. module.exports = hasNextPage
  15003. const deprecate = __webpack_require__(370)
  15004. const getPageLinks = __webpack_require__(577)
  15005. function hasNextPage (link) {
  15006. deprecate(`octokit.hasNextPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  15007. return getPageLinks(link).next
  15008. }
  15009. /***/ }),
  15010. /***/ 948:
  15011. /***/ (function(module) {
  15012. "use strict";
  15013. /**
  15014. * Tries to execute a function and discards any error that occurs.
  15015. * @param {Function} fn - Function that might or might not throw an error.
  15016. * @returns {?*} Return-value of the function when no error occurred.
  15017. */
  15018. module.exports = function(fn) {
  15019. try { return fn() } catch (e) {}
  15020. }
  15021. /***/ }),
  15022. /***/ 954:
  15023. /***/ (function(module) {
  15024. module.exports = validateAuth;
  15025. function validateAuth(auth) {
  15026. if (typeof auth === "string") {
  15027. return;
  15028. }
  15029. if (typeof auth === "function") {
  15030. return;
  15031. }
  15032. if (auth.username && auth.password) {
  15033. return;
  15034. }
  15035. if (auth.clientId && auth.clientSecret) {
  15036. return;
  15037. }
  15038. throw new Error(`Invalid "auth" option: ${JSON.stringify(auth)}`);
  15039. }
  15040. /***/ }),
  15041. /***/ 955:
  15042. /***/ (function(module, __unusedexports, __webpack_require__) {
  15043. "use strict";
  15044. const path = __webpack_require__(622);
  15045. const childProcess = __webpack_require__(129);
  15046. const crossSpawn = __webpack_require__(20);
  15047. const stripEof = __webpack_require__(768);
  15048. const npmRunPath = __webpack_require__(621);
  15049. const isStream = __webpack_require__(323);
  15050. const _getStream = __webpack_require__(145);
  15051. const pFinally = __webpack_require__(697);
  15052. const onExit = __webpack_require__(260);
  15053. const errname = __webpack_require__(427);
  15054. const stdio = __webpack_require__(168);
  15055. const TEN_MEGABYTES = 1000 * 1000 * 10;
  15056. function handleArgs(cmd, args, opts) {
  15057. let parsed;
  15058. opts = Object.assign({
  15059. extendEnv: true,
  15060. env: {}
  15061. }, opts);
  15062. if (opts.extendEnv) {
  15063. opts.env = Object.assign({}, process.env, opts.env);
  15064. }
  15065. if (opts.__winShell === true) {
  15066. delete opts.__winShell;
  15067. parsed = {
  15068. command: cmd,
  15069. args,
  15070. options: opts,
  15071. file: cmd,
  15072. original: {
  15073. cmd,
  15074. args
  15075. }
  15076. };
  15077. } else {
  15078. parsed = crossSpawn._parse(cmd, args, opts);
  15079. }
  15080. opts = Object.assign({
  15081. maxBuffer: TEN_MEGABYTES,
  15082. buffer: true,
  15083. stripEof: true,
  15084. preferLocal: true,
  15085. localDir: parsed.options.cwd || process.cwd(),
  15086. encoding: 'utf8',
  15087. reject: true,
  15088. cleanup: true
  15089. }, parsed.options);
  15090. opts.stdio = stdio(opts);
  15091. if (opts.preferLocal) {
  15092. opts.env = npmRunPath.env(Object.assign({}, opts, {cwd: opts.localDir}));
  15093. }
  15094. if (opts.detached) {
  15095. // #115
  15096. opts.cleanup = false;
  15097. }
  15098. if (process.platform === 'win32' && path.basename(parsed.command) === 'cmd.exe') {
  15099. // #116
  15100. parsed.args.unshift('/q');
  15101. }
  15102. return {
  15103. cmd: parsed.command,
  15104. args: parsed.args,
  15105. opts,
  15106. parsed
  15107. };
  15108. }
  15109. function handleInput(spawned, input) {
  15110. if (input === null || input === undefined) {
  15111. return;
  15112. }
  15113. if (isStream(input)) {
  15114. input.pipe(spawned.stdin);
  15115. } else {
  15116. spawned.stdin.end(input);
  15117. }
  15118. }
  15119. function handleOutput(opts, val) {
  15120. if (val && opts.stripEof) {
  15121. val = stripEof(val);
  15122. }
  15123. return val;
  15124. }
  15125. function handleShell(fn, cmd, opts) {
  15126. let file = '/bin/sh';
  15127. let args = ['-c', cmd];
  15128. opts = Object.assign({}, opts);
  15129. if (process.platform === 'win32') {
  15130. opts.__winShell = true;
  15131. file = process.env.comspec || 'cmd.exe';
  15132. args = ['/s', '/c', `"${cmd}"`];
  15133. opts.windowsVerbatimArguments = true;
  15134. }
  15135. if (opts.shell) {
  15136. file = opts.shell;
  15137. delete opts.shell;
  15138. }
  15139. return fn(file, args, opts);
  15140. }
  15141. function getStream(process, stream, {encoding, buffer, maxBuffer}) {
  15142. if (!process[stream]) {
  15143. return null;
  15144. }
  15145. let ret;
  15146. if (!buffer) {
  15147. // TODO: Use `ret = util.promisify(stream.finished)(process[stream]);` when targeting Node.js 10
  15148. ret = new Promise((resolve, reject) => {
  15149. process[stream]
  15150. .once('end', resolve)
  15151. .once('error', reject);
  15152. });
  15153. } else if (encoding) {
  15154. ret = _getStream(process[stream], {
  15155. encoding,
  15156. maxBuffer
  15157. });
  15158. } else {
  15159. ret = _getStream.buffer(process[stream], {maxBuffer});
  15160. }
  15161. return ret.catch(err => {
  15162. err.stream = stream;
  15163. err.message = `${stream} ${err.message}`;
  15164. throw err;
  15165. });
  15166. }
  15167. function makeError(result, options) {
  15168. const {stdout, stderr} = result;
  15169. let err = result.error;
  15170. const {code, signal} = result;
  15171. const {parsed, joinedCmd} = options;
  15172. const timedOut = options.timedOut || false;
  15173. if (!err) {
  15174. let output = '';
  15175. if (Array.isArray(parsed.opts.stdio)) {
  15176. if (parsed.opts.stdio[2] !== 'inherit') {
  15177. output += output.length > 0 ? stderr : `\n${stderr}`;
  15178. }
  15179. if (parsed.opts.stdio[1] !== 'inherit') {
  15180. output += `\n${stdout}`;
  15181. }
  15182. } else if (parsed.opts.stdio !== 'inherit') {
  15183. output = `\n${stderr}${stdout}`;
  15184. }
  15185. err = new Error(`Command failed: ${joinedCmd}${output}`);
  15186. err.code = code < 0 ? errname(code) : code;
  15187. }
  15188. err.stdout = stdout;
  15189. err.stderr = stderr;
  15190. err.failed = true;
  15191. err.signal = signal || null;
  15192. err.cmd = joinedCmd;
  15193. err.timedOut = timedOut;
  15194. return err;
  15195. }
  15196. function joinCmd(cmd, args) {
  15197. let joinedCmd = cmd;
  15198. if (Array.isArray(args) && args.length > 0) {
  15199. joinedCmd += ' ' + args.join(' ');
  15200. }
  15201. return joinedCmd;
  15202. }
  15203. module.exports = (cmd, args, opts) => {
  15204. const parsed = handleArgs(cmd, args, opts);
  15205. const {encoding, buffer, maxBuffer} = parsed.opts;
  15206. const joinedCmd = joinCmd(cmd, args);
  15207. let spawned;
  15208. try {
  15209. spawned = childProcess.spawn(parsed.cmd, parsed.args, parsed.opts);
  15210. } catch (err) {
  15211. return Promise.reject(err);
  15212. }
  15213. let removeExitHandler;
  15214. if (parsed.opts.cleanup) {
  15215. removeExitHandler = onExit(() => {
  15216. spawned.kill();
  15217. });
  15218. }
  15219. let timeoutId = null;
  15220. let timedOut = false;
  15221. const cleanup = () => {
  15222. if (timeoutId) {
  15223. clearTimeout(timeoutId);
  15224. timeoutId = null;
  15225. }
  15226. if (removeExitHandler) {
  15227. removeExitHandler();
  15228. }
  15229. };
  15230. if (parsed.opts.timeout > 0) {
  15231. timeoutId = setTimeout(() => {
  15232. timeoutId = null;
  15233. timedOut = true;
  15234. spawned.kill(parsed.opts.killSignal);
  15235. }, parsed.opts.timeout);
  15236. }
  15237. const processDone = new Promise(resolve => {
  15238. spawned.on('exit', (code, signal) => {
  15239. cleanup();
  15240. resolve({code, signal});
  15241. });
  15242. spawned.on('error', err => {
  15243. cleanup();
  15244. resolve({error: err});
  15245. });
  15246. if (spawned.stdin) {
  15247. spawned.stdin.on('error', err => {
  15248. cleanup();
  15249. resolve({error: err});
  15250. });
  15251. }
  15252. });
  15253. function destroy() {
  15254. if (spawned.stdout) {
  15255. spawned.stdout.destroy();
  15256. }
  15257. if (spawned.stderr) {
  15258. spawned.stderr.destroy();
  15259. }
  15260. }
  15261. const handlePromise = () => pFinally(Promise.all([
  15262. processDone,
  15263. getStream(spawned, 'stdout', {encoding, buffer, maxBuffer}),
  15264. getStream(spawned, 'stderr', {encoding, buffer, maxBuffer})
  15265. ]).then(arr => {
  15266. const result = arr[0];
  15267. result.stdout = arr[1];
  15268. result.stderr = arr[2];
  15269. if (result.error || result.code !== 0 || result.signal !== null) {
  15270. const err = makeError(result, {
  15271. joinedCmd,
  15272. parsed,
  15273. timedOut
  15274. });
  15275. // TODO: missing some timeout logic for killed
  15276. // https://github.com/nodejs/node/blob/master/lib/child_process.js#L203
  15277. // err.killed = spawned.killed || killed;
  15278. err.killed = err.killed || spawned.killed;
  15279. if (!parsed.opts.reject) {
  15280. return err;
  15281. }
  15282. throw err;
  15283. }
  15284. return {
  15285. stdout: handleOutput(parsed.opts, result.stdout),
  15286. stderr: handleOutput(parsed.opts, result.stderr),
  15287. code: 0,
  15288. failed: false,
  15289. killed: false,
  15290. signal: null,
  15291. cmd: joinedCmd,
  15292. timedOut: false
  15293. };
  15294. }), destroy);
  15295. crossSpawn._enoent.hookChildProcess(spawned, parsed.parsed);
  15296. handleInput(spawned, parsed.opts.input);
  15297. spawned.then = (onfulfilled, onrejected) => handlePromise().then(onfulfilled, onrejected);
  15298. spawned.catch = onrejected => handlePromise().catch(onrejected);
  15299. return spawned;
  15300. };
  15301. // TODO: set `stderr: 'ignore'` when that option is implemented
  15302. module.exports.stdout = (...args) => module.exports(...args).then(x => x.stdout);
  15303. // TODO: set `stdout: 'ignore'` when that option is implemented
  15304. module.exports.stderr = (...args) => module.exports(...args).then(x => x.stderr);
  15305. module.exports.shell = (cmd, opts) => handleShell(module.exports, cmd, opts);
  15306. module.exports.sync = (cmd, args, opts) => {
  15307. const parsed = handleArgs(cmd, args, opts);
  15308. const joinedCmd = joinCmd(cmd, args);
  15309. if (isStream(parsed.opts.input)) {
  15310. throw new TypeError('The `input` option cannot be a stream in sync mode');
  15311. }
  15312. const result = childProcess.spawnSync(parsed.cmd, parsed.args, parsed.opts);
  15313. result.code = result.status;
  15314. if (result.error || result.status !== 0 || result.signal !== null) {
  15315. const err = makeError(result, {
  15316. joinedCmd,
  15317. parsed
  15318. });
  15319. if (!parsed.opts.reject) {
  15320. return err;
  15321. }
  15322. throw err;
  15323. }
  15324. return {
  15325. stdout: handleOutput(parsed.opts, result.stdout),
  15326. stderr: handleOutput(parsed.opts, result.stderr),
  15327. code: 0,
  15328. failed: false,
  15329. signal: null,
  15330. cmd: joinedCmd,
  15331. timedOut: false
  15332. };
  15333. };
  15334. module.exports.shellSync = (cmd, opts) => handleShell(module.exports.sync, cmd, opts);
  15335. /***/ }),
  15336. /***/ 966:
  15337. /***/ (function(module, __unusedexports, __webpack_require__) {
  15338. "use strict";
  15339. const {PassThrough} = __webpack_require__(413);
  15340. module.exports = options => {
  15341. options = Object.assign({}, options);
  15342. const {array} = options;
  15343. let {encoding} = options;
  15344. const buffer = encoding === 'buffer';
  15345. let objectMode = false;
  15346. if (array) {
  15347. objectMode = !(encoding || buffer);
  15348. } else {
  15349. encoding = encoding || 'utf8';
  15350. }
  15351. if (buffer) {
  15352. encoding = null;
  15353. }
  15354. let len = 0;
  15355. const ret = [];
  15356. const stream = new PassThrough({objectMode});
  15357. if (encoding) {
  15358. stream.setEncoding(encoding);
  15359. }
  15360. stream.on('data', chunk => {
  15361. ret.push(chunk);
  15362. if (objectMode) {
  15363. len = ret.length;
  15364. } else {
  15365. len += chunk.length;
  15366. }
  15367. });
  15368. stream.getBufferedValue = () => {
  15369. if (array) {
  15370. return ret;
  15371. }
  15372. return buffer ? Buffer.concat(ret, len) : ret.join('');
  15373. };
  15374. stream.getBufferedLength = () => len;
  15375. return stream;
  15376. };
  15377. /***/ }),
  15378. /***/ 969:
  15379. /***/ (function(module, __unusedexports, __webpack_require__) {
  15380. var wrappy = __webpack_require__(11)
  15381. module.exports = wrappy(once)
  15382. module.exports.strict = wrappy(onceStrict)
  15383. once.proto = once(function () {
  15384. Object.defineProperty(Function.prototype, 'once', {
  15385. value: function () {
  15386. return once(this)
  15387. },
  15388. configurable: true
  15389. })
  15390. Object.defineProperty(Function.prototype, 'onceStrict', {
  15391. value: function () {
  15392. return onceStrict(this)
  15393. },
  15394. configurable: true
  15395. })
  15396. })
  15397. function once (fn) {
  15398. var f = function () {
  15399. if (f.called) return f.value
  15400. f.called = true
  15401. return f.value = fn.apply(this, arguments)
  15402. }
  15403. f.called = false
  15404. return f
  15405. }
  15406. function onceStrict (fn) {
  15407. var f = function () {
  15408. if (f.called)
  15409. throw new Error(f.onceError)
  15410. f.called = true
  15411. return f.value = fn.apply(this, arguments)
  15412. }
  15413. var name = fn.name || 'Function wrapped with `once`'
  15414. f.onceError = name + " shouldn't be called more than once"
  15415. f.called = false
  15416. return f
  15417. }
  15418. /***/ }),
  15419. /***/ 986:
  15420. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  15421. "use strict";
  15422. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  15423. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  15424. return new (P || (P = Promise))(function (resolve, reject) {
  15425. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  15426. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  15427. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  15428. step((generator = generator.apply(thisArg, _arguments || [])).next());
  15429. });
  15430. };
  15431. Object.defineProperty(exports, "__esModule", { value: true });
  15432. const tr = __webpack_require__(9);
  15433. /**
  15434. * Exec a command.
  15435. * Output will be streamed to the live console.
  15436. * Returns promise with return code
  15437. *
  15438. * @param commandLine command to execute (can include additional args). Must be correctly escaped.
  15439. * @param args optional arguments for tool. Escaping is handled by the lib.
  15440. * @param options optional exec options. See ExecOptions
  15441. * @returns Promise<number> exit code
  15442. */
  15443. function exec(commandLine, args, options) {
  15444. return __awaiter(this, void 0, void 0, function* () {
  15445. const commandArgs = tr.argStringToArray(commandLine);
  15446. if (commandArgs.length === 0) {
  15447. throw new Error(`Parameter 'commandLine' cannot be null or empty.`);
  15448. }
  15449. // Path to tool to execute should be first arg
  15450. const toolPath = commandArgs[0];
  15451. args = commandArgs.slice(1).concat(args || []);
  15452. const runner = new tr.ToolRunner(toolPath, args, options);
  15453. return runner.exec();
  15454. });
  15455. }
  15456. exports.exec = exec;
  15457. //# sourceMappingURL=exec.js.map
  15458. /***/ }),
  15459. /***/ 991:
  15460. /***/ (function(module, __unusedexports, __webpack_require__) {
  15461. module.exports = authenticationRequestError;
  15462. const { RequestError } = __webpack_require__(463);
  15463. function authenticationRequestError(state, error, options) {
  15464. if (!error.headers) throw error;
  15465. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  15466. // handle "2FA required" error only
  15467. if (error.status !== 401 || !otpRequired) {
  15468. throw error;
  15469. }
  15470. if (
  15471. error.status === 401 &&
  15472. otpRequired &&
  15473. error.request &&
  15474. error.request.headers["x-github-otp"]
  15475. ) {
  15476. if (state.otp) {
  15477. delete state.otp; // no longer valid, request again
  15478. } else {
  15479. throw new RequestError(
  15480. "Invalid one-time password for two-factor authentication",
  15481. 401,
  15482. {
  15483. headers: error.headers,
  15484. request: options
  15485. }
  15486. );
  15487. }
  15488. }
  15489. if (typeof state.auth.on2fa !== "function") {
  15490. throw new RequestError(
  15491. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  15492. 401,
  15493. {
  15494. headers: error.headers,
  15495. request: options
  15496. }
  15497. );
  15498. }
  15499. return Promise.resolve()
  15500. .then(() => {
  15501. return state.auth.on2fa();
  15502. })
  15503. .then(oneTimePassword => {
  15504. const newOptions = Object.assign(options, {
  15505. headers: Object.assign(options.headers, {
  15506. "x-github-otp": oneTimePassword
  15507. })
  15508. });
  15509. return state.octokit.request(newOptions).then(response => {
  15510. // If OTP still valid, then persist it for following requests
  15511. state.otp = oneTimePassword;
  15512. return response;
  15513. });
  15514. });
  15515. }
  15516. /***/ })
  15517. /******/ });