index.js 598 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324
  1. module.exports =
  2. /******/ (function(modules, runtime) { // webpackBootstrap
  3. /******/ "use strict";
  4. /******/ // The module cache
  5. /******/ var installedModules = {};
  6. /******/
  7. /******/ // The require function
  8. /******/ function __webpack_require__(moduleId) {
  9. /******/
  10. /******/ // Check if module is in cache
  11. /******/ if(installedModules[moduleId]) {
  12. /******/ return installedModules[moduleId].exports;
  13. /******/ }
  14. /******/ // Create a new module (and put it into the cache)
  15. /******/ var module = installedModules[moduleId] = {
  16. /******/ i: moduleId,
  17. /******/ l: false,
  18. /******/ exports: {}
  19. /******/ };
  20. /******/
  21. /******/ // Execute the module function
  22. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  23. /******/
  24. /******/ // Flag the module as loaded
  25. /******/ module.l = true;
  26. /******/
  27. /******/ // Return the exports of the module
  28. /******/ return module.exports;
  29. /******/ }
  30. /******/
  31. /******/
  32. /******/ __webpack_require__.ab = __dirname + "/";
  33. /******/
  34. /******/ // the startup function
  35. /******/ function startup() {
  36. /******/ // Load entry module and return exports
  37. /******/ return __webpack_require__(198);
  38. /******/ };
  39. /******/
  40. /******/ // run startup
  41. /******/ return startup();
  42. /******/ })
  43. /************************************************************************/
  44. /******/ ({
  45. /***/ 0:
  46. /***/ (function(module, __unusedexports, __webpack_require__) {
  47. const Octokit = __webpack_require__(529);
  48. const CORE_PLUGINS = [
  49. __webpack_require__(372),
  50. __webpack_require__(19), // deprecated: remove in v17
  51. __webpack_require__(190),
  52. __webpack_require__(148),
  53. __webpack_require__(248),
  54. __webpack_require__(586),
  55. __webpack_require__(430),
  56. __webpack_require__(850) // deprecated: remove in v17
  57. ];
  58. module.exports = Octokit.plugin(CORE_PLUGINS);
  59. /***/ }),
  60. /***/ 1:
  61. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  62. "use strict";
  63. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  64. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  65. return new (P || (P = Promise))(function (resolve, reject) {
  66. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  67. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  68. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  69. step((generator = generator.apply(thisArg, _arguments || [])).next());
  70. });
  71. };
  72. Object.defineProperty(exports, "__esModule", { value: true });
  73. const childProcess = __webpack_require__(129);
  74. const path = __webpack_require__(622);
  75. const util_1 = __webpack_require__(669);
  76. const ioUtil = __webpack_require__(672);
  77. const exec = util_1.promisify(childProcess.exec);
  78. /**
  79. * Copies a file or folder.
  80. * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js
  81. *
  82. * @param source source path
  83. * @param dest destination path
  84. * @param options optional. See CopyOptions.
  85. */
  86. function cp(source, dest, options = {}) {
  87. return __awaiter(this, void 0, void 0, function* () {
  88. const { force, recursive } = readCopyOptions(options);
  89. const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null;
  90. // Dest is an existing file, but not forcing
  91. if (destStat && destStat.isFile() && !force) {
  92. return;
  93. }
  94. // If dest is an existing directory, should copy inside.
  95. const newDest = destStat && destStat.isDirectory()
  96. ? path.join(dest, path.basename(source))
  97. : dest;
  98. if (!(yield ioUtil.exists(source))) {
  99. throw new Error(`no such file or directory: ${source}`);
  100. }
  101. const sourceStat = yield ioUtil.stat(source);
  102. if (sourceStat.isDirectory()) {
  103. if (!recursive) {
  104. throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`);
  105. }
  106. else {
  107. yield cpDirRecursive(source, newDest, 0, force);
  108. }
  109. }
  110. else {
  111. if (path.relative(source, newDest) === '') {
  112. // a file cannot be copied to itself
  113. throw new Error(`'${newDest}' and '${source}' are the same file`);
  114. }
  115. yield copyFile(source, newDest, force);
  116. }
  117. });
  118. }
  119. exports.cp = cp;
  120. /**
  121. * Moves a path.
  122. *
  123. * @param source source path
  124. * @param dest destination path
  125. * @param options optional. See MoveOptions.
  126. */
  127. function mv(source, dest, options = {}) {
  128. return __awaiter(this, void 0, void 0, function* () {
  129. if (yield ioUtil.exists(dest)) {
  130. let destExists = true;
  131. if (yield ioUtil.isDirectory(dest)) {
  132. // If dest is directory copy src into dest
  133. dest = path.join(dest, path.basename(source));
  134. destExists = yield ioUtil.exists(dest);
  135. }
  136. if (destExists) {
  137. if (options.force == null || options.force) {
  138. yield rmRF(dest);
  139. }
  140. else {
  141. throw new Error('Destination already exists');
  142. }
  143. }
  144. }
  145. yield mkdirP(path.dirname(dest));
  146. yield ioUtil.rename(source, dest);
  147. });
  148. }
  149. exports.mv = mv;
  150. /**
  151. * Remove a path recursively with force
  152. *
  153. * @param inputPath path to remove
  154. */
  155. function rmRF(inputPath) {
  156. return __awaiter(this, void 0, void 0, function* () {
  157. if (ioUtil.IS_WINDOWS) {
  158. // Node doesn't provide a delete operation, only an unlink function. This means that if the file is being used by another
  159. // program (e.g. antivirus), it won't be deleted. To address this, we shell out the work to rd/del.
  160. try {
  161. if (yield ioUtil.isDirectory(inputPath, true)) {
  162. yield exec(`rd /s /q "${inputPath}"`);
  163. }
  164. else {
  165. yield exec(`del /f /a "${inputPath}"`);
  166. }
  167. }
  168. catch (err) {
  169. // if you try to delete a file that doesn't exist, desired result is achieved
  170. // other errors are valid
  171. if (err.code !== 'ENOENT')
  172. throw err;
  173. }
  174. // Shelling out fails to remove a symlink folder with missing source, this unlink catches that
  175. try {
  176. yield ioUtil.unlink(inputPath);
  177. }
  178. catch (err) {
  179. // if you try to delete a file that doesn't exist, desired result is achieved
  180. // other errors are valid
  181. if (err.code !== 'ENOENT')
  182. throw err;
  183. }
  184. }
  185. else {
  186. let isDir = false;
  187. try {
  188. isDir = yield ioUtil.isDirectory(inputPath);
  189. }
  190. catch (err) {
  191. // if you try to delete a file that doesn't exist, desired result is achieved
  192. // other errors are valid
  193. if (err.code !== 'ENOENT')
  194. throw err;
  195. return;
  196. }
  197. if (isDir) {
  198. yield exec(`rm -rf "${inputPath}"`);
  199. }
  200. else {
  201. yield ioUtil.unlink(inputPath);
  202. }
  203. }
  204. });
  205. }
  206. exports.rmRF = rmRF;
  207. /**
  208. * Make a directory. Creates the full path with folders in between
  209. * Will throw if it fails
  210. *
  211. * @param fsPath path to create
  212. * @returns Promise<void>
  213. */
  214. function mkdirP(fsPath) {
  215. return __awaiter(this, void 0, void 0, function* () {
  216. yield ioUtil.mkdirP(fsPath);
  217. });
  218. }
  219. exports.mkdirP = mkdirP;
  220. /**
  221. * Returns path of a tool had the tool actually been invoked. Resolves via paths.
  222. * If you check and the tool does not exist, it will throw.
  223. *
  224. * @param tool name of the tool
  225. * @param check whether to check if tool exists
  226. * @returns Promise<string> path to tool
  227. */
  228. function which(tool, check) {
  229. return __awaiter(this, void 0, void 0, function* () {
  230. if (!tool) {
  231. throw new Error("parameter 'tool' is required");
  232. }
  233. // recursive when check=true
  234. if (check) {
  235. const result = yield which(tool, false);
  236. if (!result) {
  237. if (ioUtil.IS_WINDOWS) {
  238. throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`);
  239. }
  240. else {
  241. throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`);
  242. }
  243. }
  244. }
  245. try {
  246. // build the list of extensions to try
  247. const extensions = [];
  248. if (ioUtil.IS_WINDOWS && process.env.PATHEXT) {
  249. for (const extension of process.env.PATHEXT.split(path.delimiter)) {
  250. if (extension) {
  251. extensions.push(extension);
  252. }
  253. }
  254. }
  255. // if it's rooted, return it if exists. otherwise return empty.
  256. if (ioUtil.isRooted(tool)) {
  257. const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions);
  258. if (filePath) {
  259. return filePath;
  260. }
  261. return '';
  262. }
  263. // if any path separators, return empty
  264. if (tool.includes('/') || (ioUtil.IS_WINDOWS && tool.includes('\\'))) {
  265. return '';
  266. }
  267. // build the list of directories
  268. //
  269. // Note, technically "where" checks the current directory on Windows. From a toolkit perspective,
  270. // it feels like we should not do this. Checking the current directory seems like more of a use
  271. // case of a shell, and the which() function exposed by the toolkit should strive for consistency
  272. // across platforms.
  273. const directories = [];
  274. if (process.env.PATH) {
  275. for (const p of process.env.PATH.split(path.delimiter)) {
  276. if (p) {
  277. directories.push(p);
  278. }
  279. }
  280. }
  281. // return the first match
  282. for (const directory of directories) {
  283. const filePath = yield ioUtil.tryGetExecutablePath(directory + path.sep + tool, extensions);
  284. if (filePath) {
  285. return filePath;
  286. }
  287. }
  288. return '';
  289. }
  290. catch (err) {
  291. throw new Error(`which failed with message ${err.message}`);
  292. }
  293. });
  294. }
  295. exports.which = which;
  296. function readCopyOptions(options) {
  297. const force = options.force == null ? true : options.force;
  298. const recursive = Boolean(options.recursive);
  299. return { force, recursive };
  300. }
  301. function cpDirRecursive(sourceDir, destDir, currentDepth, force) {
  302. return __awaiter(this, void 0, void 0, function* () {
  303. // Ensure there is not a run away recursive copy
  304. if (currentDepth >= 255)
  305. return;
  306. currentDepth++;
  307. yield mkdirP(destDir);
  308. const files = yield ioUtil.readdir(sourceDir);
  309. for (const fileName of files) {
  310. const srcFile = `${sourceDir}/${fileName}`;
  311. const destFile = `${destDir}/${fileName}`;
  312. const srcFileStat = yield ioUtil.lstat(srcFile);
  313. if (srcFileStat.isDirectory()) {
  314. // Recurse
  315. yield cpDirRecursive(srcFile, destFile, currentDepth, force);
  316. }
  317. else {
  318. yield copyFile(srcFile, destFile, force);
  319. }
  320. }
  321. // Change the mode for the newly created directory
  322. yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode);
  323. });
  324. }
  325. // Buffered file copy
  326. function copyFile(srcFile, destFile, force) {
  327. return __awaiter(this, void 0, void 0, function* () {
  328. if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) {
  329. // unlink/re-link it
  330. try {
  331. yield ioUtil.lstat(destFile);
  332. yield ioUtil.unlink(destFile);
  333. }
  334. catch (e) {
  335. // Try to override file permission
  336. if (e.code === 'EPERM') {
  337. yield ioUtil.chmod(destFile, '0666');
  338. yield ioUtil.unlink(destFile);
  339. }
  340. // other errors = it doesn't exist, no work to do
  341. }
  342. // Copy over symlink
  343. const symlinkFull = yield ioUtil.readlink(srcFile);
  344. yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null);
  345. }
  346. else if (!(yield ioUtil.exists(destFile)) || force) {
  347. yield ioUtil.copyFile(srcFile, destFile);
  348. }
  349. });
  350. }
  351. //# sourceMappingURL=io.js.map
  352. /***/ }),
  353. /***/ 2:
  354. /***/ (function(module, __unusedexports, __webpack_require__) {
  355. "use strict";
  356. const os = __webpack_require__(87);
  357. const macosRelease = __webpack_require__(118);
  358. const winRelease = __webpack_require__(49);
  359. const osName = (platform, release) => {
  360. if (!platform && release) {
  361. throw new Error('You can\'t specify a `release` without specifying `platform`');
  362. }
  363. platform = platform || os.platform();
  364. let id;
  365. if (platform === 'darwin') {
  366. if (!release && os.platform() === 'darwin') {
  367. release = os.release();
  368. }
  369. const prefix = release ? (Number(release.split('.')[0]) > 15 ? 'macOS' : 'OS X') : 'macOS';
  370. id = release ? macosRelease(release).name : '';
  371. return prefix + (id ? ' ' + id : '');
  372. }
  373. if (platform === 'linux') {
  374. if (!release && os.platform() === 'linux') {
  375. release = os.release();
  376. }
  377. id = release ? release.replace(/^(\d+\.\d+).*/, '$1') : '';
  378. return 'Linux' + (id ? ' ' + id : '');
  379. }
  380. if (platform === 'win32') {
  381. if (!release && os.platform() === 'win32') {
  382. release = os.release();
  383. }
  384. id = release ? winRelease(release) : '';
  385. return 'Windows' + (id ? ' ' + id : '');
  386. }
  387. return platform;
  388. };
  389. module.exports = osName;
  390. /***/ }),
  391. /***/ 8:
  392. /***/ (function(module, __unusedexports, __webpack_require__) {
  393. module.exports = iterator;
  394. const normalizePaginatedListResponse = __webpack_require__(301);
  395. function iterator(octokit, options) {
  396. const headers = options.headers;
  397. let url = octokit.request.endpoint(options).url;
  398. return {
  399. [Symbol.asyncIterator]: () => ({
  400. next() {
  401. if (!url) {
  402. return Promise.resolve({ done: true });
  403. }
  404. return octokit
  405. .request({ url, headers })
  406. .then(response => {
  407. normalizePaginatedListResponse(octokit, url, response);
  408. // `response.headers.link` format:
  409. // '<https://api.github.com/users/aseemk/followers?page=2>; rel="next", <https://api.github.com/users/aseemk/followers?page=2>; rel="last"'
  410. // sets `url` to undefined if "next" URL is not present or `link` header is not set
  411. url = ((response.headers.link || "").match(
  412. /<([^>]+)>;\s*rel="next"/
  413. ) || [])[1];
  414. return { value: response };
  415. });
  416. }
  417. })
  418. };
  419. }
  420. /***/ }),
  421. /***/ 9:
  422. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  423. "use strict";
  424. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  425. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  426. return new (P || (P = Promise))(function (resolve, reject) {
  427. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  428. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  429. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  430. step((generator = generator.apply(thisArg, _arguments || [])).next());
  431. });
  432. };
  433. Object.defineProperty(exports, "__esModule", { value: true });
  434. const os = __webpack_require__(87);
  435. const events = __webpack_require__(614);
  436. const child = __webpack_require__(129);
  437. /* eslint-disable @typescript-eslint/unbound-method */
  438. const IS_WINDOWS = process.platform === 'win32';
  439. /*
  440. * Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way.
  441. */
  442. class ToolRunner extends events.EventEmitter {
  443. constructor(toolPath, args, options) {
  444. super();
  445. if (!toolPath) {
  446. throw new Error("Parameter 'toolPath' cannot be null or empty.");
  447. }
  448. this.toolPath = toolPath;
  449. this.args = args || [];
  450. this.options = options || {};
  451. }
  452. _debug(message) {
  453. if (this.options.listeners && this.options.listeners.debug) {
  454. this.options.listeners.debug(message);
  455. }
  456. }
  457. _getCommandString(options, noPrefix) {
  458. const toolPath = this._getSpawnFileName();
  459. const args = this._getSpawnArgs(options);
  460. let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool
  461. if (IS_WINDOWS) {
  462. // Windows + cmd file
  463. if (this._isCmdFile()) {
  464. cmd += toolPath;
  465. for (const a of args) {
  466. cmd += ` ${a}`;
  467. }
  468. }
  469. // Windows + verbatim
  470. else if (options.windowsVerbatimArguments) {
  471. cmd += `"${toolPath}"`;
  472. for (const a of args) {
  473. cmd += ` ${a}`;
  474. }
  475. }
  476. // Windows (regular)
  477. else {
  478. cmd += this._windowsQuoteCmdArg(toolPath);
  479. for (const a of args) {
  480. cmd += ` ${this._windowsQuoteCmdArg(a)}`;
  481. }
  482. }
  483. }
  484. else {
  485. // OSX/Linux - this can likely be improved with some form of quoting.
  486. // creating processes on Unix is fundamentally different than Windows.
  487. // on Unix, execvp() takes an arg array.
  488. cmd += toolPath;
  489. for (const a of args) {
  490. cmd += ` ${a}`;
  491. }
  492. }
  493. return cmd;
  494. }
  495. _processLineBuffer(data, strBuffer, onLine) {
  496. try {
  497. let s = strBuffer + data.toString();
  498. let n = s.indexOf(os.EOL);
  499. while (n > -1) {
  500. const line = s.substring(0, n);
  501. onLine(line);
  502. // the rest of the string ...
  503. s = s.substring(n + os.EOL.length);
  504. n = s.indexOf(os.EOL);
  505. }
  506. strBuffer = s;
  507. }
  508. catch (err) {
  509. // streaming lines to console is best effort. Don't fail a build.
  510. this._debug(`error processing line. Failed with error ${err}`);
  511. }
  512. }
  513. _getSpawnFileName() {
  514. if (IS_WINDOWS) {
  515. if (this._isCmdFile()) {
  516. return process.env['COMSPEC'] || 'cmd.exe';
  517. }
  518. }
  519. return this.toolPath;
  520. }
  521. _getSpawnArgs(options) {
  522. if (IS_WINDOWS) {
  523. if (this._isCmdFile()) {
  524. let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`;
  525. for (const a of this.args) {
  526. argline += ' ';
  527. argline += options.windowsVerbatimArguments
  528. ? a
  529. : this._windowsQuoteCmdArg(a);
  530. }
  531. argline += '"';
  532. return [argline];
  533. }
  534. }
  535. return this.args;
  536. }
  537. _endsWith(str, end) {
  538. return str.endsWith(end);
  539. }
  540. _isCmdFile() {
  541. const upperToolPath = this.toolPath.toUpperCase();
  542. return (this._endsWith(upperToolPath, '.CMD') ||
  543. this._endsWith(upperToolPath, '.BAT'));
  544. }
  545. _windowsQuoteCmdArg(arg) {
  546. // for .exe, apply the normal quoting rules that libuv applies
  547. if (!this._isCmdFile()) {
  548. return this._uvQuoteCmdArg(arg);
  549. }
  550. // otherwise apply quoting rules specific to the cmd.exe command line parser.
  551. // the libuv rules are generic and are not designed specifically for cmd.exe
  552. // command line parser.
  553. //
  554. // for a detailed description of the cmd.exe command line parser, refer to
  555. // http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912
  556. // need quotes for empty arg
  557. if (!arg) {
  558. return '""';
  559. }
  560. // determine whether the arg needs to be quoted
  561. const cmdSpecialChars = [
  562. ' ',
  563. '\t',
  564. '&',
  565. '(',
  566. ')',
  567. '[',
  568. ']',
  569. '{',
  570. '}',
  571. '^',
  572. '=',
  573. ';',
  574. '!',
  575. "'",
  576. '+',
  577. ',',
  578. '`',
  579. '~',
  580. '|',
  581. '<',
  582. '>',
  583. '"'
  584. ];
  585. let needsQuotes = false;
  586. for (const char of arg) {
  587. if (cmdSpecialChars.some(x => x === char)) {
  588. needsQuotes = true;
  589. break;
  590. }
  591. }
  592. // short-circuit if quotes not needed
  593. if (!needsQuotes) {
  594. return arg;
  595. }
  596. // the following quoting rules are very similar to the rules that by libuv applies.
  597. //
  598. // 1) wrap the string in quotes
  599. //
  600. // 2) double-up quotes - i.e. " => ""
  601. //
  602. // this is different from the libuv quoting rules. libuv replaces " with \", which unfortunately
  603. // doesn't work well with a cmd.exe command line.
  604. //
  605. // note, replacing " with "" also works well if the arg is passed to a downstream .NET console app.
  606. // for example, the command line:
  607. // foo.exe "myarg:""my val"""
  608. // is parsed by a .NET console app into an arg array:
  609. // [ "myarg:\"my val\"" ]
  610. // which is the same end result when applying libuv quoting rules. although the actual
  611. // command line from libuv quoting rules would look like:
  612. // foo.exe "myarg:\"my val\""
  613. //
  614. // 3) double-up slashes that precede a quote,
  615. // e.g. hello \world => "hello \world"
  616. // hello\"world => "hello\\""world"
  617. // hello\\"world => "hello\\\\""world"
  618. // hello world\ => "hello world\\"
  619. //
  620. // technically this is not required for a cmd.exe command line, or the batch argument parser.
  621. // the reasons for including this as a .cmd quoting rule are:
  622. //
  623. // a) this is optimized for the scenario where the argument is passed from the .cmd file to an
  624. // external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule.
  625. //
  626. // b) it's what we've been doing previously (by deferring to node default behavior) and we
  627. // haven't heard any complaints about that aspect.
  628. //
  629. // note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be
  630. // escaped when used on the command line directly - even though within a .cmd file % can be escaped
  631. // by using %%.
  632. //
  633. // the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts
  634. // the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing.
  635. //
  636. // one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would
  637. // often work, since it is unlikely that var^ would exist, and the ^ character is removed when the
  638. // variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args
  639. // to an external program.
  640. //
  641. // an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file.
  642. // % can be escaped within a .cmd file.
  643. let reverse = '"';
  644. let quoteHit = true;
  645. for (let i = arg.length; i > 0; i--) {
  646. // walk the string in reverse
  647. reverse += arg[i - 1];
  648. if (quoteHit && arg[i - 1] === '\\') {
  649. reverse += '\\'; // double the slash
  650. }
  651. else if (arg[i - 1] === '"') {
  652. quoteHit = true;
  653. reverse += '"'; // double the quote
  654. }
  655. else {
  656. quoteHit = false;
  657. }
  658. }
  659. reverse += '"';
  660. return reverse
  661. .split('')
  662. .reverse()
  663. .join('');
  664. }
  665. _uvQuoteCmdArg(arg) {
  666. // Tool runner wraps child_process.spawn() and needs to apply the same quoting as
  667. // Node in certain cases where the undocumented spawn option windowsVerbatimArguments
  668. // is used.
  669. //
  670. // Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV,
  671. // see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details),
  672. // pasting copyright notice from Node within this function:
  673. //
  674. // Copyright Joyent, Inc. and other Node contributors. All rights reserved.
  675. //
  676. // Permission is hereby granted, free of charge, to any person obtaining a copy
  677. // of this software and associated documentation files (the "Software"), to
  678. // deal in the Software without restriction, including without limitation the
  679. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  680. // sell copies of the Software, and to permit persons to whom the Software is
  681. // furnished to do so, subject to the following conditions:
  682. //
  683. // The above copyright notice and this permission notice shall be included in
  684. // all copies or substantial portions of the Software.
  685. //
  686. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  687. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  688. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  689. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  690. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  691. // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  692. // IN THE SOFTWARE.
  693. if (!arg) {
  694. // Need double quotation for empty argument
  695. return '""';
  696. }
  697. if (!arg.includes(' ') && !arg.includes('\t') && !arg.includes('"')) {
  698. // No quotation needed
  699. return arg;
  700. }
  701. if (!arg.includes('"') && !arg.includes('\\')) {
  702. // No embedded double quotes or backslashes, so I can just wrap
  703. // quote marks around the whole thing.
  704. return `"${arg}"`;
  705. }
  706. // Expected input/output:
  707. // input : hello"world
  708. // output: "hello\"world"
  709. // input : hello""world
  710. // output: "hello\"\"world"
  711. // input : hello\world
  712. // output: hello\world
  713. // input : hello\\world
  714. // output: hello\\world
  715. // input : hello\"world
  716. // output: "hello\\\"world"
  717. // input : hello\\"world
  718. // output: "hello\\\\\"world"
  719. // input : hello world\
  720. // output: "hello world\\" - note the comment in libuv actually reads "hello world\"
  721. // but it appears the comment is wrong, it should be "hello world\\"
  722. let reverse = '"';
  723. let quoteHit = true;
  724. for (let i = arg.length; i > 0; i--) {
  725. // walk the string in reverse
  726. reverse += arg[i - 1];
  727. if (quoteHit && arg[i - 1] === '\\') {
  728. reverse += '\\';
  729. }
  730. else if (arg[i - 1] === '"') {
  731. quoteHit = true;
  732. reverse += '\\';
  733. }
  734. else {
  735. quoteHit = false;
  736. }
  737. }
  738. reverse += '"';
  739. return reverse
  740. .split('')
  741. .reverse()
  742. .join('');
  743. }
  744. _cloneExecOptions(options) {
  745. options = options || {};
  746. const result = {
  747. cwd: options.cwd || process.cwd(),
  748. env: options.env || process.env,
  749. silent: options.silent || false,
  750. windowsVerbatimArguments: options.windowsVerbatimArguments || false,
  751. failOnStdErr: options.failOnStdErr || false,
  752. ignoreReturnCode: options.ignoreReturnCode || false,
  753. delay: options.delay || 10000
  754. };
  755. result.outStream = options.outStream || process.stdout;
  756. result.errStream = options.errStream || process.stderr;
  757. return result;
  758. }
  759. _getSpawnOptions(options, toolPath) {
  760. options = options || {};
  761. const result = {};
  762. result.cwd = options.cwd;
  763. result.env = options.env;
  764. result['windowsVerbatimArguments'] =
  765. options.windowsVerbatimArguments || this._isCmdFile();
  766. if (options.windowsVerbatimArguments) {
  767. result.argv0 = `"${toolPath}"`;
  768. }
  769. return result;
  770. }
  771. /**
  772. * Exec a tool.
  773. * Output will be streamed to the live console.
  774. * Returns promise with return code
  775. *
  776. * @param tool path to tool to exec
  777. * @param options optional exec options. See ExecOptions
  778. * @returns number
  779. */
  780. exec() {
  781. return __awaiter(this, void 0, void 0, function* () {
  782. return new Promise((resolve, reject) => {
  783. this._debug(`exec tool: ${this.toolPath}`);
  784. this._debug('arguments:');
  785. for (const arg of this.args) {
  786. this._debug(` ${arg}`);
  787. }
  788. const optionsNonNull = this._cloneExecOptions(this.options);
  789. if (!optionsNonNull.silent && optionsNonNull.outStream) {
  790. optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL);
  791. }
  792. const state = new ExecState(optionsNonNull, this.toolPath);
  793. state.on('debug', (message) => {
  794. this._debug(message);
  795. });
  796. const fileName = this._getSpawnFileName();
  797. const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName));
  798. const stdbuffer = '';
  799. if (cp.stdout) {
  800. cp.stdout.on('data', (data) => {
  801. if (this.options.listeners && this.options.listeners.stdout) {
  802. this.options.listeners.stdout(data);
  803. }
  804. if (!optionsNonNull.silent && optionsNonNull.outStream) {
  805. optionsNonNull.outStream.write(data);
  806. }
  807. this._processLineBuffer(data, stdbuffer, (line) => {
  808. if (this.options.listeners && this.options.listeners.stdline) {
  809. this.options.listeners.stdline(line);
  810. }
  811. });
  812. });
  813. }
  814. const errbuffer = '';
  815. if (cp.stderr) {
  816. cp.stderr.on('data', (data) => {
  817. state.processStderr = true;
  818. if (this.options.listeners && this.options.listeners.stderr) {
  819. this.options.listeners.stderr(data);
  820. }
  821. if (!optionsNonNull.silent &&
  822. optionsNonNull.errStream &&
  823. optionsNonNull.outStream) {
  824. const s = optionsNonNull.failOnStdErr
  825. ? optionsNonNull.errStream
  826. : optionsNonNull.outStream;
  827. s.write(data);
  828. }
  829. this._processLineBuffer(data, errbuffer, (line) => {
  830. if (this.options.listeners && this.options.listeners.errline) {
  831. this.options.listeners.errline(line);
  832. }
  833. });
  834. });
  835. }
  836. cp.on('error', (err) => {
  837. state.processError = err.message;
  838. state.processExited = true;
  839. state.processClosed = true;
  840. state.CheckComplete();
  841. });
  842. cp.on('exit', (code) => {
  843. state.processExitCode = code;
  844. state.processExited = true;
  845. this._debug(`Exit code ${code} received from tool '${this.toolPath}'`);
  846. state.CheckComplete();
  847. });
  848. cp.on('close', (code) => {
  849. state.processExitCode = code;
  850. state.processExited = true;
  851. state.processClosed = true;
  852. this._debug(`STDIO streams have closed for tool '${this.toolPath}'`);
  853. state.CheckComplete();
  854. });
  855. state.on('done', (error, exitCode) => {
  856. if (stdbuffer.length > 0) {
  857. this.emit('stdline', stdbuffer);
  858. }
  859. if (errbuffer.length > 0) {
  860. this.emit('errline', errbuffer);
  861. }
  862. cp.removeAllListeners();
  863. if (error) {
  864. reject(error);
  865. }
  866. else {
  867. resolve(exitCode);
  868. }
  869. });
  870. });
  871. });
  872. }
  873. }
  874. exports.ToolRunner = ToolRunner;
  875. /**
  876. * Convert an arg string to an array of args. Handles escaping
  877. *
  878. * @param argString string of arguments
  879. * @returns string[] array of arguments
  880. */
  881. function argStringToArray(argString) {
  882. const args = [];
  883. let inQuotes = false;
  884. let escaped = false;
  885. let arg = '';
  886. function append(c) {
  887. // we only escape double quotes.
  888. if (escaped && c !== '"') {
  889. arg += '\\';
  890. }
  891. arg += c;
  892. escaped = false;
  893. }
  894. for (let i = 0; i < argString.length; i++) {
  895. const c = argString.charAt(i);
  896. if (c === '"') {
  897. if (!escaped) {
  898. inQuotes = !inQuotes;
  899. }
  900. else {
  901. append(c);
  902. }
  903. continue;
  904. }
  905. if (c === '\\' && escaped) {
  906. append(c);
  907. continue;
  908. }
  909. if (c === '\\' && inQuotes) {
  910. escaped = true;
  911. continue;
  912. }
  913. if (c === ' ' && !inQuotes) {
  914. if (arg.length > 0) {
  915. args.push(arg);
  916. arg = '';
  917. }
  918. continue;
  919. }
  920. append(c);
  921. }
  922. if (arg.length > 0) {
  923. args.push(arg.trim());
  924. }
  925. return args;
  926. }
  927. exports.argStringToArray = argStringToArray;
  928. class ExecState extends events.EventEmitter {
  929. constructor(options, toolPath) {
  930. super();
  931. this.processClosed = false; // tracks whether the process has exited and stdio is closed
  932. this.processError = '';
  933. this.processExitCode = 0;
  934. this.processExited = false; // tracks whether the process has exited
  935. this.processStderr = false; // tracks whether stderr was written to
  936. this.delay = 10000; // 10 seconds
  937. this.done = false;
  938. this.timeout = null;
  939. if (!toolPath) {
  940. throw new Error('toolPath must not be empty');
  941. }
  942. this.options = options;
  943. this.toolPath = toolPath;
  944. if (options.delay) {
  945. this.delay = options.delay;
  946. }
  947. }
  948. CheckComplete() {
  949. if (this.done) {
  950. return;
  951. }
  952. if (this.processClosed) {
  953. this._setResult();
  954. }
  955. else if (this.processExited) {
  956. this.timeout = setTimeout(ExecState.HandleTimeout, this.delay, this);
  957. }
  958. }
  959. _debug(message) {
  960. this.emit('debug', message);
  961. }
  962. _setResult() {
  963. // determine whether there is an error
  964. let error;
  965. if (this.processExited) {
  966. if (this.processError) {
  967. error = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`);
  968. }
  969. else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) {
  970. error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`);
  971. }
  972. else if (this.processStderr && this.options.failOnStdErr) {
  973. error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`);
  974. }
  975. }
  976. // clear the timeout
  977. if (this.timeout) {
  978. clearTimeout(this.timeout);
  979. this.timeout = null;
  980. }
  981. this.done = true;
  982. this.emit('done', error, this.processExitCode);
  983. }
  984. static HandleTimeout(state) {
  985. if (state.done) {
  986. return;
  987. }
  988. if (!state.processClosed && state.processExited) {
  989. const message = `The STDIO streams did not close within ${state.delay /
  990. 1000} seconds of the exit event from process '${state.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`;
  991. state._debug(message);
  992. }
  993. state._setResult();
  994. }
  995. }
  996. //# sourceMappingURL=toolrunner.js.map
  997. /***/ }),
  998. /***/ 11:
  999. /***/ (function(module) {
  1000. // Returns a wrapper function that returns a wrapped callback
  1001. // The wrapper function should do some stuff, and return a
  1002. // presumably different callback function.
  1003. // This makes sure that own properties are retained, so that
  1004. // decorations and such are not lost along the way.
  1005. module.exports = wrappy
  1006. function wrappy (fn, cb) {
  1007. if (fn && cb) return wrappy(fn)(cb)
  1008. if (typeof fn !== 'function')
  1009. throw new TypeError('need wrapper function')
  1010. Object.keys(fn).forEach(function (k) {
  1011. wrapper[k] = fn[k]
  1012. })
  1013. return wrapper
  1014. function wrapper() {
  1015. var args = new Array(arguments.length)
  1016. for (var i = 0; i < args.length; i++) {
  1017. args[i] = arguments[i]
  1018. }
  1019. var ret = fn.apply(this, args)
  1020. var cb = args[args.length-1]
  1021. if (typeof ret === 'function' && ret !== cb) {
  1022. Object.keys(cb).forEach(function (k) {
  1023. ret[k] = cb[k]
  1024. })
  1025. }
  1026. return ret
  1027. }
  1028. }
  1029. /***/ }),
  1030. /***/ 16:
  1031. /***/ (function(module) {
  1032. module.exports = require("tls");
  1033. /***/ }),
  1034. /***/ 18:
  1035. /***/ (function() {
  1036. eval("require")("encoding");
  1037. /***/ }),
  1038. /***/ 19:
  1039. /***/ (function(module, __unusedexports, __webpack_require__) {
  1040. module.exports = authenticationPlugin;
  1041. const { Deprecation } = __webpack_require__(692);
  1042. const once = __webpack_require__(969);
  1043. const deprecateAuthenticate = once((log, deprecation) => log.warn(deprecation));
  1044. const authenticate = __webpack_require__(674);
  1045. const beforeRequest = __webpack_require__(471);
  1046. const requestError = __webpack_require__(349);
  1047. function authenticationPlugin(octokit, options) {
  1048. if (options.auth) {
  1049. octokit.authenticate = () => {
  1050. deprecateAuthenticate(
  1051. octokit.log,
  1052. new Deprecation(
  1053. '[@octokit/rest] octokit.authenticate() is deprecated and has no effect when "auth" option is set on Octokit constructor'
  1054. )
  1055. );
  1056. };
  1057. return;
  1058. }
  1059. const state = {
  1060. octokit,
  1061. auth: false
  1062. };
  1063. octokit.authenticate = authenticate.bind(null, state);
  1064. octokit.hook.before("request", beforeRequest.bind(null, state));
  1065. octokit.hook.error("request", requestError.bind(null, state));
  1066. }
  1067. /***/ }),
  1068. /***/ 20:
  1069. /***/ (function(module, __unusedexports, __webpack_require__) {
  1070. "use strict";
  1071. const cp = __webpack_require__(129);
  1072. const parse = __webpack_require__(568);
  1073. const enoent = __webpack_require__(881);
  1074. function spawn(command, args, options) {
  1075. // Parse the arguments
  1076. const parsed = parse(command, args, options);
  1077. // Spawn the child process
  1078. const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
  1079. // Hook into child process "exit" event to emit an error if the command
  1080. // does not exists, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16
  1081. enoent.hookChildProcess(spawned, parsed);
  1082. return spawned;
  1083. }
  1084. function spawnSync(command, args, options) {
  1085. // Parse the arguments
  1086. const parsed = parse(command, args, options);
  1087. // Spawn the child process
  1088. const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
  1089. // Analyze if the command does not exist, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16
  1090. result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
  1091. return result;
  1092. }
  1093. module.exports = spawn;
  1094. module.exports.spawn = spawn;
  1095. module.exports.sync = spawnSync;
  1096. module.exports._parse = parse;
  1097. module.exports._enoent = enoent;
  1098. /***/ }),
  1099. /***/ 39:
  1100. /***/ (function(module) {
  1101. "use strict";
  1102. module.exports = opts => {
  1103. opts = opts || {};
  1104. const env = opts.env || process.env;
  1105. const platform = opts.platform || process.platform;
  1106. if (platform !== 'win32') {
  1107. return 'PATH';
  1108. }
  1109. return Object.keys(env).find(x => x.toUpperCase() === 'PATH') || 'Path';
  1110. };
  1111. /***/ }),
  1112. /***/ 47:
  1113. /***/ (function(module, __unusedexports, __webpack_require__) {
  1114. module.exports = factory;
  1115. const Octokit = __webpack_require__(402);
  1116. const registerPlugin = __webpack_require__(855);
  1117. function factory(plugins) {
  1118. const Api = Octokit.bind(null, plugins || []);
  1119. Api.plugin = registerPlugin.bind(null, plugins || []);
  1120. return Api;
  1121. }
  1122. /***/ }),
  1123. /***/ 49:
  1124. /***/ (function(module, __unusedexports, __webpack_require__) {
  1125. "use strict";
  1126. const os = __webpack_require__(87);
  1127. const execa = __webpack_require__(955);
  1128. // Reference: https://www.gaijin.at/en/lstwinver.php
  1129. const names = new Map([
  1130. ['10.0', '10'],
  1131. ['6.3', '8.1'],
  1132. ['6.2', '8'],
  1133. ['6.1', '7'],
  1134. ['6.0', 'Vista'],
  1135. ['5.2', 'Server 2003'],
  1136. ['5.1', 'XP'],
  1137. ['5.0', '2000'],
  1138. ['4.9', 'ME'],
  1139. ['4.1', '98'],
  1140. ['4.0', '95']
  1141. ]);
  1142. const windowsRelease = release => {
  1143. const version = /\d+\.\d/.exec(release || os.release());
  1144. if (release && !version) {
  1145. throw new Error('`release` argument doesn\'t match `n.n`');
  1146. }
  1147. const ver = (version || [])[0];
  1148. // Server 2008, 2012 and 2016 versions are ambiguous with desktop versions and must be detected at runtime.
  1149. // If `release` is omitted or we're on a Windows system, and the version number is an ambiguous version
  1150. // then use `wmic` to get the OS caption: https://msdn.microsoft.com/en-us/library/aa394531(v=vs.85).aspx
  1151. // If the resulting caption contains the year 2008, 2012 or 2016, it is a server version, so return a server OS name.
  1152. if ((!release || release === os.release()) && ['6.1', '6.2', '6.3', '10.0'].includes(ver)) {
  1153. const stdout = execa.sync('wmic', ['os', 'get', 'Caption']).stdout || '';
  1154. const year = (stdout.match(/2008|2012|2016/) || [])[0];
  1155. if (year) {
  1156. return `Server ${year}`;
  1157. }
  1158. }
  1159. return names.get(ver);
  1160. };
  1161. module.exports = windowsRelease;
  1162. /***/ }),
  1163. /***/ 87:
  1164. /***/ (function(module) {
  1165. module.exports = require("os");
  1166. /***/ }),
  1167. /***/ 118:
  1168. /***/ (function(module, __unusedexports, __webpack_require__) {
  1169. "use strict";
  1170. const os = __webpack_require__(87);
  1171. const nameMap = new Map([
  1172. [19, 'Catalina'],
  1173. [18, 'Mojave'],
  1174. [17, 'High Sierra'],
  1175. [16, 'Sierra'],
  1176. [15, 'El Capitan'],
  1177. [14, 'Yosemite'],
  1178. [13, 'Mavericks'],
  1179. [12, 'Mountain Lion'],
  1180. [11, 'Lion'],
  1181. [10, 'Snow Leopard'],
  1182. [9, 'Leopard'],
  1183. [8, 'Tiger'],
  1184. [7, 'Panther'],
  1185. [6, 'Jaguar'],
  1186. [5, 'Puma']
  1187. ]);
  1188. const macosRelease = release => {
  1189. release = Number((release || os.release()).split('.')[0]);
  1190. return {
  1191. name: nameMap.get(release),
  1192. version: '10.' + (release - 4)
  1193. };
  1194. };
  1195. module.exports = macosRelease;
  1196. // TODO: remove this in the next major version
  1197. module.exports.default = macosRelease;
  1198. /***/ }),
  1199. /***/ 126:
  1200. /***/ (function(module) {
  1201. /**
  1202. * lodash (Custom Build) <https://lodash.com/>
  1203. * Build: `lodash modularize exports="npm" -o ./`
  1204. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  1205. * Released under MIT license <https://lodash.com/license>
  1206. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1207. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1208. */
  1209. /** Used as the size to enable large array optimizations. */
  1210. var LARGE_ARRAY_SIZE = 200;
  1211. /** Used to stand-in for `undefined` hash values. */
  1212. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1213. /** Used as references for various `Number` constants. */
  1214. var INFINITY = 1 / 0;
  1215. /** `Object#toString` result references. */
  1216. var funcTag = '[object Function]',
  1217. genTag = '[object GeneratorFunction]';
  1218. /**
  1219. * Used to match `RegExp`
  1220. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1221. */
  1222. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  1223. /** Used to detect host constructors (Safari). */
  1224. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1225. /** Detect free variable `global` from Node.js. */
  1226. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  1227. /** Detect free variable `self`. */
  1228. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1229. /** Used as a reference to the global object. */
  1230. var root = freeGlobal || freeSelf || Function('return this')();
  1231. /**
  1232. * A specialized version of `_.includes` for arrays without support for
  1233. * specifying an index to search from.
  1234. *
  1235. * @private
  1236. * @param {Array} [array] The array to inspect.
  1237. * @param {*} target The value to search for.
  1238. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1239. */
  1240. function arrayIncludes(array, value) {
  1241. var length = array ? array.length : 0;
  1242. return !!length && baseIndexOf(array, value, 0) > -1;
  1243. }
  1244. /**
  1245. * This function is like `arrayIncludes` except that it accepts a comparator.
  1246. *
  1247. * @private
  1248. * @param {Array} [array] The array to inspect.
  1249. * @param {*} target The value to search for.
  1250. * @param {Function} comparator The comparator invoked per element.
  1251. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1252. */
  1253. function arrayIncludesWith(array, value, comparator) {
  1254. var index = -1,
  1255. length = array ? array.length : 0;
  1256. while (++index < length) {
  1257. if (comparator(value, array[index])) {
  1258. return true;
  1259. }
  1260. }
  1261. return false;
  1262. }
  1263. /**
  1264. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1265. * support for iteratee shorthands.
  1266. *
  1267. * @private
  1268. * @param {Array} array The array to inspect.
  1269. * @param {Function} predicate The function invoked per iteration.
  1270. * @param {number} fromIndex The index to search from.
  1271. * @param {boolean} [fromRight] Specify iterating from right to left.
  1272. * @returns {number} Returns the index of the matched value, else `-1`.
  1273. */
  1274. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  1275. var length = array.length,
  1276. index = fromIndex + (fromRight ? 1 : -1);
  1277. while ((fromRight ? index-- : ++index < length)) {
  1278. if (predicate(array[index], index, array)) {
  1279. return index;
  1280. }
  1281. }
  1282. return -1;
  1283. }
  1284. /**
  1285. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  1286. *
  1287. * @private
  1288. * @param {Array} array The array to inspect.
  1289. * @param {*} value The value to search for.
  1290. * @param {number} fromIndex The index to search from.
  1291. * @returns {number} Returns the index of the matched value, else `-1`.
  1292. */
  1293. function baseIndexOf(array, value, fromIndex) {
  1294. if (value !== value) {
  1295. return baseFindIndex(array, baseIsNaN, fromIndex);
  1296. }
  1297. var index = fromIndex - 1,
  1298. length = array.length;
  1299. while (++index < length) {
  1300. if (array[index] === value) {
  1301. return index;
  1302. }
  1303. }
  1304. return -1;
  1305. }
  1306. /**
  1307. * The base implementation of `_.isNaN` without support for number objects.
  1308. *
  1309. * @private
  1310. * @param {*} value The value to check.
  1311. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  1312. */
  1313. function baseIsNaN(value) {
  1314. return value !== value;
  1315. }
  1316. /**
  1317. * Checks if a cache value for `key` exists.
  1318. *
  1319. * @private
  1320. * @param {Object} cache The cache to query.
  1321. * @param {string} key The key of the entry to check.
  1322. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1323. */
  1324. function cacheHas(cache, key) {
  1325. return cache.has(key);
  1326. }
  1327. /**
  1328. * Gets the value at `key` of `object`.
  1329. *
  1330. * @private
  1331. * @param {Object} [object] The object to query.
  1332. * @param {string} key The key of the property to get.
  1333. * @returns {*} Returns the property value.
  1334. */
  1335. function getValue(object, key) {
  1336. return object == null ? undefined : object[key];
  1337. }
  1338. /**
  1339. * Checks if `value` is a host object in IE < 9.
  1340. *
  1341. * @private
  1342. * @param {*} value The value to check.
  1343. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  1344. */
  1345. function isHostObject(value) {
  1346. // Many host objects are `Object` objects that can coerce to strings
  1347. // despite having improperly defined `toString` methods.
  1348. var result = false;
  1349. if (value != null && typeof value.toString != 'function') {
  1350. try {
  1351. result = !!(value + '');
  1352. } catch (e) {}
  1353. }
  1354. return result;
  1355. }
  1356. /**
  1357. * Converts `set` to an array of its values.
  1358. *
  1359. * @private
  1360. * @param {Object} set The set to convert.
  1361. * @returns {Array} Returns the values.
  1362. */
  1363. function setToArray(set) {
  1364. var index = -1,
  1365. result = Array(set.size);
  1366. set.forEach(function(value) {
  1367. result[++index] = value;
  1368. });
  1369. return result;
  1370. }
  1371. /** Used for built-in method references. */
  1372. var arrayProto = Array.prototype,
  1373. funcProto = Function.prototype,
  1374. objectProto = Object.prototype;
  1375. /** Used to detect overreaching core-js shims. */
  1376. var coreJsData = root['__core-js_shared__'];
  1377. /** Used to detect methods masquerading as native. */
  1378. var maskSrcKey = (function() {
  1379. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  1380. return uid ? ('Symbol(src)_1.' + uid) : '';
  1381. }());
  1382. /** Used to resolve the decompiled source of functions. */
  1383. var funcToString = funcProto.toString;
  1384. /** Used to check objects for own properties. */
  1385. var hasOwnProperty = objectProto.hasOwnProperty;
  1386. /**
  1387. * Used to resolve the
  1388. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  1389. * of values.
  1390. */
  1391. var objectToString = objectProto.toString;
  1392. /** Used to detect if a method is native. */
  1393. var reIsNative = RegExp('^' +
  1394. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  1395. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  1396. );
  1397. /** Built-in value references. */
  1398. var splice = arrayProto.splice;
  1399. /* Built-in method references that are verified to be native. */
  1400. var Map = getNative(root, 'Map'),
  1401. Set = getNative(root, 'Set'),
  1402. nativeCreate = getNative(Object, 'create');
  1403. /**
  1404. * Creates a hash object.
  1405. *
  1406. * @private
  1407. * @constructor
  1408. * @param {Array} [entries] The key-value pairs to cache.
  1409. */
  1410. function Hash(entries) {
  1411. var index = -1,
  1412. length = entries ? entries.length : 0;
  1413. this.clear();
  1414. while (++index < length) {
  1415. var entry = entries[index];
  1416. this.set(entry[0], entry[1]);
  1417. }
  1418. }
  1419. /**
  1420. * Removes all key-value entries from the hash.
  1421. *
  1422. * @private
  1423. * @name clear
  1424. * @memberOf Hash
  1425. */
  1426. function hashClear() {
  1427. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  1428. }
  1429. /**
  1430. * Removes `key` and its value from the hash.
  1431. *
  1432. * @private
  1433. * @name delete
  1434. * @memberOf Hash
  1435. * @param {Object} hash The hash to modify.
  1436. * @param {string} key The key of the value to remove.
  1437. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1438. */
  1439. function hashDelete(key) {
  1440. return this.has(key) && delete this.__data__[key];
  1441. }
  1442. /**
  1443. * Gets the hash value for `key`.
  1444. *
  1445. * @private
  1446. * @name get
  1447. * @memberOf Hash
  1448. * @param {string} key The key of the value to get.
  1449. * @returns {*} Returns the entry value.
  1450. */
  1451. function hashGet(key) {
  1452. var data = this.__data__;
  1453. if (nativeCreate) {
  1454. var result = data[key];
  1455. return result === HASH_UNDEFINED ? undefined : result;
  1456. }
  1457. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  1458. }
  1459. /**
  1460. * Checks if a hash value for `key` exists.
  1461. *
  1462. * @private
  1463. * @name has
  1464. * @memberOf Hash
  1465. * @param {string} key The key of the entry to check.
  1466. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1467. */
  1468. function hashHas(key) {
  1469. var data = this.__data__;
  1470. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  1471. }
  1472. /**
  1473. * Sets the hash `key` to `value`.
  1474. *
  1475. * @private
  1476. * @name set
  1477. * @memberOf Hash
  1478. * @param {string} key The key of the value to set.
  1479. * @param {*} value The value to set.
  1480. * @returns {Object} Returns the hash instance.
  1481. */
  1482. function hashSet(key, value) {
  1483. var data = this.__data__;
  1484. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  1485. return this;
  1486. }
  1487. // Add methods to `Hash`.
  1488. Hash.prototype.clear = hashClear;
  1489. Hash.prototype['delete'] = hashDelete;
  1490. Hash.prototype.get = hashGet;
  1491. Hash.prototype.has = hashHas;
  1492. Hash.prototype.set = hashSet;
  1493. /**
  1494. * Creates an list cache object.
  1495. *
  1496. * @private
  1497. * @constructor
  1498. * @param {Array} [entries] The key-value pairs to cache.
  1499. */
  1500. function ListCache(entries) {
  1501. var index = -1,
  1502. length = entries ? entries.length : 0;
  1503. this.clear();
  1504. while (++index < length) {
  1505. var entry = entries[index];
  1506. this.set(entry[0], entry[1]);
  1507. }
  1508. }
  1509. /**
  1510. * Removes all key-value entries from the list cache.
  1511. *
  1512. * @private
  1513. * @name clear
  1514. * @memberOf ListCache
  1515. */
  1516. function listCacheClear() {
  1517. this.__data__ = [];
  1518. }
  1519. /**
  1520. * Removes `key` and its value from the list cache.
  1521. *
  1522. * @private
  1523. * @name delete
  1524. * @memberOf ListCache
  1525. * @param {string} key The key of the value to remove.
  1526. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1527. */
  1528. function listCacheDelete(key) {
  1529. var data = this.__data__,
  1530. index = assocIndexOf(data, key);
  1531. if (index < 0) {
  1532. return false;
  1533. }
  1534. var lastIndex = data.length - 1;
  1535. if (index == lastIndex) {
  1536. data.pop();
  1537. } else {
  1538. splice.call(data, index, 1);
  1539. }
  1540. return true;
  1541. }
  1542. /**
  1543. * Gets the list cache value for `key`.
  1544. *
  1545. * @private
  1546. * @name get
  1547. * @memberOf ListCache
  1548. * @param {string} key The key of the value to get.
  1549. * @returns {*} Returns the entry value.
  1550. */
  1551. function listCacheGet(key) {
  1552. var data = this.__data__,
  1553. index = assocIndexOf(data, key);
  1554. return index < 0 ? undefined : data[index][1];
  1555. }
  1556. /**
  1557. * Checks if a list cache value for `key` exists.
  1558. *
  1559. * @private
  1560. * @name has
  1561. * @memberOf ListCache
  1562. * @param {string} key The key of the entry to check.
  1563. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1564. */
  1565. function listCacheHas(key) {
  1566. return assocIndexOf(this.__data__, key) > -1;
  1567. }
  1568. /**
  1569. * Sets the list cache `key` to `value`.
  1570. *
  1571. * @private
  1572. * @name set
  1573. * @memberOf ListCache
  1574. * @param {string} key The key of the value to set.
  1575. * @param {*} value The value to set.
  1576. * @returns {Object} Returns the list cache instance.
  1577. */
  1578. function listCacheSet(key, value) {
  1579. var data = this.__data__,
  1580. index = assocIndexOf(data, key);
  1581. if (index < 0) {
  1582. data.push([key, value]);
  1583. } else {
  1584. data[index][1] = value;
  1585. }
  1586. return this;
  1587. }
  1588. // Add methods to `ListCache`.
  1589. ListCache.prototype.clear = listCacheClear;
  1590. ListCache.prototype['delete'] = listCacheDelete;
  1591. ListCache.prototype.get = listCacheGet;
  1592. ListCache.prototype.has = listCacheHas;
  1593. ListCache.prototype.set = listCacheSet;
  1594. /**
  1595. * Creates a map cache object to store key-value pairs.
  1596. *
  1597. * @private
  1598. * @constructor
  1599. * @param {Array} [entries] The key-value pairs to cache.
  1600. */
  1601. function MapCache(entries) {
  1602. var index = -1,
  1603. length = entries ? entries.length : 0;
  1604. this.clear();
  1605. while (++index < length) {
  1606. var entry = entries[index];
  1607. this.set(entry[0], entry[1]);
  1608. }
  1609. }
  1610. /**
  1611. * Removes all key-value entries from the map.
  1612. *
  1613. * @private
  1614. * @name clear
  1615. * @memberOf MapCache
  1616. */
  1617. function mapCacheClear() {
  1618. this.__data__ = {
  1619. 'hash': new Hash,
  1620. 'map': new (Map || ListCache),
  1621. 'string': new Hash
  1622. };
  1623. }
  1624. /**
  1625. * Removes `key` and its value from the map.
  1626. *
  1627. * @private
  1628. * @name delete
  1629. * @memberOf MapCache
  1630. * @param {string} key The key of the value to remove.
  1631. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1632. */
  1633. function mapCacheDelete(key) {
  1634. return getMapData(this, key)['delete'](key);
  1635. }
  1636. /**
  1637. * Gets the map value for `key`.
  1638. *
  1639. * @private
  1640. * @name get
  1641. * @memberOf MapCache
  1642. * @param {string} key The key of the value to get.
  1643. * @returns {*} Returns the entry value.
  1644. */
  1645. function mapCacheGet(key) {
  1646. return getMapData(this, key).get(key);
  1647. }
  1648. /**
  1649. * Checks if a map value for `key` exists.
  1650. *
  1651. * @private
  1652. * @name has
  1653. * @memberOf MapCache
  1654. * @param {string} key The key of the entry to check.
  1655. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1656. */
  1657. function mapCacheHas(key) {
  1658. return getMapData(this, key).has(key);
  1659. }
  1660. /**
  1661. * Sets the map `key` to `value`.
  1662. *
  1663. * @private
  1664. * @name set
  1665. * @memberOf MapCache
  1666. * @param {string} key The key of the value to set.
  1667. * @param {*} value The value to set.
  1668. * @returns {Object} Returns the map cache instance.
  1669. */
  1670. function mapCacheSet(key, value) {
  1671. getMapData(this, key).set(key, value);
  1672. return this;
  1673. }
  1674. // Add methods to `MapCache`.
  1675. MapCache.prototype.clear = mapCacheClear;
  1676. MapCache.prototype['delete'] = mapCacheDelete;
  1677. MapCache.prototype.get = mapCacheGet;
  1678. MapCache.prototype.has = mapCacheHas;
  1679. MapCache.prototype.set = mapCacheSet;
  1680. /**
  1681. *
  1682. * Creates an array cache object to store unique values.
  1683. *
  1684. * @private
  1685. * @constructor
  1686. * @param {Array} [values] The values to cache.
  1687. */
  1688. function SetCache(values) {
  1689. var index = -1,
  1690. length = values ? values.length : 0;
  1691. this.__data__ = new MapCache;
  1692. while (++index < length) {
  1693. this.add(values[index]);
  1694. }
  1695. }
  1696. /**
  1697. * Adds `value` to the array cache.
  1698. *
  1699. * @private
  1700. * @name add
  1701. * @memberOf SetCache
  1702. * @alias push
  1703. * @param {*} value The value to cache.
  1704. * @returns {Object} Returns the cache instance.
  1705. */
  1706. function setCacheAdd(value) {
  1707. this.__data__.set(value, HASH_UNDEFINED);
  1708. return this;
  1709. }
  1710. /**
  1711. * Checks if `value` is in the array cache.
  1712. *
  1713. * @private
  1714. * @name has
  1715. * @memberOf SetCache
  1716. * @param {*} value The value to search for.
  1717. * @returns {number} Returns `true` if `value` is found, else `false`.
  1718. */
  1719. function setCacheHas(value) {
  1720. return this.__data__.has(value);
  1721. }
  1722. // Add methods to `SetCache`.
  1723. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  1724. SetCache.prototype.has = setCacheHas;
  1725. /**
  1726. * Gets the index at which the `key` is found in `array` of key-value pairs.
  1727. *
  1728. * @private
  1729. * @param {Array} array The array to inspect.
  1730. * @param {*} key The key to search for.
  1731. * @returns {number} Returns the index of the matched value, else `-1`.
  1732. */
  1733. function assocIndexOf(array, key) {
  1734. var length = array.length;
  1735. while (length--) {
  1736. if (eq(array[length][0], key)) {
  1737. return length;
  1738. }
  1739. }
  1740. return -1;
  1741. }
  1742. /**
  1743. * The base implementation of `_.isNative` without bad shim checks.
  1744. *
  1745. * @private
  1746. * @param {*} value The value to check.
  1747. * @returns {boolean} Returns `true` if `value` is a native function,
  1748. * else `false`.
  1749. */
  1750. function baseIsNative(value) {
  1751. if (!isObject(value) || isMasked(value)) {
  1752. return false;
  1753. }
  1754. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  1755. return pattern.test(toSource(value));
  1756. }
  1757. /**
  1758. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  1759. *
  1760. * @private
  1761. * @param {Array} array The array to inspect.
  1762. * @param {Function} [iteratee] The iteratee invoked per element.
  1763. * @param {Function} [comparator] The comparator invoked per element.
  1764. * @returns {Array} Returns the new duplicate free array.
  1765. */
  1766. function baseUniq(array, iteratee, comparator) {
  1767. var index = -1,
  1768. includes = arrayIncludes,
  1769. length = array.length,
  1770. isCommon = true,
  1771. result = [],
  1772. seen = result;
  1773. if (comparator) {
  1774. isCommon = false;
  1775. includes = arrayIncludesWith;
  1776. }
  1777. else if (length >= LARGE_ARRAY_SIZE) {
  1778. var set = iteratee ? null : createSet(array);
  1779. if (set) {
  1780. return setToArray(set);
  1781. }
  1782. isCommon = false;
  1783. includes = cacheHas;
  1784. seen = new SetCache;
  1785. }
  1786. else {
  1787. seen = iteratee ? [] : result;
  1788. }
  1789. outer:
  1790. while (++index < length) {
  1791. var value = array[index],
  1792. computed = iteratee ? iteratee(value) : value;
  1793. value = (comparator || value !== 0) ? value : 0;
  1794. if (isCommon && computed === computed) {
  1795. var seenIndex = seen.length;
  1796. while (seenIndex--) {
  1797. if (seen[seenIndex] === computed) {
  1798. continue outer;
  1799. }
  1800. }
  1801. if (iteratee) {
  1802. seen.push(computed);
  1803. }
  1804. result.push(value);
  1805. }
  1806. else if (!includes(seen, computed, comparator)) {
  1807. if (seen !== result) {
  1808. seen.push(computed);
  1809. }
  1810. result.push(value);
  1811. }
  1812. }
  1813. return result;
  1814. }
  1815. /**
  1816. * Creates a set object of `values`.
  1817. *
  1818. * @private
  1819. * @param {Array} values The values to add to the set.
  1820. * @returns {Object} Returns the new set.
  1821. */
  1822. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  1823. return new Set(values);
  1824. };
  1825. /**
  1826. * Gets the data for `map`.
  1827. *
  1828. * @private
  1829. * @param {Object} map The map to query.
  1830. * @param {string} key The reference key.
  1831. * @returns {*} Returns the map data.
  1832. */
  1833. function getMapData(map, key) {
  1834. var data = map.__data__;
  1835. return isKeyable(key)
  1836. ? data[typeof key == 'string' ? 'string' : 'hash']
  1837. : data.map;
  1838. }
  1839. /**
  1840. * Gets the native function at `key` of `object`.
  1841. *
  1842. * @private
  1843. * @param {Object} object The object to query.
  1844. * @param {string} key The key of the method to get.
  1845. * @returns {*} Returns the function if it's native, else `undefined`.
  1846. */
  1847. function getNative(object, key) {
  1848. var value = getValue(object, key);
  1849. return baseIsNative(value) ? value : undefined;
  1850. }
  1851. /**
  1852. * Checks if `value` is suitable for use as unique object key.
  1853. *
  1854. * @private
  1855. * @param {*} value The value to check.
  1856. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  1857. */
  1858. function isKeyable(value) {
  1859. var type = typeof value;
  1860. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  1861. ? (value !== '__proto__')
  1862. : (value === null);
  1863. }
  1864. /**
  1865. * Checks if `func` has its source masked.
  1866. *
  1867. * @private
  1868. * @param {Function} func The function to check.
  1869. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  1870. */
  1871. function isMasked(func) {
  1872. return !!maskSrcKey && (maskSrcKey in func);
  1873. }
  1874. /**
  1875. * Converts `func` to its source code.
  1876. *
  1877. * @private
  1878. * @param {Function} func The function to process.
  1879. * @returns {string} Returns the source code.
  1880. */
  1881. function toSource(func) {
  1882. if (func != null) {
  1883. try {
  1884. return funcToString.call(func);
  1885. } catch (e) {}
  1886. try {
  1887. return (func + '');
  1888. } catch (e) {}
  1889. }
  1890. return '';
  1891. }
  1892. /**
  1893. * Creates a duplicate-free version of an array, using
  1894. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  1895. * for equality comparisons, in which only the first occurrence of each
  1896. * element is kept.
  1897. *
  1898. * @static
  1899. * @memberOf _
  1900. * @since 0.1.0
  1901. * @category Array
  1902. * @param {Array} array The array to inspect.
  1903. * @returns {Array} Returns the new duplicate free array.
  1904. * @example
  1905. *
  1906. * _.uniq([2, 1, 2]);
  1907. * // => [2, 1]
  1908. */
  1909. function uniq(array) {
  1910. return (array && array.length)
  1911. ? baseUniq(array)
  1912. : [];
  1913. }
  1914. /**
  1915. * Performs a
  1916. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  1917. * comparison between two values to determine if they are equivalent.
  1918. *
  1919. * @static
  1920. * @memberOf _
  1921. * @since 4.0.0
  1922. * @category Lang
  1923. * @param {*} value The value to compare.
  1924. * @param {*} other The other value to compare.
  1925. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  1926. * @example
  1927. *
  1928. * var object = { 'a': 1 };
  1929. * var other = { 'a': 1 };
  1930. *
  1931. * _.eq(object, object);
  1932. * // => true
  1933. *
  1934. * _.eq(object, other);
  1935. * // => false
  1936. *
  1937. * _.eq('a', 'a');
  1938. * // => true
  1939. *
  1940. * _.eq('a', Object('a'));
  1941. * // => false
  1942. *
  1943. * _.eq(NaN, NaN);
  1944. * // => true
  1945. */
  1946. function eq(value, other) {
  1947. return value === other || (value !== value && other !== other);
  1948. }
  1949. /**
  1950. * Checks if `value` is classified as a `Function` object.
  1951. *
  1952. * @static
  1953. * @memberOf _
  1954. * @since 0.1.0
  1955. * @category Lang
  1956. * @param {*} value The value to check.
  1957. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  1958. * @example
  1959. *
  1960. * _.isFunction(_);
  1961. * // => true
  1962. *
  1963. * _.isFunction(/abc/);
  1964. * // => false
  1965. */
  1966. function isFunction(value) {
  1967. // The use of `Object#toString` avoids issues with the `typeof` operator
  1968. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  1969. var tag = isObject(value) ? objectToString.call(value) : '';
  1970. return tag == funcTag || tag == genTag;
  1971. }
  1972. /**
  1973. * Checks if `value` is the
  1974. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  1975. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  1976. *
  1977. * @static
  1978. * @memberOf _
  1979. * @since 0.1.0
  1980. * @category Lang
  1981. * @param {*} value The value to check.
  1982. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  1983. * @example
  1984. *
  1985. * _.isObject({});
  1986. * // => true
  1987. *
  1988. * _.isObject([1, 2, 3]);
  1989. * // => true
  1990. *
  1991. * _.isObject(_.noop);
  1992. * // => true
  1993. *
  1994. * _.isObject(null);
  1995. * // => false
  1996. */
  1997. function isObject(value) {
  1998. var type = typeof value;
  1999. return !!value && (type == 'object' || type == 'function');
  2000. }
  2001. /**
  2002. * This method returns `undefined`.
  2003. *
  2004. * @static
  2005. * @memberOf _
  2006. * @since 2.3.0
  2007. * @category Util
  2008. * @example
  2009. *
  2010. * _.times(2, _.noop);
  2011. * // => [undefined, undefined]
  2012. */
  2013. function noop() {
  2014. // No operation performed.
  2015. }
  2016. module.exports = uniq;
  2017. /***/ }),
  2018. /***/ 129:
  2019. /***/ (function(module) {
  2020. module.exports = require("child_process");
  2021. /***/ }),
  2022. /***/ 139:
  2023. /***/ (function(module, __unusedexports, __webpack_require__) {
  2024. // Unique ID creation requires a high quality random # generator. In node.js
  2025. // this is pretty straight-forward - we use the crypto API.
  2026. var crypto = __webpack_require__(417);
  2027. module.exports = function nodeRNG() {
  2028. return crypto.randomBytes(16);
  2029. };
  2030. /***/ }),
  2031. /***/ 141:
  2032. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2033. "use strict";
  2034. var net = __webpack_require__(631);
  2035. var tls = __webpack_require__(16);
  2036. var http = __webpack_require__(605);
  2037. var https = __webpack_require__(211);
  2038. var events = __webpack_require__(614);
  2039. var assert = __webpack_require__(357);
  2040. var util = __webpack_require__(669);
  2041. exports.httpOverHttp = httpOverHttp;
  2042. exports.httpsOverHttp = httpsOverHttp;
  2043. exports.httpOverHttps = httpOverHttps;
  2044. exports.httpsOverHttps = httpsOverHttps;
  2045. function httpOverHttp(options) {
  2046. var agent = new TunnelingAgent(options);
  2047. agent.request = http.request;
  2048. return agent;
  2049. }
  2050. function httpsOverHttp(options) {
  2051. var agent = new TunnelingAgent(options);
  2052. agent.request = http.request;
  2053. agent.createSocket = createSecureSocket;
  2054. return agent;
  2055. }
  2056. function httpOverHttps(options) {
  2057. var agent = new TunnelingAgent(options);
  2058. agent.request = https.request;
  2059. return agent;
  2060. }
  2061. function httpsOverHttps(options) {
  2062. var agent = new TunnelingAgent(options);
  2063. agent.request = https.request;
  2064. agent.createSocket = createSecureSocket;
  2065. return agent;
  2066. }
  2067. function TunnelingAgent(options) {
  2068. var self = this;
  2069. self.options = options || {};
  2070. self.proxyOptions = self.options.proxy || {};
  2071. self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;
  2072. self.requests = [];
  2073. self.sockets = [];
  2074. self.on('free', function onFree(socket, host, port, localAddress) {
  2075. var options = toOptions(host, port, localAddress);
  2076. for (var i = 0, len = self.requests.length; i < len; ++i) {
  2077. var pending = self.requests[i];
  2078. if (pending.host === options.host && pending.port === options.port) {
  2079. // Detect the request to connect same origin server,
  2080. // reuse the connection.
  2081. self.requests.splice(i, 1);
  2082. pending.request.onSocket(socket);
  2083. return;
  2084. }
  2085. }
  2086. socket.destroy();
  2087. self.removeSocket(socket);
  2088. });
  2089. }
  2090. util.inherits(TunnelingAgent, events.EventEmitter);
  2091. TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {
  2092. var self = this;
  2093. var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));
  2094. if (self.sockets.length >= this.maxSockets) {
  2095. // We are over limit so we'll add it to the queue.
  2096. self.requests.push(options);
  2097. return;
  2098. }
  2099. // If we are under maxSockets create a new one.
  2100. self.createSocket(options, function(socket) {
  2101. socket.on('free', onFree);
  2102. socket.on('close', onCloseOrRemove);
  2103. socket.on('agentRemove', onCloseOrRemove);
  2104. req.onSocket(socket);
  2105. function onFree() {
  2106. self.emit('free', socket, options);
  2107. }
  2108. function onCloseOrRemove(err) {
  2109. self.removeSocket(socket);
  2110. socket.removeListener('free', onFree);
  2111. socket.removeListener('close', onCloseOrRemove);
  2112. socket.removeListener('agentRemove', onCloseOrRemove);
  2113. }
  2114. });
  2115. };
  2116. TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
  2117. var self = this;
  2118. var placeholder = {};
  2119. self.sockets.push(placeholder);
  2120. var connectOptions = mergeOptions({}, self.proxyOptions, {
  2121. method: 'CONNECT',
  2122. path: options.host + ':' + options.port,
  2123. agent: false
  2124. });
  2125. if (connectOptions.proxyAuth) {
  2126. connectOptions.headers = connectOptions.headers || {};
  2127. connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
  2128. new Buffer(connectOptions.proxyAuth).toString('base64');
  2129. }
  2130. debug('making CONNECT request');
  2131. var connectReq = self.request(connectOptions);
  2132. connectReq.useChunkedEncodingByDefault = false; // for v0.6
  2133. connectReq.once('response', onResponse); // for v0.6
  2134. connectReq.once('upgrade', onUpgrade); // for v0.6
  2135. connectReq.once('connect', onConnect); // for v0.7 or later
  2136. connectReq.once('error', onError);
  2137. connectReq.end();
  2138. function onResponse(res) {
  2139. // Very hacky. This is necessary to avoid http-parser leaks.
  2140. res.upgrade = true;
  2141. }
  2142. function onUpgrade(res, socket, head) {
  2143. // Hacky.
  2144. process.nextTick(function() {
  2145. onConnect(res, socket, head);
  2146. });
  2147. }
  2148. function onConnect(res, socket, head) {
  2149. connectReq.removeAllListeners();
  2150. socket.removeAllListeners();
  2151. if (res.statusCode === 200) {
  2152. assert.equal(head.length, 0);
  2153. debug('tunneling connection has established');
  2154. self.sockets[self.sockets.indexOf(placeholder)] = socket;
  2155. cb(socket);
  2156. } else {
  2157. debug('tunneling socket could not be established, statusCode=%d',
  2158. res.statusCode);
  2159. var error = new Error('tunneling socket could not be established, ' +
  2160. 'statusCode=' + res.statusCode);
  2161. error.code = 'ECONNRESET';
  2162. options.request.emit('error', error);
  2163. self.removeSocket(placeholder);
  2164. }
  2165. }
  2166. function onError(cause) {
  2167. connectReq.removeAllListeners();
  2168. debug('tunneling socket could not be established, cause=%s\n',
  2169. cause.message, cause.stack);
  2170. var error = new Error('tunneling socket could not be established, ' +
  2171. 'cause=' + cause.message);
  2172. error.code = 'ECONNRESET';
  2173. options.request.emit('error', error);
  2174. self.removeSocket(placeholder);
  2175. }
  2176. };
  2177. TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
  2178. var pos = this.sockets.indexOf(socket)
  2179. if (pos === -1) {
  2180. return;
  2181. }
  2182. this.sockets.splice(pos, 1);
  2183. var pending = this.requests.shift();
  2184. if (pending) {
  2185. // If we have pending requests and a socket gets closed a new one
  2186. // needs to be created to take over in the pool for the one that closed.
  2187. this.createSocket(pending, function(socket) {
  2188. pending.request.onSocket(socket);
  2189. });
  2190. }
  2191. };
  2192. function createSecureSocket(options, cb) {
  2193. var self = this;
  2194. TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
  2195. var hostHeader = options.request.getHeader('host');
  2196. var tlsOptions = mergeOptions({}, self.options, {
  2197. socket: socket,
  2198. servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host
  2199. });
  2200. // 0 is dummy port for v0.6
  2201. var secureSocket = tls.connect(0, tlsOptions);
  2202. self.sockets[self.sockets.indexOf(socket)] = secureSocket;
  2203. cb(secureSocket);
  2204. });
  2205. }
  2206. function toOptions(host, port, localAddress) {
  2207. if (typeof host === 'string') { // since v0.10
  2208. return {
  2209. host: host,
  2210. port: port,
  2211. localAddress: localAddress
  2212. };
  2213. }
  2214. return host; // for v0.11 or later
  2215. }
  2216. function mergeOptions(target) {
  2217. for (var i = 1, len = arguments.length; i < len; ++i) {
  2218. var overrides = arguments[i];
  2219. if (typeof overrides === 'object') {
  2220. var keys = Object.keys(overrides);
  2221. for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
  2222. var k = keys[j];
  2223. if (overrides[k] !== undefined) {
  2224. target[k] = overrides[k];
  2225. }
  2226. }
  2227. }
  2228. }
  2229. return target;
  2230. }
  2231. var debug;
  2232. if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
  2233. debug = function() {
  2234. var args = Array.prototype.slice.call(arguments);
  2235. if (typeof args[0] === 'string') {
  2236. args[0] = 'TUNNEL: ' + args[0];
  2237. } else {
  2238. args.unshift('TUNNEL:');
  2239. }
  2240. console.error.apply(console, args);
  2241. }
  2242. } else {
  2243. debug = function() {};
  2244. }
  2245. exports.debug = debug; // for test
  2246. /***/ }),
  2247. /***/ 143:
  2248. /***/ (function(module, __unusedexports, __webpack_require__) {
  2249. module.exports = withAuthorizationPrefix;
  2250. const atob = __webpack_require__(368);
  2251. const REGEX_IS_BASIC_AUTH = /^[\w-]+:/;
  2252. function withAuthorizationPrefix(authorization) {
  2253. if (/^(basic|bearer|token) /i.test(authorization)) {
  2254. return authorization;
  2255. }
  2256. try {
  2257. if (REGEX_IS_BASIC_AUTH.test(atob(authorization))) {
  2258. return `basic ${authorization}`;
  2259. }
  2260. } catch (error) {}
  2261. if (authorization.split(/\./).length === 3) {
  2262. return `bearer ${authorization}`;
  2263. }
  2264. return `token ${authorization}`;
  2265. }
  2266. /***/ }),
  2267. /***/ 145:
  2268. /***/ (function(module, __unusedexports, __webpack_require__) {
  2269. "use strict";
  2270. const pump = __webpack_require__(453);
  2271. const bufferStream = __webpack_require__(966);
  2272. class MaxBufferError extends Error {
  2273. constructor() {
  2274. super('maxBuffer exceeded');
  2275. this.name = 'MaxBufferError';
  2276. }
  2277. }
  2278. function getStream(inputStream, options) {
  2279. if (!inputStream) {
  2280. return Promise.reject(new Error('Expected a stream'));
  2281. }
  2282. options = Object.assign({maxBuffer: Infinity}, options);
  2283. const {maxBuffer} = options;
  2284. let stream;
  2285. return new Promise((resolve, reject) => {
  2286. const rejectPromise = error => {
  2287. if (error) { // A null check
  2288. error.bufferedData = stream.getBufferedValue();
  2289. }
  2290. reject(error);
  2291. };
  2292. stream = pump(inputStream, bufferStream(options), error => {
  2293. if (error) {
  2294. rejectPromise(error);
  2295. return;
  2296. }
  2297. resolve();
  2298. });
  2299. stream.on('data', () => {
  2300. if (stream.getBufferedLength() > maxBuffer) {
  2301. rejectPromise(new MaxBufferError());
  2302. }
  2303. });
  2304. }).then(() => stream.getBufferedValue());
  2305. }
  2306. module.exports = getStream;
  2307. module.exports.buffer = (stream, options) => getStream(stream, Object.assign({}, options, {encoding: 'buffer'}));
  2308. module.exports.array = (stream, options) => getStream(stream, Object.assign({}, options, {array: true}));
  2309. module.exports.MaxBufferError = MaxBufferError;
  2310. /***/ }),
  2311. /***/ 148:
  2312. /***/ (function(module, __unusedexports, __webpack_require__) {
  2313. module.exports = paginatePlugin;
  2314. const iterator = __webpack_require__(8);
  2315. const paginate = __webpack_require__(807);
  2316. function paginatePlugin(octokit) {
  2317. octokit.paginate = paginate.bind(null, octokit);
  2318. octokit.paginate.iterator = iterator.bind(null, octokit);
  2319. }
  2320. /***/ }),
  2321. /***/ 168:
  2322. /***/ (function(module) {
  2323. "use strict";
  2324. const alias = ['stdin', 'stdout', 'stderr'];
  2325. const hasAlias = opts => alias.some(x => Boolean(opts[x]));
  2326. module.exports = opts => {
  2327. if (!opts) {
  2328. return null;
  2329. }
  2330. if (opts.stdio && hasAlias(opts)) {
  2331. throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${alias.map(x => `\`${x}\``).join(', ')}`);
  2332. }
  2333. if (typeof opts.stdio === 'string') {
  2334. return opts.stdio;
  2335. }
  2336. const stdio = opts.stdio || [];
  2337. if (!Array.isArray(stdio)) {
  2338. throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``);
  2339. }
  2340. const result = [];
  2341. const len = Math.max(stdio.length, alias.length);
  2342. for (let i = 0; i < len; i++) {
  2343. let value = null;
  2344. if (stdio[i] !== undefined) {
  2345. value = stdio[i];
  2346. } else if (opts[alias[i]] !== undefined) {
  2347. value = opts[alias[i]];
  2348. }
  2349. result[i] = value;
  2350. }
  2351. return result;
  2352. };
  2353. /***/ }),
  2354. /***/ 190:
  2355. /***/ (function(module, __unusedexports, __webpack_require__) {
  2356. module.exports = authenticationPlugin;
  2357. const beforeRequest = __webpack_require__(863);
  2358. const requestError = __webpack_require__(991);
  2359. const validate = __webpack_require__(954);
  2360. function authenticationPlugin(octokit, options) {
  2361. if (!options.auth) {
  2362. return;
  2363. }
  2364. validate(options.auth);
  2365. const state = {
  2366. octokit,
  2367. auth: options.auth
  2368. };
  2369. octokit.hook.before("request", beforeRequest.bind(null, state));
  2370. octokit.hook.error("request", requestError.bind(null, state));
  2371. }
  2372. /***/ }),
  2373. /***/ 197:
  2374. /***/ (function(module, __unusedexports, __webpack_require__) {
  2375. module.exports = isexe
  2376. isexe.sync = sync
  2377. var fs = __webpack_require__(747)
  2378. function isexe (path, options, cb) {
  2379. fs.stat(path, function (er, stat) {
  2380. cb(er, er ? false : checkStat(stat, options))
  2381. })
  2382. }
  2383. function sync (path, options) {
  2384. return checkStat(fs.statSync(path), options)
  2385. }
  2386. function checkStat (stat, options) {
  2387. return stat.isFile() && checkMode(stat, options)
  2388. }
  2389. function checkMode (stat, options) {
  2390. var mod = stat.mode
  2391. var uid = stat.uid
  2392. var gid = stat.gid
  2393. var myUid = options.uid !== undefined ?
  2394. options.uid : process.getuid && process.getuid()
  2395. var myGid = options.gid !== undefined ?
  2396. options.gid : process.getgid && process.getgid()
  2397. var u = parseInt('100', 8)
  2398. var g = parseInt('010', 8)
  2399. var o = parseInt('001', 8)
  2400. var ug = u | g
  2401. var ret = (mod & o) ||
  2402. (mod & g) && gid === myGid ||
  2403. (mod & u) && uid === myUid ||
  2404. (mod & ug) && myUid === 0
  2405. return ret
  2406. }
  2407. /***/ }),
  2408. /***/ 198:
  2409. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2410. "use strict";
  2411. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2412. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2413. return new (P || (P = Promise))(function (resolve, reject) {
  2414. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2415. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2416. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2417. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2418. });
  2419. };
  2420. var __importStar = (this && this.__importStar) || function (mod) {
  2421. if (mod && mod.__esModule) return mod;
  2422. var result = {};
  2423. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  2424. result["default"] = mod;
  2425. return result;
  2426. };
  2427. Object.defineProperty(exports, "__esModule", { value: true });
  2428. const core = __importStar(__webpack_require__(470));
  2429. const coreCommand = __importStar(__webpack_require__(431));
  2430. const gitSourceProvider = __importStar(__webpack_require__(293));
  2431. const inputHelper = __importStar(__webpack_require__(821));
  2432. const path = __importStar(__webpack_require__(622));
  2433. const cleanupRepositoryPath = process.env['STATE_repositoryPath'];
  2434. function run() {
  2435. return __awaiter(this, void 0, void 0, function* () {
  2436. try {
  2437. const sourceSettings = inputHelper.getInputs();
  2438. try {
  2439. // Register problem matcher
  2440. coreCommand.issueCommand('add-matcher', {}, path.join(__dirname, 'problem-matcher.json'));
  2441. // Get sources
  2442. yield gitSourceProvider.getSource(sourceSettings);
  2443. }
  2444. finally {
  2445. // Unregister problem matcher
  2446. coreCommand.issueCommand('remove-matcher', { owner: 'checkout-git' }, '');
  2447. }
  2448. }
  2449. catch (error) {
  2450. core.setFailed(error.message);
  2451. }
  2452. });
  2453. }
  2454. function cleanup() {
  2455. return __awaiter(this, void 0, void 0, function* () {
  2456. try {
  2457. yield gitSourceProvider.cleanup(cleanupRepositoryPath);
  2458. }
  2459. catch (error) {
  2460. core.warning(error.message);
  2461. }
  2462. });
  2463. }
  2464. // Main
  2465. if (!cleanupRepositoryPath) {
  2466. run();
  2467. }
  2468. // Post
  2469. else {
  2470. cleanup();
  2471. }
  2472. /***/ }),
  2473. /***/ 211:
  2474. /***/ (function(module) {
  2475. module.exports = require("https");
  2476. /***/ }),
  2477. /***/ 215:
  2478. /***/ (function(module) {
  2479. module.exports = {"name":"@octokit/rest","version":"16.35.0","publishConfig":{"access":"public"},"description":"GitHub REST API client for Node.js","keywords":["octokit","github","rest","api-client"],"author":"Gregor Martynus (https://github.com/gr2m)","contributors":[{"name":"Mike de Boer","email":"info@mikedeboer.nl"},{"name":"Fabian Jakobs","email":"fabian@c9.io"},{"name":"Joe Gallo","email":"joe@brassafrax.com"},{"name":"Gregor Martynus","url":"https://github.com/gr2m"}],"repository":"https://github.com/octokit/rest.js","dependencies":{"@octokit/request":"^5.2.0","@octokit/request-error":"^1.0.2","atob-lite":"^2.0.0","before-after-hook":"^2.0.0","btoa-lite":"^1.0.0","deprecation":"^2.0.0","lodash.get":"^4.4.2","lodash.set":"^4.3.2","lodash.uniq":"^4.5.0","octokit-pagination-methods":"^1.1.0","once":"^1.4.0","universal-user-agent":"^4.0.0"},"devDependencies":{"@gimenete/type-writer":"^0.1.3","@octokit/fixtures-server":"^5.0.6","@octokit/graphql":"^4.2.0","@types/node":"^12.0.0","bundlesize":"^0.18.0","chai":"^4.1.2","compression-webpack-plugin":"^3.0.0","cypress":"^3.0.0","glob":"^7.1.2","http-proxy-agent":"^2.1.0","lodash.camelcase":"^4.3.0","lodash.merge":"^4.6.1","lodash.upperfirst":"^4.3.1","mkdirp":"^0.5.1","mocha":"^6.0.0","mustache":"^3.0.0","nock":"^11.3.3","npm-run-all":"^4.1.2","nyc":"^14.0.0","prettier":"^1.14.2","proxy":"^1.0.0","semantic-release":"^15.0.0","sinon":"^7.2.4","sinon-chai":"^3.0.0","sort-keys":"^4.0.0","string-to-arraybuffer":"^1.0.0","string-to-jsdoc-comment":"^1.0.0","typescript":"^3.3.1","webpack":"^4.0.0","webpack-bundle-analyzer":"^3.0.0","webpack-cli":"^3.0.0"},"types":"index.d.ts","scripts":{"coverage":"nyc report --reporter=html && open coverage/index.html","lint":"prettier --check '{lib,plugins,scripts,test}/**/*.{js,json,ts}' 'docs/*.{js,json}' 'docs/src/**/*' index.js README.md package.json","lint:fix":"prettier --write '{lib,plugins,scripts,test}/**/*.{js,json,ts}' 'docs/*.{js,json}' 'docs/src/**/*' index.js README.md package.json","pretest":"npm run -s lint","test":"nyc mocha test/mocha-node-setup.js \"test/*/**/*-test.js\"","test:browser":"cypress run --browser chrome","build":"npm-run-all build:*","build:ts":"npm run -s update-endpoints:typescript","prebuild:browser":"mkdirp dist/","build:browser":"npm-run-all build:browser:*","build:browser:development":"webpack --mode development --entry . --output-library=Octokit --output=./dist/octokit-rest.js --profile --json > dist/bundle-stats.json","build:browser:production":"webpack --mode production --entry . --plugin=compression-webpack-plugin --output-library=Octokit --output-path=./dist --output-filename=octokit-rest.min.js --devtool source-map","generate-bundle-report":"webpack-bundle-analyzer dist/bundle-stats.json --mode=static --no-open --report dist/bundle-report.html","update-endpoints":"npm-run-all update-endpoints:*","update-endpoints:fetch-json":"node scripts/update-endpoints/fetch-json","update-endpoints:code":"node scripts/update-endpoints/code","update-endpoints:typescript":"node scripts/update-endpoints/typescript","prevalidate:ts":"npm run -s build:ts","validate:ts":"tsc --target es6 --noImplicitAny index.d.ts","postvalidate:ts":"tsc --noEmit --target es6 test/typescript-validate.ts","start-fixtures-server":"octokit-fixtures-server"},"license":"MIT","files":["index.js","index.d.ts","lib","plugins"],"nyc":{"ignore":["test"]},"release":{"publish":["@semantic-release/npm",{"path":"@semantic-release/github","assets":["dist/*","!dist/*.map.gz"]}]},"bundlesize":[{"path":"./dist/octokit-rest.min.js.gz","maxSize":"33 kB"}],"_resolved":"https://registry.npmjs.org/@octokit/rest/-/rest-16.35.0.tgz","_integrity":"sha512-9ShFqYWo0CLoGYhA1FdtdykJuMzS/9H6vSbbQWDX4pWr4p9v+15MsH/wpd/3fIU+tSxylaNO48+PIHqOkBRx3w==","_from":"@octokit/rest@16.35.0"};
  2480. /***/ }),
  2481. /***/ 227:
  2482. /***/ (function(__unusedmodule, exports) {
  2483. "use strict";
  2484. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2485. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2486. return new (P || (P = Promise))(function (resolve, reject) {
  2487. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2488. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2489. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2490. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2491. });
  2492. };
  2493. Object.defineProperty(exports, "__esModule", { value: true });
  2494. function getDownloadRef(ref, commit) {
  2495. if (commit) {
  2496. return commit;
  2497. }
  2498. // todo fix this to work with refs/pull etc
  2499. return ref;
  2500. }
  2501. exports.getDownloadRef = getDownloadRef;
  2502. function getCheckoutInfo(git, ref, commit) {
  2503. return __awaiter(this, void 0, void 0, function* () {
  2504. if (!git) {
  2505. throw new Error('Arg git cannot be empty');
  2506. }
  2507. if (!ref && !commit) {
  2508. throw new Error('Args ref and commit cannot both be empty');
  2509. }
  2510. const result = {};
  2511. const upperRef = (ref || '').toUpperCase();
  2512. // SHA only
  2513. if (!ref) {
  2514. result.ref = commit;
  2515. }
  2516. // refs/heads/
  2517. else if (upperRef.startsWith('REFS/HEADS/')) {
  2518. const branch = ref.substring('refs/heads/'.length);
  2519. result.ref = branch;
  2520. result.startPoint = `refs/remotes/origin/${branch}`;
  2521. }
  2522. // refs/pull/
  2523. else if (upperRef.startsWith('REFS/PULL/')) {
  2524. const branch = ref.substring('refs/pull/'.length);
  2525. result.ref = `refs/remotes/pull/${branch}`;
  2526. }
  2527. // refs/tags/
  2528. else if (upperRef.startsWith('REFS/')) {
  2529. result.ref = ref;
  2530. }
  2531. // Unqualified ref, check for a matching branch or tag
  2532. else {
  2533. if (yield git.branchExists(true, `origin/${ref}`)) {
  2534. result.ref = ref;
  2535. result.startPoint = `refs/remotes/origin/${ref}`;
  2536. }
  2537. else if (yield git.tagExists(`${ref}`)) {
  2538. result.ref = `refs/tags/${ref}`;
  2539. }
  2540. else {
  2541. throw new Error(`A branch or tag with the name '${ref}' could not be found`);
  2542. }
  2543. }
  2544. return result;
  2545. });
  2546. }
  2547. exports.getCheckoutInfo = getCheckoutInfo;
  2548. function getRefSpec(ref, commit) {
  2549. if (!ref && !commit) {
  2550. throw new Error('Args ref and commit cannot both be empty');
  2551. }
  2552. const upperRef = (ref || '').toUpperCase();
  2553. // SHA
  2554. if (commit) {
  2555. // refs/heads
  2556. if (upperRef.startsWith('REFS/HEADS/')) {
  2557. const branch = ref.substring('refs/heads/'.length);
  2558. return [`+${commit}:refs/remotes/origin/${branch}`];
  2559. }
  2560. // refs/pull/
  2561. else if (upperRef.startsWith('REFS/PULL/')) {
  2562. const branch = ref.substring('refs/pull/'.length);
  2563. return [`+${commit}:refs/remotes/pull/${branch}`];
  2564. }
  2565. // refs/tags/
  2566. else if (upperRef.startsWith('REFS/TAGS/')) {
  2567. return [`+${commit}:${ref}`];
  2568. }
  2569. // Otherwise no destination ref
  2570. else {
  2571. return [commit];
  2572. }
  2573. }
  2574. // Unqualified ref, check for a matching branch or tag
  2575. else if (!upperRef.startsWith('REFS/')) {
  2576. return [
  2577. `+refs/heads/${ref}*:refs/remotes/origin/${ref}*`,
  2578. `+refs/tags/${ref}*:refs/tags/${ref}*`
  2579. ];
  2580. }
  2581. // refs/heads/
  2582. else if (upperRef.startsWith('REFS/HEADS/')) {
  2583. const branch = ref.substring('refs/heads/'.length);
  2584. return [`+${ref}:refs/remotes/origin/${branch}`];
  2585. }
  2586. // refs/pull/
  2587. else if (upperRef.startsWith('REFS/PULL/')) {
  2588. const branch = ref.substring('refs/pull/'.length);
  2589. return [`+${ref}:refs/remotes/pull/${branch}`];
  2590. }
  2591. // refs/tags/
  2592. else {
  2593. return [`+${ref}:${ref}`];
  2594. }
  2595. }
  2596. exports.getRefSpec = getRefSpec;
  2597. /***/ }),
  2598. /***/ 248:
  2599. /***/ (function(module, __unusedexports, __webpack_require__) {
  2600. module.exports = octokitRegisterEndpoints;
  2601. const registerEndpoints = __webpack_require__(899);
  2602. function octokitRegisterEndpoints(octokit) {
  2603. octokit.registerEndpoints = registerEndpoints.bind(null, octokit);
  2604. }
  2605. /***/ }),
  2606. /***/ 260:
  2607. /***/ (function(module, __unusedexports, __webpack_require__) {
  2608. // Note: since nyc uses this module to output coverage, any lines
  2609. // that are in the direct sync flow of nyc's outputCoverage are
  2610. // ignored, since we can never get coverage for them.
  2611. var assert = __webpack_require__(357)
  2612. var signals = __webpack_require__(654)
  2613. var EE = __webpack_require__(614)
  2614. /* istanbul ignore if */
  2615. if (typeof EE !== 'function') {
  2616. EE = EE.EventEmitter
  2617. }
  2618. var emitter
  2619. if (process.__signal_exit_emitter__) {
  2620. emitter = process.__signal_exit_emitter__
  2621. } else {
  2622. emitter = process.__signal_exit_emitter__ = new EE()
  2623. emitter.count = 0
  2624. emitter.emitted = {}
  2625. }
  2626. // Because this emitter is a global, we have to check to see if a
  2627. // previous version of this library failed to enable infinite listeners.
  2628. // I know what you're about to say. But literally everything about
  2629. // signal-exit is a compromise with evil. Get used to it.
  2630. if (!emitter.infinite) {
  2631. emitter.setMaxListeners(Infinity)
  2632. emitter.infinite = true
  2633. }
  2634. module.exports = function (cb, opts) {
  2635. assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler')
  2636. if (loaded === false) {
  2637. load()
  2638. }
  2639. var ev = 'exit'
  2640. if (opts && opts.alwaysLast) {
  2641. ev = 'afterexit'
  2642. }
  2643. var remove = function () {
  2644. emitter.removeListener(ev, cb)
  2645. if (emitter.listeners('exit').length === 0 &&
  2646. emitter.listeners('afterexit').length === 0) {
  2647. unload()
  2648. }
  2649. }
  2650. emitter.on(ev, cb)
  2651. return remove
  2652. }
  2653. module.exports.unload = unload
  2654. function unload () {
  2655. if (!loaded) {
  2656. return
  2657. }
  2658. loaded = false
  2659. signals.forEach(function (sig) {
  2660. try {
  2661. process.removeListener(sig, sigListeners[sig])
  2662. } catch (er) {}
  2663. })
  2664. process.emit = originalProcessEmit
  2665. process.reallyExit = originalProcessReallyExit
  2666. emitter.count -= 1
  2667. }
  2668. function emit (event, code, signal) {
  2669. if (emitter.emitted[event]) {
  2670. return
  2671. }
  2672. emitter.emitted[event] = true
  2673. emitter.emit(event, code, signal)
  2674. }
  2675. // { <signal>: <listener fn>, ... }
  2676. var sigListeners = {}
  2677. signals.forEach(function (sig) {
  2678. sigListeners[sig] = function listener () {
  2679. // If there are no other listeners, an exit is coming!
  2680. // Simplest way: remove us and then re-send the signal.
  2681. // We know that this will kill the process, so we can
  2682. // safely emit now.
  2683. var listeners = process.listeners(sig)
  2684. if (listeners.length === emitter.count) {
  2685. unload()
  2686. emit('exit', null, sig)
  2687. /* istanbul ignore next */
  2688. emit('afterexit', null, sig)
  2689. /* istanbul ignore next */
  2690. process.kill(process.pid, sig)
  2691. }
  2692. }
  2693. })
  2694. module.exports.signals = function () {
  2695. return signals
  2696. }
  2697. module.exports.load = load
  2698. var loaded = false
  2699. function load () {
  2700. if (loaded) {
  2701. return
  2702. }
  2703. loaded = true
  2704. // This is the number of onSignalExit's that are in play.
  2705. // It's important so that we can count the correct number of
  2706. // listeners on signals, and don't wait for the other one to
  2707. // handle it instead of us.
  2708. emitter.count += 1
  2709. signals = signals.filter(function (sig) {
  2710. try {
  2711. process.on(sig, sigListeners[sig])
  2712. return true
  2713. } catch (er) {
  2714. return false
  2715. }
  2716. })
  2717. process.emit = processEmit
  2718. process.reallyExit = processReallyExit
  2719. }
  2720. var originalProcessReallyExit = process.reallyExit
  2721. function processReallyExit (code) {
  2722. process.exitCode = code || 0
  2723. emit('exit', process.exitCode, null)
  2724. /* istanbul ignore next */
  2725. emit('afterexit', process.exitCode, null)
  2726. /* istanbul ignore next */
  2727. originalProcessReallyExit.call(process, process.exitCode)
  2728. }
  2729. var originalProcessEmit = process.emit
  2730. function processEmit (ev, arg) {
  2731. if (ev === 'exit') {
  2732. if (arg !== undefined) {
  2733. process.exitCode = arg
  2734. }
  2735. var ret = originalProcessEmit.apply(this, arguments)
  2736. emit('exit', process.exitCode, null)
  2737. /* istanbul ignore next */
  2738. emit('afterexit', process.exitCode, null)
  2739. return ret
  2740. } else {
  2741. return originalProcessEmit.apply(this, arguments)
  2742. }
  2743. }
  2744. /***/ }),
  2745. /***/ 262:
  2746. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2747. "use strict";
  2748. Object.defineProperty(exports, "__esModule", { value: true });
  2749. const fs_1 = __webpack_require__(747);
  2750. const os_1 = __webpack_require__(87);
  2751. class Context {
  2752. /**
  2753. * Hydrate the context from the environment
  2754. */
  2755. constructor() {
  2756. this.payload = {};
  2757. if (process.env.GITHUB_EVENT_PATH) {
  2758. if (fs_1.existsSync(process.env.GITHUB_EVENT_PATH)) {
  2759. this.payload = JSON.parse(fs_1.readFileSync(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' }));
  2760. }
  2761. else {
  2762. const path = process.env.GITHUB_EVENT_PATH;
  2763. process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${os_1.EOL}`);
  2764. }
  2765. }
  2766. this.eventName = process.env.GITHUB_EVENT_NAME;
  2767. this.sha = process.env.GITHUB_SHA;
  2768. this.ref = process.env.GITHUB_REF;
  2769. this.workflow = process.env.GITHUB_WORKFLOW;
  2770. this.action = process.env.GITHUB_ACTION;
  2771. this.actor = process.env.GITHUB_ACTOR;
  2772. }
  2773. get issue() {
  2774. const payload = this.payload;
  2775. return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pullRequest || payload).number });
  2776. }
  2777. get repo() {
  2778. if (process.env.GITHUB_REPOSITORY) {
  2779. const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');
  2780. return { owner, repo };
  2781. }
  2782. if (this.payload.repository) {
  2783. return {
  2784. owner: this.payload.repository.owner.login,
  2785. repo: this.payload.repository.name
  2786. };
  2787. }
  2788. throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'");
  2789. }
  2790. }
  2791. exports.Context = Context;
  2792. //# sourceMappingURL=context.js.map
  2793. /***/ }),
  2794. /***/ 265:
  2795. /***/ (function(module, __unusedexports, __webpack_require__) {
  2796. module.exports = getPage
  2797. const deprecate = __webpack_require__(370)
  2798. const getPageLinks = __webpack_require__(577)
  2799. const HttpError = __webpack_require__(297)
  2800. function getPage (octokit, link, which, headers) {
  2801. deprecate(`octokit.get${which.charAt(0).toUpperCase() + which.slice(1)}Page() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  2802. const url = getPageLinks(link)[which]
  2803. if (!url) {
  2804. const urlError = new HttpError(`No ${which} page found`, 404)
  2805. return Promise.reject(urlError)
  2806. }
  2807. const requestOptions = {
  2808. url,
  2809. headers: applyAcceptHeader(link, headers)
  2810. }
  2811. const promise = octokit.request(requestOptions)
  2812. return promise
  2813. }
  2814. function applyAcceptHeader (res, headers) {
  2815. const previous = res.headers && res.headers['x-github-media-type']
  2816. if (!previous || (headers && headers.accept)) {
  2817. return headers
  2818. }
  2819. headers = headers || {}
  2820. headers.accept = 'application/vnd.' + previous
  2821. .replace('; param=', '.')
  2822. .replace('; format=', '+')
  2823. return headers
  2824. }
  2825. /***/ }),
  2826. /***/ 280:
  2827. /***/ (function(module, exports) {
  2828. exports = module.exports = SemVer
  2829. var debug
  2830. /* istanbul ignore next */
  2831. if (typeof process === 'object' &&
  2832. process.env &&
  2833. process.env.NODE_DEBUG &&
  2834. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  2835. debug = function () {
  2836. var args = Array.prototype.slice.call(arguments, 0)
  2837. args.unshift('SEMVER')
  2838. console.log.apply(console, args)
  2839. }
  2840. } else {
  2841. debug = function () {}
  2842. }
  2843. // Note: this is the semver.org version of the spec that it implements
  2844. // Not necessarily the package version of this code.
  2845. exports.SEMVER_SPEC_VERSION = '2.0.0'
  2846. var MAX_LENGTH = 256
  2847. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  2848. /* istanbul ignore next */ 9007199254740991
  2849. // Max safe segment length for coercion.
  2850. var MAX_SAFE_COMPONENT_LENGTH = 16
  2851. // The actual regexps go on exports.re
  2852. var re = exports.re = []
  2853. var src = exports.src = []
  2854. var R = 0
  2855. // The following Regular Expressions can be used for tokenizing,
  2856. // validating, and parsing SemVer version strings.
  2857. // ## Numeric Identifier
  2858. // A single `0`, or a non-zero digit followed by zero or more digits.
  2859. var NUMERICIDENTIFIER = R++
  2860. src[NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  2861. var NUMERICIDENTIFIERLOOSE = R++
  2862. src[NUMERICIDENTIFIERLOOSE] = '[0-9]+'
  2863. // ## Non-numeric Identifier
  2864. // Zero or more digits, followed by a letter or hyphen, and then zero or
  2865. // more letters, digits, or hyphens.
  2866. var NONNUMERICIDENTIFIER = R++
  2867. src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
  2868. // ## Main Version
  2869. // Three dot-separated numeric identifiers.
  2870. var MAINVERSION = R++
  2871. src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' +
  2872. '(' + src[NUMERICIDENTIFIER] + ')\\.' +
  2873. '(' + src[NUMERICIDENTIFIER] + ')'
  2874. var MAINVERSIONLOOSE = R++
  2875. src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
  2876. '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
  2877. '(' + src[NUMERICIDENTIFIERLOOSE] + ')'
  2878. // ## Pre-release Version Identifier
  2879. // A numeric identifier, or a non-numeric identifier.
  2880. var PRERELEASEIDENTIFIER = R++
  2881. src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] +
  2882. '|' + src[NONNUMERICIDENTIFIER] + ')'
  2883. var PRERELEASEIDENTIFIERLOOSE = R++
  2884. src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] +
  2885. '|' + src[NONNUMERICIDENTIFIER] + ')'
  2886. // ## Pre-release Version
  2887. // Hyphen, followed by one or more dot-separated pre-release version
  2888. // identifiers.
  2889. var PRERELEASE = R++
  2890. src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] +
  2891. '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))'
  2892. var PRERELEASELOOSE = R++
  2893. src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] +
  2894. '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))'
  2895. // ## Build Metadata Identifier
  2896. // Any combination of digits, letters, or hyphens.
  2897. var BUILDIDENTIFIER = R++
  2898. src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
  2899. // ## Build Metadata
  2900. // Plus sign, followed by one or more period-separated build metadata
  2901. // identifiers.
  2902. var BUILD = R++
  2903. src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] +
  2904. '(?:\\.' + src[BUILDIDENTIFIER] + ')*))'
  2905. // ## Full Version String
  2906. // A main version, followed optionally by a pre-release version and
  2907. // build metadata.
  2908. // Note that the only major, minor, patch, and pre-release sections of
  2909. // the version string are capturing groups. The build metadata is not a
  2910. // capturing group, because it should not ever be used in version
  2911. // comparison.
  2912. var FULL = R++
  2913. var FULLPLAIN = 'v?' + src[MAINVERSION] +
  2914. src[PRERELEASE] + '?' +
  2915. src[BUILD] + '?'
  2916. src[FULL] = '^' + FULLPLAIN + '$'
  2917. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  2918. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  2919. // common in the npm registry.
  2920. var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] +
  2921. src[PRERELEASELOOSE] + '?' +
  2922. src[BUILD] + '?'
  2923. var LOOSE = R++
  2924. src[LOOSE] = '^' + LOOSEPLAIN + '$'
  2925. var GTLT = R++
  2926. src[GTLT] = '((?:<|>)?=?)'
  2927. // Something like "2.*" or "1.2.x".
  2928. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  2929. // Only the first item is strictly required.
  2930. var XRANGEIDENTIFIERLOOSE = R++
  2931. src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  2932. var XRANGEIDENTIFIER = R++
  2933. src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*'
  2934. var XRANGEPLAIN = R++
  2935. src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' +
  2936. '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
  2937. '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
  2938. '(?:' + src[PRERELEASE] + ')?' +
  2939. src[BUILD] + '?' +
  2940. ')?)?'
  2941. var XRANGEPLAINLOOSE = R++
  2942. src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  2943. '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  2944. '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  2945. '(?:' + src[PRERELEASELOOSE] + ')?' +
  2946. src[BUILD] + '?' +
  2947. ')?)?'
  2948. var XRANGE = R++
  2949. src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'
  2950. var XRANGELOOSE = R++
  2951. src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$'
  2952. // Coercion.
  2953. // Extract anything that could conceivably be a part of a valid semver
  2954. var COERCE = R++
  2955. src[COERCE] = '(?:^|[^\\d])' +
  2956. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  2957. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  2958. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  2959. '(?:$|[^\\d])'
  2960. // Tilde ranges.
  2961. // Meaning is "reasonably at or greater than"
  2962. var LONETILDE = R++
  2963. src[LONETILDE] = '(?:~>?)'
  2964. var TILDETRIM = R++
  2965. src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+'
  2966. re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g')
  2967. var tildeTrimReplace = '$1~'
  2968. var TILDE = R++
  2969. src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'
  2970. var TILDELOOSE = R++
  2971. src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'
  2972. // Caret ranges.
  2973. // Meaning is "at least and backwards compatible with"
  2974. var LONECARET = R++
  2975. src[LONECARET] = '(?:\\^)'
  2976. var CARETTRIM = R++
  2977. src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+'
  2978. re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g')
  2979. var caretTrimReplace = '$1^'
  2980. var CARET = R++
  2981. src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$'
  2982. var CARETLOOSE = R++
  2983. src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$'
  2984. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  2985. var COMPARATORLOOSE = R++
  2986. src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$'
  2987. var COMPARATOR = R++
  2988. src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$'
  2989. // An expression to strip any whitespace between the gtlt and the thing
  2990. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  2991. var COMPARATORTRIM = R++
  2992. src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] +
  2993. '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'
  2994. // this one has to use the /g flag
  2995. re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g')
  2996. var comparatorTrimReplace = '$1$2$3'
  2997. // Something like `1.2.3 - 1.2.4`
  2998. // Note that these all use the loose form, because they'll be
  2999. // checked against either the strict or loose comparator form
  3000. // later.
  3001. var HYPHENRANGE = R++
  3002. src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' +
  3003. '\\s+-\\s+' +
  3004. '(' + src[XRANGEPLAIN] + ')' +
  3005. '\\s*$'
  3006. var HYPHENRANGELOOSE = R++
  3007. src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' +
  3008. '\\s+-\\s+' +
  3009. '(' + src[XRANGEPLAINLOOSE] + ')' +
  3010. '\\s*$'
  3011. // Star ranges basically just allow anything at all.
  3012. var STAR = R++
  3013. src[STAR] = '(<|>)?=?\\s*\\*'
  3014. // Compile to actual regexp objects.
  3015. // All are flag-free, unless they were created above with a flag.
  3016. for (var i = 0; i < R; i++) {
  3017. debug(i, src[i])
  3018. if (!re[i]) {
  3019. re[i] = new RegExp(src[i])
  3020. }
  3021. }
  3022. exports.parse = parse
  3023. function parse (version, options) {
  3024. if (!options || typeof options !== 'object') {
  3025. options = {
  3026. loose: !!options,
  3027. includePrerelease: false
  3028. }
  3029. }
  3030. if (version instanceof SemVer) {
  3031. return version
  3032. }
  3033. if (typeof version !== 'string') {
  3034. return null
  3035. }
  3036. if (version.length > MAX_LENGTH) {
  3037. return null
  3038. }
  3039. var r = options.loose ? re[LOOSE] : re[FULL]
  3040. if (!r.test(version)) {
  3041. return null
  3042. }
  3043. try {
  3044. return new SemVer(version, options)
  3045. } catch (er) {
  3046. return null
  3047. }
  3048. }
  3049. exports.valid = valid
  3050. function valid (version, options) {
  3051. var v = parse(version, options)
  3052. return v ? v.version : null
  3053. }
  3054. exports.clean = clean
  3055. function clean (version, options) {
  3056. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  3057. return s ? s.version : null
  3058. }
  3059. exports.SemVer = SemVer
  3060. function SemVer (version, options) {
  3061. if (!options || typeof options !== 'object') {
  3062. options = {
  3063. loose: !!options,
  3064. includePrerelease: false
  3065. }
  3066. }
  3067. if (version instanceof SemVer) {
  3068. if (version.loose === options.loose) {
  3069. return version
  3070. } else {
  3071. version = version.version
  3072. }
  3073. } else if (typeof version !== 'string') {
  3074. throw new TypeError('Invalid Version: ' + version)
  3075. }
  3076. if (version.length > MAX_LENGTH) {
  3077. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  3078. }
  3079. if (!(this instanceof SemVer)) {
  3080. return new SemVer(version, options)
  3081. }
  3082. debug('SemVer', version, options)
  3083. this.options = options
  3084. this.loose = !!options.loose
  3085. var m = version.trim().match(options.loose ? re[LOOSE] : re[FULL])
  3086. if (!m) {
  3087. throw new TypeError('Invalid Version: ' + version)
  3088. }
  3089. this.raw = version
  3090. // these are actually numbers
  3091. this.major = +m[1]
  3092. this.minor = +m[2]
  3093. this.patch = +m[3]
  3094. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  3095. throw new TypeError('Invalid major version')
  3096. }
  3097. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  3098. throw new TypeError('Invalid minor version')
  3099. }
  3100. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  3101. throw new TypeError('Invalid patch version')
  3102. }
  3103. // numberify any prerelease numeric ids
  3104. if (!m[4]) {
  3105. this.prerelease = []
  3106. } else {
  3107. this.prerelease = m[4].split('.').map(function (id) {
  3108. if (/^[0-9]+$/.test(id)) {
  3109. var num = +id
  3110. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  3111. return num
  3112. }
  3113. }
  3114. return id
  3115. })
  3116. }
  3117. this.build = m[5] ? m[5].split('.') : []
  3118. this.format()
  3119. }
  3120. SemVer.prototype.format = function () {
  3121. this.version = this.major + '.' + this.minor + '.' + this.patch
  3122. if (this.prerelease.length) {
  3123. this.version += '-' + this.prerelease.join('.')
  3124. }
  3125. return this.version
  3126. }
  3127. SemVer.prototype.toString = function () {
  3128. return this.version
  3129. }
  3130. SemVer.prototype.compare = function (other) {
  3131. debug('SemVer.compare', this.version, this.options, other)
  3132. if (!(other instanceof SemVer)) {
  3133. other = new SemVer(other, this.options)
  3134. }
  3135. return this.compareMain(other) || this.comparePre(other)
  3136. }
  3137. SemVer.prototype.compareMain = function (other) {
  3138. if (!(other instanceof SemVer)) {
  3139. other = new SemVer(other, this.options)
  3140. }
  3141. return compareIdentifiers(this.major, other.major) ||
  3142. compareIdentifiers(this.minor, other.minor) ||
  3143. compareIdentifiers(this.patch, other.patch)
  3144. }
  3145. SemVer.prototype.comparePre = function (other) {
  3146. if (!(other instanceof SemVer)) {
  3147. other = new SemVer(other, this.options)
  3148. }
  3149. // NOT having a prerelease is > having one
  3150. if (this.prerelease.length && !other.prerelease.length) {
  3151. return -1
  3152. } else if (!this.prerelease.length && other.prerelease.length) {
  3153. return 1
  3154. } else if (!this.prerelease.length && !other.prerelease.length) {
  3155. return 0
  3156. }
  3157. var i = 0
  3158. do {
  3159. var a = this.prerelease[i]
  3160. var b = other.prerelease[i]
  3161. debug('prerelease compare', i, a, b)
  3162. if (a === undefined && b === undefined) {
  3163. return 0
  3164. } else if (b === undefined) {
  3165. return 1
  3166. } else if (a === undefined) {
  3167. return -1
  3168. } else if (a === b) {
  3169. continue
  3170. } else {
  3171. return compareIdentifiers(a, b)
  3172. }
  3173. } while (++i)
  3174. }
  3175. // preminor will bump the version up to the next minor release, and immediately
  3176. // down to pre-release. premajor and prepatch work the same way.
  3177. SemVer.prototype.inc = function (release, identifier) {
  3178. switch (release) {
  3179. case 'premajor':
  3180. this.prerelease.length = 0
  3181. this.patch = 0
  3182. this.minor = 0
  3183. this.major++
  3184. this.inc('pre', identifier)
  3185. break
  3186. case 'preminor':
  3187. this.prerelease.length = 0
  3188. this.patch = 0
  3189. this.minor++
  3190. this.inc('pre', identifier)
  3191. break
  3192. case 'prepatch':
  3193. // If this is already a prerelease, it will bump to the next version
  3194. // drop any prereleases that might already exist, since they are not
  3195. // relevant at this point.
  3196. this.prerelease.length = 0
  3197. this.inc('patch', identifier)
  3198. this.inc('pre', identifier)
  3199. break
  3200. // If the input is a non-prerelease version, this acts the same as
  3201. // prepatch.
  3202. case 'prerelease':
  3203. if (this.prerelease.length === 0) {
  3204. this.inc('patch', identifier)
  3205. }
  3206. this.inc('pre', identifier)
  3207. break
  3208. case 'major':
  3209. // If this is a pre-major version, bump up to the same major version.
  3210. // Otherwise increment major.
  3211. // 1.0.0-5 bumps to 1.0.0
  3212. // 1.1.0 bumps to 2.0.0
  3213. if (this.minor !== 0 ||
  3214. this.patch !== 0 ||
  3215. this.prerelease.length === 0) {
  3216. this.major++
  3217. }
  3218. this.minor = 0
  3219. this.patch = 0
  3220. this.prerelease = []
  3221. break
  3222. case 'minor':
  3223. // If this is a pre-minor version, bump up to the same minor version.
  3224. // Otherwise increment minor.
  3225. // 1.2.0-5 bumps to 1.2.0
  3226. // 1.2.1 bumps to 1.3.0
  3227. if (this.patch !== 0 || this.prerelease.length === 0) {
  3228. this.minor++
  3229. }
  3230. this.patch = 0
  3231. this.prerelease = []
  3232. break
  3233. case 'patch':
  3234. // If this is not a pre-release version, it will increment the patch.
  3235. // If it is a pre-release it will bump up to the same patch version.
  3236. // 1.2.0-5 patches to 1.2.0
  3237. // 1.2.0 patches to 1.2.1
  3238. if (this.prerelease.length === 0) {
  3239. this.patch++
  3240. }
  3241. this.prerelease = []
  3242. break
  3243. // This probably shouldn't be used publicly.
  3244. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  3245. case 'pre':
  3246. if (this.prerelease.length === 0) {
  3247. this.prerelease = [0]
  3248. } else {
  3249. var i = this.prerelease.length
  3250. while (--i >= 0) {
  3251. if (typeof this.prerelease[i] === 'number') {
  3252. this.prerelease[i]++
  3253. i = -2
  3254. }
  3255. }
  3256. if (i === -1) {
  3257. // didn't increment anything
  3258. this.prerelease.push(0)
  3259. }
  3260. }
  3261. if (identifier) {
  3262. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  3263. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  3264. if (this.prerelease[0] === identifier) {
  3265. if (isNaN(this.prerelease[1])) {
  3266. this.prerelease = [identifier, 0]
  3267. }
  3268. } else {
  3269. this.prerelease = [identifier, 0]
  3270. }
  3271. }
  3272. break
  3273. default:
  3274. throw new Error('invalid increment argument: ' + release)
  3275. }
  3276. this.format()
  3277. this.raw = this.version
  3278. return this
  3279. }
  3280. exports.inc = inc
  3281. function inc (version, release, loose, identifier) {
  3282. if (typeof (loose) === 'string') {
  3283. identifier = loose
  3284. loose = undefined
  3285. }
  3286. try {
  3287. return new SemVer(version, loose).inc(release, identifier).version
  3288. } catch (er) {
  3289. return null
  3290. }
  3291. }
  3292. exports.diff = diff
  3293. function diff (version1, version2) {
  3294. if (eq(version1, version2)) {
  3295. return null
  3296. } else {
  3297. var v1 = parse(version1)
  3298. var v2 = parse(version2)
  3299. var prefix = ''
  3300. if (v1.prerelease.length || v2.prerelease.length) {
  3301. prefix = 'pre'
  3302. var defaultResult = 'prerelease'
  3303. }
  3304. for (var key in v1) {
  3305. if (key === 'major' || key === 'minor' || key === 'patch') {
  3306. if (v1[key] !== v2[key]) {
  3307. return prefix + key
  3308. }
  3309. }
  3310. }
  3311. return defaultResult // may be undefined
  3312. }
  3313. }
  3314. exports.compareIdentifiers = compareIdentifiers
  3315. var numeric = /^[0-9]+$/
  3316. function compareIdentifiers (a, b) {
  3317. var anum = numeric.test(a)
  3318. var bnum = numeric.test(b)
  3319. if (anum && bnum) {
  3320. a = +a
  3321. b = +b
  3322. }
  3323. return a === b ? 0
  3324. : (anum && !bnum) ? -1
  3325. : (bnum && !anum) ? 1
  3326. : a < b ? -1
  3327. : 1
  3328. }
  3329. exports.rcompareIdentifiers = rcompareIdentifiers
  3330. function rcompareIdentifiers (a, b) {
  3331. return compareIdentifiers(b, a)
  3332. }
  3333. exports.major = major
  3334. function major (a, loose) {
  3335. return new SemVer(a, loose).major
  3336. }
  3337. exports.minor = minor
  3338. function minor (a, loose) {
  3339. return new SemVer(a, loose).minor
  3340. }
  3341. exports.patch = patch
  3342. function patch (a, loose) {
  3343. return new SemVer(a, loose).patch
  3344. }
  3345. exports.compare = compare
  3346. function compare (a, b, loose) {
  3347. return new SemVer(a, loose).compare(new SemVer(b, loose))
  3348. }
  3349. exports.compareLoose = compareLoose
  3350. function compareLoose (a, b) {
  3351. return compare(a, b, true)
  3352. }
  3353. exports.rcompare = rcompare
  3354. function rcompare (a, b, loose) {
  3355. return compare(b, a, loose)
  3356. }
  3357. exports.sort = sort
  3358. function sort (list, loose) {
  3359. return list.sort(function (a, b) {
  3360. return exports.compare(a, b, loose)
  3361. })
  3362. }
  3363. exports.rsort = rsort
  3364. function rsort (list, loose) {
  3365. return list.sort(function (a, b) {
  3366. return exports.rcompare(a, b, loose)
  3367. })
  3368. }
  3369. exports.gt = gt
  3370. function gt (a, b, loose) {
  3371. return compare(a, b, loose) > 0
  3372. }
  3373. exports.lt = lt
  3374. function lt (a, b, loose) {
  3375. return compare(a, b, loose) < 0
  3376. }
  3377. exports.eq = eq
  3378. function eq (a, b, loose) {
  3379. return compare(a, b, loose) === 0
  3380. }
  3381. exports.neq = neq
  3382. function neq (a, b, loose) {
  3383. return compare(a, b, loose) !== 0
  3384. }
  3385. exports.gte = gte
  3386. function gte (a, b, loose) {
  3387. return compare(a, b, loose) >= 0
  3388. }
  3389. exports.lte = lte
  3390. function lte (a, b, loose) {
  3391. return compare(a, b, loose) <= 0
  3392. }
  3393. exports.cmp = cmp
  3394. function cmp (a, op, b, loose) {
  3395. switch (op) {
  3396. case '===':
  3397. if (typeof a === 'object')
  3398. a = a.version
  3399. if (typeof b === 'object')
  3400. b = b.version
  3401. return a === b
  3402. case '!==':
  3403. if (typeof a === 'object')
  3404. a = a.version
  3405. if (typeof b === 'object')
  3406. b = b.version
  3407. return a !== b
  3408. case '':
  3409. case '=':
  3410. case '==':
  3411. return eq(a, b, loose)
  3412. case '!=':
  3413. return neq(a, b, loose)
  3414. case '>':
  3415. return gt(a, b, loose)
  3416. case '>=':
  3417. return gte(a, b, loose)
  3418. case '<':
  3419. return lt(a, b, loose)
  3420. case '<=':
  3421. return lte(a, b, loose)
  3422. default:
  3423. throw new TypeError('Invalid operator: ' + op)
  3424. }
  3425. }
  3426. exports.Comparator = Comparator
  3427. function Comparator (comp, options) {
  3428. if (!options || typeof options !== 'object') {
  3429. options = {
  3430. loose: !!options,
  3431. includePrerelease: false
  3432. }
  3433. }
  3434. if (comp instanceof Comparator) {
  3435. if (comp.loose === !!options.loose) {
  3436. return comp
  3437. } else {
  3438. comp = comp.value
  3439. }
  3440. }
  3441. if (!(this instanceof Comparator)) {
  3442. return new Comparator(comp, options)
  3443. }
  3444. debug('comparator', comp, options)
  3445. this.options = options
  3446. this.loose = !!options.loose
  3447. this.parse(comp)
  3448. if (this.semver === ANY) {
  3449. this.value = ''
  3450. } else {
  3451. this.value = this.operator + this.semver.version
  3452. }
  3453. debug('comp', this)
  3454. }
  3455. var ANY = {}
  3456. Comparator.prototype.parse = function (comp) {
  3457. var r = this.options.loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
  3458. var m = comp.match(r)
  3459. if (!m) {
  3460. throw new TypeError('Invalid comparator: ' + comp)
  3461. }
  3462. this.operator = m[1]
  3463. if (this.operator === '=') {
  3464. this.operator = ''
  3465. }
  3466. // if it literally is just '>' or '' then allow anything.
  3467. if (!m[2]) {
  3468. this.semver = ANY
  3469. } else {
  3470. this.semver = new SemVer(m[2], this.options.loose)
  3471. }
  3472. }
  3473. Comparator.prototype.toString = function () {
  3474. return this.value
  3475. }
  3476. Comparator.prototype.test = function (version) {
  3477. debug('Comparator.test', version, this.options.loose)
  3478. if (this.semver === ANY) {
  3479. return true
  3480. }
  3481. if (typeof version === 'string') {
  3482. version = new SemVer(version, this.options)
  3483. }
  3484. return cmp(version, this.operator, this.semver, this.options)
  3485. }
  3486. Comparator.prototype.intersects = function (comp, options) {
  3487. if (!(comp instanceof Comparator)) {
  3488. throw new TypeError('a Comparator is required')
  3489. }
  3490. if (!options || typeof options !== 'object') {
  3491. options = {
  3492. loose: !!options,
  3493. includePrerelease: false
  3494. }
  3495. }
  3496. var rangeTmp
  3497. if (this.operator === '') {
  3498. rangeTmp = new Range(comp.value, options)
  3499. return satisfies(this.value, rangeTmp, options)
  3500. } else if (comp.operator === '') {
  3501. rangeTmp = new Range(this.value, options)
  3502. return satisfies(comp.semver, rangeTmp, options)
  3503. }
  3504. var sameDirectionIncreasing =
  3505. (this.operator === '>=' || this.operator === '>') &&
  3506. (comp.operator === '>=' || comp.operator === '>')
  3507. var sameDirectionDecreasing =
  3508. (this.operator === '<=' || this.operator === '<') &&
  3509. (comp.operator === '<=' || comp.operator === '<')
  3510. var sameSemVer = this.semver.version === comp.semver.version
  3511. var differentDirectionsInclusive =
  3512. (this.operator === '>=' || this.operator === '<=') &&
  3513. (comp.operator === '>=' || comp.operator === '<=')
  3514. var oppositeDirectionsLessThan =
  3515. cmp(this.semver, '<', comp.semver, options) &&
  3516. ((this.operator === '>=' || this.operator === '>') &&
  3517. (comp.operator === '<=' || comp.operator === '<'))
  3518. var oppositeDirectionsGreaterThan =
  3519. cmp(this.semver, '>', comp.semver, options) &&
  3520. ((this.operator === '<=' || this.operator === '<') &&
  3521. (comp.operator === '>=' || comp.operator === '>'))
  3522. return sameDirectionIncreasing || sameDirectionDecreasing ||
  3523. (sameSemVer && differentDirectionsInclusive) ||
  3524. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  3525. }
  3526. exports.Range = Range
  3527. function Range (range, options) {
  3528. if (!options || typeof options !== 'object') {
  3529. options = {
  3530. loose: !!options,
  3531. includePrerelease: false
  3532. }
  3533. }
  3534. if (range instanceof Range) {
  3535. if (range.loose === !!options.loose &&
  3536. range.includePrerelease === !!options.includePrerelease) {
  3537. return range
  3538. } else {
  3539. return new Range(range.raw, options)
  3540. }
  3541. }
  3542. if (range instanceof Comparator) {
  3543. return new Range(range.value, options)
  3544. }
  3545. if (!(this instanceof Range)) {
  3546. return new Range(range, options)
  3547. }
  3548. this.options = options
  3549. this.loose = !!options.loose
  3550. this.includePrerelease = !!options.includePrerelease
  3551. // First, split based on boolean or ||
  3552. this.raw = range
  3553. this.set = range.split(/\s*\|\|\s*/).map(function (range) {
  3554. return this.parseRange(range.trim())
  3555. }, this).filter(function (c) {
  3556. // throw out any that are not relevant for whatever reason
  3557. return c.length
  3558. })
  3559. if (!this.set.length) {
  3560. throw new TypeError('Invalid SemVer Range: ' + range)
  3561. }
  3562. this.format()
  3563. }
  3564. Range.prototype.format = function () {
  3565. this.range = this.set.map(function (comps) {
  3566. return comps.join(' ').trim()
  3567. }).join('||').trim()
  3568. return this.range
  3569. }
  3570. Range.prototype.toString = function () {
  3571. return this.range
  3572. }
  3573. Range.prototype.parseRange = function (range) {
  3574. var loose = this.options.loose
  3575. range = range.trim()
  3576. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  3577. var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE]
  3578. range = range.replace(hr, hyphenReplace)
  3579. debug('hyphen replace', range)
  3580. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  3581. range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace)
  3582. debug('comparator trim', range, re[COMPARATORTRIM])
  3583. // `~ 1.2.3` => `~1.2.3`
  3584. range = range.replace(re[TILDETRIM], tildeTrimReplace)
  3585. // `^ 1.2.3` => `^1.2.3`
  3586. range = range.replace(re[CARETTRIM], caretTrimReplace)
  3587. // normalize spaces
  3588. range = range.split(/\s+/).join(' ')
  3589. // At this point, the range is completely trimmed and
  3590. // ready to be split into comparators.
  3591. var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
  3592. var set = range.split(' ').map(function (comp) {
  3593. return parseComparator(comp, this.options)
  3594. }, this).join(' ').split(/\s+/)
  3595. if (this.options.loose) {
  3596. // in loose mode, throw out any that are not valid comparators
  3597. set = set.filter(function (comp) {
  3598. return !!comp.match(compRe)
  3599. })
  3600. }
  3601. set = set.map(function (comp) {
  3602. return new Comparator(comp, this.options)
  3603. }, this)
  3604. return set
  3605. }
  3606. Range.prototype.intersects = function (range, options) {
  3607. if (!(range instanceof Range)) {
  3608. throw new TypeError('a Range is required')
  3609. }
  3610. return this.set.some(function (thisComparators) {
  3611. return thisComparators.every(function (thisComparator) {
  3612. return range.set.some(function (rangeComparators) {
  3613. return rangeComparators.every(function (rangeComparator) {
  3614. return thisComparator.intersects(rangeComparator, options)
  3615. })
  3616. })
  3617. })
  3618. })
  3619. }
  3620. // Mostly just for testing and legacy API reasons
  3621. exports.toComparators = toComparators
  3622. function toComparators (range, options) {
  3623. return new Range(range, options).set.map(function (comp) {
  3624. return comp.map(function (c) {
  3625. return c.value
  3626. }).join(' ').trim().split(' ')
  3627. })
  3628. }
  3629. // comprised of xranges, tildes, stars, and gtlt's at this point.
  3630. // already replaced the hyphen ranges
  3631. // turn into a set of JUST comparators.
  3632. function parseComparator (comp, options) {
  3633. debug('comp', comp, options)
  3634. comp = replaceCarets(comp, options)
  3635. debug('caret', comp)
  3636. comp = replaceTildes(comp, options)
  3637. debug('tildes', comp)
  3638. comp = replaceXRanges(comp, options)
  3639. debug('xrange', comp)
  3640. comp = replaceStars(comp, options)
  3641. debug('stars', comp)
  3642. return comp
  3643. }
  3644. function isX (id) {
  3645. return !id || id.toLowerCase() === 'x' || id === '*'
  3646. }
  3647. // ~, ~> --> * (any, kinda silly)
  3648. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  3649. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  3650. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  3651. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  3652. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  3653. function replaceTildes (comp, options) {
  3654. return comp.trim().split(/\s+/).map(function (comp) {
  3655. return replaceTilde(comp, options)
  3656. }).join(' ')
  3657. }
  3658. function replaceTilde (comp, options) {
  3659. var r = options.loose ? re[TILDELOOSE] : re[TILDE]
  3660. return comp.replace(r, function (_, M, m, p, pr) {
  3661. debug('tilde', comp, _, M, m, p, pr)
  3662. var ret
  3663. if (isX(M)) {
  3664. ret = ''
  3665. } else if (isX(m)) {
  3666. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  3667. } else if (isX(p)) {
  3668. // ~1.2 == >=1.2.0 <1.3.0
  3669. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  3670. } else if (pr) {
  3671. debug('replaceTilde pr', pr)
  3672. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  3673. ' <' + M + '.' + (+m + 1) + '.0'
  3674. } else {
  3675. // ~1.2.3 == >=1.2.3 <1.3.0
  3676. ret = '>=' + M + '.' + m + '.' + p +
  3677. ' <' + M + '.' + (+m + 1) + '.0'
  3678. }
  3679. debug('tilde return', ret)
  3680. return ret
  3681. })
  3682. }
  3683. // ^ --> * (any, kinda silly)
  3684. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  3685. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  3686. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  3687. // ^1.2.3 --> >=1.2.3 <2.0.0
  3688. // ^1.2.0 --> >=1.2.0 <2.0.0
  3689. function replaceCarets (comp, options) {
  3690. return comp.trim().split(/\s+/).map(function (comp) {
  3691. return replaceCaret(comp, options)
  3692. }).join(' ')
  3693. }
  3694. function replaceCaret (comp, options) {
  3695. debug('caret', comp, options)
  3696. var r = options.loose ? re[CARETLOOSE] : re[CARET]
  3697. return comp.replace(r, function (_, M, m, p, pr) {
  3698. debug('caret', comp, _, M, m, p, pr)
  3699. var ret
  3700. if (isX(M)) {
  3701. ret = ''
  3702. } else if (isX(m)) {
  3703. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  3704. } else if (isX(p)) {
  3705. if (M === '0') {
  3706. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  3707. } else {
  3708. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  3709. }
  3710. } else if (pr) {
  3711. debug('replaceCaret pr', pr)
  3712. if (M === '0') {
  3713. if (m === '0') {
  3714. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  3715. ' <' + M + '.' + m + '.' + (+p + 1)
  3716. } else {
  3717. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  3718. ' <' + M + '.' + (+m + 1) + '.0'
  3719. }
  3720. } else {
  3721. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  3722. ' <' + (+M + 1) + '.0.0'
  3723. }
  3724. } else {
  3725. debug('no pr')
  3726. if (M === '0') {
  3727. if (m === '0') {
  3728. ret = '>=' + M + '.' + m + '.' + p +
  3729. ' <' + M + '.' + m + '.' + (+p + 1)
  3730. } else {
  3731. ret = '>=' + M + '.' + m + '.' + p +
  3732. ' <' + M + '.' + (+m + 1) + '.0'
  3733. }
  3734. } else {
  3735. ret = '>=' + M + '.' + m + '.' + p +
  3736. ' <' + (+M + 1) + '.0.0'
  3737. }
  3738. }
  3739. debug('caret return', ret)
  3740. return ret
  3741. })
  3742. }
  3743. function replaceXRanges (comp, options) {
  3744. debug('replaceXRanges', comp, options)
  3745. return comp.split(/\s+/).map(function (comp) {
  3746. return replaceXRange(comp, options)
  3747. }).join(' ')
  3748. }
  3749. function replaceXRange (comp, options) {
  3750. comp = comp.trim()
  3751. var r = options.loose ? re[XRANGELOOSE] : re[XRANGE]
  3752. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  3753. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  3754. var xM = isX(M)
  3755. var xm = xM || isX(m)
  3756. var xp = xm || isX(p)
  3757. var anyX = xp
  3758. if (gtlt === '=' && anyX) {
  3759. gtlt = ''
  3760. }
  3761. if (xM) {
  3762. if (gtlt === '>' || gtlt === '<') {
  3763. // nothing is allowed
  3764. ret = '<0.0.0'
  3765. } else {
  3766. // nothing is forbidden
  3767. ret = '*'
  3768. }
  3769. } else if (gtlt && anyX) {
  3770. // we know patch is an x, because we have any x at all.
  3771. // replace X with 0
  3772. if (xm) {
  3773. m = 0
  3774. }
  3775. p = 0
  3776. if (gtlt === '>') {
  3777. // >1 => >=2.0.0
  3778. // >1.2 => >=1.3.0
  3779. // >1.2.3 => >= 1.2.4
  3780. gtlt = '>='
  3781. if (xm) {
  3782. M = +M + 1
  3783. m = 0
  3784. p = 0
  3785. } else {
  3786. m = +m + 1
  3787. p = 0
  3788. }
  3789. } else if (gtlt === '<=') {
  3790. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  3791. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  3792. gtlt = '<'
  3793. if (xm) {
  3794. M = +M + 1
  3795. } else {
  3796. m = +m + 1
  3797. }
  3798. }
  3799. ret = gtlt + M + '.' + m + '.' + p
  3800. } else if (xm) {
  3801. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  3802. } else if (xp) {
  3803. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  3804. }
  3805. debug('xRange return', ret)
  3806. return ret
  3807. })
  3808. }
  3809. // Because * is AND-ed with everything else in the comparator,
  3810. // and '' means "any version", just remove the *s entirely.
  3811. function replaceStars (comp, options) {
  3812. debug('replaceStars', comp, options)
  3813. // Looseness is ignored here. star is always as loose as it gets!
  3814. return comp.trim().replace(re[STAR], '')
  3815. }
  3816. // This function is passed to string.replace(re[HYPHENRANGE])
  3817. // M, m, patch, prerelease, build
  3818. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  3819. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  3820. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  3821. function hyphenReplace ($0,
  3822. from, fM, fm, fp, fpr, fb,
  3823. to, tM, tm, tp, tpr, tb) {
  3824. if (isX(fM)) {
  3825. from = ''
  3826. } else if (isX(fm)) {
  3827. from = '>=' + fM + '.0.0'
  3828. } else if (isX(fp)) {
  3829. from = '>=' + fM + '.' + fm + '.0'
  3830. } else {
  3831. from = '>=' + from
  3832. }
  3833. if (isX(tM)) {
  3834. to = ''
  3835. } else if (isX(tm)) {
  3836. to = '<' + (+tM + 1) + '.0.0'
  3837. } else if (isX(tp)) {
  3838. to = '<' + tM + '.' + (+tm + 1) + '.0'
  3839. } else if (tpr) {
  3840. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  3841. } else {
  3842. to = '<=' + to
  3843. }
  3844. return (from + ' ' + to).trim()
  3845. }
  3846. // if ANY of the sets match ALL of its comparators, then pass
  3847. Range.prototype.test = function (version) {
  3848. if (!version) {
  3849. return false
  3850. }
  3851. if (typeof version === 'string') {
  3852. version = new SemVer(version, this.options)
  3853. }
  3854. for (var i = 0; i < this.set.length; i++) {
  3855. if (testSet(this.set[i], version, this.options)) {
  3856. return true
  3857. }
  3858. }
  3859. return false
  3860. }
  3861. function testSet (set, version, options) {
  3862. for (var i = 0; i < set.length; i++) {
  3863. if (!set[i].test(version)) {
  3864. return false
  3865. }
  3866. }
  3867. if (version.prerelease.length && !options.includePrerelease) {
  3868. // Find the set of versions that are allowed to have prereleases
  3869. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  3870. // That should allow `1.2.3-pr.2` to pass.
  3871. // However, `1.2.4-alpha.notready` should NOT be allowed,
  3872. // even though it's within the range set by the comparators.
  3873. for (i = 0; i < set.length; i++) {
  3874. debug(set[i].semver)
  3875. if (set[i].semver === ANY) {
  3876. continue
  3877. }
  3878. if (set[i].semver.prerelease.length > 0) {
  3879. var allowed = set[i].semver
  3880. if (allowed.major === version.major &&
  3881. allowed.minor === version.minor &&
  3882. allowed.patch === version.patch) {
  3883. return true
  3884. }
  3885. }
  3886. }
  3887. // Version has a -pre, but it's not one of the ones we like.
  3888. return false
  3889. }
  3890. return true
  3891. }
  3892. exports.satisfies = satisfies
  3893. function satisfies (version, range, options) {
  3894. try {
  3895. range = new Range(range, options)
  3896. } catch (er) {
  3897. return false
  3898. }
  3899. return range.test(version)
  3900. }
  3901. exports.maxSatisfying = maxSatisfying
  3902. function maxSatisfying (versions, range, options) {
  3903. var max = null
  3904. var maxSV = null
  3905. try {
  3906. var rangeObj = new Range(range, options)
  3907. } catch (er) {
  3908. return null
  3909. }
  3910. versions.forEach(function (v) {
  3911. if (rangeObj.test(v)) {
  3912. // satisfies(v, range, options)
  3913. if (!max || maxSV.compare(v) === -1) {
  3914. // compare(max, v, true)
  3915. max = v
  3916. maxSV = new SemVer(max, options)
  3917. }
  3918. }
  3919. })
  3920. return max
  3921. }
  3922. exports.minSatisfying = minSatisfying
  3923. function minSatisfying (versions, range, options) {
  3924. var min = null
  3925. var minSV = null
  3926. try {
  3927. var rangeObj = new Range(range, options)
  3928. } catch (er) {
  3929. return null
  3930. }
  3931. versions.forEach(function (v) {
  3932. if (rangeObj.test(v)) {
  3933. // satisfies(v, range, options)
  3934. if (!min || minSV.compare(v) === 1) {
  3935. // compare(min, v, true)
  3936. min = v
  3937. minSV = new SemVer(min, options)
  3938. }
  3939. }
  3940. })
  3941. return min
  3942. }
  3943. exports.minVersion = minVersion
  3944. function minVersion (range, loose) {
  3945. range = new Range(range, loose)
  3946. var minver = new SemVer('0.0.0')
  3947. if (range.test(minver)) {
  3948. return minver
  3949. }
  3950. minver = new SemVer('0.0.0-0')
  3951. if (range.test(minver)) {
  3952. return minver
  3953. }
  3954. minver = null
  3955. for (var i = 0; i < range.set.length; ++i) {
  3956. var comparators = range.set[i]
  3957. comparators.forEach(function (comparator) {
  3958. // Clone to avoid manipulating the comparator's semver object.
  3959. var compver = new SemVer(comparator.semver.version)
  3960. switch (comparator.operator) {
  3961. case '>':
  3962. if (compver.prerelease.length === 0) {
  3963. compver.patch++
  3964. } else {
  3965. compver.prerelease.push(0)
  3966. }
  3967. compver.raw = compver.format()
  3968. /* fallthrough */
  3969. case '':
  3970. case '>=':
  3971. if (!minver || gt(minver, compver)) {
  3972. minver = compver
  3973. }
  3974. break
  3975. case '<':
  3976. case '<=':
  3977. /* Ignore maximum versions */
  3978. break
  3979. /* istanbul ignore next */
  3980. default:
  3981. throw new Error('Unexpected operation: ' + comparator.operator)
  3982. }
  3983. })
  3984. }
  3985. if (minver && range.test(minver)) {
  3986. return minver
  3987. }
  3988. return null
  3989. }
  3990. exports.validRange = validRange
  3991. function validRange (range, options) {
  3992. try {
  3993. // Return '*' instead of '' so that truthiness works.
  3994. // This will throw if it's invalid anyway
  3995. return new Range(range, options).range || '*'
  3996. } catch (er) {
  3997. return null
  3998. }
  3999. }
  4000. // Determine if version is less than all the versions possible in the range
  4001. exports.ltr = ltr
  4002. function ltr (version, range, options) {
  4003. return outside(version, range, '<', options)
  4004. }
  4005. // Determine if version is greater than all the versions possible in the range.
  4006. exports.gtr = gtr
  4007. function gtr (version, range, options) {
  4008. return outside(version, range, '>', options)
  4009. }
  4010. exports.outside = outside
  4011. function outside (version, range, hilo, options) {
  4012. version = new SemVer(version, options)
  4013. range = new Range(range, options)
  4014. var gtfn, ltefn, ltfn, comp, ecomp
  4015. switch (hilo) {
  4016. case '>':
  4017. gtfn = gt
  4018. ltefn = lte
  4019. ltfn = lt
  4020. comp = '>'
  4021. ecomp = '>='
  4022. break
  4023. case '<':
  4024. gtfn = lt
  4025. ltefn = gte
  4026. ltfn = gt
  4027. comp = '<'
  4028. ecomp = '<='
  4029. break
  4030. default:
  4031. throw new TypeError('Must provide a hilo val of "<" or ">"')
  4032. }
  4033. // If it satisifes the range it is not outside
  4034. if (satisfies(version, range, options)) {
  4035. return false
  4036. }
  4037. // From now on, variable terms are as if we're in "gtr" mode.
  4038. // but note that everything is flipped for the "ltr" function.
  4039. for (var i = 0; i < range.set.length; ++i) {
  4040. var comparators = range.set[i]
  4041. var high = null
  4042. var low = null
  4043. comparators.forEach(function (comparator) {
  4044. if (comparator.semver === ANY) {
  4045. comparator = new Comparator('>=0.0.0')
  4046. }
  4047. high = high || comparator
  4048. low = low || comparator
  4049. if (gtfn(comparator.semver, high.semver, options)) {
  4050. high = comparator
  4051. } else if (ltfn(comparator.semver, low.semver, options)) {
  4052. low = comparator
  4053. }
  4054. })
  4055. // If the edge version comparator has a operator then our version
  4056. // isn't outside it
  4057. if (high.operator === comp || high.operator === ecomp) {
  4058. return false
  4059. }
  4060. // If the lowest version comparator has an operator and our version
  4061. // is less than it then it isn't higher than the range
  4062. if ((!low.operator || low.operator === comp) &&
  4063. ltefn(version, low.semver)) {
  4064. return false
  4065. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  4066. return false
  4067. }
  4068. }
  4069. return true
  4070. }
  4071. exports.prerelease = prerelease
  4072. function prerelease (version, options) {
  4073. var parsed = parse(version, options)
  4074. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  4075. }
  4076. exports.intersects = intersects
  4077. function intersects (r1, r2, options) {
  4078. r1 = new Range(r1, options)
  4079. r2 = new Range(r2, options)
  4080. return r1.intersects(r2)
  4081. }
  4082. exports.coerce = coerce
  4083. function coerce (version) {
  4084. if (version instanceof SemVer) {
  4085. return version
  4086. }
  4087. if (typeof version !== 'string') {
  4088. return null
  4089. }
  4090. var match = version.match(re[COERCE])
  4091. if (match == null) {
  4092. return null
  4093. }
  4094. return parse(match[1] +
  4095. '.' + (match[2] || '0') +
  4096. '.' + (match[3] || '0'))
  4097. }
  4098. /***/ }),
  4099. /***/ 289:
  4100. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  4101. "use strict";
  4102. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4103. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4104. return new (P || (P = Promise))(function (resolve, reject) {
  4105. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4106. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4107. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4108. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4109. });
  4110. };
  4111. var __importStar = (this && this.__importStar) || function (mod) {
  4112. if (mod && mod.__esModule) return mod;
  4113. var result = {};
  4114. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  4115. result["default"] = mod;
  4116. return result;
  4117. };
  4118. Object.defineProperty(exports, "__esModule", { value: true });
  4119. const core = __importStar(__webpack_require__(470));
  4120. const exec = __importStar(__webpack_require__(986));
  4121. const fshelper = __importStar(__webpack_require__(618));
  4122. const io = __importStar(__webpack_require__(1));
  4123. const path = __importStar(__webpack_require__(622));
  4124. const retryHelper = __importStar(__webpack_require__(587));
  4125. const git_version_1 = __webpack_require__(559);
  4126. // Auth header not supported before 2.9
  4127. // Wire protocol v2 not supported before 2.18
  4128. exports.MinimumGitVersion = new git_version_1.GitVersion('2.18');
  4129. function CreateCommandManager(workingDirectory, lfs) {
  4130. return __awaiter(this, void 0, void 0, function* () {
  4131. return yield GitCommandManager.createCommandManager(workingDirectory, lfs);
  4132. });
  4133. }
  4134. exports.CreateCommandManager = CreateCommandManager;
  4135. class GitCommandManager {
  4136. // Private constructor; use createCommandManager()
  4137. constructor() {
  4138. this.gitEnv = {
  4139. GIT_TERMINAL_PROMPT: '0',
  4140. GCM_INTERACTIVE: 'Never' // Disable prompting for git credential manager
  4141. };
  4142. this.gitPath = '';
  4143. this.lfs = false;
  4144. this.workingDirectory = '';
  4145. }
  4146. branchDelete(remote, branch) {
  4147. return __awaiter(this, void 0, void 0, function* () {
  4148. const args = ['branch', '--delete', '--force'];
  4149. if (remote) {
  4150. args.push('--remote');
  4151. }
  4152. args.push(branch);
  4153. yield this.execGit(args);
  4154. });
  4155. }
  4156. branchExists(remote, pattern) {
  4157. return __awaiter(this, void 0, void 0, function* () {
  4158. const args = ['branch', '--list'];
  4159. if (remote) {
  4160. args.push('--remote');
  4161. }
  4162. args.push(pattern);
  4163. const output = yield this.execGit(args);
  4164. return !!output.stdout.trim();
  4165. });
  4166. }
  4167. branchList(remote) {
  4168. return __awaiter(this, void 0, void 0, function* () {
  4169. const result = [];
  4170. // Note, this implementation uses "rev-parse --symbolic" because the output from
  4171. // "branch --list" is more difficult when in a detached HEAD state.
  4172. const args = ['rev-parse', '--symbolic'];
  4173. if (remote) {
  4174. args.push('--remotes=origin');
  4175. }
  4176. else {
  4177. args.push('--branches');
  4178. }
  4179. const output = yield this.execGit(args);
  4180. for (let branch of output.stdout.trim().split('\n')) {
  4181. branch = branch.trim();
  4182. if (branch) {
  4183. result.push(branch);
  4184. }
  4185. }
  4186. return result;
  4187. });
  4188. }
  4189. checkout(ref, startPoint) {
  4190. return __awaiter(this, void 0, void 0, function* () {
  4191. const args = ['checkout', '--progress', '--force'];
  4192. if (startPoint) {
  4193. args.push('-B', ref, startPoint);
  4194. }
  4195. else {
  4196. args.push(ref);
  4197. }
  4198. yield this.execGit(args);
  4199. });
  4200. }
  4201. checkoutDetach() {
  4202. return __awaiter(this, void 0, void 0, function* () {
  4203. const args = ['checkout', '--detach'];
  4204. yield this.execGit(args);
  4205. });
  4206. }
  4207. config(configKey, configValue) {
  4208. return __awaiter(this, void 0, void 0, function* () {
  4209. yield this.execGit(['config', configKey, configValue]);
  4210. });
  4211. }
  4212. configExists(configKey) {
  4213. return __awaiter(this, void 0, void 0, function* () {
  4214. const pattern = configKey.replace(/[^a-zA-Z0-9_]/g, x => {
  4215. return `\\${x}`;
  4216. });
  4217. const output = yield this.execGit(['config', '--name-only', '--get-regexp', pattern], true);
  4218. return output.exitCode === 0;
  4219. });
  4220. }
  4221. fetch(fetchDepth, refSpec) {
  4222. return __awaiter(this, void 0, void 0, function* () {
  4223. const args = [
  4224. '-c',
  4225. 'protocol.version=2',
  4226. 'fetch',
  4227. '--no-tags',
  4228. '--prune',
  4229. '--progress',
  4230. '--no-recurse-submodules'
  4231. ];
  4232. if (fetchDepth > 0) {
  4233. args.push(`--depth=${fetchDepth}`);
  4234. }
  4235. else if (fshelper.fileExistsSync(path.join(this.workingDirectory, '.git', 'shallow'))) {
  4236. args.push('--unshallow');
  4237. }
  4238. args.push('origin');
  4239. for (const arg of refSpec) {
  4240. args.push(arg);
  4241. }
  4242. const that = this;
  4243. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  4244. yield that.execGit(args);
  4245. }));
  4246. });
  4247. }
  4248. getWorkingDirectory() {
  4249. return this.workingDirectory;
  4250. }
  4251. init() {
  4252. return __awaiter(this, void 0, void 0, function* () {
  4253. yield this.execGit(['init', this.workingDirectory]);
  4254. });
  4255. }
  4256. isDetached() {
  4257. return __awaiter(this, void 0, void 0, function* () {
  4258. // Note, this implementation uses "branch --show-current" because
  4259. // "rev-parse --symbolic-full-name HEAD" can fail on a new repo
  4260. // with nothing checked out.
  4261. const output = yield this.execGit(['branch', '--show-current']);
  4262. return output.stdout.trim() === '';
  4263. });
  4264. }
  4265. lfsFetch(ref) {
  4266. return __awaiter(this, void 0, void 0, function* () {
  4267. const args = ['lfs', 'fetch', 'origin', ref];
  4268. const that = this;
  4269. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  4270. yield that.execGit(args);
  4271. }));
  4272. });
  4273. }
  4274. lfsInstall() {
  4275. return __awaiter(this, void 0, void 0, function* () {
  4276. yield this.execGit(['lfs', 'install', '--local']);
  4277. });
  4278. }
  4279. log1() {
  4280. return __awaiter(this, void 0, void 0, function* () {
  4281. yield this.execGit(['log', '-1']);
  4282. });
  4283. }
  4284. remoteAdd(remoteName, remoteUrl) {
  4285. return __awaiter(this, void 0, void 0, function* () {
  4286. yield this.execGit(['remote', 'add', remoteName, remoteUrl]);
  4287. });
  4288. }
  4289. tagExists(pattern) {
  4290. return __awaiter(this, void 0, void 0, function* () {
  4291. const output = yield this.execGit(['tag', '--list', pattern]);
  4292. return !!output.stdout.trim();
  4293. });
  4294. }
  4295. tryClean() {
  4296. return __awaiter(this, void 0, void 0, function* () {
  4297. const output = yield this.execGit(['clean', '-ffdx'], true);
  4298. return output.exitCode === 0;
  4299. });
  4300. }
  4301. tryConfigUnset(configKey) {
  4302. return __awaiter(this, void 0, void 0, function* () {
  4303. const output = yield this.execGit(['config', '--unset-all', configKey], true);
  4304. return output.exitCode === 0;
  4305. });
  4306. }
  4307. tryDisableAutomaticGarbageCollection() {
  4308. return __awaiter(this, void 0, void 0, function* () {
  4309. const output = yield this.execGit(['config', 'gc.auto', '0'], true);
  4310. return output.exitCode === 0;
  4311. });
  4312. }
  4313. tryGetFetchUrl() {
  4314. return __awaiter(this, void 0, void 0, function* () {
  4315. const output = yield this.execGit(['config', '--get', 'remote.origin.url'], true);
  4316. if (output.exitCode !== 0) {
  4317. return '';
  4318. }
  4319. const stdout = output.stdout.trim();
  4320. if (stdout.includes('\n')) {
  4321. return '';
  4322. }
  4323. return stdout;
  4324. });
  4325. }
  4326. tryReset() {
  4327. return __awaiter(this, void 0, void 0, function* () {
  4328. const output = yield this.execGit(['reset', '--hard', 'HEAD'], true);
  4329. return output.exitCode === 0;
  4330. });
  4331. }
  4332. static createCommandManager(workingDirectory, lfs) {
  4333. return __awaiter(this, void 0, void 0, function* () {
  4334. const result = new GitCommandManager();
  4335. yield result.initializeCommandManager(workingDirectory, lfs);
  4336. return result;
  4337. });
  4338. }
  4339. execGit(args, allowAllExitCodes = false) {
  4340. return __awaiter(this, void 0, void 0, function* () {
  4341. fshelper.directoryExistsSync(this.workingDirectory, true);
  4342. const result = new GitOutput();
  4343. const env = {};
  4344. for (const key of Object.keys(process.env)) {
  4345. env[key] = process.env[key];
  4346. }
  4347. for (const key of Object.keys(this.gitEnv)) {
  4348. env[key] = this.gitEnv[key];
  4349. }
  4350. const stdout = [];
  4351. const options = {
  4352. cwd: this.workingDirectory,
  4353. env,
  4354. ignoreReturnCode: allowAllExitCodes,
  4355. listeners: {
  4356. stdout: (data) => {
  4357. stdout.push(data.toString());
  4358. }
  4359. }
  4360. };
  4361. result.exitCode = yield exec.exec(`"${this.gitPath}"`, args, options);
  4362. result.stdout = stdout.join('');
  4363. return result;
  4364. });
  4365. }
  4366. initializeCommandManager(workingDirectory, lfs) {
  4367. return __awaiter(this, void 0, void 0, function* () {
  4368. this.workingDirectory = workingDirectory;
  4369. // Git-lfs will try to pull down assets if any of the local/user/system setting exist.
  4370. // If the user didn't enable `LFS` in their pipeline definition, disable LFS fetch/checkout.
  4371. this.lfs = lfs;
  4372. if (!this.lfs) {
  4373. this.gitEnv['GIT_LFS_SKIP_SMUDGE'] = '1';
  4374. }
  4375. this.gitPath = yield io.which('git', true);
  4376. // Git version
  4377. core.debug('Getting git version');
  4378. let gitVersion = new git_version_1.GitVersion();
  4379. let gitOutput = yield this.execGit(['version']);
  4380. let stdout = gitOutput.stdout.trim();
  4381. if (!stdout.includes('\n')) {
  4382. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  4383. if (match) {
  4384. gitVersion = new git_version_1.GitVersion(match[0]);
  4385. }
  4386. }
  4387. if (!gitVersion.isValid()) {
  4388. throw new Error('Unable to determine git version');
  4389. }
  4390. // Minimum git version
  4391. if (!gitVersion.checkMinimum(exports.MinimumGitVersion)) {
  4392. throw new Error(`Minimum required git version is ${exports.MinimumGitVersion}. Your git ('${this.gitPath}') is ${gitVersion}`);
  4393. }
  4394. if (this.lfs) {
  4395. // Git-lfs version
  4396. core.debug('Getting git-lfs version');
  4397. let gitLfsVersion = new git_version_1.GitVersion();
  4398. const gitLfsPath = yield io.which('git-lfs', true);
  4399. gitOutput = yield this.execGit(['lfs', 'version']);
  4400. stdout = gitOutput.stdout.trim();
  4401. if (!stdout.includes('\n')) {
  4402. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  4403. if (match) {
  4404. gitLfsVersion = new git_version_1.GitVersion(match[0]);
  4405. }
  4406. }
  4407. if (!gitLfsVersion.isValid()) {
  4408. throw new Error('Unable to determine git-lfs version');
  4409. }
  4410. // Minimum git-lfs version
  4411. // Note:
  4412. // - Auth header not supported before 2.1
  4413. const minimumGitLfsVersion = new git_version_1.GitVersion('2.1');
  4414. if (!gitLfsVersion.checkMinimum(minimumGitLfsVersion)) {
  4415. throw new Error(`Minimum required git-lfs version is ${minimumGitLfsVersion}. Your git-lfs ('${gitLfsPath}') is ${gitLfsVersion}`);
  4416. }
  4417. }
  4418. // Set the user agent
  4419. const gitHttpUserAgent = `git/${gitVersion} (github-actions-checkout)`;
  4420. core.debug(`Set git useragent to: ${gitHttpUserAgent}`);
  4421. this.gitEnv['GIT_HTTP_USER_AGENT'] = gitHttpUserAgent;
  4422. });
  4423. }
  4424. }
  4425. class GitOutput {
  4426. constructor() {
  4427. this.stdout = '';
  4428. this.exitCode = 0;
  4429. }
  4430. }
  4431. /***/ }),
  4432. /***/ 293:
  4433. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  4434. "use strict";
  4435. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4436. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4437. return new (P || (P = Promise))(function (resolve, reject) {
  4438. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4439. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4440. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4441. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4442. });
  4443. };
  4444. var __importStar = (this && this.__importStar) || function (mod) {
  4445. if (mod && mod.__esModule) return mod;
  4446. var result = {};
  4447. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  4448. result["default"] = mod;
  4449. return result;
  4450. };
  4451. Object.defineProperty(exports, "__esModule", { value: true });
  4452. const core = __importStar(__webpack_require__(470));
  4453. const coreCommand = __importStar(__webpack_require__(431));
  4454. const fs = __importStar(__webpack_require__(747));
  4455. const fsHelper = __importStar(__webpack_require__(618));
  4456. const gitCommandManager = __importStar(__webpack_require__(289));
  4457. const io = __importStar(__webpack_require__(1));
  4458. const path = __importStar(__webpack_require__(622));
  4459. const refHelper = __importStar(__webpack_require__(227));
  4460. const githubApiHelper = __importStar(__webpack_require__(464));
  4461. const authConfigKey = `http.https://github.com/.extraheader`;
  4462. function getSource(settings) {
  4463. return __awaiter(this, void 0, void 0, function* () {
  4464. // Repository URL
  4465. core.info(`Syncing repository: ${settings.repositoryOwner}/${settings.repositoryName}`);
  4466. const repositoryUrl = `https://github.com/${encodeURIComponent(settings.repositoryOwner)}/${encodeURIComponent(settings.repositoryName)}`;
  4467. // Set intra-task state for cleanup
  4468. coreCommand.issueCommand('save-state', { name: 'repositoryPath' }, settings.repositoryPath);
  4469. // Remove conflicting file path
  4470. if (fsHelper.fileExistsSync(settings.repositoryPath)) {
  4471. yield io.rmRF(settings.repositoryPath);
  4472. }
  4473. // Create directory
  4474. let isExisting = true;
  4475. if (!fsHelper.directoryExistsSync(settings.repositoryPath)) {
  4476. isExisting = false;
  4477. yield io.mkdirP(settings.repositoryPath);
  4478. }
  4479. // Git command manager
  4480. core.info(`Working directory is '${settings.repositoryPath}'`);
  4481. let git = null;
  4482. try {
  4483. git = yield gitCommandManager.CreateCommandManager(settings.repositoryPath, settings.lfs);
  4484. }
  4485. catch (err) {
  4486. // Git is required for LFS
  4487. if (settings.lfs) {
  4488. throw err;
  4489. }
  4490. // Otherwise fallback to REST API
  4491. }
  4492. // Prepare existing directory, otherwise recreate
  4493. if (isExisting) {
  4494. yield prepareExistingDirectory(git, settings.repositoryPath, repositoryUrl, settings.clean);
  4495. }
  4496. if (!git || `${1}` == '1') {
  4497. core.info(`Downloading the repository files using the GitHub REST API`);
  4498. core.info(`To create a local repository instead, add Git ${gitCommandManager.MinimumGitVersion} or higher to the PATH`);
  4499. yield githubApiHelper.downloadRepository(settings.accessToken, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit, settings.repositoryPath);
  4500. }
  4501. else {
  4502. // Initialize the repository
  4503. if (!fsHelper.directoryExistsSync(path.join(settings.repositoryPath, '.git'))) {
  4504. yield git.init();
  4505. yield git.remoteAdd('origin', repositoryUrl);
  4506. }
  4507. // Disable automatic garbage collection
  4508. if (!(yield git.tryDisableAutomaticGarbageCollection())) {
  4509. core.warning(`Unable to turn off git automatic garbage collection. The git fetch operation may trigger garbage collection and cause a delay.`);
  4510. }
  4511. // Remove possible previous extraheader
  4512. yield removeGitConfig(git, authConfigKey);
  4513. // Add extraheader (auth)
  4514. const base64Credentials = Buffer.from(`x-access-token:${settings.accessToken}`, 'utf8').toString('base64');
  4515. core.setSecret(base64Credentials);
  4516. const authConfigValue = `AUTHORIZATION: basic ${base64Credentials}`;
  4517. yield git.config(authConfigKey, authConfigValue);
  4518. // LFS install
  4519. if (settings.lfs) {
  4520. yield git.lfsInstall();
  4521. }
  4522. // Fetch
  4523. const refSpec = refHelper.getRefSpec(settings.ref, settings.commit);
  4524. yield git.fetch(settings.fetchDepth, refSpec);
  4525. // Checkout info
  4526. const checkoutInfo = yield refHelper.getCheckoutInfo(git, settings.ref, settings.commit);
  4527. // LFS fetch
  4528. // Explicit lfs-fetch to avoid slow checkout (fetches one lfs object at a time).
  4529. // Explicit lfs fetch will fetch lfs objects in parallel.
  4530. if (settings.lfs) {
  4531. yield git.lfsFetch(checkoutInfo.startPoint || checkoutInfo.ref);
  4532. }
  4533. // Checkout
  4534. yield git.checkout(checkoutInfo.ref, checkoutInfo.startPoint);
  4535. // Dump some info about the checked out commit
  4536. yield git.log1();
  4537. }
  4538. });
  4539. }
  4540. exports.getSource = getSource;
  4541. function cleanup(repositoryPath) {
  4542. return __awaiter(this, void 0, void 0, function* () {
  4543. // Repo exists?
  4544. if (!fsHelper.fileExistsSync(path.join(repositoryPath, '.git', 'config'))) {
  4545. return;
  4546. }
  4547. fsHelper.directoryExistsSync(repositoryPath, true);
  4548. // Remove the config key
  4549. const git = yield gitCommandManager.CreateCommandManager(repositoryPath, false);
  4550. yield removeGitConfig(git, authConfigKey);
  4551. });
  4552. }
  4553. exports.cleanup = cleanup;
  4554. function prepareExistingDirectory(git, repositoryPath, repositoryUrl, clean) {
  4555. return __awaiter(this, void 0, void 0, function* () {
  4556. let remove = false;
  4557. // Check whether using git or REST API
  4558. if (!git) {
  4559. remove = true;
  4560. }
  4561. // Fetch URL does not match
  4562. else if (!fsHelper.directoryExistsSync(path.join(repositoryPath, '.git')) ||
  4563. repositoryUrl !== (yield git.tryGetFetchUrl())) {
  4564. remove = true;
  4565. }
  4566. else {
  4567. // Delete any index.lock and shallow.lock left by a previously canceled run or crashed git process
  4568. const lockPaths = [
  4569. path.join(repositoryPath, '.git', 'index.lock'),
  4570. path.join(repositoryPath, '.git', 'shallow.lock')
  4571. ];
  4572. for (const lockPath of lockPaths) {
  4573. try {
  4574. yield io.rmRF(lockPath);
  4575. }
  4576. catch (error) {
  4577. core.debug(`Unable to delete '${lockPath}'. ${error.message}`);
  4578. }
  4579. }
  4580. try {
  4581. // Checkout detached HEAD
  4582. if (!(yield git.isDetached())) {
  4583. yield git.checkoutDetach();
  4584. }
  4585. // Remove all refs/heads/*
  4586. let branches = yield git.branchList(false);
  4587. for (const branch of branches) {
  4588. yield git.branchDelete(false, branch);
  4589. }
  4590. // Remove all refs/remotes/origin/* to avoid conflicts
  4591. branches = yield git.branchList(true);
  4592. for (const branch of branches) {
  4593. yield git.branchDelete(true, branch);
  4594. }
  4595. // Clean
  4596. if (clean) {
  4597. if (!(yield git.tryClean())) {
  4598. core.debug(`The clean command failed. This might be caused by: 1) path too long, 2) permission issue, or 3) file in use. For futher investigation, manually run 'git clean -ffdx' on the directory '${repositoryPath}'.`);
  4599. remove = true;
  4600. }
  4601. else if (!(yield git.tryReset())) {
  4602. remove = true;
  4603. }
  4604. if (remove) {
  4605. core.warning(`Unable to clean or reset the repository. The repository will be recreated instead.`);
  4606. }
  4607. }
  4608. }
  4609. catch (error) {
  4610. core.warning(`Unable to prepare the existing repository. The repository will be recreated instead.`);
  4611. remove = true;
  4612. }
  4613. }
  4614. if (remove) {
  4615. // Delete the contents of the directory. Don't delete the directory itself
  4616. // since it might be the current working directory.
  4617. core.info(`Deleting the contents of '${repositoryPath}'`);
  4618. for (const file of yield fs.promises.readdir(repositoryPath)) {
  4619. yield io.rmRF(path.join(repositoryPath, file));
  4620. }
  4621. }
  4622. });
  4623. }
  4624. function removeGitConfig(git, configKey) {
  4625. return __awaiter(this, void 0, void 0, function* () {
  4626. if ((yield git.configExists(configKey)) &&
  4627. !(yield git.tryConfigUnset(configKey))) {
  4628. // Load the config contents
  4629. core.warning(`Failed to remove '${configKey}' from the git config. Attempting to remove the config value by editing the file directly.`);
  4630. const configPath = path.join(git.getWorkingDirectory(), '.git', 'config');
  4631. fsHelper.fileExistsSync(configPath);
  4632. let contents = fs.readFileSync(configPath).toString() || '';
  4633. // Filter - only includes lines that do not contain the config key
  4634. const upperConfigKey = configKey.toUpperCase();
  4635. const split = contents
  4636. .split('\n')
  4637. .filter(x => !x.toUpperCase().includes(upperConfigKey));
  4638. contents = split.join('\n');
  4639. // Rewrite the config file
  4640. fs.writeFileSync(configPath, contents);
  4641. }
  4642. });
  4643. }
  4644. /***/ }),
  4645. /***/ 294:
  4646. /***/ (function(module, __unusedexports, __webpack_require__) {
  4647. module.exports = parseOptions;
  4648. const { Deprecation } = __webpack_require__(692);
  4649. const { getUserAgent } = __webpack_require__(796);
  4650. const once = __webpack_require__(969);
  4651. const pkg = __webpack_require__(215);
  4652. const deprecateOptionsTimeout = once((log, deprecation) =>
  4653. log.warn(deprecation)
  4654. );
  4655. const deprecateOptionsAgent = once((log, deprecation) => log.warn(deprecation));
  4656. const deprecateOptionsHeaders = once((log, deprecation) =>
  4657. log.warn(deprecation)
  4658. );
  4659. function parseOptions(options, log, hook) {
  4660. if (options.headers) {
  4661. options.headers = Object.keys(options.headers).reduce((newObj, key) => {
  4662. newObj[key.toLowerCase()] = options.headers[key];
  4663. return newObj;
  4664. }, {});
  4665. }
  4666. const clientDefaults = {
  4667. headers: options.headers || {},
  4668. request: options.request || {},
  4669. mediaType: {
  4670. previews: [],
  4671. format: ""
  4672. }
  4673. };
  4674. if (options.baseUrl) {
  4675. clientDefaults.baseUrl = options.baseUrl;
  4676. }
  4677. if (options.userAgent) {
  4678. clientDefaults.headers["user-agent"] = options.userAgent;
  4679. }
  4680. if (options.previews) {
  4681. clientDefaults.mediaType.previews = options.previews;
  4682. }
  4683. if (options.timeZone) {
  4684. clientDefaults.headers["time-zone"] = options.timeZone;
  4685. }
  4686. if (options.timeout) {
  4687. deprecateOptionsTimeout(
  4688. log,
  4689. new Deprecation(
  4690. "[@octokit/rest] new Octokit({timeout}) is deprecated. Use {request: {timeout}} instead. See https://github.com/octokit/request.js#request"
  4691. )
  4692. );
  4693. clientDefaults.request.timeout = options.timeout;
  4694. }
  4695. if (options.agent) {
  4696. deprecateOptionsAgent(
  4697. log,
  4698. new Deprecation(
  4699. "[@octokit/rest] new Octokit({agent}) is deprecated. Use {request: {agent}} instead. See https://github.com/octokit/request.js#request"
  4700. )
  4701. );
  4702. clientDefaults.request.agent = options.agent;
  4703. }
  4704. if (options.headers) {
  4705. deprecateOptionsHeaders(
  4706. log,
  4707. new Deprecation(
  4708. "[@octokit/rest] new Octokit({headers}) is deprecated. Use {userAgent, previews} instead. See https://github.com/octokit/request.js#request"
  4709. )
  4710. );
  4711. }
  4712. const userAgentOption = clientDefaults.headers["user-agent"];
  4713. const defaultUserAgent = `octokit.js/${pkg.version} ${getUserAgent()}`;
  4714. clientDefaults.headers["user-agent"] = [userAgentOption, defaultUserAgent]
  4715. .filter(Boolean)
  4716. .join(" ");
  4717. clientDefaults.request.hook = hook.bind(null, "request");
  4718. return clientDefaults;
  4719. }
  4720. /***/ }),
  4721. /***/ 297:
  4722. /***/ (function(module) {
  4723. module.exports = class HttpError extends Error {
  4724. constructor (message, code, headers) {
  4725. super(message)
  4726. // Maintains proper stack trace (only available on V8)
  4727. /* istanbul ignore next */
  4728. if (Error.captureStackTrace) {
  4729. Error.captureStackTrace(this, this.constructor)
  4730. }
  4731. this.name = 'HttpError'
  4732. this.code = code
  4733. this.headers = headers
  4734. }
  4735. }
  4736. /***/ }),
  4737. /***/ 301:
  4738. /***/ (function(module, __unusedexports, __webpack_require__) {
  4739. /**
  4740. * Some “list” response that can be paginated have a different response structure
  4741. *
  4742. * They have a `total_count` key in the response (search also has `incomplete_results`,
  4743. * /installation/repositories also has `repository_selection`), as well as a key with
  4744. * the list of the items which name varies from endpoint to endpoint:
  4745. *
  4746. * - https://developer.github.com/v3/search/#example (key `items`)
  4747. * - https://developer.github.com/v3/checks/runs/#response-3 (key: `check_runs`)
  4748. * - https://developer.github.com/v3/checks/suites/#response-1 (key: `check_suites`)
  4749. * - https://developer.github.com/v3/apps/installations/#list-repositories (key: `repositories`)
  4750. * - https://developer.github.com/v3/apps/installations/#list-installations-for-a-user (key `installations`)
  4751. * - https://developer.github.com/v3/orgs/#list-installations-for-an-organization (key `installations`)
  4752. *
  4753. * Octokit normalizes these responses so that paginated results are always returned following
  4754. * the same structure. One challenge is that if the list response has only one page, no Link
  4755. * header is provided, so this header alone is not sufficient to check wether a response is
  4756. * paginated or not. For the exceptions with the namespace, a fallback check for the route
  4757. * paths has to be added in order to normalize the response. We cannot check for the total_count
  4758. * property because it also exists in the response of Get the combined status for a specific ref.
  4759. */
  4760. module.exports = normalizePaginatedListResponse;
  4761. const { Deprecation } = __webpack_require__(692);
  4762. const once = __webpack_require__(969);
  4763. const deprecateIncompleteResults = once((log, deprecation) =>
  4764. log.warn(deprecation)
  4765. );
  4766. const deprecateTotalCount = once((log, deprecation) => log.warn(deprecation));
  4767. const deprecateNamespace = once((log, deprecation) => log.warn(deprecation));
  4768. const REGEX_IS_SEARCH_PATH = /^\/search\//;
  4769. const REGEX_IS_CHECKS_PATH = /^\/repos\/[^/]+\/[^/]+\/commits\/[^/]+\/(check-runs|check-suites)/;
  4770. const REGEX_IS_INSTALLATION_REPOSITORIES_PATH = /^\/installation\/repositories/;
  4771. const REGEX_IS_USER_INSTALLATIONS_PATH = /^\/user\/installations/;
  4772. const REGEX_IS_ORG_INSTALLATIONS_PATH = /^\/orgs\/[^/]+\/installations/;
  4773. function normalizePaginatedListResponse(octokit, url, response) {
  4774. const path = url.replace(octokit.request.endpoint.DEFAULTS.baseUrl, "");
  4775. if (
  4776. !REGEX_IS_SEARCH_PATH.test(path) &&
  4777. !REGEX_IS_CHECKS_PATH.test(path) &&
  4778. !REGEX_IS_INSTALLATION_REPOSITORIES_PATH.test(path) &&
  4779. !REGEX_IS_USER_INSTALLATIONS_PATH.test(path) &&
  4780. !REGEX_IS_ORG_INSTALLATIONS_PATH.test(path)
  4781. ) {
  4782. return;
  4783. }
  4784. // keep the additional properties intact to avoid a breaking change,
  4785. // but log a deprecation warning when accessed
  4786. const incompleteResults = response.data.incomplete_results;
  4787. const repositorySelection = response.data.repository_selection;
  4788. const totalCount = response.data.total_count;
  4789. delete response.data.incomplete_results;
  4790. delete response.data.repository_selection;
  4791. delete response.data.total_count;
  4792. const namespaceKey = Object.keys(response.data)[0];
  4793. response.data = response.data[namespaceKey];
  4794. Object.defineProperty(response.data, namespaceKey, {
  4795. get() {
  4796. deprecateNamespace(
  4797. octokit.log,
  4798. new Deprecation(
  4799. `[@octokit/rest] "result.data.${namespaceKey}" is deprecated. Use "result.data" instead`
  4800. )
  4801. );
  4802. return response.data;
  4803. }
  4804. });
  4805. if (typeof incompleteResults !== "undefined") {
  4806. Object.defineProperty(response.data, "incomplete_results", {
  4807. get() {
  4808. deprecateIncompleteResults(
  4809. octokit.log,
  4810. new Deprecation(
  4811. '[@octokit/rest] "result.data.incomplete_results" is deprecated.'
  4812. )
  4813. );
  4814. return incompleteResults;
  4815. }
  4816. });
  4817. }
  4818. if (typeof repositorySelection !== "undefined") {
  4819. Object.defineProperty(response.data, "repository_selection", {
  4820. get() {
  4821. deprecateTotalCount(
  4822. octokit.log,
  4823. new Deprecation(
  4824. '[@octokit/rest] "result.data.repository_selection" is deprecated.'
  4825. )
  4826. );
  4827. return repositorySelection;
  4828. }
  4829. });
  4830. }
  4831. Object.defineProperty(response.data, "total_count", {
  4832. get() {
  4833. deprecateTotalCount(
  4834. octokit.log,
  4835. new Deprecation(
  4836. '[@octokit/rest] "result.data.total_count" is deprecated.'
  4837. )
  4838. );
  4839. return totalCount;
  4840. }
  4841. });
  4842. }
  4843. /***/ }),
  4844. /***/ 323:
  4845. /***/ (function(module) {
  4846. "use strict";
  4847. var isStream = module.exports = function (stream) {
  4848. return stream !== null && typeof stream === 'object' && typeof stream.pipe === 'function';
  4849. };
  4850. isStream.writable = function (stream) {
  4851. return isStream(stream) && stream.writable !== false && typeof stream._write === 'function' && typeof stream._writableState === 'object';
  4852. };
  4853. isStream.readable = function (stream) {
  4854. return isStream(stream) && stream.readable !== false && typeof stream._read === 'function' && typeof stream._readableState === 'object';
  4855. };
  4856. isStream.duplex = function (stream) {
  4857. return isStream.writable(stream) && isStream.readable(stream);
  4858. };
  4859. isStream.transform = function (stream) {
  4860. return isStream.duplex(stream) && typeof stream._transform === 'function' && typeof stream._transformState === 'object';
  4861. };
  4862. /***/ }),
  4863. /***/ 336:
  4864. /***/ (function(module, __unusedexports, __webpack_require__) {
  4865. module.exports = hasLastPage
  4866. const deprecate = __webpack_require__(370)
  4867. const getPageLinks = __webpack_require__(577)
  4868. function hasLastPage (link) {
  4869. deprecate(`octokit.hasLastPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  4870. return getPageLinks(link).last
  4871. }
  4872. /***/ }),
  4873. /***/ 348:
  4874. /***/ (function(module, __unusedexports, __webpack_require__) {
  4875. "use strict";
  4876. module.exports = validate;
  4877. const { RequestError } = __webpack_require__(463);
  4878. const get = __webpack_require__(854);
  4879. const set = __webpack_require__(883);
  4880. function validate(octokit, options) {
  4881. if (!options.request.validate) {
  4882. return;
  4883. }
  4884. const { validate: params } = options.request;
  4885. Object.keys(params).forEach(parameterName => {
  4886. const parameter = get(params, parameterName);
  4887. const expectedType = parameter.type;
  4888. let parentParameterName;
  4889. let parentValue;
  4890. let parentParamIsPresent = true;
  4891. let parentParameterIsArray = false;
  4892. if (/\./.test(parameterName)) {
  4893. parentParameterName = parameterName.replace(/\.[^.]+$/, "");
  4894. parentParameterIsArray = parentParameterName.slice(-2) === "[]";
  4895. if (parentParameterIsArray) {
  4896. parentParameterName = parentParameterName.slice(0, -2);
  4897. }
  4898. parentValue = get(options, parentParameterName);
  4899. parentParamIsPresent =
  4900. parentParameterName === "headers" ||
  4901. (typeof parentValue === "object" && parentValue !== null);
  4902. }
  4903. const values = parentParameterIsArray
  4904. ? (get(options, parentParameterName) || []).map(
  4905. value => value[parameterName.split(/\./).pop()]
  4906. )
  4907. : [get(options, parameterName)];
  4908. values.forEach((value, i) => {
  4909. const valueIsPresent = typeof value !== "undefined";
  4910. const valueIsNull = value === null;
  4911. const currentParameterName = parentParameterIsArray
  4912. ? parameterName.replace(/\[\]/, `[${i}]`)
  4913. : parameterName;
  4914. if (!parameter.required && !valueIsPresent) {
  4915. return;
  4916. }
  4917. // if the parent parameter is of type object but allows null
  4918. // then the child parameters can be ignored
  4919. if (!parentParamIsPresent) {
  4920. return;
  4921. }
  4922. if (parameter.allowNull && valueIsNull) {
  4923. return;
  4924. }
  4925. if (!parameter.allowNull && valueIsNull) {
  4926. throw new RequestError(
  4927. `'${currentParameterName}' cannot be null`,
  4928. 400,
  4929. {
  4930. request: options
  4931. }
  4932. );
  4933. }
  4934. if (parameter.required && !valueIsPresent) {
  4935. throw new RequestError(
  4936. `Empty value for parameter '${currentParameterName}': ${JSON.stringify(
  4937. value
  4938. )}`,
  4939. 400,
  4940. {
  4941. request: options
  4942. }
  4943. );
  4944. }
  4945. // parse to integer before checking for enum
  4946. // so that string "1" will match enum with number 1
  4947. if (expectedType === "integer") {
  4948. const unparsedValue = value;
  4949. value = parseInt(value, 10);
  4950. if (isNaN(value)) {
  4951. throw new RequestError(
  4952. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  4953. unparsedValue
  4954. )} is NaN`,
  4955. 400,
  4956. {
  4957. request: options
  4958. }
  4959. );
  4960. }
  4961. }
  4962. if (parameter.enum && parameter.enum.indexOf(String(value)) === -1) {
  4963. throw new RequestError(
  4964. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  4965. value
  4966. )}`,
  4967. 400,
  4968. {
  4969. request: options
  4970. }
  4971. );
  4972. }
  4973. if (parameter.validation) {
  4974. const regex = new RegExp(parameter.validation);
  4975. if (!regex.test(value)) {
  4976. throw new RequestError(
  4977. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  4978. value
  4979. )}`,
  4980. 400,
  4981. {
  4982. request: options
  4983. }
  4984. );
  4985. }
  4986. }
  4987. if (expectedType === "object" && typeof value === "string") {
  4988. try {
  4989. value = JSON.parse(value);
  4990. } catch (exception) {
  4991. throw new RequestError(
  4992. `JSON parse error of value for parameter '${currentParameterName}': ${JSON.stringify(
  4993. value
  4994. )}`,
  4995. 400,
  4996. {
  4997. request: options
  4998. }
  4999. );
  5000. }
  5001. }
  5002. set(options, parameter.mapTo || currentParameterName, value);
  5003. });
  5004. });
  5005. return options;
  5006. }
  5007. /***/ }),
  5008. /***/ 349:
  5009. /***/ (function(module, __unusedexports, __webpack_require__) {
  5010. module.exports = authenticationRequestError;
  5011. const { RequestError } = __webpack_require__(463);
  5012. function authenticationRequestError(state, error, options) {
  5013. /* istanbul ignore next */
  5014. if (!error.headers) throw error;
  5015. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  5016. // handle "2FA required" error only
  5017. if (error.status !== 401 || !otpRequired) {
  5018. throw error;
  5019. }
  5020. if (
  5021. error.status === 401 &&
  5022. otpRequired &&
  5023. error.request &&
  5024. error.request.headers["x-github-otp"]
  5025. ) {
  5026. throw new RequestError(
  5027. "Invalid one-time password for two-factor authentication",
  5028. 401,
  5029. {
  5030. headers: error.headers,
  5031. request: options
  5032. }
  5033. );
  5034. }
  5035. if (typeof state.auth.on2fa !== "function") {
  5036. throw new RequestError(
  5037. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  5038. 401,
  5039. {
  5040. headers: error.headers,
  5041. request: options
  5042. }
  5043. );
  5044. }
  5045. return Promise.resolve()
  5046. .then(() => {
  5047. return state.auth.on2fa();
  5048. })
  5049. .then(oneTimePassword => {
  5050. const newOptions = Object.assign(options, {
  5051. headers: Object.assign(
  5052. { "x-github-otp": oneTimePassword },
  5053. options.headers
  5054. )
  5055. });
  5056. return state.octokit.request(newOptions);
  5057. });
  5058. }
  5059. /***/ }),
  5060. /***/ 357:
  5061. /***/ (function(module) {
  5062. module.exports = require("assert");
  5063. /***/ }),
  5064. /***/ 363:
  5065. /***/ (function(module) {
  5066. module.exports = register
  5067. function register (state, name, method, options) {
  5068. if (typeof method !== 'function') {
  5069. throw new Error('method for before hook must be a function')
  5070. }
  5071. if (!options) {
  5072. options = {}
  5073. }
  5074. if (Array.isArray(name)) {
  5075. return name.reverse().reduce(function (callback, name) {
  5076. return register.bind(null, state, name, callback, options)
  5077. }, method)()
  5078. }
  5079. return Promise.resolve()
  5080. .then(function () {
  5081. if (!state.registry[name]) {
  5082. return method(options)
  5083. }
  5084. return (state.registry[name]).reduce(function (method, registered) {
  5085. return registered.hook.bind(null, method, options)
  5086. }, method)()
  5087. })
  5088. }
  5089. /***/ }),
  5090. /***/ 368:
  5091. /***/ (function(module) {
  5092. module.exports = function atob(str) {
  5093. return Buffer.from(str, 'base64').toString('binary')
  5094. }
  5095. /***/ }),
  5096. /***/ 370:
  5097. /***/ (function(module) {
  5098. module.exports = deprecate
  5099. const loggedMessages = {}
  5100. function deprecate (message) {
  5101. if (loggedMessages[message]) {
  5102. return
  5103. }
  5104. console.warn(`DEPRECATED (@octokit/rest): ${message}`)
  5105. loggedMessages[message] = 1
  5106. }
  5107. /***/ }),
  5108. /***/ 372:
  5109. /***/ (function(module) {
  5110. module.exports = octokitDebug;
  5111. function octokitDebug(octokit) {
  5112. octokit.hook.wrap("request", (request, options) => {
  5113. octokit.log.debug("request", options);
  5114. const start = Date.now();
  5115. const requestOptions = octokit.request.endpoint.parse(options);
  5116. const path = requestOptions.url.replace(options.baseUrl, "");
  5117. return request(options)
  5118. .then(response => {
  5119. octokit.log.info(
  5120. `${requestOptions.method} ${path} - ${
  5121. response.status
  5122. } in ${Date.now() - start}ms`
  5123. );
  5124. return response;
  5125. })
  5126. .catch(error => {
  5127. octokit.log.info(
  5128. `${requestOptions.method} ${path} - ${error.status} in ${Date.now() -
  5129. start}ms`
  5130. );
  5131. throw error;
  5132. });
  5133. });
  5134. }
  5135. /***/ }),
  5136. /***/ 385:
  5137. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  5138. "use strict";
  5139. Object.defineProperty(exports, '__esModule', { value: true });
  5140. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  5141. var isPlainObject = _interopDefault(__webpack_require__(696));
  5142. var universalUserAgent = __webpack_require__(796);
  5143. function lowercaseKeys(object) {
  5144. if (!object) {
  5145. return {};
  5146. }
  5147. return Object.keys(object).reduce((newObj, key) => {
  5148. newObj[key.toLowerCase()] = object[key];
  5149. return newObj;
  5150. }, {});
  5151. }
  5152. function mergeDeep(defaults, options) {
  5153. const result = Object.assign({}, defaults);
  5154. Object.keys(options).forEach(key => {
  5155. if (isPlainObject(options[key])) {
  5156. if (!(key in defaults)) Object.assign(result, {
  5157. [key]: options[key]
  5158. });else result[key] = mergeDeep(defaults[key], options[key]);
  5159. } else {
  5160. Object.assign(result, {
  5161. [key]: options[key]
  5162. });
  5163. }
  5164. });
  5165. return result;
  5166. }
  5167. function merge(defaults, route, options) {
  5168. if (typeof route === "string") {
  5169. let [method, url] = route.split(" ");
  5170. options = Object.assign(url ? {
  5171. method,
  5172. url
  5173. } : {
  5174. url: method
  5175. }, options);
  5176. } else {
  5177. options = Object.assign({}, route);
  5178. } // lowercase header names before merging with defaults to avoid duplicates
  5179. options.headers = lowercaseKeys(options.headers);
  5180. const mergedOptions = mergeDeep(defaults || {}, options); // mediaType.previews arrays are merged, instead of overwritten
  5181. if (defaults && defaults.mediaType.previews.length) {
  5182. mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(preview => !mergedOptions.mediaType.previews.includes(preview)).concat(mergedOptions.mediaType.previews);
  5183. }
  5184. mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map(preview => preview.replace(/-preview/, ""));
  5185. return mergedOptions;
  5186. }
  5187. function addQueryParameters(url, parameters) {
  5188. const separator = /\?/.test(url) ? "&" : "?";
  5189. const names = Object.keys(parameters);
  5190. if (names.length === 0) {
  5191. return url;
  5192. }
  5193. return url + separator + names.map(name => {
  5194. if (name === "q") {
  5195. return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+");
  5196. }
  5197. return `${name}=${encodeURIComponent(parameters[name])}`;
  5198. }).join("&");
  5199. }
  5200. const urlVariableRegex = /\{[^}]+\}/g;
  5201. function removeNonChars(variableName) {
  5202. return variableName.replace(/^\W+|\W+$/g, "").split(/,/);
  5203. }
  5204. function extractUrlVariableNames(url) {
  5205. const matches = url.match(urlVariableRegex);
  5206. if (!matches) {
  5207. return [];
  5208. }
  5209. return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
  5210. }
  5211. function omit(object, keysToOmit) {
  5212. return Object.keys(object).filter(option => !keysToOmit.includes(option)).reduce((obj, key) => {
  5213. obj[key] = object[key];
  5214. return obj;
  5215. }, {});
  5216. }
  5217. // Based on https://github.com/bramstein/url-template, licensed under BSD
  5218. // TODO: create separate package.
  5219. //
  5220. // Copyright (c) 2012-2014, Bram Stein
  5221. // All rights reserved.
  5222. // Redistribution and use in source and binary forms, with or without
  5223. // modification, are permitted provided that the following conditions
  5224. // are met:
  5225. // 1. Redistributions of source code must retain the above copyright
  5226. // notice, this list of conditions and the following disclaimer.
  5227. // 2. Redistributions in binary form must reproduce the above copyright
  5228. // notice, this list of conditions and the following disclaimer in the
  5229. // documentation and/or other materials provided with the distribution.
  5230. // 3. The name of the author may not be used to endorse or promote products
  5231. // derived from this software without specific prior written permission.
  5232. // THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
  5233. // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  5234. // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  5235. // EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  5236. // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  5237. // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  5238. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  5239. // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  5240. // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  5241. // EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  5242. /* istanbul ignore file */
  5243. function encodeReserved(str) {
  5244. return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) {
  5245. if (!/%[0-9A-Fa-f]/.test(part)) {
  5246. part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]");
  5247. }
  5248. return part;
  5249. }).join("");
  5250. }
  5251. function encodeUnreserved(str) {
  5252. return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {
  5253. return "%" + c.charCodeAt(0).toString(16).toUpperCase();
  5254. });
  5255. }
  5256. function encodeValue(operator, value, key) {
  5257. value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value);
  5258. if (key) {
  5259. return encodeUnreserved(key) + "=" + value;
  5260. } else {
  5261. return value;
  5262. }
  5263. }
  5264. function isDefined(value) {
  5265. return value !== undefined && value !== null;
  5266. }
  5267. function isKeyOperator(operator) {
  5268. return operator === ";" || operator === "&" || operator === "?";
  5269. }
  5270. function getValues(context, operator, key, modifier) {
  5271. var value = context[key],
  5272. result = [];
  5273. if (isDefined(value) && value !== "") {
  5274. if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
  5275. value = value.toString();
  5276. if (modifier && modifier !== "*") {
  5277. value = value.substring(0, parseInt(modifier, 10));
  5278. }
  5279. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  5280. } else {
  5281. if (modifier === "*") {
  5282. if (Array.isArray(value)) {
  5283. value.filter(isDefined).forEach(function (value) {
  5284. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  5285. });
  5286. } else {
  5287. Object.keys(value).forEach(function (k) {
  5288. if (isDefined(value[k])) {
  5289. result.push(encodeValue(operator, value[k], k));
  5290. }
  5291. });
  5292. }
  5293. } else {
  5294. const tmp = [];
  5295. if (Array.isArray(value)) {
  5296. value.filter(isDefined).forEach(function (value) {
  5297. tmp.push(encodeValue(operator, value));
  5298. });
  5299. } else {
  5300. Object.keys(value).forEach(function (k) {
  5301. if (isDefined(value[k])) {
  5302. tmp.push(encodeUnreserved(k));
  5303. tmp.push(encodeValue(operator, value[k].toString()));
  5304. }
  5305. });
  5306. }
  5307. if (isKeyOperator(operator)) {
  5308. result.push(encodeUnreserved(key) + "=" + tmp.join(","));
  5309. } else if (tmp.length !== 0) {
  5310. result.push(tmp.join(","));
  5311. }
  5312. }
  5313. }
  5314. } else {
  5315. if (operator === ";") {
  5316. if (isDefined(value)) {
  5317. result.push(encodeUnreserved(key));
  5318. }
  5319. } else if (value === "" && (operator === "&" || operator === "?")) {
  5320. result.push(encodeUnreserved(key) + "=");
  5321. } else if (value === "") {
  5322. result.push("");
  5323. }
  5324. }
  5325. return result;
  5326. }
  5327. function parseUrl(template) {
  5328. return {
  5329. expand: expand.bind(null, template)
  5330. };
  5331. }
  5332. function expand(template, context) {
  5333. var operators = ["+", "#", ".", "/", ";", "?", "&"];
  5334. return template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function (_, expression, literal) {
  5335. if (expression) {
  5336. let operator = "";
  5337. const values = [];
  5338. if (operators.indexOf(expression.charAt(0)) !== -1) {
  5339. operator = expression.charAt(0);
  5340. expression = expression.substr(1);
  5341. }
  5342. expression.split(/,/g).forEach(function (variable) {
  5343. var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
  5344. values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
  5345. });
  5346. if (operator && operator !== "+") {
  5347. var separator = ",";
  5348. if (operator === "?") {
  5349. separator = "&";
  5350. } else if (operator !== "#") {
  5351. separator = operator;
  5352. }
  5353. return (values.length !== 0 ? operator : "") + values.join(separator);
  5354. } else {
  5355. return values.join(",");
  5356. }
  5357. } else {
  5358. return encodeReserved(literal);
  5359. }
  5360. });
  5361. }
  5362. function parse(options) {
  5363. // https://fetch.spec.whatwg.org/#methods
  5364. let method = options.method.toUpperCase(); // replace :varname with {varname} to make it RFC 6570 compatible
  5365. let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{+$1}");
  5366. let headers = Object.assign({}, options.headers);
  5367. let body;
  5368. let parameters = omit(options, ["method", "baseUrl", "url", "headers", "request", "mediaType"]); // extract variable names from URL to calculate remaining variables later
  5369. const urlVariableNames = extractUrlVariableNames(url);
  5370. url = parseUrl(url).expand(parameters);
  5371. if (!/^http/.test(url)) {
  5372. url = options.baseUrl + url;
  5373. }
  5374. const omittedParameters = Object.keys(options).filter(option => urlVariableNames.includes(option)).concat("baseUrl");
  5375. const remainingParameters = omit(parameters, omittedParameters);
  5376. const isBinaryRequset = /application\/octet-stream/i.test(headers.accept);
  5377. if (!isBinaryRequset) {
  5378. if (options.mediaType.format) {
  5379. // e.g. application/vnd.github.v3+json => application/vnd.github.v3.raw
  5380. headers.accept = headers.accept.split(/,/).map(preview => preview.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`)).join(",");
  5381. }
  5382. if (options.mediaType.previews.length) {
  5383. const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || [];
  5384. headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map(preview => {
  5385. const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json";
  5386. return `application/vnd.github.${preview}-preview${format}`;
  5387. }).join(",");
  5388. }
  5389. } // for GET/HEAD requests, set URL query parameters from remaining parameters
  5390. // for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters
  5391. if (["GET", "HEAD"].includes(method)) {
  5392. url = addQueryParameters(url, remainingParameters);
  5393. } else {
  5394. if ("data" in remainingParameters) {
  5395. body = remainingParameters.data;
  5396. } else {
  5397. if (Object.keys(remainingParameters).length) {
  5398. body = remainingParameters;
  5399. } else {
  5400. headers["content-length"] = 0;
  5401. }
  5402. }
  5403. } // default content-type for JSON if body is set
  5404. if (!headers["content-type"] && typeof body !== "undefined") {
  5405. headers["content-type"] = "application/json; charset=utf-8";
  5406. } // GitHub expects 'content-length: 0' header for PUT/PATCH requests without body.
  5407. // fetch does not allow to set `content-length` header, but we can set body to an empty string
  5408. if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") {
  5409. body = "";
  5410. } // Only return body/request keys if present
  5411. return Object.assign({
  5412. method,
  5413. url,
  5414. headers
  5415. }, typeof body !== "undefined" ? {
  5416. body
  5417. } : null, options.request ? {
  5418. request: options.request
  5419. } : null);
  5420. }
  5421. function endpointWithDefaults(defaults, route, options) {
  5422. return parse(merge(defaults, route, options));
  5423. }
  5424. function withDefaults(oldDefaults, newDefaults) {
  5425. const DEFAULTS = merge(oldDefaults, newDefaults);
  5426. const endpoint = endpointWithDefaults.bind(null, DEFAULTS);
  5427. return Object.assign(endpoint, {
  5428. DEFAULTS,
  5429. defaults: withDefaults.bind(null, DEFAULTS),
  5430. merge: merge.bind(null, DEFAULTS),
  5431. parse
  5432. });
  5433. }
  5434. const VERSION = "5.5.1";
  5435. const userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`; // DEFAULTS has all properties set that EndpointOptions has, except url.
  5436. // So we use RequestParameters and add method as additional required property.
  5437. const DEFAULTS = {
  5438. method: "GET",
  5439. baseUrl: "https://api.github.com",
  5440. headers: {
  5441. accept: "application/vnd.github.v3+json",
  5442. "user-agent": userAgent
  5443. },
  5444. mediaType: {
  5445. format: "",
  5446. previews: []
  5447. }
  5448. };
  5449. const endpoint = withDefaults(null, DEFAULTS);
  5450. exports.endpoint = endpoint;
  5451. //# sourceMappingURL=index.js.map
  5452. /***/ }),
  5453. /***/ 389:
  5454. /***/ (function(module, __unusedexports, __webpack_require__) {
  5455. "use strict";
  5456. const fs = __webpack_require__(747);
  5457. const shebangCommand = __webpack_require__(866);
  5458. function readShebang(command) {
  5459. // Read the first 150 bytes from the file
  5460. const size = 150;
  5461. let buffer;
  5462. if (Buffer.alloc) {
  5463. // Node.js v4.5+ / v5.10+
  5464. buffer = Buffer.alloc(size);
  5465. } else {
  5466. // Old Node.js API
  5467. buffer = new Buffer(size);
  5468. buffer.fill(0); // zero-fill
  5469. }
  5470. let fd;
  5471. try {
  5472. fd = fs.openSync(command, 'r');
  5473. fs.readSync(fd, buffer, 0, size, 0);
  5474. fs.closeSync(fd);
  5475. } catch (e) { /* Empty */ }
  5476. // Attempt to extract shebang (null is returned if not a shebang)
  5477. return shebangCommand(buffer.toString());
  5478. }
  5479. module.exports = readShebang;
  5480. /***/ }),
  5481. /***/ 402:
  5482. /***/ (function(module, __unusedexports, __webpack_require__) {
  5483. module.exports = Octokit;
  5484. const { request } = __webpack_require__(753);
  5485. const Hook = __webpack_require__(523);
  5486. const parseClientOptions = __webpack_require__(294);
  5487. function Octokit(plugins, options) {
  5488. options = options || {};
  5489. const hook = new Hook.Collection();
  5490. const log = Object.assign(
  5491. {
  5492. debug: () => {},
  5493. info: () => {},
  5494. warn: console.warn,
  5495. error: console.error
  5496. },
  5497. options && options.log
  5498. );
  5499. const api = {
  5500. hook,
  5501. log,
  5502. request: request.defaults(parseClientOptions(options, log, hook))
  5503. };
  5504. plugins.forEach(pluginFunction => pluginFunction(api, options));
  5505. return api;
  5506. }
  5507. /***/ }),
  5508. /***/ 413:
  5509. /***/ (function(module) {
  5510. module.exports = require("stream");
  5511. /***/ }),
  5512. /***/ 417:
  5513. /***/ (function(module) {
  5514. module.exports = require("crypto");
  5515. /***/ }),
  5516. /***/ 427:
  5517. /***/ (function(module, __unusedexports, __webpack_require__) {
  5518. "use strict";
  5519. // Older verions of Node.js might not have `util.getSystemErrorName()`.
  5520. // In that case, fall back to a deprecated internal.
  5521. const util = __webpack_require__(669);
  5522. let uv;
  5523. if (typeof util.getSystemErrorName === 'function') {
  5524. module.exports = util.getSystemErrorName;
  5525. } else {
  5526. try {
  5527. uv = process.binding('uv');
  5528. if (typeof uv.errname !== 'function') {
  5529. throw new TypeError('uv.errname is not a function');
  5530. }
  5531. } catch (err) {
  5532. console.error('execa/lib/errname: unable to establish process.binding(\'uv\')', err);
  5533. uv = null;
  5534. }
  5535. module.exports = code => errname(uv, code);
  5536. }
  5537. // Used for testing the fallback behavior
  5538. module.exports.__test__ = errname;
  5539. function errname(uv, code) {
  5540. if (uv) {
  5541. return uv.errname(code);
  5542. }
  5543. if (!(code < 0)) {
  5544. throw new Error('err >= 0');
  5545. }
  5546. return `Unknown system error ${code}`;
  5547. }
  5548. /***/ }),
  5549. /***/ 430:
  5550. /***/ (function(module, __unusedexports, __webpack_require__) {
  5551. module.exports = octokitValidate;
  5552. const validate = __webpack_require__(348);
  5553. function octokitValidate(octokit) {
  5554. octokit.hook.before("request", validate.bind(null, octokit));
  5555. }
  5556. /***/ }),
  5557. /***/ 431:
  5558. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  5559. "use strict";
  5560. Object.defineProperty(exports, "__esModule", { value: true });
  5561. const os = __webpack_require__(87);
  5562. /**
  5563. * Commands
  5564. *
  5565. * Command Format:
  5566. * ##[name key=value;key=value]message
  5567. *
  5568. * Examples:
  5569. * ##[warning]This is the user warning message
  5570. * ##[set-secret name=mypassword]definitelyNotAPassword!
  5571. */
  5572. function issueCommand(command, properties, message) {
  5573. const cmd = new Command(command, properties, message);
  5574. process.stdout.write(cmd.toString() + os.EOL);
  5575. }
  5576. exports.issueCommand = issueCommand;
  5577. function issue(name, message = '') {
  5578. issueCommand(name, {}, message);
  5579. }
  5580. exports.issue = issue;
  5581. const CMD_STRING = '::';
  5582. class Command {
  5583. constructor(command, properties, message) {
  5584. if (!command) {
  5585. command = 'missing.command';
  5586. }
  5587. this.command = command;
  5588. this.properties = properties;
  5589. this.message = message;
  5590. }
  5591. toString() {
  5592. let cmdStr = CMD_STRING + this.command;
  5593. if (this.properties && Object.keys(this.properties).length > 0) {
  5594. cmdStr += ' ';
  5595. for (const key in this.properties) {
  5596. if (this.properties.hasOwnProperty(key)) {
  5597. const val = this.properties[key];
  5598. if (val) {
  5599. // safely append the val - avoid blowing up when attempting to
  5600. // call .replace() if message is not a string for some reason
  5601. cmdStr += `${key}=${escape(`${val || ''}`)},`;
  5602. }
  5603. }
  5604. }
  5605. }
  5606. cmdStr += CMD_STRING;
  5607. // safely append the message - avoid blowing up when attempting to
  5608. // call .replace() if message is not a string for some reason
  5609. const message = `${this.message || ''}`;
  5610. cmdStr += escapeData(message);
  5611. return cmdStr;
  5612. }
  5613. }
  5614. function escapeData(s) {
  5615. return s.replace(/\r/g, '%0D').replace(/\n/g, '%0A');
  5616. }
  5617. function escape(s) {
  5618. return s
  5619. .replace(/\r/g, '%0D')
  5620. .replace(/\n/g, '%0A')
  5621. .replace(/]/g, '%5D')
  5622. .replace(/;/g, '%3B');
  5623. }
  5624. //# sourceMappingURL=command.js.map
  5625. /***/ }),
  5626. /***/ 453:
  5627. /***/ (function(module, __unusedexports, __webpack_require__) {
  5628. var once = __webpack_require__(969)
  5629. var eos = __webpack_require__(562)
  5630. var fs = __webpack_require__(747) // we only need fs to get the ReadStream and WriteStream prototypes
  5631. var noop = function () {}
  5632. var ancient = /^v?\.0/.test(process.version)
  5633. var isFn = function (fn) {
  5634. return typeof fn === 'function'
  5635. }
  5636. var isFS = function (stream) {
  5637. if (!ancient) return false // newer node version do not need to care about fs is a special way
  5638. if (!fs) return false // browser
  5639. return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close)
  5640. }
  5641. var isRequest = function (stream) {
  5642. return stream.setHeader && isFn(stream.abort)
  5643. }
  5644. var destroyer = function (stream, reading, writing, callback) {
  5645. callback = once(callback)
  5646. var closed = false
  5647. stream.on('close', function () {
  5648. closed = true
  5649. })
  5650. eos(stream, {readable: reading, writable: writing}, function (err) {
  5651. if (err) return callback(err)
  5652. closed = true
  5653. callback()
  5654. })
  5655. var destroyed = false
  5656. return function (err) {
  5657. if (closed) return
  5658. if (destroyed) return
  5659. destroyed = true
  5660. if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks
  5661. if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want
  5662. if (isFn(stream.destroy)) return stream.destroy()
  5663. callback(err || new Error('stream was destroyed'))
  5664. }
  5665. }
  5666. var call = function (fn) {
  5667. fn()
  5668. }
  5669. var pipe = function (from, to) {
  5670. return from.pipe(to)
  5671. }
  5672. var pump = function () {
  5673. var streams = Array.prototype.slice.call(arguments)
  5674. var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop
  5675. if (Array.isArray(streams[0])) streams = streams[0]
  5676. if (streams.length < 2) throw new Error('pump requires two streams per minimum')
  5677. var error
  5678. var destroys = streams.map(function (stream, i) {
  5679. var reading = i < streams.length - 1
  5680. var writing = i > 0
  5681. return destroyer(stream, reading, writing, function (err) {
  5682. if (!error) error = err
  5683. if (err) destroys.forEach(call)
  5684. if (reading) return
  5685. destroys.forEach(call)
  5686. callback(error)
  5687. })
  5688. })
  5689. return streams.reduce(pipe)
  5690. }
  5691. module.exports = pump
  5692. /***/ }),
  5693. /***/ 454:
  5694. /***/ (function(module, exports, __webpack_require__) {
  5695. "use strict";
  5696. Object.defineProperty(exports, '__esModule', { value: true });
  5697. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  5698. var Stream = _interopDefault(__webpack_require__(413));
  5699. var http = _interopDefault(__webpack_require__(605));
  5700. var Url = _interopDefault(__webpack_require__(835));
  5701. var https = _interopDefault(__webpack_require__(211));
  5702. var zlib = _interopDefault(__webpack_require__(761));
  5703. // Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js
  5704. // fix for "Readable" isn't a named export issue
  5705. const Readable = Stream.Readable;
  5706. const BUFFER = Symbol('buffer');
  5707. const TYPE = Symbol('type');
  5708. class Blob {
  5709. constructor() {
  5710. this[TYPE] = '';
  5711. const blobParts = arguments[0];
  5712. const options = arguments[1];
  5713. const buffers = [];
  5714. let size = 0;
  5715. if (blobParts) {
  5716. const a = blobParts;
  5717. const length = Number(a.length);
  5718. for (let i = 0; i < length; i++) {
  5719. const element = a[i];
  5720. let buffer;
  5721. if (element instanceof Buffer) {
  5722. buffer = element;
  5723. } else if (ArrayBuffer.isView(element)) {
  5724. buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength);
  5725. } else if (element instanceof ArrayBuffer) {
  5726. buffer = Buffer.from(element);
  5727. } else if (element instanceof Blob) {
  5728. buffer = element[BUFFER];
  5729. } else {
  5730. buffer = Buffer.from(typeof element === 'string' ? element : String(element));
  5731. }
  5732. size += buffer.length;
  5733. buffers.push(buffer);
  5734. }
  5735. }
  5736. this[BUFFER] = Buffer.concat(buffers);
  5737. let type = options && options.type !== undefined && String(options.type).toLowerCase();
  5738. if (type && !/[^\u0020-\u007E]/.test(type)) {
  5739. this[TYPE] = type;
  5740. }
  5741. }
  5742. get size() {
  5743. return this[BUFFER].length;
  5744. }
  5745. get type() {
  5746. return this[TYPE];
  5747. }
  5748. text() {
  5749. return Promise.resolve(this[BUFFER].toString());
  5750. }
  5751. arrayBuffer() {
  5752. const buf = this[BUFFER];
  5753. const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  5754. return Promise.resolve(ab);
  5755. }
  5756. stream() {
  5757. const readable = new Readable();
  5758. readable._read = function () {};
  5759. readable.push(this[BUFFER]);
  5760. readable.push(null);
  5761. return readable;
  5762. }
  5763. toString() {
  5764. return '[object Blob]';
  5765. }
  5766. slice() {
  5767. const size = this.size;
  5768. const start = arguments[0];
  5769. const end = arguments[1];
  5770. let relativeStart, relativeEnd;
  5771. if (start === undefined) {
  5772. relativeStart = 0;
  5773. } else if (start < 0) {
  5774. relativeStart = Math.max(size + start, 0);
  5775. } else {
  5776. relativeStart = Math.min(start, size);
  5777. }
  5778. if (end === undefined) {
  5779. relativeEnd = size;
  5780. } else if (end < 0) {
  5781. relativeEnd = Math.max(size + end, 0);
  5782. } else {
  5783. relativeEnd = Math.min(end, size);
  5784. }
  5785. const span = Math.max(relativeEnd - relativeStart, 0);
  5786. const buffer = this[BUFFER];
  5787. const slicedBuffer = buffer.slice(relativeStart, relativeStart + span);
  5788. const blob = new Blob([], { type: arguments[2] });
  5789. blob[BUFFER] = slicedBuffer;
  5790. return blob;
  5791. }
  5792. }
  5793. Object.defineProperties(Blob.prototype, {
  5794. size: { enumerable: true },
  5795. type: { enumerable: true },
  5796. slice: { enumerable: true }
  5797. });
  5798. Object.defineProperty(Blob.prototype, Symbol.toStringTag, {
  5799. value: 'Blob',
  5800. writable: false,
  5801. enumerable: false,
  5802. configurable: true
  5803. });
  5804. /**
  5805. * fetch-error.js
  5806. *
  5807. * FetchError interface for operational errors
  5808. */
  5809. /**
  5810. * Create FetchError instance
  5811. *
  5812. * @param String message Error message for human
  5813. * @param String type Error type for machine
  5814. * @param String systemError For Node.js system error
  5815. * @return FetchError
  5816. */
  5817. function FetchError(message, type, systemError) {
  5818. Error.call(this, message);
  5819. this.message = message;
  5820. this.type = type;
  5821. // when err.type is `system`, err.code contains system error code
  5822. if (systemError) {
  5823. this.code = this.errno = systemError.code;
  5824. }
  5825. // hide custom error implementation details from end-users
  5826. Error.captureStackTrace(this, this.constructor);
  5827. }
  5828. FetchError.prototype = Object.create(Error.prototype);
  5829. FetchError.prototype.constructor = FetchError;
  5830. FetchError.prototype.name = 'FetchError';
  5831. let convert;
  5832. try {
  5833. convert = __webpack_require__(18).convert;
  5834. } catch (e) {}
  5835. const INTERNALS = Symbol('Body internals');
  5836. // fix an issue where "PassThrough" isn't a named export for node <10
  5837. const PassThrough = Stream.PassThrough;
  5838. /**
  5839. * Body mixin
  5840. *
  5841. * Ref: https://fetch.spec.whatwg.org/#body
  5842. *
  5843. * @param Stream body Readable stream
  5844. * @param Object opts Response options
  5845. * @return Void
  5846. */
  5847. function Body(body) {
  5848. var _this = this;
  5849. var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  5850. _ref$size = _ref.size;
  5851. let size = _ref$size === undefined ? 0 : _ref$size;
  5852. var _ref$timeout = _ref.timeout;
  5853. let timeout = _ref$timeout === undefined ? 0 : _ref$timeout;
  5854. if (body == null) {
  5855. // body is undefined or null
  5856. body = null;
  5857. } else if (isURLSearchParams(body)) {
  5858. // body is a URLSearchParams
  5859. body = Buffer.from(body.toString());
  5860. } else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  5861. // body is ArrayBuffer
  5862. body = Buffer.from(body);
  5863. } else if (ArrayBuffer.isView(body)) {
  5864. // body is ArrayBufferView
  5865. body = Buffer.from(body.buffer, body.byteOffset, body.byteLength);
  5866. } else if (body instanceof Stream) ; else {
  5867. // none of the above
  5868. // coerce to string then buffer
  5869. body = Buffer.from(String(body));
  5870. }
  5871. this[INTERNALS] = {
  5872. body,
  5873. disturbed: false,
  5874. error: null
  5875. };
  5876. this.size = size;
  5877. this.timeout = timeout;
  5878. if (body instanceof Stream) {
  5879. body.on('error', function (err) {
  5880. const error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err);
  5881. _this[INTERNALS].error = error;
  5882. });
  5883. }
  5884. }
  5885. Body.prototype = {
  5886. get body() {
  5887. return this[INTERNALS].body;
  5888. },
  5889. get bodyUsed() {
  5890. return this[INTERNALS].disturbed;
  5891. },
  5892. /**
  5893. * Decode response as ArrayBuffer
  5894. *
  5895. * @return Promise
  5896. */
  5897. arrayBuffer() {
  5898. return consumeBody.call(this).then(function (buf) {
  5899. return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  5900. });
  5901. },
  5902. /**
  5903. * Return raw response as Blob
  5904. *
  5905. * @return Promise
  5906. */
  5907. blob() {
  5908. let ct = this.headers && this.headers.get('content-type') || '';
  5909. return consumeBody.call(this).then(function (buf) {
  5910. return Object.assign(
  5911. // Prevent copying
  5912. new Blob([], {
  5913. type: ct.toLowerCase()
  5914. }), {
  5915. [BUFFER]: buf
  5916. });
  5917. });
  5918. },
  5919. /**
  5920. * Decode response as json
  5921. *
  5922. * @return Promise
  5923. */
  5924. json() {
  5925. var _this2 = this;
  5926. return consumeBody.call(this).then(function (buffer) {
  5927. try {
  5928. return JSON.parse(buffer.toString());
  5929. } catch (err) {
  5930. return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));
  5931. }
  5932. });
  5933. },
  5934. /**
  5935. * Decode response as text
  5936. *
  5937. * @return Promise
  5938. */
  5939. text() {
  5940. return consumeBody.call(this).then(function (buffer) {
  5941. return buffer.toString();
  5942. });
  5943. },
  5944. /**
  5945. * Decode response as buffer (non-spec api)
  5946. *
  5947. * @return Promise
  5948. */
  5949. buffer() {
  5950. return consumeBody.call(this);
  5951. },
  5952. /**
  5953. * Decode response as text, while automatically detecting the encoding and
  5954. * trying to decode to UTF-8 (non-spec api)
  5955. *
  5956. * @return Promise
  5957. */
  5958. textConverted() {
  5959. var _this3 = this;
  5960. return consumeBody.call(this).then(function (buffer) {
  5961. return convertBody(buffer, _this3.headers);
  5962. });
  5963. }
  5964. };
  5965. // In browsers, all properties are enumerable.
  5966. Object.defineProperties(Body.prototype, {
  5967. body: { enumerable: true },
  5968. bodyUsed: { enumerable: true },
  5969. arrayBuffer: { enumerable: true },
  5970. blob: { enumerable: true },
  5971. json: { enumerable: true },
  5972. text: { enumerable: true }
  5973. });
  5974. Body.mixIn = function (proto) {
  5975. for (const name of Object.getOwnPropertyNames(Body.prototype)) {
  5976. // istanbul ignore else: future proof
  5977. if (!(name in proto)) {
  5978. const desc = Object.getOwnPropertyDescriptor(Body.prototype, name);
  5979. Object.defineProperty(proto, name, desc);
  5980. }
  5981. }
  5982. };
  5983. /**
  5984. * Consume and convert an entire Body to a Buffer.
  5985. *
  5986. * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body
  5987. *
  5988. * @return Promise
  5989. */
  5990. function consumeBody() {
  5991. var _this4 = this;
  5992. if (this[INTERNALS].disturbed) {
  5993. return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`));
  5994. }
  5995. this[INTERNALS].disturbed = true;
  5996. if (this[INTERNALS].error) {
  5997. return Body.Promise.reject(this[INTERNALS].error);
  5998. }
  5999. let body = this.body;
  6000. // body is null
  6001. if (body === null) {
  6002. return Body.Promise.resolve(Buffer.alloc(0));
  6003. }
  6004. // body is blob
  6005. if (isBlob(body)) {
  6006. body = body.stream();
  6007. }
  6008. // body is buffer
  6009. if (Buffer.isBuffer(body)) {
  6010. return Body.Promise.resolve(body);
  6011. }
  6012. // istanbul ignore if: should never happen
  6013. if (!(body instanceof Stream)) {
  6014. return Body.Promise.resolve(Buffer.alloc(0));
  6015. }
  6016. // body is stream
  6017. // get ready to actually consume the body
  6018. let accum = [];
  6019. let accumBytes = 0;
  6020. let abort = false;
  6021. return new Body.Promise(function (resolve, reject) {
  6022. let resTimeout;
  6023. // allow timeout on slow response body
  6024. if (_this4.timeout) {
  6025. resTimeout = setTimeout(function () {
  6026. abort = true;
  6027. reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout'));
  6028. }, _this4.timeout);
  6029. }
  6030. // handle stream errors
  6031. body.on('error', function (err) {
  6032. if (err.name === 'AbortError') {
  6033. // if the request was aborted, reject with this Error
  6034. abort = true;
  6035. reject(err);
  6036. } else {
  6037. // other errors, such as incorrect content-encoding
  6038. reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err));
  6039. }
  6040. });
  6041. body.on('data', function (chunk) {
  6042. if (abort || chunk === null) {
  6043. return;
  6044. }
  6045. if (_this4.size && accumBytes + chunk.length > _this4.size) {
  6046. abort = true;
  6047. reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size'));
  6048. return;
  6049. }
  6050. accumBytes += chunk.length;
  6051. accum.push(chunk);
  6052. });
  6053. body.on('end', function () {
  6054. if (abort) {
  6055. return;
  6056. }
  6057. clearTimeout(resTimeout);
  6058. try {
  6059. resolve(Buffer.concat(accum, accumBytes));
  6060. } catch (err) {
  6061. // handle streams that have accumulated too much data (issue #414)
  6062. reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err));
  6063. }
  6064. });
  6065. });
  6066. }
  6067. /**
  6068. * Detect buffer encoding and convert to target encoding
  6069. * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding
  6070. *
  6071. * @param Buffer buffer Incoming buffer
  6072. * @param String encoding Target encoding
  6073. * @return String
  6074. */
  6075. function convertBody(buffer, headers) {
  6076. if (typeof convert !== 'function') {
  6077. throw new Error('The package `encoding` must be installed to use the textConverted() function');
  6078. }
  6079. const ct = headers.get('content-type');
  6080. let charset = 'utf-8';
  6081. let res, str;
  6082. // header
  6083. if (ct) {
  6084. res = /charset=([^;]*)/i.exec(ct);
  6085. }
  6086. // no charset in content type, peek at response body for at most 1024 bytes
  6087. str = buffer.slice(0, 1024).toString();
  6088. // html5
  6089. if (!res && str) {
  6090. res = /<meta.+?charset=(['"])(.+?)\1/i.exec(str);
  6091. }
  6092. // html4
  6093. if (!res && str) {
  6094. res = /<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(str);
  6095. if (res) {
  6096. res = /charset=(.*)/i.exec(res.pop());
  6097. }
  6098. }
  6099. // xml
  6100. if (!res && str) {
  6101. res = /<\?xml.+?encoding=(['"])(.+?)\1/i.exec(str);
  6102. }
  6103. // found charset
  6104. if (res) {
  6105. charset = res.pop();
  6106. // prevent decode issues when sites use incorrect encoding
  6107. // ref: https://hsivonen.fi/encoding-menu/
  6108. if (charset === 'gb2312' || charset === 'gbk') {
  6109. charset = 'gb18030';
  6110. }
  6111. }
  6112. // turn raw buffers into a single utf-8 buffer
  6113. return convert(buffer, 'UTF-8', charset).toString();
  6114. }
  6115. /**
  6116. * Detect a URLSearchParams object
  6117. * ref: https://github.com/bitinn/node-fetch/issues/296#issuecomment-307598143
  6118. *
  6119. * @param Object obj Object to detect by type or brand
  6120. * @return String
  6121. */
  6122. function isURLSearchParams(obj) {
  6123. // Duck-typing as a necessary condition.
  6124. if (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {
  6125. return false;
  6126. }
  6127. // Brand-checking and more duck-typing as optional condition.
  6128. return obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';
  6129. }
  6130. /**
  6131. * Check if `obj` is a W3C `Blob` object (which `File` inherits from)
  6132. * @param {*} obj
  6133. * @return {boolean}
  6134. */
  6135. function isBlob(obj) {
  6136. return typeof obj === 'object' && typeof obj.arrayBuffer === 'function' && typeof obj.type === 'string' && typeof obj.stream === 'function' && typeof obj.constructor === 'function' && typeof obj.constructor.name === 'string' && /^(Blob|File)$/.test(obj.constructor.name) && /^(Blob|File)$/.test(obj[Symbol.toStringTag]);
  6137. }
  6138. /**
  6139. * Clone body given Res/Req instance
  6140. *
  6141. * @param Mixed instance Response or Request instance
  6142. * @return Mixed
  6143. */
  6144. function clone(instance) {
  6145. let p1, p2;
  6146. let body = instance.body;
  6147. // don't allow cloning a used body
  6148. if (instance.bodyUsed) {
  6149. throw new Error('cannot clone body after it is used');
  6150. }
  6151. // check that body is a stream and not form-data object
  6152. // note: we can't clone the form-data object without having it as a dependency
  6153. if (body instanceof Stream && typeof body.getBoundary !== 'function') {
  6154. // tee instance body
  6155. p1 = new PassThrough();
  6156. p2 = new PassThrough();
  6157. body.pipe(p1);
  6158. body.pipe(p2);
  6159. // set instance body to teed body and return the other teed body
  6160. instance[INTERNALS].body = p1;
  6161. body = p2;
  6162. }
  6163. return body;
  6164. }
  6165. /**
  6166. * Performs the operation "extract a `Content-Type` value from |object|" as
  6167. * specified in the specification:
  6168. * https://fetch.spec.whatwg.org/#concept-bodyinit-extract
  6169. *
  6170. * This function assumes that instance.body is present.
  6171. *
  6172. * @param Mixed instance Any options.body input
  6173. */
  6174. function extractContentType(body) {
  6175. if (body === null) {
  6176. // body is null
  6177. return null;
  6178. } else if (typeof body === 'string') {
  6179. // body is string
  6180. return 'text/plain;charset=UTF-8';
  6181. } else if (isURLSearchParams(body)) {
  6182. // body is a URLSearchParams
  6183. return 'application/x-www-form-urlencoded;charset=UTF-8';
  6184. } else if (isBlob(body)) {
  6185. // body is blob
  6186. return body.type || null;
  6187. } else if (Buffer.isBuffer(body)) {
  6188. // body is buffer
  6189. return null;
  6190. } else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  6191. // body is ArrayBuffer
  6192. return null;
  6193. } else if (ArrayBuffer.isView(body)) {
  6194. // body is ArrayBufferView
  6195. return null;
  6196. } else if (typeof body.getBoundary === 'function') {
  6197. // detect form data input from form-data module
  6198. return `multipart/form-data;boundary=${body.getBoundary()}`;
  6199. } else if (body instanceof Stream) {
  6200. // body is stream
  6201. // can't really do much about this
  6202. return null;
  6203. } else {
  6204. // Body constructor defaults other things to string
  6205. return 'text/plain;charset=UTF-8';
  6206. }
  6207. }
  6208. /**
  6209. * The Fetch Standard treats this as if "total bytes" is a property on the body.
  6210. * For us, we have to explicitly get it with a function.
  6211. *
  6212. * ref: https://fetch.spec.whatwg.org/#concept-body-total-bytes
  6213. *
  6214. * @param Body instance Instance of Body
  6215. * @return Number? Number of bytes, or null if not possible
  6216. */
  6217. function getTotalBytes(instance) {
  6218. const body = instance.body;
  6219. if (body === null) {
  6220. // body is null
  6221. return 0;
  6222. } else if (isBlob(body)) {
  6223. return body.size;
  6224. } else if (Buffer.isBuffer(body)) {
  6225. // body is buffer
  6226. return body.length;
  6227. } else if (body && typeof body.getLengthSync === 'function') {
  6228. // detect form data input from form-data module
  6229. if (body._lengthRetrievers && body._lengthRetrievers.length == 0 || // 1.x
  6230. body.hasKnownLength && body.hasKnownLength()) {
  6231. // 2.x
  6232. return body.getLengthSync();
  6233. }
  6234. return null;
  6235. } else {
  6236. // body is stream
  6237. return null;
  6238. }
  6239. }
  6240. /**
  6241. * Write a Body to a Node.js WritableStream (e.g. http.Request) object.
  6242. *
  6243. * @param Body instance Instance of Body
  6244. * @return Void
  6245. */
  6246. function writeToStream(dest, instance) {
  6247. const body = instance.body;
  6248. if (body === null) {
  6249. // body is null
  6250. dest.end();
  6251. } else if (isBlob(body)) {
  6252. body.stream().pipe(dest);
  6253. } else if (Buffer.isBuffer(body)) {
  6254. // body is buffer
  6255. dest.write(body);
  6256. dest.end();
  6257. } else {
  6258. // body is stream
  6259. body.pipe(dest);
  6260. }
  6261. }
  6262. // expose Promise
  6263. Body.Promise = global.Promise;
  6264. /**
  6265. * headers.js
  6266. *
  6267. * Headers class offers convenient helpers
  6268. */
  6269. const invalidTokenRegex = /[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/;
  6270. const invalidHeaderCharRegex = /[^\t\x20-\x7e\x80-\xff]/;
  6271. function validateName(name) {
  6272. name = `${name}`;
  6273. if (invalidTokenRegex.test(name) || name === '') {
  6274. throw new TypeError(`${name} is not a legal HTTP header name`);
  6275. }
  6276. }
  6277. function validateValue(value) {
  6278. value = `${value}`;
  6279. if (invalidHeaderCharRegex.test(value)) {
  6280. throw new TypeError(`${value} is not a legal HTTP header value`);
  6281. }
  6282. }
  6283. /**
  6284. * Find the key in the map object given a header name.
  6285. *
  6286. * Returns undefined if not found.
  6287. *
  6288. * @param String name Header name
  6289. * @return String|Undefined
  6290. */
  6291. function find(map, name) {
  6292. name = name.toLowerCase();
  6293. for (const key in map) {
  6294. if (key.toLowerCase() === name) {
  6295. return key;
  6296. }
  6297. }
  6298. return undefined;
  6299. }
  6300. const MAP = Symbol('map');
  6301. class Headers {
  6302. /**
  6303. * Headers class
  6304. *
  6305. * @param Object headers Response headers
  6306. * @return Void
  6307. */
  6308. constructor() {
  6309. let init = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
  6310. this[MAP] = Object.create(null);
  6311. if (init instanceof Headers) {
  6312. const rawHeaders = init.raw();
  6313. const headerNames = Object.keys(rawHeaders);
  6314. for (const headerName of headerNames) {
  6315. for (const value of rawHeaders[headerName]) {
  6316. this.append(headerName, value);
  6317. }
  6318. }
  6319. return;
  6320. }
  6321. // We don't worry about converting prop to ByteString here as append()
  6322. // will handle it.
  6323. if (init == null) ; else if (typeof init === 'object') {
  6324. const method = init[Symbol.iterator];
  6325. if (method != null) {
  6326. if (typeof method !== 'function') {
  6327. throw new TypeError('Header pairs must be iterable');
  6328. }
  6329. // sequence<sequence<ByteString>>
  6330. // Note: per spec we have to first exhaust the lists then process them
  6331. const pairs = [];
  6332. for (const pair of init) {
  6333. if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') {
  6334. throw new TypeError('Each header pair must be iterable');
  6335. }
  6336. pairs.push(Array.from(pair));
  6337. }
  6338. for (const pair of pairs) {
  6339. if (pair.length !== 2) {
  6340. throw new TypeError('Each header pair must be a name/value tuple');
  6341. }
  6342. this.append(pair[0], pair[1]);
  6343. }
  6344. } else {
  6345. // record<ByteString, ByteString>
  6346. for (const key of Object.keys(init)) {
  6347. const value = init[key];
  6348. this.append(key, value);
  6349. }
  6350. }
  6351. } else {
  6352. throw new TypeError('Provided initializer must be an object');
  6353. }
  6354. }
  6355. /**
  6356. * Return combined header value given name
  6357. *
  6358. * @param String name Header name
  6359. * @return Mixed
  6360. */
  6361. get(name) {
  6362. name = `${name}`;
  6363. validateName(name);
  6364. const key = find(this[MAP], name);
  6365. if (key === undefined) {
  6366. return null;
  6367. }
  6368. return this[MAP][key].join(', ');
  6369. }
  6370. /**
  6371. * Iterate over all headers
  6372. *
  6373. * @param Function callback Executed for each item with parameters (value, name, thisArg)
  6374. * @param Boolean thisArg `this` context for callback function
  6375. * @return Void
  6376. */
  6377. forEach(callback) {
  6378. let thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
  6379. let pairs = getHeaders(this);
  6380. let i = 0;
  6381. while (i < pairs.length) {
  6382. var _pairs$i = pairs[i];
  6383. const name = _pairs$i[0],
  6384. value = _pairs$i[1];
  6385. callback.call(thisArg, value, name, this);
  6386. pairs = getHeaders(this);
  6387. i++;
  6388. }
  6389. }
  6390. /**
  6391. * Overwrite header values given name
  6392. *
  6393. * @param String name Header name
  6394. * @param String value Header value
  6395. * @return Void
  6396. */
  6397. set(name, value) {
  6398. name = `${name}`;
  6399. value = `${value}`;
  6400. validateName(name);
  6401. validateValue(value);
  6402. const key = find(this[MAP], name);
  6403. this[MAP][key !== undefined ? key : name] = [value];
  6404. }
  6405. /**
  6406. * Append a value onto existing header
  6407. *
  6408. * @param String name Header name
  6409. * @param String value Header value
  6410. * @return Void
  6411. */
  6412. append(name, value) {
  6413. name = `${name}`;
  6414. value = `${value}`;
  6415. validateName(name);
  6416. validateValue(value);
  6417. const key = find(this[MAP], name);
  6418. if (key !== undefined) {
  6419. this[MAP][key].push(value);
  6420. } else {
  6421. this[MAP][name] = [value];
  6422. }
  6423. }
  6424. /**
  6425. * Check for header name existence
  6426. *
  6427. * @param String name Header name
  6428. * @return Boolean
  6429. */
  6430. has(name) {
  6431. name = `${name}`;
  6432. validateName(name);
  6433. return find(this[MAP], name) !== undefined;
  6434. }
  6435. /**
  6436. * Delete all header values given name
  6437. *
  6438. * @param String name Header name
  6439. * @return Void
  6440. */
  6441. delete(name) {
  6442. name = `${name}`;
  6443. validateName(name);
  6444. const key = find(this[MAP], name);
  6445. if (key !== undefined) {
  6446. delete this[MAP][key];
  6447. }
  6448. }
  6449. /**
  6450. * Return raw headers (non-spec api)
  6451. *
  6452. * @return Object
  6453. */
  6454. raw() {
  6455. return this[MAP];
  6456. }
  6457. /**
  6458. * Get an iterator on keys.
  6459. *
  6460. * @return Iterator
  6461. */
  6462. keys() {
  6463. return createHeadersIterator(this, 'key');
  6464. }
  6465. /**
  6466. * Get an iterator on values.
  6467. *
  6468. * @return Iterator
  6469. */
  6470. values() {
  6471. return createHeadersIterator(this, 'value');
  6472. }
  6473. /**
  6474. * Get an iterator on entries.
  6475. *
  6476. * This is the default iterator of the Headers object.
  6477. *
  6478. * @return Iterator
  6479. */
  6480. [Symbol.iterator]() {
  6481. return createHeadersIterator(this, 'key+value');
  6482. }
  6483. }
  6484. Headers.prototype.entries = Headers.prototype[Symbol.iterator];
  6485. Object.defineProperty(Headers.prototype, Symbol.toStringTag, {
  6486. value: 'Headers',
  6487. writable: false,
  6488. enumerable: false,
  6489. configurable: true
  6490. });
  6491. Object.defineProperties(Headers.prototype, {
  6492. get: { enumerable: true },
  6493. forEach: { enumerable: true },
  6494. set: { enumerable: true },
  6495. append: { enumerable: true },
  6496. has: { enumerable: true },
  6497. delete: { enumerable: true },
  6498. keys: { enumerable: true },
  6499. values: { enumerable: true },
  6500. entries: { enumerable: true }
  6501. });
  6502. function getHeaders(headers) {
  6503. let kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value';
  6504. const keys = Object.keys(headers[MAP]).sort();
  6505. return keys.map(kind === 'key' ? function (k) {
  6506. return k.toLowerCase();
  6507. } : kind === 'value' ? function (k) {
  6508. return headers[MAP][k].join(', ');
  6509. } : function (k) {
  6510. return [k.toLowerCase(), headers[MAP][k].join(', ')];
  6511. });
  6512. }
  6513. const INTERNAL = Symbol('internal');
  6514. function createHeadersIterator(target, kind) {
  6515. const iterator = Object.create(HeadersIteratorPrototype);
  6516. iterator[INTERNAL] = {
  6517. target,
  6518. kind,
  6519. index: 0
  6520. };
  6521. return iterator;
  6522. }
  6523. const HeadersIteratorPrototype = Object.setPrototypeOf({
  6524. next() {
  6525. // istanbul ignore if
  6526. if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) {
  6527. throw new TypeError('Value of `this` is not a HeadersIterator');
  6528. }
  6529. var _INTERNAL = this[INTERNAL];
  6530. const target = _INTERNAL.target,
  6531. kind = _INTERNAL.kind,
  6532. index = _INTERNAL.index;
  6533. const values = getHeaders(target, kind);
  6534. const len = values.length;
  6535. if (index >= len) {
  6536. return {
  6537. value: undefined,
  6538. done: true
  6539. };
  6540. }
  6541. this[INTERNAL].index = index + 1;
  6542. return {
  6543. value: values[index],
  6544. done: false
  6545. };
  6546. }
  6547. }, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));
  6548. Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, {
  6549. value: 'HeadersIterator',
  6550. writable: false,
  6551. enumerable: false,
  6552. configurable: true
  6553. });
  6554. /**
  6555. * Export the Headers object in a form that Node.js can consume.
  6556. *
  6557. * @param Headers headers
  6558. * @return Object
  6559. */
  6560. function exportNodeCompatibleHeaders(headers) {
  6561. const obj = Object.assign({ __proto__: null }, headers[MAP]);
  6562. // http.request() only supports string as Host header. This hack makes
  6563. // specifying custom Host header possible.
  6564. const hostHeaderKey = find(headers[MAP], 'Host');
  6565. if (hostHeaderKey !== undefined) {
  6566. obj[hostHeaderKey] = obj[hostHeaderKey][0];
  6567. }
  6568. return obj;
  6569. }
  6570. /**
  6571. * Create a Headers object from an object of headers, ignoring those that do
  6572. * not conform to HTTP grammar productions.
  6573. *
  6574. * @param Object obj Object of headers
  6575. * @return Headers
  6576. */
  6577. function createHeadersLenient(obj) {
  6578. const headers = new Headers();
  6579. for (const name of Object.keys(obj)) {
  6580. if (invalidTokenRegex.test(name)) {
  6581. continue;
  6582. }
  6583. if (Array.isArray(obj[name])) {
  6584. for (const val of obj[name]) {
  6585. if (invalidHeaderCharRegex.test(val)) {
  6586. continue;
  6587. }
  6588. if (headers[MAP][name] === undefined) {
  6589. headers[MAP][name] = [val];
  6590. } else {
  6591. headers[MAP][name].push(val);
  6592. }
  6593. }
  6594. } else if (!invalidHeaderCharRegex.test(obj[name])) {
  6595. headers[MAP][name] = [obj[name]];
  6596. }
  6597. }
  6598. return headers;
  6599. }
  6600. const INTERNALS$1 = Symbol('Response internals');
  6601. // fix an issue where "STATUS_CODES" aren't a named export for node <10
  6602. const STATUS_CODES = http.STATUS_CODES;
  6603. /**
  6604. * Response class
  6605. *
  6606. * @param Stream body Readable stream
  6607. * @param Object opts Response options
  6608. * @return Void
  6609. */
  6610. class Response {
  6611. constructor() {
  6612. let body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  6613. let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  6614. Body.call(this, body, opts);
  6615. const status = opts.status || 200;
  6616. const headers = new Headers(opts.headers);
  6617. if (body != null && !headers.has('Content-Type')) {
  6618. const contentType = extractContentType(body);
  6619. if (contentType) {
  6620. headers.append('Content-Type', contentType);
  6621. }
  6622. }
  6623. this[INTERNALS$1] = {
  6624. url: opts.url,
  6625. status,
  6626. statusText: opts.statusText || STATUS_CODES[status],
  6627. headers,
  6628. counter: opts.counter
  6629. };
  6630. }
  6631. get url() {
  6632. return this[INTERNALS$1].url || '';
  6633. }
  6634. get status() {
  6635. return this[INTERNALS$1].status;
  6636. }
  6637. /**
  6638. * Convenience property representing if the request ended normally
  6639. */
  6640. get ok() {
  6641. return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;
  6642. }
  6643. get redirected() {
  6644. return this[INTERNALS$1].counter > 0;
  6645. }
  6646. get statusText() {
  6647. return this[INTERNALS$1].statusText;
  6648. }
  6649. get headers() {
  6650. return this[INTERNALS$1].headers;
  6651. }
  6652. /**
  6653. * Clone this response
  6654. *
  6655. * @return Response
  6656. */
  6657. clone() {
  6658. return new Response(clone(this), {
  6659. url: this.url,
  6660. status: this.status,
  6661. statusText: this.statusText,
  6662. headers: this.headers,
  6663. ok: this.ok,
  6664. redirected: this.redirected
  6665. });
  6666. }
  6667. }
  6668. Body.mixIn(Response.prototype);
  6669. Object.defineProperties(Response.prototype, {
  6670. url: { enumerable: true },
  6671. status: { enumerable: true },
  6672. ok: { enumerable: true },
  6673. redirected: { enumerable: true },
  6674. statusText: { enumerable: true },
  6675. headers: { enumerable: true },
  6676. clone: { enumerable: true }
  6677. });
  6678. Object.defineProperty(Response.prototype, Symbol.toStringTag, {
  6679. value: 'Response',
  6680. writable: false,
  6681. enumerable: false,
  6682. configurable: true
  6683. });
  6684. const INTERNALS$2 = Symbol('Request internals');
  6685. // fix an issue where "format", "parse" aren't a named export for node <10
  6686. const parse_url = Url.parse;
  6687. const format_url = Url.format;
  6688. const streamDestructionSupported = 'destroy' in Stream.Readable.prototype;
  6689. /**
  6690. * Check if a value is an instance of Request.
  6691. *
  6692. * @param Mixed input
  6693. * @return Boolean
  6694. */
  6695. function isRequest(input) {
  6696. return typeof input === 'object' && typeof input[INTERNALS$2] === 'object';
  6697. }
  6698. function isAbortSignal(signal) {
  6699. const proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal);
  6700. return !!(proto && proto.constructor.name === 'AbortSignal');
  6701. }
  6702. /**
  6703. * Request class
  6704. *
  6705. * @param Mixed input Url or Request instance
  6706. * @param Object init Custom options
  6707. * @return Void
  6708. */
  6709. class Request {
  6710. constructor(input) {
  6711. let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  6712. let parsedURL;
  6713. // normalize input
  6714. if (!isRequest(input)) {
  6715. if (input && input.href) {
  6716. // in order to support Node.js' Url objects; though WHATWG's URL objects
  6717. // will fall into this branch also (since their `toString()` will return
  6718. // `href` property anyway)
  6719. parsedURL = parse_url(input.href);
  6720. } else {
  6721. // coerce input to a string before attempting to parse
  6722. parsedURL = parse_url(`${input}`);
  6723. }
  6724. input = {};
  6725. } else {
  6726. parsedURL = parse_url(input.url);
  6727. }
  6728. let method = init.method || input.method || 'GET';
  6729. method = method.toUpperCase();
  6730. if ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) {
  6731. throw new TypeError('Request with GET/HEAD method cannot have body');
  6732. }
  6733. let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null;
  6734. Body.call(this, inputBody, {
  6735. timeout: init.timeout || input.timeout || 0,
  6736. size: init.size || input.size || 0
  6737. });
  6738. const headers = new Headers(init.headers || input.headers || {});
  6739. if (inputBody != null && !headers.has('Content-Type')) {
  6740. const contentType = extractContentType(inputBody);
  6741. if (contentType) {
  6742. headers.append('Content-Type', contentType);
  6743. }
  6744. }
  6745. let signal = isRequest(input) ? input.signal : null;
  6746. if ('signal' in init) signal = init.signal;
  6747. if (signal != null && !isAbortSignal(signal)) {
  6748. throw new TypeError('Expected signal to be an instanceof AbortSignal');
  6749. }
  6750. this[INTERNALS$2] = {
  6751. method,
  6752. redirect: init.redirect || input.redirect || 'follow',
  6753. headers,
  6754. parsedURL,
  6755. signal
  6756. };
  6757. // node-fetch-only options
  6758. this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20;
  6759. this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true;
  6760. this.counter = init.counter || input.counter || 0;
  6761. this.agent = init.agent || input.agent;
  6762. }
  6763. get method() {
  6764. return this[INTERNALS$2].method;
  6765. }
  6766. get url() {
  6767. return format_url(this[INTERNALS$2].parsedURL);
  6768. }
  6769. get headers() {
  6770. return this[INTERNALS$2].headers;
  6771. }
  6772. get redirect() {
  6773. return this[INTERNALS$2].redirect;
  6774. }
  6775. get signal() {
  6776. return this[INTERNALS$2].signal;
  6777. }
  6778. /**
  6779. * Clone this request
  6780. *
  6781. * @return Request
  6782. */
  6783. clone() {
  6784. return new Request(this);
  6785. }
  6786. }
  6787. Body.mixIn(Request.prototype);
  6788. Object.defineProperty(Request.prototype, Symbol.toStringTag, {
  6789. value: 'Request',
  6790. writable: false,
  6791. enumerable: false,
  6792. configurable: true
  6793. });
  6794. Object.defineProperties(Request.prototype, {
  6795. method: { enumerable: true },
  6796. url: { enumerable: true },
  6797. headers: { enumerable: true },
  6798. redirect: { enumerable: true },
  6799. clone: { enumerable: true },
  6800. signal: { enumerable: true }
  6801. });
  6802. /**
  6803. * Convert a Request to Node.js http request options.
  6804. *
  6805. * @param Request A Request instance
  6806. * @return Object The options object to be passed to http.request
  6807. */
  6808. function getNodeRequestOptions(request) {
  6809. const parsedURL = request[INTERNALS$2].parsedURL;
  6810. const headers = new Headers(request[INTERNALS$2].headers);
  6811. // fetch step 1.3
  6812. if (!headers.has('Accept')) {
  6813. headers.set('Accept', '*/*');
  6814. }
  6815. // Basic fetch
  6816. if (!parsedURL.protocol || !parsedURL.hostname) {
  6817. throw new TypeError('Only absolute URLs are supported');
  6818. }
  6819. if (!/^https?:$/.test(parsedURL.protocol)) {
  6820. throw new TypeError('Only HTTP(S) protocols are supported');
  6821. }
  6822. if (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) {
  6823. throw new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8');
  6824. }
  6825. // HTTP-network-or-cache fetch steps 2.4-2.7
  6826. let contentLengthValue = null;
  6827. if (request.body == null && /^(POST|PUT)$/i.test(request.method)) {
  6828. contentLengthValue = '0';
  6829. }
  6830. if (request.body != null) {
  6831. const totalBytes = getTotalBytes(request);
  6832. if (typeof totalBytes === 'number') {
  6833. contentLengthValue = String(totalBytes);
  6834. }
  6835. }
  6836. if (contentLengthValue) {
  6837. headers.set('Content-Length', contentLengthValue);
  6838. }
  6839. // HTTP-network-or-cache fetch step 2.11
  6840. if (!headers.has('User-Agent')) {
  6841. headers.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)');
  6842. }
  6843. // HTTP-network-or-cache fetch step 2.15
  6844. if (request.compress && !headers.has('Accept-Encoding')) {
  6845. headers.set('Accept-Encoding', 'gzip,deflate');
  6846. }
  6847. let agent = request.agent;
  6848. if (typeof agent === 'function') {
  6849. agent = agent(parsedURL);
  6850. }
  6851. if (!headers.has('Connection') && !agent) {
  6852. headers.set('Connection', 'close');
  6853. }
  6854. // HTTP-network fetch step 4.2
  6855. // chunked encoding is handled by Node.js
  6856. return Object.assign({}, parsedURL, {
  6857. method: request.method,
  6858. headers: exportNodeCompatibleHeaders(headers),
  6859. agent
  6860. });
  6861. }
  6862. /**
  6863. * abort-error.js
  6864. *
  6865. * AbortError interface for cancelled requests
  6866. */
  6867. /**
  6868. * Create AbortError instance
  6869. *
  6870. * @param String message Error message for human
  6871. * @return AbortError
  6872. */
  6873. function AbortError(message) {
  6874. Error.call(this, message);
  6875. this.type = 'aborted';
  6876. this.message = message;
  6877. // hide custom error implementation details from end-users
  6878. Error.captureStackTrace(this, this.constructor);
  6879. }
  6880. AbortError.prototype = Object.create(Error.prototype);
  6881. AbortError.prototype.constructor = AbortError;
  6882. AbortError.prototype.name = 'AbortError';
  6883. // fix an issue where "PassThrough", "resolve" aren't a named export for node <10
  6884. const PassThrough$1 = Stream.PassThrough;
  6885. const resolve_url = Url.resolve;
  6886. /**
  6887. * Fetch function
  6888. *
  6889. * @param Mixed url Absolute url or Request instance
  6890. * @param Object opts Fetch options
  6891. * @return Promise
  6892. */
  6893. function fetch(url, opts) {
  6894. // allow custom promise
  6895. if (!fetch.Promise) {
  6896. throw new Error('native promise missing, set fetch.Promise to your favorite alternative');
  6897. }
  6898. Body.Promise = fetch.Promise;
  6899. // wrap http.request into fetch
  6900. return new fetch.Promise(function (resolve, reject) {
  6901. // build request object
  6902. const request = new Request(url, opts);
  6903. const options = getNodeRequestOptions(request);
  6904. const send = (options.protocol === 'https:' ? https : http).request;
  6905. const signal = request.signal;
  6906. let response = null;
  6907. const abort = function abort() {
  6908. let error = new AbortError('The user aborted a request.');
  6909. reject(error);
  6910. if (request.body && request.body instanceof Stream.Readable) {
  6911. request.body.destroy(error);
  6912. }
  6913. if (!response || !response.body) return;
  6914. response.body.emit('error', error);
  6915. };
  6916. if (signal && signal.aborted) {
  6917. abort();
  6918. return;
  6919. }
  6920. const abortAndFinalize = function abortAndFinalize() {
  6921. abort();
  6922. finalize();
  6923. };
  6924. // send request
  6925. const req = send(options);
  6926. let reqTimeout;
  6927. if (signal) {
  6928. signal.addEventListener('abort', abortAndFinalize);
  6929. }
  6930. function finalize() {
  6931. req.abort();
  6932. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  6933. clearTimeout(reqTimeout);
  6934. }
  6935. if (request.timeout) {
  6936. req.once('socket', function (socket) {
  6937. reqTimeout = setTimeout(function () {
  6938. reject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout'));
  6939. finalize();
  6940. }, request.timeout);
  6941. });
  6942. }
  6943. req.on('error', function (err) {
  6944. reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));
  6945. finalize();
  6946. });
  6947. req.on('response', function (res) {
  6948. clearTimeout(reqTimeout);
  6949. const headers = createHeadersLenient(res.headers);
  6950. // HTTP fetch step 5
  6951. if (fetch.isRedirect(res.statusCode)) {
  6952. // HTTP fetch step 5.2
  6953. const location = headers.get('Location');
  6954. // HTTP fetch step 5.3
  6955. const locationURL = location === null ? null : resolve_url(request.url, location);
  6956. // HTTP fetch step 5.5
  6957. switch (request.redirect) {
  6958. case 'error':
  6959. reject(new FetchError(`redirect mode is set to error: ${request.url}`, 'no-redirect'));
  6960. finalize();
  6961. return;
  6962. case 'manual':
  6963. // node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL.
  6964. if (locationURL !== null) {
  6965. // handle corrupted header
  6966. try {
  6967. headers.set('Location', locationURL);
  6968. } catch (err) {
  6969. // istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request
  6970. reject(err);
  6971. }
  6972. }
  6973. break;
  6974. case 'follow':
  6975. // HTTP-redirect fetch step 2
  6976. if (locationURL === null) {
  6977. break;
  6978. }
  6979. // HTTP-redirect fetch step 5
  6980. if (request.counter >= request.follow) {
  6981. reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));
  6982. finalize();
  6983. return;
  6984. }
  6985. // HTTP-redirect fetch step 6 (counter increment)
  6986. // Create a new Request object.
  6987. const requestOpts = {
  6988. headers: new Headers(request.headers),
  6989. follow: request.follow,
  6990. counter: request.counter + 1,
  6991. agent: request.agent,
  6992. compress: request.compress,
  6993. method: request.method,
  6994. body: request.body,
  6995. signal: request.signal,
  6996. timeout: request.timeout
  6997. };
  6998. // HTTP-redirect fetch step 9
  6999. if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {
  7000. reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));
  7001. finalize();
  7002. return;
  7003. }
  7004. // HTTP-redirect fetch step 11
  7005. if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') {
  7006. requestOpts.method = 'GET';
  7007. requestOpts.body = undefined;
  7008. requestOpts.headers.delete('content-length');
  7009. }
  7010. // HTTP-redirect fetch step 15
  7011. resolve(fetch(new Request(locationURL, requestOpts)));
  7012. finalize();
  7013. return;
  7014. }
  7015. }
  7016. // prepare response
  7017. res.once('end', function () {
  7018. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  7019. });
  7020. let body = res.pipe(new PassThrough$1());
  7021. const response_options = {
  7022. url: request.url,
  7023. status: res.statusCode,
  7024. statusText: res.statusMessage,
  7025. headers: headers,
  7026. size: request.size,
  7027. timeout: request.timeout,
  7028. counter: request.counter
  7029. };
  7030. // HTTP-network fetch step 12.1.1.3
  7031. const codings = headers.get('Content-Encoding');
  7032. // HTTP-network fetch step 12.1.1.4: handle content codings
  7033. // in following scenarios we ignore compression support
  7034. // 1. compression support is disabled
  7035. // 2. HEAD request
  7036. // 3. no Content-Encoding header
  7037. // 4. no content response (204)
  7038. // 5. content not modified response (304)
  7039. if (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) {
  7040. response = new Response(body, response_options);
  7041. resolve(response);
  7042. return;
  7043. }
  7044. // For Node v6+
  7045. // Be less strict when decoding compressed responses, since sometimes
  7046. // servers send slightly invalid responses that are still accepted
  7047. // by common browsers.
  7048. // Always using Z_SYNC_FLUSH is what cURL does.
  7049. const zlibOptions = {
  7050. flush: zlib.Z_SYNC_FLUSH,
  7051. finishFlush: zlib.Z_SYNC_FLUSH
  7052. };
  7053. // for gzip
  7054. if (codings == 'gzip' || codings == 'x-gzip') {
  7055. body = body.pipe(zlib.createGunzip(zlibOptions));
  7056. response = new Response(body, response_options);
  7057. resolve(response);
  7058. return;
  7059. }
  7060. // for deflate
  7061. if (codings == 'deflate' || codings == 'x-deflate') {
  7062. // handle the infamous raw deflate response from old servers
  7063. // a hack for old IIS and Apache servers
  7064. const raw = res.pipe(new PassThrough$1());
  7065. raw.once('data', function (chunk) {
  7066. // see http://stackoverflow.com/questions/37519828
  7067. if ((chunk[0] & 0x0F) === 0x08) {
  7068. body = body.pipe(zlib.createInflate());
  7069. } else {
  7070. body = body.pipe(zlib.createInflateRaw());
  7071. }
  7072. response = new Response(body, response_options);
  7073. resolve(response);
  7074. });
  7075. return;
  7076. }
  7077. // for br
  7078. if (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') {
  7079. body = body.pipe(zlib.createBrotliDecompress());
  7080. response = new Response(body, response_options);
  7081. resolve(response);
  7082. return;
  7083. }
  7084. // otherwise, use response as-is
  7085. response = new Response(body, response_options);
  7086. resolve(response);
  7087. });
  7088. writeToStream(req, request);
  7089. });
  7090. }
  7091. /**
  7092. * Redirect code matching
  7093. *
  7094. * @param Number code Status code
  7095. * @return Boolean
  7096. */
  7097. fetch.isRedirect = function (code) {
  7098. return code === 301 || code === 302 || code === 303 || code === 307 || code === 308;
  7099. };
  7100. // expose Promise
  7101. fetch.Promise = global.Promise;
  7102. module.exports = exports = fetch;
  7103. Object.defineProperty(exports, "__esModule", { value: true });
  7104. exports.default = exports;
  7105. exports.Headers = Headers;
  7106. exports.Request = Request;
  7107. exports.Response = Response;
  7108. exports.FetchError = FetchError;
  7109. /***/ }),
  7110. /***/ 462:
  7111. /***/ (function(module) {
  7112. "use strict";
  7113. // See http://www.robvanderwoude.com/escapechars.php
  7114. const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
  7115. function escapeCommand(arg) {
  7116. // Escape meta chars
  7117. arg = arg.replace(metaCharsRegExp, '^$1');
  7118. return arg;
  7119. }
  7120. function escapeArgument(arg, doubleEscapeMetaChars) {
  7121. // Convert to string
  7122. arg = `${arg}`;
  7123. // Algorithm below is based on https://qntm.org/cmd
  7124. // Sequence of backslashes followed by a double quote:
  7125. // double up all the backslashes and escape the double quote
  7126. arg = arg.replace(/(\\*)"/g, '$1$1\\"');
  7127. // Sequence of backslashes followed by the end of the string
  7128. // (which will become a double quote later):
  7129. // double up all the backslashes
  7130. arg = arg.replace(/(\\*)$/, '$1$1');
  7131. // All other backslashes occur literally
  7132. // Quote the whole thing:
  7133. arg = `"${arg}"`;
  7134. // Escape meta chars
  7135. arg = arg.replace(metaCharsRegExp, '^$1');
  7136. // Double escape meta chars if necessary
  7137. if (doubleEscapeMetaChars) {
  7138. arg = arg.replace(metaCharsRegExp, '^$1');
  7139. }
  7140. return arg;
  7141. }
  7142. module.exports.command = escapeCommand;
  7143. module.exports.argument = escapeArgument;
  7144. /***/ }),
  7145. /***/ 463:
  7146. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7147. "use strict";
  7148. Object.defineProperty(exports, '__esModule', { value: true });
  7149. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  7150. var deprecation = __webpack_require__(692);
  7151. var once = _interopDefault(__webpack_require__(969));
  7152. const logOnce = once(deprecation => console.warn(deprecation));
  7153. /**
  7154. * Error with extra properties to help with debugging
  7155. */
  7156. class RequestError extends Error {
  7157. constructor(message, statusCode, options) {
  7158. super(message); // Maintains proper stack trace (only available on V8)
  7159. /* istanbul ignore next */
  7160. if (Error.captureStackTrace) {
  7161. Error.captureStackTrace(this, this.constructor);
  7162. }
  7163. this.name = "HttpError";
  7164. this.status = statusCode;
  7165. Object.defineProperty(this, "code", {
  7166. get() {
  7167. logOnce(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`."));
  7168. return statusCode;
  7169. }
  7170. });
  7171. this.headers = options.headers || {}; // redact request credentials without mutating original request options
  7172. const requestCopy = Object.assign({}, options.request);
  7173. if (options.request.headers.authorization) {
  7174. requestCopy.headers = Object.assign({}, options.request.headers, {
  7175. authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]")
  7176. });
  7177. }
  7178. requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit
  7179. // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications
  7180. .replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]") // OAuth tokens can be passed as URL query parameters, although it is not recommended
  7181. // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header
  7182. .replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
  7183. this.request = requestCopy;
  7184. }
  7185. }
  7186. exports.RequestError = RequestError;
  7187. //# sourceMappingURL=index.js.map
  7188. /***/ }),
  7189. /***/ 464:
  7190. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7191. "use strict";
  7192. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  7193. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  7194. return new (P || (P = Promise))(function (resolve, reject) {
  7195. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  7196. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  7197. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  7198. step((generator = generator.apply(thisArg, _arguments || [])).next());
  7199. });
  7200. };
  7201. var __importStar = (this && this.__importStar) || function (mod) {
  7202. if (mod && mod.__esModule) return mod;
  7203. var result = {};
  7204. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  7205. result["default"] = mod;
  7206. return result;
  7207. };
  7208. Object.defineProperty(exports, "__esModule", { value: true });
  7209. const assert = __importStar(__webpack_require__(357));
  7210. const core = __importStar(__webpack_require__(470));
  7211. const exec = __importStar(__webpack_require__(986));
  7212. const fs = __importStar(__webpack_require__(747));
  7213. const github = __importStar(__webpack_require__(469));
  7214. const io = __importStar(__webpack_require__(1));
  7215. const path = __importStar(__webpack_require__(622));
  7216. const refHelper = __importStar(__webpack_require__(227));
  7217. const retryHelper = __importStar(__webpack_require__(587));
  7218. const toolCache = __importStar(__webpack_require__(533));
  7219. const IS_WINDOWS = process.platform === 'win32';
  7220. function downloadRepository(accessToken, owner, repo, ref, commit, repositoryPath) {
  7221. return __awaiter(this, void 0, void 0, function* () {
  7222. // Determine archive path
  7223. const runnerTemp = process.env['RUNNER_TEMP'];
  7224. assert.ok(runnerTemp, 'RUNNER_TEMP not defined');
  7225. const archivePath = path.join(runnerTemp, 'checkout.tar.gz');
  7226. // Ensure file does not exist
  7227. core.debug(`Ensuring archive file does not exist: ${archivePath}`);
  7228. yield io.rmRF(archivePath);
  7229. // Download the archive
  7230. let archiveData = yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  7231. core.info('Downloading the archive using the REST API');
  7232. return yield downloadArchive(accessToken, owner, repo, ref, commit);
  7233. }));
  7234. // Write archive to disk
  7235. core.info('Writing archive to disk');
  7236. yield fs.promises.writeFile(archivePath, archiveData);
  7237. archiveData = Buffer.from(''); // Free memory
  7238. // // Get the archive URL using the REST API
  7239. // await retryHelper.execute(async () => {
  7240. // // Prepare the archive stream
  7241. // core.debug(`Preparing the archive stream: ${archivePath}`)
  7242. // await io.rmRF(archivePath)
  7243. // const fileStream = fs.createWriteStream(archivePath)
  7244. // const fileStreamClosed = getFileClosedPromise(fileStream)
  7245. // try {
  7246. // // Get the archive URL
  7247. // core.info('Getting archive URL')
  7248. // const archiveUrl = await getArchiveUrl(
  7249. // accessToken,
  7250. // owner,
  7251. // repo,
  7252. // ref,
  7253. // commit
  7254. // )
  7255. // // Download the archive
  7256. // core.info('Downloading the archive') // Do not print the archive URL because it has an embedded token
  7257. // await downloadFile(archiveUrl, fileStream)
  7258. // } finally {
  7259. // fileStream.end()
  7260. // await fileStreamClosed
  7261. // }
  7262. // })
  7263. // await fs.promises.writeFile(archivePath, raw)
  7264. // // await exec.exec(`ls -la "${archiveFile}"`, [], {
  7265. // // cwd: repositoryPath
  7266. // // } as ExecOptions)
  7267. // Extract archive
  7268. const extractPath = path.join(runnerTemp, `checkout`);
  7269. yield io.rmRF(extractPath);
  7270. yield io.mkdirP(extractPath);
  7271. if (IS_WINDOWS) {
  7272. yield toolCache.extractZip(archivePath, extractPath);
  7273. }
  7274. else {
  7275. yield toolCache.extractTar(archivePath, extractPath);
  7276. }
  7277. // await exec.exec(`tar -xzf "${archiveFile}"`, [], {
  7278. // cwd: extractPath
  7279. // } as ExecOptions)
  7280. // Determine the real directory to copy (ignore extra dir at root of the archive)
  7281. const archiveFileNames = yield fs.promises.readdir(extractPath);
  7282. assert.ok(archiveFileNames.length == 1, 'Expected exactly one directory inside archive');
  7283. const extraDirectoryName = archiveFileNames[0];
  7284. core.info(`Resolved ${extraDirectoryName}`); // contains the short SHA
  7285. const tempRepositoryPath = path.join(extractPath, extraDirectoryName);
  7286. // Move the files
  7287. for (const fileName of yield fs.promises.readdir(tempRepositoryPath)) {
  7288. const sourcePath = path.join(tempRepositoryPath, fileName);
  7289. const targetPath = path.join(repositoryPath, fileName);
  7290. yield io.mv(sourcePath, targetPath);
  7291. }
  7292. yield exec.exec(`find .`, [], {
  7293. cwd: repositoryPath
  7294. });
  7295. });
  7296. }
  7297. exports.downloadRepository = downloadRepository;
  7298. function downloadArchive(accessToken, owner, repo, ref, commit) {
  7299. return __awaiter(this, void 0, void 0, function* () {
  7300. const octokit = new github.GitHub(accessToken);
  7301. const params = {
  7302. owner: owner,
  7303. repo: repo,
  7304. archive_format: IS_WINDOWS ? 'zipball' : 'tarball',
  7305. ref: refHelper.getDownloadRef(ref, commit)
  7306. };
  7307. const response = yield octokit.repos.getArchiveLink(params);
  7308. console.log('GOT THE RESPONSE');
  7309. console.log(`status=${response.status}`);
  7310. console.log(`headers=${JSON.stringify(response.headers)}`);
  7311. console.log(`data=${JSON.stringify(response.data)}`);
  7312. if (response.status != 200) {
  7313. throw new Error(`Unexpected response from GitHub API. Status: '${response.status}'`);
  7314. }
  7315. return Buffer.from(response.data); // response.data is ArrayBuffer
  7316. });
  7317. }
  7318. // async function getArchiveUrl(
  7319. // accessToken: string,
  7320. // owner: string,
  7321. // repo: string,
  7322. // ref: string,
  7323. // commit: string
  7324. // ): Promise<string> {
  7325. // const octokit = new github.GitHub(accessToken)
  7326. // const params: RequestOptions & ReposGetArchiveLinkParams = {
  7327. // method: 'HEAD',
  7328. // owner: owner,
  7329. // repo: repo,
  7330. // archive_format: IS_WINDOWS ? 'zipball' : 'tarball',
  7331. // ref: refHelper.getDownloadRef(ref, commit)
  7332. // }
  7333. // const response = await octokit.repos.getArchiveLink(params)
  7334. // console.log('GOT THE RESPONSE')
  7335. // console.log(`status=${response.status}`)
  7336. // console.log(`headers=${JSON.stringify(response.headers)}`)
  7337. // console.log(`data=${JSON.stringify(response.data)}`)
  7338. // if (response.status != 200) {
  7339. // throw new Error(
  7340. // `Unexpected response from GitHub API. Status: '${response.status}'`
  7341. // )
  7342. // }
  7343. // console.log('GETTING THE LOCATION')
  7344. // const archiveUrl = response.headers['Location'] // Do not print the archive URL because it has an embedded token
  7345. // assert.ok(
  7346. // archiveUrl,
  7347. // `Expected GitHub API response to contain 'Location' header`
  7348. // )
  7349. // return archiveUrl
  7350. // }
  7351. // function downloadFile(url: string, fileStream: WriteStream): Promise<void> {
  7352. // return new Promise((resolve, reject) => {
  7353. // try {
  7354. // https.get(url, (response: IncomingMessage) => {
  7355. // if (response.statusCode != 200) {
  7356. // reject(`Request failed with status '${response.statusCode}'`)
  7357. // response.resume() // Consume response data to free up memory
  7358. // return
  7359. // }
  7360. // response.on('data', chunk => {
  7361. // fileStream.write(chunk)
  7362. // })
  7363. // response.on('end', () => {
  7364. // resolve()
  7365. // })
  7366. // response.on('error', err => {
  7367. // reject(err)
  7368. // })
  7369. // })
  7370. // } catch (err) {
  7371. // reject(err)
  7372. // }
  7373. // })
  7374. // }
  7375. // function getFileClosedPromise(stream: WriteStream): Promise<void> {
  7376. // return new Promise((resolve, reject) => {
  7377. // stream.on('error', err => {
  7378. // reject(err)
  7379. // })
  7380. // stream.on('finish', () => {
  7381. // resolve()
  7382. // })
  7383. // })
  7384. // }
  7385. /***/ }),
  7386. /***/ 469:
  7387. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7388. "use strict";
  7389. var __importDefault = (this && this.__importDefault) || function (mod) {
  7390. return (mod && mod.__esModule) ? mod : { "default": mod };
  7391. };
  7392. var __importStar = (this && this.__importStar) || function (mod) {
  7393. if (mod && mod.__esModule) return mod;
  7394. var result = {};
  7395. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  7396. result["default"] = mod;
  7397. return result;
  7398. };
  7399. Object.defineProperty(exports, "__esModule", { value: true });
  7400. // Originally pulled from https://github.com/JasonEtco/actions-toolkit/blob/master/src/github.ts
  7401. const graphql_1 = __webpack_require__(898);
  7402. const rest_1 = __importDefault(__webpack_require__(0));
  7403. const Context = __importStar(__webpack_require__(262));
  7404. // We need this in order to extend Octokit
  7405. rest_1.default.prototype = new rest_1.default();
  7406. exports.context = new Context.Context();
  7407. class GitHub extends rest_1.default {
  7408. constructor(token, opts = {}) {
  7409. super(Object.assign(Object.assign({}, opts), { auth: `token ${token}` }));
  7410. this.graphql = graphql_1.graphql.defaults({
  7411. headers: { authorization: `token ${token}` }
  7412. });
  7413. }
  7414. }
  7415. exports.GitHub = GitHub;
  7416. //# sourceMappingURL=github.js.map
  7417. /***/ }),
  7418. /***/ 470:
  7419. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7420. "use strict";
  7421. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  7422. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  7423. return new (P || (P = Promise))(function (resolve, reject) {
  7424. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  7425. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  7426. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  7427. step((generator = generator.apply(thisArg, _arguments || [])).next());
  7428. });
  7429. };
  7430. Object.defineProperty(exports, "__esModule", { value: true });
  7431. const command_1 = __webpack_require__(431);
  7432. const os = __webpack_require__(87);
  7433. const path = __webpack_require__(622);
  7434. /**
  7435. * The code to exit an action
  7436. */
  7437. var ExitCode;
  7438. (function (ExitCode) {
  7439. /**
  7440. * A code indicating that the action was successful
  7441. */
  7442. ExitCode[ExitCode["Success"] = 0] = "Success";
  7443. /**
  7444. * A code indicating that the action was a failure
  7445. */
  7446. ExitCode[ExitCode["Failure"] = 1] = "Failure";
  7447. })(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
  7448. //-----------------------------------------------------------------------
  7449. // Variables
  7450. //-----------------------------------------------------------------------
  7451. /**
  7452. * Sets env variable for this action and future actions in the job
  7453. * @param name the name of the variable to set
  7454. * @param val the value of the variable
  7455. */
  7456. function exportVariable(name, val) {
  7457. process.env[name] = val;
  7458. command_1.issueCommand('set-env', { name }, val);
  7459. }
  7460. exports.exportVariable = exportVariable;
  7461. /**
  7462. * Registers a secret which will get masked from logs
  7463. * @param secret value of the secret
  7464. */
  7465. function setSecret(secret) {
  7466. command_1.issueCommand('add-mask', {}, secret);
  7467. }
  7468. exports.setSecret = setSecret;
  7469. /**
  7470. * Prepends inputPath to the PATH (for this action and future actions)
  7471. * @param inputPath
  7472. */
  7473. function addPath(inputPath) {
  7474. command_1.issueCommand('add-path', {}, inputPath);
  7475. process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
  7476. }
  7477. exports.addPath = addPath;
  7478. /**
  7479. * Gets the value of an input. The value is also trimmed.
  7480. *
  7481. * @param name name of the input to get
  7482. * @param options optional. See InputOptions.
  7483. * @returns string
  7484. */
  7485. function getInput(name, options) {
  7486. const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';
  7487. if (options && options.required && !val) {
  7488. throw new Error(`Input required and not supplied: ${name}`);
  7489. }
  7490. return val.trim();
  7491. }
  7492. exports.getInput = getInput;
  7493. /**
  7494. * Sets the value of an output.
  7495. *
  7496. * @param name name of the output to set
  7497. * @param value value to store
  7498. */
  7499. function setOutput(name, value) {
  7500. command_1.issueCommand('set-output', { name }, value);
  7501. }
  7502. exports.setOutput = setOutput;
  7503. //-----------------------------------------------------------------------
  7504. // Results
  7505. //-----------------------------------------------------------------------
  7506. /**
  7507. * Sets the action status to failed.
  7508. * When the action exits it will be with an exit code of 1
  7509. * @param message add error issue message
  7510. */
  7511. function setFailed(message) {
  7512. process.exitCode = ExitCode.Failure;
  7513. error(message);
  7514. }
  7515. exports.setFailed = setFailed;
  7516. //-----------------------------------------------------------------------
  7517. // Logging Commands
  7518. //-----------------------------------------------------------------------
  7519. /**
  7520. * Writes debug message to user log
  7521. * @param message debug message
  7522. */
  7523. function debug(message) {
  7524. command_1.issueCommand('debug', {}, message);
  7525. }
  7526. exports.debug = debug;
  7527. /**
  7528. * Adds an error issue
  7529. * @param message error issue message
  7530. */
  7531. function error(message) {
  7532. command_1.issue('error', message);
  7533. }
  7534. exports.error = error;
  7535. /**
  7536. * Adds an warning issue
  7537. * @param message warning issue message
  7538. */
  7539. function warning(message) {
  7540. command_1.issue('warning', message);
  7541. }
  7542. exports.warning = warning;
  7543. /**
  7544. * Writes info to log with console.log.
  7545. * @param message info message
  7546. */
  7547. function info(message) {
  7548. process.stdout.write(message + os.EOL);
  7549. }
  7550. exports.info = info;
  7551. /**
  7552. * Begin an output group.
  7553. *
  7554. * Output until the next `groupEnd` will be foldable in this group
  7555. *
  7556. * @param name The name of the output group
  7557. */
  7558. function startGroup(name) {
  7559. command_1.issue('group', name);
  7560. }
  7561. exports.startGroup = startGroup;
  7562. /**
  7563. * End an output group.
  7564. */
  7565. function endGroup() {
  7566. command_1.issue('endgroup');
  7567. }
  7568. exports.endGroup = endGroup;
  7569. /**
  7570. * Wrap an asynchronous function call in a group.
  7571. *
  7572. * Returns the same type as the function itself.
  7573. *
  7574. * @param name The name of the group
  7575. * @param fn The function to wrap in the group
  7576. */
  7577. function group(name, fn) {
  7578. return __awaiter(this, void 0, void 0, function* () {
  7579. startGroup(name);
  7580. let result;
  7581. try {
  7582. result = yield fn();
  7583. }
  7584. finally {
  7585. endGroup();
  7586. }
  7587. return result;
  7588. });
  7589. }
  7590. exports.group = group;
  7591. //# sourceMappingURL=core.js.map
  7592. /***/ }),
  7593. /***/ 471:
  7594. /***/ (function(module, __unusedexports, __webpack_require__) {
  7595. module.exports = authenticationBeforeRequest;
  7596. const btoa = __webpack_require__(675);
  7597. const uniq = __webpack_require__(126);
  7598. function authenticationBeforeRequest(state, options) {
  7599. if (!state.auth.type) {
  7600. return;
  7601. }
  7602. if (state.auth.type === "basic") {
  7603. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  7604. options.headers.authorization = `Basic ${hash}`;
  7605. return;
  7606. }
  7607. if (state.auth.type === "token") {
  7608. options.headers.authorization = `token ${state.auth.token}`;
  7609. return;
  7610. }
  7611. if (state.auth.type === "app") {
  7612. options.headers.authorization = `Bearer ${state.auth.token}`;
  7613. const acceptHeaders = options.headers.accept
  7614. .split(",")
  7615. .concat("application/vnd.github.machine-man-preview+json");
  7616. options.headers.accept = uniq(acceptHeaders)
  7617. .filter(Boolean)
  7618. .join(",");
  7619. return;
  7620. }
  7621. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  7622. if (state.auth.token) {
  7623. options.url += `access_token=${encodeURIComponent(state.auth.token)}`;
  7624. return;
  7625. }
  7626. const key = encodeURIComponent(state.auth.key);
  7627. const secret = encodeURIComponent(state.auth.secret);
  7628. options.url += `client_id=${key}&client_secret=${secret}`;
  7629. }
  7630. /***/ }),
  7631. /***/ 489:
  7632. /***/ (function(module, __unusedexports, __webpack_require__) {
  7633. "use strict";
  7634. const path = __webpack_require__(622);
  7635. const which = __webpack_require__(814);
  7636. const pathKey = __webpack_require__(39)();
  7637. function resolveCommandAttempt(parsed, withoutPathExt) {
  7638. const cwd = process.cwd();
  7639. const hasCustomCwd = parsed.options.cwd != null;
  7640. // If a custom `cwd` was specified, we need to change the process cwd
  7641. // because `which` will do stat calls but does not support a custom cwd
  7642. if (hasCustomCwd) {
  7643. try {
  7644. process.chdir(parsed.options.cwd);
  7645. } catch (err) {
  7646. /* Empty */
  7647. }
  7648. }
  7649. let resolved;
  7650. try {
  7651. resolved = which.sync(parsed.command, {
  7652. path: (parsed.options.env || process.env)[pathKey],
  7653. pathExt: withoutPathExt ? path.delimiter : undefined,
  7654. });
  7655. } catch (e) {
  7656. /* Empty */
  7657. } finally {
  7658. process.chdir(cwd);
  7659. }
  7660. // If we successfully resolved, ensure that an absolute path is returned
  7661. // Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it
  7662. if (resolved) {
  7663. resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved);
  7664. }
  7665. return resolved;
  7666. }
  7667. function resolveCommand(parsed) {
  7668. return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
  7669. }
  7670. module.exports = resolveCommand;
  7671. /***/ }),
  7672. /***/ 510:
  7673. /***/ (function(module) {
  7674. module.exports = addHook
  7675. function addHook (state, kind, name, hook) {
  7676. var orig = hook
  7677. if (!state.registry[name]) {
  7678. state.registry[name] = []
  7679. }
  7680. if (kind === 'before') {
  7681. hook = function (method, options) {
  7682. return Promise.resolve()
  7683. .then(orig.bind(null, options))
  7684. .then(method.bind(null, options))
  7685. }
  7686. }
  7687. if (kind === 'after') {
  7688. hook = function (method, options) {
  7689. var result
  7690. return Promise.resolve()
  7691. .then(method.bind(null, options))
  7692. .then(function (result_) {
  7693. result = result_
  7694. return orig(result, options)
  7695. })
  7696. .then(function () {
  7697. return result
  7698. })
  7699. }
  7700. }
  7701. if (kind === 'error') {
  7702. hook = function (method, options) {
  7703. return Promise.resolve()
  7704. .then(method.bind(null, options))
  7705. .catch(function (error) {
  7706. return orig(error, options)
  7707. })
  7708. }
  7709. }
  7710. state.registry[name].push({
  7711. hook: hook,
  7712. orig: orig
  7713. })
  7714. }
  7715. /***/ }),
  7716. /***/ 523:
  7717. /***/ (function(module, __unusedexports, __webpack_require__) {
  7718. var register = __webpack_require__(363)
  7719. var addHook = __webpack_require__(510)
  7720. var removeHook = __webpack_require__(763)
  7721. // bind with array of arguments: https://stackoverflow.com/a/21792913
  7722. var bind = Function.bind
  7723. var bindable = bind.bind(bind)
  7724. function bindApi (hook, state, name) {
  7725. var removeHookRef = bindable(removeHook, null).apply(null, name ? [state, name] : [state])
  7726. hook.api = { remove: removeHookRef }
  7727. hook.remove = removeHookRef
  7728. ;['before', 'error', 'after', 'wrap'].forEach(function (kind) {
  7729. var args = name ? [state, kind, name] : [state, kind]
  7730. hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args)
  7731. })
  7732. }
  7733. function HookSingular () {
  7734. var singularHookName = 'h'
  7735. var singularHookState = {
  7736. registry: {}
  7737. }
  7738. var singularHook = register.bind(null, singularHookState, singularHookName)
  7739. bindApi(singularHook, singularHookState, singularHookName)
  7740. return singularHook
  7741. }
  7742. function HookCollection () {
  7743. var state = {
  7744. registry: {}
  7745. }
  7746. var hook = register.bind(null, state)
  7747. bindApi(hook, state)
  7748. return hook
  7749. }
  7750. var collectionHookDeprecationMessageDisplayed = false
  7751. function Hook () {
  7752. if (!collectionHookDeprecationMessageDisplayed) {
  7753. console.warn('[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4')
  7754. collectionHookDeprecationMessageDisplayed = true
  7755. }
  7756. return HookCollection()
  7757. }
  7758. Hook.Singular = HookSingular.bind()
  7759. Hook.Collection = HookCollection.bind()
  7760. module.exports = Hook
  7761. // expose constructors as a named property for TypeScript
  7762. module.exports.Hook = Hook
  7763. module.exports.Singular = Hook.Singular
  7764. module.exports.Collection = Hook.Collection
  7765. /***/ }),
  7766. /***/ 529:
  7767. /***/ (function(module, __unusedexports, __webpack_require__) {
  7768. const factory = __webpack_require__(47);
  7769. module.exports = factory();
  7770. /***/ }),
  7771. /***/ 533:
  7772. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7773. "use strict";
  7774. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  7775. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  7776. return new (P || (P = Promise))(function (resolve, reject) {
  7777. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  7778. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  7779. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  7780. step((generator = generator.apply(thisArg, _arguments || [])).next());
  7781. });
  7782. };
  7783. Object.defineProperty(exports, "__esModule", { value: true });
  7784. const core = __webpack_require__(470);
  7785. const io = __webpack_require__(1);
  7786. const fs = __webpack_require__(747);
  7787. const os = __webpack_require__(87);
  7788. const path = __webpack_require__(622);
  7789. const httpm = __webpack_require__(874);
  7790. const semver = __webpack_require__(656);
  7791. const uuidV4 = __webpack_require__(826);
  7792. const exec_1 = __webpack_require__(986);
  7793. const assert_1 = __webpack_require__(357);
  7794. class HTTPError extends Error {
  7795. constructor(httpStatusCode) {
  7796. super(`Unexpected HTTP response: ${httpStatusCode}`);
  7797. this.httpStatusCode = httpStatusCode;
  7798. Object.setPrototypeOf(this, new.target.prototype);
  7799. }
  7800. }
  7801. exports.HTTPError = HTTPError;
  7802. const IS_WINDOWS = process.platform === 'win32';
  7803. const userAgent = 'actions/tool-cache';
  7804. // On load grab temp directory and cache directory and remove them from env (currently don't want to expose this)
  7805. let tempDirectory = process.env['RUNNER_TEMP'] || '';
  7806. let cacheRoot = process.env['RUNNER_TOOL_CACHE'] || '';
  7807. // If directories not found, place them in common temp locations
  7808. if (!tempDirectory || !cacheRoot) {
  7809. let baseLocation;
  7810. if (IS_WINDOWS) {
  7811. // On windows use the USERPROFILE env variable
  7812. baseLocation = process.env['USERPROFILE'] || 'C:\\';
  7813. }
  7814. else {
  7815. if (process.platform === 'darwin') {
  7816. baseLocation = '/Users';
  7817. }
  7818. else {
  7819. baseLocation = '/home';
  7820. }
  7821. }
  7822. if (!tempDirectory) {
  7823. tempDirectory = path.join(baseLocation, 'actions', 'temp');
  7824. }
  7825. if (!cacheRoot) {
  7826. cacheRoot = path.join(baseLocation, 'actions', 'cache');
  7827. }
  7828. }
  7829. /**
  7830. * Download a tool from an url and stream it into a file
  7831. *
  7832. * @param url url of tool to download
  7833. * @returns path to downloaded tool
  7834. */
  7835. function downloadTool(url) {
  7836. return __awaiter(this, void 0, void 0, function* () {
  7837. // Wrap in a promise so that we can resolve from within stream callbacks
  7838. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  7839. try {
  7840. const http = new httpm.HttpClient(userAgent, [], {
  7841. allowRetries: true,
  7842. maxRetries: 3
  7843. });
  7844. const destPath = path.join(tempDirectory, uuidV4());
  7845. yield io.mkdirP(tempDirectory);
  7846. core.debug(`Downloading ${url}`);
  7847. core.debug(`Downloading ${destPath}`);
  7848. if (fs.existsSync(destPath)) {
  7849. throw new Error(`Destination file path ${destPath} already exists`);
  7850. }
  7851. const response = yield http.get(url);
  7852. if (response.message.statusCode !== 200) {
  7853. const err = new HTTPError(response.message.statusCode);
  7854. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  7855. throw err;
  7856. }
  7857. const file = fs.createWriteStream(destPath);
  7858. file.on('open', () => __awaiter(this, void 0, void 0, function* () {
  7859. try {
  7860. const stream = response.message.pipe(file);
  7861. stream.on('close', () => {
  7862. core.debug('download complete');
  7863. resolve(destPath);
  7864. });
  7865. }
  7866. catch (err) {
  7867. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  7868. reject(err);
  7869. }
  7870. }));
  7871. file.on('error', err => {
  7872. file.end();
  7873. reject(err);
  7874. });
  7875. }
  7876. catch (err) {
  7877. reject(err);
  7878. }
  7879. }));
  7880. });
  7881. }
  7882. exports.downloadTool = downloadTool;
  7883. /**
  7884. * Extract a .7z file
  7885. *
  7886. * @param file path to the .7z file
  7887. * @param dest destination directory. Optional.
  7888. * @param _7zPath path to 7zr.exe. Optional, for long path support. Most .7z archives do not have this
  7889. * problem. If your .7z archive contains very long paths, you can pass the path to 7zr.exe which will
  7890. * gracefully handle long paths. By default 7zdec.exe is used because it is a very small program and is
  7891. * bundled with the tool lib. However it does not support long paths. 7zr.exe is the reduced command line
  7892. * interface, it is smaller than the full command line interface, and it does support long paths. At the
  7893. * time of this writing, it is freely available from the LZMA SDK that is available on the 7zip website.
  7894. * Be sure to check the current license agreement. If 7zr.exe is bundled with your action, then the path
  7895. * to 7zr.exe can be pass to this function.
  7896. * @returns path to the destination directory
  7897. */
  7898. function extract7z(file, dest, _7zPath) {
  7899. return __awaiter(this, void 0, void 0, function* () {
  7900. assert_1.ok(IS_WINDOWS, 'extract7z() not supported on current OS');
  7901. assert_1.ok(file, 'parameter "file" is required');
  7902. dest = dest || (yield _createExtractFolder(dest));
  7903. const originalCwd = process.cwd();
  7904. process.chdir(dest);
  7905. if (_7zPath) {
  7906. try {
  7907. const args = [
  7908. 'x',
  7909. '-bb1',
  7910. '-bd',
  7911. '-sccUTF-8',
  7912. file
  7913. ];
  7914. const options = {
  7915. silent: true
  7916. };
  7917. yield exec_1.exec(`"${_7zPath}"`, args, options);
  7918. }
  7919. finally {
  7920. process.chdir(originalCwd);
  7921. }
  7922. }
  7923. else {
  7924. const escapedScript = path
  7925. .join(__dirname, '..', 'scripts', 'Invoke-7zdec.ps1')
  7926. .replace(/'/g, "''")
  7927. .replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  7928. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  7929. const escapedTarget = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  7930. const command = `& '${escapedScript}' -Source '${escapedFile}' -Target '${escapedTarget}'`;
  7931. const args = [
  7932. '-NoLogo',
  7933. '-Sta',
  7934. '-NoProfile',
  7935. '-NonInteractive',
  7936. '-ExecutionPolicy',
  7937. 'Unrestricted',
  7938. '-Command',
  7939. command
  7940. ];
  7941. const options = {
  7942. silent: true
  7943. };
  7944. try {
  7945. const powershellPath = yield io.which('powershell', true);
  7946. yield exec_1.exec(`"${powershellPath}"`, args, options);
  7947. }
  7948. finally {
  7949. process.chdir(originalCwd);
  7950. }
  7951. }
  7952. return dest;
  7953. });
  7954. }
  7955. exports.extract7z = extract7z;
  7956. /**
  7957. * Extract a tar
  7958. *
  7959. * @param file path to the tar
  7960. * @param dest destination directory. Optional.
  7961. * @param flags flags for the tar. Optional.
  7962. * @returns path to the destination directory
  7963. */
  7964. function extractTar(file, dest, flags = 'xz') {
  7965. return __awaiter(this, void 0, void 0, function* () {
  7966. if (!file) {
  7967. throw new Error("parameter 'file' is required");
  7968. }
  7969. dest = dest || (yield _createExtractFolder(dest));
  7970. const tarPath = yield io.which('tar', true);
  7971. yield exec_1.exec(`"${tarPath}"`, [flags, '-C', dest, '-f', file]);
  7972. return dest;
  7973. });
  7974. }
  7975. exports.extractTar = extractTar;
  7976. /**
  7977. * Extract a zip
  7978. *
  7979. * @param file path to the zip
  7980. * @param dest destination directory. Optional.
  7981. * @returns path to the destination directory
  7982. */
  7983. function extractZip(file, dest) {
  7984. return __awaiter(this, void 0, void 0, function* () {
  7985. if (!file) {
  7986. throw new Error("parameter 'file' is required");
  7987. }
  7988. dest = dest || (yield _createExtractFolder(dest));
  7989. if (IS_WINDOWS) {
  7990. yield extractZipWin(file, dest);
  7991. }
  7992. else {
  7993. yield extractZipNix(file, dest);
  7994. }
  7995. return dest;
  7996. });
  7997. }
  7998. exports.extractZip = extractZip;
  7999. function extractZipWin(file, dest) {
  8000. return __awaiter(this, void 0, void 0, function* () {
  8001. // build the powershell command
  8002. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  8003. const escapedDest = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  8004. const command = `$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ; [System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}')`;
  8005. // run powershell
  8006. const powershellPath = yield io.which('powershell');
  8007. const args = [
  8008. '-NoLogo',
  8009. '-Sta',
  8010. '-NoProfile',
  8011. '-NonInteractive',
  8012. '-ExecutionPolicy',
  8013. 'Unrestricted',
  8014. '-Command',
  8015. command
  8016. ];
  8017. yield exec_1.exec(`"${powershellPath}"`, args);
  8018. });
  8019. }
  8020. function extractZipNix(file, dest) {
  8021. return __awaiter(this, void 0, void 0, function* () {
  8022. const unzipPath = yield io.which('unzip');
  8023. yield exec_1.exec(`"${unzipPath}"`, [file], { cwd: dest });
  8024. });
  8025. }
  8026. /**
  8027. * Caches a directory and installs it into the tool cacheDir
  8028. *
  8029. * @param sourceDir the directory to cache into tools
  8030. * @param tool tool name
  8031. * @param version version of the tool. semver format
  8032. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  8033. */
  8034. function cacheDir(sourceDir, tool, version, arch) {
  8035. return __awaiter(this, void 0, void 0, function* () {
  8036. version = semver.clean(version) || version;
  8037. arch = arch || os.arch();
  8038. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  8039. core.debug(`source dir: ${sourceDir}`);
  8040. if (!fs.statSync(sourceDir).isDirectory()) {
  8041. throw new Error('sourceDir is not a directory');
  8042. }
  8043. // Create the tool dir
  8044. const destPath = yield _createToolPath(tool, version, arch);
  8045. // copy each child item. do not move. move can fail on Windows
  8046. // due to anti-virus software having an open handle on a file.
  8047. for (const itemName of fs.readdirSync(sourceDir)) {
  8048. const s = path.join(sourceDir, itemName);
  8049. yield io.cp(s, destPath, { recursive: true });
  8050. }
  8051. // write .complete
  8052. _completeToolPath(tool, version, arch);
  8053. return destPath;
  8054. });
  8055. }
  8056. exports.cacheDir = cacheDir;
  8057. /**
  8058. * Caches a downloaded file (GUID) and installs it
  8059. * into the tool cache with a given targetName
  8060. *
  8061. * @param sourceFile the file to cache into tools. Typically a result of downloadTool which is a guid.
  8062. * @param targetFile the name of the file name in the tools directory
  8063. * @param tool tool name
  8064. * @param version version of the tool. semver format
  8065. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  8066. */
  8067. function cacheFile(sourceFile, targetFile, tool, version, arch) {
  8068. return __awaiter(this, void 0, void 0, function* () {
  8069. version = semver.clean(version) || version;
  8070. arch = arch || os.arch();
  8071. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  8072. core.debug(`source file: ${sourceFile}`);
  8073. if (!fs.statSync(sourceFile).isFile()) {
  8074. throw new Error('sourceFile is not a file');
  8075. }
  8076. // create the tool dir
  8077. const destFolder = yield _createToolPath(tool, version, arch);
  8078. // copy instead of move. move can fail on Windows due to
  8079. // anti-virus software having an open handle on a file.
  8080. const destPath = path.join(destFolder, targetFile);
  8081. core.debug(`destination file ${destPath}`);
  8082. yield io.cp(sourceFile, destPath);
  8083. // write .complete
  8084. _completeToolPath(tool, version, arch);
  8085. return destFolder;
  8086. });
  8087. }
  8088. exports.cacheFile = cacheFile;
  8089. /**
  8090. * Finds the path to a tool version in the local installed tool cache
  8091. *
  8092. * @param toolName name of the tool
  8093. * @param versionSpec version of the tool
  8094. * @param arch optional arch. defaults to arch of computer
  8095. */
  8096. function find(toolName, versionSpec, arch) {
  8097. if (!toolName) {
  8098. throw new Error('toolName parameter is required');
  8099. }
  8100. if (!versionSpec) {
  8101. throw new Error('versionSpec parameter is required');
  8102. }
  8103. arch = arch || os.arch();
  8104. // attempt to resolve an explicit version
  8105. if (!_isExplicitVersion(versionSpec)) {
  8106. const localVersions = findAllVersions(toolName, arch);
  8107. const match = _evaluateVersions(localVersions, versionSpec);
  8108. versionSpec = match;
  8109. }
  8110. // check for the explicit version in the cache
  8111. let toolPath = '';
  8112. if (versionSpec) {
  8113. versionSpec = semver.clean(versionSpec) || '';
  8114. const cachePath = path.join(cacheRoot, toolName, versionSpec, arch);
  8115. core.debug(`checking cache: ${cachePath}`);
  8116. if (fs.existsSync(cachePath) && fs.existsSync(`${cachePath}.complete`)) {
  8117. core.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`);
  8118. toolPath = cachePath;
  8119. }
  8120. else {
  8121. core.debug('not found');
  8122. }
  8123. }
  8124. return toolPath;
  8125. }
  8126. exports.find = find;
  8127. /**
  8128. * Finds the paths to all versions of a tool that are installed in the local tool cache
  8129. *
  8130. * @param toolName name of the tool
  8131. * @param arch optional arch. defaults to arch of computer
  8132. */
  8133. function findAllVersions(toolName, arch) {
  8134. const versions = [];
  8135. arch = arch || os.arch();
  8136. const toolPath = path.join(cacheRoot, toolName);
  8137. if (fs.existsSync(toolPath)) {
  8138. const children = fs.readdirSync(toolPath);
  8139. for (const child of children) {
  8140. if (_isExplicitVersion(child)) {
  8141. const fullPath = path.join(toolPath, child, arch || '');
  8142. if (fs.existsSync(fullPath) && fs.existsSync(`${fullPath}.complete`)) {
  8143. versions.push(child);
  8144. }
  8145. }
  8146. }
  8147. }
  8148. return versions;
  8149. }
  8150. exports.findAllVersions = findAllVersions;
  8151. function _createExtractFolder(dest) {
  8152. return __awaiter(this, void 0, void 0, function* () {
  8153. if (!dest) {
  8154. // create a temp dir
  8155. dest = path.join(tempDirectory, uuidV4());
  8156. }
  8157. yield io.mkdirP(dest);
  8158. return dest;
  8159. });
  8160. }
  8161. function _createToolPath(tool, version, arch) {
  8162. return __awaiter(this, void 0, void 0, function* () {
  8163. const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
  8164. core.debug(`destination ${folderPath}`);
  8165. const markerPath = `${folderPath}.complete`;
  8166. yield io.rmRF(folderPath);
  8167. yield io.rmRF(markerPath);
  8168. yield io.mkdirP(folderPath);
  8169. return folderPath;
  8170. });
  8171. }
  8172. function _completeToolPath(tool, version, arch) {
  8173. const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
  8174. const markerPath = `${folderPath}.complete`;
  8175. fs.writeFileSync(markerPath, '');
  8176. core.debug('finished caching tool');
  8177. }
  8178. function _isExplicitVersion(versionSpec) {
  8179. const c = semver.clean(versionSpec) || '';
  8180. core.debug(`isExplicit: ${c}`);
  8181. const valid = semver.valid(c) != null;
  8182. core.debug(`explicit? ${valid}`);
  8183. return valid;
  8184. }
  8185. function _evaluateVersions(versions, versionSpec) {
  8186. let version = '';
  8187. core.debug(`evaluating ${versions.length} versions`);
  8188. versions = versions.sort((a, b) => {
  8189. if (semver.gt(a, b)) {
  8190. return 1;
  8191. }
  8192. return -1;
  8193. });
  8194. for (let i = versions.length - 1; i >= 0; i--) {
  8195. const potential = versions[i];
  8196. const satisfied = semver.satisfies(potential, versionSpec);
  8197. if (satisfied) {
  8198. version = potential;
  8199. break;
  8200. }
  8201. }
  8202. if (version) {
  8203. core.debug(`matched: ${version}`);
  8204. }
  8205. else {
  8206. core.debug('match not found');
  8207. }
  8208. return version;
  8209. }
  8210. //# sourceMappingURL=tool-cache.js.map
  8211. /***/ }),
  8212. /***/ 536:
  8213. /***/ (function(module, __unusedexports, __webpack_require__) {
  8214. module.exports = hasFirstPage
  8215. const deprecate = __webpack_require__(370)
  8216. const getPageLinks = __webpack_require__(577)
  8217. function hasFirstPage (link) {
  8218. deprecate(`octokit.hasFirstPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  8219. return getPageLinks(link).first
  8220. }
  8221. /***/ }),
  8222. /***/ 550:
  8223. /***/ (function(module, __unusedexports, __webpack_require__) {
  8224. module.exports = getNextPage
  8225. const getPage = __webpack_require__(265)
  8226. function getNextPage (octokit, link, headers) {
  8227. return getPage(octokit, link, 'next', headers)
  8228. }
  8229. /***/ }),
  8230. /***/ 558:
  8231. /***/ (function(module, __unusedexports, __webpack_require__) {
  8232. module.exports = hasPreviousPage
  8233. const deprecate = __webpack_require__(370)
  8234. const getPageLinks = __webpack_require__(577)
  8235. function hasPreviousPage (link) {
  8236. deprecate(`octokit.hasPreviousPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  8237. return getPageLinks(link).prev
  8238. }
  8239. /***/ }),
  8240. /***/ 559:
  8241. /***/ (function(__unusedmodule, exports) {
  8242. "use strict";
  8243. Object.defineProperty(exports, "__esModule", { value: true });
  8244. class GitVersion {
  8245. /**
  8246. * Used for comparing the version of git and git-lfs against the minimum required version
  8247. * @param version the version string, e.g. 1.2 or 1.2.3
  8248. */
  8249. constructor(version) {
  8250. this.major = NaN;
  8251. this.minor = NaN;
  8252. this.patch = NaN;
  8253. if (version) {
  8254. const match = version.match(/^(\d+)\.(\d+)(\.(\d+))?$/);
  8255. if (match) {
  8256. this.major = Number(match[1]);
  8257. this.minor = Number(match[2]);
  8258. if (match[4]) {
  8259. this.patch = Number(match[4]);
  8260. }
  8261. }
  8262. }
  8263. }
  8264. /**
  8265. * Compares the instance against a minimum required version
  8266. * @param minimum Minimum version
  8267. */
  8268. checkMinimum(minimum) {
  8269. if (!minimum.isValid()) {
  8270. throw new Error('Arg minimum is not a valid version');
  8271. }
  8272. // Major is insufficient
  8273. if (this.major < minimum.major) {
  8274. return false;
  8275. }
  8276. // Major is equal
  8277. if (this.major === minimum.major) {
  8278. // Minor is insufficient
  8279. if (this.minor < minimum.minor) {
  8280. return false;
  8281. }
  8282. // Minor is equal
  8283. if (this.minor === minimum.minor) {
  8284. // Patch is insufficient
  8285. if (this.patch && this.patch < (minimum.patch || 0)) {
  8286. return false;
  8287. }
  8288. }
  8289. }
  8290. return true;
  8291. }
  8292. /**
  8293. * Indicates whether the instance was constructed from a valid version string
  8294. */
  8295. isValid() {
  8296. return !isNaN(this.major);
  8297. }
  8298. /**
  8299. * Returns the version as a string, e.g. 1.2 or 1.2.3
  8300. */
  8301. toString() {
  8302. let result = '';
  8303. if (this.isValid()) {
  8304. result = `${this.major}.${this.minor}`;
  8305. if (!isNaN(this.patch)) {
  8306. result += `.${this.patch}`;
  8307. }
  8308. }
  8309. return result;
  8310. }
  8311. }
  8312. exports.GitVersion = GitVersion;
  8313. /***/ }),
  8314. /***/ 562:
  8315. /***/ (function(module, __unusedexports, __webpack_require__) {
  8316. var once = __webpack_require__(969);
  8317. var noop = function() {};
  8318. var isRequest = function(stream) {
  8319. return stream.setHeader && typeof stream.abort === 'function';
  8320. };
  8321. var isChildProcess = function(stream) {
  8322. return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3
  8323. };
  8324. var eos = function(stream, opts, callback) {
  8325. if (typeof opts === 'function') return eos(stream, null, opts);
  8326. if (!opts) opts = {};
  8327. callback = once(callback || noop);
  8328. var ws = stream._writableState;
  8329. var rs = stream._readableState;
  8330. var readable = opts.readable || (opts.readable !== false && stream.readable);
  8331. var writable = opts.writable || (opts.writable !== false && stream.writable);
  8332. var cancelled = false;
  8333. var onlegacyfinish = function() {
  8334. if (!stream.writable) onfinish();
  8335. };
  8336. var onfinish = function() {
  8337. writable = false;
  8338. if (!readable) callback.call(stream);
  8339. };
  8340. var onend = function() {
  8341. readable = false;
  8342. if (!writable) callback.call(stream);
  8343. };
  8344. var onexit = function(exitCode) {
  8345. callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null);
  8346. };
  8347. var onerror = function(err) {
  8348. callback.call(stream, err);
  8349. };
  8350. var onclose = function() {
  8351. process.nextTick(onclosenexttick);
  8352. };
  8353. var onclosenexttick = function() {
  8354. if (cancelled) return;
  8355. if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error('premature close'));
  8356. if (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error('premature close'));
  8357. };
  8358. var onrequest = function() {
  8359. stream.req.on('finish', onfinish);
  8360. };
  8361. if (isRequest(stream)) {
  8362. stream.on('complete', onfinish);
  8363. stream.on('abort', onclose);
  8364. if (stream.req) onrequest();
  8365. else stream.on('request', onrequest);
  8366. } else if (writable && !ws) { // legacy streams
  8367. stream.on('end', onlegacyfinish);
  8368. stream.on('close', onlegacyfinish);
  8369. }
  8370. if (isChildProcess(stream)) stream.on('exit', onexit);
  8371. stream.on('end', onend);
  8372. stream.on('finish', onfinish);
  8373. if (opts.error !== false) stream.on('error', onerror);
  8374. stream.on('close', onclose);
  8375. return function() {
  8376. cancelled = true;
  8377. stream.removeListener('complete', onfinish);
  8378. stream.removeListener('abort', onclose);
  8379. stream.removeListener('request', onrequest);
  8380. if (stream.req) stream.req.removeListener('finish', onfinish);
  8381. stream.removeListener('end', onlegacyfinish);
  8382. stream.removeListener('close', onlegacyfinish);
  8383. stream.removeListener('finish', onfinish);
  8384. stream.removeListener('exit', onexit);
  8385. stream.removeListener('end', onend);
  8386. stream.removeListener('error', onerror);
  8387. stream.removeListener('close', onclose);
  8388. };
  8389. };
  8390. module.exports = eos;
  8391. /***/ }),
  8392. /***/ 563:
  8393. /***/ (function(module, __unusedexports, __webpack_require__) {
  8394. module.exports = getPreviousPage
  8395. const getPage = __webpack_require__(265)
  8396. function getPreviousPage (octokit, link, headers) {
  8397. return getPage(octokit, link, 'prev', headers)
  8398. }
  8399. /***/ }),
  8400. /***/ 568:
  8401. /***/ (function(module, __unusedexports, __webpack_require__) {
  8402. "use strict";
  8403. const path = __webpack_require__(622);
  8404. const niceTry = __webpack_require__(948);
  8405. const resolveCommand = __webpack_require__(489);
  8406. const escape = __webpack_require__(462);
  8407. const readShebang = __webpack_require__(389);
  8408. const semver = __webpack_require__(280);
  8409. const isWin = process.platform === 'win32';
  8410. const isExecutableRegExp = /\.(?:com|exe)$/i;
  8411. const isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
  8412. // `options.shell` is supported in Node ^4.8.0, ^5.7.0 and >= 6.0.0
  8413. const supportsShellOption = niceTry(() => semver.satisfies(process.version, '^4.8.0 || ^5.7.0 || >= 6.0.0', true)) || false;
  8414. function detectShebang(parsed) {
  8415. parsed.file = resolveCommand(parsed);
  8416. const shebang = parsed.file && readShebang(parsed.file);
  8417. if (shebang) {
  8418. parsed.args.unshift(parsed.file);
  8419. parsed.command = shebang;
  8420. return resolveCommand(parsed);
  8421. }
  8422. return parsed.file;
  8423. }
  8424. function parseNonShell(parsed) {
  8425. if (!isWin) {
  8426. return parsed;
  8427. }
  8428. // Detect & add support for shebangs
  8429. const commandFile = detectShebang(parsed);
  8430. // We don't need a shell if the command filename is an executable
  8431. const needsShell = !isExecutableRegExp.test(commandFile);
  8432. // If a shell is required, use cmd.exe and take care of escaping everything correctly
  8433. // Note that `forceShell` is an hidden option used only in tests
  8434. if (parsed.options.forceShell || needsShell) {
  8435. // Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/`
  8436. // The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument
  8437. // Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called,
  8438. // we need to double escape them
  8439. const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
  8440. // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\bar)
  8441. // This is necessary otherwise it will always fail with ENOENT in those cases
  8442. parsed.command = path.normalize(parsed.command);
  8443. // Escape command & arguments
  8444. parsed.command = escape.command(parsed.command);
  8445. parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
  8446. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  8447. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  8448. parsed.command = process.env.comspec || 'cmd.exe';
  8449. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  8450. }
  8451. return parsed;
  8452. }
  8453. function parseShell(parsed) {
  8454. // If node supports the shell option, there's no need to mimic its behavior
  8455. if (supportsShellOption) {
  8456. return parsed;
  8457. }
  8458. // Mimic node shell option
  8459. // See https://github.com/nodejs/node/blob/b9f6a2dc059a1062776133f3d4fd848c4da7d150/lib/child_process.js#L335
  8460. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  8461. if (isWin) {
  8462. parsed.command = typeof parsed.options.shell === 'string' ? parsed.options.shell : process.env.comspec || 'cmd.exe';
  8463. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  8464. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  8465. } else {
  8466. if (typeof parsed.options.shell === 'string') {
  8467. parsed.command = parsed.options.shell;
  8468. } else if (process.platform === 'android') {
  8469. parsed.command = '/system/bin/sh';
  8470. } else {
  8471. parsed.command = '/bin/sh';
  8472. }
  8473. parsed.args = ['-c', shellCommand];
  8474. }
  8475. return parsed;
  8476. }
  8477. function parse(command, args, options) {
  8478. // Normalize arguments, similar to nodejs
  8479. if (args && !Array.isArray(args)) {
  8480. options = args;
  8481. args = null;
  8482. }
  8483. args = args ? args.slice(0) : []; // Clone array to avoid changing the original
  8484. options = Object.assign({}, options); // Clone object to avoid changing the original
  8485. // Build our parsed object
  8486. const parsed = {
  8487. command,
  8488. args,
  8489. options,
  8490. file: undefined,
  8491. original: {
  8492. command,
  8493. args,
  8494. },
  8495. };
  8496. // Delegate further parsing to shell or non-shell
  8497. return options.shell ? parseShell(parsed) : parseNonShell(parsed);
  8498. }
  8499. module.exports = parse;
  8500. /***/ }),
  8501. /***/ 577:
  8502. /***/ (function(module) {
  8503. module.exports = getPageLinks
  8504. function getPageLinks (link) {
  8505. link = link.link || link.headers.link || ''
  8506. const links = {}
  8507. // link format:
  8508. // '<https://api.github.com/users/aseemk/followers?page=2>; rel="next", <https://api.github.com/users/aseemk/followers?page=2>; rel="last"'
  8509. link.replace(/<([^>]*)>;\s*rel="([\w]*)"/g, (m, uri, type) => {
  8510. links[type] = uri
  8511. })
  8512. return links
  8513. }
  8514. /***/ }),
  8515. /***/ 586:
  8516. /***/ (function(module, __unusedexports, __webpack_require__) {
  8517. module.exports = octokitRestApiEndpoints;
  8518. const ROUTES = __webpack_require__(705);
  8519. function octokitRestApiEndpoints(octokit) {
  8520. // Aliasing scopes for backward compatibility
  8521. // See https://github.com/octokit/rest.js/pull/1134
  8522. ROUTES.gitdata = ROUTES.git;
  8523. ROUTES.authorization = ROUTES.oauthAuthorizations;
  8524. ROUTES.pullRequests = ROUTES.pulls;
  8525. octokit.registerEndpoints(ROUTES);
  8526. }
  8527. /***/ }),
  8528. /***/ 587:
  8529. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8530. "use strict";
  8531. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  8532. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  8533. return new (P || (P = Promise))(function (resolve, reject) {
  8534. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  8535. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  8536. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  8537. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8538. });
  8539. };
  8540. var __importStar = (this && this.__importStar) || function (mod) {
  8541. if (mod && mod.__esModule) return mod;
  8542. var result = {};
  8543. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  8544. result["default"] = mod;
  8545. return result;
  8546. };
  8547. Object.defineProperty(exports, "__esModule", { value: true });
  8548. const core = __importStar(__webpack_require__(470));
  8549. const maxAttempts = 3;
  8550. const minSeconds = 10;
  8551. const maxSeconds = 20;
  8552. function execute(action) {
  8553. return __awaiter(this, void 0, void 0, function* () {
  8554. let attempt = 1;
  8555. while (attempt < maxAttempts) {
  8556. // Try
  8557. try {
  8558. return yield action();
  8559. }
  8560. catch (err) {
  8561. core.info(err.message);
  8562. }
  8563. // Sleep
  8564. const seconds = getRandomIntInclusive(minSeconds, maxSeconds);
  8565. core.info(`Waiting ${seconds} before trying again`);
  8566. yield sleep(seconds * 1000);
  8567. attempt++;
  8568. }
  8569. // Last attempt
  8570. return yield action();
  8571. });
  8572. }
  8573. exports.execute = execute;
  8574. function getRandomIntInclusive(minimum, maximum) {
  8575. minimum = Math.floor(minimum);
  8576. maximum = Math.floor(maximum);
  8577. return Math.floor(Math.random() * (maximum - minimum + 1)) + minimum;
  8578. }
  8579. function sleep(milliseconds) {
  8580. return __awaiter(this, void 0, void 0, function* () {
  8581. return new Promise(resolve => setTimeout(resolve, milliseconds));
  8582. });
  8583. }
  8584. /***/ }),
  8585. /***/ 605:
  8586. /***/ (function(module) {
  8587. module.exports = require("http");
  8588. /***/ }),
  8589. /***/ 614:
  8590. /***/ (function(module) {
  8591. module.exports = require("events");
  8592. /***/ }),
  8593. /***/ 618:
  8594. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8595. "use strict";
  8596. var __importStar = (this && this.__importStar) || function (mod) {
  8597. if (mod && mod.__esModule) return mod;
  8598. var result = {};
  8599. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  8600. result["default"] = mod;
  8601. return result;
  8602. };
  8603. Object.defineProperty(exports, "__esModule", { value: true });
  8604. const fs = __importStar(__webpack_require__(747));
  8605. function directoryExistsSync(path, required) {
  8606. if (!path) {
  8607. throw new Error("Arg 'path' must not be empty");
  8608. }
  8609. let stats;
  8610. try {
  8611. stats = fs.statSync(path);
  8612. }
  8613. catch (error) {
  8614. if (error.code === 'ENOENT') {
  8615. if (!required) {
  8616. return false;
  8617. }
  8618. throw new Error(`Directory '${path}' does not exist`);
  8619. }
  8620. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  8621. }
  8622. if (stats.isDirectory()) {
  8623. return true;
  8624. }
  8625. else if (!required) {
  8626. return false;
  8627. }
  8628. throw new Error(`Directory '${path}' does not exist`);
  8629. }
  8630. exports.directoryExistsSync = directoryExistsSync;
  8631. function existsSync(path) {
  8632. if (!path) {
  8633. throw new Error("Arg 'path' must not be empty");
  8634. }
  8635. try {
  8636. fs.statSync(path);
  8637. }
  8638. catch (error) {
  8639. if (error.code === 'ENOENT') {
  8640. return false;
  8641. }
  8642. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  8643. }
  8644. return true;
  8645. }
  8646. exports.existsSync = existsSync;
  8647. function fileExistsSync(path) {
  8648. if (!path) {
  8649. throw new Error("Arg 'path' must not be empty");
  8650. }
  8651. let stats;
  8652. try {
  8653. stats = fs.statSync(path);
  8654. }
  8655. catch (error) {
  8656. if (error.code === 'ENOENT') {
  8657. return false;
  8658. }
  8659. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  8660. }
  8661. if (!stats.isDirectory()) {
  8662. return true;
  8663. }
  8664. return false;
  8665. }
  8666. exports.fileExistsSync = fileExistsSync;
  8667. /***/ }),
  8668. /***/ 621:
  8669. /***/ (function(module, __unusedexports, __webpack_require__) {
  8670. "use strict";
  8671. const path = __webpack_require__(622);
  8672. const pathKey = __webpack_require__(39);
  8673. module.exports = opts => {
  8674. opts = Object.assign({
  8675. cwd: process.cwd(),
  8676. path: process.env[pathKey()]
  8677. }, opts);
  8678. let prev;
  8679. let pth = path.resolve(opts.cwd);
  8680. const ret = [];
  8681. while (prev !== pth) {
  8682. ret.push(path.join(pth, 'node_modules/.bin'));
  8683. prev = pth;
  8684. pth = path.resolve(pth, '..');
  8685. }
  8686. // ensure the running `node` binary is used
  8687. ret.push(path.dirname(process.execPath));
  8688. return ret.concat(opts.path).join(path.delimiter);
  8689. };
  8690. module.exports.env = opts => {
  8691. opts = Object.assign({
  8692. env: process.env
  8693. }, opts);
  8694. const env = Object.assign({}, opts.env);
  8695. const path = pathKey({env});
  8696. opts.path = env[path];
  8697. env[path] = module.exports(opts);
  8698. return env;
  8699. };
  8700. /***/ }),
  8701. /***/ 622:
  8702. /***/ (function(module) {
  8703. module.exports = require("path");
  8704. /***/ }),
  8705. /***/ 631:
  8706. /***/ (function(module) {
  8707. module.exports = require("net");
  8708. /***/ }),
  8709. /***/ 649:
  8710. /***/ (function(module, __unusedexports, __webpack_require__) {
  8711. module.exports = getLastPage
  8712. const getPage = __webpack_require__(265)
  8713. function getLastPage (octokit, link, headers) {
  8714. return getPage(octokit, link, 'last', headers)
  8715. }
  8716. /***/ }),
  8717. /***/ 654:
  8718. /***/ (function(module) {
  8719. // This is not the set of all possible signals.
  8720. //
  8721. // It IS, however, the set of all signals that trigger
  8722. // an exit on either Linux or BSD systems. Linux is a
  8723. // superset of the signal names supported on BSD, and
  8724. // the unknown signals just fail to register, so we can
  8725. // catch that easily enough.
  8726. //
  8727. // Don't bother with SIGKILL. It's uncatchable, which
  8728. // means that we can't fire any callbacks anyway.
  8729. //
  8730. // If a user does happen to register a handler on a non-
  8731. // fatal signal like SIGWINCH or something, and then
  8732. // exit, it'll end up firing `process.emit('exit')`, so
  8733. // the handler will be fired anyway.
  8734. //
  8735. // SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised
  8736. // artificially, inherently leave the process in a
  8737. // state from which it is not safe to try and enter JS
  8738. // listeners.
  8739. module.exports = [
  8740. 'SIGABRT',
  8741. 'SIGALRM',
  8742. 'SIGHUP',
  8743. 'SIGINT',
  8744. 'SIGTERM'
  8745. ]
  8746. if (process.platform !== 'win32') {
  8747. module.exports.push(
  8748. 'SIGVTALRM',
  8749. 'SIGXCPU',
  8750. 'SIGXFSZ',
  8751. 'SIGUSR2',
  8752. 'SIGTRAP',
  8753. 'SIGSYS',
  8754. 'SIGQUIT',
  8755. 'SIGIOT'
  8756. // should detect profiler and enable/disable accordingly.
  8757. // see #21
  8758. // 'SIGPROF'
  8759. )
  8760. }
  8761. if (process.platform === 'linux') {
  8762. module.exports.push(
  8763. 'SIGIO',
  8764. 'SIGPOLL',
  8765. 'SIGPWR',
  8766. 'SIGSTKFLT',
  8767. 'SIGUNUSED'
  8768. )
  8769. }
  8770. /***/ }),
  8771. /***/ 656:
  8772. /***/ (function(module, exports) {
  8773. exports = module.exports = SemVer
  8774. var debug
  8775. /* istanbul ignore next */
  8776. if (typeof process === 'object' &&
  8777. process.env &&
  8778. process.env.NODE_DEBUG &&
  8779. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  8780. debug = function () {
  8781. var args = Array.prototype.slice.call(arguments, 0)
  8782. args.unshift('SEMVER')
  8783. console.log.apply(console, args)
  8784. }
  8785. } else {
  8786. debug = function () {}
  8787. }
  8788. // Note: this is the semver.org version of the spec that it implements
  8789. // Not necessarily the package version of this code.
  8790. exports.SEMVER_SPEC_VERSION = '2.0.0'
  8791. var MAX_LENGTH = 256
  8792. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  8793. /* istanbul ignore next */ 9007199254740991
  8794. // Max safe segment length for coercion.
  8795. var MAX_SAFE_COMPONENT_LENGTH = 16
  8796. // The actual regexps go on exports.re
  8797. var re = exports.re = []
  8798. var src = exports.src = []
  8799. var t = exports.tokens = {}
  8800. var R = 0
  8801. function tok (n) {
  8802. t[n] = R++
  8803. }
  8804. // The following Regular Expressions can be used for tokenizing,
  8805. // validating, and parsing SemVer version strings.
  8806. // ## Numeric Identifier
  8807. // A single `0`, or a non-zero digit followed by zero or more digits.
  8808. tok('NUMERICIDENTIFIER')
  8809. src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  8810. tok('NUMERICIDENTIFIERLOOSE')
  8811. src[t.NUMERICIDENTIFIERLOOSE] = '[0-9]+'
  8812. // ## Non-numeric Identifier
  8813. // Zero or more digits, followed by a letter or hyphen, and then zero or
  8814. // more letters, digits, or hyphens.
  8815. tok('NONNUMERICIDENTIFIER')
  8816. src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
  8817. // ## Main Version
  8818. // Three dot-separated numeric identifiers.
  8819. tok('MAINVERSION')
  8820. src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  8821. '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  8822. '(' + src[t.NUMERICIDENTIFIER] + ')'
  8823. tok('MAINVERSIONLOOSE')
  8824. src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  8825. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  8826. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')'
  8827. // ## Pre-release Version Identifier
  8828. // A numeric identifier, or a non-numeric identifier.
  8829. tok('PRERELEASEIDENTIFIER')
  8830. src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] +
  8831. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  8832. tok('PRERELEASEIDENTIFIERLOOSE')
  8833. src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] +
  8834. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  8835. // ## Pre-release Version
  8836. // Hyphen, followed by one or more dot-separated pre-release version
  8837. // identifiers.
  8838. tok('PRERELEASE')
  8839. src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] +
  8840. '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))'
  8841. tok('PRERELEASELOOSE')
  8842. src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] +
  8843. '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))'
  8844. // ## Build Metadata Identifier
  8845. // Any combination of digits, letters, or hyphens.
  8846. tok('BUILDIDENTIFIER')
  8847. src[t.BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
  8848. // ## Build Metadata
  8849. // Plus sign, followed by one or more period-separated build metadata
  8850. // identifiers.
  8851. tok('BUILD')
  8852. src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] +
  8853. '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))'
  8854. // ## Full Version String
  8855. // A main version, followed optionally by a pre-release version and
  8856. // build metadata.
  8857. // Note that the only major, minor, patch, and pre-release sections of
  8858. // the version string are capturing groups. The build metadata is not a
  8859. // capturing group, because it should not ever be used in version
  8860. // comparison.
  8861. tok('FULL')
  8862. tok('FULLPLAIN')
  8863. src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] +
  8864. src[t.PRERELEASE] + '?' +
  8865. src[t.BUILD] + '?'
  8866. src[t.FULL] = '^' + src[t.FULLPLAIN] + '$'
  8867. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  8868. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  8869. // common in the npm registry.
  8870. tok('LOOSEPLAIN')
  8871. src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] +
  8872. src[t.PRERELEASELOOSE] + '?' +
  8873. src[t.BUILD] + '?'
  8874. tok('LOOSE')
  8875. src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$'
  8876. tok('GTLT')
  8877. src[t.GTLT] = '((?:<|>)?=?)'
  8878. // Something like "2.*" or "1.2.x".
  8879. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  8880. // Only the first item is strictly required.
  8881. tok('XRANGEIDENTIFIERLOOSE')
  8882. src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  8883. tok('XRANGEIDENTIFIER')
  8884. src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*'
  8885. tok('XRANGEPLAIN')
  8886. src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' +
  8887. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  8888. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  8889. '(?:' + src[t.PRERELEASE] + ')?' +
  8890. src[t.BUILD] + '?' +
  8891. ')?)?'
  8892. tok('XRANGEPLAINLOOSE')
  8893. src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  8894. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  8895. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  8896. '(?:' + src[t.PRERELEASELOOSE] + ')?' +
  8897. src[t.BUILD] + '?' +
  8898. ')?)?'
  8899. tok('XRANGE')
  8900. src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$'
  8901. tok('XRANGELOOSE')
  8902. src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$'
  8903. // Coercion.
  8904. // Extract anything that could conceivably be a part of a valid semver
  8905. tok('COERCE')
  8906. src[t.COERCE] = '(^|[^\\d])' +
  8907. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  8908. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  8909. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  8910. '(?:$|[^\\d])'
  8911. tok('COERCERTL')
  8912. re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g')
  8913. // Tilde ranges.
  8914. // Meaning is "reasonably at or greater than"
  8915. tok('LONETILDE')
  8916. src[t.LONETILDE] = '(?:~>?)'
  8917. tok('TILDETRIM')
  8918. src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+'
  8919. re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g')
  8920. var tildeTrimReplace = '$1~'
  8921. tok('TILDE')
  8922. src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$'
  8923. tok('TILDELOOSE')
  8924. src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$'
  8925. // Caret ranges.
  8926. // Meaning is "at least and backwards compatible with"
  8927. tok('LONECARET')
  8928. src[t.LONECARET] = '(?:\\^)'
  8929. tok('CARETTRIM')
  8930. src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+'
  8931. re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g')
  8932. var caretTrimReplace = '$1^'
  8933. tok('CARET')
  8934. src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$'
  8935. tok('CARETLOOSE')
  8936. src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$'
  8937. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  8938. tok('COMPARATORLOOSE')
  8939. src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$'
  8940. tok('COMPARATOR')
  8941. src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$'
  8942. // An expression to strip any whitespace between the gtlt and the thing
  8943. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  8944. tok('COMPARATORTRIM')
  8945. src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] +
  8946. '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')'
  8947. // this one has to use the /g flag
  8948. re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g')
  8949. var comparatorTrimReplace = '$1$2$3'
  8950. // Something like `1.2.3 - 1.2.4`
  8951. // Note that these all use the loose form, because they'll be
  8952. // checked against either the strict or loose comparator form
  8953. // later.
  8954. tok('HYPHENRANGE')
  8955. src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' +
  8956. '\\s+-\\s+' +
  8957. '(' + src[t.XRANGEPLAIN] + ')' +
  8958. '\\s*$'
  8959. tok('HYPHENRANGELOOSE')
  8960. src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' +
  8961. '\\s+-\\s+' +
  8962. '(' + src[t.XRANGEPLAINLOOSE] + ')' +
  8963. '\\s*$'
  8964. // Star ranges basically just allow anything at all.
  8965. tok('STAR')
  8966. src[t.STAR] = '(<|>)?=?\\s*\\*'
  8967. // Compile to actual regexp objects.
  8968. // All are flag-free, unless they were created above with a flag.
  8969. for (var i = 0; i < R; i++) {
  8970. debug(i, src[i])
  8971. if (!re[i]) {
  8972. re[i] = new RegExp(src[i])
  8973. }
  8974. }
  8975. exports.parse = parse
  8976. function parse (version, options) {
  8977. if (!options || typeof options !== 'object') {
  8978. options = {
  8979. loose: !!options,
  8980. includePrerelease: false
  8981. }
  8982. }
  8983. if (version instanceof SemVer) {
  8984. return version
  8985. }
  8986. if (typeof version !== 'string') {
  8987. return null
  8988. }
  8989. if (version.length > MAX_LENGTH) {
  8990. return null
  8991. }
  8992. var r = options.loose ? re[t.LOOSE] : re[t.FULL]
  8993. if (!r.test(version)) {
  8994. return null
  8995. }
  8996. try {
  8997. return new SemVer(version, options)
  8998. } catch (er) {
  8999. return null
  9000. }
  9001. }
  9002. exports.valid = valid
  9003. function valid (version, options) {
  9004. var v = parse(version, options)
  9005. return v ? v.version : null
  9006. }
  9007. exports.clean = clean
  9008. function clean (version, options) {
  9009. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  9010. return s ? s.version : null
  9011. }
  9012. exports.SemVer = SemVer
  9013. function SemVer (version, options) {
  9014. if (!options || typeof options !== 'object') {
  9015. options = {
  9016. loose: !!options,
  9017. includePrerelease: false
  9018. }
  9019. }
  9020. if (version instanceof SemVer) {
  9021. if (version.loose === options.loose) {
  9022. return version
  9023. } else {
  9024. version = version.version
  9025. }
  9026. } else if (typeof version !== 'string') {
  9027. throw new TypeError('Invalid Version: ' + version)
  9028. }
  9029. if (version.length > MAX_LENGTH) {
  9030. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  9031. }
  9032. if (!(this instanceof SemVer)) {
  9033. return new SemVer(version, options)
  9034. }
  9035. debug('SemVer', version, options)
  9036. this.options = options
  9037. this.loose = !!options.loose
  9038. var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])
  9039. if (!m) {
  9040. throw new TypeError('Invalid Version: ' + version)
  9041. }
  9042. this.raw = version
  9043. // these are actually numbers
  9044. this.major = +m[1]
  9045. this.minor = +m[2]
  9046. this.patch = +m[3]
  9047. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  9048. throw new TypeError('Invalid major version')
  9049. }
  9050. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  9051. throw new TypeError('Invalid minor version')
  9052. }
  9053. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  9054. throw new TypeError('Invalid patch version')
  9055. }
  9056. // numberify any prerelease numeric ids
  9057. if (!m[4]) {
  9058. this.prerelease = []
  9059. } else {
  9060. this.prerelease = m[4].split('.').map(function (id) {
  9061. if (/^[0-9]+$/.test(id)) {
  9062. var num = +id
  9063. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  9064. return num
  9065. }
  9066. }
  9067. return id
  9068. })
  9069. }
  9070. this.build = m[5] ? m[5].split('.') : []
  9071. this.format()
  9072. }
  9073. SemVer.prototype.format = function () {
  9074. this.version = this.major + '.' + this.minor + '.' + this.patch
  9075. if (this.prerelease.length) {
  9076. this.version += '-' + this.prerelease.join('.')
  9077. }
  9078. return this.version
  9079. }
  9080. SemVer.prototype.toString = function () {
  9081. return this.version
  9082. }
  9083. SemVer.prototype.compare = function (other) {
  9084. debug('SemVer.compare', this.version, this.options, other)
  9085. if (!(other instanceof SemVer)) {
  9086. other = new SemVer(other, this.options)
  9087. }
  9088. return this.compareMain(other) || this.comparePre(other)
  9089. }
  9090. SemVer.prototype.compareMain = function (other) {
  9091. if (!(other instanceof SemVer)) {
  9092. other = new SemVer(other, this.options)
  9093. }
  9094. return compareIdentifiers(this.major, other.major) ||
  9095. compareIdentifiers(this.minor, other.minor) ||
  9096. compareIdentifiers(this.patch, other.patch)
  9097. }
  9098. SemVer.prototype.comparePre = function (other) {
  9099. if (!(other instanceof SemVer)) {
  9100. other = new SemVer(other, this.options)
  9101. }
  9102. // NOT having a prerelease is > having one
  9103. if (this.prerelease.length && !other.prerelease.length) {
  9104. return -1
  9105. } else if (!this.prerelease.length && other.prerelease.length) {
  9106. return 1
  9107. } else if (!this.prerelease.length && !other.prerelease.length) {
  9108. return 0
  9109. }
  9110. var i = 0
  9111. do {
  9112. var a = this.prerelease[i]
  9113. var b = other.prerelease[i]
  9114. debug('prerelease compare', i, a, b)
  9115. if (a === undefined && b === undefined) {
  9116. return 0
  9117. } else if (b === undefined) {
  9118. return 1
  9119. } else if (a === undefined) {
  9120. return -1
  9121. } else if (a === b) {
  9122. continue
  9123. } else {
  9124. return compareIdentifiers(a, b)
  9125. }
  9126. } while (++i)
  9127. }
  9128. SemVer.prototype.compareBuild = function (other) {
  9129. if (!(other instanceof SemVer)) {
  9130. other = new SemVer(other, this.options)
  9131. }
  9132. var i = 0
  9133. do {
  9134. var a = this.build[i]
  9135. var b = other.build[i]
  9136. debug('prerelease compare', i, a, b)
  9137. if (a === undefined && b === undefined) {
  9138. return 0
  9139. } else if (b === undefined) {
  9140. return 1
  9141. } else if (a === undefined) {
  9142. return -1
  9143. } else if (a === b) {
  9144. continue
  9145. } else {
  9146. return compareIdentifiers(a, b)
  9147. }
  9148. } while (++i)
  9149. }
  9150. // preminor will bump the version up to the next minor release, and immediately
  9151. // down to pre-release. premajor and prepatch work the same way.
  9152. SemVer.prototype.inc = function (release, identifier) {
  9153. switch (release) {
  9154. case 'premajor':
  9155. this.prerelease.length = 0
  9156. this.patch = 0
  9157. this.minor = 0
  9158. this.major++
  9159. this.inc('pre', identifier)
  9160. break
  9161. case 'preminor':
  9162. this.prerelease.length = 0
  9163. this.patch = 0
  9164. this.minor++
  9165. this.inc('pre', identifier)
  9166. break
  9167. case 'prepatch':
  9168. // If this is already a prerelease, it will bump to the next version
  9169. // drop any prereleases that might already exist, since they are not
  9170. // relevant at this point.
  9171. this.prerelease.length = 0
  9172. this.inc('patch', identifier)
  9173. this.inc('pre', identifier)
  9174. break
  9175. // If the input is a non-prerelease version, this acts the same as
  9176. // prepatch.
  9177. case 'prerelease':
  9178. if (this.prerelease.length === 0) {
  9179. this.inc('patch', identifier)
  9180. }
  9181. this.inc('pre', identifier)
  9182. break
  9183. case 'major':
  9184. // If this is a pre-major version, bump up to the same major version.
  9185. // Otherwise increment major.
  9186. // 1.0.0-5 bumps to 1.0.0
  9187. // 1.1.0 bumps to 2.0.0
  9188. if (this.minor !== 0 ||
  9189. this.patch !== 0 ||
  9190. this.prerelease.length === 0) {
  9191. this.major++
  9192. }
  9193. this.minor = 0
  9194. this.patch = 0
  9195. this.prerelease = []
  9196. break
  9197. case 'minor':
  9198. // If this is a pre-minor version, bump up to the same minor version.
  9199. // Otherwise increment minor.
  9200. // 1.2.0-5 bumps to 1.2.0
  9201. // 1.2.1 bumps to 1.3.0
  9202. if (this.patch !== 0 || this.prerelease.length === 0) {
  9203. this.minor++
  9204. }
  9205. this.patch = 0
  9206. this.prerelease = []
  9207. break
  9208. case 'patch':
  9209. // If this is not a pre-release version, it will increment the patch.
  9210. // If it is a pre-release it will bump up to the same patch version.
  9211. // 1.2.0-5 patches to 1.2.0
  9212. // 1.2.0 patches to 1.2.1
  9213. if (this.prerelease.length === 0) {
  9214. this.patch++
  9215. }
  9216. this.prerelease = []
  9217. break
  9218. // This probably shouldn't be used publicly.
  9219. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  9220. case 'pre':
  9221. if (this.prerelease.length === 0) {
  9222. this.prerelease = [0]
  9223. } else {
  9224. var i = this.prerelease.length
  9225. while (--i >= 0) {
  9226. if (typeof this.prerelease[i] === 'number') {
  9227. this.prerelease[i]++
  9228. i = -2
  9229. }
  9230. }
  9231. if (i === -1) {
  9232. // didn't increment anything
  9233. this.prerelease.push(0)
  9234. }
  9235. }
  9236. if (identifier) {
  9237. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  9238. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  9239. if (this.prerelease[0] === identifier) {
  9240. if (isNaN(this.prerelease[1])) {
  9241. this.prerelease = [identifier, 0]
  9242. }
  9243. } else {
  9244. this.prerelease = [identifier, 0]
  9245. }
  9246. }
  9247. break
  9248. default:
  9249. throw new Error('invalid increment argument: ' + release)
  9250. }
  9251. this.format()
  9252. this.raw = this.version
  9253. return this
  9254. }
  9255. exports.inc = inc
  9256. function inc (version, release, loose, identifier) {
  9257. if (typeof (loose) === 'string') {
  9258. identifier = loose
  9259. loose = undefined
  9260. }
  9261. try {
  9262. return new SemVer(version, loose).inc(release, identifier).version
  9263. } catch (er) {
  9264. return null
  9265. }
  9266. }
  9267. exports.diff = diff
  9268. function diff (version1, version2) {
  9269. if (eq(version1, version2)) {
  9270. return null
  9271. } else {
  9272. var v1 = parse(version1)
  9273. var v2 = parse(version2)
  9274. var prefix = ''
  9275. if (v1.prerelease.length || v2.prerelease.length) {
  9276. prefix = 'pre'
  9277. var defaultResult = 'prerelease'
  9278. }
  9279. for (var key in v1) {
  9280. if (key === 'major' || key === 'minor' || key === 'patch') {
  9281. if (v1[key] !== v2[key]) {
  9282. return prefix + key
  9283. }
  9284. }
  9285. }
  9286. return defaultResult // may be undefined
  9287. }
  9288. }
  9289. exports.compareIdentifiers = compareIdentifiers
  9290. var numeric = /^[0-9]+$/
  9291. function compareIdentifiers (a, b) {
  9292. var anum = numeric.test(a)
  9293. var bnum = numeric.test(b)
  9294. if (anum && bnum) {
  9295. a = +a
  9296. b = +b
  9297. }
  9298. return a === b ? 0
  9299. : (anum && !bnum) ? -1
  9300. : (bnum && !anum) ? 1
  9301. : a < b ? -1
  9302. : 1
  9303. }
  9304. exports.rcompareIdentifiers = rcompareIdentifiers
  9305. function rcompareIdentifiers (a, b) {
  9306. return compareIdentifiers(b, a)
  9307. }
  9308. exports.major = major
  9309. function major (a, loose) {
  9310. return new SemVer(a, loose).major
  9311. }
  9312. exports.minor = minor
  9313. function minor (a, loose) {
  9314. return new SemVer(a, loose).minor
  9315. }
  9316. exports.patch = patch
  9317. function patch (a, loose) {
  9318. return new SemVer(a, loose).patch
  9319. }
  9320. exports.compare = compare
  9321. function compare (a, b, loose) {
  9322. return new SemVer(a, loose).compare(new SemVer(b, loose))
  9323. }
  9324. exports.compareLoose = compareLoose
  9325. function compareLoose (a, b) {
  9326. return compare(a, b, true)
  9327. }
  9328. exports.compareBuild = compareBuild
  9329. function compareBuild (a, b, loose) {
  9330. var versionA = new SemVer(a, loose)
  9331. var versionB = new SemVer(b, loose)
  9332. return versionA.compare(versionB) || versionA.compareBuild(versionB)
  9333. }
  9334. exports.rcompare = rcompare
  9335. function rcompare (a, b, loose) {
  9336. return compare(b, a, loose)
  9337. }
  9338. exports.sort = sort
  9339. function sort (list, loose) {
  9340. return list.sort(function (a, b) {
  9341. return exports.compareBuild(a, b, loose)
  9342. })
  9343. }
  9344. exports.rsort = rsort
  9345. function rsort (list, loose) {
  9346. return list.sort(function (a, b) {
  9347. return exports.compareBuild(b, a, loose)
  9348. })
  9349. }
  9350. exports.gt = gt
  9351. function gt (a, b, loose) {
  9352. return compare(a, b, loose) > 0
  9353. }
  9354. exports.lt = lt
  9355. function lt (a, b, loose) {
  9356. return compare(a, b, loose) < 0
  9357. }
  9358. exports.eq = eq
  9359. function eq (a, b, loose) {
  9360. return compare(a, b, loose) === 0
  9361. }
  9362. exports.neq = neq
  9363. function neq (a, b, loose) {
  9364. return compare(a, b, loose) !== 0
  9365. }
  9366. exports.gte = gte
  9367. function gte (a, b, loose) {
  9368. return compare(a, b, loose) >= 0
  9369. }
  9370. exports.lte = lte
  9371. function lte (a, b, loose) {
  9372. return compare(a, b, loose) <= 0
  9373. }
  9374. exports.cmp = cmp
  9375. function cmp (a, op, b, loose) {
  9376. switch (op) {
  9377. case '===':
  9378. if (typeof a === 'object')
  9379. a = a.version
  9380. if (typeof b === 'object')
  9381. b = b.version
  9382. return a === b
  9383. case '!==':
  9384. if (typeof a === 'object')
  9385. a = a.version
  9386. if (typeof b === 'object')
  9387. b = b.version
  9388. return a !== b
  9389. case '':
  9390. case '=':
  9391. case '==':
  9392. return eq(a, b, loose)
  9393. case '!=':
  9394. return neq(a, b, loose)
  9395. case '>':
  9396. return gt(a, b, loose)
  9397. case '>=':
  9398. return gte(a, b, loose)
  9399. case '<':
  9400. return lt(a, b, loose)
  9401. case '<=':
  9402. return lte(a, b, loose)
  9403. default:
  9404. throw new TypeError('Invalid operator: ' + op)
  9405. }
  9406. }
  9407. exports.Comparator = Comparator
  9408. function Comparator (comp, options) {
  9409. if (!options || typeof options !== 'object') {
  9410. options = {
  9411. loose: !!options,
  9412. includePrerelease: false
  9413. }
  9414. }
  9415. if (comp instanceof Comparator) {
  9416. if (comp.loose === !!options.loose) {
  9417. return comp
  9418. } else {
  9419. comp = comp.value
  9420. }
  9421. }
  9422. if (!(this instanceof Comparator)) {
  9423. return new Comparator(comp, options)
  9424. }
  9425. debug('comparator', comp, options)
  9426. this.options = options
  9427. this.loose = !!options.loose
  9428. this.parse(comp)
  9429. if (this.semver === ANY) {
  9430. this.value = ''
  9431. } else {
  9432. this.value = this.operator + this.semver.version
  9433. }
  9434. debug('comp', this)
  9435. }
  9436. var ANY = {}
  9437. Comparator.prototype.parse = function (comp) {
  9438. var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
  9439. var m = comp.match(r)
  9440. if (!m) {
  9441. throw new TypeError('Invalid comparator: ' + comp)
  9442. }
  9443. this.operator = m[1] !== undefined ? m[1] : ''
  9444. if (this.operator === '=') {
  9445. this.operator = ''
  9446. }
  9447. // if it literally is just '>' or '' then allow anything.
  9448. if (!m[2]) {
  9449. this.semver = ANY
  9450. } else {
  9451. this.semver = new SemVer(m[2], this.options.loose)
  9452. }
  9453. }
  9454. Comparator.prototype.toString = function () {
  9455. return this.value
  9456. }
  9457. Comparator.prototype.test = function (version) {
  9458. debug('Comparator.test', version, this.options.loose)
  9459. if (this.semver === ANY || version === ANY) {
  9460. return true
  9461. }
  9462. if (typeof version === 'string') {
  9463. try {
  9464. version = new SemVer(version, this.options)
  9465. } catch (er) {
  9466. return false
  9467. }
  9468. }
  9469. return cmp(version, this.operator, this.semver, this.options)
  9470. }
  9471. Comparator.prototype.intersects = function (comp, options) {
  9472. if (!(comp instanceof Comparator)) {
  9473. throw new TypeError('a Comparator is required')
  9474. }
  9475. if (!options || typeof options !== 'object') {
  9476. options = {
  9477. loose: !!options,
  9478. includePrerelease: false
  9479. }
  9480. }
  9481. var rangeTmp
  9482. if (this.operator === '') {
  9483. if (this.value === '') {
  9484. return true
  9485. }
  9486. rangeTmp = new Range(comp.value, options)
  9487. return satisfies(this.value, rangeTmp, options)
  9488. } else if (comp.operator === '') {
  9489. if (comp.value === '') {
  9490. return true
  9491. }
  9492. rangeTmp = new Range(this.value, options)
  9493. return satisfies(comp.semver, rangeTmp, options)
  9494. }
  9495. var sameDirectionIncreasing =
  9496. (this.operator === '>=' || this.operator === '>') &&
  9497. (comp.operator === '>=' || comp.operator === '>')
  9498. var sameDirectionDecreasing =
  9499. (this.operator === '<=' || this.operator === '<') &&
  9500. (comp.operator === '<=' || comp.operator === '<')
  9501. var sameSemVer = this.semver.version === comp.semver.version
  9502. var differentDirectionsInclusive =
  9503. (this.operator === '>=' || this.operator === '<=') &&
  9504. (comp.operator === '>=' || comp.operator === '<=')
  9505. var oppositeDirectionsLessThan =
  9506. cmp(this.semver, '<', comp.semver, options) &&
  9507. ((this.operator === '>=' || this.operator === '>') &&
  9508. (comp.operator === '<=' || comp.operator === '<'))
  9509. var oppositeDirectionsGreaterThan =
  9510. cmp(this.semver, '>', comp.semver, options) &&
  9511. ((this.operator === '<=' || this.operator === '<') &&
  9512. (comp.operator === '>=' || comp.operator === '>'))
  9513. return sameDirectionIncreasing || sameDirectionDecreasing ||
  9514. (sameSemVer && differentDirectionsInclusive) ||
  9515. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  9516. }
  9517. exports.Range = Range
  9518. function Range (range, options) {
  9519. if (!options || typeof options !== 'object') {
  9520. options = {
  9521. loose: !!options,
  9522. includePrerelease: false
  9523. }
  9524. }
  9525. if (range instanceof Range) {
  9526. if (range.loose === !!options.loose &&
  9527. range.includePrerelease === !!options.includePrerelease) {
  9528. return range
  9529. } else {
  9530. return new Range(range.raw, options)
  9531. }
  9532. }
  9533. if (range instanceof Comparator) {
  9534. return new Range(range.value, options)
  9535. }
  9536. if (!(this instanceof Range)) {
  9537. return new Range(range, options)
  9538. }
  9539. this.options = options
  9540. this.loose = !!options.loose
  9541. this.includePrerelease = !!options.includePrerelease
  9542. // First, split based on boolean or ||
  9543. this.raw = range
  9544. this.set = range.split(/\s*\|\|\s*/).map(function (range) {
  9545. return this.parseRange(range.trim())
  9546. }, this).filter(function (c) {
  9547. // throw out any that are not relevant for whatever reason
  9548. return c.length
  9549. })
  9550. if (!this.set.length) {
  9551. throw new TypeError('Invalid SemVer Range: ' + range)
  9552. }
  9553. this.format()
  9554. }
  9555. Range.prototype.format = function () {
  9556. this.range = this.set.map(function (comps) {
  9557. return comps.join(' ').trim()
  9558. }).join('||').trim()
  9559. return this.range
  9560. }
  9561. Range.prototype.toString = function () {
  9562. return this.range
  9563. }
  9564. Range.prototype.parseRange = function (range) {
  9565. var loose = this.options.loose
  9566. range = range.trim()
  9567. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  9568. var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]
  9569. range = range.replace(hr, hyphenReplace)
  9570. debug('hyphen replace', range)
  9571. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  9572. range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)
  9573. debug('comparator trim', range, re[t.COMPARATORTRIM])
  9574. // `~ 1.2.3` => `~1.2.3`
  9575. range = range.replace(re[t.TILDETRIM], tildeTrimReplace)
  9576. // `^ 1.2.3` => `^1.2.3`
  9577. range = range.replace(re[t.CARETTRIM], caretTrimReplace)
  9578. // normalize spaces
  9579. range = range.split(/\s+/).join(' ')
  9580. // At this point, the range is completely trimmed and
  9581. // ready to be split into comparators.
  9582. var compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
  9583. var set = range.split(' ').map(function (comp) {
  9584. return parseComparator(comp, this.options)
  9585. }, this).join(' ').split(/\s+/)
  9586. if (this.options.loose) {
  9587. // in loose mode, throw out any that are not valid comparators
  9588. set = set.filter(function (comp) {
  9589. return !!comp.match(compRe)
  9590. })
  9591. }
  9592. set = set.map(function (comp) {
  9593. return new Comparator(comp, this.options)
  9594. }, this)
  9595. return set
  9596. }
  9597. Range.prototype.intersects = function (range, options) {
  9598. if (!(range instanceof Range)) {
  9599. throw new TypeError('a Range is required')
  9600. }
  9601. return this.set.some(function (thisComparators) {
  9602. return (
  9603. isSatisfiable(thisComparators, options) &&
  9604. range.set.some(function (rangeComparators) {
  9605. return (
  9606. isSatisfiable(rangeComparators, options) &&
  9607. thisComparators.every(function (thisComparator) {
  9608. return rangeComparators.every(function (rangeComparator) {
  9609. return thisComparator.intersects(rangeComparator, options)
  9610. })
  9611. })
  9612. )
  9613. })
  9614. )
  9615. })
  9616. }
  9617. // take a set of comparators and determine whether there
  9618. // exists a version which can satisfy it
  9619. function isSatisfiable (comparators, options) {
  9620. var result = true
  9621. var remainingComparators = comparators.slice()
  9622. var testComparator = remainingComparators.pop()
  9623. while (result && remainingComparators.length) {
  9624. result = remainingComparators.every(function (otherComparator) {
  9625. return testComparator.intersects(otherComparator, options)
  9626. })
  9627. testComparator = remainingComparators.pop()
  9628. }
  9629. return result
  9630. }
  9631. // Mostly just for testing and legacy API reasons
  9632. exports.toComparators = toComparators
  9633. function toComparators (range, options) {
  9634. return new Range(range, options).set.map(function (comp) {
  9635. return comp.map(function (c) {
  9636. return c.value
  9637. }).join(' ').trim().split(' ')
  9638. })
  9639. }
  9640. // comprised of xranges, tildes, stars, and gtlt's at this point.
  9641. // already replaced the hyphen ranges
  9642. // turn into a set of JUST comparators.
  9643. function parseComparator (comp, options) {
  9644. debug('comp', comp, options)
  9645. comp = replaceCarets(comp, options)
  9646. debug('caret', comp)
  9647. comp = replaceTildes(comp, options)
  9648. debug('tildes', comp)
  9649. comp = replaceXRanges(comp, options)
  9650. debug('xrange', comp)
  9651. comp = replaceStars(comp, options)
  9652. debug('stars', comp)
  9653. return comp
  9654. }
  9655. function isX (id) {
  9656. return !id || id.toLowerCase() === 'x' || id === '*'
  9657. }
  9658. // ~, ~> --> * (any, kinda silly)
  9659. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  9660. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  9661. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  9662. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  9663. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  9664. function replaceTildes (comp, options) {
  9665. return comp.trim().split(/\s+/).map(function (comp) {
  9666. return replaceTilde(comp, options)
  9667. }).join(' ')
  9668. }
  9669. function replaceTilde (comp, options) {
  9670. var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]
  9671. return comp.replace(r, function (_, M, m, p, pr) {
  9672. debug('tilde', comp, _, M, m, p, pr)
  9673. var ret
  9674. if (isX(M)) {
  9675. ret = ''
  9676. } else if (isX(m)) {
  9677. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  9678. } else if (isX(p)) {
  9679. // ~1.2 == >=1.2.0 <1.3.0
  9680. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  9681. } else if (pr) {
  9682. debug('replaceTilde pr', pr)
  9683. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  9684. ' <' + M + '.' + (+m + 1) + '.0'
  9685. } else {
  9686. // ~1.2.3 == >=1.2.3 <1.3.0
  9687. ret = '>=' + M + '.' + m + '.' + p +
  9688. ' <' + M + '.' + (+m + 1) + '.0'
  9689. }
  9690. debug('tilde return', ret)
  9691. return ret
  9692. })
  9693. }
  9694. // ^ --> * (any, kinda silly)
  9695. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  9696. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  9697. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  9698. // ^1.2.3 --> >=1.2.3 <2.0.0
  9699. // ^1.2.0 --> >=1.2.0 <2.0.0
  9700. function replaceCarets (comp, options) {
  9701. return comp.trim().split(/\s+/).map(function (comp) {
  9702. return replaceCaret(comp, options)
  9703. }).join(' ')
  9704. }
  9705. function replaceCaret (comp, options) {
  9706. debug('caret', comp, options)
  9707. var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]
  9708. return comp.replace(r, function (_, M, m, p, pr) {
  9709. debug('caret', comp, _, M, m, p, pr)
  9710. var ret
  9711. if (isX(M)) {
  9712. ret = ''
  9713. } else if (isX(m)) {
  9714. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  9715. } else if (isX(p)) {
  9716. if (M === '0') {
  9717. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  9718. } else {
  9719. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  9720. }
  9721. } else if (pr) {
  9722. debug('replaceCaret pr', pr)
  9723. if (M === '0') {
  9724. if (m === '0') {
  9725. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  9726. ' <' + M + '.' + m + '.' + (+p + 1)
  9727. } else {
  9728. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  9729. ' <' + M + '.' + (+m + 1) + '.0'
  9730. }
  9731. } else {
  9732. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  9733. ' <' + (+M + 1) + '.0.0'
  9734. }
  9735. } else {
  9736. debug('no pr')
  9737. if (M === '0') {
  9738. if (m === '0') {
  9739. ret = '>=' + M + '.' + m + '.' + p +
  9740. ' <' + M + '.' + m + '.' + (+p + 1)
  9741. } else {
  9742. ret = '>=' + M + '.' + m + '.' + p +
  9743. ' <' + M + '.' + (+m + 1) + '.0'
  9744. }
  9745. } else {
  9746. ret = '>=' + M + '.' + m + '.' + p +
  9747. ' <' + (+M + 1) + '.0.0'
  9748. }
  9749. }
  9750. debug('caret return', ret)
  9751. return ret
  9752. })
  9753. }
  9754. function replaceXRanges (comp, options) {
  9755. debug('replaceXRanges', comp, options)
  9756. return comp.split(/\s+/).map(function (comp) {
  9757. return replaceXRange(comp, options)
  9758. }).join(' ')
  9759. }
  9760. function replaceXRange (comp, options) {
  9761. comp = comp.trim()
  9762. var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]
  9763. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  9764. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  9765. var xM = isX(M)
  9766. var xm = xM || isX(m)
  9767. var xp = xm || isX(p)
  9768. var anyX = xp
  9769. if (gtlt === '=' && anyX) {
  9770. gtlt = ''
  9771. }
  9772. // if we're including prereleases in the match, then we need
  9773. // to fix this to -0, the lowest possible prerelease value
  9774. pr = options.includePrerelease ? '-0' : ''
  9775. if (xM) {
  9776. if (gtlt === '>' || gtlt === '<') {
  9777. // nothing is allowed
  9778. ret = '<0.0.0-0'
  9779. } else {
  9780. // nothing is forbidden
  9781. ret = '*'
  9782. }
  9783. } else if (gtlt && anyX) {
  9784. // we know patch is an x, because we have any x at all.
  9785. // replace X with 0
  9786. if (xm) {
  9787. m = 0
  9788. }
  9789. p = 0
  9790. if (gtlt === '>') {
  9791. // >1 => >=2.0.0
  9792. // >1.2 => >=1.3.0
  9793. // >1.2.3 => >= 1.2.4
  9794. gtlt = '>='
  9795. if (xm) {
  9796. M = +M + 1
  9797. m = 0
  9798. p = 0
  9799. } else {
  9800. m = +m + 1
  9801. p = 0
  9802. }
  9803. } else if (gtlt === '<=') {
  9804. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  9805. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  9806. gtlt = '<'
  9807. if (xm) {
  9808. M = +M + 1
  9809. } else {
  9810. m = +m + 1
  9811. }
  9812. }
  9813. ret = gtlt + M + '.' + m + '.' + p + pr
  9814. } else if (xm) {
  9815. ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr
  9816. } else if (xp) {
  9817. ret = '>=' + M + '.' + m + '.0' + pr +
  9818. ' <' + M + '.' + (+m + 1) + '.0' + pr
  9819. }
  9820. debug('xRange return', ret)
  9821. return ret
  9822. })
  9823. }
  9824. // Because * is AND-ed with everything else in the comparator,
  9825. // and '' means "any version", just remove the *s entirely.
  9826. function replaceStars (comp, options) {
  9827. debug('replaceStars', comp, options)
  9828. // Looseness is ignored here. star is always as loose as it gets!
  9829. return comp.trim().replace(re[t.STAR], '')
  9830. }
  9831. // This function is passed to string.replace(re[t.HYPHENRANGE])
  9832. // M, m, patch, prerelease, build
  9833. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  9834. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  9835. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  9836. function hyphenReplace ($0,
  9837. from, fM, fm, fp, fpr, fb,
  9838. to, tM, tm, tp, tpr, tb) {
  9839. if (isX(fM)) {
  9840. from = ''
  9841. } else if (isX(fm)) {
  9842. from = '>=' + fM + '.0.0'
  9843. } else if (isX(fp)) {
  9844. from = '>=' + fM + '.' + fm + '.0'
  9845. } else {
  9846. from = '>=' + from
  9847. }
  9848. if (isX(tM)) {
  9849. to = ''
  9850. } else if (isX(tm)) {
  9851. to = '<' + (+tM + 1) + '.0.0'
  9852. } else if (isX(tp)) {
  9853. to = '<' + tM + '.' + (+tm + 1) + '.0'
  9854. } else if (tpr) {
  9855. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  9856. } else {
  9857. to = '<=' + to
  9858. }
  9859. return (from + ' ' + to).trim()
  9860. }
  9861. // if ANY of the sets match ALL of its comparators, then pass
  9862. Range.prototype.test = function (version) {
  9863. if (!version) {
  9864. return false
  9865. }
  9866. if (typeof version === 'string') {
  9867. try {
  9868. version = new SemVer(version, this.options)
  9869. } catch (er) {
  9870. return false
  9871. }
  9872. }
  9873. for (var i = 0; i < this.set.length; i++) {
  9874. if (testSet(this.set[i], version, this.options)) {
  9875. return true
  9876. }
  9877. }
  9878. return false
  9879. }
  9880. function testSet (set, version, options) {
  9881. for (var i = 0; i < set.length; i++) {
  9882. if (!set[i].test(version)) {
  9883. return false
  9884. }
  9885. }
  9886. if (version.prerelease.length && !options.includePrerelease) {
  9887. // Find the set of versions that are allowed to have prereleases
  9888. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  9889. // That should allow `1.2.3-pr.2` to pass.
  9890. // However, `1.2.4-alpha.notready` should NOT be allowed,
  9891. // even though it's within the range set by the comparators.
  9892. for (i = 0; i < set.length; i++) {
  9893. debug(set[i].semver)
  9894. if (set[i].semver === ANY) {
  9895. continue
  9896. }
  9897. if (set[i].semver.prerelease.length > 0) {
  9898. var allowed = set[i].semver
  9899. if (allowed.major === version.major &&
  9900. allowed.minor === version.minor &&
  9901. allowed.patch === version.patch) {
  9902. return true
  9903. }
  9904. }
  9905. }
  9906. // Version has a -pre, but it's not one of the ones we like.
  9907. return false
  9908. }
  9909. return true
  9910. }
  9911. exports.satisfies = satisfies
  9912. function satisfies (version, range, options) {
  9913. try {
  9914. range = new Range(range, options)
  9915. } catch (er) {
  9916. return false
  9917. }
  9918. return range.test(version)
  9919. }
  9920. exports.maxSatisfying = maxSatisfying
  9921. function maxSatisfying (versions, range, options) {
  9922. var max = null
  9923. var maxSV = null
  9924. try {
  9925. var rangeObj = new Range(range, options)
  9926. } catch (er) {
  9927. return null
  9928. }
  9929. versions.forEach(function (v) {
  9930. if (rangeObj.test(v)) {
  9931. // satisfies(v, range, options)
  9932. if (!max || maxSV.compare(v) === -1) {
  9933. // compare(max, v, true)
  9934. max = v
  9935. maxSV = new SemVer(max, options)
  9936. }
  9937. }
  9938. })
  9939. return max
  9940. }
  9941. exports.minSatisfying = minSatisfying
  9942. function minSatisfying (versions, range, options) {
  9943. var min = null
  9944. var minSV = null
  9945. try {
  9946. var rangeObj = new Range(range, options)
  9947. } catch (er) {
  9948. return null
  9949. }
  9950. versions.forEach(function (v) {
  9951. if (rangeObj.test(v)) {
  9952. // satisfies(v, range, options)
  9953. if (!min || minSV.compare(v) === 1) {
  9954. // compare(min, v, true)
  9955. min = v
  9956. minSV = new SemVer(min, options)
  9957. }
  9958. }
  9959. })
  9960. return min
  9961. }
  9962. exports.minVersion = minVersion
  9963. function minVersion (range, loose) {
  9964. range = new Range(range, loose)
  9965. var minver = new SemVer('0.0.0')
  9966. if (range.test(minver)) {
  9967. return minver
  9968. }
  9969. minver = new SemVer('0.0.0-0')
  9970. if (range.test(minver)) {
  9971. return minver
  9972. }
  9973. minver = null
  9974. for (var i = 0; i < range.set.length; ++i) {
  9975. var comparators = range.set[i]
  9976. comparators.forEach(function (comparator) {
  9977. // Clone to avoid manipulating the comparator's semver object.
  9978. var compver = new SemVer(comparator.semver.version)
  9979. switch (comparator.operator) {
  9980. case '>':
  9981. if (compver.prerelease.length === 0) {
  9982. compver.patch++
  9983. } else {
  9984. compver.prerelease.push(0)
  9985. }
  9986. compver.raw = compver.format()
  9987. /* fallthrough */
  9988. case '':
  9989. case '>=':
  9990. if (!minver || gt(minver, compver)) {
  9991. minver = compver
  9992. }
  9993. break
  9994. case '<':
  9995. case '<=':
  9996. /* Ignore maximum versions */
  9997. break
  9998. /* istanbul ignore next */
  9999. default:
  10000. throw new Error('Unexpected operation: ' + comparator.operator)
  10001. }
  10002. })
  10003. }
  10004. if (minver && range.test(minver)) {
  10005. return minver
  10006. }
  10007. return null
  10008. }
  10009. exports.validRange = validRange
  10010. function validRange (range, options) {
  10011. try {
  10012. // Return '*' instead of '' so that truthiness works.
  10013. // This will throw if it's invalid anyway
  10014. return new Range(range, options).range || '*'
  10015. } catch (er) {
  10016. return null
  10017. }
  10018. }
  10019. // Determine if version is less than all the versions possible in the range
  10020. exports.ltr = ltr
  10021. function ltr (version, range, options) {
  10022. return outside(version, range, '<', options)
  10023. }
  10024. // Determine if version is greater than all the versions possible in the range.
  10025. exports.gtr = gtr
  10026. function gtr (version, range, options) {
  10027. return outside(version, range, '>', options)
  10028. }
  10029. exports.outside = outside
  10030. function outside (version, range, hilo, options) {
  10031. version = new SemVer(version, options)
  10032. range = new Range(range, options)
  10033. var gtfn, ltefn, ltfn, comp, ecomp
  10034. switch (hilo) {
  10035. case '>':
  10036. gtfn = gt
  10037. ltefn = lte
  10038. ltfn = lt
  10039. comp = '>'
  10040. ecomp = '>='
  10041. break
  10042. case '<':
  10043. gtfn = lt
  10044. ltefn = gte
  10045. ltfn = gt
  10046. comp = '<'
  10047. ecomp = '<='
  10048. break
  10049. default:
  10050. throw new TypeError('Must provide a hilo val of "<" or ">"')
  10051. }
  10052. // If it satisifes the range it is not outside
  10053. if (satisfies(version, range, options)) {
  10054. return false
  10055. }
  10056. // From now on, variable terms are as if we're in "gtr" mode.
  10057. // but note that everything is flipped for the "ltr" function.
  10058. for (var i = 0; i < range.set.length; ++i) {
  10059. var comparators = range.set[i]
  10060. var high = null
  10061. var low = null
  10062. comparators.forEach(function (comparator) {
  10063. if (comparator.semver === ANY) {
  10064. comparator = new Comparator('>=0.0.0')
  10065. }
  10066. high = high || comparator
  10067. low = low || comparator
  10068. if (gtfn(comparator.semver, high.semver, options)) {
  10069. high = comparator
  10070. } else if (ltfn(comparator.semver, low.semver, options)) {
  10071. low = comparator
  10072. }
  10073. })
  10074. // If the edge version comparator has a operator then our version
  10075. // isn't outside it
  10076. if (high.operator === comp || high.operator === ecomp) {
  10077. return false
  10078. }
  10079. // If the lowest version comparator has an operator and our version
  10080. // is less than it then it isn't higher than the range
  10081. if ((!low.operator || low.operator === comp) &&
  10082. ltefn(version, low.semver)) {
  10083. return false
  10084. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  10085. return false
  10086. }
  10087. }
  10088. return true
  10089. }
  10090. exports.prerelease = prerelease
  10091. function prerelease (version, options) {
  10092. var parsed = parse(version, options)
  10093. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  10094. }
  10095. exports.intersects = intersects
  10096. function intersects (r1, r2, options) {
  10097. r1 = new Range(r1, options)
  10098. r2 = new Range(r2, options)
  10099. return r1.intersects(r2)
  10100. }
  10101. exports.coerce = coerce
  10102. function coerce (version, options) {
  10103. if (version instanceof SemVer) {
  10104. return version
  10105. }
  10106. if (typeof version === 'number') {
  10107. version = String(version)
  10108. }
  10109. if (typeof version !== 'string') {
  10110. return null
  10111. }
  10112. options = options || {}
  10113. var match = null
  10114. if (!options.rtl) {
  10115. match = version.match(re[t.COERCE])
  10116. } else {
  10117. // Find the right-most coercible string that does not share
  10118. // a terminus with a more left-ward coercible string.
  10119. // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
  10120. //
  10121. // Walk through the string checking with a /g regexp
  10122. // Manually set the index so as to pick up overlapping matches.
  10123. // Stop when we get a match that ends at the string end, since no
  10124. // coercible string can be more right-ward without the same terminus.
  10125. var next
  10126. while ((next = re[t.COERCERTL].exec(version)) &&
  10127. (!match || match.index + match[0].length !== version.length)
  10128. ) {
  10129. if (!match ||
  10130. next.index + next[0].length !== match.index + match[0].length) {
  10131. match = next
  10132. }
  10133. re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length
  10134. }
  10135. // leave it in a clean state
  10136. re[t.COERCERTL].lastIndex = -1
  10137. }
  10138. if (match === null) {
  10139. return null
  10140. }
  10141. return parse(match[2] +
  10142. '.' + (match[3] || '0') +
  10143. '.' + (match[4] || '0'), options)
  10144. }
  10145. /***/ }),
  10146. /***/ 669:
  10147. /***/ (function(module) {
  10148. module.exports = require("util");
  10149. /***/ }),
  10150. /***/ 672:
  10151. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  10152. "use strict";
  10153. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  10154. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  10155. return new (P || (P = Promise))(function (resolve, reject) {
  10156. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  10157. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  10158. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  10159. step((generator = generator.apply(thisArg, _arguments || [])).next());
  10160. });
  10161. };
  10162. var _a;
  10163. Object.defineProperty(exports, "__esModule", { value: true });
  10164. const assert_1 = __webpack_require__(357);
  10165. const fs = __webpack_require__(747);
  10166. const path = __webpack_require__(622);
  10167. _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;
  10168. exports.IS_WINDOWS = process.platform === 'win32';
  10169. function exists(fsPath) {
  10170. return __awaiter(this, void 0, void 0, function* () {
  10171. try {
  10172. yield exports.stat(fsPath);
  10173. }
  10174. catch (err) {
  10175. if (err.code === 'ENOENT') {
  10176. return false;
  10177. }
  10178. throw err;
  10179. }
  10180. return true;
  10181. });
  10182. }
  10183. exports.exists = exists;
  10184. function isDirectory(fsPath, useStat = false) {
  10185. return __awaiter(this, void 0, void 0, function* () {
  10186. const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath);
  10187. return stats.isDirectory();
  10188. });
  10189. }
  10190. exports.isDirectory = isDirectory;
  10191. /**
  10192. * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:
  10193. * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases).
  10194. */
  10195. function isRooted(p) {
  10196. p = normalizeSeparators(p);
  10197. if (!p) {
  10198. throw new Error('isRooted() parameter "p" cannot be empty');
  10199. }
  10200. if (exports.IS_WINDOWS) {
  10201. return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello
  10202. ); // e.g. C: or C:\hello
  10203. }
  10204. return p.startsWith('/');
  10205. }
  10206. exports.isRooted = isRooted;
  10207. /**
  10208. * Recursively create a directory at `fsPath`.
  10209. *
  10210. * This implementation is optimistic, meaning it attempts to create the full
  10211. * path first, and backs up the path stack from there.
  10212. *
  10213. * @param fsPath The path to create
  10214. * @param maxDepth The maximum recursion depth
  10215. * @param depth The current recursion depth
  10216. */
  10217. function mkdirP(fsPath, maxDepth = 1000, depth = 1) {
  10218. return __awaiter(this, void 0, void 0, function* () {
  10219. assert_1.ok(fsPath, 'a path argument must be provided');
  10220. fsPath = path.resolve(fsPath);
  10221. if (depth >= maxDepth)
  10222. return exports.mkdir(fsPath);
  10223. try {
  10224. yield exports.mkdir(fsPath);
  10225. return;
  10226. }
  10227. catch (err) {
  10228. switch (err.code) {
  10229. case 'ENOENT': {
  10230. yield mkdirP(path.dirname(fsPath), maxDepth, depth + 1);
  10231. yield exports.mkdir(fsPath);
  10232. return;
  10233. }
  10234. default: {
  10235. let stats;
  10236. try {
  10237. stats = yield exports.stat(fsPath);
  10238. }
  10239. catch (err2) {
  10240. throw err;
  10241. }
  10242. if (!stats.isDirectory())
  10243. throw err;
  10244. }
  10245. }
  10246. }
  10247. });
  10248. }
  10249. exports.mkdirP = mkdirP;
  10250. /**
  10251. * Best effort attempt to determine whether a file exists and is executable.
  10252. * @param filePath file path to check
  10253. * @param extensions additional file extensions to try
  10254. * @return if file exists and is executable, returns the file path. otherwise empty string.
  10255. */
  10256. function tryGetExecutablePath(filePath, extensions) {
  10257. return __awaiter(this, void 0, void 0, function* () {
  10258. let stats = undefined;
  10259. try {
  10260. // test file exists
  10261. stats = yield exports.stat(filePath);
  10262. }
  10263. catch (err) {
  10264. if (err.code !== 'ENOENT') {
  10265. // eslint-disable-next-line no-console
  10266. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  10267. }
  10268. }
  10269. if (stats && stats.isFile()) {
  10270. if (exports.IS_WINDOWS) {
  10271. // on Windows, test for valid extension
  10272. const upperExt = path.extname(filePath).toUpperCase();
  10273. if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) {
  10274. return filePath;
  10275. }
  10276. }
  10277. else {
  10278. if (isUnixExecutable(stats)) {
  10279. return filePath;
  10280. }
  10281. }
  10282. }
  10283. // try each extension
  10284. const originalFilePath = filePath;
  10285. for (const extension of extensions) {
  10286. filePath = originalFilePath + extension;
  10287. stats = undefined;
  10288. try {
  10289. stats = yield exports.stat(filePath);
  10290. }
  10291. catch (err) {
  10292. if (err.code !== 'ENOENT') {
  10293. // eslint-disable-next-line no-console
  10294. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  10295. }
  10296. }
  10297. if (stats && stats.isFile()) {
  10298. if (exports.IS_WINDOWS) {
  10299. // preserve the case of the actual file (since an extension was appended)
  10300. try {
  10301. const directory = path.dirname(filePath);
  10302. const upperName = path.basename(filePath).toUpperCase();
  10303. for (const actualName of yield exports.readdir(directory)) {
  10304. if (upperName === actualName.toUpperCase()) {
  10305. filePath = path.join(directory, actualName);
  10306. break;
  10307. }
  10308. }
  10309. }
  10310. catch (err) {
  10311. // eslint-disable-next-line no-console
  10312. console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`);
  10313. }
  10314. return filePath;
  10315. }
  10316. else {
  10317. if (isUnixExecutable(stats)) {
  10318. return filePath;
  10319. }
  10320. }
  10321. }
  10322. }
  10323. return '';
  10324. });
  10325. }
  10326. exports.tryGetExecutablePath = tryGetExecutablePath;
  10327. function normalizeSeparators(p) {
  10328. p = p || '';
  10329. if (exports.IS_WINDOWS) {
  10330. // convert slashes on Windows
  10331. p = p.replace(/\//g, '\\');
  10332. // remove redundant slashes
  10333. return p.replace(/\\\\+/g, '\\');
  10334. }
  10335. // remove redundant slashes
  10336. return p.replace(/\/\/+/g, '/');
  10337. }
  10338. // on Mac/Linux, test the execute bit
  10339. // R W X R W X R W X
  10340. // 256 128 64 32 16 8 4 2 1
  10341. function isUnixExecutable(stats) {
  10342. return ((stats.mode & 1) > 0 ||
  10343. ((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||
  10344. ((stats.mode & 64) > 0 && stats.uid === process.getuid()));
  10345. }
  10346. //# sourceMappingURL=io-util.js.map
  10347. /***/ }),
  10348. /***/ 674:
  10349. /***/ (function(module, __unusedexports, __webpack_require__) {
  10350. module.exports = authenticate;
  10351. const { Deprecation } = __webpack_require__(692);
  10352. const once = __webpack_require__(969);
  10353. const deprecateAuthenticate = once((log, deprecation) => log.warn(deprecation));
  10354. function authenticate(state, options) {
  10355. deprecateAuthenticate(
  10356. state.octokit.log,
  10357. new Deprecation(
  10358. '[@octokit/rest] octokit.authenticate() is deprecated. Use "auth" constructor option instead.'
  10359. )
  10360. );
  10361. if (!options) {
  10362. state.auth = false;
  10363. return;
  10364. }
  10365. switch (options.type) {
  10366. case "basic":
  10367. if (!options.username || !options.password) {
  10368. throw new Error(
  10369. "Basic authentication requires both a username and password to be set"
  10370. );
  10371. }
  10372. break;
  10373. case "oauth":
  10374. if (!options.token && !(options.key && options.secret)) {
  10375. throw new Error(
  10376. "OAuth2 authentication requires a token or key & secret to be set"
  10377. );
  10378. }
  10379. break;
  10380. case "token":
  10381. case "app":
  10382. if (!options.token) {
  10383. throw new Error("Token authentication requires a token to be set");
  10384. }
  10385. break;
  10386. default:
  10387. throw new Error(
  10388. "Invalid authentication type, must be 'basic', 'oauth', 'token' or 'app'"
  10389. );
  10390. }
  10391. state.auth = options;
  10392. }
  10393. /***/ }),
  10394. /***/ 675:
  10395. /***/ (function(module) {
  10396. module.exports = function btoa(str) {
  10397. return new Buffer(str).toString('base64')
  10398. }
  10399. /***/ }),
  10400. /***/ 692:
  10401. /***/ (function(__unusedmodule, exports) {
  10402. "use strict";
  10403. Object.defineProperty(exports, '__esModule', { value: true });
  10404. class Deprecation extends Error {
  10405. constructor(message) {
  10406. super(message); // Maintains proper stack trace (only available on V8)
  10407. /* istanbul ignore next */
  10408. if (Error.captureStackTrace) {
  10409. Error.captureStackTrace(this, this.constructor);
  10410. }
  10411. this.name = 'Deprecation';
  10412. }
  10413. }
  10414. exports.Deprecation = Deprecation;
  10415. /***/ }),
  10416. /***/ 696:
  10417. /***/ (function(module) {
  10418. "use strict";
  10419. /*!
  10420. * isobject <https://github.com/jonschlinkert/isobject>
  10421. *
  10422. * Copyright (c) 2014-2017, Jon Schlinkert.
  10423. * Released under the MIT License.
  10424. */
  10425. function isObject(val) {
  10426. return val != null && typeof val === 'object' && Array.isArray(val) === false;
  10427. }
  10428. /*!
  10429. * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
  10430. *
  10431. * Copyright (c) 2014-2017, Jon Schlinkert.
  10432. * Released under the MIT License.
  10433. */
  10434. function isObjectObject(o) {
  10435. return isObject(o) === true
  10436. && Object.prototype.toString.call(o) === '[object Object]';
  10437. }
  10438. function isPlainObject(o) {
  10439. var ctor,prot;
  10440. if (isObjectObject(o) === false) return false;
  10441. // If has modified constructor
  10442. ctor = o.constructor;
  10443. if (typeof ctor !== 'function') return false;
  10444. // If has modified prototype
  10445. prot = ctor.prototype;
  10446. if (isObjectObject(prot) === false) return false;
  10447. // If constructor does not have an Object-specific method
  10448. if (prot.hasOwnProperty('isPrototypeOf') === false) {
  10449. return false;
  10450. }
  10451. // Most likely a plain Object
  10452. return true;
  10453. }
  10454. module.exports = isPlainObject;
  10455. /***/ }),
  10456. /***/ 697:
  10457. /***/ (function(module) {
  10458. "use strict";
  10459. module.exports = (promise, onFinally) => {
  10460. onFinally = onFinally || (() => {});
  10461. return promise.then(
  10462. val => new Promise(resolve => {
  10463. resolve(onFinally());
  10464. }).then(() => val),
  10465. err => new Promise(resolve => {
  10466. resolve(onFinally());
  10467. }).then(() => {
  10468. throw err;
  10469. })
  10470. );
  10471. };
  10472. /***/ }),
  10473. /***/ 705:
  10474. /***/ (function(module) {
  10475. 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"}}};
  10476. /***/ }),
  10477. /***/ 722:
  10478. /***/ (function(module) {
  10479. /**
  10480. * Convert array of 16 byte values to UUID string format of the form:
  10481. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  10482. */
  10483. var byteToHex = [];
  10484. for (var i = 0; i < 256; ++i) {
  10485. byteToHex[i] = (i + 0x100).toString(16).substr(1);
  10486. }
  10487. function bytesToUuid(buf, offset) {
  10488. var i = offset || 0;
  10489. var bth = byteToHex;
  10490. // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
  10491. return ([bth[buf[i++]], bth[buf[i++]],
  10492. bth[buf[i++]], bth[buf[i++]], '-',
  10493. bth[buf[i++]], bth[buf[i++]], '-',
  10494. bth[buf[i++]], bth[buf[i++]], '-',
  10495. bth[buf[i++]], bth[buf[i++]], '-',
  10496. bth[buf[i++]], bth[buf[i++]],
  10497. bth[buf[i++]], bth[buf[i++]],
  10498. bth[buf[i++]], bth[buf[i++]]]).join('');
  10499. }
  10500. module.exports = bytesToUuid;
  10501. /***/ }),
  10502. /***/ 742:
  10503. /***/ (function(module, __unusedexports, __webpack_require__) {
  10504. var fs = __webpack_require__(747)
  10505. var core
  10506. if (process.platform === 'win32' || global.TESTING_WINDOWS) {
  10507. core = __webpack_require__(818)
  10508. } else {
  10509. core = __webpack_require__(197)
  10510. }
  10511. module.exports = isexe
  10512. isexe.sync = sync
  10513. function isexe (path, options, cb) {
  10514. if (typeof options === 'function') {
  10515. cb = options
  10516. options = {}
  10517. }
  10518. if (!cb) {
  10519. if (typeof Promise !== 'function') {
  10520. throw new TypeError('callback not provided')
  10521. }
  10522. return new Promise(function (resolve, reject) {
  10523. isexe(path, options || {}, function (er, is) {
  10524. if (er) {
  10525. reject(er)
  10526. } else {
  10527. resolve(is)
  10528. }
  10529. })
  10530. })
  10531. }
  10532. core(path, options || {}, function (er, is) {
  10533. // ignore EACCES because that just means we aren't allowed to run it
  10534. if (er) {
  10535. if (er.code === 'EACCES' || options && options.ignoreErrors) {
  10536. er = null
  10537. is = false
  10538. }
  10539. }
  10540. cb(er, is)
  10541. })
  10542. }
  10543. function sync (path, options) {
  10544. // my kingdom for a filtered catch
  10545. try {
  10546. return core.sync(path, options || {})
  10547. } catch (er) {
  10548. if (options && options.ignoreErrors || er.code === 'EACCES') {
  10549. return false
  10550. } else {
  10551. throw er
  10552. }
  10553. }
  10554. }
  10555. /***/ }),
  10556. /***/ 747:
  10557. /***/ (function(module) {
  10558. module.exports = require("fs");
  10559. /***/ }),
  10560. /***/ 753:
  10561. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  10562. "use strict";
  10563. Object.defineProperty(exports, '__esModule', { value: true });
  10564. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  10565. var endpoint = __webpack_require__(385);
  10566. var universalUserAgent = __webpack_require__(796);
  10567. var isPlainObject = _interopDefault(__webpack_require__(696));
  10568. var nodeFetch = _interopDefault(__webpack_require__(454));
  10569. var requestError = __webpack_require__(463);
  10570. const VERSION = "5.3.1";
  10571. function getBufferResponse(response) {
  10572. return response.arrayBuffer();
  10573. }
  10574. function fetchWrapper(requestOptions) {
  10575. if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {
  10576. requestOptions.body = JSON.stringify(requestOptions.body);
  10577. }
  10578. let headers = {};
  10579. let status;
  10580. let url;
  10581. const fetch = requestOptions.request && requestOptions.request.fetch || nodeFetch;
  10582. return fetch(requestOptions.url, Object.assign({
  10583. method: requestOptions.method,
  10584. body: requestOptions.body,
  10585. headers: requestOptions.headers,
  10586. redirect: requestOptions.redirect
  10587. }, requestOptions.request)).then(response => {
  10588. url = response.url;
  10589. status = response.status;
  10590. for (const keyAndValue of response.headers) {
  10591. headers[keyAndValue[0]] = keyAndValue[1];
  10592. }
  10593. if (status === 204 || status === 205) {
  10594. return;
  10595. } // GitHub API returns 200 for HEAD requsets
  10596. if (requestOptions.method === "HEAD") {
  10597. if (status < 400) {
  10598. return;
  10599. }
  10600. throw new requestError.RequestError(response.statusText, status, {
  10601. headers,
  10602. request: requestOptions
  10603. });
  10604. }
  10605. if (status === 304) {
  10606. throw new requestError.RequestError("Not modified", status, {
  10607. headers,
  10608. request: requestOptions
  10609. });
  10610. }
  10611. if (status >= 400) {
  10612. return response.text().then(message => {
  10613. const error = new requestError.RequestError(message, status, {
  10614. headers,
  10615. request: requestOptions
  10616. });
  10617. try {
  10618. let responseBody = JSON.parse(error.message);
  10619. Object.assign(error, responseBody);
  10620. let errors = responseBody.errors; // Assumption `errors` would always be in Array Fotmat
  10621. error.message = error.message + ": " + errors.map(JSON.stringify).join(", ");
  10622. } catch (e) {// ignore, see octokit/rest.js#684
  10623. }
  10624. throw error;
  10625. });
  10626. }
  10627. const contentType = response.headers.get("content-type");
  10628. if (/application\/json/.test(contentType)) {
  10629. return response.json();
  10630. }
  10631. if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) {
  10632. return response.text();
  10633. }
  10634. return getBufferResponse(response);
  10635. }).then(data => {
  10636. return {
  10637. status,
  10638. url,
  10639. headers,
  10640. data
  10641. };
  10642. }).catch(error => {
  10643. if (error instanceof requestError.RequestError) {
  10644. throw error;
  10645. }
  10646. throw new requestError.RequestError(error.message, 500, {
  10647. headers,
  10648. request: requestOptions
  10649. });
  10650. });
  10651. }
  10652. function withDefaults(oldEndpoint, newDefaults) {
  10653. const endpoint = oldEndpoint.defaults(newDefaults);
  10654. const newApi = function (route, parameters) {
  10655. const endpointOptions = endpoint.merge(route, parameters);
  10656. if (!endpointOptions.request || !endpointOptions.request.hook) {
  10657. return fetchWrapper(endpoint.parse(endpointOptions));
  10658. }
  10659. const request = (route, parameters) => {
  10660. return fetchWrapper(endpoint.parse(endpoint.merge(route, parameters)));
  10661. };
  10662. Object.assign(request, {
  10663. endpoint,
  10664. defaults: withDefaults.bind(null, endpoint)
  10665. });
  10666. return endpointOptions.request.hook(request, endpointOptions);
  10667. };
  10668. return Object.assign(newApi, {
  10669. endpoint,
  10670. defaults: withDefaults.bind(null, endpoint)
  10671. });
  10672. }
  10673. const request = withDefaults(endpoint.endpoint, {
  10674. headers: {
  10675. "user-agent": `octokit-request.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  10676. }
  10677. });
  10678. exports.request = request;
  10679. //# sourceMappingURL=index.js.map
  10680. /***/ }),
  10681. /***/ 761:
  10682. /***/ (function(module) {
  10683. module.exports = require("zlib");
  10684. /***/ }),
  10685. /***/ 763:
  10686. /***/ (function(module) {
  10687. module.exports = removeHook
  10688. function removeHook (state, name, method) {
  10689. if (!state.registry[name]) {
  10690. return
  10691. }
  10692. var index = state.registry[name]
  10693. .map(function (registered) { return registered.orig })
  10694. .indexOf(method)
  10695. if (index === -1) {
  10696. return
  10697. }
  10698. state.registry[name].splice(index, 1)
  10699. }
  10700. /***/ }),
  10701. /***/ 768:
  10702. /***/ (function(module) {
  10703. "use strict";
  10704. module.exports = function (x) {
  10705. var lf = typeof x === 'string' ? '\n' : '\n'.charCodeAt();
  10706. var cr = typeof x === 'string' ? '\r' : '\r'.charCodeAt();
  10707. if (x[x.length - 1] === lf) {
  10708. x = x.slice(0, x.length - 1);
  10709. }
  10710. if (x[x.length - 1] === cr) {
  10711. x = x.slice(0, x.length - 1);
  10712. }
  10713. return x;
  10714. };
  10715. /***/ }),
  10716. /***/ 777:
  10717. /***/ (function(module, __unusedexports, __webpack_require__) {
  10718. module.exports = getFirstPage
  10719. const getPage = __webpack_require__(265)
  10720. function getFirstPage (octokit, link, headers) {
  10721. return getPage(octokit, link, 'first', headers)
  10722. }
  10723. /***/ }),
  10724. /***/ 796:
  10725. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  10726. "use strict";
  10727. Object.defineProperty(exports, '__esModule', { value: true });
  10728. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  10729. var osName = _interopDefault(__webpack_require__(2));
  10730. function getUserAgent() {
  10731. try {
  10732. return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
  10733. } catch (error) {
  10734. if (/wmic os get Caption/.test(error.message)) {
  10735. return "Windows <version undetectable>";
  10736. }
  10737. throw error;
  10738. }
  10739. }
  10740. exports.getUserAgent = getUserAgent;
  10741. //# sourceMappingURL=index.js.map
  10742. /***/ }),
  10743. /***/ 807:
  10744. /***/ (function(module, __unusedexports, __webpack_require__) {
  10745. module.exports = paginate;
  10746. const iterator = __webpack_require__(8);
  10747. function paginate(octokit, route, options, mapFn) {
  10748. if (typeof options === "function") {
  10749. mapFn = options;
  10750. options = undefined;
  10751. }
  10752. options = octokit.request.endpoint.merge(route, options);
  10753. return gather(
  10754. octokit,
  10755. [],
  10756. iterator(octokit, options)[Symbol.asyncIterator](),
  10757. mapFn
  10758. );
  10759. }
  10760. function gather(octokit, results, iterator, mapFn) {
  10761. return iterator.next().then(result => {
  10762. if (result.done) {
  10763. return results;
  10764. }
  10765. let earlyExit = false;
  10766. function done() {
  10767. earlyExit = true;
  10768. }
  10769. results = results.concat(
  10770. mapFn ? mapFn(result.value, done) : result.value.data
  10771. );
  10772. if (earlyExit) {
  10773. return results;
  10774. }
  10775. return gather(octokit, results, iterator, mapFn);
  10776. });
  10777. }
  10778. /***/ }),
  10779. /***/ 814:
  10780. /***/ (function(module, __unusedexports, __webpack_require__) {
  10781. module.exports = which
  10782. which.sync = whichSync
  10783. var isWindows = process.platform === 'win32' ||
  10784. process.env.OSTYPE === 'cygwin' ||
  10785. process.env.OSTYPE === 'msys'
  10786. var path = __webpack_require__(622)
  10787. var COLON = isWindows ? ';' : ':'
  10788. var isexe = __webpack_require__(742)
  10789. function getNotFoundError (cmd) {
  10790. var er = new Error('not found: ' + cmd)
  10791. er.code = 'ENOENT'
  10792. return er
  10793. }
  10794. function getPathInfo (cmd, opt) {
  10795. var colon = opt.colon || COLON
  10796. var pathEnv = opt.path || process.env.PATH || ''
  10797. var pathExt = ['']
  10798. pathEnv = pathEnv.split(colon)
  10799. var pathExtExe = ''
  10800. if (isWindows) {
  10801. pathEnv.unshift(process.cwd())
  10802. pathExtExe = (opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM')
  10803. pathExt = pathExtExe.split(colon)
  10804. // Always test the cmd itself first. isexe will check to make sure
  10805. // it's found in the pathExt set.
  10806. if (cmd.indexOf('.') !== -1 && pathExt[0] !== '')
  10807. pathExt.unshift('')
  10808. }
  10809. // If it has a slash, then we don't bother searching the pathenv.
  10810. // just check the file itself, and that's it.
  10811. if (cmd.match(/\//) || isWindows && cmd.match(/\\/))
  10812. pathEnv = ['']
  10813. return {
  10814. env: pathEnv,
  10815. ext: pathExt,
  10816. extExe: pathExtExe
  10817. }
  10818. }
  10819. function which (cmd, opt, cb) {
  10820. if (typeof opt === 'function') {
  10821. cb = opt
  10822. opt = {}
  10823. }
  10824. var info = getPathInfo(cmd, opt)
  10825. var pathEnv = info.env
  10826. var pathExt = info.ext
  10827. var pathExtExe = info.extExe
  10828. var found = []
  10829. ;(function F (i, l) {
  10830. if (i === l) {
  10831. if (opt.all && found.length)
  10832. return cb(null, found)
  10833. else
  10834. return cb(getNotFoundError(cmd))
  10835. }
  10836. var pathPart = pathEnv[i]
  10837. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  10838. pathPart = pathPart.slice(1, -1)
  10839. var p = path.join(pathPart, cmd)
  10840. if (!pathPart && (/^\.[\\\/]/).test(cmd)) {
  10841. p = cmd.slice(0, 2) + p
  10842. }
  10843. ;(function E (ii, ll) {
  10844. if (ii === ll) return F(i + 1, l)
  10845. var ext = pathExt[ii]
  10846. isexe(p + ext, { pathExt: pathExtExe }, function (er, is) {
  10847. if (!er && is) {
  10848. if (opt.all)
  10849. found.push(p + ext)
  10850. else
  10851. return cb(null, p + ext)
  10852. }
  10853. return E(ii + 1, ll)
  10854. })
  10855. })(0, pathExt.length)
  10856. })(0, pathEnv.length)
  10857. }
  10858. function whichSync (cmd, opt) {
  10859. opt = opt || {}
  10860. var info = getPathInfo(cmd, opt)
  10861. var pathEnv = info.env
  10862. var pathExt = info.ext
  10863. var pathExtExe = info.extExe
  10864. var found = []
  10865. for (var i = 0, l = pathEnv.length; i < l; i ++) {
  10866. var pathPart = pathEnv[i]
  10867. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  10868. pathPart = pathPart.slice(1, -1)
  10869. var p = path.join(pathPart, cmd)
  10870. if (!pathPart && /^\.[\\\/]/.test(cmd)) {
  10871. p = cmd.slice(0, 2) + p
  10872. }
  10873. for (var j = 0, ll = pathExt.length; j < ll; j ++) {
  10874. var cur = p + pathExt[j]
  10875. var is
  10876. try {
  10877. is = isexe.sync(cur, { pathExt: pathExtExe })
  10878. if (is) {
  10879. if (opt.all)
  10880. found.push(cur)
  10881. else
  10882. return cur
  10883. }
  10884. } catch (ex) {}
  10885. }
  10886. }
  10887. if (opt.all && found.length)
  10888. return found
  10889. if (opt.nothrow)
  10890. return null
  10891. throw getNotFoundError(cmd)
  10892. }
  10893. /***/ }),
  10894. /***/ 816:
  10895. /***/ (function(module) {
  10896. "use strict";
  10897. module.exports = /^#!.*/;
  10898. /***/ }),
  10899. /***/ 818:
  10900. /***/ (function(module, __unusedexports, __webpack_require__) {
  10901. module.exports = isexe
  10902. isexe.sync = sync
  10903. var fs = __webpack_require__(747)
  10904. function checkPathExt (path, options) {
  10905. var pathext = options.pathExt !== undefined ?
  10906. options.pathExt : process.env.PATHEXT
  10907. if (!pathext) {
  10908. return true
  10909. }
  10910. pathext = pathext.split(';')
  10911. if (pathext.indexOf('') !== -1) {
  10912. return true
  10913. }
  10914. for (var i = 0; i < pathext.length; i++) {
  10915. var p = pathext[i].toLowerCase()
  10916. if (p && path.substr(-p.length).toLowerCase() === p) {
  10917. return true
  10918. }
  10919. }
  10920. return false
  10921. }
  10922. function checkStat (stat, path, options) {
  10923. if (!stat.isSymbolicLink() && !stat.isFile()) {
  10924. return false
  10925. }
  10926. return checkPathExt(path, options)
  10927. }
  10928. function isexe (path, options, cb) {
  10929. fs.stat(path, function (er, stat) {
  10930. cb(er, er ? false : checkStat(stat, path, options))
  10931. })
  10932. }
  10933. function sync (path, options) {
  10934. return checkStat(fs.statSync(path), path, options)
  10935. }
  10936. /***/ }),
  10937. /***/ 821:
  10938. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  10939. "use strict";
  10940. var __importStar = (this && this.__importStar) || function (mod) {
  10941. if (mod && mod.__esModule) return mod;
  10942. var result = {};
  10943. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  10944. result["default"] = mod;
  10945. return result;
  10946. };
  10947. Object.defineProperty(exports, "__esModule", { value: true });
  10948. const core = __importStar(__webpack_require__(470));
  10949. const fsHelper = __importStar(__webpack_require__(618));
  10950. const github = __importStar(__webpack_require__(469));
  10951. const path = __importStar(__webpack_require__(622));
  10952. function getInputs() {
  10953. const result = {};
  10954. // GitHub workspace
  10955. let githubWorkspacePath = process.env['GITHUB_WORKSPACE'];
  10956. if (!githubWorkspacePath) {
  10957. throw new Error('GITHUB_WORKSPACE not defined');
  10958. }
  10959. githubWorkspacePath = path.resolve(githubWorkspacePath);
  10960. core.debug(`GITHUB_WORKSPACE = '${githubWorkspacePath}'`);
  10961. fsHelper.directoryExistsSync(githubWorkspacePath, true);
  10962. // Qualified repository
  10963. const qualifiedRepository = core.getInput('repository') ||
  10964. `${github.context.repo.owner}/${github.context.repo.repo}`;
  10965. core.debug(`qualified repository = '${qualifiedRepository}'`);
  10966. const splitRepository = qualifiedRepository.split('/');
  10967. if (splitRepository.length !== 2 ||
  10968. !splitRepository[0] ||
  10969. !splitRepository[1]) {
  10970. throw new Error(`Invalid repository '${qualifiedRepository}'. Expected format {owner}/{repo}.`);
  10971. }
  10972. result.repositoryOwner = splitRepository[0];
  10973. result.repositoryName = splitRepository[1];
  10974. // Repository path
  10975. result.repositoryPath = core.getInput('path') || '.';
  10976. result.repositoryPath = path.resolve(githubWorkspacePath, result.repositoryPath);
  10977. if (!(result.repositoryPath + path.sep).startsWith(githubWorkspacePath + path.sep)) {
  10978. throw new Error(`Repository path '${result.repositoryPath}' is not under '${githubWorkspacePath}'`);
  10979. }
  10980. // Workflow repository?
  10981. const isWorkflowRepository = qualifiedRepository.toUpperCase() ===
  10982. `${github.context.repo.owner}/${github.context.repo.repo}`.toUpperCase();
  10983. // Source branch, source version
  10984. result.ref = core.getInput('ref');
  10985. if (!result.ref) {
  10986. if (isWorkflowRepository) {
  10987. result.ref = github.context.ref;
  10988. result.commit = github.context.sha;
  10989. }
  10990. if (!result.ref && !result.commit) {
  10991. result.ref = 'refs/heads/master';
  10992. }
  10993. }
  10994. // SHA?
  10995. else if (result.ref.match(/^[0-9a-fA-F]{40}$/)) {
  10996. result.commit = result.ref;
  10997. result.ref = '';
  10998. }
  10999. core.debug(`ref = '${result.ref}'`);
  11000. core.debug(`commit = '${result.commit}'`);
  11001. // Clean
  11002. result.clean = (core.getInput('clean') || 'true').toUpperCase() === 'TRUE';
  11003. core.debug(`clean = ${result.clean}`);
  11004. // Submodules
  11005. if (core.getInput('submodules')) {
  11006. throw new Error("The input 'submodules' is not supported in actions/checkout@v2");
  11007. }
  11008. // Fetch depth
  11009. result.fetchDepth = Math.floor(Number(core.getInput('fetch-depth') || '1'));
  11010. if (isNaN(result.fetchDepth) || result.fetchDepth < 0) {
  11011. result.fetchDepth = 0;
  11012. }
  11013. core.debug(`fetch depth = ${result.fetchDepth}`);
  11014. // LFS
  11015. result.lfs = (core.getInput('lfs') || 'false').toUpperCase() === 'TRUE';
  11016. core.debug(`lfs = ${result.lfs}`);
  11017. // Access token
  11018. result.accessToken = core.getInput('token');
  11019. return result;
  11020. }
  11021. exports.getInputs = getInputs;
  11022. /***/ }),
  11023. /***/ 826:
  11024. /***/ (function(module, __unusedexports, __webpack_require__) {
  11025. var rng = __webpack_require__(139);
  11026. var bytesToUuid = __webpack_require__(722);
  11027. function v4(options, buf, offset) {
  11028. var i = buf && offset || 0;
  11029. if (typeof(options) == 'string') {
  11030. buf = options === 'binary' ? new Array(16) : null;
  11031. options = null;
  11032. }
  11033. options = options || {};
  11034. var rnds = options.random || (options.rng || rng)();
  11035. // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  11036. rnds[6] = (rnds[6] & 0x0f) | 0x40;
  11037. rnds[8] = (rnds[8] & 0x3f) | 0x80;
  11038. // Copy bytes to buffer, if provided
  11039. if (buf) {
  11040. for (var ii = 0; ii < 16; ++ii) {
  11041. buf[i + ii] = rnds[ii];
  11042. }
  11043. }
  11044. return buf || bytesToUuid(rnds);
  11045. }
  11046. module.exports = v4;
  11047. /***/ }),
  11048. /***/ 835:
  11049. /***/ (function(module) {
  11050. module.exports = require("url");
  11051. /***/ }),
  11052. /***/ 850:
  11053. /***/ (function(module, __unusedexports, __webpack_require__) {
  11054. module.exports = paginationMethodsPlugin
  11055. function paginationMethodsPlugin (octokit) {
  11056. octokit.getFirstPage = __webpack_require__(777).bind(null, octokit)
  11057. octokit.getLastPage = __webpack_require__(649).bind(null, octokit)
  11058. octokit.getNextPage = __webpack_require__(550).bind(null, octokit)
  11059. octokit.getPreviousPage = __webpack_require__(563).bind(null, octokit)
  11060. octokit.hasFirstPage = __webpack_require__(536)
  11061. octokit.hasLastPage = __webpack_require__(336)
  11062. octokit.hasNextPage = __webpack_require__(929)
  11063. octokit.hasPreviousPage = __webpack_require__(558)
  11064. }
  11065. /***/ }),
  11066. /***/ 854:
  11067. /***/ (function(module) {
  11068. /**
  11069. * lodash (Custom Build) <https://lodash.com/>
  11070. * Build: `lodash modularize exports="npm" -o ./`
  11071. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  11072. * Released under MIT license <https://lodash.com/license>
  11073. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  11074. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  11075. */
  11076. /** Used as the `TypeError` message for "Functions" methods. */
  11077. var FUNC_ERROR_TEXT = 'Expected a function';
  11078. /** Used to stand-in for `undefined` hash values. */
  11079. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  11080. /** Used as references for various `Number` constants. */
  11081. var INFINITY = 1 / 0;
  11082. /** `Object#toString` result references. */
  11083. var funcTag = '[object Function]',
  11084. genTag = '[object GeneratorFunction]',
  11085. symbolTag = '[object Symbol]';
  11086. /** Used to match property names within property paths. */
  11087. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  11088. reIsPlainProp = /^\w*$/,
  11089. reLeadingDot = /^\./,
  11090. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  11091. /**
  11092. * Used to match `RegExp`
  11093. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  11094. */
  11095. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  11096. /** Used to match backslashes in property paths. */
  11097. var reEscapeChar = /\\(\\)?/g;
  11098. /** Used to detect host constructors (Safari). */
  11099. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  11100. /** Detect free variable `global` from Node.js. */
  11101. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  11102. /** Detect free variable `self`. */
  11103. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  11104. /** Used as a reference to the global object. */
  11105. var root = freeGlobal || freeSelf || Function('return this')();
  11106. /**
  11107. * Gets the value at `key` of `object`.
  11108. *
  11109. * @private
  11110. * @param {Object} [object] The object to query.
  11111. * @param {string} key The key of the property to get.
  11112. * @returns {*} Returns the property value.
  11113. */
  11114. function getValue(object, key) {
  11115. return object == null ? undefined : object[key];
  11116. }
  11117. /**
  11118. * Checks if `value` is a host object in IE < 9.
  11119. *
  11120. * @private
  11121. * @param {*} value The value to check.
  11122. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  11123. */
  11124. function isHostObject(value) {
  11125. // Many host objects are `Object` objects that can coerce to strings
  11126. // despite having improperly defined `toString` methods.
  11127. var result = false;
  11128. if (value != null && typeof value.toString != 'function') {
  11129. try {
  11130. result = !!(value + '');
  11131. } catch (e) {}
  11132. }
  11133. return result;
  11134. }
  11135. /** Used for built-in method references. */
  11136. var arrayProto = Array.prototype,
  11137. funcProto = Function.prototype,
  11138. objectProto = Object.prototype;
  11139. /** Used to detect overreaching core-js shims. */
  11140. var coreJsData = root['__core-js_shared__'];
  11141. /** Used to detect methods masquerading as native. */
  11142. var maskSrcKey = (function() {
  11143. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  11144. return uid ? ('Symbol(src)_1.' + uid) : '';
  11145. }());
  11146. /** Used to resolve the decompiled source of functions. */
  11147. var funcToString = funcProto.toString;
  11148. /** Used to check objects for own properties. */
  11149. var hasOwnProperty = objectProto.hasOwnProperty;
  11150. /**
  11151. * Used to resolve the
  11152. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  11153. * of values.
  11154. */
  11155. var objectToString = objectProto.toString;
  11156. /** Used to detect if a method is native. */
  11157. var reIsNative = RegExp('^' +
  11158. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  11159. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  11160. );
  11161. /** Built-in value references. */
  11162. var Symbol = root.Symbol,
  11163. splice = arrayProto.splice;
  11164. /* Built-in method references that are verified to be native. */
  11165. var Map = getNative(root, 'Map'),
  11166. nativeCreate = getNative(Object, 'create');
  11167. /** Used to convert symbols to primitives and strings. */
  11168. var symbolProto = Symbol ? Symbol.prototype : undefined,
  11169. symbolToString = symbolProto ? symbolProto.toString : undefined;
  11170. /**
  11171. * Creates a hash object.
  11172. *
  11173. * @private
  11174. * @constructor
  11175. * @param {Array} [entries] The key-value pairs to cache.
  11176. */
  11177. function Hash(entries) {
  11178. var index = -1,
  11179. length = entries ? entries.length : 0;
  11180. this.clear();
  11181. while (++index < length) {
  11182. var entry = entries[index];
  11183. this.set(entry[0], entry[1]);
  11184. }
  11185. }
  11186. /**
  11187. * Removes all key-value entries from the hash.
  11188. *
  11189. * @private
  11190. * @name clear
  11191. * @memberOf Hash
  11192. */
  11193. function hashClear() {
  11194. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  11195. }
  11196. /**
  11197. * Removes `key` and its value from the hash.
  11198. *
  11199. * @private
  11200. * @name delete
  11201. * @memberOf Hash
  11202. * @param {Object} hash The hash to modify.
  11203. * @param {string} key The key of the value to remove.
  11204. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  11205. */
  11206. function hashDelete(key) {
  11207. return this.has(key) && delete this.__data__[key];
  11208. }
  11209. /**
  11210. * Gets the hash value for `key`.
  11211. *
  11212. * @private
  11213. * @name get
  11214. * @memberOf Hash
  11215. * @param {string} key The key of the value to get.
  11216. * @returns {*} Returns the entry value.
  11217. */
  11218. function hashGet(key) {
  11219. var data = this.__data__;
  11220. if (nativeCreate) {
  11221. var result = data[key];
  11222. return result === HASH_UNDEFINED ? undefined : result;
  11223. }
  11224. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  11225. }
  11226. /**
  11227. * Checks if a hash value for `key` exists.
  11228. *
  11229. * @private
  11230. * @name has
  11231. * @memberOf Hash
  11232. * @param {string} key The key of the entry to check.
  11233. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  11234. */
  11235. function hashHas(key) {
  11236. var data = this.__data__;
  11237. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  11238. }
  11239. /**
  11240. * Sets the hash `key` to `value`.
  11241. *
  11242. * @private
  11243. * @name set
  11244. * @memberOf Hash
  11245. * @param {string} key The key of the value to set.
  11246. * @param {*} value The value to set.
  11247. * @returns {Object} Returns the hash instance.
  11248. */
  11249. function hashSet(key, value) {
  11250. var data = this.__data__;
  11251. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  11252. return this;
  11253. }
  11254. // Add methods to `Hash`.
  11255. Hash.prototype.clear = hashClear;
  11256. Hash.prototype['delete'] = hashDelete;
  11257. Hash.prototype.get = hashGet;
  11258. Hash.prototype.has = hashHas;
  11259. Hash.prototype.set = hashSet;
  11260. /**
  11261. * Creates an list cache object.
  11262. *
  11263. * @private
  11264. * @constructor
  11265. * @param {Array} [entries] The key-value pairs to cache.
  11266. */
  11267. function ListCache(entries) {
  11268. var index = -1,
  11269. length = entries ? entries.length : 0;
  11270. this.clear();
  11271. while (++index < length) {
  11272. var entry = entries[index];
  11273. this.set(entry[0], entry[1]);
  11274. }
  11275. }
  11276. /**
  11277. * Removes all key-value entries from the list cache.
  11278. *
  11279. * @private
  11280. * @name clear
  11281. * @memberOf ListCache
  11282. */
  11283. function listCacheClear() {
  11284. this.__data__ = [];
  11285. }
  11286. /**
  11287. * Removes `key` and its value from the list cache.
  11288. *
  11289. * @private
  11290. * @name delete
  11291. * @memberOf ListCache
  11292. * @param {string} key The key of the value to remove.
  11293. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  11294. */
  11295. function listCacheDelete(key) {
  11296. var data = this.__data__,
  11297. index = assocIndexOf(data, key);
  11298. if (index < 0) {
  11299. return false;
  11300. }
  11301. var lastIndex = data.length - 1;
  11302. if (index == lastIndex) {
  11303. data.pop();
  11304. } else {
  11305. splice.call(data, index, 1);
  11306. }
  11307. return true;
  11308. }
  11309. /**
  11310. * Gets the list cache value for `key`.
  11311. *
  11312. * @private
  11313. * @name get
  11314. * @memberOf ListCache
  11315. * @param {string} key The key of the value to get.
  11316. * @returns {*} Returns the entry value.
  11317. */
  11318. function listCacheGet(key) {
  11319. var data = this.__data__,
  11320. index = assocIndexOf(data, key);
  11321. return index < 0 ? undefined : data[index][1];
  11322. }
  11323. /**
  11324. * Checks if a list cache value for `key` exists.
  11325. *
  11326. * @private
  11327. * @name has
  11328. * @memberOf ListCache
  11329. * @param {string} key The key of the entry to check.
  11330. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  11331. */
  11332. function listCacheHas(key) {
  11333. return assocIndexOf(this.__data__, key) > -1;
  11334. }
  11335. /**
  11336. * Sets the list cache `key` to `value`.
  11337. *
  11338. * @private
  11339. * @name set
  11340. * @memberOf ListCache
  11341. * @param {string} key The key of the value to set.
  11342. * @param {*} value The value to set.
  11343. * @returns {Object} Returns the list cache instance.
  11344. */
  11345. function listCacheSet(key, value) {
  11346. var data = this.__data__,
  11347. index = assocIndexOf(data, key);
  11348. if (index < 0) {
  11349. data.push([key, value]);
  11350. } else {
  11351. data[index][1] = value;
  11352. }
  11353. return this;
  11354. }
  11355. // Add methods to `ListCache`.
  11356. ListCache.prototype.clear = listCacheClear;
  11357. ListCache.prototype['delete'] = listCacheDelete;
  11358. ListCache.prototype.get = listCacheGet;
  11359. ListCache.prototype.has = listCacheHas;
  11360. ListCache.prototype.set = listCacheSet;
  11361. /**
  11362. * Creates a map cache object to store key-value pairs.
  11363. *
  11364. * @private
  11365. * @constructor
  11366. * @param {Array} [entries] The key-value pairs to cache.
  11367. */
  11368. function MapCache(entries) {
  11369. var index = -1,
  11370. length = entries ? entries.length : 0;
  11371. this.clear();
  11372. while (++index < length) {
  11373. var entry = entries[index];
  11374. this.set(entry[0], entry[1]);
  11375. }
  11376. }
  11377. /**
  11378. * Removes all key-value entries from the map.
  11379. *
  11380. * @private
  11381. * @name clear
  11382. * @memberOf MapCache
  11383. */
  11384. function mapCacheClear() {
  11385. this.__data__ = {
  11386. 'hash': new Hash,
  11387. 'map': new (Map || ListCache),
  11388. 'string': new Hash
  11389. };
  11390. }
  11391. /**
  11392. * Removes `key` and its value from the map.
  11393. *
  11394. * @private
  11395. * @name delete
  11396. * @memberOf MapCache
  11397. * @param {string} key The key of the value to remove.
  11398. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  11399. */
  11400. function mapCacheDelete(key) {
  11401. return getMapData(this, key)['delete'](key);
  11402. }
  11403. /**
  11404. * Gets the map value for `key`.
  11405. *
  11406. * @private
  11407. * @name get
  11408. * @memberOf MapCache
  11409. * @param {string} key The key of the value to get.
  11410. * @returns {*} Returns the entry value.
  11411. */
  11412. function mapCacheGet(key) {
  11413. return getMapData(this, key).get(key);
  11414. }
  11415. /**
  11416. * Checks if a map value for `key` exists.
  11417. *
  11418. * @private
  11419. * @name has
  11420. * @memberOf MapCache
  11421. * @param {string} key The key of the entry to check.
  11422. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  11423. */
  11424. function mapCacheHas(key) {
  11425. return getMapData(this, key).has(key);
  11426. }
  11427. /**
  11428. * Sets the map `key` to `value`.
  11429. *
  11430. * @private
  11431. * @name set
  11432. * @memberOf MapCache
  11433. * @param {string} key The key of the value to set.
  11434. * @param {*} value The value to set.
  11435. * @returns {Object} Returns the map cache instance.
  11436. */
  11437. function mapCacheSet(key, value) {
  11438. getMapData(this, key).set(key, value);
  11439. return this;
  11440. }
  11441. // Add methods to `MapCache`.
  11442. MapCache.prototype.clear = mapCacheClear;
  11443. MapCache.prototype['delete'] = mapCacheDelete;
  11444. MapCache.prototype.get = mapCacheGet;
  11445. MapCache.prototype.has = mapCacheHas;
  11446. MapCache.prototype.set = mapCacheSet;
  11447. /**
  11448. * Gets the index at which the `key` is found in `array` of key-value pairs.
  11449. *
  11450. * @private
  11451. * @param {Array} array The array to inspect.
  11452. * @param {*} key The key to search for.
  11453. * @returns {number} Returns the index of the matched value, else `-1`.
  11454. */
  11455. function assocIndexOf(array, key) {
  11456. var length = array.length;
  11457. while (length--) {
  11458. if (eq(array[length][0], key)) {
  11459. return length;
  11460. }
  11461. }
  11462. return -1;
  11463. }
  11464. /**
  11465. * The base implementation of `_.get` without support for default values.
  11466. *
  11467. * @private
  11468. * @param {Object} object The object to query.
  11469. * @param {Array|string} path The path of the property to get.
  11470. * @returns {*} Returns the resolved value.
  11471. */
  11472. function baseGet(object, path) {
  11473. path = isKey(path, object) ? [path] : castPath(path);
  11474. var index = 0,
  11475. length = path.length;
  11476. while (object != null && index < length) {
  11477. object = object[toKey(path[index++])];
  11478. }
  11479. return (index && index == length) ? object : undefined;
  11480. }
  11481. /**
  11482. * The base implementation of `_.isNative` without bad shim checks.
  11483. *
  11484. * @private
  11485. * @param {*} value The value to check.
  11486. * @returns {boolean} Returns `true` if `value` is a native function,
  11487. * else `false`.
  11488. */
  11489. function baseIsNative(value) {
  11490. if (!isObject(value) || isMasked(value)) {
  11491. return false;
  11492. }
  11493. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  11494. return pattern.test(toSource(value));
  11495. }
  11496. /**
  11497. * The base implementation of `_.toString` which doesn't convert nullish
  11498. * values to empty strings.
  11499. *
  11500. * @private
  11501. * @param {*} value The value to process.
  11502. * @returns {string} Returns the string.
  11503. */
  11504. function baseToString(value) {
  11505. // Exit early for strings to avoid a performance hit in some environments.
  11506. if (typeof value == 'string') {
  11507. return value;
  11508. }
  11509. if (isSymbol(value)) {
  11510. return symbolToString ? symbolToString.call(value) : '';
  11511. }
  11512. var result = (value + '');
  11513. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  11514. }
  11515. /**
  11516. * Casts `value` to a path array if it's not one.
  11517. *
  11518. * @private
  11519. * @param {*} value The value to inspect.
  11520. * @returns {Array} Returns the cast property path array.
  11521. */
  11522. function castPath(value) {
  11523. return isArray(value) ? value : stringToPath(value);
  11524. }
  11525. /**
  11526. * Gets the data for `map`.
  11527. *
  11528. * @private
  11529. * @param {Object} map The map to query.
  11530. * @param {string} key The reference key.
  11531. * @returns {*} Returns the map data.
  11532. */
  11533. function getMapData(map, key) {
  11534. var data = map.__data__;
  11535. return isKeyable(key)
  11536. ? data[typeof key == 'string' ? 'string' : 'hash']
  11537. : data.map;
  11538. }
  11539. /**
  11540. * Gets the native function at `key` of `object`.
  11541. *
  11542. * @private
  11543. * @param {Object} object The object to query.
  11544. * @param {string} key The key of the method to get.
  11545. * @returns {*} Returns the function if it's native, else `undefined`.
  11546. */
  11547. function getNative(object, key) {
  11548. var value = getValue(object, key);
  11549. return baseIsNative(value) ? value : undefined;
  11550. }
  11551. /**
  11552. * Checks if `value` is a property name and not a property path.
  11553. *
  11554. * @private
  11555. * @param {*} value The value to check.
  11556. * @param {Object} [object] The object to query keys on.
  11557. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  11558. */
  11559. function isKey(value, object) {
  11560. if (isArray(value)) {
  11561. return false;
  11562. }
  11563. var type = typeof value;
  11564. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  11565. value == null || isSymbol(value)) {
  11566. return true;
  11567. }
  11568. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  11569. (object != null && value in Object(object));
  11570. }
  11571. /**
  11572. * Checks if `value` is suitable for use as unique object key.
  11573. *
  11574. * @private
  11575. * @param {*} value The value to check.
  11576. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  11577. */
  11578. function isKeyable(value) {
  11579. var type = typeof value;
  11580. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  11581. ? (value !== '__proto__')
  11582. : (value === null);
  11583. }
  11584. /**
  11585. * Checks if `func` has its source masked.
  11586. *
  11587. * @private
  11588. * @param {Function} func The function to check.
  11589. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  11590. */
  11591. function isMasked(func) {
  11592. return !!maskSrcKey && (maskSrcKey in func);
  11593. }
  11594. /**
  11595. * Converts `string` to a property path array.
  11596. *
  11597. * @private
  11598. * @param {string} string The string to convert.
  11599. * @returns {Array} Returns the property path array.
  11600. */
  11601. var stringToPath = memoize(function(string) {
  11602. string = toString(string);
  11603. var result = [];
  11604. if (reLeadingDot.test(string)) {
  11605. result.push('');
  11606. }
  11607. string.replace(rePropName, function(match, number, quote, string) {
  11608. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  11609. });
  11610. return result;
  11611. });
  11612. /**
  11613. * Converts `value` to a string key if it's not a string or symbol.
  11614. *
  11615. * @private
  11616. * @param {*} value The value to inspect.
  11617. * @returns {string|symbol} Returns the key.
  11618. */
  11619. function toKey(value) {
  11620. if (typeof value == 'string' || isSymbol(value)) {
  11621. return value;
  11622. }
  11623. var result = (value + '');
  11624. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  11625. }
  11626. /**
  11627. * Converts `func` to its source code.
  11628. *
  11629. * @private
  11630. * @param {Function} func The function to process.
  11631. * @returns {string} Returns the source code.
  11632. */
  11633. function toSource(func) {
  11634. if (func != null) {
  11635. try {
  11636. return funcToString.call(func);
  11637. } catch (e) {}
  11638. try {
  11639. return (func + '');
  11640. } catch (e) {}
  11641. }
  11642. return '';
  11643. }
  11644. /**
  11645. * Creates a function that memoizes the result of `func`. If `resolver` is
  11646. * provided, it determines the cache key for storing the result based on the
  11647. * arguments provided to the memoized function. By default, the first argument
  11648. * provided to the memoized function is used as the map cache key. The `func`
  11649. * is invoked with the `this` binding of the memoized function.
  11650. *
  11651. * **Note:** The cache is exposed as the `cache` property on the memoized
  11652. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  11653. * constructor with one whose instances implement the
  11654. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  11655. * method interface of `delete`, `get`, `has`, and `set`.
  11656. *
  11657. * @static
  11658. * @memberOf _
  11659. * @since 0.1.0
  11660. * @category Function
  11661. * @param {Function} func The function to have its output memoized.
  11662. * @param {Function} [resolver] The function to resolve the cache key.
  11663. * @returns {Function} Returns the new memoized function.
  11664. * @example
  11665. *
  11666. * var object = { 'a': 1, 'b': 2 };
  11667. * var other = { 'c': 3, 'd': 4 };
  11668. *
  11669. * var values = _.memoize(_.values);
  11670. * values(object);
  11671. * // => [1, 2]
  11672. *
  11673. * values(other);
  11674. * // => [3, 4]
  11675. *
  11676. * object.a = 2;
  11677. * values(object);
  11678. * // => [1, 2]
  11679. *
  11680. * // Modify the result cache.
  11681. * values.cache.set(object, ['a', 'b']);
  11682. * values(object);
  11683. * // => ['a', 'b']
  11684. *
  11685. * // Replace `_.memoize.Cache`.
  11686. * _.memoize.Cache = WeakMap;
  11687. */
  11688. function memoize(func, resolver) {
  11689. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  11690. throw new TypeError(FUNC_ERROR_TEXT);
  11691. }
  11692. var memoized = function() {
  11693. var args = arguments,
  11694. key = resolver ? resolver.apply(this, args) : args[0],
  11695. cache = memoized.cache;
  11696. if (cache.has(key)) {
  11697. return cache.get(key);
  11698. }
  11699. var result = func.apply(this, args);
  11700. memoized.cache = cache.set(key, result);
  11701. return result;
  11702. };
  11703. memoized.cache = new (memoize.Cache || MapCache);
  11704. return memoized;
  11705. }
  11706. // Assign cache to `_.memoize`.
  11707. memoize.Cache = MapCache;
  11708. /**
  11709. * Performs a
  11710. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  11711. * comparison between two values to determine if they are equivalent.
  11712. *
  11713. * @static
  11714. * @memberOf _
  11715. * @since 4.0.0
  11716. * @category Lang
  11717. * @param {*} value The value to compare.
  11718. * @param {*} other The other value to compare.
  11719. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11720. * @example
  11721. *
  11722. * var object = { 'a': 1 };
  11723. * var other = { 'a': 1 };
  11724. *
  11725. * _.eq(object, object);
  11726. * // => true
  11727. *
  11728. * _.eq(object, other);
  11729. * // => false
  11730. *
  11731. * _.eq('a', 'a');
  11732. * // => true
  11733. *
  11734. * _.eq('a', Object('a'));
  11735. * // => false
  11736. *
  11737. * _.eq(NaN, NaN);
  11738. * // => true
  11739. */
  11740. function eq(value, other) {
  11741. return value === other || (value !== value && other !== other);
  11742. }
  11743. /**
  11744. * Checks if `value` is classified as an `Array` object.
  11745. *
  11746. * @static
  11747. * @memberOf _
  11748. * @since 0.1.0
  11749. * @category Lang
  11750. * @param {*} value The value to check.
  11751. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  11752. * @example
  11753. *
  11754. * _.isArray([1, 2, 3]);
  11755. * // => true
  11756. *
  11757. * _.isArray(document.body.children);
  11758. * // => false
  11759. *
  11760. * _.isArray('abc');
  11761. * // => false
  11762. *
  11763. * _.isArray(_.noop);
  11764. * // => false
  11765. */
  11766. var isArray = Array.isArray;
  11767. /**
  11768. * Checks if `value` is classified as a `Function` object.
  11769. *
  11770. * @static
  11771. * @memberOf _
  11772. * @since 0.1.0
  11773. * @category Lang
  11774. * @param {*} value The value to check.
  11775. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  11776. * @example
  11777. *
  11778. * _.isFunction(_);
  11779. * // => true
  11780. *
  11781. * _.isFunction(/abc/);
  11782. * // => false
  11783. */
  11784. function isFunction(value) {
  11785. // The use of `Object#toString` avoids issues with the `typeof` operator
  11786. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  11787. var tag = isObject(value) ? objectToString.call(value) : '';
  11788. return tag == funcTag || tag == genTag;
  11789. }
  11790. /**
  11791. * Checks if `value` is the
  11792. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  11793. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  11794. *
  11795. * @static
  11796. * @memberOf _
  11797. * @since 0.1.0
  11798. * @category Lang
  11799. * @param {*} value The value to check.
  11800. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  11801. * @example
  11802. *
  11803. * _.isObject({});
  11804. * // => true
  11805. *
  11806. * _.isObject([1, 2, 3]);
  11807. * // => true
  11808. *
  11809. * _.isObject(_.noop);
  11810. * // => true
  11811. *
  11812. * _.isObject(null);
  11813. * // => false
  11814. */
  11815. function isObject(value) {
  11816. var type = typeof value;
  11817. return !!value && (type == 'object' || type == 'function');
  11818. }
  11819. /**
  11820. * Checks if `value` is object-like. A value is object-like if it's not `null`
  11821. * and has a `typeof` result of "object".
  11822. *
  11823. * @static
  11824. * @memberOf _
  11825. * @since 4.0.0
  11826. * @category Lang
  11827. * @param {*} value The value to check.
  11828. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  11829. * @example
  11830. *
  11831. * _.isObjectLike({});
  11832. * // => true
  11833. *
  11834. * _.isObjectLike([1, 2, 3]);
  11835. * // => true
  11836. *
  11837. * _.isObjectLike(_.noop);
  11838. * // => false
  11839. *
  11840. * _.isObjectLike(null);
  11841. * // => false
  11842. */
  11843. function isObjectLike(value) {
  11844. return !!value && typeof value == 'object';
  11845. }
  11846. /**
  11847. * Checks if `value` is classified as a `Symbol` primitive or object.
  11848. *
  11849. * @static
  11850. * @memberOf _
  11851. * @since 4.0.0
  11852. * @category Lang
  11853. * @param {*} value The value to check.
  11854. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  11855. * @example
  11856. *
  11857. * _.isSymbol(Symbol.iterator);
  11858. * // => true
  11859. *
  11860. * _.isSymbol('abc');
  11861. * // => false
  11862. */
  11863. function isSymbol(value) {
  11864. return typeof value == 'symbol' ||
  11865. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  11866. }
  11867. /**
  11868. * Converts `value` to a string. An empty string is returned for `null`
  11869. * and `undefined` values. The sign of `-0` is preserved.
  11870. *
  11871. * @static
  11872. * @memberOf _
  11873. * @since 4.0.0
  11874. * @category Lang
  11875. * @param {*} value The value to process.
  11876. * @returns {string} Returns the string.
  11877. * @example
  11878. *
  11879. * _.toString(null);
  11880. * // => ''
  11881. *
  11882. * _.toString(-0);
  11883. * // => '-0'
  11884. *
  11885. * _.toString([1, 2, 3]);
  11886. * // => '1,2,3'
  11887. */
  11888. function toString(value) {
  11889. return value == null ? '' : baseToString(value);
  11890. }
  11891. /**
  11892. * Gets the value at `path` of `object`. If the resolved value is
  11893. * `undefined`, the `defaultValue` is returned in its place.
  11894. *
  11895. * @static
  11896. * @memberOf _
  11897. * @since 3.7.0
  11898. * @category Object
  11899. * @param {Object} object The object to query.
  11900. * @param {Array|string} path The path of the property to get.
  11901. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  11902. * @returns {*} Returns the resolved value.
  11903. * @example
  11904. *
  11905. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  11906. *
  11907. * _.get(object, 'a[0].b.c');
  11908. * // => 3
  11909. *
  11910. * _.get(object, ['a', '0', 'b', 'c']);
  11911. * // => 3
  11912. *
  11913. * _.get(object, 'a.b.c', 'default');
  11914. * // => 'default'
  11915. */
  11916. function get(object, path, defaultValue) {
  11917. var result = object == null ? undefined : baseGet(object, path);
  11918. return result === undefined ? defaultValue : result;
  11919. }
  11920. module.exports = get;
  11921. /***/ }),
  11922. /***/ 855:
  11923. /***/ (function(module, __unusedexports, __webpack_require__) {
  11924. module.exports = registerPlugin;
  11925. const factory = __webpack_require__(47);
  11926. function registerPlugin(plugins, pluginFunction) {
  11927. return factory(
  11928. plugins.includes(pluginFunction) ? plugins : plugins.concat(pluginFunction)
  11929. );
  11930. }
  11931. /***/ }),
  11932. /***/ 856:
  11933. /***/ (function(module, __unusedexports, __webpack_require__) {
  11934. module.exports = __webpack_require__(141);
  11935. /***/ }),
  11936. /***/ 863:
  11937. /***/ (function(module, __unusedexports, __webpack_require__) {
  11938. module.exports = authenticationBeforeRequest;
  11939. const btoa = __webpack_require__(675);
  11940. const withAuthorizationPrefix = __webpack_require__(143);
  11941. function authenticationBeforeRequest(state, options) {
  11942. if (typeof state.auth === "string") {
  11943. options.headers.authorization = withAuthorizationPrefix(state.auth);
  11944. // https://developer.github.com/v3/previews/#integrations
  11945. if (
  11946. /^bearer /i.test(state.auth) &&
  11947. !/machine-man/.test(options.headers.accept)
  11948. ) {
  11949. const acceptHeaders = options.headers.accept
  11950. .split(",")
  11951. .concat("application/vnd.github.machine-man-preview+json");
  11952. options.headers.accept = acceptHeaders.filter(Boolean).join(",");
  11953. }
  11954. return;
  11955. }
  11956. if (state.auth.username) {
  11957. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  11958. options.headers.authorization = `Basic ${hash}`;
  11959. if (state.otp) {
  11960. options.headers["x-github-otp"] = state.otp;
  11961. }
  11962. return;
  11963. }
  11964. if (state.auth.clientId) {
  11965. // There is a special case for OAuth applications, when `clientId` and `clientSecret` is passed as
  11966. // Basic Authorization instead of query parameters. The only routes where that applies share the same
  11967. // URL though: `/applications/:client_id/tokens/:access_token`.
  11968. //
  11969. // 1. [Check an authorization](https://developer.github.com/v3/oauth_authorizations/#check-an-authorization)
  11970. // 2. [Reset an authorization](https://developer.github.com/v3/oauth_authorizations/#reset-an-authorization)
  11971. // 3. [Revoke an authorization for an application](https://developer.github.com/v3/oauth_authorizations/#revoke-an-authorization-for-an-application)
  11972. //
  11973. // We identify by checking the URL. It must merge both "/applications/:client_id/tokens/:access_token"
  11974. // as well as "/applications/123/tokens/token456"
  11975. if (/\/applications\/:?[\w_]+\/tokens\/:?[\w_]+($|\?)/.test(options.url)) {
  11976. const hash = btoa(`${state.auth.clientId}:${state.auth.clientSecret}`);
  11977. options.headers.authorization = `Basic ${hash}`;
  11978. return;
  11979. }
  11980. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  11981. options.url += `client_id=${state.auth.clientId}&client_secret=${state.auth.clientSecret}`;
  11982. return;
  11983. }
  11984. return Promise.resolve()
  11985. .then(() => {
  11986. return state.auth();
  11987. })
  11988. .then(authorization => {
  11989. options.headers.authorization = withAuthorizationPrefix(authorization);
  11990. });
  11991. }
  11992. /***/ }),
  11993. /***/ 866:
  11994. /***/ (function(module, __unusedexports, __webpack_require__) {
  11995. "use strict";
  11996. var shebangRegex = __webpack_require__(816);
  11997. module.exports = function (str) {
  11998. var match = str.match(shebangRegex);
  11999. if (!match) {
  12000. return null;
  12001. }
  12002. var arr = match[0].replace(/#! ?/, '').split(' ');
  12003. var bin = arr[0].split('/').pop();
  12004. var arg = arr[1];
  12005. return (bin === 'env' ?
  12006. arg :
  12007. bin + (arg ? ' ' + arg : '')
  12008. );
  12009. };
  12010. /***/ }),
  12011. /***/ 874:
  12012. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  12013. "use strict";
  12014. // Copyright (c) Microsoft. All rights reserved.
  12015. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
  12016. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  12017. return new (P || (P = Promise))(function (resolve, reject) {
  12018. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  12019. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  12020. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  12021. step((generator = generator.apply(thisArg, _arguments || [])).next());
  12022. });
  12023. };
  12024. Object.defineProperty(exports, "__esModule", { value: true });
  12025. const url = __webpack_require__(835);
  12026. const http = __webpack_require__(605);
  12027. const https = __webpack_require__(211);
  12028. let fs;
  12029. let tunnel;
  12030. var HttpCodes;
  12031. (function (HttpCodes) {
  12032. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  12033. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  12034. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  12035. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  12036. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  12037. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  12038. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  12039. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  12040. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  12041. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  12042. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  12043. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  12044. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  12045. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  12046. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  12047. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  12048. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  12049. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  12050. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  12051. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  12052. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  12053. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  12054. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  12055. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  12056. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  12057. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  12058. })(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
  12059. const HttpRedirectCodes = [HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect];
  12060. const HttpResponseRetryCodes = [HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout];
  12061. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  12062. const ExponentialBackoffCeiling = 10;
  12063. const ExponentialBackoffTimeSlice = 5;
  12064. class HttpClientResponse {
  12065. constructor(message) {
  12066. this.message = message;
  12067. }
  12068. readBody() {
  12069. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  12070. let output = '';
  12071. this.message.on('data', (chunk) => {
  12072. output += chunk;
  12073. });
  12074. this.message.on('end', () => {
  12075. resolve(output);
  12076. });
  12077. }));
  12078. }
  12079. }
  12080. exports.HttpClientResponse = HttpClientResponse;
  12081. function isHttps(requestUrl) {
  12082. let parsedUrl = url.parse(requestUrl);
  12083. return parsedUrl.protocol === 'https:';
  12084. }
  12085. exports.isHttps = isHttps;
  12086. var EnvironmentVariables;
  12087. (function (EnvironmentVariables) {
  12088. EnvironmentVariables["HTTP_PROXY"] = "HTTP_PROXY";
  12089. EnvironmentVariables["HTTPS_PROXY"] = "HTTPS_PROXY";
  12090. })(EnvironmentVariables || (EnvironmentVariables = {}));
  12091. class HttpClient {
  12092. constructor(userAgent, handlers, requestOptions) {
  12093. this._ignoreSslError = false;
  12094. this._allowRedirects = true;
  12095. this._maxRedirects = 50;
  12096. this._allowRetries = false;
  12097. this._maxRetries = 1;
  12098. this._keepAlive = false;
  12099. this._disposed = false;
  12100. this.userAgent = userAgent;
  12101. this.handlers = handlers || [];
  12102. this.requestOptions = requestOptions;
  12103. if (requestOptions) {
  12104. if (requestOptions.ignoreSslError != null) {
  12105. this._ignoreSslError = requestOptions.ignoreSslError;
  12106. }
  12107. this._socketTimeout = requestOptions.socketTimeout;
  12108. this._httpProxy = requestOptions.proxy;
  12109. if (requestOptions.proxy && requestOptions.proxy.proxyBypassHosts) {
  12110. this._httpProxyBypassHosts = [];
  12111. requestOptions.proxy.proxyBypassHosts.forEach(bypass => {
  12112. this._httpProxyBypassHosts.push(new RegExp(bypass, 'i'));
  12113. });
  12114. }
  12115. this._certConfig = requestOptions.cert;
  12116. if (this._certConfig) {
  12117. // If using cert, need fs
  12118. fs = __webpack_require__(747);
  12119. // cache the cert content into memory, so we don't have to read it from disk every time
  12120. if (this._certConfig.caFile && fs.existsSync(this._certConfig.caFile)) {
  12121. this._ca = fs.readFileSync(this._certConfig.caFile, 'utf8');
  12122. }
  12123. if (this._certConfig.certFile && fs.existsSync(this._certConfig.certFile)) {
  12124. this._cert = fs.readFileSync(this._certConfig.certFile, 'utf8');
  12125. }
  12126. if (this._certConfig.keyFile && fs.existsSync(this._certConfig.keyFile)) {
  12127. this._key = fs.readFileSync(this._certConfig.keyFile, 'utf8');
  12128. }
  12129. }
  12130. if (requestOptions.allowRedirects != null) {
  12131. this._allowRedirects = requestOptions.allowRedirects;
  12132. }
  12133. if (requestOptions.maxRedirects != null) {
  12134. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  12135. }
  12136. if (requestOptions.keepAlive != null) {
  12137. this._keepAlive = requestOptions.keepAlive;
  12138. }
  12139. if (requestOptions.allowRetries != null) {
  12140. this._allowRetries = requestOptions.allowRetries;
  12141. }
  12142. if (requestOptions.maxRetries != null) {
  12143. this._maxRetries = requestOptions.maxRetries;
  12144. }
  12145. }
  12146. }
  12147. options(requestUrl, additionalHeaders) {
  12148. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  12149. }
  12150. get(requestUrl, additionalHeaders) {
  12151. return this.request('GET', requestUrl, null, additionalHeaders || {});
  12152. }
  12153. del(requestUrl, additionalHeaders) {
  12154. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  12155. }
  12156. post(requestUrl, data, additionalHeaders) {
  12157. return this.request('POST', requestUrl, data, additionalHeaders || {});
  12158. }
  12159. patch(requestUrl, data, additionalHeaders) {
  12160. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  12161. }
  12162. put(requestUrl, data, additionalHeaders) {
  12163. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  12164. }
  12165. head(requestUrl, additionalHeaders) {
  12166. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  12167. }
  12168. sendStream(verb, requestUrl, stream, additionalHeaders) {
  12169. return this.request(verb, requestUrl, stream, additionalHeaders);
  12170. }
  12171. /**
  12172. * Makes a raw http request.
  12173. * All other methods such as get, post, patch, and request ultimately call this.
  12174. * Prefer get, del, post and patch
  12175. */
  12176. request(verb, requestUrl, data, headers) {
  12177. return __awaiter(this, void 0, void 0, function* () {
  12178. if (this._disposed) {
  12179. throw new Error("Client has already been disposed.");
  12180. }
  12181. let info = this._prepareRequest(verb, requestUrl, headers);
  12182. // Only perform retries on reads since writes may not be idempotent.
  12183. let maxTries = (this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1) ? this._maxRetries + 1 : 1;
  12184. let numTries = 0;
  12185. let response;
  12186. while (numTries < maxTries) {
  12187. response = yield this.requestRaw(info, data);
  12188. // Check if it's an authentication challenge
  12189. if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) {
  12190. let authenticationHandler;
  12191. for (let i = 0; i < this.handlers.length; i++) {
  12192. if (this.handlers[i].canHandleAuthentication(response)) {
  12193. authenticationHandler = this.handlers[i];
  12194. break;
  12195. }
  12196. }
  12197. if (authenticationHandler) {
  12198. return authenticationHandler.handleAuthentication(this, info, data);
  12199. }
  12200. else {
  12201. // We have received an unauthorized response but have no handlers to handle it.
  12202. // Let the response return to the caller.
  12203. return response;
  12204. }
  12205. }
  12206. let redirectsRemaining = this._maxRedirects;
  12207. while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1
  12208. && this._allowRedirects
  12209. && redirectsRemaining > 0) {
  12210. const redirectUrl = response.message.headers["location"];
  12211. if (!redirectUrl) {
  12212. // if there's no location to redirect to, we won't
  12213. break;
  12214. }
  12215. // we need to finish reading the response before reassigning response
  12216. // which will leak the open socket.
  12217. yield response.readBody();
  12218. // let's make the request with the new redirectUrl
  12219. info = this._prepareRequest(verb, redirectUrl, headers);
  12220. response = yield this.requestRaw(info, data);
  12221. redirectsRemaining--;
  12222. }
  12223. if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {
  12224. // If not a retry code, return immediately instead of retrying
  12225. return response;
  12226. }
  12227. numTries += 1;
  12228. if (numTries < maxTries) {
  12229. yield response.readBody();
  12230. yield this._performExponentialBackoff(numTries);
  12231. }
  12232. }
  12233. return response;
  12234. });
  12235. }
  12236. /**
  12237. * Needs to be called if keepAlive is set to true in request options.
  12238. */
  12239. dispose() {
  12240. if (this._agent) {
  12241. this._agent.destroy();
  12242. }
  12243. this._disposed = true;
  12244. }
  12245. /**
  12246. * Raw request.
  12247. * @param info
  12248. * @param data
  12249. */
  12250. requestRaw(info, data) {
  12251. return new Promise((resolve, reject) => {
  12252. let callbackForResult = function (err, res) {
  12253. if (err) {
  12254. reject(err);
  12255. }
  12256. resolve(res);
  12257. };
  12258. this.requestRawWithCallback(info, data, callbackForResult);
  12259. });
  12260. }
  12261. /**
  12262. * Raw request with callback.
  12263. * @param info
  12264. * @param data
  12265. * @param onResult
  12266. */
  12267. requestRawWithCallback(info, data, onResult) {
  12268. let socket;
  12269. let isDataString = typeof (data) === 'string';
  12270. if (typeof (data) === 'string') {
  12271. info.options.headers["Content-Length"] = Buffer.byteLength(data, 'utf8');
  12272. }
  12273. let callbackCalled = false;
  12274. let handleResult = (err, res) => {
  12275. if (!callbackCalled) {
  12276. callbackCalled = true;
  12277. onResult(err, res);
  12278. }
  12279. };
  12280. let req = info.httpModule.request(info.options, (msg) => {
  12281. let res = new HttpClientResponse(msg);
  12282. handleResult(null, res);
  12283. });
  12284. req.on('socket', (sock) => {
  12285. socket = sock;
  12286. });
  12287. // If we ever get disconnected, we want the socket to timeout eventually
  12288. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  12289. if (socket) {
  12290. socket.end();
  12291. }
  12292. handleResult(new Error('Request timeout: ' + info.options.path), null);
  12293. });
  12294. req.on('error', function (err) {
  12295. // err has statusCode property
  12296. // res should have headers
  12297. handleResult(err, null);
  12298. });
  12299. if (data && typeof (data) === 'string') {
  12300. req.write(data, 'utf8');
  12301. }
  12302. if (data && typeof (data) !== 'string') {
  12303. data.on('close', function () {
  12304. req.end();
  12305. });
  12306. data.pipe(req);
  12307. }
  12308. else {
  12309. req.end();
  12310. }
  12311. }
  12312. _prepareRequest(method, requestUrl, headers) {
  12313. const info = {};
  12314. info.parsedUrl = url.parse(requestUrl);
  12315. const usingSsl = info.parsedUrl.protocol === 'https:';
  12316. info.httpModule = usingSsl ? https : http;
  12317. const defaultPort = usingSsl ? 443 : 80;
  12318. info.options = {};
  12319. info.options.host = info.parsedUrl.hostname;
  12320. info.options.port = info.parsedUrl.port ? parseInt(info.parsedUrl.port) : defaultPort;
  12321. info.options.path = (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  12322. info.options.method = method;
  12323. info.options.headers = this._mergeHeaders(headers);
  12324. info.options.headers["user-agent"] = this.userAgent;
  12325. info.options.agent = this._getAgent(requestUrl);
  12326. // gives handlers an opportunity to participate
  12327. if (this.handlers && !this._isPresigned(requestUrl)) {
  12328. this.handlers.forEach((handler) => {
  12329. handler.prepareRequest(info.options);
  12330. });
  12331. }
  12332. return info;
  12333. }
  12334. _isPresigned(requestUrl) {
  12335. if (this.requestOptions && this.requestOptions.presignedUrlPatterns) {
  12336. const patterns = this.requestOptions.presignedUrlPatterns;
  12337. for (let i = 0; i < patterns.length; i++) {
  12338. if (requestUrl.match(patterns[i])) {
  12339. return true;
  12340. }
  12341. }
  12342. }
  12343. return false;
  12344. }
  12345. _mergeHeaders(headers) {
  12346. const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {});
  12347. if (this.requestOptions && this.requestOptions.headers) {
  12348. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
  12349. }
  12350. return lowercaseKeys(headers || {});
  12351. }
  12352. _getAgent(requestUrl) {
  12353. let agent;
  12354. let proxy = this._getProxy(requestUrl);
  12355. let useProxy = proxy.proxyUrl && proxy.proxyUrl.hostname && !this._isBypassProxy(requestUrl);
  12356. if (this._keepAlive && useProxy) {
  12357. agent = this._proxyAgent;
  12358. }
  12359. if (this._keepAlive && !useProxy) {
  12360. agent = this._agent;
  12361. }
  12362. // if agent is already assigned use that agent.
  12363. if (!!agent) {
  12364. return agent;
  12365. }
  12366. let parsedUrl = url.parse(requestUrl);
  12367. const usingSsl = parsedUrl.protocol === 'https:';
  12368. let maxSockets = 100;
  12369. if (!!this.requestOptions) {
  12370. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  12371. }
  12372. if (useProxy) {
  12373. // If using proxy, need tunnel
  12374. if (!tunnel) {
  12375. tunnel = __webpack_require__(856);
  12376. }
  12377. const agentOptions = {
  12378. maxSockets: maxSockets,
  12379. keepAlive: this._keepAlive,
  12380. proxy: {
  12381. proxyAuth: proxy.proxyAuth,
  12382. host: proxy.proxyUrl.hostname,
  12383. port: proxy.proxyUrl.port
  12384. },
  12385. };
  12386. let tunnelAgent;
  12387. const overHttps = proxy.proxyUrl.protocol === 'https:';
  12388. if (usingSsl) {
  12389. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  12390. }
  12391. else {
  12392. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  12393. }
  12394. agent = tunnelAgent(agentOptions);
  12395. this._proxyAgent = agent;
  12396. }
  12397. // if reusing agent across request and tunneling agent isn't assigned create a new agent
  12398. if (this._keepAlive && !agent) {
  12399. const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };
  12400. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  12401. this._agent = agent;
  12402. }
  12403. // if not using private agent and tunnel agent isn't setup then use global agent
  12404. if (!agent) {
  12405. agent = usingSsl ? https.globalAgent : http.globalAgent;
  12406. }
  12407. if (usingSsl && this._ignoreSslError) {
  12408. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  12409. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  12410. // we have to cast it to any and change it directly
  12411. agent.options = Object.assign(agent.options || {}, { rejectUnauthorized: false });
  12412. }
  12413. if (usingSsl && this._certConfig) {
  12414. agent.options = Object.assign(agent.options || {}, { ca: this._ca, cert: this._cert, key: this._key, passphrase: this._certConfig.passphrase });
  12415. }
  12416. return agent;
  12417. }
  12418. _getProxy(requestUrl) {
  12419. const parsedUrl = url.parse(requestUrl);
  12420. let usingSsl = parsedUrl.protocol === 'https:';
  12421. let proxyConfig = this._httpProxy;
  12422. // fallback to http_proxy and https_proxy env
  12423. let https_proxy = process.env[EnvironmentVariables.HTTPS_PROXY];
  12424. let http_proxy = process.env[EnvironmentVariables.HTTP_PROXY];
  12425. if (!proxyConfig) {
  12426. if (https_proxy && usingSsl) {
  12427. proxyConfig = {
  12428. proxyUrl: https_proxy
  12429. };
  12430. }
  12431. else if (http_proxy) {
  12432. proxyConfig = {
  12433. proxyUrl: http_proxy
  12434. };
  12435. }
  12436. }
  12437. let proxyUrl;
  12438. let proxyAuth;
  12439. if (proxyConfig) {
  12440. if (proxyConfig.proxyUrl.length > 0) {
  12441. proxyUrl = url.parse(proxyConfig.proxyUrl);
  12442. }
  12443. if (proxyConfig.proxyUsername || proxyConfig.proxyPassword) {
  12444. proxyAuth = proxyConfig.proxyUsername + ":" + proxyConfig.proxyPassword;
  12445. }
  12446. }
  12447. return { proxyUrl: proxyUrl, proxyAuth: proxyAuth };
  12448. }
  12449. _isBypassProxy(requestUrl) {
  12450. if (!this._httpProxyBypassHosts) {
  12451. return false;
  12452. }
  12453. let bypass = false;
  12454. this._httpProxyBypassHosts.forEach(bypassHost => {
  12455. if (bypassHost.test(requestUrl)) {
  12456. bypass = true;
  12457. }
  12458. });
  12459. return bypass;
  12460. }
  12461. _performExponentialBackoff(retryNumber) {
  12462. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  12463. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  12464. return new Promise(resolve => setTimeout(() => resolve(), ms));
  12465. }
  12466. }
  12467. exports.HttpClient = HttpClient;
  12468. /***/ }),
  12469. /***/ 881:
  12470. /***/ (function(module) {
  12471. "use strict";
  12472. const isWin = process.platform === 'win32';
  12473. function notFoundError(original, syscall) {
  12474. return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
  12475. code: 'ENOENT',
  12476. errno: 'ENOENT',
  12477. syscall: `${syscall} ${original.command}`,
  12478. path: original.command,
  12479. spawnargs: original.args,
  12480. });
  12481. }
  12482. function hookChildProcess(cp, parsed) {
  12483. if (!isWin) {
  12484. return;
  12485. }
  12486. const originalEmit = cp.emit;
  12487. cp.emit = function (name, arg1) {
  12488. // If emitting "exit" event and exit code is 1, we need to check if
  12489. // the command exists and emit an "error" instead
  12490. // See https://github.com/IndigoUnited/node-cross-spawn/issues/16
  12491. if (name === 'exit') {
  12492. const err = verifyENOENT(arg1, parsed, 'spawn');
  12493. if (err) {
  12494. return originalEmit.call(cp, 'error', err);
  12495. }
  12496. }
  12497. return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params
  12498. };
  12499. }
  12500. function verifyENOENT(status, parsed) {
  12501. if (isWin && status === 1 && !parsed.file) {
  12502. return notFoundError(parsed.original, 'spawn');
  12503. }
  12504. return null;
  12505. }
  12506. function verifyENOENTSync(status, parsed) {
  12507. if (isWin && status === 1 && !parsed.file) {
  12508. return notFoundError(parsed.original, 'spawnSync');
  12509. }
  12510. return null;
  12511. }
  12512. module.exports = {
  12513. hookChildProcess,
  12514. verifyENOENT,
  12515. verifyENOENTSync,
  12516. notFoundError,
  12517. };
  12518. /***/ }),
  12519. /***/ 883:
  12520. /***/ (function(module) {
  12521. /**
  12522. * lodash (Custom Build) <https://lodash.com/>
  12523. * Build: `lodash modularize exports="npm" -o ./`
  12524. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  12525. * Released under MIT license <https://lodash.com/license>
  12526. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  12527. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  12528. */
  12529. /** Used as the `TypeError` message for "Functions" methods. */
  12530. var FUNC_ERROR_TEXT = 'Expected a function';
  12531. /** Used to stand-in for `undefined` hash values. */
  12532. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  12533. /** Used as references for various `Number` constants. */
  12534. var INFINITY = 1 / 0,
  12535. MAX_SAFE_INTEGER = 9007199254740991;
  12536. /** `Object#toString` result references. */
  12537. var funcTag = '[object Function]',
  12538. genTag = '[object GeneratorFunction]',
  12539. symbolTag = '[object Symbol]';
  12540. /** Used to match property names within property paths. */
  12541. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  12542. reIsPlainProp = /^\w*$/,
  12543. reLeadingDot = /^\./,
  12544. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  12545. /**
  12546. * Used to match `RegExp`
  12547. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  12548. */
  12549. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  12550. /** Used to match backslashes in property paths. */
  12551. var reEscapeChar = /\\(\\)?/g;
  12552. /** Used to detect host constructors (Safari). */
  12553. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  12554. /** Used to detect unsigned integer values. */
  12555. var reIsUint = /^(?:0|[1-9]\d*)$/;
  12556. /** Detect free variable `global` from Node.js. */
  12557. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  12558. /** Detect free variable `self`. */
  12559. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  12560. /** Used as a reference to the global object. */
  12561. var root = freeGlobal || freeSelf || Function('return this')();
  12562. /**
  12563. * Gets the value at `key` of `object`.
  12564. *
  12565. * @private
  12566. * @param {Object} [object] The object to query.
  12567. * @param {string} key The key of the property to get.
  12568. * @returns {*} Returns the property value.
  12569. */
  12570. function getValue(object, key) {
  12571. return object == null ? undefined : object[key];
  12572. }
  12573. /**
  12574. * Checks if `value` is a host object in IE < 9.
  12575. *
  12576. * @private
  12577. * @param {*} value The value to check.
  12578. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  12579. */
  12580. function isHostObject(value) {
  12581. // Many host objects are `Object` objects that can coerce to strings
  12582. // despite having improperly defined `toString` methods.
  12583. var result = false;
  12584. if (value != null && typeof value.toString != 'function') {
  12585. try {
  12586. result = !!(value + '');
  12587. } catch (e) {}
  12588. }
  12589. return result;
  12590. }
  12591. /** Used for built-in method references. */
  12592. var arrayProto = Array.prototype,
  12593. funcProto = Function.prototype,
  12594. objectProto = Object.prototype;
  12595. /** Used to detect overreaching core-js shims. */
  12596. var coreJsData = root['__core-js_shared__'];
  12597. /** Used to detect methods masquerading as native. */
  12598. var maskSrcKey = (function() {
  12599. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  12600. return uid ? ('Symbol(src)_1.' + uid) : '';
  12601. }());
  12602. /** Used to resolve the decompiled source of functions. */
  12603. var funcToString = funcProto.toString;
  12604. /** Used to check objects for own properties. */
  12605. var hasOwnProperty = objectProto.hasOwnProperty;
  12606. /**
  12607. * Used to resolve the
  12608. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  12609. * of values.
  12610. */
  12611. var objectToString = objectProto.toString;
  12612. /** Used to detect if a method is native. */
  12613. var reIsNative = RegExp('^' +
  12614. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  12615. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  12616. );
  12617. /** Built-in value references. */
  12618. var Symbol = root.Symbol,
  12619. splice = arrayProto.splice;
  12620. /* Built-in method references that are verified to be native. */
  12621. var Map = getNative(root, 'Map'),
  12622. nativeCreate = getNative(Object, 'create');
  12623. /** Used to convert symbols to primitives and strings. */
  12624. var symbolProto = Symbol ? Symbol.prototype : undefined,
  12625. symbolToString = symbolProto ? symbolProto.toString : undefined;
  12626. /**
  12627. * Creates a hash object.
  12628. *
  12629. * @private
  12630. * @constructor
  12631. * @param {Array} [entries] The key-value pairs to cache.
  12632. */
  12633. function Hash(entries) {
  12634. var index = -1,
  12635. length = entries ? entries.length : 0;
  12636. this.clear();
  12637. while (++index < length) {
  12638. var entry = entries[index];
  12639. this.set(entry[0], entry[1]);
  12640. }
  12641. }
  12642. /**
  12643. * Removes all key-value entries from the hash.
  12644. *
  12645. * @private
  12646. * @name clear
  12647. * @memberOf Hash
  12648. */
  12649. function hashClear() {
  12650. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  12651. }
  12652. /**
  12653. * Removes `key` and its value from the hash.
  12654. *
  12655. * @private
  12656. * @name delete
  12657. * @memberOf Hash
  12658. * @param {Object} hash The hash to modify.
  12659. * @param {string} key The key of the value to remove.
  12660. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  12661. */
  12662. function hashDelete(key) {
  12663. return this.has(key) && delete this.__data__[key];
  12664. }
  12665. /**
  12666. * Gets the hash value for `key`.
  12667. *
  12668. * @private
  12669. * @name get
  12670. * @memberOf Hash
  12671. * @param {string} key The key of the value to get.
  12672. * @returns {*} Returns the entry value.
  12673. */
  12674. function hashGet(key) {
  12675. var data = this.__data__;
  12676. if (nativeCreate) {
  12677. var result = data[key];
  12678. return result === HASH_UNDEFINED ? undefined : result;
  12679. }
  12680. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  12681. }
  12682. /**
  12683. * Checks if a hash value for `key` exists.
  12684. *
  12685. * @private
  12686. * @name has
  12687. * @memberOf Hash
  12688. * @param {string} key The key of the entry to check.
  12689. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  12690. */
  12691. function hashHas(key) {
  12692. var data = this.__data__;
  12693. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  12694. }
  12695. /**
  12696. * Sets the hash `key` to `value`.
  12697. *
  12698. * @private
  12699. * @name set
  12700. * @memberOf Hash
  12701. * @param {string} key The key of the value to set.
  12702. * @param {*} value The value to set.
  12703. * @returns {Object} Returns the hash instance.
  12704. */
  12705. function hashSet(key, value) {
  12706. var data = this.__data__;
  12707. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  12708. return this;
  12709. }
  12710. // Add methods to `Hash`.
  12711. Hash.prototype.clear = hashClear;
  12712. Hash.prototype['delete'] = hashDelete;
  12713. Hash.prototype.get = hashGet;
  12714. Hash.prototype.has = hashHas;
  12715. Hash.prototype.set = hashSet;
  12716. /**
  12717. * Creates an list cache object.
  12718. *
  12719. * @private
  12720. * @constructor
  12721. * @param {Array} [entries] The key-value pairs to cache.
  12722. */
  12723. function ListCache(entries) {
  12724. var index = -1,
  12725. length = entries ? entries.length : 0;
  12726. this.clear();
  12727. while (++index < length) {
  12728. var entry = entries[index];
  12729. this.set(entry[0], entry[1]);
  12730. }
  12731. }
  12732. /**
  12733. * Removes all key-value entries from the list cache.
  12734. *
  12735. * @private
  12736. * @name clear
  12737. * @memberOf ListCache
  12738. */
  12739. function listCacheClear() {
  12740. this.__data__ = [];
  12741. }
  12742. /**
  12743. * Removes `key` and its value from the list cache.
  12744. *
  12745. * @private
  12746. * @name delete
  12747. * @memberOf ListCache
  12748. * @param {string} key The key of the value to remove.
  12749. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  12750. */
  12751. function listCacheDelete(key) {
  12752. var data = this.__data__,
  12753. index = assocIndexOf(data, key);
  12754. if (index < 0) {
  12755. return false;
  12756. }
  12757. var lastIndex = data.length - 1;
  12758. if (index == lastIndex) {
  12759. data.pop();
  12760. } else {
  12761. splice.call(data, index, 1);
  12762. }
  12763. return true;
  12764. }
  12765. /**
  12766. * Gets the list cache value for `key`.
  12767. *
  12768. * @private
  12769. * @name get
  12770. * @memberOf ListCache
  12771. * @param {string} key The key of the value to get.
  12772. * @returns {*} Returns the entry value.
  12773. */
  12774. function listCacheGet(key) {
  12775. var data = this.__data__,
  12776. index = assocIndexOf(data, key);
  12777. return index < 0 ? undefined : data[index][1];
  12778. }
  12779. /**
  12780. * Checks if a list cache value for `key` exists.
  12781. *
  12782. * @private
  12783. * @name has
  12784. * @memberOf ListCache
  12785. * @param {string} key The key of the entry to check.
  12786. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  12787. */
  12788. function listCacheHas(key) {
  12789. return assocIndexOf(this.__data__, key) > -1;
  12790. }
  12791. /**
  12792. * Sets the list cache `key` to `value`.
  12793. *
  12794. * @private
  12795. * @name set
  12796. * @memberOf ListCache
  12797. * @param {string} key The key of the value to set.
  12798. * @param {*} value The value to set.
  12799. * @returns {Object} Returns the list cache instance.
  12800. */
  12801. function listCacheSet(key, value) {
  12802. var data = this.__data__,
  12803. index = assocIndexOf(data, key);
  12804. if (index < 0) {
  12805. data.push([key, value]);
  12806. } else {
  12807. data[index][1] = value;
  12808. }
  12809. return this;
  12810. }
  12811. // Add methods to `ListCache`.
  12812. ListCache.prototype.clear = listCacheClear;
  12813. ListCache.prototype['delete'] = listCacheDelete;
  12814. ListCache.prototype.get = listCacheGet;
  12815. ListCache.prototype.has = listCacheHas;
  12816. ListCache.prototype.set = listCacheSet;
  12817. /**
  12818. * Creates a map cache object to store key-value pairs.
  12819. *
  12820. * @private
  12821. * @constructor
  12822. * @param {Array} [entries] The key-value pairs to cache.
  12823. */
  12824. function MapCache(entries) {
  12825. var index = -1,
  12826. length = entries ? entries.length : 0;
  12827. this.clear();
  12828. while (++index < length) {
  12829. var entry = entries[index];
  12830. this.set(entry[0], entry[1]);
  12831. }
  12832. }
  12833. /**
  12834. * Removes all key-value entries from the map.
  12835. *
  12836. * @private
  12837. * @name clear
  12838. * @memberOf MapCache
  12839. */
  12840. function mapCacheClear() {
  12841. this.__data__ = {
  12842. 'hash': new Hash,
  12843. 'map': new (Map || ListCache),
  12844. 'string': new Hash
  12845. };
  12846. }
  12847. /**
  12848. * Removes `key` and its value from the map.
  12849. *
  12850. * @private
  12851. * @name delete
  12852. * @memberOf MapCache
  12853. * @param {string} key The key of the value to remove.
  12854. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  12855. */
  12856. function mapCacheDelete(key) {
  12857. return getMapData(this, key)['delete'](key);
  12858. }
  12859. /**
  12860. * Gets the map value for `key`.
  12861. *
  12862. * @private
  12863. * @name get
  12864. * @memberOf MapCache
  12865. * @param {string} key The key of the value to get.
  12866. * @returns {*} Returns the entry value.
  12867. */
  12868. function mapCacheGet(key) {
  12869. return getMapData(this, key).get(key);
  12870. }
  12871. /**
  12872. * Checks if a map value for `key` exists.
  12873. *
  12874. * @private
  12875. * @name has
  12876. * @memberOf MapCache
  12877. * @param {string} key The key of the entry to check.
  12878. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  12879. */
  12880. function mapCacheHas(key) {
  12881. return getMapData(this, key).has(key);
  12882. }
  12883. /**
  12884. * Sets the map `key` to `value`.
  12885. *
  12886. * @private
  12887. * @name set
  12888. * @memberOf MapCache
  12889. * @param {string} key The key of the value to set.
  12890. * @param {*} value The value to set.
  12891. * @returns {Object} Returns the map cache instance.
  12892. */
  12893. function mapCacheSet(key, value) {
  12894. getMapData(this, key).set(key, value);
  12895. return this;
  12896. }
  12897. // Add methods to `MapCache`.
  12898. MapCache.prototype.clear = mapCacheClear;
  12899. MapCache.prototype['delete'] = mapCacheDelete;
  12900. MapCache.prototype.get = mapCacheGet;
  12901. MapCache.prototype.has = mapCacheHas;
  12902. MapCache.prototype.set = mapCacheSet;
  12903. /**
  12904. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  12905. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  12906. * for equality comparisons.
  12907. *
  12908. * @private
  12909. * @param {Object} object The object to modify.
  12910. * @param {string} key The key of the property to assign.
  12911. * @param {*} value The value to assign.
  12912. */
  12913. function assignValue(object, key, value) {
  12914. var objValue = object[key];
  12915. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  12916. (value === undefined && !(key in object))) {
  12917. object[key] = value;
  12918. }
  12919. }
  12920. /**
  12921. * Gets the index at which the `key` is found in `array` of key-value pairs.
  12922. *
  12923. * @private
  12924. * @param {Array} array The array to inspect.
  12925. * @param {*} key The key to search for.
  12926. * @returns {number} Returns the index of the matched value, else `-1`.
  12927. */
  12928. function assocIndexOf(array, key) {
  12929. var length = array.length;
  12930. while (length--) {
  12931. if (eq(array[length][0], key)) {
  12932. return length;
  12933. }
  12934. }
  12935. return -1;
  12936. }
  12937. /**
  12938. * The base implementation of `_.isNative` without bad shim checks.
  12939. *
  12940. * @private
  12941. * @param {*} value The value to check.
  12942. * @returns {boolean} Returns `true` if `value` is a native function,
  12943. * else `false`.
  12944. */
  12945. function baseIsNative(value) {
  12946. if (!isObject(value) || isMasked(value)) {
  12947. return false;
  12948. }
  12949. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  12950. return pattern.test(toSource(value));
  12951. }
  12952. /**
  12953. * The base implementation of `_.set`.
  12954. *
  12955. * @private
  12956. * @param {Object} object The object to modify.
  12957. * @param {Array|string} path The path of the property to set.
  12958. * @param {*} value The value to set.
  12959. * @param {Function} [customizer] The function to customize path creation.
  12960. * @returns {Object} Returns `object`.
  12961. */
  12962. function baseSet(object, path, value, customizer) {
  12963. if (!isObject(object)) {
  12964. return object;
  12965. }
  12966. path = isKey(path, object) ? [path] : castPath(path);
  12967. var index = -1,
  12968. length = path.length,
  12969. lastIndex = length - 1,
  12970. nested = object;
  12971. while (nested != null && ++index < length) {
  12972. var key = toKey(path[index]),
  12973. newValue = value;
  12974. if (index != lastIndex) {
  12975. var objValue = nested[key];
  12976. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  12977. if (newValue === undefined) {
  12978. newValue = isObject(objValue)
  12979. ? objValue
  12980. : (isIndex(path[index + 1]) ? [] : {});
  12981. }
  12982. }
  12983. assignValue(nested, key, newValue);
  12984. nested = nested[key];
  12985. }
  12986. return object;
  12987. }
  12988. /**
  12989. * The base implementation of `_.toString` which doesn't convert nullish
  12990. * values to empty strings.
  12991. *
  12992. * @private
  12993. * @param {*} value The value to process.
  12994. * @returns {string} Returns the string.
  12995. */
  12996. function baseToString(value) {
  12997. // Exit early for strings to avoid a performance hit in some environments.
  12998. if (typeof value == 'string') {
  12999. return value;
  13000. }
  13001. if (isSymbol(value)) {
  13002. return symbolToString ? symbolToString.call(value) : '';
  13003. }
  13004. var result = (value + '');
  13005. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  13006. }
  13007. /**
  13008. * Casts `value` to a path array if it's not one.
  13009. *
  13010. * @private
  13011. * @param {*} value The value to inspect.
  13012. * @returns {Array} Returns the cast property path array.
  13013. */
  13014. function castPath(value) {
  13015. return isArray(value) ? value : stringToPath(value);
  13016. }
  13017. /**
  13018. * Gets the data for `map`.
  13019. *
  13020. * @private
  13021. * @param {Object} map The map to query.
  13022. * @param {string} key The reference key.
  13023. * @returns {*} Returns the map data.
  13024. */
  13025. function getMapData(map, key) {
  13026. var data = map.__data__;
  13027. return isKeyable(key)
  13028. ? data[typeof key == 'string' ? 'string' : 'hash']
  13029. : data.map;
  13030. }
  13031. /**
  13032. * Gets the native function at `key` of `object`.
  13033. *
  13034. * @private
  13035. * @param {Object} object The object to query.
  13036. * @param {string} key The key of the method to get.
  13037. * @returns {*} Returns the function if it's native, else `undefined`.
  13038. */
  13039. function getNative(object, key) {
  13040. var value = getValue(object, key);
  13041. return baseIsNative(value) ? value : undefined;
  13042. }
  13043. /**
  13044. * Checks if `value` is a valid array-like index.
  13045. *
  13046. * @private
  13047. * @param {*} value The value to check.
  13048. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  13049. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  13050. */
  13051. function isIndex(value, length) {
  13052. length = length == null ? MAX_SAFE_INTEGER : length;
  13053. return !!length &&
  13054. (typeof value == 'number' || reIsUint.test(value)) &&
  13055. (value > -1 && value % 1 == 0 && value < length);
  13056. }
  13057. /**
  13058. * Checks if `value` is a property name and not a property path.
  13059. *
  13060. * @private
  13061. * @param {*} value The value to check.
  13062. * @param {Object} [object] The object to query keys on.
  13063. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  13064. */
  13065. function isKey(value, object) {
  13066. if (isArray(value)) {
  13067. return false;
  13068. }
  13069. var type = typeof value;
  13070. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  13071. value == null || isSymbol(value)) {
  13072. return true;
  13073. }
  13074. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  13075. (object != null && value in Object(object));
  13076. }
  13077. /**
  13078. * Checks if `value` is suitable for use as unique object key.
  13079. *
  13080. * @private
  13081. * @param {*} value The value to check.
  13082. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  13083. */
  13084. function isKeyable(value) {
  13085. var type = typeof value;
  13086. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  13087. ? (value !== '__proto__')
  13088. : (value === null);
  13089. }
  13090. /**
  13091. * Checks if `func` has its source masked.
  13092. *
  13093. * @private
  13094. * @param {Function} func The function to check.
  13095. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  13096. */
  13097. function isMasked(func) {
  13098. return !!maskSrcKey && (maskSrcKey in func);
  13099. }
  13100. /**
  13101. * Converts `string` to a property path array.
  13102. *
  13103. * @private
  13104. * @param {string} string The string to convert.
  13105. * @returns {Array} Returns the property path array.
  13106. */
  13107. var stringToPath = memoize(function(string) {
  13108. string = toString(string);
  13109. var result = [];
  13110. if (reLeadingDot.test(string)) {
  13111. result.push('');
  13112. }
  13113. string.replace(rePropName, function(match, number, quote, string) {
  13114. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  13115. });
  13116. return result;
  13117. });
  13118. /**
  13119. * Converts `value` to a string key if it's not a string or symbol.
  13120. *
  13121. * @private
  13122. * @param {*} value The value to inspect.
  13123. * @returns {string|symbol} Returns the key.
  13124. */
  13125. function toKey(value) {
  13126. if (typeof value == 'string' || isSymbol(value)) {
  13127. return value;
  13128. }
  13129. var result = (value + '');
  13130. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  13131. }
  13132. /**
  13133. * Converts `func` to its source code.
  13134. *
  13135. * @private
  13136. * @param {Function} func The function to process.
  13137. * @returns {string} Returns the source code.
  13138. */
  13139. function toSource(func) {
  13140. if (func != null) {
  13141. try {
  13142. return funcToString.call(func);
  13143. } catch (e) {}
  13144. try {
  13145. return (func + '');
  13146. } catch (e) {}
  13147. }
  13148. return '';
  13149. }
  13150. /**
  13151. * Creates a function that memoizes the result of `func`. If `resolver` is
  13152. * provided, it determines the cache key for storing the result based on the
  13153. * arguments provided to the memoized function. By default, the first argument
  13154. * provided to the memoized function is used as the map cache key. The `func`
  13155. * is invoked with the `this` binding of the memoized function.
  13156. *
  13157. * **Note:** The cache is exposed as the `cache` property on the memoized
  13158. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  13159. * constructor with one whose instances implement the
  13160. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  13161. * method interface of `delete`, `get`, `has`, and `set`.
  13162. *
  13163. * @static
  13164. * @memberOf _
  13165. * @since 0.1.0
  13166. * @category Function
  13167. * @param {Function} func The function to have its output memoized.
  13168. * @param {Function} [resolver] The function to resolve the cache key.
  13169. * @returns {Function} Returns the new memoized function.
  13170. * @example
  13171. *
  13172. * var object = { 'a': 1, 'b': 2 };
  13173. * var other = { 'c': 3, 'd': 4 };
  13174. *
  13175. * var values = _.memoize(_.values);
  13176. * values(object);
  13177. * // => [1, 2]
  13178. *
  13179. * values(other);
  13180. * // => [3, 4]
  13181. *
  13182. * object.a = 2;
  13183. * values(object);
  13184. * // => [1, 2]
  13185. *
  13186. * // Modify the result cache.
  13187. * values.cache.set(object, ['a', 'b']);
  13188. * values(object);
  13189. * // => ['a', 'b']
  13190. *
  13191. * // Replace `_.memoize.Cache`.
  13192. * _.memoize.Cache = WeakMap;
  13193. */
  13194. function memoize(func, resolver) {
  13195. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  13196. throw new TypeError(FUNC_ERROR_TEXT);
  13197. }
  13198. var memoized = function() {
  13199. var args = arguments,
  13200. key = resolver ? resolver.apply(this, args) : args[0],
  13201. cache = memoized.cache;
  13202. if (cache.has(key)) {
  13203. return cache.get(key);
  13204. }
  13205. var result = func.apply(this, args);
  13206. memoized.cache = cache.set(key, result);
  13207. return result;
  13208. };
  13209. memoized.cache = new (memoize.Cache || MapCache);
  13210. return memoized;
  13211. }
  13212. // Assign cache to `_.memoize`.
  13213. memoize.Cache = MapCache;
  13214. /**
  13215. * Performs a
  13216. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  13217. * comparison between two values to determine if they are equivalent.
  13218. *
  13219. * @static
  13220. * @memberOf _
  13221. * @since 4.0.0
  13222. * @category Lang
  13223. * @param {*} value The value to compare.
  13224. * @param {*} other The other value to compare.
  13225. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  13226. * @example
  13227. *
  13228. * var object = { 'a': 1 };
  13229. * var other = { 'a': 1 };
  13230. *
  13231. * _.eq(object, object);
  13232. * // => true
  13233. *
  13234. * _.eq(object, other);
  13235. * // => false
  13236. *
  13237. * _.eq('a', 'a');
  13238. * // => true
  13239. *
  13240. * _.eq('a', Object('a'));
  13241. * // => false
  13242. *
  13243. * _.eq(NaN, NaN);
  13244. * // => true
  13245. */
  13246. function eq(value, other) {
  13247. return value === other || (value !== value && other !== other);
  13248. }
  13249. /**
  13250. * Checks if `value` is classified as an `Array` object.
  13251. *
  13252. * @static
  13253. * @memberOf _
  13254. * @since 0.1.0
  13255. * @category Lang
  13256. * @param {*} value The value to check.
  13257. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  13258. * @example
  13259. *
  13260. * _.isArray([1, 2, 3]);
  13261. * // => true
  13262. *
  13263. * _.isArray(document.body.children);
  13264. * // => false
  13265. *
  13266. * _.isArray('abc');
  13267. * // => false
  13268. *
  13269. * _.isArray(_.noop);
  13270. * // => false
  13271. */
  13272. var isArray = Array.isArray;
  13273. /**
  13274. * Checks if `value` is classified as a `Function` object.
  13275. *
  13276. * @static
  13277. * @memberOf _
  13278. * @since 0.1.0
  13279. * @category Lang
  13280. * @param {*} value The value to check.
  13281. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  13282. * @example
  13283. *
  13284. * _.isFunction(_);
  13285. * // => true
  13286. *
  13287. * _.isFunction(/abc/);
  13288. * // => false
  13289. */
  13290. function isFunction(value) {
  13291. // The use of `Object#toString` avoids issues with the `typeof` operator
  13292. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  13293. var tag = isObject(value) ? objectToString.call(value) : '';
  13294. return tag == funcTag || tag == genTag;
  13295. }
  13296. /**
  13297. * Checks if `value` is the
  13298. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  13299. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  13300. *
  13301. * @static
  13302. * @memberOf _
  13303. * @since 0.1.0
  13304. * @category Lang
  13305. * @param {*} value The value to check.
  13306. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  13307. * @example
  13308. *
  13309. * _.isObject({});
  13310. * // => true
  13311. *
  13312. * _.isObject([1, 2, 3]);
  13313. * // => true
  13314. *
  13315. * _.isObject(_.noop);
  13316. * // => true
  13317. *
  13318. * _.isObject(null);
  13319. * // => false
  13320. */
  13321. function isObject(value) {
  13322. var type = typeof value;
  13323. return !!value && (type == 'object' || type == 'function');
  13324. }
  13325. /**
  13326. * Checks if `value` is object-like. A value is object-like if it's not `null`
  13327. * and has a `typeof` result of "object".
  13328. *
  13329. * @static
  13330. * @memberOf _
  13331. * @since 4.0.0
  13332. * @category Lang
  13333. * @param {*} value The value to check.
  13334. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  13335. * @example
  13336. *
  13337. * _.isObjectLike({});
  13338. * // => true
  13339. *
  13340. * _.isObjectLike([1, 2, 3]);
  13341. * // => true
  13342. *
  13343. * _.isObjectLike(_.noop);
  13344. * // => false
  13345. *
  13346. * _.isObjectLike(null);
  13347. * // => false
  13348. */
  13349. function isObjectLike(value) {
  13350. return !!value && typeof value == 'object';
  13351. }
  13352. /**
  13353. * Checks if `value` is classified as a `Symbol` primitive or object.
  13354. *
  13355. * @static
  13356. * @memberOf _
  13357. * @since 4.0.0
  13358. * @category Lang
  13359. * @param {*} value The value to check.
  13360. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  13361. * @example
  13362. *
  13363. * _.isSymbol(Symbol.iterator);
  13364. * // => true
  13365. *
  13366. * _.isSymbol('abc');
  13367. * // => false
  13368. */
  13369. function isSymbol(value) {
  13370. return typeof value == 'symbol' ||
  13371. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  13372. }
  13373. /**
  13374. * Converts `value` to a string. An empty string is returned for `null`
  13375. * and `undefined` values. The sign of `-0` is preserved.
  13376. *
  13377. * @static
  13378. * @memberOf _
  13379. * @since 4.0.0
  13380. * @category Lang
  13381. * @param {*} value The value to process.
  13382. * @returns {string} Returns the string.
  13383. * @example
  13384. *
  13385. * _.toString(null);
  13386. * // => ''
  13387. *
  13388. * _.toString(-0);
  13389. * // => '-0'
  13390. *
  13391. * _.toString([1, 2, 3]);
  13392. * // => '1,2,3'
  13393. */
  13394. function toString(value) {
  13395. return value == null ? '' : baseToString(value);
  13396. }
  13397. /**
  13398. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  13399. * it's created. Arrays are created for missing index properties while objects
  13400. * are created for all other missing properties. Use `_.setWith` to customize
  13401. * `path` creation.
  13402. *
  13403. * **Note:** This method mutates `object`.
  13404. *
  13405. * @static
  13406. * @memberOf _
  13407. * @since 3.7.0
  13408. * @category Object
  13409. * @param {Object} object The object to modify.
  13410. * @param {Array|string} path The path of the property to set.
  13411. * @param {*} value The value to set.
  13412. * @returns {Object} Returns `object`.
  13413. * @example
  13414. *
  13415. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13416. *
  13417. * _.set(object, 'a[0].b.c', 4);
  13418. * console.log(object.a[0].b.c);
  13419. * // => 4
  13420. *
  13421. * _.set(object, ['x', '0', 'y', 'z'], 5);
  13422. * console.log(object.x[0].y.z);
  13423. * // => 5
  13424. */
  13425. function set(object, path, value) {
  13426. return object == null ? object : baseSet(object, path, value);
  13427. }
  13428. module.exports = set;
  13429. /***/ }),
  13430. /***/ 898:
  13431. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  13432. "use strict";
  13433. Object.defineProperty(exports, '__esModule', { value: true });
  13434. var request = __webpack_require__(753);
  13435. var universalUserAgent = __webpack_require__(796);
  13436. const VERSION = "4.3.1";
  13437. class GraphqlError extends Error {
  13438. constructor(request, response) {
  13439. const message = response.data.errors[0].message;
  13440. super(message);
  13441. Object.assign(this, response.data);
  13442. this.name = "GraphqlError";
  13443. this.request = request; // Maintains proper stack trace (only available on V8)
  13444. /* istanbul ignore next */
  13445. if (Error.captureStackTrace) {
  13446. Error.captureStackTrace(this, this.constructor);
  13447. }
  13448. }
  13449. }
  13450. const NON_VARIABLE_OPTIONS = ["method", "baseUrl", "url", "headers", "request", "query"];
  13451. function graphql(request, query, options) {
  13452. options = typeof query === "string" ? options = Object.assign({
  13453. query
  13454. }, options) : options = query;
  13455. const requestOptions = Object.keys(options).reduce((result, key) => {
  13456. if (NON_VARIABLE_OPTIONS.includes(key)) {
  13457. result[key] = options[key];
  13458. return result;
  13459. }
  13460. if (!result.variables) {
  13461. result.variables = {};
  13462. }
  13463. result.variables[key] = options[key];
  13464. return result;
  13465. }, {});
  13466. return request(requestOptions).then(response => {
  13467. if (response.data.errors) {
  13468. throw new GraphqlError(requestOptions, {
  13469. data: response.data
  13470. });
  13471. }
  13472. return response.data.data;
  13473. });
  13474. }
  13475. function withDefaults(request$1, newDefaults) {
  13476. const newRequest = request$1.defaults(newDefaults);
  13477. const newApi = (query, options) => {
  13478. return graphql(newRequest, query, options);
  13479. };
  13480. return Object.assign(newApi, {
  13481. defaults: withDefaults.bind(null, newRequest),
  13482. endpoint: request.request.endpoint
  13483. });
  13484. }
  13485. const graphql$1 = withDefaults(request.request, {
  13486. headers: {
  13487. "user-agent": `octokit-graphql.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  13488. },
  13489. method: "POST",
  13490. url: "/graphql"
  13491. });
  13492. function withCustomRequest(customRequest) {
  13493. return withDefaults(customRequest, {
  13494. method: "POST",
  13495. url: "/graphql"
  13496. });
  13497. }
  13498. exports.graphql = graphql$1;
  13499. exports.withCustomRequest = withCustomRequest;
  13500. //# sourceMappingURL=index.js.map
  13501. /***/ }),
  13502. /***/ 899:
  13503. /***/ (function(module, __unusedexports, __webpack_require__) {
  13504. module.exports = registerEndpoints;
  13505. const { Deprecation } = __webpack_require__(692);
  13506. function registerEndpoints(octokit, routes) {
  13507. Object.keys(routes).forEach(namespaceName => {
  13508. if (!octokit[namespaceName]) {
  13509. octokit[namespaceName] = {};
  13510. }
  13511. Object.keys(routes[namespaceName]).forEach(apiName => {
  13512. const apiOptions = routes[namespaceName][apiName];
  13513. const endpointDefaults = ["method", "url", "headers"].reduce(
  13514. (map, key) => {
  13515. if (typeof apiOptions[key] !== "undefined") {
  13516. map[key] = apiOptions[key];
  13517. }
  13518. return map;
  13519. },
  13520. {}
  13521. );
  13522. endpointDefaults.request = {
  13523. validate: apiOptions.params
  13524. };
  13525. let request = octokit.request.defaults(endpointDefaults);
  13526. // patch request & endpoint methods to support deprecated parameters.
  13527. // Not the most elegant solution, but we don’t want to move deprecation
  13528. // logic into octokit/endpoint.js as it’s out of scope
  13529. const hasDeprecatedParam = Object.keys(apiOptions.params || {}).find(
  13530. key => apiOptions.params[key].deprecated
  13531. );
  13532. if (hasDeprecatedParam) {
  13533. const patch = patchForDeprecation.bind(null, octokit, apiOptions);
  13534. request = patch(
  13535. octokit.request.defaults(endpointDefaults),
  13536. `.${namespaceName}.${apiName}()`
  13537. );
  13538. request.endpoint = patch(
  13539. request.endpoint,
  13540. `.${namespaceName}.${apiName}.endpoint()`
  13541. );
  13542. request.endpoint.merge = patch(
  13543. request.endpoint.merge,
  13544. `.${namespaceName}.${apiName}.endpoint.merge()`
  13545. );
  13546. }
  13547. if (apiOptions.deprecated) {
  13548. octokit[namespaceName][apiName] = function deprecatedEndpointMethod() {
  13549. octokit.log.warn(
  13550. new Deprecation(`[@octokit/rest] ${apiOptions.deprecated}`)
  13551. );
  13552. octokit[namespaceName][apiName] = request;
  13553. return request.apply(null, arguments);
  13554. };
  13555. return;
  13556. }
  13557. octokit[namespaceName][apiName] = request;
  13558. });
  13559. });
  13560. }
  13561. function patchForDeprecation(octokit, apiOptions, method, methodName) {
  13562. const patchedMethod = options => {
  13563. options = Object.assign({}, options);
  13564. Object.keys(options).forEach(key => {
  13565. if (apiOptions.params[key] && apiOptions.params[key].deprecated) {
  13566. const aliasKey = apiOptions.params[key].alias;
  13567. octokit.log.warn(
  13568. new Deprecation(
  13569. `[@octokit/rest] "${key}" parameter is deprecated for "${methodName}". Use "${aliasKey}" instead`
  13570. )
  13571. );
  13572. if (!(aliasKey in options)) {
  13573. options[aliasKey] = options[key];
  13574. }
  13575. delete options[key];
  13576. }
  13577. });
  13578. return method(options);
  13579. };
  13580. Object.keys(method).forEach(key => {
  13581. patchedMethod[key] = method[key];
  13582. });
  13583. return patchedMethod;
  13584. }
  13585. /***/ }),
  13586. /***/ 929:
  13587. /***/ (function(module, __unusedexports, __webpack_require__) {
  13588. module.exports = hasNextPage
  13589. const deprecate = __webpack_require__(370)
  13590. const getPageLinks = __webpack_require__(577)
  13591. function hasNextPage (link) {
  13592. deprecate(`octokit.hasNextPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  13593. return getPageLinks(link).next
  13594. }
  13595. /***/ }),
  13596. /***/ 948:
  13597. /***/ (function(module) {
  13598. "use strict";
  13599. /**
  13600. * Tries to execute a function and discards any error that occurs.
  13601. * @param {Function} fn - Function that might or might not throw an error.
  13602. * @returns {?*} Return-value of the function when no error occurred.
  13603. */
  13604. module.exports = function(fn) {
  13605. try { return fn() } catch (e) {}
  13606. }
  13607. /***/ }),
  13608. /***/ 954:
  13609. /***/ (function(module) {
  13610. module.exports = validateAuth;
  13611. function validateAuth(auth) {
  13612. if (typeof auth === "string") {
  13613. return;
  13614. }
  13615. if (typeof auth === "function") {
  13616. return;
  13617. }
  13618. if (auth.username && auth.password) {
  13619. return;
  13620. }
  13621. if (auth.clientId && auth.clientSecret) {
  13622. return;
  13623. }
  13624. throw new Error(`Invalid "auth" option: ${JSON.stringify(auth)}`);
  13625. }
  13626. /***/ }),
  13627. /***/ 955:
  13628. /***/ (function(module, __unusedexports, __webpack_require__) {
  13629. "use strict";
  13630. const path = __webpack_require__(622);
  13631. const childProcess = __webpack_require__(129);
  13632. const crossSpawn = __webpack_require__(20);
  13633. const stripEof = __webpack_require__(768);
  13634. const npmRunPath = __webpack_require__(621);
  13635. const isStream = __webpack_require__(323);
  13636. const _getStream = __webpack_require__(145);
  13637. const pFinally = __webpack_require__(697);
  13638. const onExit = __webpack_require__(260);
  13639. const errname = __webpack_require__(427);
  13640. const stdio = __webpack_require__(168);
  13641. const TEN_MEGABYTES = 1000 * 1000 * 10;
  13642. function handleArgs(cmd, args, opts) {
  13643. let parsed;
  13644. opts = Object.assign({
  13645. extendEnv: true,
  13646. env: {}
  13647. }, opts);
  13648. if (opts.extendEnv) {
  13649. opts.env = Object.assign({}, process.env, opts.env);
  13650. }
  13651. if (opts.__winShell === true) {
  13652. delete opts.__winShell;
  13653. parsed = {
  13654. command: cmd,
  13655. args,
  13656. options: opts,
  13657. file: cmd,
  13658. original: {
  13659. cmd,
  13660. args
  13661. }
  13662. };
  13663. } else {
  13664. parsed = crossSpawn._parse(cmd, args, opts);
  13665. }
  13666. opts = Object.assign({
  13667. maxBuffer: TEN_MEGABYTES,
  13668. buffer: true,
  13669. stripEof: true,
  13670. preferLocal: true,
  13671. localDir: parsed.options.cwd || process.cwd(),
  13672. encoding: 'utf8',
  13673. reject: true,
  13674. cleanup: true
  13675. }, parsed.options);
  13676. opts.stdio = stdio(opts);
  13677. if (opts.preferLocal) {
  13678. opts.env = npmRunPath.env(Object.assign({}, opts, {cwd: opts.localDir}));
  13679. }
  13680. if (opts.detached) {
  13681. // #115
  13682. opts.cleanup = false;
  13683. }
  13684. if (process.platform === 'win32' && path.basename(parsed.command) === 'cmd.exe') {
  13685. // #116
  13686. parsed.args.unshift('/q');
  13687. }
  13688. return {
  13689. cmd: parsed.command,
  13690. args: parsed.args,
  13691. opts,
  13692. parsed
  13693. };
  13694. }
  13695. function handleInput(spawned, input) {
  13696. if (input === null || input === undefined) {
  13697. return;
  13698. }
  13699. if (isStream(input)) {
  13700. input.pipe(spawned.stdin);
  13701. } else {
  13702. spawned.stdin.end(input);
  13703. }
  13704. }
  13705. function handleOutput(opts, val) {
  13706. if (val && opts.stripEof) {
  13707. val = stripEof(val);
  13708. }
  13709. return val;
  13710. }
  13711. function handleShell(fn, cmd, opts) {
  13712. let file = '/bin/sh';
  13713. let args = ['-c', cmd];
  13714. opts = Object.assign({}, opts);
  13715. if (process.platform === 'win32') {
  13716. opts.__winShell = true;
  13717. file = process.env.comspec || 'cmd.exe';
  13718. args = ['/s', '/c', `"${cmd}"`];
  13719. opts.windowsVerbatimArguments = true;
  13720. }
  13721. if (opts.shell) {
  13722. file = opts.shell;
  13723. delete opts.shell;
  13724. }
  13725. return fn(file, args, opts);
  13726. }
  13727. function getStream(process, stream, {encoding, buffer, maxBuffer}) {
  13728. if (!process[stream]) {
  13729. return null;
  13730. }
  13731. let ret;
  13732. if (!buffer) {
  13733. // TODO: Use `ret = util.promisify(stream.finished)(process[stream]);` when targeting Node.js 10
  13734. ret = new Promise((resolve, reject) => {
  13735. process[stream]
  13736. .once('end', resolve)
  13737. .once('error', reject);
  13738. });
  13739. } else if (encoding) {
  13740. ret = _getStream(process[stream], {
  13741. encoding,
  13742. maxBuffer
  13743. });
  13744. } else {
  13745. ret = _getStream.buffer(process[stream], {maxBuffer});
  13746. }
  13747. return ret.catch(err => {
  13748. err.stream = stream;
  13749. err.message = `${stream} ${err.message}`;
  13750. throw err;
  13751. });
  13752. }
  13753. function makeError(result, options) {
  13754. const {stdout, stderr} = result;
  13755. let err = result.error;
  13756. const {code, signal} = result;
  13757. const {parsed, joinedCmd} = options;
  13758. const timedOut = options.timedOut || false;
  13759. if (!err) {
  13760. let output = '';
  13761. if (Array.isArray(parsed.opts.stdio)) {
  13762. if (parsed.opts.stdio[2] !== 'inherit') {
  13763. output += output.length > 0 ? stderr : `\n${stderr}`;
  13764. }
  13765. if (parsed.opts.stdio[1] !== 'inherit') {
  13766. output += `\n${stdout}`;
  13767. }
  13768. } else if (parsed.opts.stdio !== 'inherit') {
  13769. output = `\n${stderr}${stdout}`;
  13770. }
  13771. err = new Error(`Command failed: ${joinedCmd}${output}`);
  13772. err.code = code < 0 ? errname(code) : code;
  13773. }
  13774. err.stdout = stdout;
  13775. err.stderr = stderr;
  13776. err.failed = true;
  13777. err.signal = signal || null;
  13778. err.cmd = joinedCmd;
  13779. err.timedOut = timedOut;
  13780. return err;
  13781. }
  13782. function joinCmd(cmd, args) {
  13783. let joinedCmd = cmd;
  13784. if (Array.isArray(args) && args.length > 0) {
  13785. joinedCmd += ' ' + args.join(' ');
  13786. }
  13787. return joinedCmd;
  13788. }
  13789. module.exports = (cmd, args, opts) => {
  13790. const parsed = handleArgs(cmd, args, opts);
  13791. const {encoding, buffer, maxBuffer} = parsed.opts;
  13792. const joinedCmd = joinCmd(cmd, args);
  13793. let spawned;
  13794. try {
  13795. spawned = childProcess.spawn(parsed.cmd, parsed.args, parsed.opts);
  13796. } catch (err) {
  13797. return Promise.reject(err);
  13798. }
  13799. let removeExitHandler;
  13800. if (parsed.opts.cleanup) {
  13801. removeExitHandler = onExit(() => {
  13802. spawned.kill();
  13803. });
  13804. }
  13805. let timeoutId = null;
  13806. let timedOut = false;
  13807. const cleanup = () => {
  13808. if (timeoutId) {
  13809. clearTimeout(timeoutId);
  13810. timeoutId = null;
  13811. }
  13812. if (removeExitHandler) {
  13813. removeExitHandler();
  13814. }
  13815. };
  13816. if (parsed.opts.timeout > 0) {
  13817. timeoutId = setTimeout(() => {
  13818. timeoutId = null;
  13819. timedOut = true;
  13820. spawned.kill(parsed.opts.killSignal);
  13821. }, parsed.opts.timeout);
  13822. }
  13823. const processDone = new Promise(resolve => {
  13824. spawned.on('exit', (code, signal) => {
  13825. cleanup();
  13826. resolve({code, signal});
  13827. });
  13828. spawned.on('error', err => {
  13829. cleanup();
  13830. resolve({error: err});
  13831. });
  13832. if (spawned.stdin) {
  13833. spawned.stdin.on('error', err => {
  13834. cleanup();
  13835. resolve({error: err});
  13836. });
  13837. }
  13838. });
  13839. function destroy() {
  13840. if (spawned.stdout) {
  13841. spawned.stdout.destroy();
  13842. }
  13843. if (spawned.stderr) {
  13844. spawned.stderr.destroy();
  13845. }
  13846. }
  13847. const handlePromise = () => pFinally(Promise.all([
  13848. processDone,
  13849. getStream(spawned, 'stdout', {encoding, buffer, maxBuffer}),
  13850. getStream(spawned, 'stderr', {encoding, buffer, maxBuffer})
  13851. ]).then(arr => {
  13852. const result = arr[0];
  13853. result.stdout = arr[1];
  13854. result.stderr = arr[2];
  13855. if (result.error || result.code !== 0 || result.signal !== null) {
  13856. const err = makeError(result, {
  13857. joinedCmd,
  13858. parsed,
  13859. timedOut
  13860. });
  13861. // TODO: missing some timeout logic for killed
  13862. // https://github.com/nodejs/node/blob/master/lib/child_process.js#L203
  13863. // err.killed = spawned.killed || killed;
  13864. err.killed = err.killed || spawned.killed;
  13865. if (!parsed.opts.reject) {
  13866. return err;
  13867. }
  13868. throw err;
  13869. }
  13870. return {
  13871. stdout: handleOutput(parsed.opts, result.stdout),
  13872. stderr: handleOutput(parsed.opts, result.stderr),
  13873. code: 0,
  13874. failed: false,
  13875. killed: false,
  13876. signal: null,
  13877. cmd: joinedCmd,
  13878. timedOut: false
  13879. };
  13880. }), destroy);
  13881. crossSpawn._enoent.hookChildProcess(spawned, parsed.parsed);
  13882. handleInput(spawned, parsed.opts.input);
  13883. spawned.then = (onfulfilled, onrejected) => handlePromise().then(onfulfilled, onrejected);
  13884. spawned.catch = onrejected => handlePromise().catch(onrejected);
  13885. return spawned;
  13886. };
  13887. // TODO: set `stderr: 'ignore'` when that option is implemented
  13888. module.exports.stdout = (...args) => module.exports(...args).then(x => x.stdout);
  13889. // TODO: set `stdout: 'ignore'` when that option is implemented
  13890. module.exports.stderr = (...args) => module.exports(...args).then(x => x.stderr);
  13891. module.exports.shell = (cmd, opts) => handleShell(module.exports, cmd, opts);
  13892. module.exports.sync = (cmd, args, opts) => {
  13893. const parsed = handleArgs(cmd, args, opts);
  13894. const joinedCmd = joinCmd(cmd, args);
  13895. if (isStream(parsed.opts.input)) {
  13896. throw new TypeError('The `input` option cannot be a stream in sync mode');
  13897. }
  13898. const result = childProcess.spawnSync(parsed.cmd, parsed.args, parsed.opts);
  13899. result.code = result.status;
  13900. if (result.error || result.status !== 0 || result.signal !== null) {
  13901. const err = makeError(result, {
  13902. joinedCmd,
  13903. parsed
  13904. });
  13905. if (!parsed.opts.reject) {
  13906. return err;
  13907. }
  13908. throw err;
  13909. }
  13910. return {
  13911. stdout: handleOutput(parsed.opts, result.stdout),
  13912. stderr: handleOutput(parsed.opts, result.stderr),
  13913. code: 0,
  13914. failed: false,
  13915. signal: null,
  13916. cmd: joinedCmd,
  13917. timedOut: false
  13918. };
  13919. };
  13920. module.exports.shellSync = (cmd, opts) => handleShell(module.exports.sync, cmd, opts);
  13921. /***/ }),
  13922. /***/ 966:
  13923. /***/ (function(module, __unusedexports, __webpack_require__) {
  13924. "use strict";
  13925. const {PassThrough} = __webpack_require__(413);
  13926. module.exports = options => {
  13927. options = Object.assign({}, options);
  13928. const {array} = options;
  13929. let {encoding} = options;
  13930. const buffer = encoding === 'buffer';
  13931. let objectMode = false;
  13932. if (array) {
  13933. objectMode = !(encoding || buffer);
  13934. } else {
  13935. encoding = encoding || 'utf8';
  13936. }
  13937. if (buffer) {
  13938. encoding = null;
  13939. }
  13940. let len = 0;
  13941. const ret = [];
  13942. const stream = new PassThrough({objectMode});
  13943. if (encoding) {
  13944. stream.setEncoding(encoding);
  13945. }
  13946. stream.on('data', chunk => {
  13947. ret.push(chunk);
  13948. if (objectMode) {
  13949. len = ret.length;
  13950. } else {
  13951. len += chunk.length;
  13952. }
  13953. });
  13954. stream.getBufferedValue = () => {
  13955. if (array) {
  13956. return ret;
  13957. }
  13958. return buffer ? Buffer.concat(ret, len) : ret.join('');
  13959. };
  13960. stream.getBufferedLength = () => len;
  13961. return stream;
  13962. };
  13963. /***/ }),
  13964. /***/ 969:
  13965. /***/ (function(module, __unusedexports, __webpack_require__) {
  13966. var wrappy = __webpack_require__(11)
  13967. module.exports = wrappy(once)
  13968. module.exports.strict = wrappy(onceStrict)
  13969. once.proto = once(function () {
  13970. Object.defineProperty(Function.prototype, 'once', {
  13971. value: function () {
  13972. return once(this)
  13973. },
  13974. configurable: true
  13975. })
  13976. Object.defineProperty(Function.prototype, 'onceStrict', {
  13977. value: function () {
  13978. return onceStrict(this)
  13979. },
  13980. configurable: true
  13981. })
  13982. })
  13983. function once (fn) {
  13984. var f = function () {
  13985. if (f.called) return f.value
  13986. f.called = true
  13987. return f.value = fn.apply(this, arguments)
  13988. }
  13989. f.called = false
  13990. return f
  13991. }
  13992. function onceStrict (fn) {
  13993. var f = function () {
  13994. if (f.called)
  13995. throw new Error(f.onceError)
  13996. f.called = true
  13997. return f.value = fn.apply(this, arguments)
  13998. }
  13999. var name = fn.name || 'Function wrapped with `once`'
  14000. f.onceError = name + " shouldn't be called more than once"
  14001. f.called = false
  14002. return f
  14003. }
  14004. /***/ }),
  14005. /***/ 986:
  14006. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  14007. "use strict";
  14008. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  14009. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  14010. return new (P || (P = Promise))(function (resolve, reject) {
  14011. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  14012. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  14013. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  14014. step((generator = generator.apply(thisArg, _arguments || [])).next());
  14015. });
  14016. };
  14017. Object.defineProperty(exports, "__esModule", { value: true });
  14018. const tr = __webpack_require__(9);
  14019. /**
  14020. * Exec a command.
  14021. * Output will be streamed to the live console.
  14022. * Returns promise with return code
  14023. *
  14024. * @param commandLine command to execute (can include additional args). Must be correctly escaped.
  14025. * @param args optional arguments for tool. Escaping is handled by the lib.
  14026. * @param options optional exec options. See ExecOptions
  14027. * @returns Promise<number> exit code
  14028. */
  14029. function exec(commandLine, args, options) {
  14030. return __awaiter(this, void 0, void 0, function* () {
  14031. const commandArgs = tr.argStringToArray(commandLine);
  14032. if (commandArgs.length === 0) {
  14033. throw new Error(`Parameter 'commandLine' cannot be null or empty.`);
  14034. }
  14035. // Path to tool to execute should be first arg
  14036. const toolPath = commandArgs[0];
  14037. args = commandArgs.slice(1).concat(args || []);
  14038. const runner = new tr.ToolRunner(toolPath, args, options);
  14039. return runner.exec();
  14040. });
  14041. }
  14042. exports.exec = exec;
  14043. //# sourceMappingURL=exec.js.map
  14044. /***/ }),
  14045. /***/ 991:
  14046. /***/ (function(module, __unusedexports, __webpack_require__) {
  14047. module.exports = authenticationRequestError;
  14048. const { RequestError } = __webpack_require__(463);
  14049. function authenticationRequestError(state, error, options) {
  14050. if (!error.headers) throw error;
  14051. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  14052. // handle "2FA required" error only
  14053. if (error.status !== 401 || !otpRequired) {
  14054. throw error;
  14055. }
  14056. if (
  14057. error.status === 401 &&
  14058. otpRequired &&
  14059. error.request &&
  14060. error.request.headers["x-github-otp"]
  14061. ) {
  14062. if (state.otp) {
  14063. delete state.otp; // no longer valid, request again
  14064. } else {
  14065. throw new RequestError(
  14066. "Invalid one-time password for two-factor authentication",
  14067. 401,
  14068. {
  14069. headers: error.headers,
  14070. request: options
  14071. }
  14072. );
  14073. }
  14074. }
  14075. if (typeof state.auth.on2fa !== "function") {
  14076. throw new RequestError(
  14077. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  14078. 401,
  14079. {
  14080. headers: error.headers,
  14081. request: options
  14082. }
  14083. );
  14084. }
  14085. return Promise.resolve()
  14086. .then(() => {
  14087. return state.auth.on2fa();
  14088. })
  14089. .then(oneTimePassword => {
  14090. const newOptions = Object.assign(options, {
  14091. headers: Object.assign(options.headers, {
  14092. "x-github-otp": oneTimePassword
  14093. })
  14094. });
  14095. return state.octokit.request(newOptions).then(response => {
  14096. // If OTP still valid, then persist it for following requests
  14097. state.otp = oneTimePassword;
  14098. return response;
  14099. });
  14100. });
  14101. }
  14102. /***/ })
  14103. /******/ });