index.js 506 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288
  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. /***/ 18:
  1031. /***/ (function() {
  1032. eval("require")("encoding");
  1033. /***/ }),
  1034. /***/ 19:
  1035. /***/ (function(module, __unusedexports, __webpack_require__) {
  1036. module.exports = authenticationPlugin;
  1037. const { Deprecation } = __webpack_require__(692);
  1038. const once = __webpack_require__(969);
  1039. const deprecateAuthenticate = once((log, deprecation) => log.warn(deprecation));
  1040. const authenticate = __webpack_require__(674);
  1041. const beforeRequest = __webpack_require__(471);
  1042. const requestError = __webpack_require__(349);
  1043. function authenticationPlugin(octokit, options) {
  1044. if (options.auth) {
  1045. octokit.authenticate = () => {
  1046. deprecateAuthenticate(
  1047. octokit.log,
  1048. new Deprecation(
  1049. '[@octokit/rest] octokit.authenticate() is deprecated and has no effect when "auth" option is set on Octokit constructor'
  1050. )
  1051. );
  1052. };
  1053. return;
  1054. }
  1055. const state = {
  1056. octokit,
  1057. auth: false
  1058. };
  1059. octokit.authenticate = authenticate.bind(null, state);
  1060. octokit.hook.before("request", beforeRequest.bind(null, state));
  1061. octokit.hook.error("request", requestError.bind(null, state));
  1062. }
  1063. /***/ }),
  1064. /***/ 20:
  1065. /***/ (function(module, __unusedexports, __webpack_require__) {
  1066. "use strict";
  1067. const cp = __webpack_require__(129);
  1068. const parse = __webpack_require__(568);
  1069. const enoent = __webpack_require__(881);
  1070. function spawn(command, args, options) {
  1071. // Parse the arguments
  1072. const parsed = parse(command, args, options);
  1073. // Spawn the child process
  1074. const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
  1075. // Hook into child process "exit" event to emit an error if the command
  1076. // does not exists, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16
  1077. enoent.hookChildProcess(spawned, parsed);
  1078. return spawned;
  1079. }
  1080. function spawnSync(command, args, options) {
  1081. // Parse the arguments
  1082. const parsed = parse(command, args, options);
  1083. // Spawn the child process
  1084. const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
  1085. // Analyze if the command does not exist, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16
  1086. result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
  1087. return result;
  1088. }
  1089. module.exports = spawn;
  1090. module.exports.spawn = spawn;
  1091. module.exports.sync = spawnSync;
  1092. module.exports._parse = parse;
  1093. module.exports._enoent = enoent;
  1094. /***/ }),
  1095. /***/ 39:
  1096. /***/ (function(module) {
  1097. "use strict";
  1098. module.exports = opts => {
  1099. opts = opts || {};
  1100. const env = opts.env || process.env;
  1101. const platform = opts.platform || process.platform;
  1102. if (platform !== 'win32') {
  1103. return 'PATH';
  1104. }
  1105. return Object.keys(env).find(x => x.toUpperCase() === 'PATH') || 'Path';
  1106. };
  1107. /***/ }),
  1108. /***/ 47:
  1109. /***/ (function(module, __unusedexports, __webpack_require__) {
  1110. module.exports = factory;
  1111. const Octokit = __webpack_require__(402);
  1112. const registerPlugin = __webpack_require__(855);
  1113. function factory(plugins) {
  1114. const Api = Octokit.bind(null, plugins || []);
  1115. Api.plugin = registerPlugin.bind(null, plugins || []);
  1116. return Api;
  1117. }
  1118. /***/ }),
  1119. /***/ 49:
  1120. /***/ (function(module, __unusedexports, __webpack_require__) {
  1121. "use strict";
  1122. const os = __webpack_require__(87);
  1123. const execa = __webpack_require__(955);
  1124. // Reference: https://www.gaijin.at/en/lstwinver.php
  1125. const names = new Map([
  1126. ['10.0', '10'],
  1127. ['6.3', '8.1'],
  1128. ['6.2', '8'],
  1129. ['6.1', '7'],
  1130. ['6.0', 'Vista'],
  1131. ['5.2', 'Server 2003'],
  1132. ['5.1', 'XP'],
  1133. ['5.0', '2000'],
  1134. ['4.9', 'ME'],
  1135. ['4.1', '98'],
  1136. ['4.0', '95']
  1137. ]);
  1138. const windowsRelease = release => {
  1139. const version = /\d+\.\d/.exec(release || os.release());
  1140. if (release && !version) {
  1141. throw new Error('`release` argument doesn\'t match `n.n`');
  1142. }
  1143. const ver = (version || [])[0];
  1144. // Server 2008, 2012 and 2016 versions are ambiguous with desktop versions and must be detected at runtime.
  1145. // If `release` is omitted or we're on a Windows system, and the version number is an ambiguous version
  1146. // then use `wmic` to get the OS caption: https://msdn.microsoft.com/en-us/library/aa394531(v=vs.85).aspx
  1147. // If the resulting caption contains the year 2008, 2012 or 2016, it is a server version, so return a server OS name.
  1148. if ((!release || release === os.release()) && ['6.1', '6.2', '6.3', '10.0'].includes(ver)) {
  1149. const stdout = execa.sync('wmic', ['os', 'get', 'Caption']).stdout || '';
  1150. const year = (stdout.match(/2008|2012|2016/) || [])[0];
  1151. if (year) {
  1152. return `Server ${year}`;
  1153. }
  1154. }
  1155. return names.get(ver);
  1156. };
  1157. module.exports = windowsRelease;
  1158. /***/ }),
  1159. /***/ 87:
  1160. /***/ (function(module) {
  1161. module.exports = require("os");
  1162. /***/ }),
  1163. /***/ 118:
  1164. /***/ (function(module, __unusedexports, __webpack_require__) {
  1165. "use strict";
  1166. const os = __webpack_require__(87);
  1167. const nameMap = new Map([
  1168. [19, 'Catalina'],
  1169. [18, 'Mojave'],
  1170. [17, 'High Sierra'],
  1171. [16, 'Sierra'],
  1172. [15, 'El Capitan'],
  1173. [14, 'Yosemite'],
  1174. [13, 'Mavericks'],
  1175. [12, 'Mountain Lion'],
  1176. [11, 'Lion'],
  1177. [10, 'Snow Leopard'],
  1178. [9, 'Leopard'],
  1179. [8, 'Tiger'],
  1180. [7, 'Panther'],
  1181. [6, 'Jaguar'],
  1182. [5, 'Puma']
  1183. ]);
  1184. const macosRelease = release => {
  1185. release = Number((release || os.release()).split('.')[0]);
  1186. return {
  1187. name: nameMap.get(release),
  1188. version: '10.' + (release - 4)
  1189. };
  1190. };
  1191. module.exports = macosRelease;
  1192. // TODO: remove this in the next major version
  1193. module.exports.default = macosRelease;
  1194. /***/ }),
  1195. /***/ 126:
  1196. /***/ (function(module) {
  1197. /**
  1198. * lodash (Custom Build) <https://lodash.com/>
  1199. * Build: `lodash modularize exports="npm" -o ./`
  1200. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  1201. * Released under MIT license <https://lodash.com/license>
  1202. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1203. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1204. */
  1205. /** Used as the size to enable large array optimizations. */
  1206. var LARGE_ARRAY_SIZE = 200;
  1207. /** Used to stand-in for `undefined` hash values. */
  1208. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1209. /** Used as references for various `Number` constants. */
  1210. var INFINITY = 1 / 0;
  1211. /** `Object#toString` result references. */
  1212. var funcTag = '[object Function]',
  1213. genTag = '[object GeneratorFunction]';
  1214. /**
  1215. * Used to match `RegExp`
  1216. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1217. */
  1218. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  1219. /** Used to detect host constructors (Safari). */
  1220. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1221. /** Detect free variable `global` from Node.js. */
  1222. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  1223. /** Detect free variable `self`. */
  1224. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1225. /** Used as a reference to the global object. */
  1226. var root = freeGlobal || freeSelf || Function('return this')();
  1227. /**
  1228. * A specialized version of `_.includes` for arrays without support for
  1229. * specifying an index to search from.
  1230. *
  1231. * @private
  1232. * @param {Array} [array] The array to inspect.
  1233. * @param {*} target The value to search for.
  1234. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1235. */
  1236. function arrayIncludes(array, value) {
  1237. var length = array ? array.length : 0;
  1238. return !!length && baseIndexOf(array, value, 0) > -1;
  1239. }
  1240. /**
  1241. * This function is like `arrayIncludes` except that it accepts a comparator.
  1242. *
  1243. * @private
  1244. * @param {Array} [array] The array to inspect.
  1245. * @param {*} target The value to search for.
  1246. * @param {Function} comparator The comparator invoked per element.
  1247. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1248. */
  1249. function arrayIncludesWith(array, value, comparator) {
  1250. var index = -1,
  1251. length = array ? array.length : 0;
  1252. while (++index < length) {
  1253. if (comparator(value, array[index])) {
  1254. return true;
  1255. }
  1256. }
  1257. return false;
  1258. }
  1259. /**
  1260. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1261. * support for iteratee shorthands.
  1262. *
  1263. * @private
  1264. * @param {Array} array The array to inspect.
  1265. * @param {Function} predicate The function invoked per iteration.
  1266. * @param {number} fromIndex The index to search from.
  1267. * @param {boolean} [fromRight] Specify iterating from right to left.
  1268. * @returns {number} Returns the index of the matched value, else `-1`.
  1269. */
  1270. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  1271. var length = array.length,
  1272. index = fromIndex + (fromRight ? 1 : -1);
  1273. while ((fromRight ? index-- : ++index < length)) {
  1274. if (predicate(array[index], index, array)) {
  1275. return index;
  1276. }
  1277. }
  1278. return -1;
  1279. }
  1280. /**
  1281. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  1282. *
  1283. * @private
  1284. * @param {Array} array The array to inspect.
  1285. * @param {*} value The value to search for.
  1286. * @param {number} fromIndex The index to search from.
  1287. * @returns {number} Returns the index of the matched value, else `-1`.
  1288. */
  1289. function baseIndexOf(array, value, fromIndex) {
  1290. if (value !== value) {
  1291. return baseFindIndex(array, baseIsNaN, fromIndex);
  1292. }
  1293. var index = fromIndex - 1,
  1294. length = array.length;
  1295. while (++index < length) {
  1296. if (array[index] === value) {
  1297. return index;
  1298. }
  1299. }
  1300. return -1;
  1301. }
  1302. /**
  1303. * The base implementation of `_.isNaN` without support for number objects.
  1304. *
  1305. * @private
  1306. * @param {*} value The value to check.
  1307. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  1308. */
  1309. function baseIsNaN(value) {
  1310. return value !== value;
  1311. }
  1312. /**
  1313. * Checks if a cache value for `key` exists.
  1314. *
  1315. * @private
  1316. * @param {Object} cache The cache to query.
  1317. * @param {string} key The key of the entry to check.
  1318. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1319. */
  1320. function cacheHas(cache, key) {
  1321. return cache.has(key);
  1322. }
  1323. /**
  1324. * Gets the value at `key` of `object`.
  1325. *
  1326. * @private
  1327. * @param {Object} [object] The object to query.
  1328. * @param {string} key The key of the property to get.
  1329. * @returns {*} Returns the property value.
  1330. */
  1331. function getValue(object, key) {
  1332. return object == null ? undefined : object[key];
  1333. }
  1334. /**
  1335. * Checks if `value` is a host object in IE < 9.
  1336. *
  1337. * @private
  1338. * @param {*} value The value to check.
  1339. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  1340. */
  1341. function isHostObject(value) {
  1342. // Many host objects are `Object` objects that can coerce to strings
  1343. // despite having improperly defined `toString` methods.
  1344. var result = false;
  1345. if (value != null && typeof value.toString != 'function') {
  1346. try {
  1347. result = !!(value + '');
  1348. } catch (e) {}
  1349. }
  1350. return result;
  1351. }
  1352. /**
  1353. * Converts `set` to an array of its values.
  1354. *
  1355. * @private
  1356. * @param {Object} set The set to convert.
  1357. * @returns {Array} Returns the values.
  1358. */
  1359. function setToArray(set) {
  1360. var index = -1,
  1361. result = Array(set.size);
  1362. set.forEach(function(value) {
  1363. result[++index] = value;
  1364. });
  1365. return result;
  1366. }
  1367. /** Used for built-in method references. */
  1368. var arrayProto = Array.prototype,
  1369. funcProto = Function.prototype,
  1370. objectProto = Object.prototype;
  1371. /** Used to detect overreaching core-js shims. */
  1372. var coreJsData = root['__core-js_shared__'];
  1373. /** Used to detect methods masquerading as native. */
  1374. var maskSrcKey = (function() {
  1375. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  1376. return uid ? ('Symbol(src)_1.' + uid) : '';
  1377. }());
  1378. /** Used to resolve the decompiled source of functions. */
  1379. var funcToString = funcProto.toString;
  1380. /** Used to check objects for own properties. */
  1381. var hasOwnProperty = objectProto.hasOwnProperty;
  1382. /**
  1383. * Used to resolve the
  1384. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  1385. * of values.
  1386. */
  1387. var objectToString = objectProto.toString;
  1388. /** Used to detect if a method is native. */
  1389. var reIsNative = RegExp('^' +
  1390. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  1391. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  1392. );
  1393. /** Built-in value references. */
  1394. var splice = arrayProto.splice;
  1395. /* Built-in method references that are verified to be native. */
  1396. var Map = getNative(root, 'Map'),
  1397. Set = getNative(root, 'Set'),
  1398. nativeCreate = getNative(Object, 'create');
  1399. /**
  1400. * Creates a hash object.
  1401. *
  1402. * @private
  1403. * @constructor
  1404. * @param {Array} [entries] The key-value pairs to cache.
  1405. */
  1406. function Hash(entries) {
  1407. var index = -1,
  1408. length = entries ? entries.length : 0;
  1409. this.clear();
  1410. while (++index < length) {
  1411. var entry = entries[index];
  1412. this.set(entry[0], entry[1]);
  1413. }
  1414. }
  1415. /**
  1416. * Removes all key-value entries from the hash.
  1417. *
  1418. * @private
  1419. * @name clear
  1420. * @memberOf Hash
  1421. */
  1422. function hashClear() {
  1423. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  1424. }
  1425. /**
  1426. * Removes `key` and its value from the hash.
  1427. *
  1428. * @private
  1429. * @name delete
  1430. * @memberOf Hash
  1431. * @param {Object} hash The hash to modify.
  1432. * @param {string} key The key of the value to remove.
  1433. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1434. */
  1435. function hashDelete(key) {
  1436. return this.has(key) && delete this.__data__[key];
  1437. }
  1438. /**
  1439. * Gets the hash value for `key`.
  1440. *
  1441. * @private
  1442. * @name get
  1443. * @memberOf Hash
  1444. * @param {string} key The key of the value to get.
  1445. * @returns {*} Returns the entry value.
  1446. */
  1447. function hashGet(key) {
  1448. var data = this.__data__;
  1449. if (nativeCreate) {
  1450. var result = data[key];
  1451. return result === HASH_UNDEFINED ? undefined : result;
  1452. }
  1453. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  1454. }
  1455. /**
  1456. * Checks if a hash value for `key` exists.
  1457. *
  1458. * @private
  1459. * @name has
  1460. * @memberOf Hash
  1461. * @param {string} key The key of the entry to check.
  1462. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1463. */
  1464. function hashHas(key) {
  1465. var data = this.__data__;
  1466. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  1467. }
  1468. /**
  1469. * Sets the hash `key` to `value`.
  1470. *
  1471. * @private
  1472. * @name set
  1473. * @memberOf Hash
  1474. * @param {string} key The key of the value to set.
  1475. * @param {*} value The value to set.
  1476. * @returns {Object} Returns the hash instance.
  1477. */
  1478. function hashSet(key, value) {
  1479. var data = this.__data__;
  1480. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  1481. return this;
  1482. }
  1483. // Add methods to `Hash`.
  1484. Hash.prototype.clear = hashClear;
  1485. Hash.prototype['delete'] = hashDelete;
  1486. Hash.prototype.get = hashGet;
  1487. Hash.prototype.has = hashHas;
  1488. Hash.prototype.set = hashSet;
  1489. /**
  1490. * Creates an list cache object.
  1491. *
  1492. * @private
  1493. * @constructor
  1494. * @param {Array} [entries] The key-value pairs to cache.
  1495. */
  1496. function ListCache(entries) {
  1497. var index = -1,
  1498. length = entries ? entries.length : 0;
  1499. this.clear();
  1500. while (++index < length) {
  1501. var entry = entries[index];
  1502. this.set(entry[0], entry[1]);
  1503. }
  1504. }
  1505. /**
  1506. * Removes all key-value entries from the list cache.
  1507. *
  1508. * @private
  1509. * @name clear
  1510. * @memberOf ListCache
  1511. */
  1512. function listCacheClear() {
  1513. this.__data__ = [];
  1514. }
  1515. /**
  1516. * Removes `key` and its value from the list cache.
  1517. *
  1518. * @private
  1519. * @name delete
  1520. * @memberOf ListCache
  1521. * @param {string} key The key of the value to remove.
  1522. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1523. */
  1524. function listCacheDelete(key) {
  1525. var data = this.__data__,
  1526. index = assocIndexOf(data, key);
  1527. if (index < 0) {
  1528. return false;
  1529. }
  1530. var lastIndex = data.length - 1;
  1531. if (index == lastIndex) {
  1532. data.pop();
  1533. } else {
  1534. splice.call(data, index, 1);
  1535. }
  1536. return true;
  1537. }
  1538. /**
  1539. * Gets the list cache value for `key`.
  1540. *
  1541. * @private
  1542. * @name get
  1543. * @memberOf ListCache
  1544. * @param {string} key The key of the value to get.
  1545. * @returns {*} Returns the entry value.
  1546. */
  1547. function listCacheGet(key) {
  1548. var data = this.__data__,
  1549. index = assocIndexOf(data, key);
  1550. return index < 0 ? undefined : data[index][1];
  1551. }
  1552. /**
  1553. * Checks if a list cache value for `key` exists.
  1554. *
  1555. * @private
  1556. * @name has
  1557. * @memberOf ListCache
  1558. * @param {string} key The key of the entry to check.
  1559. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1560. */
  1561. function listCacheHas(key) {
  1562. return assocIndexOf(this.__data__, key) > -1;
  1563. }
  1564. /**
  1565. * Sets the list cache `key` to `value`.
  1566. *
  1567. * @private
  1568. * @name set
  1569. * @memberOf ListCache
  1570. * @param {string} key The key of the value to set.
  1571. * @param {*} value The value to set.
  1572. * @returns {Object} Returns the list cache instance.
  1573. */
  1574. function listCacheSet(key, value) {
  1575. var data = this.__data__,
  1576. index = assocIndexOf(data, key);
  1577. if (index < 0) {
  1578. data.push([key, value]);
  1579. } else {
  1580. data[index][1] = value;
  1581. }
  1582. return this;
  1583. }
  1584. // Add methods to `ListCache`.
  1585. ListCache.prototype.clear = listCacheClear;
  1586. ListCache.prototype['delete'] = listCacheDelete;
  1587. ListCache.prototype.get = listCacheGet;
  1588. ListCache.prototype.has = listCacheHas;
  1589. ListCache.prototype.set = listCacheSet;
  1590. /**
  1591. * Creates a map cache object to store key-value pairs.
  1592. *
  1593. * @private
  1594. * @constructor
  1595. * @param {Array} [entries] The key-value pairs to cache.
  1596. */
  1597. function MapCache(entries) {
  1598. var index = -1,
  1599. length = entries ? entries.length : 0;
  1600. this.clear();
  1601. while (++index < length) {
  1602. var entry = entries[index];
  1603. this.set(entry[0], entry[1]);
  1604. }
  1605. }
  1606. /**
  1607. * Removes all key-value entries from the map.
  1608. *
  1609. * @private
  1610. * @name clear
  1611. * @memberOf MapCache
  1612. */
  1613. function mapCacheClear() {
  1614. this.__data__ = {
  1615. 'hash': new Hash,
  1616. 'map': new (Map || ListCache),
  1617. 'string': new Hash
  1618. };
  1619. }
  1620. /**
  1621. * Removes `key` and its value from the map.
  1622. *
  1623. * @private
  1624. * @name delete
  1625. * @memberOf MapCache
  1626. * @param {string} key The key of the value to remove.
  1627. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1628. */
  1629. function mapCacheDelete(key) {
  1630. return getMapData(this, key)['delete'](key);
  1631. }
  1632. /**
  1633. * Gets the map value for `key`.
  1634. *
  1635. * @private
  1636. * @name get
  1637. * @memberOf MapCache
  1638. * @param {string} key The key of the value to get.
  1639. * @returns {*} Returns the entry value.
  1640. */
  1641. function mapCacheGet(key) {
  1642. return getMapData(this, key).get(key);
  1643. }
  1644. /**
  1645. * Checks if a map value for `key` exists.
  1646. *
  1647. * @private
  1648. * @name has
  1649. * @memberOf MapCache
  1650. * @param {string} key The key of the entry to check.
  1651. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1652. */
  1653. function mapCacheHas(key) {
  1654. return getMapData(this, key).has(key);
  1655. }
  1656. /**
  1657. * Sets the map `key` to `value`.
  1658. *
  1659. * @private
  1660. * @name set
  1661. * @memberOf MapCache
  1662. * @param {string} key The key of the value to set.
  1663. * @param {*} value The value to set.
  1664. * @returns {Object} Returns the map cache instance.
  1665. */
  1666. function mapCacheSet(key, value) {
  1667. getMapData(this, key).set(key, value);
  1668. return this;
  1669. }
  1670. // Add methods to `MapCache`.
  1671. MapCache.prototype.clear = mapCacheClear;
  1672. MapCache.prototype['delete'] = mapCacheDelete;
  1673. MapCache.prototype.get = mapCacheGet;
  1674. MapCache.prototype.has = mapCacheHas;
  1675. MapCache.prototype.set = mapCacheSet;
  1676. /**
  1677. *
  1678. * Creates an array cache object to store unique values.
  1679. *
  1680. * @private
  1681. * @constructor
  1682. * @param {Array} [values] The values to cache.
  1683. */
  1684. function SetCache(values) {
  1685. var index = -1,
  1686. length = values ? values.length : 0;
  1687. this.__data__ = new MapCache;
  1688. while (++index < length) {
  1689. this.add(values[index]);
  1690. }
  1691. }
  1692. /**
  1693. * Adds `value` to the array cache.
  1694. *
  1695. * @private
  1696. * @name add
  1697. * @memberOf SetCache
  1698. * @alias push
  1699. * @param {*} value The value to cache.
  1700. * @returns {Object} Returns the cache instance.
  1701. */
  1702. function setCacheAdd(value) {
  1703. this.__data__.set(value, HASH_UNDEFINED);
  1704. return this;
  1705. }
  1706. /**
  1707. * Checks if `value` is in the array cache.
  1708. *
  1709. * @private
  1710. * @name has
  1711. * @memberOf SetCache
  1712. * @param {*} value The value to search for.
  1713. * @returns {number} Returns `true` if `value` is found, else `false`.
  1714. */
  1715. function setCacheHas(value) {
  1716. return this.__data__.has(value);
  1717. }
  1718. // Add methods to `SetCache`.
  1719. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  1720. SetCache.prototype.has = setCacheHas;
  1721. /**
  1722. * Gets the index at which the `key` is found in `array` of key-value pairs.
  1723. *
  1724. * @private
  1725. * @param {Array} array The array to inspect.
  1726. * @param {*} key The key to search for.
  1727. * @returns {number} Returns the index of the matched value, else `-1`.
  1728. */
  1729. function assocIndexOf(array, key) {
  1730. var length = array.length;
  1731. while (length--) {
  1732. if (eq(array[length][0], key)) {
  1733. return length;
  1734. }
  1735. }
  1736. return -1;
  1737. }
  1738. /**
  1739. * The base implementation of `_.isNative` without bad shim checks.
  1740. *
  1741. * @private
  1742. * @param {*} value The value to check.
  1743. * @returns {boolean} Returns `true` if `value` is a native function,
  1744. * else `false`.
  1745. */
  1746. function baseIsNative(value) {
  1747. if (!isObject(value) || isMasked(value)) {
  1748. return false;
  1749. }
  1750. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  1751. return pattern.test(toSource(value));
  1752. }
  1753. /**
  1754. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  1755. *
  1756. * @private
  1757. * @param {Array} array The array to inspect.
  1758. * @param {Function} [iteratee] The iteratee invoked per element.
  1759. * @param {Function} [comparator] The comparator invoked per element.
  1760. * @returns {Array} Returns the new duplicate free array.
  1761. */
  1762. function baseUniq(array, iteratee, comparator) {
  1763. var index = -1,
  1764. includes = arrayIncludes,
  1765. length = array.length,
  1766. isCommon = true,
  1767. result = [],
  1768. seen = result;
  1769. if (comparator) {
  1770. isCommon = false;
  1771. includes = arrayIncludesWith;
  1772. }
  1773. else if (length >= LARGE_ARRAY_SIZE) {
  1774. var set = iteratee ? null : createSet(array);
  1775. if (set) {
  1776. return setToArray(set);
  1777. }
  1778. isCommon = false;
  1779. includes = cacheHas;
  1780. seen = new SetCache;
  1781. }
  1782. else {
  1783. seen = iteratee ? [] : result;
  1784. }
  1785. outer:
  1786. while (++index < length) {
  1787. var value = array[index],
  1788. computed = iteratee ? iteratee(value) : value;
  1789. value = (comparator || value !== 0) ? value : 0;
  1790. if (isCommon && computed === computed) {
  1791. var seenIndex = seen.length;
  1792. while (seenIndex--) {
  1793. if (seen[seenIndex] === computed) {
  1794. continue outer;
  1795. }
  1796. }
  1797. if (iteratee) {
  1798. seen.push(computed);
  1799. }
  1800. result.push(value);
  1801. }
  1802. else if (!includes(seen, computed, comparator)) {
  1803. if (seen !== result) {
  1804. seen.push(computed);
  1805. }
  1806. result.push(value);
  1807. }
  1808. }
  1809. return result;
  1810. }
  1811. /**
  1812. * Creates a set object of `values`.
  1813. *
  1814. * @private
  1815. * @param {Array} values The values to add to the set.
  1816. * @returns {Object} Returns the new set.
  1817. */
  1818. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  1819. return new Set(values);
  1820. };
  1821. /**
  1822. * Gets the data for `map`.
  1823. *
  1824. * @private
  1825. * @param {Object} map The map to query.
  1826. * @param {string} key The reference key.
  1827. * @returns {*} Returns the map data.
  1828. */
  1829. function getMapData(map, key) {
  1830. var data = map.__data__;
  1831. return isKeyable(key)
  1832. ? data[typeof key == 'string' ? 'string' : 'hash']
  1833. : data.map;
  1834. }
  1835. /**
  1836. * Gets the native function at `key` of `object`.
  1837. *
  1838. * @private
  1839. * @param {Object} object The object to query.
  1840. * @param {string} key The key of the method to get.
  1841. * @returns {*} Returns the function if it's native, else `undefined`.
  1842. */
  1843. function getNative(object, key) {
  1844. var value = getValue(object, key);
  1845. return baseIsNative(value) ? value : undefined;
  1846. }
  1847. /**
  1848. * Checks if `value` is suitable for use as unique object key.
  1849. *
  1850. * @private
  1851. * @param {*} value The value to check.
  1852. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  1853. */
  1854. function isKeyable(value) {
  1855. var type = typeof value;
  1856. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  1857. ? (value !== '__proto__')
  1858. : (value === null);
  1859. }
  1860. /**
  1861. * Checks if `func` has its source masked.
  1862. *
  1863. * @private
  1864. * @param {Function} func The function to check.
  1865. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  1866. */
  1867. function isMasked(func) {
  1868. return !!maskSrcKey && (maskSrcKey in func);
  1869. }
  1870. /**
  1871. * Converts `func` to its source code.
  1872. *
  1873. * @private
  1874. * @param {Function} func The function to process.
  1875. * @returns {string} Returns the source code.
  1876. */
  1877. function toSource(func) {
  1878. if (func != null) {
  1879. try {
  1880. return funcToString.call(func);
  1881. } catch (e) {}
  1882. try {
  1883. return (func + '');
  1884. } catch (e) {}
  1885. }
  1886. return '';
  1887. }
  1888. /**
  1889. * Creates a duplicate-free version of an array, using
  1890. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  1891. * for equality comparisons, in which only the first occurrence of each
  1892. * element is kept.
  1893. *
  1894. * @static
  1895. * @memberOf _
  1896. * @since 0.1.0
  1897. * @category Array
  1898. * @param {Array} array The array to inspect.
  1899. * @returns {Array} Returns the new duplicate free array.
  1900. * @example
  1901. *
  1902. * _.uniq([2, 1, 2]);
  1903. * // => [2, 1]
  1904. */
  1905. function uniq(array) {
  1906. return (array && array.length)
  1907. ? baseUniq(array)
  1908. : [];
  1909. }
  1910. /**
  1911. * Performs a
  1912. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  1913. * comparison between two values to determine if they are equivalent.
  1914. *
  1915. * @static
  1916. * @memberOf _
  1917. * @since 4.0.0
  1918. * @category Lang
  1919. * @param {*} value The value to compare.
  1920. * @param {*} other The other value to compare.
  1921. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  1922. * @example
  1923. *
  1924. * var object = { 'a': 1 };
  1925. * var other = { 'a': 1 };
  1926. *
  1927. * _.eq(object, object);
  1928. * // => true
  1929. *
  1930. * _.eq(object, other);
  1931. * // => false
  1932. *
  1933. * _.eq('a', 'a');
  1934. * // => true
  1935. *
  1936. * _.eq('a', Object('a'));
  1937. * // => false
  1938. *
  1939. * _.eq(NaN, NaN);
  1940. * // => true
  1941. */
  1942. function eq(value, other) {
  1943. return value === other || (value !== value && other !== other);
  1944. }
  1945. /**
  1946. * Checks if `value` is classified as a `Function` object.
  1947. *
  1948. * @static
  1949. * @memberOf _
  1950. * @since 0.1.0
  1951. * @category Lang
  1952. * @param {*} value The value to check.
  1953. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  1954. * @example
  1955. *
  1956. * _.isFunction(_);
  1957. * // => true
  1958. *
  1959. * _.isFunction(/abc/);
  1960. * // => false
  1961. */
  1962. function isFunction(value) {
  1963. // The use of `Object#toString` avoids issues with the `typeof` operator
  1964. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  1965. var tag = isObject(value) ? objectToString.call(value) : '';
  1966. return tag == funcTag || tag == genTag;
  1967. }
  1968. /**
  1969. * Checks if `value` is the
  1970. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  1971. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  1972. *
  1973. * @static
  1974. * @memberOf _
  1975. * @since 0.1.0
  1976. * @category Lang
  1977. * @param {*} value The value to check.
  1978. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  1979. * @example
  1980. *
  1981. * _.isObject({});
  1982. * // => true
  1983. *
  1984. * _.isObject([1, 2, 3]);
  1985. * // => true
  1986. *
  1987. * _.isObject(_.noop);
  1988. * // => true
  1989. *
  1990. * _.isObject(null);
  1991. * // => false
  1992. */
  1993. function isObject(value) {
  1994. var type = typeof value;
  1995. return !!value && (type == 'object' || type == 'function');
  1996. }
  1997. /**
  1998. * This method returns `undefined`.
  1999. *
  2000. * @static
  2001. * @memberOf _
  2002. * @since 2.3.0
  2003. * @category Util
  2004. * @example
  2005. *
  2006. * _.times(2, _.noop);
  2007. * // => [undefined, undefined]
  2008. */
  2009. function noop() {
  2010. // No operation performed.
  2011. }
  2012. module.exports = uniq;
  2013. /***/ }),
  2014. /***/ 129:
  2015. /***/ (function(module) {
  2016. module.exports = require("child_process");
  2017. /***/ }),
  2018. /***/ 143:
  2019. /***/ (function(module, __unusedexports, __webpack_require__) {
  2020. module.exports = withAuthorizationPrefix;
  2021. const atob = __webpack_require__(368);
  2022. const REGEX_IS_BASIC_AUTH = /^[\w-]+:/;
  2023. function withAuthorizationPrefix(authorization) {
  2024. if (/^(basic|bearer|token) /i.test(authorization)) {
  2025. return authorization;
  2026. }
  2027. try {
  2028. if (REGEX_IS_BASIC_AUTH.test(atob(authorization))) {
  2029. return `basic ${authorization}`;
  2030. }
  2031. } catch (error) {}
  2032. if (authorization.split(/\./).length === 3) {
  2033. return `bearer ${authorization}`;
  2034. }
  2035. return `token ${authorization}`;
  2036. }
  2037. /***/ }),
  2038. /***/ 145:
  2039. /***/ (function(module, __unusedexports, __webpack_require__) {
  2040. "use strict";
  2041. const pump = __webpack_require__(453);
  2042. const bufferStream = __webpack_require__(966);
  2043. class MaxBufferError extends Error {
  2044. constructor() {
  2045. super('maxBuffer exceeded');
  2046. this.name = 'MaxBufferError';
  2047. }
  2048. }
  2049. function getStream(inputStream, options) {
  2050. if (!inputStream) {
  2051. return Promise.reject(new Error('Expected a stream'));
  2052. }
  2053. options = Object.assign({maxBuffer: Infinity}, options);
  2054. const {maxBuffer} = options;
  2055. let stream;
  2056. return new Promise((resolve, reject) => {
  2057. const rejectPromise = error => {
  2058. if (error) { // A null check
  2059. error.bufferedData = stream.getBufferedValue();
  2060. }
  2061. reject(error);
  2062. };
  2063. stream = pump(inputStream, bufferStream(options), error => {
  2064. if (error) {
  2065. rejectPromise(error);
  2066. return;
  2067. }
  2068. resolve();
  2069. });
  2070. stream.on('data', () => {
  2071. if (stream.getBufferedLength() > maxBuffer) {
  2072. rejectPromise(new MaxBufferError());
  2073. }
  2074. });
  2075. }).then(() => stream.getBufferedValue());
  2076. }
  2077. module.exports = getStream;
  2078. module.exports.buffer = (stream, options) => getStream(stream, Object.assign({}, options, {encoding: 'buffer'}));
  2079. module.exports.array = (stream, options) => getStream(stream, Object.assign({}, options, {array: true}));
  2080. module.exports.MaxBufferError = MaxBufferError;
  2081. /***/ }),
  2082. /***/ 148:
  2083. /***/ (function(module, __unusedexports, __webpack_require__) {
  2084. module.exports = paginatePlugin;
  2085. const iterator = __webpack_require__(8);
  2086. const paginate = __webpack_require__(807);
  2087. function paginatePlugin(octokit) {
  2088. octokit.paginate = paginate.bind(null, octokit);
  2089. octokit.paginate.iterator = iterator.bind(null, octokit);
  2090. }
  2091. /***/ }),
  2092. /***/ 168:
  2093. /***/ (function(module) {
  2094. "use strict";
  2095. const alias = ['stdin', 'stdout', 'stderr'];
  2096. const hasAlias = opts => alias.some(x => Boolean(opts[x]));
  2097. module.exports = opts => {
  2098. if (!opts) {
  2099. return null;
  2100. }
  2101. if (opts.stdio && hasAlias(opts)) {
  2102. throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${alias.map(x => `\`${x}\``).join(', ')}`);
  2103. }
  2104. if (typeof opts.stdio === 'string') {
  2105. return opts.stdio;
  2106. }
  2107. const stdio = opts.stdio || [];
  2108. if (!Array.isArray(stdio)) {
  2109. throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``);
  2110. }
  2111. const result = [];
  2112. const len = Math.max(stdio.length, alias.length);
  2113. for (let i = 0; i < len; i++) {
  2114. let value = null;
  2115. if (stdio[i] !== undefined) {
  2116. value = stdio[i];
  2117. } else if (opts[alias[i]] !== undefined) {
  2118. value = opts[alias[i]];
  2119. }
  2120. result[i] = value;
  2121. }
  2122. return result;
  2123. };
  2124. /***/ }),
  2125. /***/ 190:
  2126. /***/ (function(module, __unusedexports, __webpack_require__) {
  2127. module.exports = authenticationPlugin;
  2128. const beforeRequest = __webpack_require__(863);
  2129. const requestError = __webpack_require__(991);
  2130. const validate = __webpack_require__(954);
  2131. function authenticationPlugin(octokit, options) {
  2132. if (!options.auth) {
  2133. return;
  2134. }
  2135. validate(options.auth);
  2136. const state = {
  2137. octokit,
  2138. auth: options.auth
  2139. };
  2140. octokit.hook.before("request", beforeRequest.bind(null, state));
  2141. octokit.hook.error("request", requestError.bind(null, state));
  2142. }
  2143. /***/ }),
  2144. /***/ 197:
  2145. /***/ (function(module, __unusedexports, __webpack_require__) {
  2146. module.exports = isexe
  2147. isexe.sync = sync
  2148. var fs = __webpack_require__(747)
  2149. function isexe (path, options, cb) {
  2150. fs.stat(path, function (er, stat) {
  2151. cb(er, er ? false : checkStat(stat, options))
  2152. })
  2153. }
  2154. function sync (path, options) {
  2155. return checkStat(fs.statSync(path), options)
  2156. }
  2157. function checkStat (stat, options) {
  2158. return stat.isFile() && checkMode(stat, options)
  2159. }
  2160. function checkMode (stat, options) {
  2161. var mod = stat.mode
  2162. var uid = stat.uid
  2163. var gid = stat.gid
  2164. var myUid = options.uid !== undefined ?
  2165. options.uid : process.getuid && process.getuid()
  2166. var myGid = options.gid !== undefined ?
  2167. options.gid : process.getgid && process.getgid()
  2168. var u = parseInt('100', 8)
  2169. var g = parseInt('010', 8)
  2170. var o = parseInt('001', 8)
  2171. var ug = u | g
  2172. var ret = (mod & o) ||
  2173. (mod & g) && gid === myGid ||
  2174. (mod & u) && uid === myUid ||
  2175. (mod & ug) && myUid === 0
  2176. return ret
  2177. }
  2178. /***/ }),
  2179. /***/ 198:
  2180. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2181. "use strict";
  2182. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2183. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2184. return new (P || (P = Promise))(function (resolve, reject) {
  2185. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2186. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2187. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2188. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2189. });
  2190. };
  2191. var __importStar = (this && this.__importStar) || function (mod) {
  2192. if (mod && mod.__esModule) return mod;
  2193. var result = {};
  2194. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  2195. result["default"] = mod;
  2196. return result;
  2197. };
  2198. Object.defineProperty(exports, "__esModule", { value: true });
  2199. const core = __importStar(__webpack_require__(470));
  2200. const coreCommand = __importStar(__webpack_require__(431));
  2201. const gitSourceProvider = __importStar(__webpack_require__(293));
  2202. const inputHelper = __importStar(__webpack_require__(821));
  2203. const path = __importStar(__webpack_require__(622));
  2204. const cleanupRepositoryPath = process.env['STATE_repositoryPath'];
  2205. function run() {
  2206. return __awaiter(this, void 0, void 0, function* () {
  2207. try {
  2208. const sourceSettings = inputHelper.getInputs();
  2209. try {
  2210. // Register problem matcher
  2211. coreCommand.issueCommand('add-matcher', {}, path.join(__dirname, 'problem-matcher.json'));
  2212. // Get sources
  2213. yield gitSourceProvider.getSource(sourceSettings);
  2214. }
  2215. finally {
  2216. // Unregister problem matcher
  2217. coreCommand.issueCommand('remove-matcher', { owner: 'checkout-git' }, '');
  2218. }
  2219. }
  2220. catch (error) {
  2221. core.setFailed(error.message);
  2222. }
  2223. });
  2224. }
  2225. function cleanup() {
  2226. return __awaiter(this, void 0, void 0, function* () {
  2227. try {
  2228. yield gitSourceProvider.cleanup(cleanupRepositoryPath);
  2229. }
  2230. catch (error) {
  2231. core.warning(error.message);
  2232. }
  2233. });
  2234. }
  2235. // Main
  2236. if (!cleanupRepositoryPath) {
  2237. run();
  2238. }
  2239. // Post
  2240. else {
  2241. cleanup();
  2242. }
  2243. /***/ }),
  2244. /***/ 211:
  2245. /***/ (function(module) {
  2246. module.exports = require("https");
  2247. /***/ }),
  2248. /***/ 215:
  2249. /***/ (function(module) {
  2250. 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"};
  2251. /***/ }),
  2252. /***/ 227:
  2253. /***/ (function(__unusedmodule, exports) {
  2254. "use strict";
  2255. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2256. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2257. return new (P || (P = Promise))(function (resolve, reject) {
  2258. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2259. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2260. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2261. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2262. });
  2263. };
  2264. Object.defineProperty(exports, "__esModule", { value: true });
  2265. function getCheckoutInfo(git, ref, commit) {
  2266. return __awaiter(this, void 0, void 0, function* () {
  2267. if (!git) {
  2268. throw new Error('Arg git cannot be empty');
  2269. }
  2270. if (!ref && !commit) {
  2271. throw new Error('Args ref and commit cannot both be empty');
  2272. }
  2273. const result = {};
  2274. const upperRef = (ref || '').toUpperCase();
  2275. // SHA only
  2276. if (!ref) {
  2277. result.ref = commit;
  2278. }
  2279. // refs/heads/
  2280. else if (upperRef.startsWith('REFS/HEADS/')) {
  2281. const branch = ref.substring('refs/heads/'.length);
  2282. result.ref = branch;
  2283. result.startPoint = `refs/remotes/origin/${branch}`;
  2284. }
  2285. // refs/pull/
  2286. else if (upperRef.startsWith('REFS/PULL/')) {
  2287. const branch = ref.substring('refs/pull/'.length);
  2288. result.ref = `refs/remotes/pull/${branch}`;
  2289. }
  2290. // refs/tags/
  2291. else if (upperRef.startsWith('REFS/')) {
  2292. result.ref = ref;
  2293. }
  2294. // Unqualified ref, check for a matching branch or tag
  2295. else {
  2296. if (yield git.branchExists(true, `origin/${ref}`)) {
  2297. result.ref = ref;
  2298. result.startPoint = `refs/remotes/origin/${ref}`;
  2299. }
  2300. else if (yield git.tagExists(`${ref}`)) {
  2301. result.ref = `refs/tags/${ref}`;
  2302. }
  2303. else {
  2304. throw new Error(`A branch or tag with the name '${ref}' could not be found`);
  2305. }
  2306. }
  2307. return result;
  2308. });
  2309. }
  2310. exports.getCheckoutInfo = getCheckoutInfo;
  2311. function getRefSpec(ref, commit) {
  2312. if (!ref && !commit) {
  2313. throw new Error('Args ref and commit cannot both be empty');
  2314. }
  2315. const upperRef = (ref || '').toUpperCase();
  2316. // SHA
  2317. if (commit) {
  2318. // refs/heads
  2319. if (upperRef.startsWith('REFS/HEADS/')) {
  2320. const branch = ref.substring('refs/heads/'.length);
  2321. return [`+${commit}:refs/remotes/origin/${branch}`];
  2322. }
  2323. // refs/pull/
  2324. else if (upperRef.startsWith('REFS/PULL/')) {
  2325. const branch = ref.substring('refs/pull/'.length);
  2326. return [`+${commit}:refs/remotes/pull/${branch}`];
  2327. }
  2328. // refs/tags/
  2329. else if (upperRef.startsWith('REFS/TAGS/')) {
  2330. return [`+${commit}:${ref}`];
  2331. }
  2332. // Otherwise no destination ref
  2333. else {
  2334. return [commit];
  2335. }
  2336. }
  2337. // Unqualified ref, check for a matching branch or tag
  2338. else if (!upperRef.startsWith('REFS/')) {
  2339. return [
  2340. `+refs/heads/${ref}*:refs/remotes/origin/${ref}*`,
  2341. `+refs/tags/${ref}*:refs/tags/${ref}*`
  2342. ];
  2343. }
  2344. // refs/heads/
  2345. else if (upperRef.startsWith('REFS/HEADS/')) {
  2346. const branch = ref.substring('refs/heads/'.length);
  2347. return [`+${ref}:refs/remotes/origin/${branch}`];
  2348. }
  2349. // refs/pull/
  2350. else if (upperRef.startsWith('REFS/PULL/')) {
  2351. const branch = ref.substring('refs/pull/'.length);
  2352. return [`+${ref}:refs/remotes/pull/${branch}`];
  2353. }
  2354. // refs/tags/
  2355. else {
  2356. return [`+${ref}:${ref}`];
  2357. }
  2358. }
  2359. exports.getRefSpec = getRefSpec;
  2360. /***/ }),
  2361. /***/ 248:
  2362. /***/ (function(module, __unusedexports, __webpack_require__) {
  2363. module.exports = octokitRegisterEndpoints;
  2364. const registerEndpoints = __webpack_require__(899);
  2365. function octokitRegisterEndpoints(octokit) {
  2366. octokit.registerEndpoints = registerEndpoints.bind(null, octokit);
  2367. }
  2368. /***/ }),
  2369. /***/ 260:
  2370. /***/ (function(module, __unusedexports, __webpack_require__) {
  2371. // Note: since nyc uses this module to output coverage, any lines
  2372. // that are in the direct sync flow of nyc's outputCoverage are
  2373. // ignored, since we can never get coverage for them.
  2374. var assert = __webpack_require__(357)
  2375. var signals = __webpack_require__(654)
  2376. var EE = __webpack_require__(614)
  2377. /* istanbul ignore if */
  2378. if (typeof EE !== 'function') {
  2379. EE = EE.EventEmitter
  2380. }
  2381. var emitter
  2382. if (process.__signal_exit_emitter__) {
  2383. emitter = process.__signal_exit_emitter__
  2384. } else {
  2385. emitter = process.__signal_exit_emitter__ = new EE()
  2386. emitter.count = 0
  2387. emitter.emitted = {}
  2388. }
  2389. // Because this emitter is a global, we have to check to see if a
  2390. // previous version of this library failed to enable infinite listeners.
  2391. // I know what you're about to say. But literally everything about
  2392. // signal-exit is a compromise with evil. Get used to it.
  2393. if (!emitter.infinite) {
  2394. emitter.setMaxListeners(Infinity)
  2395. emitter.infinite = true
  2396. }
  2397. module.exports = function (cb, opts) {
  2398. assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler')
  2399. if (loaded === false) {
  2400. load()
  2401. }
  2402. var ev = 'exit'
  2403. if (opts && opts.alwaysLast) {
  2404. ev = 'afterexit'
  2405. }
  2406. var remove = function () {
  2407. emitter.removeListener(ev, cb)
  2408. if (emitter.listeners('exit').length === 0 &&
  2409. emitter.listeners('afterexit').length === 0) {
  2410. unload()
  2411. }
  2412. }
  2413. emitter.on(ev, cb)
  2414. return remove
  2415. }
  2416. module.exports.unload = unload
  2417. function unload () {
  2418. if (!loaded) {
  2419. return
  2420. }
  2421. loaded = false
  2422. signals.forEach(function (sig) {
  2423. try {
  2424. process.removeListener(sig, sigListeners[sig])
  2425. } catch (er) {}
  2426. })
  2427. process.emit = originalProcessEmit
  2428. process.reallyExit = originalProcessReallyExit
  2429. emitter.count -= 1
  2430. }
  2431. function emit (event, code, signal) {
  2432. if (emitter.emitted[event]) {
  2433. return
  2434. }
  2435. emitter.emitted[event] = true
  2436. emitter.emit(event, code, signal)
  2437. }
  2438. // { <signal>: <listener fn>, ... }
  2439. var sigListeners = {}
  2440. signals.forEach(function (sig) {
  2441. sigListeners[sig] = function listener () {
  2442. // If there are no other listeners, an exit is coming!
  2443. // Simplest way: remove us and then re-send the signal.
  2444. // We know that this will kill the process, so we can
  2445. // safely emit now.
  2446. var listeners = process.listeners(sig)
  2447. if (listeners.length === emitter.count) {
  2448. unload()
  2449. emit('exit', null, sig)
  2450. /* istanbul ignore next */
  2451. emit('afterexit', null, sig)
  2452. /* istanbul ignore next */
  2453. process.kill(process.pid, sig)
  2454. }
  2455. }
  2456. })
  2457. module.exports.signals = function () {
  2458. return signals
  2459. }
  2460. module.exports.load = load
  2461. var loaded = false
  2462. function load () {
  2463. if (loaded) {
  2464. return
  2465. }
  2466. loaded = true
  2467. // This is the number of onSignalExit's that are in play.
  2468. // It's important so that we can count the correct number of
  2469. // listeners on signals, and don't wait for the other one to
  2470. // handle it instead of us.
  2471. emitter.count += 1
  2472. signals = signals.filter(function (sig) {
  2473. try {
  2474. process.on(sig, sigListeners[sig])
  2475. return true
  2476. } catch (er) {
  2477. return false
  2478. }
  2479. })
  2480. process.emit = processEmit
  2481. process.reallyExit = processReallyExit
  2482. }
  2483. var originalProcessReallyExit = process.reallyExit
  2484. function processReallyExit (code) {
  2485. process.exitCode = code || 0
  2486. emit('exit', process.exitCode, null)
  2487. /* istanbul ignore next */
  2488. emit('afterexit', process.exitCode, null)
  2489. /* istanbul ignore next */
  2490. originalProcessReallyExit.call(process, process.exitCode)
  2491. }
  2492. var originalProcessEmit = process.emit
  2493. function processEmit (ev, arg) {
  2494. if (ev === 'exit') {
  2495. if (arg !== undefined) {
  2496. process.exitCode = arg
  2497. }
  2498. var ret = originalProcessEmit.apply(this, arguments)
  2499. emit('exit', process.exitCode, null)
  2500. /* istanbul ignore next */
  2501. emit('afterexit', process.exitCode, null)
  2502. return ret
  2503. } else {
  2504. return originalProcessEmit.apply(this, arguments)
  2505. }
  2506. }
  2507. /***/ }),
  2508. /***/ 262:
  2509. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2510. "use strict";
  2511. Object.defineProperty(exports, "__esModule", { value: true });
  2512. const fs_1 = __webpack_require__(747);
  2513. const os_1 = __webpack_require__(87);
  2514. class Context {
  2515. /**
  2516. * Hydrate the context from the environment
  2517. */
  2518. constructor() {
  2519. this.payload = {};
  2520. if (process.env.GITHUB_EVENT_PATH) {
  2521. if (fs_1.existsSync(process.env.GITHUB_EVENT_PATH)) {
  2522. this.payload = JSON.parse(fs_1.readFileSync(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' }));
  2523. }
  2524. else {
  2525. const path = process.env.GITHUB_EVENT_PATH;
  2526. process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${os_1.EOL}`);
  2527. }
  2528. }
  2529. this.eventName = process.env.GITHUB_EVENT_NAME;
  2530. this.sha = process.env.GITHUB_SHA;
  2531. this.ref = process.env.GITHUB_REF;
  2532. this.workflow = process.env.GITHUB_WORKFLOW;
  2533. this.action = process.env.GITHUB_ACTION;
  2534. this.actor = process.env.GITHUB_ACTOR;
  2535. }
  2536. get issue() {
  2537. const payload = this.payload;
  2538. return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pullRequest || payload).number });
  2539. }
  2540. get repo() {
  2541. if (process.env.GITHUB_REPOSITORY) {
  2542. const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');
  2543. return { owner, repo };
  2544. }
  2545. if (this.payload.repository) {
  2546. return {
  2547. owner: this.payload.repository.owner.login,
  2548. repo: this.payload.repository.name
  2549. };
  2550. }
  2551. throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'");
  2552. }
  2553. }
  2554. exports.Context = Context;
  2555. //# sourceMappingURL=context.js.map
  2556. /***/ }),
  2557. /***/ 265:
  2558. /***/ (function(module, __unusedexports, __webpack_require__) {
  2559. module.exports = getPage
  2560. const deprecate = __webpack_require__(370)
  2561. const getPageLinks = __webpack_require__(577)
  2562. const HttpError = __webpack_require__(297)
  2563. function getPage (octokit, link, which, headers) {
  2564. 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.`)
  2565. const url = getPageLinks(link)[which]
  2566. if (!url) {
  2567. const urlError = new HttpError(`No ${which} page found`, 404)
  2568. return Promise.reject(urlError)
  2569. }
  2570. const requestOptions = {
  2571. url,
  2572. headers: applyAcceptHeader(link, headers)
  2573. }
  2574. const promise = octokit.request(requestOptions)
  2575. return promise
  2576. }
  2577. function applyAcceptHeader (res, headers) {
  2578. const previous = res.headers && res.headers['x-github-media-type']
  2579. if (!previous || (headers && headers.accept)) {
  2580. return headers
  2581. }
  2582. headers = headers || {}
  2583. headers.accept = 'application/vnd.' + previous
  2584. .replace('; param=', '.')
  2585. .replace('; format=', '+')
  2586. return headers
  2587. }
  2588. /***/ }),
  2589. /***/ 280:
  2590. /***/ (function(module, exports) {
  2591. exports = module.exports = SemVer
  2592. var debug
  2593. /* istanbul ignore next */
  2594. if (typeof process === 'object' &&
  2595. process.env &&
  2596. process.env.NODE_DEBUG &&
  2597. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  2598. debug = function () {
  2599. var args = Array.prototype.slice.call(arguments, 0)
  2600. args.unshift('SEMVER')
  2601. console.log.apply(console, args)
  2602. }
  2603. } else {
  2604. debug = function () {}
  2605. }
  2606. // Note: this is the semver.org version of the spec that it implements
  2607. // Not necessarily the package version of this code.
  2608. exports.SEMVER_SPEC_VERSION = '2.0.0'
  2609. var MAX_LENGTH = 256
  2610. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  2611. /* istanbul ignore next */ 9007199254740991
  2612. // Max safe segment length for coercion.
  2613. var MAX_SAFE_COMPONENT_LENGTH = 16
  2614. // The actual regexps go on exports.re
  2615. var re = exports.re = []
  2616. var src = exports.src = []
  2617. var R = 0
  2618. // The following Regular Expressions can be used for tokenizing,
  2619. // validating, and parsing SemVer version strings.
  2620. // ## Numeric Identifier
  2621. // A single `0`, or a non-zero digit followed by zero or more digits.
  2622. var NUMERICIDENTIFIER = R++
  2623. src[NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  2624. var NUMERICIDENTIFIERLOOSE = R++
  2625. src[NUMERICIDENTIFIERLOOSE] = '[0-9]+'
  2626. // ## Non-numeric Identifier
  2627. // Zero or more digits, followed by a letter or hyphen, and then zero or
  2628. // more letters, digits, or hyphens.
  2629. var NONNUMERICIDENTIFIER = R++
  2630. src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
  2631. // ## Main Version
  2632. // Three dot-separated numeric identifiers.
  2633. var MAINVERSION = R++
  2634. src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' +
  2635. '(' + src[NUMERICIDENTIFIER] + ')\\.' +
  2636. '(' + src[NUMERICIDENTIFIER] + ')'
  2637. var MAINVERSIONLOOSE = R++
  2638. src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
  2639. '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
  2640. '(' + src[NUMERICIDENTIFIERLOOSE] + ')'
  2641. // ## Pre-release Version Identifier
  2642. // A numeric identifier, or a non-numeric identifier.
  2643. var PRERELEASEIDENTIFIER = R++
  2644. src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] +
  2645. '|' + src[NONNUMERICIDENTIFIER] + ')'
  2646. var PRERELEASEIDENTIFIERLOOSE = R++
  2647. src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] +
  2648. '|' + src[NONNUMERICIDENTIFIER] + ')'
  2649. // ## Pre-release Version
  2650. // Hyphen, followed by one or more dot-separated pre-release version
  2651. // identifiers.
  2652. var PRERELEASE = R++
  2653. src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] +
  2654. '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))'
  2655. var PRERELEASELOOSE = R++
  2656. src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] +
  2657. '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))'
  2658. // ## Build Metadata Identifier
  2659. // Any combination of digits, letters, or hyphens.
  2660. var BUILDIDENTIFIER = R++
  2661. src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
  2662. // ## Build Metadata
  2663. // Plus sign, followed by one or more period-separated build metadata
  2664. // identifiers.
  2665. var BUILD = R++
  2666. src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] +
  2667. '(?:\\.' + src[BUILDIDENTIFIER] + ')*))'
  2668. // ## Full Version String
  2669. // A main version, followed optionally by a pre-release version and
  2670. // build metadata.
  2671. // Note that the only major, minor, patch, and pre-release sections of
  2672. // the version string are capturing groups. The build metadata is not a
  2673. // capturing group, because it should not ever be used in version
  2674. // comparison.
  2675. var FULL = R++
  2676. var FULLPLAIN = 'v?' + src[MAINVERSION] +
  2677. src[PRERELEASE] + '?' +
  2678. src[BUILD] + '?'
  2679. src[FULL] = '^' + FULLPLAIN + '$'
  2680. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  2681. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  2682. // common in the npm registry.
  2683. var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] +
  2684. src[PRERELEASELOOSE] + '?' +
  2685. src[BUILD] + '?'
  2686. var LOOSE = R++
  2687. src[LOOSE] = '^' + LOOSEPLAIN + '$'
  2688. var GTLT = R++
  2689. src[GTLT] = '((?:<|>)?=?)'
  2690. // Something like "2.*" or "1.2.x".
  2691. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  2692. // Only the first item is strictly required.
  2693. var XRANGEIDENTIFIERLOOSE = R++
  2694. src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  2695. var XRANGEIDENTIFIER = R++
  2696. src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*'
  2697. var XRANGEPLAIN = R++
  2698. src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' +
  2699. '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
  2700. '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
  2701. '(?:' + src[PRERELEASE] + ')?' +
  2702. src[BUILD] + '?' +
  2703. ')?)?'
  2704. var XRANGEPLAINLOOSE = R++
  2705. src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  2706. '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  2707. '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  2708. '(?:' + src[PRERELEASELOOSE] + ')?' +
  2709. src[BUILD] + '?' +
  2710. ')?)?'
  2711. var XRANGE = R++
  2712. src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'
  2713. var XRANGELOOSE = R++
  2714. src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$'
  2715. // Coercion.
  2716. // Extract anything that could conceivably be a part of a valid semver
  2717. var COERCE = R++
  2718. src[COERCE] = '(?:^|[^\\d])' +
  2719. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  2720. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  2721. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  2722. '(?:$|[^\\d])'
  2723. // Tilde ranges.
  2724. // Meaning is "reasonably at or greater than"
  2725. var LONETILDE = R++
  2726. src[LONETILDE] = '(?:~>?)'
  2727. var TILDETRIM = R++
  2728. src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+'
  2729. re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g')
  2730. var tildeTrimReplace = '$1~'
  2731. var TILDE = R++
  2732. src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'
  2733. var TILDELOOSE = R++
  2734. src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'
  2735. // Caret ranges.
  2736. // Meaning is "at least and backwards compatible with"
  2737. var LONECARET = R++
  2738. src[LONECARET] = '(?:\\^)'
  2739. var CARETTRIM = R++
  2740. src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+'
  2741. re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g')
  2742. var caretTrimReplace = '$1^'
  2743. var CARET = R++
  2744. src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$'
  2745. var CARETLOOSE = R++
  2746. src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$'
  2747. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  2748. var COMPARATORLOOSE = R++
  2749. src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$'
  2750. var COMPARATOR = R++
  2751. src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$'
  2752. // An expression to strip any whitespace between the gtlt and the thing
  2753. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  2754. var COMPARATORTRIM = R++
  2755. src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] +
  2756. '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'
  2757. // this one has to use the /g flag
  2758. re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g')
  2759. var comparatorTrimReplace = '$1$2$3'
  2760. // Something like `1.2.3 - 1.2.4`
  2761. // Note that these all use the loose form, because they'll be
  2762. // checked against either the strict or loose comparator form
  2763. // later.
  2764. var HYPHENRANGE = R++
  2765. src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' +
  2766. '\\s+-\\s+' +
  2767. '(' + src[XRANGEPLAIN] + ')' +
  2768. '\\s*$'
  2769. var HYPHENRANGELOOSE = R++
  2770. src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' +
  2771. '\\s+-\\s+' +
  2772. '(' + src[XRANGEPLAINLOOSE] + ')' +
  2773. '\\s*$'
  2774. // Star ranges basically just allow anything at all.
  2775. var STAR = R++
  2776. src[STAR] = '(<|>)?=?\\s*\\*'
  2777. // Compile to actual regexp objects.
  2778. // All are flag-free, unless they were created above with a flag.
  2779. for (var i = 0; i < R; i++) {
  2780. debug(i, src[i])
  2781. if (!re[i]) {
  2782. re[i] = new RegExp(src[i])
  2783. }
  2784. }
  2785. exports.parse = parse
  2786. function parse (version, options) {
  2787. if (!options || typeof options !== 'object') {
  2788. options = {
  2789. loose: !!options,
  2790. includePrerelease: false
  2791. }
  2792. }
  2793. if (version instanceof SemVer) {
  2794. return version
  2795. }
  2796. if (typeof version !== 'string') {
  2797. return null
  2798. }
  2799. if (version.length > MAX_LENGTH) {
  2800. return null
  2801. }
  2802. var r = options.loose ? re[LOOSE] : re[FULL]
  2803. if (!r.test(version)) {
  2804. return null
  2805. }
  2806. try {
  2807. return new SemVer(version, options)
  2808. } catch (er) {
  2809. return null
  2810. }
  2811. }
  2812. exports.valid = valid
  2813. function valid (version, options) {
  2814. var v = parse(version, options)
  2815. return v ? v.version : null
  2816. }
  2817. exports.clean = clean
  2818. function clean (version, options) {
  2819. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  2820. return s ? s.version : null
  2821. }
  2822. exports.SemVer = SemVer
  2823. function SemVer (version, options) {
  2824. if (!options || typeof options !== 'object') {
  2825. options = {
  2826. loose: !!options,
  2827. includePrerelease: false
  2828. }
  2829. }
  2830. if (version instanceof SemVer) {
  2831. if (version.loose === options.loose) {
  2832. return version
  2833. } else {
  2834. version = version.version
  2835. }
  2836. } else if (typeof version !== 'string') {
  2837. throw new TypeError('Invalid Version: ' + version)
  2838. }
  2839. if (version.length > MAX_LENGTH) {
  2840. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  2841. }
  2842. if (!(this instanceof SemVer)) {
  2843. return new SemVer(version, options)
  2844. }
  2845. debug('SemVer', version, options)
  2846. this.options = options
  2847. this.loose = !!options.loose
  2848. var m = version.trim().match(options.loose ? re[LOOSE] : re[FULL])
  2849. if (!m) {
  2850. throw new TypeError('Invalid Version: ' + version)
  2851. }
  2852. this.raw = version
  2853. // these are actually numbers
  2854. this.major = +m[1]
  2855. this.minor = +m[2]
  2856. this.patch = +m[3]
  2857. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  2858. throw new TypeError('Invalid major version')
  2859. }
  2860. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  2861. throw new TypeError('Invalid minor version')
  2862. }
  2863. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  2864. throw new TypeError('Invalid patch version')
  2865. }
  2866. // numberify any prerelease numeric ids
  2867. if (!m[4]) {
  2868. this.prerelease = []
  2869. } else {
  2870. this.prerelease = m[4].split('.').map(function (id) {
  2871. if (/^[0-9]+$/.test(id)) {
  2872. var num = +id
  2873. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  2874. return num
  2875. }
  2876. }
  2877. return id
  2878. })
  2879. }
  2880. this.build = m[5] ? m[5].split('.') : []
  2881. this.format()
  2882. }
  2883. SemVer.prototype.format = function () {
  2884. this.version = this.major + '.' + this.minor + '.' + this.patch
  2885. if (this.prerelease.length) {
  2886. this.version += '-' + this.prerelease.join('.')
  2887. }
  2888. return this.version
  2889. }
  2890. SemVer.prototype.toString = function () {
  2891. return this.version
  2892. }
  2893. SemVer.prototype.compare = function (other) {
  2894. debug('SemVer.compare', this.version, this.options, other)
  2895. if (!(other instanceof SemVer)) {
  2896. other = new SemVer(other, this.options)
  2897. }
  2898. return this.compareMain(other) || this.comparePre(other)
  2899. }
  2900. SemVer.prototype.compareMain = function (other) {
  2901. if (!(other instanceof SemVer)) {
  2902. other = new SemVer(other, this.options)
  2903. }
  2904. return compareIdentifiers(this.major, other.major) ||
  2905. compareIdentifiers(this.minor, other.minor) ||
  2906. compareIdentifiers(this.patch, other.patch)
  2907. }
  2908. SemVer.prototype.comparePre = function (other) {
  2909. if (!(other instanceof SemVer)) {
  2910. other = new SemVer(other, this.options)
  2911. }
  2912. // NOT having a prerelease is > having one
  2913. if (this.prerelease.length && !other.prerelease.length) {
  2914. return -1
  2915. } else if (!this.prerelease.length && other.prerelease.length) {
  2916. return 1
  2917. } else if (!this.prerelease.length && !other.prerelease.length) {
  2918. return 0
  2919. }
  2920. var i = 0
  2921. do {
  2922. var a = this.prerelease[i]
  2923. var b = other.prerelease[i]
  2924. debug('prerelease compare', i, a, b)
  2925. if (a === undefined && b === undefined) {
  2926. return 0
  2927. } else if (b === undefined) {
  2928. return 1
  2929. } else if (a === undefined) {
  2930. return -1
  2931. } else if (a === b) {
  2932. continue
  2933. } else {
  2934. return compareIdentifiers(a, b)
  2935. }
  2936. } while (++i)
  2937. }
  2938. // preminor will bump the version up to the next minor release, and immediately
  2939. // down to pre-release. premajor and prepatch work the same way.
  2940. SemVer.prototype.inc = function (release, identifier) {
  2941. switch (release) {
  2942. case 'premajor':
  2943. this.prerelease.length = 0
  2944. this.patch = 0
  2945. this.minor = 0
  2946. this.major++
  2947. this.inc('pre', identifier)
  2948. break
  2949. case 'preminor':
  2950. this.prerelease.length = 0
  2951. this.patch = 0
  2952. this.minor++
  2953. this.inc('pre', identifier)
  2954. break
  2955. case 'prepatch':
  2956. // If this is already a prerelease, it will bump to the next version
  2957. // drop any prereleases that might already exist, since they are not
  2958. // relevant at this point.
  2959. this.prerelease.length = 0
  2960. this.inc('patch', identifier)
  2961. this.inc('pre', identifier)
  2962. break
  2963. // If the input is a non-prerelease version, this acts the same as
  2964. // prepatch.
  2965. case 'prerelease':
  2966. if (this.prerelease.length === 0) {
  2967. this.inc('patch', identifier)
  2968. }
  2969. this.inc('pre', identifier)
  2970. break
  2971. case 'major':
  2972. // If this is a pre-major version, bump up to the same major version.
  2973. // Otherwise increment major.
  2974. // 1.0.0-5 bumps to 1.0.0
  2975. // 1.1.0 bumps to 2.0.0
  2976. if (this.minor !== 0 ||
  2977. this.patch !== 0 ||
  2978. this.prerelease.length === 0) {
  2979. this.major++
  2980. }
  2981. this.minor = 0
  2982. this.patch = 0
  2983. this.prerelease = []
  2984. break
  2985. case 'minor':
  2986. // If this is a pre-minor version, bump up to the same minor version.
  2987. // Otherwise increment minor.
  2988. // 1.2.0-5 bumps to 1.2.0
  2989. // 1.2.1 bumps to 1.3.0
  2990. if (this.patch !== 0 || this.prerelease.length === 0) {
  2991. this.minor++
  2992. }
  2993. this.patch = 0
  2994. this.prerelease = []
  2995. break
  2996. case 'patch':
  2997. // If this is not a pre-release version, it will increment the patch.
  2998. // If it is a pre-release it will bump up to the same patch version.
  2999. // 1.2.0-5 patches to 1.2.0
  3000. // 1.2.0 patches to 1.2.1
  3001. if (this.prerelease.length === 0) {
  3002. this.patch++
  3003. }
  3004. this.prerelease = []
  3005. break
  3006. // This probably shouldn't be used publicly.
  3007. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  3008. case 'pre':
  3009. if (this.prerelease.length === 0) {
  3010. this.prerelease = [0]
  3011. } else {
  3012. var i = this.prerelease.length
  3013. while (--i >= 0) {
  3014. if (typeof this.prerelease[i] === 'number') {
  3015. this.prerelease[i]++
  3016. i = -2
  3017. }
  3018. }
  3019. if (i === -1) {
  3020. // didn't increment anything
  3021. this.prerelease.push(0)
  3022. }
  3023. }
  3024. if (identifier) {
  3025. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  3026. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  3027. if (this.prerelease[0] === identifier) {
  3028. if (isNaN(this.prerelease[1])) {
  3029. this.prerelease = [identifier, 0]
  3030. }
  3031. } else {
  3032. this.prerelease = [identifier, 0]
  3033. }
  3034. }
  3035. break
  3036. default:
  3037. throw new Error('invalid increment argument: ' + release)
  3038. }
  3039. this.format()
  3040. this.raw = this.version
  3041. return this
  3042. }
  3043. exports.inc = inc
  3044. function inc (version, release, loose, identifier) {
  3045. if (typeof (loose) === 'string') {
  3046. identifier = loose
  3047. loose = undefined
  3048. }
  3049. try {
  3050. return new SemVer(version, loose).inc(release, identifier).version
  3051. } catch (er) {
  3052. return null
  3053. }
  3054. }
  3055. exports.diff = diff
  3056. function diff (version1, version2) {
  3057. if (eq(version1, version2)) {
  3058. return null
  3059. } else {
  3060. var v1 = parse(version1)
  3061. var v2 = parse(version2)
  3062. var prefix = ''
  3063. if (v1.prerelease.length || v2.prerelease.length) {
  3064. prefix = 'pre'
  3065. var defaultResult = 'prerelease'
  3066. }
  3067. for (var key in v1) {
  3068. if (key === 'major' || key === 'minor' || key === 'patch') {
  3069. if (v1[key] !== v2[key]) {
  3070. return prefix + key
  3071. }
  3072. }
  3073. }
  3074. return defaultResult // may be undefined
  3075. }
  3076. }
  3077. exports.compareIdentifiers = compareIdentifiers
  3078. var numeric = /^[0-9]+$/
  3079. function compareIdentifiers (a, b) {
  3080. var anum = numeric.test(a)
  3081. var bnum = numeric.test(b)
  3082. if (anum && bnum) {
  3083. a = +a
  3084. b = +b
  3085. }
  3086. return a === b ? 0
  3087. : (anum && !bnum) ? -1
  3088. : (bnum && !anum) ? 1
  3089. : a < b ? -1
  3090. : 1
  3091. }
  3092. exports.rcompareIdentifiers = rcompareIdentifiers
  3093. function rcompareIdentifiers (a, b) {
  3094. return compareIdentifiers(b, a)
  3095. }
  3096. exports.major = major
  3097. function major (a, loose) {
  3098. return new SemVer(a, loose).major
  3099. }
  3100. exports.minor = minor
  3101. function minor (a, loose) {
  3102. return new SemVer(a, loose).minor
  3103. }
  3104. exports.patch = patch
  3105. function patch (a, loose) {
  3106. return new SemVer(a, loose).patch
  3107. }
  3108. exports.compare = compare
  3109. function compare (a, b, loose) {
  3110. return new SemVer(a, loose).compare(new SemVer(b, loose))
  3111. }
  3112. exports.compareLoose = compareLoose
  3113. function compareLoose (a, b) {
  3114. return compare(a, b, true)
  3115. }
  3116. exports.rcompare = rcompare
  3117. function rcompare (a, b, loose) {
  3118. return compare(b, a, loose)
  3119. }
  3120. exports.sort = sort
  3121. function sort (list, loose) {
  3122. return list.sort(function (a, b) {
  3123. return exports.compare(a, b, loose)
  3124. })
  3125. }
  3126. exports.rsort = rsort
  3127. function rsort (list, loose) {
  3128. return list.sort(function (a, b) {
  3129. return exports.rcompare(a, b, loose)
  3130. })
  3131. }
  3132. exports.gt = gt
  3133. function gt (a, b, loose) {
  3134. return compare(a, b, loose) > 0
  3135. }
  3136. exports.lt = lt
  3137. function lt (a, b, loose) {
  3138. return compare(a, b, loose) < 0
  3139. }
  3140. exports.eq = eq
  3141. function eq (a, b, loose) {
  3142. return compare(a, b, loose) === 0
  3143. }
  3144. exports.neq = neq
  3145. function neq (a, b, loose) {
  3146. return compare(a, b, loose) !== 0
  3147. }
  3148. exports.gte = gte
  3149. function gte (a, b, loose) {
  3150. return compare(a, b, loose) >= 0
  3151. }
  3152. exports.lte = lte
  3153. function lte (a, b, loose) {
  3154. return compare(a, b, loose) <= 0
  3155. }
  3156. exports.cmp = cmp
  3157. function cmp (a, op, b, loose) {
  3158. switch (op) {
  3159. case '===':
  3160. if (typeof a === 'object')
  3161. a = a.version
  3162. if (typeof b === 'object')
  3163. b = b.version
  3164. return a === b
  3165. case '!==':
  3166. if (typeof a === 'object')
  3167. a = a.version
  3168. if (typeof b === 'object')
  3169. b = b.version
  3170. return a !== b
  3171. case '':
  3172. case '=':
  3173. case '==':
  3174. return eq(a, b, loose)
  3175. case '!=':
  3176. return neq(a, b, loose)
  3177. case '>':
  3178. return gt(a, b, loose)
  3179. case '>=':
  3180. return gte(a, b, loose)
  3181. case '<':
  3182. return lt(a, b, loose)
  3183. case '<=':
  3184. return lte(a, b, loose)
  3185. default:
  3186. throw new TypeError('Invalid operator: ' + op)
  3187. }
  3188. }
  3189. exports.Comparator = Comparator
  3190. function Comparator (comp, options) {
  3191. if (!options || typeof options !== 'object') {
  3192. options = {
  3193. loose: !!options,
  3194. includePrerelease: false
  3195. }
  3196. }
  3197. if (comp instanceof Comparator) {
  3198. if (comp.loose === !!options.loose) {
  3199. return comp
  3200. } else {
  3201. comp = comp.value
  3202. }
  3203. }
  3204. if (!(this instanceof Comparator)) {
  3205. return new Comparator(comp, options)
  3206. }
  3207. debug('comparator', comp, options)
  3208. this.options = options
  3209. this.loose = !!options.loose
  3210. this.parse(comp)
  3211. if (this.semver === ANY) {
  3212. this.value = ''
  3213. } else {
  3214. this.value = this.operator + this.semver.version
  3215. }
  3216. debug('comp', this)
  3217. }
  3218. var ANY = {}
  3219. Comparator.prototype.parse = function (comp) {
  3220. var r = this.options.loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
  3221. var m = comp.match(r)
  3222. if (!m) {
  3223. throw new TypeError('Invalid comparator: ' + comp)
  3224. }
  3225. this.operator = m[1]
  3226. if (this.operator === '=') {
  3227. this.operator = ''
  3228. }
  3229. // if it literally is just '>' or '' then allow anything.
  3230. if (!m[2]) {
  3231. this.semver = ANY
  3232. } else {
  3233. this.semver = new SemVer(m[2], this.options.loose)
  3234. }
  3235. }
  3236. Comparator.prototype.toString = function () {
  3237. return this.value
  3238. }
  3239. Comparator.prototype.test = function (version) {
  3240. debug('Comparator.test', version, this.options.loose)
  3241. if (this.semver === ANY) {
  3242. return true
  3243. }
  3244. if (typeof version === 'string') {
  3245. version = new SemVer(version, this.options)
  3246. }
  3247. return cmp(version, this.operator, this.semver, this.options)
  3248. }
  3249. Comparator.prototype.intersects = function (comp, options) {
  3250. if (!(comp instanceof Comparator)) {
  3251. throw new TypeError('a Comparator is required')
  3252. }
  3253. if (!options || typeof options !== 'object') {
  3254. options = {
  3255. loose: !!options,
  3256. includePrerelease: false
  3257. }
  3258. }
  3259. var rangeTmp
  3260. if (this.operator === '') {
  3261. rangeTmp = new Range(comp.value, options)
  3262. return satisfies(this.value, rangeTmp, options)
  3263. } else if (comp.operator === '') {
  3264. rangeTmp = new Range(this.value, options)
  3265. return satisfies(comp.semver, rangeTmp, options)
  3266. }
  3267. var sameDirectionIncreasing =
  3268. (this.operator === '>=' || this.operator === '>') &&
  3269. (comp.operator === '>=' || comp.operator === '>')
  3270. var sameDirectionDecreasing =
  3271. (this.operator === '<=' || this.operator === '<') &&
  3272. (comp.operator === '<=' || comp.operator === '<')
  3273. var sameSemVer = this.semver.version === comp.semver.version
  3274. var differentDirectionsInclusive =
  3275. (this.operator === '>=' || this.operator === '<=') &&
  3276. (comp.operator === '>=' || comp.operator === '<=')
  3277. var oppositeDirectionsLessThan =
  3278. cmp(this.semver, '<', comp.semver, options) &&
  3279. ((this.operator === '>=' || this.operator === '>') &&
  3280. (comp.operator === '<=' || comp.operator === '<'))
  3281. var oppositeDirectionsGreaterThan =
  3282. cmp(this.semver, '>', comp.semver, options) &&
  3283. ((this.operator === '<=' || this.operator === '<') &&
  3284. (comp.operator === '>=' || comp.operator === '>'))
  3285. return sameDirectionIncreasing || sameDirectionDecreasing ||
  3286. (sameSemVer && differentDirectionsInclusive) ||
  3287. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  3288. }
  3289. exports.Range = Range
  3290. function Range (range, options) {
  3291. if (!options || typeof options !== 'object') {
  3292. options = {
  3293. loose: !!options,
  3294. includePrerelease: false
  3295. }
  3296. }
  3297. if (range instanceof Range) {
  3298. if (range.loose === !!options.loose &&
  3299. range.includePrerelease === !!options.includePrerelease) {
  3300. return range
  3301. } else {
  3302. return new Range(range.raw, options)
  3303. }
  3304. }
  3305. if (range instanceof Comparator) {
  3306. return new Range(range.value, options)
  3307. }
  3308. if (!(this instanceof Range)) {
  3309. return new Range(range, options)
  3310. }
  3311. this.options = options
  3312. this.loose = !!options.loose
  3313. this.includePrerelease = !!options.includePrerelease
  3314. // First, split based on boolean or ||
  3315. this.raw = range
  3316. this.set = range.split(/\s*\|\|\s*/).map(function (range) {
  3317. return this.parseRange(range.trim())
  3318. }, this).filter(function (c) {
  3319. // throw out any that are not relevant for whatever reason
  3320. return c.length
  3321. })
  3322. if (!this.set.length) {
  3323. throw new TypeError('Invalid SemVer Range: ' + range)
  3324. }
  3325. this.format()
  3326. }
  3327. Range.prototype.format = function () {
  3328. this.range = this.set.map(function (comps) {
  3329. return comps.join(' ').trim()
  3330. }).join('||').trim()
  3331. return this.range
  3332. }
  3333. Range.prototype.toString = function () {
  3334. return this.range
  3335. }
  3336. Range.prototype.parseRange = function (range) {
  3337. var loose = this.options.loose
  3338. range = range.trim()
  3339. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  3340. var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE]
  3341. range = range.replace(hr, hyphenReplace)
  3342. debug('hyphen replace', range)
  3343. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  3344. range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace)
  3345. debug('comparator trim', range, re[COMPARATORTRIM])
  3346. // `~ 1.2.3` => `~1.2.3`
  3347. range = range.replace(re[TILDETRIM], tildeTrimReplace)
  3348. // `^ 1.2.3` => `^1.2.3`
  3349. range = range.replace(re[CARETTRIM], caretTrimReplace)
  3350. // normalize spaces
  3351. range = range.split(/\s+/).join(' ')
  3352. // At this point, the range is completely trimmed and
  3353. // ready to be split into comparators.
  3354. var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
  3355. var set = range.split(' ').map(function (comp) {
  3356. return parseComparator(comp, this.options)
  3357. }, this).join(' ').split(/\s+/)
  3358. if (this.options.loose) {
  3359. // in loose mode, throw out any that are not valid comparators
  3360. set = set.filter(function (comp) {
  3361. return !!comp.match(compRe)
  3362. })
  3363. }
  3364. set = set.map(function (comp) {
  3365. return new Comparator(comp, this.options)
  3366. }, this)
  3367. return set
  3368. }
  3369. Range.prototype.intersects = function (range, options) {
  3370. if (!(range instanceof Range)) {
  3371. throw new TypeError('a Range is required')
  3372. }
  3373. return this.set.some(function (thisComparators) {
  3374. return thisComparators.every(function (thisComparator) {
  3375. return range.set.some(function (rangeComparators) {
  3376. return rangeComparators.every(function (rangeComparator) {
  3377. return thisComparator.intersects(rangeComparator, options)
  3378. })
  3379. })
  3380. })
  3381. })
  3382. }
  3383. // Mostly just for testing and legacy API reasons
  3384. exports.toComparators = toComparators
  3385. function toComparators (range, options) {
  3386. return new Range(range, options).set.map(function (comp) {
  3387. return comp.map(function (c) {
  3388. return c.value
  3389. }).join(' ').trim().split(' ')
  3390. })
  3391. }
  3392. // comprised of xranges, tildes, stars, and gtlt's at this point.
  3393. // already replaced the hyphen ranges
  3394. // turn into a set of JUST comparators.
  3395. function parseComparator (comp, options) {
  3396. debug('comp', comp, options)
  3397. comp = replaceCarets(comp, options)
  3398. debug('caret', comp)
  3399. comp = replaceTildes(comp, options)
  3400. debug('tildes', comp)
  3401. comp = replaceXRanges(comp, options)
  3402. debug('xrange', comp)
  3403. comp = replaceStars(comp, options)
  3404. debug('stars', comp)
  3405. return comp
  3406. }
  3407. function isX (id) {
  3408. return !id || id.toLowerCase() === 'x' || id === '*'
  3409. }
  3410. // ~, ~> --> * (any, kinda silly)
  3411. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  3412. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  3413. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  3414. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  3415. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  3416. function replaceTildes (comp, options) {
  3417. return comp.trim().split(/\s+/).map(function (comp) {
  3418. return replaceTilde(comp, options)
  3419. }).join(' ')
  3420. }
  3421. function replaceTilde (comp, options) {
  3422. var r = options.loose ? re[TILDELOOSE] : re[TILDE]
  3423. return comp.replace(r, function (_, M, m, p, pr) {
  3424. debug('tilde', comp, _, M, m, p, pr)
  3425. var ret
  3426. if (isX(M)) {
  3427. ret = ''
  3428. } else if (isX(m)) {
  3429. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  3430. } else if (isX(p)) {
  3431. // ~1.2 == >=1.2.0 <1.3.0
  3432. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  3433. } else if (pr) {
  3434. debug('replaceTilde pr', pr)
  3435. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  3436. ' <' + M + '.' + (+m + 1) + '.0'
  3437. } else {
  3438. // ~1.2.3 == >=1.2.3 <1.3.0
  3439. ret = '>=' + M + '.' + m + '.' + p +
  3440. ' <' + M + '.' + (+m + 1) + '.0'
  3441. }
  3442. debug('tilde return', ret)
  3443. return ret
  3444. })
  3445. }
  3446. // ^ --> * (any, kinda silly)
  3447. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  3448. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  3449. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  3450. // ^1.2.3 --> >=1.2.3 <2.0.0
  3451. // ^1.2.0 --> >=1.2.0 <2.0.0
  3452. function replaceCarets (comp, options) {
  3453. return comp.trim().split(/\s+/).map(function (comp) {
  3454. return replaceCaret(comp, options)
  3455. }).join(' ')
  3456. }
  3457. function replaceCaret (comp, options) {
  3458. debug('caret', comp, options)
  3459. var r = options.loose ? re[CARETLOOSE] : re[CARET]
  3460. return comp.replace(r, function (_, M, m, p, pr) {
  3461. debug('caret', comp, _, M, m, p, pr)
  3462. var ret
  3463. if (isX(M)) {
  3464. ret = ''
  3465. } else if (isX(m)) {
  3466. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  3467. } else if (isX(p)) {
  3468. if (M === '0') {
  3469. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  3470. } else {
  3471. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  3472. }
  3473. } else if (pr) {
  3474. debug('replaceCaret pr', pr)
  3475. if (M === '0') {
  3476. if (m === '0') {
  3477. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  3478. ' <' + M + '.' + m + '.' + (+p + 1)
  3479. } else {
  3480. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  3481. ' <' + M + '.' + (+m + 1) + '.0'
  3482. }
  3483. } else {
  3484. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  3485. ' <' + (+M + 1) + '.0.0'
  3486. }
  3487. } else {
  3488. debug('no pr')
  3489. if (M === '0') {
  3490. if (m === '0') {
  3491. ret = '>=' + M + '.' + m + '.' + p +
  3492. ' <' + M + '.' + m + '.' + (+p + 1)
  3493. } else {
  3494. ret = '>=' + M + '.' + m + '.' + p +
  3495. ' <' + M + '.' + (+m + 1) + '.0'
  3496. }
  3497. } else {
  3498. ret = '>=' + M + '.' + m + '.' + p +
  3499. ' <' + (+M + 1) + '.0.0'
  3500. }
  3501. }
  3502. debug('caret return', ret)
  3503. return ret
  3504. })
  3505. }
  3506. function replaceXRanges (comp, options) {
  3507. debug('replaceXRanges', comp, options)
  3508. return comp.split(/\s+/).map(function (comp) {
  3509. return replaceXRange(comp, options)
  3510. }).join(' ')
  3511. }
  3512. function replaceXRange (comp, options) {
  3513. comp = comp.trim()
  3514. var r = options.loose ? re[XRANGELOOSE] : re[XRANGE]
  3515. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  3516. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  3517. var xM = isX(M)
  3518. var xm = xM || isX(m)
  3519. var xp = xm || isX(p)
  3520. var anyX = xp
  3521. if (gtlt === '=' && anyX) {
  3522. gtlt = ''
  3523. }
  3524. if (xM) {
  3525. if (gtlt === '>' || gtlt === '<') {
  3526. // nothing is allowed
  3527. ret = '<0.0.0'
  3528. } else {
  3529. // nothing is forbidden
  3530. ret = '*'
  3531. }
  3532. } else if (gtlt && anyX) {
  3533. // we know patch is an x, because we have any x at all.
  3534. // replace X with 0
  3535. if (xm) {
  3536. m = 0
  3537. }
  3538. p = 0
  3539. if (gtlt === '>') {
  3540. // >1 => >=2.0.0
  3541. // >1.2 => >=1.3.0
  3542. // >1.2.3 => >= 1.2.4
  3543. gtlt = '>='
  3544. if (xm) {
  3545. M = +M + 1
  3546. m = 0
  3547. p = 0
  3548. } else {
  3549. m = +m + 1
  3550. p = 0
  3551. }
  3552. } else if (gtlt === '<=') {
  3553. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  3554. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  3555. gtlt = '<'
  3556. if (xm) {
  3557. M = +M + 1
  3558. } else {
  3559. m = +m + 1
  3560. }
  3561. }
  3562. ret = gtlt + M + '.' + m + '.' + p
  3563. } else if (xm) {
  3564. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  3565. } else if (xp) {
  3566. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  3567. }
  3568. debug('xRange return', ret)
  3569. return ret
  3570. })
  3571. }
  3572. // Because * is AND-ed with everything else in the comparator,
  3573. // and '' means "any version", just remove the *s entirely.
  3574. function replaceStars (comp, options) {
  3575. debug('replaceStars', comp, options)
  3576. // Looseness is ignored here. star is always as loose as it gets!
  3577. return comp.trim().replace(re[STAR], '')
  3578. }
  3579. // This function is passed to string.replace(re[HYPHENRANGE])
  3580. // M, m, patch, prerelease, build
  3581. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  3582. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  3583. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  3584. function hyphenReplace ($0,
  3585. from, fM, fm, fp, fpr, fb,
  3586. to, tM, tm, tp, tpr, tb) {
  3587. if (isX(fM)) {
  3588. from = ''
  3589. } else if (isX(fm)) {
  3590. from = '>=' + fM + '.0.0'
  3591. } else if (isX(fp)) {
  3592. from = '>=' + fM + '.' + fm + '.0'
  3593. } else {
  3594. from = '>=' + from
  3595. }
  3596. if (isX(tM)) {
  3597. to = ''
  3598. } else if (isX(tm)) {
  3599. to = '<' + (+tM + 1) + '.0.0'
  3600. } else if (isX(tp)) {
  3601. to = '<' + tM + '.' + (+tm + 1) + '.0'
  3602. } else if (tpr) {
  3603. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  3604. } else {
  3605. to = '<=' + to
  3606. }
  3607. return (from + ' ' + to).trim()
  3608. }
  3609. // if ANY of the sets match ALL of its comparators, then pass
  3610. Range.prototype.test = function (version) {
  3611. if (!version) {
  3612. return false
  3613. }
  3614. if (typeof version === 'string') {
  3615. version = new SemVer(version, this.options)
  3616. }
  3617. for (var i = 0; i < this.set.length; i++) {
  3618. if (testSet(this.set[i], version, this.options)) {
  3619. return true
  3620. }
  3621. }
  3622. return false
  3623. }
  3624. function testSet (set, version, options) {
  3625. for (var i = 0; i < set.length; i++) {
  3626. if (!set[i].test(version)) {
  3627. return false
  3628. }
  3629. }
  3630. if (version.prerelease.length && !options.includePrerelease) {
  3631. // Find the set of versions that are allowed to have prereleases
  3632. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  3633. // That should allow `1.2.3-pr.2` to pass.
  3634. // However, `1.2.4-alpha.notready` should NOT be allowed,
  3635. // even though it's within the range set by the comparators.
  3636. for (i = 0; i < set.length; i++) {
  3637. debug(set[i].semver)
  3638. if (set[i].semver === ANY) {
  3639. continue
  3640. }
  3641. if (set[i].semver.prerelease.length > 0) {
  3642. var allowed = set[i].semver
  3643. if (allowed.major === version.major &&
  3644. allowed.minor === version.minor &&
  3645. allowed.patch === version.patch) {
  3646. return true
  3647. }
  3648. }
  3649. }
  3650. // Version has a -pre, but it's not one of the ones we like.
  3651. return false
  3652. }
  3653. return true
  3654. }
  3655. exports.satisfies = satisfies
  3656. function satisfies (version, range, options) {
  3657. try {
  3658. range = new Range(range, options)
  3659. } catch (er) {
  3660. return false
  3661. }
  3662. return range.test(version)
  3663. }
  3664. exports.maxSatisfying = maxSatisfying
  3665. function maxSatisfying (versions, range, options) {
  3666. var max = null
  3667. var maxSV = null
  3668. try {
  3669. var rangeObj = new Range(range, options)
  3670. } catch (er) {
  3671. return null
  3672. }
  3673. versions.forEach(function (v) {
  3674. if (rangeObj.test(v)) {
  3675. // satisfies(v, range, options)
  3676. if (!max || maxSV.compare(v) === -1) {
  3677. // compare(max, v, true)
  3678. max = v
  3679. maxSV = new SemVer(max, options)
  3680. }
  3681. }
  3682. })
  3683. return max
  3684. }
  3685. exports.minSatisfying = minSatisfying
  3686. function minSatisfying (versions, range, options) {
  3687. var min = null
  3688. var minSV = null
  3689. try {
  3690. var rangeObj = new Range(range, options)
  3691. } catch (er) {
  3692. return null
  3693. }
  3694. versions.forEach(function (v) {
  3695. if (rangeObj.test(v)) {
  3696. // satisfies(v, range, options)
  3697. if (!min || minSV.compare(v) === 1) {
  3698. // compare(min, v, true)
  3699. min = v
  3700. minSV = new SemVer(min, options)
  3701. }
  3702. }
  3703. })
  3704. return min
  3705. }
  3706. exports.minVersion = minVersion
  3707. function minVersion (range, loose) {
  3708. range = new Range(range, loose)
  3709. var minver = new SemVer('0.0.0')
  3710. if (range.test(minver)) {
  3711. return minver
  3712. }
  3713. minver = new SemVer('0.0.0-0')
  3714. if (range.test(minver)) {
  3715. return minver
  3716. }
  3717. minver = null
  3718. for (var i = 0; i < range.set.length; ++i) {
  3719. var comparators = range.set[i]
  3720. comparators.forEach(function (comparator) {
  3721. // Clone to avoid manipulating the comparator's semver object.
  3722. var compver = new SemVer(comparator.semver.version)
  3723. switch (comparator.operator) {
  3724. case '>':
  3725. if (compver.prerelease.length === 0) {
  3726. compver.patch++
  3727. } else {
  3728. compver.prerelease.push(0)
  3729. }
  3730. compver.raw = compver.format()
  3731. /* fallthrough */
  3732. case '':
  3733. case '>=':
  3734. if (!minver || gt(minver, compver)) {
  3735. minver = compver
  3736. }
  3737. break
  3738. case '<':
  3739. case '<=':
  3740. /* Ignore maximum versions */
  3741. break
  3742. /* istanbul ignore next */
  3743. default:
  3744. throw new Error('Unexpected operation: ' + comparator.operator)
  3745. }
  3746. })
  3747. }
  3748. if (minver && range.test(minver)) {
  3749. return minver
  3750. }
  3751. return null
  3752. }
  3753. exports.validRange = validRange
  3754. function validRange (range, options) {
  3755. try {
  3756. // Return '*' instead of '' so that truthiness works.
  3757. // This will throw if it's invalid anyway
  3758. return new Range(range, options).range || '*'
  3759. } catch (er) {
  3760. return null
  3761. }
  3762. }
  3763. // Determine if version is less than all the versions possible in the range
  3764. exports.ltr = ltr
  3765. function ltr (version, range, options) {
  3766. return outside(version, range, '<', options)
  3767. }
  3768. // Determine if version is greater than all the versions possible in the range.
  3769. exports.gtr = gtr
  3770. function gtr (version, range, options) {
  3771. return outside(version, range, '>', options)
  3772. }
  3773. exports.outside = outside
  3774. function outside (version, range, hilo, options) {
  3775. version = new SemVer(version, options)
  3776. range = new Range(range, options)
  3777. var gtfn, ltefn, ltfn, comp, ecomp
  3778. switch (hilo) {
  3779. case '>':
  3780. gtfn = gt
  3781. ltefn = lte
  3782. ltfn = lt
  3783. comp = '>'
  3784. ecomp = '>='
  3785. break
  3786. case '<':
  3787. gtfn = lt
  3788. ltefn = gte
  3789. ltfn = gt
  3790. comp = '<'
  3791. ecomp = '<='
  3792. break
  3793. default:
  3794. throw new TypeError('Must provide a hilo val of "<" or ">"')
  3795. }
  3796. // If it satisifes the range it is not outside
  3797. if (satisfies(version, range, options)) {
  3798. return false
  3799. }
  3800. // From now on, variable terms are as if we're in "gtr" mode.
  3801. // but note that everything is flipped for the "ltr" function.
  3802. for (var i = 0; i < range.set.length; ++i) {
  3803. var comparators = range.set[i]
  3804. var high = null
  3805. var low = null
  3806. comparators.forEach(function (comparator) {
  3807. if (comparator.semver === ANY) {
  3808. comparator = new Comparator('>=0.0.0')
  3809. }
  3810. high = high || comparator
  3811. low = low || comparator
  3812. if (gtfn(comparator.semver, high.semver, options)) {
  3813. high = comparator
  3814. } else if (ltfn(comparator.semver, low.semver, options)) {
  3815. low = comparator
  3816. }
  3817. })
  3818. // If the edge version comparator has a operator then our version
  3819. // isn't outside it
  3820. if (high.operator === comp || high.operator === ecomp) {
  3821. return false
  3822. }
  3823. // If the lowest version comparator has an operator and our version
  3824. // is less than it then it isn't higher than the range
  3825. if ((!low.operator || low.operator === comp) &&
  3826. ltefn(version, low.semver)) {
  3827. return false
  3828. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  3829. return false
  3830. }
  3831. }
  3832. return true
  3833. }
  3834. exports.prerelease = prerelease
  3835. function prerelease (version, options) {
  3836. var parsed = parse(version, options)
  3837. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  3838. }
  3839. exports.intersects = intersects
  3840. function intersects (r1, r2, options) {
  3841. r1 = new Range(r1, options)
  3842. r2 = new Range(r2, options)
  3843. return r1.intersects(r2)
  3844. }
  3845. exports.coerce = coerce
  3846. function coerce (version) {
  3847. if (version instanceof SemVer) {
  3848. return version
  3849. }
  3850. if (typeof version !== 'string') {
  3851. return null
  3852. }
  3853. var match = version.match(re[COERCE])
  3854. if (match == null) {
  3855. return null
  3856. }
  3857. return parse(match[1] +
  3858. '.' + (match[2] || '0') +
  3859. '.' + (match[3] || '0'))
  3860. }
  3861. /***/ }),
  3862. /***/ 289:
  3863. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  3864. "use strict";
  3865. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  3866. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  3867. return new (P || (P = Promise))(function (resolve, reject) {
  3868. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  3869. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  3870. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  3871. step((generator = generator.apply(thisArg, _arguments || [])).next());
  3872. });
  3873. };
  3874. var __importStar = (this && this.__importStar) || function (mod) {
  3875. if (mod && mod.__esModule) return mod;
  3876. var result = {};
  3877. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  3878. result["default"] = mod;
  3879. return result;
  3880. };
  3881. Object.defineProperty(exports, "__esModule", { value: true });
  3882. const core = __importStar(__webpack_require__(470));
  3883. const exec = __importStar(__webpack_require__(986));
  3884. const fshelper = __importStar(__webpack_require__(618));
  3885. const io = __importStar(__webpack_require__(1));
  3886. const path = __importStar(__webpack_require__(622));
  3887. const git_version_1 = __webpack_require__(559);
  3888. // Auth header not supported before 2.9
  3889. // Wire protocol v2 not supported before 2.18
  3890. exports.MinimumGitVersion = new git_version_1.GitVersion('2.18');
  3891. function CreateCommandManager(workingDirectory, lfs) {
  3892. return __awaiter(this, void 0, void 0, function* () {
  3893. return yield GitCommandManager.createCommandManager(workingDirectory, lfs);
  3894. });
  3895. }
  3896. exports.CreateCommandManager = CreateCommandManager;
  3897. class GitCommandManager {
  3898. // Private constructor; use createCommandManager()
  3899. constructor() {
  3900. this.gitEnv = {
  3901. GIT_TERMINAL_PROMPT: '0',
  3902. GCM_INTERACTIVE: 'Never' // Disable prompting for git credential manager
  3903. };
  3904. this.gitPath = '';
  3905. this.lfs = false;
  3906. this.workingDirectory = '';
  3907. }
  3908. branchDelete(remote, branch) {
  3909. return __awaiter(this, void 0, void 0, function* () {
  3910. const args = ['branch', '--delete', '--force'];
  3911. if (remote) {
  3912. args.push('--remote');
  3913. }
  3914. args.push(branch);
  3915. yield this.execGit(args);
  3916. });
  3917. }
  3918. branchExists(remote, pattern) {
  3919. return __awaiter(this, void 0, void 0, function* () {
  3920. const args = ['branch', '--list'];
  3921. if (remote) {
  3922. args.push('--remote');
  3923. }
  3924. args.push(pattern);
  3925. const output = yield this.execGit(args);
  3926. return !!output.stdout.trim();
  3927. });
  3928. }
  3929. branchList(remote) {
  3930. return __awaiter(this, void 0, void 0, function* () {
  3931. const result = [];
  3932. // Note, this implementation uses "rev-parse --symbolic" because the output from
  3933. // "branch --list" is more difficult when in a detached HEAD state.
  3934. const args = ['rev-parse', '--symbolic'];
  3935. if (remote) {
  3936. args.push('--remotes=origin');
  3937. }
  3938. else {
  3939. args.push('--branches');
  3940. }
  3941. const output = yield this.execGit(args);
  3942. for (let branch of output.stdout.trim().split('\n')) {
  3943. branch = branch.trim();
  3944. if (branch) {
  3945. result.push(branch);
  3946. }
  3947. }
  3948. return result;
  3949. });
  3950. }
  3951. checkout(ref, startPoint) {
  3952. return __awaiter(this, void 0, void 0, function* () {
  3953. const args = ['checkout', '--progress', '--force'];
  3954. if (startPoint) {
  3955. args.push('-B', ref, startPoint);
  3956. }
  3957. else {
  3958. args.push(ref);
  3959. }
  3960. yield this.execGit(args);
  3961. });
  3962. }
  3963. checkoutDetach() {
  3964. return __awaiter(this, void 0, void 0, function* () {
  3965. const args = ['checkout', '--detach'];
  3966. yield this.execGit(args);
  3967. });
  3968. }
  3969. config(configKey, configValue) {
  3970. return __awaiter(this, void 0, void 0, function* () {
  3971. yield this.execGit(['config', configKey, configValue]);
  3972. });
  3973. }
  3974. configExists(configKey) {
  3975. return __awaiter(this, void 0, void 0, function* () {
  3976. const pattern = configKey.replace(/[^a-zA-Z0-9_]/g, x => {
  3977. return `\\${x}`;
  3978. });
  3979. const output = yield this.execGit(['config', '--name-only', '--get-regexp', pattern], true);
  3980. return output.exitCode === 0;
  3981. });
  3982. }
  3983. fetch(fetchDepth, refSpec) {
  3984. return __awaiter(this, void 0, void 0, function* () {
  3985. const args = [
  3986. '-c',
  3987. 'protocol.version=2',
  3988. 'fetch',
  3989. '--no-tags',
  3990. '--prune',
  3991. '--progress',
  3992. '--no-recurse-submodules'
  3993. ];
  3994. if (fetchDepth > 0) {
  3995. args.push(`--depth=${fetchDepth}`);
  3996. }
  3997. else if (fshelper.fileExistsSync(path.join(this.workingDirectory, '.git', 'shallow'))) {
  3998. args.push('--unshallow');
  3999. }
  4000. args.push('origin');
  4001. for (const arg of refSpec) {
  4002. args.push(arg);
  4003. }
  4004. let attempt = 1;
  4005. const maxAttempts = 3;
  4006. while (attempt <= maxAttempts) {
  4007. const allowAllExitCodes = attempt < maxAttempts;
  4008. const output = yield this.execGit(args, allowAllExitCodes);
  4009. if (output.exitCode === 0) {
  4010. break;
  4011. }
  4012. const seconds = this.getRandomIntInclusive(1, 10);
  4013. core.warning(`Git fetch failed with exit code ${output.exitCode}. Waiting ${seconds} seconds before trying again.`);
  4014. yield this.sleep(seconds * 1000);
  4015. attempt++;
  4016. }
  4017. });
  4018. }
  4019. getWorkingDirectory() {
  4020. return this.workingDirectory;
  4021. }
  4022. init() {
  4023. return __awaiter(this, void 0, void 0, function* () {
  4024. yield this.execGit(['init', this.workingDirectory]);
  4025. });
  4026. }
  4027. isDetached() {
  4028. return __awaiter(this, void 0, void 0, function* () {
  4029. // Note, this implementation uses "branch --show-current" because
  4030. // "rev-parse --symbolic-full-name HEAD" can fail on a new repo
  4031. // with nothing checked out.
  4032. const output = yield this.execGit(['branch', '--show-current']);
  4033. return output.stdout.trim() === '';
  4034. });
  4035. }
  4036. lfsFetch(ref) {
  4037. return __awaiter(this, void 0, void 0, function* () {
  4038. const args = ['lfs', 'fetch', 'origin', ref];
  4039. let attempt = 1;
  4040. const maxAttempts = 3;
  4041. while (attempt <= maxAttempts) {
  4042. const allowAllExitCodes = attempt < maxAttempts;
  4043. const output = yield this.execGit(args, allowAllExitCodes);
  4044. if (output.exitCode === 0) {
  4045. break;
  4046. }
  4047. const seconds = this.getRandomIntInclusive(1, 10);
  4048. core.warning(`Git lfs fetch failed with exit code ${output.exitCode}. Waiting ${seconds} seconds before trying again.`);
  4049. yield this.sleep(seconds * 1000);
  4050. attempt++;
  4051. }
  4052. });
  4053. }
  4054. lfsInstall() {
  4055. return __awaiter(this, void 0, void 0, function* () {
  4056. yield this.execGit(['lfs', 'install', '--local']);
  4057. });
  4058. }
  4059. log1() {
  4060. return __awaiter(this, void 0, void 0, function* () {
  4061. yield this.execGit(['log', '-1']);
  4062. });
  4063. }
  4064. remoteAdd(remoteName, remoteUrl) {
  4065. return __awaiter(this, void 0, void 0, function* () {
  4066. yield this.execGit(['remote', 'add', remoteName, remoteUrl]);
  4067. });
  4068. }
  4069. tagExists(pattern) {
  4070. return __awaiter(this, void 0, void 0, function* () {
  4071. const output = yield this.execGit(['tag', '--list', pattern]);
  4072. return !!output.stdout.trim();
  4073. });
  4074. }
  4075. tryClean() {
  4076. return __awaiter(this, void 0, void 0, function* () {
  4077. const output = yield this.execGit(['clean', '-ffdx'], true);
  4078. return output.exitCode === 0;
  4079. });
  4080. }
  4081. tryConfigUnset(configKey) {
  4082. return __awaiter(this, void 0, void 0, function* () {
  4083. const output = yield this.execGit(['config', '--unset-all', configKey], true);
  4084. return output.exitCode === 0;
  4085. });
  4086. }
  4087. tryDisableAutomaticGarbageCollection() {
  4088. return __awaiter(this, void 0, void 0, function* () {
  4089. const output = yield this.execGit(['config', 'gc.auto', '0'], true);
  4090. return output.exitCode === 0;
  4091. });
  4092. }
  4093. tryGetFetchUrl() {
  4094. return __awaiter(this, void 0, void 0, function* () {
  4095. const output = yield this.execGit(['config', '--get', 'remote.origin.url'], true);
  4096. if (output.exitCode !== 0) {
  4097. return '';
  4098. }
  4099. const stdout = output.stdout.trim();
  4100. if (stdout.includes('\n')) {
  4101. return '';
  4102. }
  4103. return stdout;
  4104. });
  4105. }
  4106. tryReset() {
  4107. return __awaiter(this, void 0, void 0, function* () {
  4108. const output = yield this.execGit(['reset', '--hard', 'HEAD'], true);
  4109. return output.exitCode === 0;
  4110. });
  4111. }
  4112. static createCommandManager(workingDirectory, lfs) {
  4113. return __awaiter(this, void 0, void 0, function* () {
  4114. const result = new GitCommandManager();
  4115. yield result.initializeCommandManager(workingDirectory, lfs);
  4116. return result;
  4117. });
  4118. }
  4119. execGit(args, allowAllExitCodes = false) {
  4120. return __awaiter(this, void 0, void 0, function* () {
  4121. fshelper.directoryExistsSync(this.workingDirectory, true);
  4122. const result = new GitOutput();
  4123. const env = {};
  4124. for (const key of Object.keys(process.env)) {
  4125. env[key] = process.env[key];
  4126. }
  4127. for (const key of Object.keys(this.gitEnv)) {
  4128. env[key] = this.gitEnv[key];
  4129. }
  4130. const stdout = [];
  4131. const options = {
  4132. cwd: this.workingDirectory,
  4133. env,
  4134. ignoreReturnCode: allowAllExitCodes,
  4135. listeners: {
  4136. stdout: (data) => {
  4137. stdout.push(data.toString());
  4138. }
  4139. }
  4140. };
  4141. result.exitCode = yield exec.exec(`"${this.gitPath}"`, args, options);
  4142. result.stdout = stdout.join('');
  4143. return result;
  4144. });
  4145. }
  4146. initializeCommandManager(workingDirectory, lfs) {
  4147. return __awaiter(this, void 0, void 0, function* () {
  4148. this.workingDirectory = workingDirectory;
  4149. // Git-lfs will try to pull down assets if any of the local/user/system setting exist.
  4150. // If the user didn't enable `LFS` in their pipeline definition, disable LFS fetch/checkout.
  4151. this.lfs = lfs;
  4152. if (!this.lfs) {
  4153. this.gitEnv['GIT_LFS_SKIP_SMUDGE'] = '1';
  4154. }
  4155. this.gitPath = yield io.which('git', true);
  4156. // Git version
  4157. core.debug('Getting git version');
  4158. let gitVersion = new git_version_1.GitVersion();
  4159. let gitOutput = yield this.execGit(['version']);
  4160. let stdout = gitOutput.stdout.trim();
  4161. if (!stdout.includes('\n')) {
  4162. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  4163. if (match) {
  4164. gitVersion = new git_version_1.GitVersion(match[0]);
  4165. }
  4166. }
  4167. if (!gitVersion.isValid()) {
  4168. throw new Error('Unable to determine git version');
  4169. }
  4170. // Minimum git version
  4171. if (!gitVersion.checkMinimum(exports.MinimumGitVersion)) {
  4172. throw new Error(`Minimum required git version is ${exports.MinimumGitVersion}. Your git ('${this.gitPath}') is ${gitVersion}`);
  4173. }
  4174. if (this.lfs) {
  4175. // Git-lfs version
  4176. core.debug('Getting git-lfs version');
  4177. let gitLfsVersion = new git_version_1.GitVersion();
  4178. const gitLfsPath = yield io.which('git-lfs', true);
  4179. gitOutput = yield this.execGit(['lfs', 'version']);
  4180. stdout = gitOutput.stdout.trim();
  4181. if (!stdout.includes('\n')) {
  4182. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  4183. if (match) {
  4184. gitLfsVersion = new git_version_1.GitVersion(match[0]);
  4185. }
  4186. }
  4187. if (!gitLfsVersion.isValid()) {
  4188. throw new Error('Unable to determine git-lfs version');
  4189. }
  4190. // Minimum git-lfs version
  4191. // Note:
  4192. // - Auth header not supported before 2.1
  4193. const minimumGitLfsVersion = new git_version_1.GitVersion('2.1');
  4194. if (!gitLfsVersion.checkMinimum(minimumGitLfsVersion)) {
  4195. throw new Error(`Minimum required git-lfs version is ${minimumGitLfsVersion}. Your git-lfs ('${gitLfsPath}') is ${gitLfsVersion}`);
  4196. }
  4197. }
  4198. // Set the user agent
  4199. const gitHttpUserAgent = `git/${gitVersion} (github-actions-checkout)`;
  4200. core.debug(`Set git useragent to: ${gitHttpUserAgent}`);
  4201. this.gitEnv['GIT_HTTP_USER_AGENT'] = gitHttpUserAgent;
  4202. });
  4203. }
  4204. getRandomIntInclusive(minimum, maximum) {
  4205. minimum = Math.floor(minimum);
  4206. maximum = Math.floor(maximum);
  4207. return Math.floor(Math.random() * (maximum - minimum + 1)) + minimum;
  4208. }
  4209. sleep(milliseconds) {
  4210. return __awaiter(this, void 0, void 0, function* () {
  4211. return new Promise(resolve => setTimeout(resolve, milliseconds));
  4212. });
  4213. }
  4214. }
  4215. class GitOutput {
  4216. constructor() {
  4217. this.stdout = '';
  4218. this.exitCode = 0;
  4219. }
  4220. }
  4221. /***/ }),
  4222. /***/ 293:
  4223. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  4224. "use strict";
  4225. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4226. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4227. return new (P || (P = Promise))(function (resolve, reject) {
  4228. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4229. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4230. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4231. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4232. });
  4233. };
  4234. var __importStar = (this && this.__importStar) || function (mod) {
  4235. if (mod && mod.__esModule) return mod;
  4236. var result = {};
  4237. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  4238. result["default"] = mod;
  4239. return result;
  4240. };
  4241. Object.defineProperty(exports, "__esModule", { value: true });
  4242. const core = __importStar(__webpack_require__(470));
  4243. const coreCommand = __importStar(__webpack_require__(431));
  4244. const fs = __importStar(__webpack_require__(747));
  4245. const fsHelper = __importStar(__webpack_require__(618));
  4246. const gitCommandManager = __importStar(__webpack_require__(289));
  4247. const io = __importStar(__webpack_require__(1));
  4248. const path = __importStar(__webpack_require__(622));
  4249. const refHelper = __importStar(__webpack_require__(227));
  4250. const githubApiHelper = __importStar(__webpack_require__(464));
  4251. const authConfigKey = `http.https://github.com/.extraheader`;
  4252. function getSource(settings) {
  4253. return __awaiter(this, void 0, void 0, function* () {
  4254. // Repository URL
  4255. core.info(`Syncing repository: ${settings.repositoryOwner}/${settings.repositoryName}`);
  4256. const repositoryUrl = `https://github.com/${encodeURIComponent(settings.repositoryOwner)}/${encodeURIComponent(settings.repositoryName)}`;
  4257. // Set intra-task state for cleanup
  4258. coreCommand.issueCommand('save-state', { name: 'repositoryPath' }, settings.repositoryPath);
  4259. // Remove conflicting file path
  4260. if (fsHelper.fileExistsSync(settings.repositoryPath)) {
  4261. yield io.rmRF(settings.repositoryPath);
  4262. }
  4263. // Create directory
  4264. let isExisting = true;
  4265. if (!fsHelper.directoryExistsSync(settings.repositoryPath)) {
  4266. isExisting = false;
  4267. yield io.mkdirP(settings.repositoryPath);
  4268. }
  4269. // Git command manager
  4270. core.info(`Working directory is '${settings.repositoryPath}'`);
  4271. let git = null;
  4272. try {
  4273. git = yield gitCommandManager.CreateCommandManager(settings.repositoryPath, settings.lfs);
  4274. }
  4275. catch (err) {
  4276. // Git is required for LFS
  4277. if (settings.lfs) {
  4278. throw err;
  4279. }
  4280. // Otherwise fallback to REST API
  4281. }
  4282. // Prepare existing directory, otherwise recreate
  4283. if (isExisting) {
  4284. yield prepareExistingDirectory(git, settings.repositoryPath, repositoryUrl, settings.clean);
  4285. }
  4286. if (!git || `${1}` == '1') {
  4287. core.info(`Add git Git version ${gitCommandManager.MinimumGitVersion} was not found in the PATH.`);
  4288. core.info(`Instead downloading the repository files using the GitHub REST API.`);
  4289. yield githubApiHelper.downloadRepository(settings.accessToken, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.repositoryPath);
  4290. }
  4291. else {
  4292. // Initialize the repository
  4293. if (!fsHelper.directoryExistsSync(path.join(settings.repositoryPath, '.git'))) {
  4294. yield git.init();
  4295. yield git.remoteAdd('origin', repositoryUrl);
  4296. }
  4297. // Disable automatic garbage collection
  4298. if (!(yield git.tryDisableAutomaticGarbageCollection())) {
  4299. core.warning(`Unable to turn off git automatic garbage collection. The git fetch operation may trigger garbage collection and cause a delay.`);
  4300. }
  4301. // Remove possible previous extraheader
  4302. yield removeGitConfig(git, authConfigKey);
  4303. // Add extraheader (auth)
  4304. const base64Credentials = Buffer.from(`x-access-token:${settings.accessToken}`, 'utf8').toString('base64');
  4305. core.setSecret(base64Credentials);
  4306. const authConfigValue = `AUTHORIZATION: basic ${base64Credentials}`;
  4307. yield git.config(authConfigKey, authConfigValue);
  4308. // LFS install
  4309. if (settings.lfs) {
  4310. yield git.lfsInstall();
  4311. }
  4312. // Fetch
  4313. const refSpec = refHelper.getRefSpec(settings.ref, settings.commit);
  4314. yield git.fetch(settings.fetchDepth, refSpec);
  4315. // Checkout info
  4316. const checkoutInfo = yield refHelper.getCheckoutInfo(git, settings.ref, settings.commit);
  4317. // LFS fetch
  4318. // Explicit lfs-fetch to avoid slow checkout (fetches one lfs object at a time).
  4319. // Explicit lfs fetch will fetch lfs objects in parallel.
  4320. if (settings.lfs) {
  4321. yield git.lfsFetch(checkoutInfo.startPoint || checkoutInfo.ref);
  4322. }
  4323. // Checkout
  4324. yield git.checkout(checkoutInfo.ref, checkoutInfo.startPoint);
  4325. // Dump some info about the checked out commit
  4326. yield git.log1();
  4327. }
  4328. });
  4329. }
  4330. exports.getSource = getSource;
  4331. function cleanup(repositoryPath) {
  4332. return __awaiter(this, void 0, void 0, function* () {
  4333. // Repo exists?
  4334. if (!fsHelper.fileExistsSync(path.join(repositoryPath, '.git', 'config'))) {
  4335. return;
  4336. }
  4337. fsHelper.directoryExistsSync(repositoryPath, true);
  4338. // Remove the config key
  4339. const git = yield gitCommandManager.CreateCommandManager(repositoryPath, false);
  4340. yield removeGitConfig(git, authConfigKey);
  4341. });
  4342. }
  4343. exports.cleanup = cleanup;
  4344. function prepareExistingDirectory(git, repositoryPath, repositoryUrl, clean) {
  4345. return __awaiter(this, void 0, void 0, function* () {
  4346. let remove = false;
  4347. // Check whether using git or REST API
  4348. if (!git) {
  4349. remove = true;
  4350. }
  4351. // Fetch URL does not match
  4352. else if (!fsHelper.directoryExistsSync(path.join(repositoryPath, '.git')) ||
  4353. repositoryUrl !== (yield git.tryGetFetchUrl())) {
  4354. remove = true;
  4355. }
  4356. else {
  4357. // Delete any index.lock and shallow.lock left by a previously canceled run or crashed git process
  4358. const lockPaths = [
  4359. path.join(repositoryPath, '.git', 'index.lock'),
  4360. path.join(repositoryPath, '.git', 'shallow.lock')
  4361. ];
  4362. for (const lockPath of lockPaths) {
  4363. try {
  4364. yield io.rmRF(lockPath);
  4365. }
  4366. catch (error) {
  4367. core.debug(`Unable to delete '${lockPath}'. ${error.message}`);
  4368. }
  4369. }
  4370. try {
  4371. // Checkout detached HEAD
  4372. if (!(yield git.isDetached())) {
  4373. yield git.checkoutDetach();
  4374. }
  4375. // Remove all refs/heads/*
  4376. let branches = yield git.branchList(false);
  4377. for (const branch of branches) {
  4378. yield git.branchDelete(false, branch);
  4379. }
  4380. // Remove all refs/remotes/origin/* to avoid conflicts
  4381. branches = yield git.branchList(true);
  4382. for (const branch of branches) {
  4383. yield git.branchDelete(true, branch);
  4384. }
  4385. // Clean
  4386. if (clean) {
  4387. if (!(yield git.tryClean())) {
  4388. 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}'.`);
  4389. remove = true;
  4390. }
  4391. else if (!(yield git.tryReset())) {
  4392. remove = true;
  4393. }
  4394. if (remove) {
  4395. core.warning(`Unable to clean or reset the repository. The repository will be recreated instead.`);
  4396. }
  4397. }
  4398. }
  4399. catch (error) {
  4400. core.warning(`Unable to prepare the existing repository. The repository will be recreated instead.`);
  4401. remove = true;
  4402. }
  4403. }
  4404. if (remove) {
  4405. // Delete the contents of the directory. Don't delete the directory itself
  4406. // since it might be the current working directory.
  4407. core.info(`Deleting the contents of '${repositoryPath}'`);
  4408. for (const file of yield fs.promises.readdir(repositoryPath)) {
  4409. yield io.rmRF(path.join(repositoryPath, file));
  4410. }
  4411. }
  4412. });
  4413. }
  4414. function removeGitConfig(git, configKey) {
  4415. return __awaiter(this, void 0, void 0, function* () {
  4416. if ((yield git.configExists(configKey)) &&
  4417. !(yield git.tryConfigUnset(configKey))) {
  4418. // Load the config contents
  4419. core.warning(`Failed to remove '${configKey}' from the git config. Attempting to remove the config value by editing the file directly.`);
  4420. const configPath = path.join(git.getWorkingDirectory(), '.git', 'config');
  4421. fsHelper.fileExistsSync(configPath);
  4422. let contents = fs.readFileSync(configPath).toString() || '';
  4423. // Filter - only includes lines that do not contain the config key
  4424. const upperConfigKey = configKey.toUpperCase();
  4425. const split = contents
  4426. .split('\n')
  4427. .filter(x => !x.toUpperCase().includes(upperConfigKey));
  4428. contents = split.join('\n');
  4429. // Rewrite the config file
  4430. fs.writeFileSync(configPath, contents);
  4431. }
  4432. });
  4433. }
  4434. /***/ }),
  4435. /***/ 294:
  4436. /***/ (function(module, __unusedexports, __webpack_require__) {
  4437. module.exports = parseOptions;
  4438. const { Deprecation } = __webpack_require__(692);
  4439. const { getUserAgent } = __webpack_require__(796);
  4440. const once = __webpack_require__(969);
  4441. const pkg = __webpack_require__(215);
  4442. const deprecateOptionsTimeout = once((log, deprecation) =>
  4443. log.warn(deprecation)
  4444. );
  4445. const deprecateOptionsAgent = once((log, deprecation) => log.warn(deprecation));
  4446. const deprecateOptionsHeaders = once((log, deprecation) =>
  4447. log.warn(deprecation)
  4448. );
  4449. function parseOptions(options, log, hook) {
  4450. if (options.headers) {
  4451. options.headers = Object.keys(options.headers).reduce((newObj, key) => {
  4452. newObj[key.toLowerCase()] = options.headers[key];
  4453. return newObj;
  4454. }, {});
  4455. }
  4456. const clientDefaults = {
  4457. headers: options.headers || {},
  4458. request: options.request || {},
  4459. mediaType: {
  4460. previews: [],
  4461. format: ""
  4462. }
  4463. };
  4464. if (options.baseUrl) {
  4465. clientDefaults.baseUrl = options.baseUrl;
  4466. }
  4467. if (options.userAgent) {
  4468. clientDefaults.headers["user-agent"] = options.userAgent;
  4469. }
  4470. if (options.previews) {
  4471. clientDefaults.mediaType.previews = options.previews;
  4472. }
  4473. if (options.timeZone) {
  4474. clientDefaults.headers["time-zone"] = options.timeZone;
  4475. }
  4476. if (options.timeout) {
  4477. deprecateOptionsTimeout(
  4478. log,
  4479. new Deprecation(
  4480. "[@octokit/rest] new Octokit({timeout}) is deprecated. Use {request: {timeout}} instead. See https://github.com/octokit/request.js#request"
  4481. )
  4482. );
  4483. clientDefaults.request.timeout = options.timeout;
  4484. }
  4485. if (options.agent) {
  4486. deprecateOptionsAgent(
  4487. log,
  4488. new Deprecation(
  4489. "[@octokit/rest] new Octokit({agent}) is deprecated. Use {request: {agent}} instead. See https://github.com/octokit/request.js#request"
  4490. )
  4491. );
  4492. clientDefaults.request.agent = options.agent;
  4493. }
  4494. if (options.headers) {
  4495. deprecateOptionsHeaders(
  4496. log,
  4497. new Deprecation(
  4498. "[@octokit/rest] new Octokit({headers}) is deprecated. Use {userAgent, previews} instead. See https://github.com/octokit/request.js#request"
  4499. )
  4500. );
  4501. }
  4502. const userAgentOption = clientDefaults.headers["user-agent"];
  4503. const defaultUserAgent = `octokit.js/${pkg.version} ${getUserAgent()}`;
  4504. clientDefaults.headers["user-agent"] = [userAgentOption, defaultUserAgent]
  4505. .filter(Boolean)
  4506. .join(" ");
  4507. clientDefaults.request.hook = hook.bind(null, "request");
  4508. return clientDefaults;
  4509. }
  4510. /***/ }),
  4511. /***/ 297:
  4512. /***/ (function(module) {
  4513. module.exports = class HttpError extends Error {
  4514. constructor (message, code, headers) {
  4515. super(message)
  4516. // Maintains proper stack trace (only available on V8)
  4517. /* istanbul ignore next */
  4518. if (Error.captureStackTrace) {
  4519. Error.captureStackTrace(this, this.constructor)
  4520. }
  4521. this.name = 'HttpError'
  4522. this.code = code
  4523. this.headers = headers
  4524. }
  4525. }
  4526. /***/ }),
  4527. /***/ 301:
  4528. /***/ (function(module, __unusedexports, __webpack_require__) {
  4529. /**
  4530. * Some “list” response that can be paginated have a different response structure
  4531. *
  4532. * They have a `total_count` key in the response (search also has `incomplete_results`,
  4533. * /installation/repositories also has `repository_selection`), as well as a key with
  4534. * the list of the items which name varies from endpoint to endpoint:
  4535. *
  4536. * - https://developer.github.com/v3/search/#example (key `items`)
  4537. * - https://developer.github.com/v3/checks/runs/#response-3 (key: `check_runs`)
  4538. * - https://developer.github.com/v3/checks/suites/#response-1 (key: `check_suites`)
  4539. * - https://developer.github.com/v3/apps/installations/#list-repositories (key: `repositories`)
  4540. * - https://developer.github.com/v3/apps/installations/#list-installations-for-a-user (key `installations`)
  4541. * - https://developer.github.com/v3/orgs/#list-installations-for-an-organization (key `installations`)
  4542. *
  4543. * Octokit normalizes these responses so that paginated results are always returned following
  4544. * the same structure. One challenge is that if the list response has only one page, no Link
  4545. * header is provided, so this header alone is not sufficient to check wether a response is
  4546. * paginated or not. For the exceptions with the namespace, a fallback check for the route
  4547. * paths has to be added in order to normalize the response. We cannot check for the total_count
  4548. * property because it also exists in the response of Get the combined status for a specific ref.
  4549. */
  4550. module.exports = normalizePaginatedListResponse;
  4551. const { Deprecation } = __webpack_require__(692);
  4552. const once = __webpack_require__(969);
  4553. const deprecateIncompleteResults = once((log, deprecation) =>
  4554. log.warn(deprecation)
  4555. );
  4556. const deprecateTotalCount = once((log, deprecation) => log.warn(deprecation));
  4557. const deprecateNamespace = once((log, deprecation) => log.warn(deprecation));
  4558. const REGEX_IS_SEARCH_PATH = /^\/search\//;
  4559. const REGEX_IS_CHECKS_PATH = /^\/repos\/[^/]+\/[^/]+\/commits\/[^/]+\/(check-runs|check-suites)/;
  4560. const REGEX_IS_INSTALLATION_REPOSITORIES_PATH = /^\/installation\/repositories/;
  4561. const REGEX_IS_USER_INSTALLATIONS_PATH = /^\/user\/installations/;
  4562. const REGEX_IS_ORG_INSTALLATIONS_PATH = /^\/orgs\/[^/]+\/installations/;
  4563. function normalizePaginatedListResponse(octokit, url, response) {
  4564. const path = url.replace(octokit.request.endpoint.DEFAULTS.baseUrl, "");
  4565. if (
  4566. !REGEX_IS_SEARCH_PATH.test(path) &&
  4567. !REGEX_IS_CHECKS_PATH.test(path) &&
  4568. !REGEX_IS_INSTALLATION_REPOSITORIES_PATH.test(path) &&
  4569. !REGEX_IS_USER_INSTALLATIONS_PATH.test(path) &&
  4570. !REGEX_IS_ORG_INSTALLATIONS_PATH.test(path)
  4571. ) {
  4572. return;
  4573. }
  4574. // keep the additional properties intact to avoid a breaking change,
  4575. // but log a deprecation warning when accessed
  4576. const incompleteResults = response.data.incomplete_results;
  4577. const repositorySelection = response.data.repository_selection;
  4578. const totalCount = response.data.total_count;
  4579. delete response.data.incomplete_results;
  4580. delete response.data.repository_selection;
  4581. delete response.data.total_count;
  4582. const namespaceKey = Object.keys(response.data)[0];
  4583. response.data = response.data[namespaceKey];
  4584. Object.defineProperty(response.data, namespaceKey, {
  4585. get() {
  4586. deprecateNamespace(
  4587. octokit.log,
  4588. new Deprecation(
  4589. `[@octokit/rest] "result.data.${namespaceKey}" is deprecated. Use "result.data" instead`
  4590. )
  4591. );
  4592. return response.data;
  4593. }
  4594. });
  4595. if (typeof incompleteResults !== "undefined") {
  4596. Object.defineProperty(response.data, "incomplete_results", {
  4597. get() {
  4598. deprecateIncompleteResults(
  4599. octokit.log,
  4600. new Deprecation(
  4601. '[@octokit/rest] "result.data.incomplete_results" is deprecated.'
  4602. )
  4603. );
  4604. return incompleteResults;
  4605. }
  4606. });
  4607. }
  4608. if (typeof repositorySelection !== "undefined") {
  4609. Object.defineProperty(response.data, "repository_selection", {
  4610. get() {
  4611. deprecateTotalCount(
  4612. octokit.log,
  4613. new Deprecation(
  4614. '[@octokit/rest] "result.data.repository_selection" is deprecated.'
  4615. )
  4616. );
  4617. return repositorySelection;
  4618. }
  4619. });
  4620. }
  4621. Object.defineProperty(response.data, "total_count", {
  4622. get() {
  4623. deprecateTotalCount(
  4624. octokit.log,
  4625. new Deprecation(
  4626. '[@octokit/rest] "result.data.total_count" is deprecated.'
  4627. )
  4628. );
  4629. return totalCount;
  4630. }
  4631. });
  4632. }
  4633. /***/ }),
  4634. /***/ 323:
  4635. /***/ (function(module) {
  4636. "use strict";
  4637. var isStream = module.exports = function (stream) {
  4638. return stream !== null && typeof stream === 'object' && typeof stream.pipe === 'function';
  4639. };
  4640. isStream.writable = function (stream) {
  4641. return isStream(stream) && stream.writable !== false && typeof stream._write === 'function' && typeof stream._writableState === 'object';
  4642. };
  4643. isStream.readable = function (stream) {
  4644. return isStream(stream) && stream.readable !== false && typeof stream._read === 'function' && typeof stream._readableState === 'object';
  4645. };
  4646. isStream.duplex = function (stream) {
  4647. return isStream.writable(stream) && isStream.readable(stream);
  4648. };
  4649. isStream.transform = function (stream) {
  4650. return isStream.duplex(stream) && typeof stream._transform === 'function' && typeof stream._transformState === 'object';
  4651. };
  4652. /***/ }),
  4653. /***/ 336:
  4654. /***/ (function(module, __unusedexports, __webpack_require__) {
  4655. module.exports = hasLastPage
  4656. const deprecate = __webpack_require__(370)
  4657. const getPageLinks = __webpack_require__(577)
  4658. function hasLastPage (link) {
  4659. deprecate(`octokit.hasLastPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  4660. return getPageLinks(link).last
  4661. }
  4662. /***/ }),
  4663. /***/ 348:
  4664. /***/ (function(module, __unusedexports, __webpack_require__) {
  4665. "use strict";
  4666. module.exports = validate;
  4667. const { RequestError } = __webpack_require__(463);
  4668. const get = __webpack_require__(854);
  4669. const set = __webpack_require__(883);
  4670. function validate(octokit, options) {
  4671. if (!options.request.validate) {
  4672. return;
  4673. }
  4674. const { validate: params } = options.request;
  4675. Object.keys(params).forEach(parameterName => {
  4676. const parameter = get(params, parameterName);
  4677. const expectedType = parameter.type;
  4678. let parentParameterName;
  4679. let parentValue;
  4680. let parentParamIsPresent = true;
  4681. let parentParameterIsArray = false;
  4682. if (/\./.test(parameterName)) {
  4683. parentParameterName = parameterName.replace(/\.[^.]+$/, "");
  4684. parentParameterIsArray = parentParameterName.slice(-2) === "[]";
  4685. if (parentParameterIsArray) {
  4686. parentParameterName = parentParameterName.slice(0, -2);
  4687. }
  4688. parentValue = get(options, parentParameterName);
  4689. parentParamIsPresent =
  4690. parentParameterName === "headers" ||
  4691. (typeof parentValue === "object" && parentValue !== null);
  4692. }
  4693. const values = parentParameterIsArray
  4694. ? (get(options, parentParameterName) || []).map(
  4695. value => value[parameterName.split(/\./).pop()]
  4696. )
  4697. : [get(options, parameterName)];
  4698. values.forEach((value, i) => {
  4699. const valueIsPresent = typeof value !== "undefined";
  4700. const valueIsNull = value === null;
  4701. const currentParameterName = parentParameterIsArray
  4702. ? parameterName.replace(/\[\]/, `[${i}]`)
  4703. : parameterName;
  4704. if (!parameter.required && !valueIsPresent) {
  4705. return;
  4706. }
  4707. // if the parent parameter is of type object but allows null
  4708. // then the child parameters can be ignored
  4709. if (!parentParamIsPresent) {
  4710. return;
  4711. }
  4712. if (parameter.allowNull && valueIsNull) {
  4713. return;
  4714. }
  4715. if (!parameter.allowNull && valueIsNull) {
  4716. throw new RequestError(
  4717. `'${currentParameterName}' cannot be null`,
  4718. 400,
  4719. {
  4720. request: options
  4721. }
  4722. );
  4723. }
  4724. if (parameter.required && !valueIsPresent) {
  4725. throw new RequestError(
  4726. `Empty value for parameter '${currentParameterName}': ${JSON.stringify(
  4727. value
  4728. )}`,
  4729. 400,
  4730. {
  4731. request: options
  4732. }
  4733. );
  4734. }
  4735. // parse to integer before checking for enum
  4736. // so that string "1" will match enum with number 1
  4737. if (expectedType === "integer") {
  4738. const unparsedValue = value;
  4739. value = parseInt(value, 10);
  4740. if (isNaN(value)) {
  4741. throw new RequestError(
  4742. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  4743. unparsedValue
  4744. )} is NaN`,
  4745. 400,
  4746. {
  4747. request: options
  4748. }
  4749. );
  4750. }
  4751. }
  4752. if (parameter.enum && parameter.enum.indexOf(String(value)) === -1) {
  4753. throw new RequestError(
  4754. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  4755. value
  4756. )}`,
  4757. 400,
  4758. {
  4759. request: options
  4760. }
  4761. );
  4762. }
  4763. if (parameter.validation) {
  4764. const regex = new RegExp(parameter.validation);
  4765. if (!regex.test(value)) {
  4766. throw new RequestError(
  4767. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  4768. value
  4769. )}`,
  4770. 400,
  4771. {
  4772. request: options
  4773. }
  4774. );
  4775. }
  4776. }
  4777. if (expectedType === "object" && typeof value === "string") {
  4778. try {
  4779. value = JSON.parse(value);
  4780. } catch (exception) {
  4781. throw new RequestError(
  4782. `JSON parse error of value for parameter '${currentParameterName}': ${JSON.stringify(
  4783. value
  4784. )}`,
  4785. 400,
  4786. {
  4787. request: options
  4788. }
  4789. );
  4790. }
  4791. }
  4792. set(options, parameter.mapTo || currentParameterName, value);
  4793. });
  4794. });
  4795. return options;
  4796. }
  4797. /***/ }),
  4798. /***/ 349:
  4799. /***/ (function(module, __unusedexports, __webpack_require__) {
  4800. module.exports = authenticationRequestError;
  4801. const { RequestError } = __webpack_require__(463);
  4802. function authenticationRequestError(state, error, options) {
  4803. /* istanbul ignore next */
  4804. if (!error.headers) throw error;
  4805. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  4806. // handle "2FA required" error only
  4807. if (error.status !== 401 || !otpRequired) {
  4808. throw error;
  4809. }
  4810. if (
  4811. error.status === 401 &&
  4812. otpRequired &&
  4813. error.request &&
  4814. error.request.headers["x-github-otp"]
  4815. ) {
  4816. throw new RequestError(
  4817. "Invalid one-time password for two-factor authentication",
  4818. 401,
  4819. {
  4820. headers: error.headers,
  4821. request: options
  4822. }
  4823. );
  4824. }
  4825. if (typeof state.auth.on2fa !== "function") {
  4826. throw new RequestError(
  4827. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  4828. 401,
  4829. {
  4830. headers: error.headers,
  4831. request: options
  4832. }
  4833. );
  4834. }
  4835. return Promise.resolve()
  4836. .then(() => {
  4837. return state.auth.on2fa();
  4838. })
  4839. .then(oneTimePassword => {
  4840. const newOptions = Object.assign(options, {
  4841. headers: Object.assign(
  4842. { "x-github-otp": oneTimePassword },
  4843. options.headers
  4844. )
  4845. });
  4846. return state.octokit.request(newOptions);
  4847. });
  4848. }
  4849. /***/ }),
  4850. /***/ 357:
  4851. /***/ (function(module) {
  4852. module.exports = require("assert");
  4853. /***/ }),
  4854. /***/ 363:
  4855. /***/ (function(module) {
  4856. module.exports = register
  4857. function register (state, name, method, options) {
  4858. if (typeof method !== 'function') {
  4859. throw new Error('method for before hook must be a function')
  4860. }
  4861. if (!options) {
  4862. options = {}
  4863. }
  4864. if (Array.isArray(name)) {
  4865. return name.reverse().reduce(function (callback, name) {
  4866. return register.bind(null, state, name, callback, options)
  4867. }, method)()
  4868. }
  4869. return Promise.resolve()
  4870. .then(function () {
  4871. if (!state.registry[name]) {
  4872. return method(options)
  4873. }
  4874. return (state.registry[name]).reduce(function (method, registered) {
  4875. return registered.hook.bind(null, method, options)
  4876. }, method)()
  4877. })
  4878. }
  4879. /***/ }),
  4880. /***/ 368:
  4881. /***/ (function(module) {
  4882. module.exports = function atob(str) {
  4883. return Buffer.from(str, 'base64').toString('binary')
  4884. }
  4885. /***/ }),
  4886. /***/ 370:
  4887. /***/ (function(module) {
  4888. module.exports = deprecate
  4889. const loggedMessages = {}
  4890. function deprecate (message) {
  4891. if (loggedMessages[message]) {
  4892. return
  4893. }
  4894. console.warn(`DEPRECATED (@octokit/rest): ${message}`)
  4895. loggedMessages[message] = 1
  4896. }
  4897. /***/ }),
  4898. /***/ 372:
  4899. /***/ (function(module) {
  4900. module.exports = octokitDebug;
  4901. function octokitDebug(octokit) {
  4902. octokit.hook.wrap("request", (request, options) => {
  4903. octokit.log.debug("request", options);
  4904. const start = Date.now();
  4905. const requestOptions = octokit.request.endpoint.parse(options);
  4906. const path = requestOptions.url.replace(options.baseUrl, "");
  4907. return request(options)
  4908. .then(response => {
  4909. octokit.log.info(
  4910. `${requestOptions.method} ${path} - ${
  4911. response.status
  4912. } in ${Date.now() - start}ms`
  4913. );
  4914. return response;
  4915. })
  4916. .catch(error => {
  4917. octokit.log.info(
  4918. `${requestOptions.method} ${path} - ${error.status} in ${Date.now() -
  4919. start}ms`
  4920. );
  4921. throw error;
  4922. });
  4923. });
  4924. }
  4925. /***/ }),
  4926. /***/ 385:
  4927. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  4928. "use strict";
  4929. Object.defineProperty(exports, '__esModule', { value: true });
  4930. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  4931. var isPlainObject = _interopDefault(__webpack_require__(696));
  4932. var universalUserAgent = __webpack_require__(796);
  4933. function lowercaseKeys(object) {
  4934. if (!object) {
  4935. return {};
  4936. }
  4937. return Object.keys(object).reduce((newObj, key) => {
  4938. newObj[key.toLowerCase()] = object[key];
  4939. return newObj;
  4940. }, {});
  4941. }
  4942. function mergeDeep(defaults, options) {
  4943. const result = Object.assign({}, defaults);
  4944. Object.keys(options).forEach(key => {
  4945. if (isPlainObject(options[key])) {
  4946. if (!(key in defaults)) Object.assign(result, {
  4947. [key]: options[key]
  4948. });else result[key] = mergeDeep(defaults[key], options[key]);
  4949. } else {
  4950. Object.assign(result, {
  4951. [key]: options[key]
  4952. });
  4953. }
  4954. });
  4955. return result;
  4956. }
  4957. function merge(defaults, route, options) {
  4958. if (typeof route === "string") {
  4959. let [method, url] = route.split(" ");
  4960. options = Object.assign(url ? {
  4961. method,
  4962. url
  4963. } : {
  4964. url: method
  4965. }, options);
  4966. } else {
  4967. options = Object.assign({}, route);
  4968. } // lowercase header names before merging with defaults to avoid duplicates
  4969. options.headers = lowercaseKeys(options.headers);
  4970. const mergedOptions = mergeDeep(defaults || {}, options); // mediaType.previews arrays are merged, instead of overwritten
  4971. if (defaults && defaults.mediaType.previews.length) {
  4972. mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(preview => !mergedOptions.mediaType.previews.includes(preview)).concat(mergedOptions.mediaType.previews);
  4973. }
  4974. mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map(preview => preview.replace(/-preview/, ""));
  4975. return mergedOptions;
  4976. }
  4977. function addQueryParameters(url, parameters) {
  4978. const separator = /\?/.test(url) ? "&" : "?";
  4979. const names = Object.keys(parameters);
  4980. if (names.length === 0) {
  4981. return url;
  4982. }
  4983. return url + separator + names.map(name => {
  4984. if (name === "q") {
  4985. return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+");
  4986. }
  4987. return `${name}=${encodeURIComponent(parameters[name])}`;
  4988. }).join("&");
  4989. }
  4990. const urlVariableRegex = /\{[^}]+\}/g;
  4991. function removeNonChars(variableName) {
  4992. return variableName.replace(/^\W+|\W+$/g, "").split(/,/);
  4993. }
  4994. function extractUrlVariableNames(url) {
  4995. const matches = url.match(urlVariableRegex);
  4996. if (!matches) {
  4997. return [];
  4998. }
  4999. return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
  5000. }
  5001. function omit(object, keysToOmit) {
  5002. return Object.keys(object).filter(option => !keysToOmit.includes(option)).reduce((obj, key) => {
  5003. obj[key] = object[key];
  5004. return obj;
  5005. }, {});
  5006. }
  5007. // Based on https://github.com/bramstein/url-template, licensed under BSD
  5008. // TODO: create separate package.
  5009. //
  5010. // Copyright (c) 2012-2014, Bram Stein
  5011. // All rights reserved.
  5012. // Redistribution and use in source and binary forms, with or without
  5013. // modification, are permitted provided that the following conditions
  5014. // are met:
  5015. // 1. Redistributions of source code must retain the above copyright
  5016. // notice, this list of conditions and the following disclaimer.
  5017. // 2. Redistributions in binary form must reproduce the above copyright
  5018. // notice, this list of conditions and the following disclaimer in the
  5019. // documentation and/or other materials provided with the distribution.
  5020. // 3. The name of the author may not be used to endorse or promote products
  5021. // derived from this software without specific prior written permission.
  5022. // THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
  5023. // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  5024. // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  5025. // EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  5026. // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  5027. // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  5028. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  5029. // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  5030. // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  5031. // EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  5032. /* istanbul ignore file */
  5033. function encodeReserved(str) {
  5034. return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) {
  5035. if (!/%[0-9A-Fa-f]/.test(part)) {
  5036. part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]");
  5037. }
  5038. return part;
  5039. }).join("");
  5040. }
  5041. function encodeUnreserved(str) {
  5042. return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {
  5043. return "%" + c.charCodeAt(0).toString(16).toUpperCase();
  5044. });
  5045. }
  5046. function encodeValue(operator, value, key) {
  5047. value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value);
  5048. if (key) {
  5049. return encodeUnreserved(key) + "=" + value;
  5050. } else {
  5051. return value;
  5052. }
  5053. }
  5054. function isDefined(value) {
  5055. return value !== undefined && value !== null;
  5056. }
  5057. function isKeyOperator(operator) {
  5058. return operator === ";" || operator === "&" || operator === "?";
  5059. }
  5060. function getValues(context, operator, key, modifier) {
  5061. var value = context[key],
  5062. result = [];
  5063. if (isDefined(value) && value !== "") {
  5064. if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
  5065. value = value.toString();
  5066. if (modifier && modifier !== "*") {
  5067. value = value.substring(0, parseInt(modifier, 10));
  5068. }
  5069. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  5070. } else {
  5071. if (modifier === "*") {
  5072. if (Array.isArray(value)) {
  5073. value.filter(isDefined).forEach(function (value) {
  5074. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  5075. });
  5076. } else {
  5077. Object.keys(value).forEach(function (k) {
  5078. if (isDefined(value[k])) {
  5079. result.push(encodeValue(operator, value[k], k));
  5080. }
  5081. });
  5082. }
  5083. } else {
  5084. const tmp = [];
  5085. if (Array.isArray(value)) {
  5086. value.filter(isDefined).forEach(function (value) {
  5087. tmp.push(encodeValue(operator, value));
  5088. });
  5089. } else {
  5090. Object.keys(value).forEach(function (k) {
  5091. if (isDefined(value[k])) {
  5092. tmp.push(encodeUnreserved(k));
  5093. tmp.push(encodeValue(operator, value[k].toString()));
  5094. }
  5095. });
  5096. }
  5097. if (isKeyOperator(operator)) {
  5098. result.push(encodeUnreserved(key) + "=" + tmp.join(","));
  5099. } else if (tmp.length !== 0) {
  5100. result.push(tmp.join(","));
  5101. }
  5102. }
  5103. }
  5104. } else {
  5105. if (operator === ";") {
  5106. if (isDefined(value)) {
  5107. result.push(encodeUnreserved(key));
  5108. }
  5109. } else if (value === "" && (operator === "&" || operator === "?")) {
  5110. result.push(encodeUnreserved(key) + "=");
  5111. } else if (value === "") {
  5112. result.push("");
  5113. }
  5114. }
  5115. return result;
  5116. }
  5117. function parseUrl(template) {
  5118. return {
  5119. expand: expand.bind(null, template)
  5120. };
  5121. }
  5122. function expand(template, context) {
  5123. var operators = ["+", "#", ".", "/", ";", "?", "&"];
  5124. return template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function (_, expression, literal) {
  5125. if (expression) {
  5126. let operator = "";
  5127. const values = [];
  5128. if (operators.indexOf(expression.charAt(0)) !== -1) {
  5129. operator = expression.charAt(0);
  5130. expression = expression.substr(1);
  5131. }
  5132. expression.split(/,/g).forEach(function (variable) {
  5133. var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
  5134. values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
  5135. });
  5136. if (operator && operator !== "+") {
  5137. var separator = ",";
  5138. if (operator === "?") {
  5139. separator = "&";
  5140. } else if (operator !== "#") {
  5141. separator = operator;
  5142. }
  5143. return (values.length !== 0 ? operator : "") + values.join(separator);
  5144. } else {
  5145. return values.join(",");
  5146. }
  5147. } else {
  5148. return encodeReserved(literal);
  5149. }
  5150. });
  5151. }
  5152. function parse(options) {
  5153. // https://fetch.spec.whatwg.org/#methods
  5154. let method = options.method.toUpperCase(); // replace :varname with {varname} to make it RFC 6570 compatible
  5155. let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{+$1}");
  5156. let headers = Object.assign({}, options.headers);
  5157. let body;
  5158. let parameters = omit(options, ["method", "baseUrl", "url", "headers", "request", "mediaType"]); // extract variable names from URL to calculate remaining variables later
  5159. const urlVariableNames = extractUrlVariableNames(url);
  5160. url = parseUrl(url).expand(parameters);
  5161. if (!/^http/.test(url)) {
  5162. url = options.baseUrl + url;
  5163. }
  5164. const omittedParameters = Object.keys(options).filter(option => urlVariableNames.includes(option)).concat("baseUrl");
  5165. const remainingParameters = omit(parameters, omittedParameters);
  5166. const isBinaryRequset = /application\/octet-stream/i.test(headers.accept);
  5167. if (!isBinaryRequset) {
  5168. if (options.mediaType.format) {
  5169. // e.g. application/vnd.github.v3+json => application/vnd.github.v3.raw
  5170. headers.accept = headers.accept.split(/,/).map(preview => preview.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`)).join(",");
  5171. }
  5172. if (options.mediaType.previews.length) {
  5173. const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || [];
  5174. headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map(preview => {
  5175. const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json";
  5176. return `application/vnd.github.${preview}-preview${format}`;
  5177. }).join(",");
  5178. }
  5179. } // for GET/HEAD requests, set URL query parameters from remaining parameters
  5180. // for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters
  5181. if (["GET", "HEAD"].includes(method)) {
  5182. url = addQueryParameters(url, remainingParameters);
  5183. } else {
  5184. if ("data" in remainingParameters) {
  5185. body = remainingParameters.data;
  5186. } else {
  5187. if (Object.keys(remainingParameters).length) {
  5188. body = remainingParameters;
  5189. } else {
  5190. headers["content-length"] = 0;
  5191. }
  5192. }
  5193. } // default content-type for JSON if body is set
  5194. if (!headers["content-type"] && typeof body !== "undefined") {
  5195. headers["content-type"] = "application/json; charset=utf-8";
  5196. } // GitHub expects 'content-length: 0' header for PUT/PATCH requests without body.
  5197. // fetch does not allow to set `content-length` header, but we can set body to an empty string
  5198. if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") {
  5199. body = "";
  5200. } // Only return body/request keys if present
  5201. return Object.assign({
  5202. method,
  5203. url,
  5204. headers
  5205. }, typeof body !== "undefined" ? {
  5206. body
  5207. } : null, options.request ? {
  5208. request: options.request
  5209. } : null);
  5210. }
  5211. function endpointWithDefaults(defaults, route, options) {
  5212. return parse(merge(defaults, route, options));
  5213. }
  5214. function withDefaults(oldDefaults, newDefaults) {
  5215. const DEFAULTS = merge(oldDefaults, newDefaults);
  5216. const endpoint = endpointWithDefaults.bind(null, DEFAULTS);
  5217. return Object.assign(endpoint, {
  5218. DEFAULTS,
  5219. defaults: withDefaults.bind(null, DEFAULTS),
  5220. merge: merge.bind(null, DEFAULTS),
  5221. parse
  5222. });
  5223. }
  5224. const VERSION = "5.5.1";
  5225. const userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`; // DEFAULTS has all properties set that EndpointOptions has, except url.
  5226. // So we use RequestParameters and add method as additional required property.
  5227. const DEFAULTS = {
  5228. method: "GET",
  5229. baseUrl: "https://api.github.com",
  5230. headers: {
  5231. accept: "application/vnd.github.v3+json",
  5232. "user-agent": userAgent
  5233. },
  5234. mediaType: {
  5235. format: "",
  5236. previews: []
  5237. }
  5238. };
  5239. const endpoint = withDefaults(null, DEFAULTS);
  5240. exports.endpoint = endpoint;
  5241. //# sourceMappingURL=index.js.map
  5242. /***/ }),
  5243. /***/ 389:
  5244. /***/ (function(module, __unusedexports, __webpack_require__) {
  5245. "use strict";
  5246. const fs = __webpack_require__(747);
  5247. const shebangCommand = __webpack_require__(866);
  5248. function readShebang(command) {
  5249. // Read the first 150 bytes from the file
  5250. const size = 150;
  5251. let buffer;
  5252. if (Buffer.alloc) {
  5253. // Node.js v4.5+ / v5.10+
  5254. buffer = Buffer.alloc(size);
  5255. } else {
  5256. // Old Node.js API
  5257. buffer = new Buffer(size);
  5258. buffer.fill(0); // zero-fill
  5259. }
  5260. let fd;
  5261. try {
  5262. fd = fs.openSync(command, 'r');
  5263. fs.readSync(fd, buffer, 0, size, 0);
  5264. fs.closeSync(fd);
  5265. } catch (e) { /* Empty */ }
  5266. // Attempt to extract shebang (null is returned if not a shebang)
  5267. return shebangCommand(buffer.toString());
  5268. }
  5269. module.exports = readShebang;
  5270. /***/ }),
  5271. /***/ 402:
  5272. /***/ (function(module, __unusedexports, __webpack_require__) {
  5273. module.exports = Octokit;
  5274. const { request } = __webpack_require__(753);
  5275. const Hook = __webpack_require__(523);
  5276. const parseClientOptions = __webpack_require__(294);
  5277. function Octokit(plugins, options) {
  5278. options = options || {};
  5279. const hook = new Hook.Collection();
  5280. const log = Object.assign(
  5281. {
  5282. debug: () => {},
  5283. info: () => {},
  5284. warn: console.warn,
  5285. error: console.error
  5286. },
  5287. options && options.log
  5288. );
  5289. const api = {
  5290. hook,
  5291. log,
  5292. request: request.defaults(parseClientOptions(options, log, hook))
  5293. };
  5294. plugins.forEach(pluginFunction => pluginFunction(api, options));
  5295. return api;
  5296. }
  5297. /***/ }),
  5298. /***/ 413:
  5299. /***/ (function(module) {
  5300. module.exports = require("stream");
  5301. /***/ }),
  5302. /***/ 427:
  5303. /***/ (function(module, __unusedexports, __webpack_require__) {
  5304. "use strict";
  5305. // Older verions of Node.js might not have `util.getSystemErrorName()`.
  5306. // In that case, fall back to a deprecated internal.
  5307. const util = __webpack_require__(669);
  5308. let uv;
  5309. if (typeof util.getSystemErrorName === 'function') {
  5310. module.exports = util.getSystemErrorName;
  5311. } else {
  5312. try {
  5313. uv = process.binding('uv');
  5314. if (typeof uv.errname !== 'function') {
  5315. throw new TypeError('uv.errname is not a function');
  5316. }
  5317. } catch (err) {
  5318. console.error('execa/lib/errname: unable to establish process.binding(\'uv\')', err);
  5319. uv = null;
  5320. }
  5321. module.exports = code => errname(uv, code);
  5322. }
  5323. // Used for testing the fallback behavior
  5324. module.exports.__test__ = errname;
  5325. function errname(uv, code) {
  5326. if (uv) {
  5327. return uv.errname(code);
  5328. }
  5329. if (!(code < 0)) {
  5330. throw new Error('err >= 0');
  5331. }
  5332. return `Unknown system error ${code}`;
  5333. }
  5334. /***/ }),
  5335. /***/ 430:
  5336. /***/ (function(module, __unusedexports, __webpack_require__) {
  5337. module.exports = octokitValidate;
  5338. const validate = __webpack_require__(348);
  5339. function octokitValidate(octokit) {
  5340. octokit.hook.before("request", validate.bind(null, octokit));
  5341. }
  5342. /***/ }),
  5343. /***/ 431:
  5344. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  5345. "use strict";
  5346. Object.defineProperty(exports, "__esModule", { value: true });
  5347. const os = __webpack_require__(87);
  5348. /**
  5349. * Commands
  5350. *
  5351. * Command Format:
  5352. * ##[name key=value;key=value]message
  5353. *
  5354. * Examples:
  5355. * ##[warning]This is the user warning message
  5356. * ##[set-secret name=mypassword]definitelyNotAPassword!
  5357. */
  5358. function issueCommand(command, properties, message) {
  5359. const cmd = new Command(command, properties, message);
  5360. process.stdout.write(cmd.toString() + os.EOL);
  5361. }
  5362. exports.issueCommand = issueCommand;
  5363. function issue(name, message = '') {
  5364. issueCommand(name, {}, message);
  5365. }
  5366. exports.issue = issue;
  5367. const CMD_STRING = '::';
  5368. class Command {
  5369. constructor(command, properties, message) {
  5370. if (!command) {
  5371. command = 'missing.command';
  5372. }
  5373. this.command = command;
  5374. this.properties = properties;
  5375. this.message = message;
  5376. }
  5377. toString() {
  5378. let cmdStr = CMD_STRING + this.command;
  5379. if (this.properties && Object.keys(this.properties).length > 0) {
  5380. cmdStr += ' ';
  5381. for (const key in this.properties) {
  5382. if (this.properties.hasOwnProperty(key)) {
  5383. const val = this.properties[key];
  5384. if (val) {
  5385. // safely append the val - avoid blowing up when attempting to
  5386. // call .replace() if message is not a string for some reason
  5387. cmdStr += `${key}=${escape(`${val || ''}`)},`;
  5388. }
  5389. }
  5390. }
  5391. }
  5392. cmdStr += CMD_STRING;
  5393. // safely append the message - avoid blowing up when attempting to
  5394. // call .replace() if message is not a string for some reason
  5395. const message = `${this.message || ''}`;
  5396. cmdStr += escapeData(message);
  5397. return cmdStr;
  5398. }
  5399. }
  5400. function escapeData(s) {
  5401. return s.replace(/\r/g, '%0D').replace(/\n/g, '%0A');
  5402. }
  5403. function escape(s) {
  5404. return s
  5405. .replace(/\r/g, '%0D')
  5406. .replace(/\n/g, '%0A')
  5407. .replace(/]/g, '%5D')
  5408. .replace(/;/g, '%3B');
  5409. }
  5410. //# sourceMappingURL=command.js.map
  5411. /***/ }),
  5412. /***/ 453:
  5413. /***/ (function(module, __unusedexports, __webpack_require__) {
  5414. var once = __webpack_require__(969)
  5415. var eos = __webpack_require__(562)
  5416. var fs = __webpack_require__(747) // we only need fs to get the ReadStream and WriteStream prototypes
  5417. var noop = function () {}
  5418. var ancient = /^v?\.0/.test(process.version)
  5419. var isFn = function (fn) {
  5420. return typeof fn === 'function'
  5421. }
  5422. var isFS = function (stream) {
  5423. if (!ancient) return false // newer node version do not need to care about fs is a special way
  5424. if (!fs) return false // browser
  5425. return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close)
  5426. }
  5427. var isRequest = function (stream) {
  5428. return stream.setHeader && isFn(stream.abort)
  5429. }
  5430. var destroyer = function (stream, reading, writing, callback) {
  5431. callback = once(callback)
  5432. var closed = false
  5433. stream.on('close', function () {
  5434. closed = true
  5435. })
  5436. eos(stream, {readable: reading, writable: writing}, function (err) {
  5437. if (err) return callback(err)
  5438. closed = true
  5439. callback()
  5440. })
  5441. var destroyed = false
  5442. return function (err) {
  5443. if (closed) return
  5444. if (destroyed) return
  5445. destroyed = true
  5446. if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks
  5447. if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want
  5448. if (isFn(stream.destroy)) return stream.destroy()
  5449. callback(err || new Error('stream was destroyed'))
  5450. }
  5451. }
  5452. var call = function (fn) {
  5453. fn()
  5454. }
  5455. var pipe = function (from, to) {
  5456. return from.pipe(to)
  5457. }
  5458. var pump = function () {
  5459. var streams = Array.prototype.slice.call(arguments)
  5460. var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop
  5461. if (Array.isArray(streams[0])) streams = streams[0]
  5462. if (streams.length < 2) throw new Error('pump requires two streams per minimum')
  5463. var error
  5464. var destroys = streams.map(function (stream, i) {
  5465. var reading = i < streams.length - 1
  5466. var writing = i > 0
  5467. return destroyer(stream, reading, writing, function (err) {
  5468. if (!error) error = err
  5469. if (err) destroys.forEach(call)
  5470. if (reading) return
  5471. destroys.forEach(call)
  5472. callback(error)
  5473. })
  5474. })
  5475. return streams.reduce(pipe)
  5476. }
  5477. module.exports = pump
  5478. /***/ }),
  5479. /***/ 454:
  5480. /***/ (function(module, exports, __webpack_require__) {
  5481. "use strict";
  5482. Object.defineProperty(exports, '__esModule', { value: true });
  5483. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  5484. var Stream = _interopDefault(__webpack_require__(413));
  5485. var http = _interopDefault(__webpack_require__(605));
  5486. var Url = _interopDefault(__webpack_require__(835));
  5487. var https = _interopDefault(__webpack_require__(211));
  5488. var zlib = _interopDefault(__webpack_require__(761));
  5489. // Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js
  5490. // fix for "Readable" isn't a named export issue
  5491. const Readable = Stream.Readable;
  5492. const BUFFER = Symbol('buffer');
  5493. const TYPE = Symbol('type');
  5494. class Blob {
  5495. constructor() {
  5496. this[TYPE] = '';
  5497. const blobParts = arguments[0];
  5498. const options = arguments[1];
  5499. const buffers = [];
  5500. let size = 0;
  5501. if (blobParts) {
  5502. const a = blobParts;
  5503. const length = Number(a.length);
  5504. for (let i = 0; i < length; i++) {
  5505. const element = a[i];
  5506. let buffer;
  5507. if (element instanceof Buffer) {
  5508. buffer = element;
  5509. } else if (ArrayBuffer.isView(element)) {
  5510. buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength);
  5511. } else if (element instanceof ArrayBuffer) {
  5512. buffer = Buffer.from(element);
  5513. } else if (element instanceof Blob) {
  5514. buffer = element[BUFFER];
  5515. } else {
  5516. buffer = Buffer.from(typeof element === 'string' ? element : String(element));
  5517. }
  5518. size += buffer.length;
  5519. buffers.push(buffer);
  5520. }
  5521. }
  5522. this[BUFFER] = Buffer.concat(buffers);
  5523. let type = options && options.type !== undefined && String(options.type).toLowerCase();
  5524. if (type && !/[^\u0020-\u007E]/.test(type)) {
  5525. this[TYPE] = type;
  5526. }
  5527. }
  5528. get size() {
  5529. return this[BUFFER].length;
  5530. }
  5531. get type() {
  5532. return this[TYPE];
  5533. }
  5534. text() {
  5535. return Promise.resolve(this[BUFFER].toString());
  5536. }
  5537. arrayBuffer() {
  5538. const buf = this[BUFFER];
  5539. const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  5540. return Promise.resolve(ab);
  5541. }
  5542. stream() {
  5543. const readable = new Readable();
  5544. readable._read = function () {};
  5545. readable.push(this[BUFFER]);
  5546. readable.push(null);
  5547. return readable;
  5548. }
  5549. toString() {
  5550. return '[object Blob]';
  5551. }
  5552. slice() {
  5553. const size = this.size;
  5554. const start = arguments[0];
  5555. const end = arguments[1];
  5556. let relativeStart, relativeEnd;
  5557. if (start === undefined) {
  5558. relativeStart = 0;
  5559. } else if (start < 0) {
  5560. relativeStart = Math.max(size + start, 0);
  5561. } else {
  5562. relativeStart = Math.min(start, size);
  5563. }
  5564. if (end === undefined) {
  5565. relativeEnd = size;
  5566. } else if (end < 0) {
  5567. relativeEnd = Math.max(size + end, 0);
  5568. } else {
  5569. relativeEnd = Math.min(end, size);
  5570. }
  5571. const span = Math.max(relativeEnd - relativeStart, 0);
  5572. const buffer = this[BUFFER];
  5573. const slicedBuffer = buffer.slice(relativeStart, relativeStart + span);
  5574. const blob = new Blob([], { type: arguments[2] });
  5575. blob[BUFFER] = slicedBuffer;
  5576. return blob;
  5577. }
  5578. }
  5579. Object.defineProperties(Blob.prototype, {
  5580. size: { enumerable: true },
  5581. type: { enumerable: true },
  5582. slice: { enumerable: true }
  5583. });
  5584. Object.defineProperty(Blob.prototype, Symbol.toStringTag, {
  5585. value: 'Blob',
  5586. writable: false,
  5587. enumerable: false,
  5588. configurable: true
  5589. });
  5590. /**
  5591. * fetch-error.js
  5592. *
  5593. * FetchError interface for operational errors
  5594. */
  5595. /**
  5596. * Create FetchError instance
  5597. *
  5598. * @param String message Error message for human
  5599. * @param String type Error type for machine
  5600. * @param String systemError For Node.js system error
  5601. * @return FetchError
  5602. */
  5603. function FetchError(message, type, systemError) {
  5604. Error.call(this, message);
  5605. this.message = message;
  5606. this.type = type;
  5607. // when err.type is `system`, err.code contains system error code
  5608. if (systemError) {
  5609. this.code = this.errno = systemError.code;
  5610. }
  5611. // hide custom error implementation details from end-users
  5612. Error.captureStackTrace(this, this.constructor);
  5613. }
  5614. FetchError.prototype = Object.create(Error.prototype);
  5615. FetchError.prototype.constructor = FetchError;
  5616. FetchError.prototype.name = 'FetchError';
  5617. let convert;
  5618. try {
  5619. convert = __webpack_require__(18).convert;
  5620. } catch (e) {}
  5621. const INTERNALS = Symbol('Body internals');
  5622. // fix an issue where "PassThrough" isn't a named export for node <10
  5623. const PassThrough = Stream.PassThrough;
  5624. /**
  5625. * Body mixin
  5626. *
  5627. * Ref: https://fetch.spec.whatwg.org/#body
  5628. *
  5629. * @param Stream body Readable stream
  5630. * @param Object opts Response options
  5631. * @return Void
  5632. */
  5633. function Body(body) {
  5634. var _this = this;
  5635. var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  5636. _ref$size = _ref.size;
  5637. let size = _ref$size === undefined ? 0 : _ref$size;
  5638. var _ref$timeout = _ref.timeout;
  5639. let timeout = _ref$timeout === undefined ? 0 : _ref$timeout;
  5640. if (body == null) {
  5641. // body is undefined or null
  5642. body = null;
  5643. } else if (isURLSearchParams(body)) {
  5644. // body is a URLSearchParams
  5645. body = Buffer.from(body.toString());
  5646. } else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  5647. // body is ArrayBuffer
  5648. body = Buffer.from(body);
  5649. } else if (ArrayBuffer.isView(body)) {
  5650. // body is ArrayBufferView
  5651. body = Buffer.from(body.buffer, body.byteOffset, body.byteLength);
  5652. } else if (body instanceof Stream) ; else {
  5653. // none of the above
  5654. // coerce to string then buffer
  5655. body = Buffer.from(String(body));
  5656. }
  5657. this[INTERNALS] = {
  5658. body,
  5659. disturbed: false,
  5660. error: null
  5661. };
  5662. this.size = size;
  5663. this.timeout = timeout;
  5664. if (body instanceof Stream) {
  5665. body.on('error', function (err) {
  5666. const error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err);
  5667. _this[INTERNALS].error = error;
  5668. });
  5669. }
  5670. }
  5671. Body.prototype = {
  5672. get body() {
  5673. return this[INTERNALS].body;
  5674. },
  5675. get bodyUsed() {
  5676. return this[INTERNALS].disturbed;
  5677. },
  5678. /**
  5679. * Decode response as ArrayBuffer
  5680. *
  5681. * @return Promise
  5682. */
  5683. arrayBuffer() {
  5684. return consumeBody.call(this).then(function (buf) {
  5685. return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  5686. });
  5687. },
  5688. /**
  5689. * Return raw response as Blob
  5690. *
  5691. * @return Promise
  5692. */
  5693. blob() {
  5694. let ct = this.headers && this.headers.get('content-type') || '';
  5695. return consumeBody.call(this).then(function (buf) {
  5696. return Object.assign(
  5697. // Prevent copying
  5698. new Blob([], {
  5699. type: ct.toLowerCase()
  5700. }), {
  5701. [BUFFER]: buf
  5702. });
  5703. });
  5704. },
  5705. /**
  5706. * Decode response as json
  5707. *
  5708. * @return Promise
  5709. */
  5710. json() {
  5711. var _this2 = this;
  5712. return consumeBody.call(this).then(function (buffer) {
  5713. try {
  5714. return JSON.parse(buffer.toString());
  5715. } catch (err) {
  5716. return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));
  5717. }
  5718. });
  5719. },
  5720. /**
  5721. * Decode response as text
  5722. *
  5723. * @return Promise
  5724. */
  5725. text() {
  5726. return consumeBody.call(this).then(function (buffer) {
  5727. return buffer.toString();
  5728. });
  5729. },
  5730. /**
  5731. * Decode response as buffer (non-spec api)
  5732. *
  5733. * @return Promise
  5734. */
  5735. buffer() {
  5736. return consumeBody.call(this);
  5737. },
  5738. /**
  5739. * Decode response as text, while automatically detecting the encoding and
  5740. * trying to decode to UTF-8 (non-spec api)
  5741. *
  5742. * @return Promise
  5743. */
  5744. textConverted() {
  5745. var _this3 = this;
  5746. return consumeBody.call(this).then(function (buffer) {
  5747. return convertBody(buffer, _this3.headers);
  5748. });
  5749. }
  5750. };
  5751. // In browsers, all properties are enumerable.
  5752. Object.defineProperties(Body.prototype, {
  5753. body: { enumerable: true },
  5754. bodyUsed: { enumerable: true },
  5755. arrayBuffer: { enumerable: true },
  5756. blob: { enumerable: true },
  5757. json: { enumerable: true },
  5758. text: { enumerable: true }
  5759. });
  5760. Body.mixIn = function (proto) {
  5761. for (const name of Object.getOwnPropertyNames(Body.prototype)) {
  5762. // istanbul ignore else: future proof
  5763. if (!(name in proto)) {
  5764. const desc = Object.getOwnPropertyDescriptor(Body.prototype, name);
  5765. Object.defineProperty(proto, name, desc);
  5766. }
  5767. }
  5768. };
  5769. /**
  5770. * Consume and convert an entire Body to a Buffer.
  5771. *
  5772. * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body
  5773. *
  5774. * @return Promise
  5775. */
  5776. function consumeBody() {
  5777. var _this4 = this;
  5778. if (this[INTERNALS].disturbed) {
  5779. return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`));
  5780. }
  5781. this[INTERNALS].disturbed = true;
  5782. if (this[INTERNALS].error) {
  5783. return Body.Promise.reject(this[INTERNALS].error);
  5784. }
  5785. let body = this.body;
  5786. // body is null
  5787. if (body === null) {
  5788. return Body.Promise.resolve(Buffer.alloc(0));
  5789. }
  5790. // body is blob
  5791. if (isBlob(body)) {
  5792. body = body.stream();
  5793. }
  5794. // body is buffer
  5795. if (Buffer.isBuffer(body)) {
  5796. return Body.Promise.resolve(body);
  5797. }
  5798. // istanbul ignore if: should never happen
  5799. if (!(body instanceof Stream)) {
  5800. return Body.Promise.resolve(Buffer.alloc(0));
  5801. }
  5802. // body is stream
  5803. // get ready to actually consume the body
  5804. let accum = [];
  5805. let accumBytes = 0;
  5806. let abort = false;
  5807. return new Body.Promise(function (resolve, reject) {
  5808. let resTimeout;
  5809. // allow timeout on slow response body
  5810. if (_this4.timeout) {
  5811. resTimeout = setTimeout(function () {
  5812. abort = true;
  5813. reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout'));
  5814. }, _this4.timeout);
  5815. }
  5816. // handle stream errors
  5817. body.on('error', function (err) {
  5818. if (err.name === 'AbortError') {
  5819. // if the request was aborted, reject with this Error
  5820. abort = true;
  5821. reject(err);
  5822. } else {
  5823. // other errors, such as incorrect content-encoding
  5824. reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err));
  5825. }
  5826. });
  5827. body.on('data', function (chunk) {
  5828. if (abort || chunk === null) {
  5829. return;
  5830. }
  5831. if (_this4.size && accumBytes + chunk.length > _this4.size) {
  5832. abort = true;
  5833. reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size'));
  5834. return;
  5835. }
  5836. accumBytes += chunk.length;
  5837. accum.push(chunk);
  5838. });
  5839. body.on('end', function () {
  5840. if (abort) {
  5841. return;
  5842. }
  5843. clearTimeout(resTimeout);
  5844. try {
  5845. resolve(Buffer.concat(accum, accumBytes));
  5846. } catch (err) {
  5847. // handle streams that have accumulated too much data (issue #414)
  5848. reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err));
  5849. }
  5850. });
  5851. });
  5852. }
  5853. /**
  5854. * Detect buffer encoding and convert to target encoding
  5855. * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding
  5856. *
  5857. * @param Buffer buffer Incoming buffer
  5858. * @param String encoding Target encoding
  5859. * @return String
  5860. */
  5861. function convertBody(buffer, headers) {
  5862. if (typeof convert !== 'function') {
  5863. throw new Error('The package `encoding` must be installed to use the textConverted() function');
  5864. }
  5865. const ct = headers.get('content-type');
  5866. let charset = 'utf-8';
  5867. let res, str;
  5868. // header
  5869. if (ct) {
  5870. res = /charset=([^;]*)/i.exec(ct);
  5871. }
  5872. // no charset in content type, peek at response body for at most 1024 bytes
  5873. str = buffer.slice(0, 1024).toString();
  5874. // html5
  5875. if (!res && str) {
  5876. res = /<meta.+?charset=(['"])(.+?)\1/i.exec(str);
  5877. }
  5878. // html4
  5879. if (!res && str) {
  5880. res = /<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(str);
  5881. if (res) {
  5882. res = /charset=(.*)/i.exec(res.pop());
  5883. }
  5884. }
  5885. // xml
  5886. if (!res && str) {
  5887. res = /<\?xml.+?encoding=(['"])(.+?)\1/i.exec(str);
  5888. }
  5889. // found charset
  5890. if (res) {
  5891. charset = res.pop();
  5892. // prevent decode issues when sites use incorrect encoding
  5893. // ref: https://hsivonen.fi/encoding-menu/
  5894. if (charset === 'gb2312' || charset === 'gbk') {
  5895. charset = 'gb18030';
  5896. }
  5897. }
  5898. // turn raw buffers into a single utf-8 buffer
  5899. return convert(buffer, 'UTF-8', charset).toString();
  5900. }
  5901. /**
  5902. * Detect a URLSearchParams object
  5903. * ref: https://github.com/bitinn/node-fetch/issues/296#issuecomment-307598143
  5904. *
  5905. * @param Object obj Object to detect by type or brand
  5906. * @return String
  5907. */
  5908. function isURLSearchParams(obj) {
  5909. // Duck-typing as a necessary condition.
  5910. 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') {
  5911. return false;
  5912. }
  5913. // Brand-checking and more duck-typing as optional condition.
  5914. return obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';
  5915. }
  5916. /**
  5917. * Check if `obj` is a W3C `Blob` object (which `File` inherits from)
  5918. * @param {*} obj
  5919. * @return {boolean}
  5920. */
  5921. function isBlob(obj) {
  5922. 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]);
  5923. }
  5924. /**
  5925. * Clone body given Res/Req instance
  5926. *
  5927. * @param Mixed instance Response or Request instance
  5928. * @return Mixed
  5929. */
  5930. function clone(instance) {
  5931. let p1, p2;
  5932. let body = instance.body;
  5933. // don't allow cloning a used body
  5934. if (instance.bodyUsed) {
  5935. throw new Error('cannot clone body after it is used');
  5936. }
  5937. // check that body is a stream and not form-data object
  5938. // note: we can't clone the form-data object without having it as a dependency
  5939. if (body instanceof Stream && typeof body.getBoundary !== 'function') {
  5940. // tee instance body
  5941. p1 = new PassThrough();
  5942. p2 = new PassThrough();
  5943. body.pipe(p1);
  5944. body.pipe(p2);
  5945. // set instance body to teed body and return the other teed body
  5946. instance[INTERNALS].body = p1;
  5947. body = p2;
  5948. }
  5949. return body;
  5950. }
  5951. /**
  5952. * Performs the operation "extract a `Content-Type` value from |object|" as
  5953. * specified in the specification:
  5954. * https://fetch.spec.whatwg.org/#concept-bodyinit-extract
  5955. *
  5956. * This function assumes that instance.body is present.
  5957. *
  5958. * @param Mixed instance Any options.body input
  5959. */
  5960. function extractContentType(body) {
  5961. if (body === null) {
  5962. // body is null
  5963. return null;
  5964. } else if (typeof body === 'string') {
  5965. // body is string
  5966. return 'text/plain;charset=UTF-8';
  5967. } else if (isURLSearchParams(body)) {
  5968. // body is a URLSearchParams
  5969. return 'application/x-www-form-urlencoded;charset=UTF-8';
  5970. } else if (isBlob(body)) {
  5971. // body is blob
  5972. return body.type || null;
  5973. } else if (Buffer.isBuffer(body)) {
  5974. // body is buffer
  5975. return null;
  5976. } else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  5977. // body is ArrayBuffer
  5978. return null;
  5979. } else if (ArrayBuffer.isView(body)) {
  5980. // body is ArrayBufferView
  5981. return null;
  5982. } else if (typeof body.getBoundary === 'function') {
  5983. // detect form data input from form-data module
  5984. return `multipart/form-data;boundary=${body.getBoundary()}`;
  5985. } else if (body instanceof Stream) {
  5986. // body is stream
  5987. // can't really do much about this
  5988. return null;
  5989. } else {
  5990. // Body constructor defaults other things to string
  5991. return 'text/plain;charset=UTF-8';
  5992. }
  5993. }
  5994. /**
  5995. * The Fetch Standard treats this as if "total bytes" is a property on the body.
  5996. * For us, we have to explicitly get it with a function.
  5997. *
  5998. * ref: https://fetch.spec.whatwg.org/#concept-body-total-bytes
  5999. *
  6000. * @param Body instance Instance of Body
  6001. * @return Number? Number of bytes, or null if not possible
  6002. */
  6003. function getTotalBytes(instance) {
  6004. const body = instance.body;
  6005. if (body === null) {
  6006. // body is null
  6007. return 0;
  6008. } else if (isBlob(body)) {
  6009. return body.size;
  6010. } else if (Buffer.isBuffer(body)) {
  6011. // body is buffer
  6012. return body.length;
  6013. } else if (body && typeof body.getLengthSync === 'function') {
  6014. // detect form data input from form-data module
  6015. if (body._lengthRetrievers && body._lengthRetrievers.length == 0 || // 1.x
  6016. body.hasKnownLength && body.hasKnownLength()) {
  6017. // 2.x
  6018. return body.getLengthSync();
  6019. }
  6020. return null;
  6021. } else {
  6022. // body is stream
  6023. return null;
  6024. }
  6025. }
  6026. /**
  6027. * Write a Body to a Node.js WritableStream (e.g. http.Request) object.
  6028. *
  6029. * @param Body instance Instance of Body
  6030. * @return Void
  6031. */
  6032. function writeToStream(dest, instance) {
  6033. const body = instance.body;
  6034. if (body === null) {
  6035. // body is null
  6036. dest.end();
  6037. } else if (isBlob(body)) {
  6038. body.stream().pipe(dest);
  6039. } else if (Buffer.isBuffer(body)) {
  6040. // body is buffer
  6041. dest.write(body);
  6042. dest.end();
  6043. } else {
  6044. // body is stream
  6045. body.pipe(dest);
  6046. }
  6047. }
  6048. // expose Promise
  6049. Body.Promise = global.Promise;
  6050. /**
  6051. * headers.js
  6052. *
  6053. * Headers class offers convenient helpers
  6054. */
  6055. const invalidTokenRegex = /[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/;
  6056. const invalidHeaderCharRegex = /[^\t\x20-\x7e\x80-\xff]/;
  6057. function validateName(name) {
  6058. name = `${name}`;
  6059. if (invalidTokenRegex.test(name) || name === '') {
  6060. throw new TypeError(`${name} is not a legal HTTP header name`);
  6061. }
  6062. }
  6063. function validateValue(value) {
  6064. value = `${value}`;
  6065. if (invalidHeaderCharRegex.test(value)) {
  6066. throw new TypeError(`${value} is not a legal HTTP header value`);
  6067. }
  6068. }
  6069. /**
  6070. * Find the key in the map object given a header name.
  6071. *
  6072. * Returns undefined if not found.
  6073. *
  6074. * @param String name Header name
  6075. * @return String|Undefined
  6076. */
  6077. function find(map, name) {
  6078. name = name.toLowerCase();
  6079. for (const key in map) {
  6080. if (key.toLowerCase() === name) {
  6081. return key;
  6082. }
  6083. }
  6084. return undefined;
  6085. }
  6086. const MAP = Symbol('map');
  6087. class Headers {
  6088. /**
  6089. * Headers class
  6090. *
  6091. * @param Object headers Response headers
  6092. * @return Void
  6093. */
  6094. constructor() {
  6095. let init = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
  6096. this[MAP] = Object.create(null);
  6097. if (init instanceof Headers) {
  6098. const rawHeaders = init.raw();
  6099. const headerNames = Object.keys(rawHeaders);
  6100. for (const headerName of headerNames) {
  6101. for (const value of rawHeaders[headerName]) {
  6102. this.append(headerName, value);
  6103. }
  6104. }
  6105. return;
  6106. }
  6107. // We don't worry about converting prop to ByteString here as append()
  6108. // will handle it.
  6109. if (init == null) ; else if (typeof init === 'object') {
  6110. const method = init[Symbol.iterator];
  6111. if (method != null) {
  6112. if (typeof method !== 'function') {
  6113. throw new TypeError('Header pairs must be iterable');
  6114. }
  6115. // sequence<sequence<ByteString>>
  6116. // Note: per spec we have to first exhaust the lists then process them
  6117. const pairs = [];
  6118. for (const pair of init) {
  6119. if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') {
  6120. throw new TypeError('Each header pair must be iterable');
  6121. }
  6122. pairs.push(Array.from(pair));
  6123. }
  6124. for (const pair of pairs) {
  6125. if (pair.length !== 2) {
  6126. throw new TypeError('Each header pair must be a name/value tuple');
  6127. }
  6128. this.append(pair[0], pair[1]);
  6129. }
  6130. } else {
  6131. // record<ByteString, ByteString>
  6132. for (const key of Object.keys(init)) {
  6133. const value = init[key];
  6134. this.append(key, value);
  6135. }
  6136. }
  6137. } else {
  6138. throw new TypeError('Provided initializer must be an object');
  6139. }
  6140. }
  6141. /**
  6142. * Return combined header value given name
  6143. *
  6144. * @param String name Header name
  6145. * @return Mixed
  6146. */
  6147. get(name) {
  6148. name = `${name}`;
  6149. validateName(name);
  6150. const key = find(this[MAP], name);
  6151. if (key === undefined) {
  6152. return null;
  6153. }
  6154. return this[MAP][key].join(', ');
  6155. }
  6156. /**
  6157. * Iterate over all headers
  6158. *
  6159. * @param Function callback Executed for each item with parameters (value, name, thisArg)
  6160. * @param Boolean thisArg `this` context for callback function
  6161. * @return Void
  6162. */
  6163. forEach(callback) {
  6164. let thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
  6165. let pairs = getHeaders(this);
  6166. let i = 0;
  6167. while (i < pairs.length) {
  6168. var _pairs$i = pairs[i];
  6169. const name = _pairs$i[0],
  6170. value = _pairs$i[1];
  6171. callback.call(thisArg, value, name, this);
  6172. pairs = getHeaders(this);
  6173. i++;
  6174. }
  6175. }
  6176. /**
  6177. * Overwrite header values given name
  6178. *
  6179. * @param String name Header name
  6180. * @param String value Header value
  6181. * @return Void
  6182. */
  6183. set(name, value) {
  6184. name = `${name}`;
  6185. value = `${value}`;
  6186. validateName(name);
  6187. validateValue(value);
  6188. const key = find(this[MAP], name);
  6189. this[MAP][key !== undefined ? key : name] = [value];
  6190. }
  6191. /**
  6192. * Append a value onto existing header
  6193. *
  6194. * @param String name Header name
  6195. * @param String value Header value
  6196. * @return Void
  6197. */
  6198. append(name, value) {
  6199. name = `${name}`;
  6200. value = `${value}`;
  6201. validateName(name);
  6202. validateValue(value);
  6203. const key = find(this[MAP], name);
  6204. if (key !== undefined) {
  6205. this[MAP][key].push(value);
  6206. } else {
  6207. this[MAP][name] = [value];
  6208. }
  6209. }
  6210. /**
  6211. * Check for header name existence
  6212. *
  6213. * @param String name Header name
  6214. * @return Boolean
  6215. */
  6216. has(name) {
  6217. name = `${name}`;
  6218. validateName(name);
  6219. return find(this[MAP], name) !== undefined;
  6220. }
  6221. /**
  6222. * Delete all header values given name
  6223. *
  6224. * @param String name Header name
  6225. * @return Void
  6226. */
  6227. delete(name) {
  6228. name = `${name}`;
  6229. validateName(name);
  6230. const key = find(this[MAP], name);
  6231. if (key !== undefined) {
  6232. delete this[MAP][key];
  6233. }
  6234. }
  6235. /**
  6236. * Return raw headers (non-spec api)
  6237. *
  6238. * @return Object
  6239. */
  6240. raw() {
  6241. return this[MAP];
  6242. }
  6243. /**
  6244. * Get an iterator on keys.
  6245. *
  6246. * @return Iterator
  6247. */
  6248. keys() {
  6249. return createHeadersIterator(this, 'key');
  6250. }
  6251. /**
  6252. * Get an iterator on values.
  6253. *
  6254. * @return Iterator
  6255. */
  6256. values() {
  6257. return createHeadersIterator(this, 'value');
  6258. }
  6259. /**
  6260. * Get an iterator on entries.
  6261. *
  6262. * This is the default iterator of the Headers object.
  6263. *
  6264. * @return Iterator
  6265. */
  6266. [Symbol.iterator]() {
  6267. return createHeadersIterator(this, 'key+value');
  6268. }
  6269. }
  6270. Headers.prototype.entries = Headers.prototype[Symbol.iterator];
  6271. Object.defineProperty(Headers.prototype, Symbol.toStringTag, {
  6272. value: 'Headers',
  6273. writable: false,
  6274. enumerable: false,
  6275. configurable: true
  6276. });
  6277. Object.defineProperties(Headers.prototype, {
  6278. get: { enumerable: true },
  6279. forEach: { enumerable: true },
  6280. set: { enumerable: true },
  6281. append: { enumerable: true },
  6282. has: { enumerable: true },
  6283. delete: { enumerable: true },
  6284. keys: { enumerable: true },
  6285. values: { enumerable: true },
  6286. entries: { enumerable: true }
  6287. });
  6288. function getHeaders(headers) {
  6289. let kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value';
  6290. const keys = Object.keys(headers[MAP]).sort();
  6291. return keys.map(kind === 'key' ? function (k) {
  6292. return k.toLowerCase();
  6293. } : kind === 'value' ? function (k) {
  6294. return headers[MAP][k].join(', ');
  6295. } : function (k) {
  6296. return [k.toLowerCase(), headers[MAP][k].join(', ')];
  6297. });
  6298. }
  6299. const INTERNAL = Symbol('internal');
  6300. function createHeadersIterator(target, kind) {
  6301. const iterator = Object.create(HeadersIteratorPrototype);
  6302. iterator[INTERNAL] = {
  6303. target,
  6304. kind,
  6305. index: 0
  6306. };
  6307. return iterator;
  6308. }
  6309. const HeadersIteratorPrototype = Object.setPrototypeOf({
  6310. next() {
  6311. // istanbul ignore if
  6312. if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) {
  6313. throw new TypeError('Value of `this` is not a HeadersIterator');
  6314. }
  6315. var _INTERNAL = this[INTERNAL];
  6316. const target = _INTERNAL.target,
  6317. kind = _INTERNAL.kind,
  6318. index = _INTERNAL.index;
  6319. const values = getHeaders(target, kind);
  6320. const len = values.length;
  6321. if (index >= len) {
  6322. return {
  6323. value: undefined,
  6324. done: true
  6325. };
  6326. }
  6327. this[INTERNAL].index = index + 1;
  6328. return {
  6329. value: values[index],
  6330. done: false
  6331. };
  6332. }
  6333. }, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));
  6334. Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, {
  6335. value: 'HeadersIterator',
  6336. writable: false,
  6337. enumerable: false,
  6338. configurable: true
  6339. });
  6340. /**
  6341. * Export the Headers object in a form that Node.js can consume.
  6342. *
  6343. * @param Headers headers
  6344. * @return Object
  6345. */
  6346. function exportNodeCompatibleHeaders(headers) {
  6347. const obj = Object.assign({ __proto__: null }, headers[MAP]);
  6348. // http.request() only supports string as Host header. This hack makes
  6349. // specifying custom Host header possible.
  6350. const hostHeaderKey = find(headers[MAP], 'Host');
  6351. if (hostHeaderKey !== undefined) {
  6352. obj[hostHeaderKey] = obj[hostHeaderKey][0];
  6353. }
  6354. return obj;
  6355. }
  6356. /**
  6357. * Create a Headers object from an object of headers, ignoring those that do
  6358. * not conform to HTTP grammar productions.
  6359. *
  6360. * @param Object obj Object of headers
  6361. * @return Headers
  6362. */
  6363. function createHeadersLenient(obj) {
  6364. const headers = new Headers();
  6365. for (const name of Object.keys(obj)) {
  6366. if (invalidTokenRegex.test(name)) {
  6367. continue;
  6368. }
  6369. if (Array.isArray(obj[name])) {
  6370. for (const val of obj[name]) {
  6371. if (invalidHeaderCharRegex.test(val)) {
  6372. continue;
  6373. }
  6374. if (headers[MAP][name] === undefined) {
  6375. headers[MAP][name] = [val];
  6376. } else {
  6377. headers[MAP][name].push(val);
  6378. }
  6379. }
  6380. } else if (!invalidHeaderCharRegex.test(obj[name])) {
  6381. headers[MAP][name] = [obj[name]];
  6382. }
  6383. }
  6384. return headers;
  6385. }
  6386. const INTERNALS$1 = Symbol('Response internals');
  6387. // fix an issue where "STATUS_CODES" aren't a named export for node <10
  6388. const STATUS_CODES = http.STATUS_CODES;
  6389. /**
  6390. * Response class
  6391. *
  6392. * @param Stream body Readable stream
  6393. * @param Object opts Response options
  6394. * @return Void
  6395. */
  6396. class Response {
  6397. constructor() {
  6398. let body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  6399. let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  6400. Body.call(this, body, opts);
  6401. const status = opts.status || 200;
  6402. const headers = new Headers(opts.headers);
  6403. if (body != null && !headers.has('Content-Type')) {
  6404. const contentType = extractContentType(body);
  6405. if (contentType) {
  6406. headers.append('Content-Type', contentType);
  6407. }
  6408. }
  6409. this[INTERNALS$1] = {
  6410. url: opts.url,
  6411. status,
  6412. statusText: opts.statusText || STATUS_CODES[status],
  6413. headers,
  6414. counter: opts.counter
  6415. };
  6416. }
  6417. get url() {
  6418. return this[INTERNALS$1].url || '';
  6419. }
  6420. get status() {
  6421. return this[INTERNALS$1].status;
  6422. }
  6423. /**
  6424. * Convenience property representing if the request ended normally
  6425. */
  6426. get ok() {
  6427. return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;
  6428. }
  6429. get redirected() {
  6430. return this[INTERNALS$1].counter > 0;
  6431. }
  6432. get statusText() {
  6433. return this[INTERNALS$1].statusText;
  6434. }
  6435. get headers() {
  6436. return this[INTERNALS$1].headers;
  6437. }
  6438. /**
  6439. * Clone this response
  6440. *
  6441. * @return Response
  6442. */
  6443. clone() {
  6444. return new Response(clone(this), {
  6445. url: this.url,
  6446. status: this.status,
  6447. statusText: this.statusText,
  6448. headers: this.headers,
  6449. ok: this.ok,
  6450. redirected: this.redirected
  6451. });
  6452. }
  6453. }
  6454. Body.mixIn(Response.prototype);
  6455. Object.defineProperties(Response.prototype, {
  6456. url: { enumerable: true },
  6457. status: { enumerable: true },
  6458. ok: { enumerable: true },
  6459. redirected: { enumerable: true },
  6460. statusText: { enumerable: true },
  6461. headers: { enumerable: true },
  6462. clone: { enumerable: true }
  6463. });
  6464. Object.defineProperty(Response.prototype, Symbol.toStringTag, {
  6465. value: 'Response',
  6466. writable: false,
  6467. enumerable: false,
  6468. configurable: true
  6469. });
  6470. const INTERNALS$2 = Symbol('Request internals');
  6471. // fix an issue where "format", "parse" aren't a named export for node <10
  6472. const parse_url = Url.parse;
  6473. const format_url = Url.format;
  6474. const streamDestructionSupported = 'destroy' in Stream.Readable.prototype;
  6475. /**
  6476. * Check if a value is an instance of Request.
  6477. *
  6478. * @param Mixed input
  6479. * @return Boolean
  6480. */
  6481. function isRequest(input) {
  6482. return typeof input === 'object' && typeof input[INTERNALS$2] === 'object';
  6483. }
  6484. function isAbortSignal(signal) {
  6485. const proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal);
  6486. return !!(proto && proto.constructor.name === 'AbortSignal');
  6487. }
  6488. /**
  6489. * Request class
  6490. *
  6491. * @param Mixed input Url or Request instance
  6492. * @param Object init Custom options
  6493. * @return Void
  6494. */
  6495. class Request {
  6496. constructor(input) {
  6497. let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  6498. let parsedURL;
  6499. // normalize input
  6500. if (!isRequest(input)) {
  6501. if (input && input.href) {
  6502. // in order to support Node.js' Url objects; though WHATWG's URL objects
  6503. // will fall into this branch also (since their `toString()` will return
  6504. // `href` property anyway)
  6505. parsedURL = parse_url(input.href);
  6506. } else {
  6507. // coerce input to a string before attempting to parse
  6508. parsedURL = parse_url(`${input}`);
  6509. }
  6510. input = {};
  6511. } else {
  6512. parsedURL = parse_url(input.url);
  6513. }
  6514. let method = init.method || input.method || 'GET';
  6515. method = method.toUpperCase();
  6516. if ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) {
  6517. throw new TypeError('Request with GET/HEAD method cannot have body');
  6518. }
  6519. let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null;
  6520. Body.call(this, inputBody, {
  6521. timeout: init.timeout || input.timeout || 0,
  6522. size: init.size || input.size || 0
  6523. });
  6524. const headers = new Headers(init.headers || input.headers || {});
  6525. if (inputBody != null && !headers.has('Content-Type')) {
  6526. const contentType = extractContentType(inputBody);
  6527. if (contentType) {
  6528. headers.append('Content-Type', contentType);
  6529. }
  6530. }
  6531. let signal = isRequest(input) ? input.signal : null;
  6532. if ('signal' in init) signal = init.signal;
  6533. if (signal != null && !isAbortSignal(signal)) {
  6534. throw new TypeError('Expected signal to be an instanceof AbortSignal');
  6535. }
  6536. this[INTERNALS$2] = {
  6537. method,
  6538. redirect: init.redirect || input.redirect || 'follow',
  6539. headers,
  6540. parsedURL,
  6541. signal
  6542. };
  6543. // node-fetch-only options
  6544. this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20;
  6545. this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true;
  6546. this.counter = init.counter || input.counter || 0;
  6547. this.agent = init.agent || input.agent;
  6548. }
  6549. get method() {
  6550. return this[INTERNALS$2].method;
  6551. }
  6552. get url() {
  6553. return format_url(this[INTERNALS$2].parsedURL);
  6554. }
  6555. get headers() {
  6556. return this[INTERNALS$2].headers;
  6557. }
  6558. get redirect() {
  6559. return this[INTERNALS$2].redirect;
  6560. }
  6561. get signal() {
  6562. return this[INTERNALS$2].signal;
  6563. }
  6564. /**
  6565. * Clone this request
  6566. *
  6567. * @return Request
  6568. */
  6569. clone() {
  6570. return new Request(this);
  6571. }
  6572. }
  6573. Body.mixIn(Request.prototype);
  6574. Object.defineProperty(Request.prototype, Symbol.toStringTag, {
  6575. value: 'Request',
  6576. writable: false,
  6577. enumerable: false,
  6578. configurable: true
  6579. });
  6580. Object.defineProperties(Request.prototype, {
  6581. method: { enumerable: true },
  6582. url: { enumerable: true },
  6583. headers: { enumerable: true },
  6584. redirect: { enumerable: true },
  6585. clone: { enumerable: true },
  6586. signal: { enumerable: true }
  6587. });
  6588. /**
  6589. * Convert a Request to Node.js http request options.
  6590. *
  6591. * @param Request A Request instance
  6592. * @return Object The options object to be passed to http.request
  6593. */
  6594. function getNodeRequestOptions(request) {
  6595. const parsedURL = request[INTERNALS$2].parsedURL;
  6596. const headers = new Headers(request[INTERNALS$2].headers);
  6597. // fetch step 1.3
  6598. if (!headers.has('Accept')) {
  6599. headers.set('Accept', '*/*');
  6600. }
  6601. // Basic fetch
  6602. if (!parsedURL.protocol || !parsedURL.hostname) {
  6603. throw new TypeError('Only absolute URLs are supported');
  6604. }
  6605. if (!/^https?:$/.test(parsedURL.protocol)) {
  6606. throw new TypeError('Only HTTP(S) protocols are supported');
  6607. }
  6608. if (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) {
  6609. throw new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8');
  6610. }
  6611. // HTTP-network-or-cache fetch steps 2.4-2.7
  6612. let contentLengthValue = null;
  6613. if (request.body == null && /^(POST|PUT)$/i.test(request.method)) {
  6614. contentLengthValue = '0';
  6615. }
  6616. if (request.body != null) {
  6617. const totalBytes = getTotalBytes(request);
  6618. if (typeof totalBytes === 'number') {
  6619. contentLengthValue = String(totalBytes);
  6620. }
  6621. }
  6622. if (contentLengthValue) {
  6623. headers.set('Content-Length', contentLengthValue);
  6624. }
  6625. // HTTP-network-or-cache fetch step 2.11
  6626. if (!headers.has('User-Agent')) {
  6627. headers.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)');
  6628. }
  6629. // HTTP-network-or-cache fetch step 2.15
  6630. if (request.compress && !headers.has('Accept-Encoding')) {
  6631. headers.set('Accept-Encoding', 'gzip,deflate');
  6632. }
  6633. let agent = request.agent;
  6634. if (typeof agent === 'function') {
  6635. agent = agent(parsedURL);
  6636. }
  6637. if (!headers.has('Connection') && !agent) {
  6638. headers.set('Connection', 'close');
  6639. }
  6640. // HTTP-network fetch step 4.2
  6641. // chunked encoding is handled by Node.js
  6642. return Object.assign({}, parsedURL, {
  6643. method: request.method,
  6644. headers: exportNodeCompatibleHeaders(headers),
  6645. agent
  6646. });
  6647. }
  6648. /**
  6649. * abort-error.js
  6650. *
  6651. * AbortError interface for cancelled requests
  6652. */
  6653. /**
  6654. * Create AbortError instance
  6655. *
  6656. * @param String message Error message for human
  6657. * @return AbortError
  6658. */
  6659. function AbortError(message) {
  6660. Error.call(this, message);
  6661. this.type = 'aborted';
  6662. this.message = message;
  6663. // hide custom error implementation details from end-users
  6664. Error.captureStackTrace(this, this.constructor);
  6665. }
  6666. AbortError.prototype = Object.create(Error.prototype);
  6667. AbortError.prototype.constructor = AbortError;
  6668. AbortError.prototype.name = 'AbortError';
  6669. // fix an issue where "PassThrough", "resolve" aren't a named export for node <10
  6670. const PassThrough$1 = Stream.PassThrough;
  6671. const resolve_url = Url.resolve;
  6672. /**
  6673. * Fetch function
  6674. *
  6675. * @param Mixed url Absolute url or Request instance
  6676. * @param Object opts Fetch options
  6677. * @return Promise
  6678. */
  6679. function fetch(url, opts) {
  6680. // allow custom promise
  6681. if (!fetch.Promise) {
  6682. throw new Error('native promise missing, set fetch.Promise to your favorite alternative');
  6683. }
  6684. Body.Promise = fetch.Promise;
  6685. // wrap http.request into fetch
  6686. return new fetch.Promise(function (resolve, reject) {
  6687. // build request object
  6688. const request = new Request(url, opts);
  6689. const options = getNodeRequestOptions(request);
  6690. const send = (options.protocol === 'https:' ? https : http).request;
  6691. const signal = request.signal;
  6692. let response = null;
  6693. const abort = function abort() {
  6694. let error = new AbortError('The user aborted a request.');
  6695. reject(error);
  6696. if (request.body && request.body instanceof Stream.Readable) {
  6697. request.body.destroy(error);
  6698. }
  6699. if (!response || !response.body) return;
  6700. response.body.emit('error', error);
  6701. };
  6702. if (signal && signal.aborted) {
  6703. abort();
  6704. return;
  6705. }
  6706. const abortAndFinalize = function abortAndFinalize() {
  6707. abort();
  6708. finalize();
  6709. };
  6710. // send request
  6711. const req = send(options);
  6712. let reqTimeout;
  6713. if (signal) {
  6714. signal.addEventListener('abort', abortAndFinalize);
  6715. }
  6716. function finalize() {
  6717. req.abort();
  6718. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  6719. clearTimeout(reqTimeout);
  6720. }
  6721. if (request.timeout) {
  6722. req.once('socket', function (socket) {
  6723. reqTimeout = setTimeout(function () {
  6724. reject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout'));
  6725. finalize();
  6726. }, request.timeout);
  6727. });
  6728. }
  6729. req.on('error', function (err) {
  6730. reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));
  6731. finalize();
  6732. });
  6733. req.on('response', function (res) {
  6734. clearTimeout(reqTimeout);
  6735. const headers = createHeadersLenient(res.headers);
  6736. // HTTP fetch step 5
  6737. if (fetch.isRedirect(res.statusCode)) {
  6738. // HTTP fetch step 5.2
  6739. const location = headers.get('Location');
  6740. // HTTP fetch step 5.3
  6741. const locationURL = location === null ? null : resolve_url(request.url, location);
  6742. // HTTP fetch step 5.5
  6743. switch (request.redirect) {
  6744. case 'error':
  6745. reject(new FetchError(`redirect mode is set to error: ${request.url}`, 'no-redirect'));
  6746. finalize();
  6747. return;
  6748. case 'manual':
  6749. // node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL.
  6750. if (locationURL !== null) {
  6751. // handle corrupted header
  6752. try {
  6753. headers.set('Location', locationURL);
  6754. } catch (err) {
  6755. // istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request
  6756. reject(err);
  6757. }
  6758. }
  6759. break;
  6760. case 'follow':
  6761. // HTTP-redirect fetch step 2
  6762. if (locationURL === null) {
  6763. break;
  6764. }
  6765. // HTTP-redirect fetch step 5
  6766. if (request.counter >= request.follow) {
  6767. reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));
  6768. finalize();
  6769. return;
  6770. }
  6771. // HTTP-redirect fetch step 6 (counter increment)
  6772. // Create a new Request object.
  6773. const requestOpts = {
  6774. headers: new Headers(request.headers),
  6775. follow: request.follow,
  6776. counter: request.counter + 1,
  6777. agent: request.agent,
  6778. compress: request.compress,
  6779. method: request.method,
  6780. body: request.body,
  6781. signal: request.signal,
  6782. timeout: request.timeout
  6783. };
  6784. // HTTP-redirect fetch step 9
  6785. if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {
  6786. reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));
  6787. finalize();
  6788. return;
  6789. }
  6790. // HTTP-redirect fetch step 11
  6791. if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') {
  6792. requestOpts.method = 'GET';
  6793. requestOpts.body = undefined;
  6794. requestOpts.headers.delete('content-length');
  6795. }
  6796. // HTTP-redirect fetch step 15
  6797. resolve(fetch(new Request(locationURL, requestOpts)));
  6798. finalize();
  6799. return;
  6800. }
  6801. }
  6802. // prepare response
  6803. res.once('end', function () {
  6804. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  6805. });
  6806. let body = res.pipe(new PassThrough$1());
  6807. const response_options = {
  6808. url: request.url,
  6809. status: res.statusCode,
  6810. statusText: res.statusMessage,
  6811. headers: headers,
  6812. size: request.size,
  6813. timeout: request.timeout,
  6814. counter: request.counter
  6815. };
  6816. // HTTP-network fetch step 12.1.1.3
  6817. const codings = headers.get('Content-Encoding');
  6818. // HTTP-network fetch step 12.1.1.4: handle content codings
  6819. // in following scenarios we ignore compression support
  6820. // 1. compression support is disabled
  6821. // 2. HEAD request
  6822. // 3. no Content-Encoding header
  6823. // 4. no content response (204)
  6824. // 5. content not modified response (304)
  6825. if (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) {
  6826. response = new Response(body, response_options);
  6827. resolve(response);
  6828. return;
  6829. }
  6830. // For Node v6+
  6831. // Be less strict when decoding compressed responses, since sometimes
  6832. // servers send slightly invalid responses that are still accepted
  6833. // by common browsers.
  6834. // Always using Z_SYNC_FLUSH is what cURL does.
  6835. const zlibOptions = {
  6836. flush: zlib.Z_SYNC_FLUSH,
  6837. finishFlush: zlib.Z_SYNC_FLUSH
  6838. };
  6839. // for gzip
  6840. if (codings == 'gzip' || codings == 'x-gzip') {
  6841. body = body.pipe(zlib.createGunzip(zlibOptions));
  6842. response = new Response(body, response_options);
  6843. resolve(response);
  6844. return;
  6845. }
  6846. // for deflate
  6847. if (codings == 'deflate' || codings == 'x-deflate') {
  6848. // handle the infamous raw deflate response from old servers
  6849. // a hack for old IIS and Apache servers
  6850. const raw = res.pipe(new PassThrough$1());
  6851. raw.once('data', function (chunk) {
  6852. // see http://stackoverflow.com/questions/37519828
  6853. if ((chunk[0] & 0x0F) === 0x08) {
  6854. body = body.pipe(zlib.createInflate());
  6855. } else {
  6856. body = body.pipe(zlib.createInflateRaw());
  6857. }
  6858. response = new Response(body, response_options);
  6859. resolve(response);
  6860. });
  6861. return;
  6862. }
  6863. // for br
  6864. if (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') {
  6865. body = body.pipe(zlib.createBrotliDecompress());
  6866. response = new Response(body, response_options);
  6867. resolve(response);
  6868. return;
  6869. }
  6870. // otherwise, use response as-is
  6871. response = new Response(body, response_options);
  6872. resolve(response);
  6873. });
  6874. writeToStream(req, request);
  6875. });
  6876. }
  6877. /**
  6878. * Redirect code matching
  6879. *
  6880. * @param Number code Status code
  6881. * @return Boolean
  6882. */
  6883. fetch.isRedirect = function (code) {
  6884. return code === 301 || code === 302 || code === 303 || code === 307 || code === 308;
  6885. };
  6886. // expose Promise
  6887. fetch.Promise = global.Promise;
  6888. module.exports = exports = fetch;
  6889. Object.defineProperty(exports, "__esModule", { value: true });
  6890. exports.default = exports;
  6891. exports.Headers = Headers;
  6892. exports.Request = Request;
  6893. exports.Response = Response;
  6894. exports.FetchError = FetchError;
  6895. /***/ }),
  6896. /***/ 462:
  6897. /***/ (function(module) {
  6898. "use strict";
  6899. // See http://www.robvanderwoude.com/escapechars.php
  6900. const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
  6901. function escapeCommand(arg) {
  6902. // Escape meta chars
  6903. arg = arg.replace(metaCharsRegExp, '^$1');
  6904. return arg;
  6905. }
  6906. function escapeArgument(arg, doubleEscapeMetaChars) {
  6907. // Convert to string
  6908. arg = `${arg}`;
  6909. // Algorithm below is based on https://qntm.org/cmd
  6910. // Sequence of backslashes followed by a double quote:
  6911. // double up all the backslashes and escape the double quote
  6912. arg = arg.replace(/(\\*)"/g, '$1$1\\"');
  6913. // Sequence of backslashes followed by the end of the string
  6914. // (which will become a double quote later):
  6915. // double up all the backslashes
  6916. arg = arg.replace(/(\\*)$/, '$1$1');
  6917. // All other backslashes occur literally
  6918. // Quote the whole thing:
  6919. arg = `"${arg}"`;
  6920. // Escape meta chars
  6921. arg = arg.replace(metaCharsRegExp, '^$1');
  6922. // Double escape meta chars if necessary
  6923. if (doubleEscapeMetaChars) {
  6924. arg = arg.replace(metaCharsRegExp, '^$1');
  6925. }
  6926. return arg;
  6927. }
  6928. module.exports.command = escapeCommand;
  6929. module.exports.argument = escapeArgument;
  6930. /***/ }),
  6931. /***/ 463:
  6932. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  6933. "use strict";
  6934. Object.defineProperty(exports, '__esModule', { value: true });
  6935. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  6936. var deprecation = __webpack_require__(692);
  6937. var once = _interopDefault(__webpack_require__(969));
  6938. const logOnce = once(deprecation => console.warn(deprecation));
  6939. /**
  6940. * Error with extra properties to help with debugging
  6941. */
  6942. class RequestError extends Error {
  6943. constructor(message, statusCode, options) {
  6944. super(message); // Maintains proper stack trace (only available on V8)
  6945. /* istanbul ignore next */
  6946. if (Error.captureStackTrace) {
  6947. Error.captureStackTrace(this, this.constructor);
  6948. }
  6949. this.name = "HttpError";
  6950. this.status = statusCode;
  6951. Object.defineProperty(this, "code", {
  6952. get() {
  6953. logOnce(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`."));
  6954. return statusCode;
  6955. }
  6956. });
  6957. this.headers = options.headers || {}; // redact request credentials without mutating original request options
  6958. const requestCopy = Object.assign({}, options.request);
  6959. if (options.request.headers.authorization) {
  6960. requestCopy.headers = Object.assign({}, options.request.headers, {
  6961. authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]")
  6962. });
  6963. }
  6964. requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit
  6965. // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications
  6966. .replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]") // OAuth tokens can be passed as URL query parameters, although it is not recommended
  6967. // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header
  6968. .replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
  6969. this.request = requestCopy;
  6970. }
  6971. }
  6972. exports.RequestError = RequestError;
  6973. //# sourceMappingURL=index.js.map
  6974. /***/ }),
  6975. /***/ 464:
  6976. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  6977. "use strict";
  6978. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6979. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6980. return new (P || (P = Promise))(function (resolve, reject) {
  6981. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6982. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6983. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6984. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6985. });
  6986. };
  6987. var __importStar = (this && this.__importStar) || function (mod) {
  6988. if (mod && mod.__esModule) return mod;
  6989. var result = {};
  6990. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  6991. result["default"] = mod;
  6992. return result;
  6993. };
  6994. Object.defineProperty(exports, "__esModule", { value: true });
  6995. const assert = __importStar(__webpack_require__(357));
  6996. const core = __importStar(__webpack_require__(470));
  6997. const exec = __importStar(__webpack_require__(986));
  6998. const fs = __importStar(__webpack_require__(747));
  6999. const github = __importStar(__webpack_require__(469));
  7000. const io = __importStar(__webpack_require__(1));
  7001. const path = __importStar(__webpack_require__(622));
  7002. const IS_WINDOWS = process.platform === 'win32';
  7003. function downloadRepository(accessToken, owner, repo, ref, repositoryPath) {
  7004. return __awaiter(this, void 0, void 0, function* () {
  7005. const octokit = new github.GitHub(accessToken);
  7006. const params = {
  7007. archive_format: IS_WINDOWS ? 'zipball' : 'tarball',
  7008. owner: owner,
  7009. repo: repo,
  7010. ref: ref
  7011. };
  7012. // todo: retry
  7013. const response = yield octokit.repos.getArchiveLink(params);
  7014. if (response.status != 200) {
  7015. throw new Error(`Unexpected response from GitHub API. Status: '${response.status}'; Data: '${response.data}'`);
  7016. }
  7017. console.log(`status=${response.status}`);
  7018. console.log(`headers=${JSON.stringify(response.headers)}`);
  7019. // console.log(`data=${response.data}`)
  7020. // console.log(`data=${JSON.stringify(response.data)}`)
  7021. // for (const key of Object.keys(response.data)) {
  7022. // console.log(`data['${key}']=${response.data[key]}`)
  7023. // }
  7024. const runnerTemp = process.env['RUNNER_TEMP'];
  7025. assert.ok(runnerTemp, 'RUNNER_TEMP not defined');
  7026. const archiveFile = path.join(runnerTemp, 'checkout-archive.tar.gz');
  7027. yield io.rmRF(archiveFile);
  7028. yield fs.promises.writeFile(archiveFile, new Buffer(response.data));
  7029. yield exec.exec(`ls -la "${archiveFile}"`, [], {
  7030. cwd: repositoryPath
  7031. });
  7032. const extractPath = path.join(runnerTemp, 'checkout-archive');
  7033. yield io.rmRF(extractPath);
  7034. yield io.mkdirP(extractPath);
  7035. yield exec.exec(`tar -xzf "${archiveFile}"`, [], {
  7036. cwd: extractPath
  7037. });
  7038. // Determine the real directory to copy (ignore extra dir at root of the archive)
  7039. const archiveFileNames = yield fs.promises.readdir(extractPath);
  7040. assert.ok(archiveFileNames.length == 1, 'Expected exactly one directory inside archive');
  7041. const extraDirectoryName = archiveFileNames[0];
  7042. core.info(`Resolved ${extraDirectoryName}`); // contains the short SHA
  7043. const tempRepositoryPath = path.join(extractPath, extraDirectoryName);
  7044. for (const fileName of tempRepositoryPath) {
  7045. const sourcePath = path.join(tempRepositoryPath, fileName);
  7046. const targetPath = path.join(repositoryPath, fileName);
  7047. yield io.mv(sourcePath, targetPath);
  7048. }
  7049. yield exec.exec(`find .`, [], {
  7050. cwd: repositoryPath
  7051. });
  7052. });
  7053. }
  7054. exports.downloadRepository = downloadRepository;
  7055. /***/ }),
  7056. /***/ 469:
  7057. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7058. "use strict";
  7059. var __importDefault = (this && this.__importDefault) || function (mod) {
  7060. return (mod && mod.__esModule) ? mod : { "default": mod };
  7061. };
  7062. var __importStar = (this && this.__importStar) || function (mod) {
  7063. if (mod && mod.__esModule) return mod;
  7064. var result = {};
  7065. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  7066. result["default"] = mod;
  7067. return result;
  7068. };
  7069. Object.defineProperty(exports, "__esModule", { value: true });
  7070. // Originally pulled from https://github.com/JasonEtco/actions-toolkit/blob/master/src/github.ts
  7071. const graphql_1 = __webpack_require__(898);
  7072. const rest_1 = __importDefault(__webpack_require__(0));
  7073. const Context = __importStar(__webpack_require__(262));
  7074. // We need this in order to extend Octokit
  7075. rest_1.default.prototype = new rest_1.default();
  7076. exports.context = new Context.Context();
  7077. class GitHub extends rest_1.default {
  7078. constructor(token, opts = {}) {
  7079. super(Object.assign(Object.assign({}, opts), { auth: `token ${token}` }));
  7080. this.graphql = graphql_1.graphql.defaults({
  7081. headers: { authorization: `token ${token}` }
  7082. });
  7083. }
  7084. }
  7085. exports.GitHub = GitHub;
  7086. //# sourceMappingURL=github.js.map
  7087. /***/ }),
  7088. /***/ 470:
  7089. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7090. "use strict";
  7091. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  7092. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  7093. return new (P || (P = Promise))(function (resolve, reject) {
  7094. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  7095. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  7096. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  7097. step((generator = generator.apply(thisArg, _arguments || [])).next());
  7098. });
  7099. };
  7100. Object.defineProperty(exports, "__esModule", { value: true });
  7101. const command_1 = __webpack_require__(431);
  7102. const os = __webpack_require__(87);
  7103. const path = __webpack_require__(622);
  7104. /**
  7105. * The code to exit an action
  7106. */
  7107. var ExitCode;
  7108. (function (ExitCode) {
  7109. /**
  7110. * A code indicating that the action was successful
  7111. */
  7112. ExitCode[ExitCode["Success"] = 0] = "Success";
  7113. /**
  7114. * A code indicating that the action was a failure
  7115. */
  7116. ExitCode[ExitCode["Failure"] = 1] = "Failure";
  7117. })(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
  7118. //-----------------------------------------------------------------------
  7119. // Variables
  7120. //-----------------------------------------------------------------------
  7121. /**
  7122. * Sets env variable for this action and future actions in the job
  7123. * @param name the name of the variable to set
  7124. * @param val the value of the variable
  7125. */
  7126. function exportVariable(name, val) {
  7127. process.env[name] = val;
  7128. command_1.issueCommand('set-env', { name }, val);
  7129. }
  7130. exports.exportVariable = exportVariable;
  7131. /**
  7132. * Registers a secret which will get masked from logs
  7133. * @param secret value of the secret
  7134. */
  7135. function setSecret(secret) {
  7136. command_1.issueCommand('add-mask', {}, secret);
  7137. }
  7138. exports.setSecret = setSecret;
  7139. /**
  7140. * Prepends inputPath to the PATH (for this action and future actions)
  7141. * @param inputPath
  7142. */
  7143. function addPath(inputPath) {
  7144. command_1.issueCommand('add-path', {}, inputPath);
  7145. process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
  7146. }
  7147. exports.addPath = addPath;
  7148. /**
  7149. * Gets the value of an input. The value is also trimmed.
  7150. *
  7151. * @param name name of the input to get
  7152. * @param options optional. See InputOptions.
  7153. * @returns string
  7154. */
  7155. function getInput(name, options) {
  7156. const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';
  7157. if (options && options.required && !val) {
  7158. throw new Error(`Input required and not supplied: ${name}`);
  7159. }
  7160. return val.trim();
  7161. }
  7162. exports.getInput = getInput;
  7163. /**
  7164. * Sets the value of an output.
  7165. *
  7166. * @param name name of the output to set
  7167. * @param value value to store
  7168. */
  7169. function setOutput(name, value) {
  7170. command_1.issueCommand('set-output', { name }, value);
  7171. }
  7172. exports.setOutput = setOutput;
  7173. //-----------------------------------------------------------------------
  7174. // Results
  7175. //-----------------------------------------------------------------------
  7176. /**
  7177. * Sets the action status to failed.
  7178. * When the action exits it will be with an exit code of 1
  7179. * @param message add error issue message
  7180. */
  7181. function setFailed(message) {
  7182. process.exitCode = ExitCode.Failure;
  7183. error(message);
  7184. }
  7185. exports.setFailed = setFailed;
  7186. //-----------------------------------------------------------------------
  7187. // Logging Commands
  7188. //-----------------------------------------------------------------------
  7189. /**
  7190. * Writes debug message to user log
  7191. * @param message debug message
  7192. */
  7193. function debug(message) {
  7194. command_1.issueCommand('debug', {}, message);
  7195. }
  7196. exports.debug = debug;
  7197. /**
  7198. * Adds an error issue
  7199. * @param message error issue message
  7200. */
  7201. function error(message) {
  7202. command_1.issue('error', message);
  7203. }
  7204. exports.error = error;
  7205. /**
  7206. * Adds an warning issue
  7207. * @param message warning issue message
  7208. */
  7209. function warning(message) {
  7210. command_1.issue('warning', message);
  7211. }
  7212. exports.warning = warning;
  7213. /**
  7214. * Writes info to log with console.log.
  7215. * @param message info message
  7216. */
  7217. function info(message) {
  7218. process.stdout.write(message + os.EOL);
  7219. }
  7220. exports.info = info;
  7221. /**
  7222. * Begin an output group.
  7223. *
  7224. * Output until the next `groupEnd` will be foldable in this group
  7225. *
  7226. * @param name The name of the output group
  7227. */
  7228. function startGroup(name) {
  7229. command_1.issue('group', name);
  7230. }
  7231. exports.startGroup = startGroup;
  7232. /**
  7233. * End an output group.
  7234. */
  7235. function endGroup() {
  7236. command_1.issue('endgroup');
  7237. }
  7238. exports.endGroup = endGroup;
  7239. /**
  7240. * Wrap an asynchronous function call in a group.
  7241. *
  7242. * Returns the same type as the function itself.
  7243. *
  7244. * @param name The name of the group
  7245. * @param fn The function to wrap in the group
  7246. */
  7247. function group(name, fn) {
  7248. return __awaiter(this, void 0, void 0, function* () {
  7249. startGroup(name);
  7250. let result;
  7251. try {
  7252. result = yield fn();
  7253. }
  7254. finally {
  7255. endGroup();
  7256. }
  7257. return result;
  7258. });
  7259. }
  7260. exports.group = group;
  7261. //# sourceMappingURL=core.js.map
  7262. /***/ }),
  7263. /***/ 471:
  7264. /***/ (function(module, __unusedexports, __webpack_require__) {
  7265. module.exports = authenticationBeforeRequest;
  7266. const btoa = __webpack_require__(675);
  7267. const uniq = __webpack_require__(126);
  7268. function authenticationBeforeRequest(state, options) {
  7269. if (!state.auth.type) {
  7270. return;
  7271. }
  7272. if (state.auth.type === "basic") {
  7273. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  7274. options.headers.authorization = `Basic ${hash}`;
  7275. return;
  7276. }
  7277. if (state.auth.type === "token") {
  7278. options.headers.authorization = `token ${state.auth.token}`;
  7279. return;
  7280. }
  7281. if (state.auth.type === "app") {
  7282. options.headers.authorization = `Bearer ${state.auth.token}`;
  7283. const acceptHeaders = options.headers.accept
  7284. .split(",")
  7285. .concat("application/vnd.github.machine-man-preview+json");
  7286. options.headers.accept = uniq(acceptHeaders)
  7287. .filter(Boolean)
  7288. .join(",");
  7289. return;
  7290. }
  7291. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  7292. if (state.auth.token) {
  7293. options.url += `access_token=${encodeURIComponent(state.auth.token)}`;
  7294. return;
  7295. }
  7296. const key = encodeURIComponent(state.auth.key);
  7297. const secret = encodeURIComponent(state.auth.secret);
  7298. options.url += `client_id=${key}&client_secret=${secret}`;
  7299. }
  7300. /***/ }),
  7301. /***/ 489:
  7302. /***/ (function(module, __unusedexports, __webpack_require__) {
  7303. "use strict";
  7304. const path = __webpack_require__(622);
  7305. const which = __webpack_require__(814);
  7306. const pathKey = __webpack_require__(39)();
  7307. function resolveCommandAttempt(parsed, withoutPathExt) {
  7308. const cwd = process.cwd();
  7309. const hasCustomCwd = parsed.options.cwd != null;
  7310. // If a custom `cwd` was specified, we need to change the process cwd
  7311. // because `which` will do stat calls but does not support a custom cwd
  7312. if (hasCustomCwd) {
  7313. try {
  7314. process.chdir(parsed.options.cwd);
  7315. } catch (err) {
  7316. /* Empty */
  7317. }
  7318. }
  7319. let resolved;
  7320. try {
  7321. resolved = which.sync(parsed.command, {
  7322. path: (parsed.options.env || process.env)[pathKey],
  7323. pathExt: withoutPathExt ? path.delimiter : undefined,
  7324. });
  7325. } catch (e) {
  7326. /* Empty */
  7327. } finally {
  7328. process.chdir(cwd);
  7329. }
  7330. // If we successfully resolved, ensure that an absolute path is returned
  7331. // Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it
  7332. if (resolved) {
  7333. resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved);
  7334. }
  7335. return resolved;
  7336. }
  7337. function resolveCommand(parsed) {
  7338. return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
  7339. }
  7340. module.exports = resolveCommand;
  7341. /***/ }),
  7342. /***/ 510:
  7343. /***/ (function(module) {
  7344. module.exports = addHook
  7345. function addHook (state, kind, name, hook) {
  7346. var orig = hook
  7347. if (!state.registry[name]) {
  7348. state.registry[name] = []
  7349. }
  7350. if (kind === 'before') {
  7351. hook = function (method, options) {
  7352. return Promise.resolve()
  7353. .then(orig.bind(null, options))
  7354. .then(method.bind(null, options))
  7355. }
  7356. }
  7357. if (kind === 'after') {
  7358. hook = function (method, options) {
  7359. var result
  7360. return Promise.resolve()
  7361. .then(method.bind(null, options))
  7362. .then(function (result_) {
  7363. result = result_
  7364. return orig(result, options)
  7365. })
  7366. .then(function () {
  7367. return result
  7368. })
  7369. }
  7370. }
  7371. if (kind === 'error') {
  7372. hook = function (method, options) {
  7373. return Promise.resolve()
  7374. .then(method.bind(null, options))
  7375. .catch(function (error) {
  7376. return orig(error, options)
  7377. })
  7378. }
  7379. }
  7380. state.registry[name].push({
  7381. hook: hook,
  7382. orig: orig
  7383. })
  7384. }
  7385. /***/ }),
  7386. /***/ 523:
  7387. /***/ (function(module, __unusedexports, __webpack_require__) {
  7388. var register = __webpack_require__(363)
  7389. var addHook = __webpack_require__(510)
  7390. var removeHook = __webpack_require__(763)
  7391. // bind with array of arguments: https://stackoverflow.com/a/21792913
  7392. var bind = Function.bind
  7393. var bindable = bind.bind(bind)
  7394. function bindApi (hook, state, name) {
  7395. var removeHookRef = bindable(removeHook, null).apply(null, name ? [state, name] : [state])
  7396. hook.api = { remove: removeHookRef }
  7397. hook.remove = removeHookRef
  7398. ;['before', 'error', 'after', 'wrap'].forEach(function (kind) {
  7399. var args = name ? [state, kind, name] : [state, kind]
  7400. hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args)
  7401. })
  7402. }
  7403. function HookSingular () {
  7404. var singularHookName = 'h'
  7405. var singularHookState = {
  7406. registry: {}
  7407. }
  7408. var singularHook = register.bind(null, singularHookState, singularHookName)
  7409. bindApi(singularHook, singularHookState, singularHookName)
  7410. return singularHook
  7411. }
  7412. function HookCollection () {
  7413. var state = {
  7414. registry: {}
  7415. }
  7416. var hook = register.bind(null, state)
  7417. bindApi(hook, state)
  7418. return hook
  7419. }
  7420. var collectionHookDeprecationMessageDisplayed = false
  7421. function Hook () {
  7422. if (!collectionHookDeprecationMessageDisplayed) {
  7423. console.warn('[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4')
  7424. collectionHookDeprecationMessageDisplayed = true
  7425. }
  7426. return HookCollection()
  7427. }
  7428. Hook.Singular = HookSingular.bind()
  7429. Hook.Collection = HookCollection.bind()
  7430. module.exports = Hook
  7431. // expose constructors as a named property for TypeScript
  7432. module.exports.Hook = Hook
  7433. module.exports.Singular = Hook.Singular
  7434. module.exports.Collection = Hook.Collection
  7435. /***/ }),
  7436. /***/ 529:
  7437. /***/ (function(module, __unusedexports, __webpack_require__) {
  7438. const factory = __webpack_require__(47);
  7439. module.exports = factory();
  7440. /***/ }),
  7441. /***/ 536:
  7442. /***/ (function(module, __unusedexports, __webpack_require__) {
  7443. module.exports = hasFirstPage
  7444. const deprecate = __webpack_require__(370)
  7445. const getPageLinks = __webpack_require__(577)
  7446. function hasFirstPage (link) {
  7447. deprecate(`octokit.hasFirstPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  7448. return getPageLinks(link).first
  7449. }
  7450. /***/ }),
  7451. /***/ 550:
  7452. /***/ (function(module, __unusedexports, __webpack_require__) {
  7453. module.exports = getNextPage
  7454. const getPage = __webpack_require__(265)
  7455. function getNextPage (octokit, link, headers) {
  7456. return getPage(octokit, link, 'next', headers)
  7457. }
  7458. /***/ }),
  7459. /***/ 558:
  7460. /***/ (function(module, __unusedexports, __webpack_require__) {
  7461. module.exports = hasPreviousPage
  7462. const deprecate = __webpack_require__(370)
  7463. const getPageLinks = __webpack_require__(577)
  7464. function hasPreviousPage (link) {
  7465. deprecate(`octokit.hasPreviousPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  7466. return getPageLinks(link).prev
  7467. }
  7468. /***/ }),
  7469. /***/ 559:
  7470. /***/ (function(__unusedmodule, exports) {
  7471. "use strict";
  7472. Object.defineProperty(exports, "__esModule", { value: true });
  7473. class GitVersion {
  7474. /**
  7475. * Used for comparing the version of git and git-lfs against the minimum required version
  7476. * @param version the version string, e.g. 1.2 or 1.2.3
  7477. */
  7478. constructor(version) {
  7479. this.major = NaN;
  7480. this.minor = NaN;
  7481. this.patch = NaN;
  7482. if (version) {
  7483. const match = version.match(/^(\d+)\.(\d+)(\.(\d+))?$/);
  7484. if (match) {
  7485. this.major = Number(match[1]);
  7486. this.minor = Number(match[2]);
  7487. if (match[4]) {
  7488. this.patch = Number(match[4]);
  7489. }
  7490. }
  7491. }
  7492. }
  7493. /**
  7494. * Compares the instance against a minimum required version
  7495. * @param minimum Minimum version
  7496. */
  7497. checkMinimum(minimum) {
  7498. if (!minimum.isValid()) {
  7499. throw new Error('Arg minimum is not a valid version');
  7500. }
  7501. // Major is insufficient
  7502. if (this.major < minimum.major) {
  7503. return false;
  7504. }
  7505. // Major is equal
  7506. if (this.major === minimum.major) {
  7507. // Minor is insufficient
  7508. if (this.minor < minimum.minor) {
  7509. return false;
  7510. }
  7511. // Minor is equal
  7512. if (this.minor === minimum.minor) {
  7513. // Patch is insufficient
  7514. if (this.patch && this.patch < (minimum.patch || 0)) {
  7515. return false;
  7516. }
  7517. }
  7518. }
  7519. return true;
  7520. }
  7521. /**
  7522. * Indicates whether the instance was constructed from a valid version string
  7523. */
  7524. isValid() {
  7525. return !isNaN(this.major);
  7526. }
  7527. /**
  7528. * Returns the version as a string, e.g. 1.2 or 1.2.3
  7529. */
  7530. toString() {
  7531. let result = '';
  7532. if (this.isValid()) {
  7533. result = `${this.major}.${this.minor}`;
  7534. if (!isNaN(this.patch)) {
  7535. result += `.${this.patch}`;
  7536. }
  7537. }
  7538. return result;
  7539. }
  7540. }
  7541. exports.GitVersion = GitVersion;
  7542. /***/ }),
  7543. /***/ 562:
  7544. /***/ (function(module, __unusedexports, __webpack_require__) {
  7545. var once = __webpack_require__(969);
  7546. var noop = function() {};
  7547. var isRequest = function(stream) {
  7548. return stream.setHeader && typeof stream.abort === 'function';
  7549. };
  7550. var isChildProcess = function(stream) {
  7551. return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3
  7552. };
  7553. var eos = function(stream, opts, callback) {
  7554. if (typeof opts === 'function') return eos(stream, null, opts);
  7555. if (!opts) opts = {};
  7556. callback = once(callback || noop);
  7557. var ws = stream._writableState;
  7558. var rs = stream._readableState;
  7559. var readable = opts.readable || (opts.readable !== false && stream.readable);
  7560. var writable = opts.writable || (opts.writable !== false && stream.writable);
  7561. var cancelled = false;
  7562. var onlegacyfinish = function() {
  7563. if (!stream.writable) onfinish();
  7564. };
  7565. var onfinish = function() {
  7566. writable = false;
  7567. if (!readable) callback.call(stream);
  7568. };
  7569. var onend = function() {
  7570. readable = false;
  7571. if (!writable) callback.call(stream);
  7572. };
  7573. var onexit = function(exitCode) {
  7574. callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null);
  7575. };
  7576. var onerror = function(err) {
  7577. callback.call(stream, err);
  7578. };
  7579. var onclose = function() {
  7580. process.nextTick(onclosenexttick);
  7581. };
  7582. var onclosenexttick = function() {
  7583. if (cancelled) return;
  7584. if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error('premature close'));
  7585. if (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error('premature close'));
  7586. };
  7587. var onrequest = function() {
  7588. stream.req.on('finish', onfinish);
  7589. };
  7590. if (isRequest(stream)) {
  7591. stream.on('complete', onfinish);
  7592. stream.on('abort', onclose);
  7593. if (stream.req) onrequest();
  7594. else stream.on('request', onrequest);
  7595. } else if (writable && !ws) { // legacy streams
  7596. stream.on('end', onlegacyfinish);
  7597. stream.on('close', onlegacyfinish);
  7598. }
  7599. if (isChildProcess(stream)) stream.on('exit', onexit);
  7600. stream.on('end', onend);
  7601. stream.on('finish', onfinish);
  7602. if (opts.error !== false) stream.on('error', onerror);
  7603. stream.on('close', onclose);
  7604. return function() {
  7605. cancelled = true;
  7606. stream.removeListener('complete', onfinish);
  7607. stream.removeListener('abort', onclose);
  7608. stream.removeListener('request', onrequest);
  7609. if (stream.req) stream.req.removeListener('finish', onfinish);
  7610. stream.removeListener('end', onlegacyfinish);
  7611. stream.removeListener('close', onlegacyfinish);
  7612. stream.removeListener('finish', onfinish);
  7613. stream.removeListener('exit', onexit);
  7614. stream.removeListener('end', onend);
  7615. stream.removeListener('error', onerror);
  7616. stream.removeListener('close', onclose);
  7617. };
  7618. };
  7619. module.exports = eos;
  7620. /***/ }),
  7621. /***/ 563:
  7622. /***/ (function(module, __unusedexports, __webpack_require__) {
  7623. module.exports = getPreviousPage
  7624. const getPage = __webpack_require__(265)
  7625. function getPreviousPage (octokit, link, headers) {
  7626. return getPage(octokit, link, 'prev', headers)
  7627. }
  7628. /***/ }),
  7629. /***/ 568:
  7630. /***/ (function(module, __unusedexports, __webpack_require__) {
  7631. "use strict";
  7632. const path = __webpack_require__(622);
  7633. const niceTry = __webpack_require__(948);
  7634. const resolveCommand = __webpack_require__(489);
  7635. const escape = __webpack_require__(462);
  7636. const readShebang = __webpack_require__(389);
  7637. const semver = __webpack_require__(280);
  7638. const isWin = process.platform === 'win32';
  7639. const isExecutableRegExp = /\.(?:com|exe)$/i;
  7640. const isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
  7641. // `options.shell` is supported in Node ^4.8.0, ^5.7.0 and >= 6.0.0
  7642. const supportsShellOption = niceTry(() => semver.satisfies(process.version, '^4.8.0 || ^5.7.0 || >= 6.0.0', true)) || false;
  7643. function detectShebang(parsed) {
  7644. parsed.file = resolveCommand(parsed);
  7645. const shebang = parsed.file && readShebang(parsed.file);
  7646. if (shebang) {
  7647. parsed.args.unshift(parsed.file);
  7648. parsed.command = shebang;
  7649. return resolveCommand(parsed);
  7650. }
  7651. return parsed.file;
  7652. }
  7653. function parseNonShell(parsed) {
  7654. if (!isWin) {
  7655. return parsed;
  7656. }
  7657. // Detect & add support for shebangs
  7658. const commandFile = detectShebang(parsed);
  7659. // We don't need a shell if the command filename is an executable
  7660. const needsShell = !isExecutableRegExp.test(commandFile);
  7661. // If a shell is required, use cmd.exe and take care of escaping everything correctly
  7662. // Note that `forceShell` is an hidden option used only in tests
  7663. if (parsed.options.forceShell || needsShell) {
  7664. // Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/`
  7665. // The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument
  7666. // Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called,
  7667. // we need to double escape them
  7668. const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
  7669. // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\bar)
  7670. // This is necessary otherwise it will always fail with ENOENT in those cases
  7671. parsed.command = path.normalize(parsed.command);
  7672. // Escape command & arguments
  7673. parsed.command = escape.command(parsed.command);
  7674. parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
  7675. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  7676. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  7677. parsed.command = process.env.comspec || 'cmd.exe';
  7678. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  7679. }
  7680. return parsed;
  7681. }
  7682. function parseShell(parsed) {
  7683. // If node supports the shell option, there's no need to mimic its behavior
  7684. if (supportsShellOption) {
  7685. return parsed;
  7686. }
  7687. // Mimic node shell option
  7688. // See https://github.com/nodejs/node/blob/b9f6a2dc059a1062776133f3d4fd848c4da7d150/lib/child_process.js#L335
  7689. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  7690. if (isWin) {
  7691. parsed.command = typeof parsed.options.shell === 'string' ? parsed.options.shell : process.env.comspec || 'cmd.exe';
  7692. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  7693. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  7694. } else {
  7695. if (typeof parsed.options.shell === 'string') {
  7696. parsed.command = parsed.options.shell;
  7697. } else if (process.platform === 'android') {
  7698. parsed.command = '/system/bin/sh';
  7699. } else {
  7700. parsed.command = '/bin/sh';
  7701. }
  7702. parsed.args = ['-c', shellCommand];
  7703. }
  7704. return parsed;
  7705. }
  7706. function parse(command, args, options) {
  7707. // Normalize arguments, similar to nodejs
  7708. if (args && !Array.isArray(args)) {
  7709. options = args;
  7710. args = null;
  7711. }
  7712. args = args ? args.slice(0) : []; // Clone array to avoid changing the original
  7713. options = Object.assign({}, options); // Clone object to avoid changing the original
  7714. // Build our parsed object
  7715. const parsed = {
  7716. command,
  7717. args,
  7718. options,
  7719. file: undefined,
  7720. original: {
  7721. command,
  7722. args,
  7723. },
  7724. };
  7725. // Delegate further parsing to shell or non-shell
  7726. return options.shell ? parseShell(parsed) : parseNonShell(parsed);
  7727. }
  7728. module.exports = parse;
  7729. /***/ }),
  7730. /***/ 577:
  7731. /***/ (function(module) {
  7732. module.exports = getPageLinks
  7733. function getPageLinks (link) {
  7734. link = link.link || link.headers.link || ''
  7735. const links = {}
  7736. // link format:
  7737. // '<https://api.github.com/users/aseemk/followers?page=2>; rel="next", <https://api.github.com/users/aseemk/followers?page=2>; rel="last"'
  7738. link.replace(/<([^>]*)>;\s*rel="([\w]*)"/g, (m, uri, type) => {
  7739. links[type] = uri
  7740. })
  7741. return links
  7742. }
  7743. /***/ }),
  7744. /***/ 586:
  7745. /***/ (function(module, __unusedexports, __webpack_require__) {
  7746. module.exports = octokitRestApiEndpoints;
  7747. const ROUTES = __webpack_require__(705);
  7748. function octokitRestApiEndpoints(octokit) {
  7749. // Aliasing scopes for backward compatibility
  7750. // See https://github.com/octokit/rest.js/pull/1134
  7751. ROUTES.gitdata = ROUTES.git;
  7752. ROUTES.authorization = ROUTES.oauthAuthorizations;
  7753. ROUTES.pullRequests = ROUTES.pulls;
  7754. octokit.registerEndpoints(ROUTES);
  7755. }
  7756. /***/ }),
  7757. /***/ 605:
  7758. /***/ (function(module) {
  7759. module.exports = require("http");
  7760. /***/ }),
  7761. /***/ 614:
  7762. /***/ (function(module) {
  7763. module.exports = require("events");
  7764. /***/ }),
  7765. /***/ 618:
  7766. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7767. "use strict";
  7768. var __importStar = (this && this.__importStar) || function (mod) {
  7769. if (mod && mod.__esModule) return mod;
  7770. var result = {};
  7771. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  7772. result["default"] = mod;
  7773. return result;
  7774. };
  7775. Object.defineProperty(exports, "__esModule", { value: true });
  7776. const fs = __importStar(__webpack_require__(747));
  7777. function directoryExistsSync(path, required) {
  7778. if (!path) {
  7779. throw new Error("Arg 'path' must not be empty");
  7780. }
  7781. let stats;
  7782. try {
  7783. stats = fs.statSync(path);
  7784. }
  7785. catch (error) {
  7786. if (error.code === 'ENOENT') {
  7787. if (!required) {
  7788. return false;
  7789. }
  7790. throw new Error(`Directory '${path}' does not exist`);
  7791. }
  7792. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  7793. }
  7794. if (stats.isDirectory()) {
  7795. return true;
  7796. }
  7797. else if (!required) {
  7798. return false;
  7799. }
  7800. throw new Error(`Directory '${path}' does not exist`);
  7801. }
  7802. exports.directoryExistsSync = directoryExistsSync;
  7803. function existsSync(path) {
  7804. if (!path) {
  7805. throw new Error("Arg 'path' must not be empty");
  7806. }
  7807. try {
  7808. fs.statSync(path);
  7809. }
  7810. catch (error) {
  7811. if (error.code === 'ENOENT') {
  7812. return false;
  7813. }
  7814. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  7815. }
  7816. return true;
  7817. }
  7818. exports.existsSync = existsSync;
  7819. function fileExistsSync(path) {
  7820. if (!path) {
  7821. throw new Error("Arg 'path' must not be empty");
  7822. }
  7823. let stats;
  7824. try {
  7825. stats = fs.statSync(path);
  7826. }
  7827. catch (error) {
  7828. if (error.code === 'ENOENT') {
  7829. return false;
  7830. }
  7831. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  7832. }
  7833. if (!stats.isDirectory()) {
  7834. return true;
  7835. }
  7836. return false;
  7837. }
  7838. exports.fileExistsSync = fileExistsSync;
  7839. /***/ }),
  7840. /***/ 621:
  7841. /***/ (function(module, __unusedexports, __webpack_require__) {
  7842. "use strict";
  7843. const path = __webpack_require__(622);
  7844. const pathKey = __webpack_require__(39);
  7845. module.exports = opts => {
  7846. opts = Object.assign({
  7847. cwd: process.cwd(),
  7848. path: process.env[pathKey()]
  7849. }, opts);
  7850. let prev;
  7851. let pth = path.resolve(opts.cwd);
  7852. const ret = [];
  7853. while (prev !== pth) {
  7854. ret.push(path.join(pth, 'node_modules/.bin'));
  7855. prev = pth;
  7856. pth = path.resolve(pth, '..');
  7857. }
  7858. // ensure the running `node` binary is used
  7859. ret.push(path.dirname(process.execPath));
  7860. return ret.concat(opts.path).join(path.delimiter);
  7861. };
  7862. module.exports.env = opts => {
  7863. opts = Object.assign({
  7864. env: process.env
  7865. }, opts);
  7866. const env = Object.assign({}, opts.env);
  7867. const path = pathKey({env});
  7868. opts.path = env[path];
  7869. env[path] = module.exports(opts);
  7870. return env;
  7871. };
  7872. /***/ }),
  7873. /***/ 622:
  7874. /***/ (function(module) {
  7875. module.exports = require("path");
  7876. /***/ }),
  7877. /***/ 649:
  7878. /***/ (function(module, __unusedexports, __webpack_require__) {
  7879. module.exports = getLastPage
  7880. const getPage = __webpack_require__(265)
  7881. function getLastPage (octokit, link, headers) {
  7882. return getPage(octokit, link, 'last', headers)
  7883. }
  7884. /***/ }),
  7885. /***/ 654:
  7886. /***/ (function(module) {
  7887. // This is not the set of all possible signals.
  7888. //
  7889. // It IS, however, the set of all signals that trigger
  7890. // an exit on either Linux or BSD systems. Linux is a
  7891. // superset of the signal names supported on BSD, and
  7892. // the unknown signals just fail to register, so we can
  7893. // catch that easily enough.
  7894. //
  7895. // Don't bother with SIGKILL. It's uncatchable, which
  7896. // means that we can't fire any callbacks anyway.
  7897. //
  7898. // If a user does happen to register a handler on a non-
  7899. // fatal signal like SIGWINCH or something, and then
  7900. // exit, it'll end up firing `process.emit('exit')`, so
  7901. // the handler will be fired anyway.
  7902. //
  7903. // SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised
  7904. // artificially, inherently leave the process in a
  7905. // state from which it is not safe to try and enter JS
  7906. // listeners.
  7907. module.exports = [
  7908. 'SIGABRT',
  7909. 'SIGALRM',
  7910. 'SIGHUP',
  7911. 'SIGINT',
  7912. 'SIGTERM'
  7913. ]
  7914. if (process.platform !== 'win32') {
  7915. module.exports.push(
  7916. 'SIGVTALRM',
  7917. 'SIGXCPU',
  7918. 'SIGXFSZ',
  7919. 'SIGUSR2',
  7920. 'SIGTRAP',
  7921. 'SIGSYS',
  7922. 'SIGQUIT',
  7923. 'SIGIOT'
  7924. // should detect profiler and enable/disable accordingly.
  7925. // see #21
  7926. // 'SIGPROF'
  7927. )
  7928. }
  7929. if (process.platform === 'linux') {
  7930. module.exports.push(
  7931. 'SIGIO',
  7932. 'SIGPOLL',
  7933. 'SIGPWR',
  7934. 'SIGSTKFLT',
  7935. 'SIGUNUSED'
  7936. )
  7937. }
  7938. /***/ }),
  7939. /***/ 669:
  7940. /***/ (function(module) {
  7941. module.exports = require("util");
  7942. /***/ }),
  7943. /***/ 672:
  7944. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7945. "use strict";
  7946. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  7947. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  7948. return new (P || (P = Promise))(function (resolve, reject) {
  7949. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  7950. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  7951. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  7952. step((generator = generator.apply(thisArg, _arguments || [])).next());
  7953. });
  7954. };
  7955. var _a;
  7956. Object.defineProperty(exports, "__esModule", { value: true });
  7957. const assert_1 = __webpack_require__(357);
  7958. const fs = __webpack_require__(747);
  7959. const path = __webpack_require__(622);
  7960. _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;
  7961. exports.IS_WINDOWS = process.platform === 'win32';
  7962. function exists(fsPath) {
  7963. return __awaiter(this, void 0, void 0, function* () {
  7964. try {
  7965. yield exports.stat(fsPath);
  7966. }
  7967. catch (err) {
  7968. if (err.code === 'ENOENT') {
  7969. return false;
  7970. }
  7971. throw err;
  7972. }
  7973. return true;
  7974. });
  7975. }
  7976. exports.exists = exists;
  7977. function isDirectory(fsPath, useStat = false) {
  7978. return __awaiter(this, void 0, void 0, function* () {
  7979. const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath);
  7980. return stats.isDirectory();
  7981. });
  7982. }
  7983. exports.isDirectory = isDirectory;
  7984. /**
  7985. * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:
  7986. * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases).
  7987. */
  7988. function isRooted(p) {
  7989. p = normalizeSeparators(p);
  7990. if (!p) {
  7991. throw new Error('isRooted() parameter "p" cannot be empty');
  7992. }
  7993. if (exports.IS_WINDOWS) {
  7994. return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello
  7995. ); // e.g. C: or C:\hello
  7996. }
  7997. return p.startsWith('/');
  7998. }
  7999. exports.isRooted = isRooted;
  8000. /**
  8001. * Recursively create a directory at `fsPath`.
  8002. *
  8003. * This implementation is optimistic, meaning it attempts to create the full
  8004. * path first, and backs up the path stack from there.
  8005. *
  8006. * @param fsPath The path to create
  8007. * @param maxDepth The maximum recursion depth
  8008. * @param depth The current recursion depth
  8009. */
  8010. function mkdirP(fsPath, maxDepth = 1000, depth = 1) {
  8011. return __awaiter(this, void 0, void 0, function* () {
  8012. assert_1.ok(fsPath, 'a path argument must be provided');
  8013. fsPath = path.resolve(fsPath);
  8014. if (depth >= maxDepth)
  8015. return exports.mkdir(fsPath);
  8016. try {
  8017. yield exports.mkdir(fsPath);
  8018. return;
  8019. }
  8020. catch (err) {
  8021. switch (err.code) {
  8022. case 'ENOENT': {
  8023. yield mkdirP(path.dirname(fsPath), maxDepth, depth + 1);
  8024. yield exports.mkdir(fsPath);
  8025. return;
  8026. }
  8027. default: {
  8028. let stats;
  8029. try {
  8030. stats = yield exports.stat(fsPath);
  8031. }
  8032. catch (err2) {
  8033. throw err;
  8034. }
  8035. if (!stats.isDirectory())
  8036. throw err;
  8037. }
  8038. }
  8039. }
  8040. });
  8041. }
  8042. exports.mkdirP = mkdirP;
  8043. /**
  8044. * Best effort attempt to determine whether a file exists and is executable.
  8045. * @param filePath file path to check
  8046. * @param extensions additional file extensions to try
  8047. * @return if file exists and is executable, returns the file path. otherwise empty string.
  8048. */
  8049. function tryGetExecutablePath(filePath, extensions) {
  8050. return __awaiter(this, void 0, void 0, function* () {
  8051. let stats = undefined;
  8052. try {
  8053. // test file exists
  8054. stats = yield exports.stat(filePath);
  8055. }
  8056. catch (err) {
  8057. if (err.code !== 'ENOENT') {
  8058. // eslint-disable-next-line no-console
  8059. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  8060. }
  8061. }
  8062. if (stats && stats.isFile()) {
  8063. if (exports.IS_WINDOWS) {
  8064. // on Windows, test for valid extension
  8065. const upperExt = path.extname(filePath).toUpperCase();
  8066. if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) {
  8067. return filePath;
  8068. }
  8069. }
  8070. else {
  8071. if (isUnixExecutable(stats)) {
  8072. return filePath;
  8073. }
  8074. }
  8075. }
  8076. // try each extension
  8077. const originalFilePath = filePath;
  8078. for (const extension of extensions) {
  8079. filePath = originalFilePath + extension;
  8080. stats = undefined;
  8081. try {
  8082. stats = yield exports.stat(filePath);
  8083. }
  8084. catch (err) {
  8085. if (err.code !== 'ENOENT') {
  8086. // eslint-disable-next-line no-console
  8087. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  8088. }
  8089. }
  8090. if (stats && stats.isFile()) {
  8091. if (exports.IS_WINDOWS) {
  8092. // preserve the case of the actual file (since an extension was appended)
  8093. try {
  8094. const directory = path.dirname(filePath);
  8095. const upperName = path.basename(filePath).toUpperCase();
  8096. for (const actualName of yield exports.readdir(directory)) {
  8097. if (upperName === actualName.toUpperCase()) {
  8098. filePath = path.join(directory, actualName);
  8099. break;
  8100. }
  8101. }
  8102. }
  8103. catch (err) {
  8104. // eslint-disable-next-line no-console
  8105. console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`);
  8106. }
  8107. return filePath;
  8108. }
  8109. else {
  8110. if (isUnixExecutable(stats)) {
  8111. return filePath;
  8112. }
  8113. }
  8114. }
  8115. }
  8116. return '';
  8117. });
  8118. }
  8119. exports.tryGetExecutablePath = tryGetExecutablePath;
  8120. function normalizeSeparators(p) {
  8121. p = p || '';
  8122. if (exports.IS_WINDOWS) {
  8123. // convert slashes on Windows
  8124. p = p.replace(/\//g, '\\');
  8125. // remove redundant slashes
  8126. return p.replace(/\\\\+/g, '\\');
  8127. }
  8128. // remove redundant slashes
  8129. return p.replace(/\/\/+/g, '/');
  8130. }
  8131. // on Mac/Linux, test the execute bit
  8132. // R W X R W X R W X
  8133. // 256 128 64 32 16 8 4 2 1
  8134. function isUnixExecutable(stats) {
  8135. return ((stats.mode & 1) > 0 ||
  8136. ((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||
  8137. ((stats.mode & 64) > 0 && stats.uid === process.getuid()));
  8138. }
  8139. //# sourceMappingURL=io-util.js.map
  8140. /***/ }),
  8141. /***/ 674:
  8142. /***/ (function(module, __unusedexports, __webpack_require__) {
  8143. module.exports = authenticate;
  8144. const { Deprecation } = __webpack_require__(692);
  8145. const once = __webpack_require__(969);
  8146. const deprecateAuthenticate = once((log, deprecation) => log.warn(deprecation));
  8147. function authenticate(state, options) {
  8148. deprecateAuthenticate(
  8149. state.octokit.log,
  8150. new Deprecation(
  8151. '[@octokit/rest] octokit.authenticate() is deprecated. Use "auth" constructor option instead.'
  8152. )
  8153. );
  8154. if (!options) {
  8155. state.auth = false;
  8156. return;
  8157. }
  8158. switch (options.type) {
  8159. case "basic":
  8160. if (!options.username || !options.password) {
  8161. throw new Error(
  8162. "Basic authentication requires both a username and password to be set"
  8163. );
  8164. }
  8165. break;
  8166. case "oauth":
  8167. if (!options.token && !(options.key && options.secret)) {
  8168. throw new Error(
  8169. "OAuth2 authentication requires a token or key & secret to be set"
  8170. );
  8171. }
  8172. break;
  8173. case "token":
  8174. case "app":
  8175. if (!options.token) {
  8176. throw new Error("Token authentication requires a token to be set");
  8177. }
  8178. break;
  8179. default:
  8180. throw new Error(
  8181. "Invalid authentication type, must be 'basic', 'oauth', 'token' or 'app'"
  8182. );
  8183. }
  8184. state.auth = options;
  8185. }
  8186. /***/ }),
  8187. /***/ 675:
  8188. /***/ (function(module) {
  8189. module.exports = function btoa(str) {
  8190. return new Buffer(str).toString('base64')
  8191. }
  8192. /***/ }),
  8193. /***/ 692:
  8194. /***/ (function(__unusedmodule, exports) {
  8195. "use strict";
  8196. Object.defineProperty(exports, '__esModule', { value: true });
  8197. class Deprecation extends Error {
  8198. constructor(message) {
  8199. super(message); // Maintains proper stack trace (only available on V8)
  8200. /* istanbul ignore next */
  8201. if (Error.captureStackTrace) {
  8202. Error.captureStackTrace(this, this.constructor);
  8203. }
  8204. this.name = 'Deprecation';
  8205. }
  8206. }
  8207. exports.Deprecation = Deprecation;
  8208. /***/ }),
  8209. /***/ 696:
  8210. /***/ (function(module) {
  8211. "use strict";
  8212. /*!
  8213. * isobject <https://github.com/jonschlinkert/isobject>
  8214. *
  8215. * Copyright (c) 2014-2017, Jon Schlinkert.
  8216. * Released under the MIT License.
  8217. */
  8218. function isObject(val) {
  8219. return val != null && typeof val === 'object' && Array.isArray(val) === false;
  8220. }
  8221. /*!
  8222. * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
  8223. *
  8224. * Copyright (c) 2014-2017, Jon Schlinkert.
  8225. * Released under the MIT License.
  8226. */
  8227. function isObjectObject(o) {
  8228. return isObject(o) === true
  8229. && Object.prototype.toString.call(o) === '[object Object]';
  8230. }
  8231. function isPlainObject(o) {
  8232. var ctor,prot;
  8233. if (isObjectObject(o) === false) return false;
  8234. // If has modified constructor
  8235. ctor = o.constructor;
  8236. if (typeof ctor !== 'function') return false;
  8237. // If has modified prototype
  8238. prot = ctor.prototype;
  8239. if (isObjectObject(prot) === false) return false;
  8240. // If constructor does not have an Object-specific method
  8241. if (prot.hasOwnProperty('isPrototypeOf') === false) {
  8242. return false;
  8243. }
  8244. // Most likely a plain Object
  8245. return true;
  8246. }
  8247. module.exports = isPlainObject;
  8248. /***/ }),
  8249. /***/ 697:
  8250. /***/ (function(module) {
  8251. "use strict";
  8252. module.exports = (promise, onFinally) => {
  8253. onFinally = onFinally || (() => {});
  8254. return promise.then(
  8255. val => new Promise(resolve => {
  8256. resolve(onFinally());
  8257. }).then(() => val),
  8258. err => new Promise(resolve => {
  8259. resolve(onFinally());
  8260. }).then(() => {
  8261. throw err;
  8262. })
  8263. );
  8264. };
  8265. /***/ }),
  8266. /***/ 705:
  8267. /***/ (function(module) {
  8268. 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"}}};
  8269. /***/ }),
  8270. /***/ 742:
  8271. /***/ (function(module, __unusedexports, __webpack_require__) {
  8272. var fs = __webpack_require__(747)
  8273. var core
  8274. if (process.platform === 'win32' || global.TESTING_WINDOWS) {
  8275. core = __webpack_require__(818)
  8276. } else {
  8277. core = __webpack_require__(197)
  8278. }
  8279. module.exports = isexe
  8280. isexe.sync = sync
  8281. function isexe (path, options, cb) {
  8282. if (typeof options === 'function') {
  8283. cb = options
  8284. options = {}
  8285. }
  8286. if (!cb) {
  8287. if (typeof Promise !== 'function') {
  8288. throw new TypeError('callback not provided')
  8289. }
  8290. return new Promise(function (resolve, reject) {
  8291. isexe(path, options || {}, function (er, is) {
  8292. if (er) {
  8293. reject(er)
  8294. } else {
  8295. resolve(is)
  8296. }
  8297. })
  8298. })
  8299. }
  8300. core(path, options || {}, function (er, is) {
  8301. // ignore EACCES because that just means we aren't allowed to run it
  8302. if (er) {
  8303. if (er.code === 'EACCES' || options && options.ignoreErrors) {
  8304. er = null
  8305. is = false
  8306. }
  8307. }
  8308. cb(er, is)
  8309. })
  8310. }
  8311. function sync (path, options) {
  8312. // my kingdom for a filtered catch
  8313. try {
  8314. return core.sync(path, options || {})
  8315. } catch (er) {
  8316. if (options && options.ignoreErrors || er.code === 'EACCES') {
  8317. return false
  8318. } else {
  8319. throw er
  8320. }
  8321. }
  8322. }
  8323. /***/ }),
  8324. /***/ 747:
  8325. /***/ (function(module) {
  8326. module.exports = require("fs");
  8327. /***/ }),
  8328. /***/ 753:
  8329. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8330. "use strict";
  8331. Object.defineProperty(exports, '__esModule', { value: true });
  8332. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  8333. var endpoint = __webpack_require__(385);
  8334. var universalUserAgent = __webpack_require__(796);
  8335. var isPlainObject = _interopDefault(__webpack_require__(696));
  8336. var nodeFetch = _interopDefault(__webpack_require__(454));
  8337. var requestError = __webpack_require__(463);
  8338. const VERSION = "5.3.1";
  8339. function getBufferResponse(response) {
  8340. return response.arrayBuffer();
  8341. }
  8342. function fetchWrapper(requestOptions) {
  8343. if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {
  8344. requestOptions.body = JSON.stringify(requestOptions.body);
  8345. }
  8346. let headers = {};
  8347. let status;
  8348. let url;
  8349. const fetch = requestOptions.request && requestOptions.request.fetch || nodeFetch;
  8350. return fetch(requestOptions.url, Object.assign({
  8351. method: requestOptions.method,
  8352. body: requestOptions.body,
  8353. headers: requestOptions.headers,
  8354. redirect: requestOptions.redirect
  8355. }, requestOptions.request)).then(response => {
  8356. url = response.url;
  8357. status = response.status;
  8358. for (const keyAndValue of response.headers) {
  8359. headers[keyAndValue[0]] = keyAndValue[1];
  8360. }
  8361. if (status === 204 || status === 205) {
  8362. return;
  8363. } // GitHub API returns 200 for HEAD requsets
  8364. if (requestOptions.method === "HEAD") {
  8365. if (status < 400) {
  8366. return;
  8367. }
  8368. throw new requestError.RequestError(response.statusText, status, {
  8369. headers,
  8370. request: requestOptions
  8371. });
  8372. }
  8373. if (status === 304) {
  8374. throw new requestError.RequestError("Not modified", status, {
  8375. headers,
  8376. request: requestOptions
  8377. });
  8378. }
  8379. if (status >= 400) {
  8380. return response.text().then(message => {
  8381. const error = new requestError.RequestError(message, status, {
  8382. headers,
  8383. request: requestOptions
  8384. });
  8385. try {
  8386. let responseBody = JSON.parse(error.message);
  8387. Object.assign(error, responseBody);
  8388. let errors = responseBody.errors; // Assumption `errors` would always be in Array Fotmat
  8389. error.message = error.message + ": " + errors.map(JSON.stringify).join(", ");
  8390. } catch (e) {// ignore, see octokit/rest.js#684
  8391. }
  8392. throw error;
  8393. });
  8394. }
  8395. const contentType = response.headers.get("content-type");
  8396. if (/application\/json/.test(contentType)) {
  8397. return response.json();
  8398. }
  8399. if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) {
  8400. return response.text();
  8401. }
  8402. return getBufferResponse(response);
  8403. }).then(data => {
  8404. return {
  8405. status,
  8406. url,
  8407. headers,
  8408. data
  8409. };
  8410. }).catch(error => {
  8411. if (error instanceof requestError.RequestError) {
  8412. throw error;
  8413. }
  8414. throw new requestError.RequestError(error.message, 500, {
  8415. headers,
  8416. request: requestOptions
  8417. });
  8418. });
  8419. }
  8420. function withDefaults(oldEndpoint, newDefaults) {
  8421. const endpoint = oldEndpoint.defaults(newDefaults);
  8422. const newApi = function (route, parameters) {
  8423. const endpointOptions = endpoint.merge(route, parameters);
  8424. if (!endpointOptions.request || !endpointOptions.request.hook) {
  8425. return fetchWrapper(endpoint.parse(endpointOptions));
  8426. }
  8427. const request = (route, parameters) => {
  8428. return fetchWrapper(endpoint.parse(endpoint.merge(route, parameters)));
  8429. };
  8430. Object.assign(request, {
  8431. endpoint,
  8432. defaults: withDefaults.bind(null, endpoint)
  8433. });
  8434. return endpointOptions.request.hook(request, endpointOptions);
  8435. };
  8436. return Object.assign(newApi, {
  8437. endpoint,
  8438. defaults: withDefaults.bind(null, endpoint)
  8439. });
  8440. }
  8441. const request = withDefaults(endpoint.endpoint, {
  8442. headers: {
  8443. "user-agent": `octokit-request.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  8444. }
  8445. });
  8446. exports.request = request;
  8447. //# sourceMappingURL=index.js.map
  8448. /***/ }),
  8449. /***/ 761:
  8450. /***/ (function(module) {
  8451. module.exports = require("zlib");
  8452. /***/ }),
  8453. /***/ 763:
  8454. /***/ (function(module) {
  8455. module.exports = removeHook
  8456. function removeHook (state, name, method) {
  8457. if (!state.registry[name]) {
  8458. return
  8459. }
  8460. var index = state.registry[name]
  8461. .map(function (registered) { return registered.orig })
  8462. .indexOf(method)
  8463. if (index === -1) {
  8464. return
  8465. }
  8466. state.registry[name].splice(index, 1)
  8467. }
  8468. /***/ }),
  8469. /***/ 768:
  8470. /***/ (function(module) {
  8471. "use strict";
  8472. module.exports = function (x) {
  8473. var lf = typeof x === 'string' ? '\n' : '\n'.charCodeAt();
  8474. var cr = typeof x === 'string' ? '\r' : '\r'.charCodeAt();
  8475. if (x[x.length - 1] === lf) {
  8476. x = x.slice(0, x.length - 1);
  8477. }
  8478. if (x[x.length - 1] === cr) {
  8479. x = x.slice(0, x.length - 1);
  8480. }
  8481. return x;
  8482. };
  8483. /***/ }),
  8484. /***/ 777:
  8485. /***/ (function(module, __unusedexports, __webpack_require__) {
  8486. module.exports = getFirstPage
  8487. const getPage = __webpack_require__(265)
  8488. function getFirstPage (octokit, link, headers) {
  8489. return getPage(octokit, link, 'first', headers)
  8490. }
  8491. /***/ }),
  8492. /***/ 796:
  8493. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8494. "use strict";
  8495. Object.defineProperty(exports, '__esModule', { value: true });
  8496. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  8497. var osName = _interopDefault(__webpack_require__(2));
  8498. function getUserAgent() {
  8499. try {
  8500. return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
  8501. } catch (error) {
  8502. if (/wmic os get Caption/.test(error.message)) {
  8503. return "Windows <version undetectable>";
  8504. }
  8505. throw error;
  8506. }
  8507. }
  8508. exports.getUserAgent = getUserAgent;
  8509. //# sourceMappingURL=index.js.map
  8510. /***/ }),
  8511. /***/ 807:
  8512. /***/ (function(module, __unusedexports, __webpack_require__) {
  8513. module.exports = paginate;
  8514. const iterator = __webpack_require__(8);
  8515. function paginate(octokit, route, options, mapFn) {
  8516. if (typeof options === "function") {
  8517. mapFn = options;
  8518. options = undefined;
  8519. }
  8520. options = octokit.request.endpoint.merge(route, options);
  8521. return gather(
  8522. octokit,
  8523. [],
  8524. iterator(octokit, options)[Symbol.asyncIterator](),
  8525. mapFn
  8526. );
  8527. }
  8528. function gather(octokit, results, iterator, mapFn) {
  8529. return iterator.next().then(result => {
  8530. if (result.done) {
  8531. return results;
  8532. }
  8533. let earlyExit = false;
  8534. function done() {
  8535. earlyExit = true;
  8536. }
  8537. results = results.concat(
  8538. mapFn ? mapFn(result.value, done) : result.value.data
  8539. );
  8540. if (earlyExit) {
  8541. return results;
  8542. }
  8543. return gather(octokit, results, iterator, mapFn);
  8544. });
  8545. }
  8546. /***/ }),
  8547. /***/ 814:
  8548. /***/ (function(module, __unusedexports, __webpack_require__) {
  8549. module.exports = which
  8550. which.sync = whichSync
  8551. var isWindows = process.platform === 'win32' ||
  8552. process.env.OSTYPE === 'cygwin' ||
  8553. process.env.OSTYPE === 'msys'
  8554. var path = __webpack_require__(622)
  8555. var COLON = isWindows ? ';' : ':'
  8556. var isexe = __webpack_require__(742)
  8557. function getNotFoundError (cmd) {
  8558. var er = new Error('not found: ' + cmd)
  8559. er.code = 'ENOENT'
  8560. return er
  8561. }
  8562. function getPathInfo (cmd, opt) {
  8563. var colon = opt.colon || COLON
  8564. var pathEnv = opt.path || process.env.PATH || ''
  8565. var pathExt = ['']
  8566. pathEnv = pathEnv.split(colon)
  8567. var pathExtExe = ''
  8568. if (isWindows) {
  8569. pathEnv.unshift(process.cwd())
  8570. pathExtExe = (opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM')
  8571. pathExt = pathExtExe.split(colon)
  8572. // Always test the cmd itself first. isexe will check to make sure
  8573. // it's found in the pathExt set.
  8574. if (cmd.indexOf('.') !== -1 && pathExt[0] !== '')
  8575. pathExt.unshift('')
  8576. }
  8577. // If it has a slash, then we don't bother searching the pathenv.
  8578. // just check the file itself, and that's it.
  8579. if (cmd.match(/\//) || isWindows && cmd.match(/\\/))
  8580. pathEnv = ['']
  8581. return {
  8582. env: pathEnv,
  8583. ext: pathExt,
  8584. extExe: pathExtExe
  8585. }
  8586. }
  8587. function which (cmd, opt, cb) {
  8588. if (typeof opt === 'function') {
  8589. cb = opt
  8590. opt = {}
  8591. }
  8592. var info = getPathInfo(cmd, opt)
  8593. var pathEnv = info.env
  8594. var pathExt = info.ext
  8595. var pathExtExe = info.extExe
  8596. var found = []
  8597. ;(function F (i, l) {
  8598. if (i === l) {
  8599. if (opt.all && found.length)
  8600. return cb(null, found)
  8601. else
  8602. return cb(getNotFoundError(cmd))
  8603. }
  8604. var pathPart = pathEnv[i]
  8605. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  8606. pathPart = pathPart.slice(1, -1)
  8607. var p = path.join(pathPart, cmd)
  8608. if (!pathPart && (/^\.[\\\/]/).test(cmd)) {
  8609. p = cmd.slice(0, 2) + p
  8610. }
  8611. ;(function E (ii, ll) {
  8612. if (ii === ll) return F(i + 1, l)
  8613. var ext = pathExt[ii]
  8614. isexe(p + ext, { pathExt: pathExtExe }, function (er, is) {
  8615. if (!er && is) {
  8616. if (opt.all)
  8617. found.push(p + ext)
  8618. else
  8619. return cb(null, p + ext)
  8620. }
  8621. return E(ii + 1, ll)
  8622. })
  8623. })(0, pathExt.length)
  8624. })(0, pathEnv.length)
  8625. }
  8626. function whichSync (cmd, opt) {
  8627. opt = opt || {}
  8628. var info = getPathInfo(cmd, opt)
  8629. var pathEnv = info.env
  8630. var pathExt = info.ext
  8631. var pathExtExe = info.extExe
  8632. var found = []
  8633. for (var i = 0, l = pathEnv.length; i < l; i ++) {
  8634. var pathPart = pathEnv[i]
  8635. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  8636. pathPart = pathPart.slice(1, -1)
  8637. var p = path.join(pathPart, cmd)
  8638. if (!pathPart && /^\.[\\\/]/.test(cmd)) {
  8639. p = cmd.slice(0, 2) + p
  8640. }
  8641. for (var j = 0, ll = pathExt.length; j < ll; j ++) {
  8642. var cur = p + pathExt[j]
  8643. var is
  8644. try {
  8645. is = isexe.sync(cur, { pathExt: pathExtExe })
  8646. if (is) {
  8647. if (opt.all)
  8648. found.push(cur)
  8649. else
  8650. return cur
  8651. }
  8652. } catch (ex) {}
  8653. }
  8654. }
  8655. if (opt.all && found.length)
  8656. return found
  8657. if (opt.nothrow)
  8658. return null
  8659. throw getNotFoundError(cmd)
  8660. }
  8661. /***/ }),
  8662. /***/ 816:
  8663. /***/ (function(module) {
  8664. "use strict";
  8665. module.exports = /^#!.*/;
  8666. /***/ }),
  8667. /***/ 818:
  8668. /***/ (function(module, __unusedexports, __webpack_require__) {
  8669. module.exports = isexe
  8670. isexe.sync = sync
  8671. var fs = __webpack_require__(747)
  8672. function checkPathExt (path, options) {
  8673. var pathext = options.pathExt !== undefined ?
  8674. options.pathExt : process.env.PATHEXT
  8675. if (!pathext) {
  8676. return true
  8677. }
  8678. pathext = pathext.split(';')
  8679. if (pathext.indexOf('') !== -1) {
  8680. return true
  8681. }
  8682. for (var i = 0; i < pathext.length; i++) {
  8683. var p = pathext[i].toLowerCase()
  8684. if (p && path.substr(-p.length).toLowerCase() === p) {
  8685. return true
  8686. }
  8687. }
  8688. return false
  8689. }
  8690. function checkStat (stat, path, options) {
  8691. if (!stat.isSymbolicLink() && !stat.isFile()) {
  8692. return false
  8693. }
  8694. return checkPathExt(path, options)
  8695. }
  8696. function isexe (path, options, cb) {
  8697. fs.stat(path, function (er, stat) {
  8698. cb(er, er ? false : checkStat(stat, path, options))
  8699. })
  8700. }
  8701. function sync (path, options) {
  8702. return checkStat(fs.statSync(path), path, options)
  8703. }
  8704. /***/ }),
  8705. /***/ 821:
  8706. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8707. "use strict";
  8708. var __importStar = (this && this.__importStar) || function (mod) {
  8709. if (mod && mod.__esModule) return mod;
  8710. var result = {};
  8711. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  8712. result["default"] = mod;
  8713. return result;
  8714. };
  8715. Object.defineProperty(exports, "__esModule", { value: true });
  8716. const core = __importStar(__webpack_require__(470));
  8717. const fsHelper = __importStar(__webpack_require__(618));
  8718. const github = __importStar(__webpack_require__(469));
  8719. const path = __importStar(__webpack_require__(622));
  8720. function getInputs() {
  8721. const result = {};
  8722. // GitHub workspace
  8723. let githubWorkspacePath = process.env['GITHUB_WORKSPACE'];
  8724. if (!githubWorkspacePath) {
  8725. throw new Error('GITHUB_WORKSPACE not defined');
  8726. }
  8727. githubWorkspacePath = path.resolve(githubWorkspacePath);
  8728. core.debug(`GITHUB_WORKSPACE = '${githubWorkspacePath}'`);
  8729. fsHelper.directoryExistsSync(githubWorkspacePath, true);
  8730. // Qualified repository
  8731. const qualifiedRepository = core.getInput('repository') ||
  8732. `${github.context.repo.owner}/${github.context.repo.repo}`;
  8733. core.debug(`qualified repository = '${qualifiedRepository}'`);
  8734. const splitRepository = qualifiedRepository.split('/');
  8735. if (splitRepository.length !== 2 ||
  8736. !splitRepository[0] ||
  8737. !splitRepository[1]) {
  8738. throw new Error(`Invalid repository '${qualifiedRepository}'. Expected format {owner}/{repo}.`);
  8739. }
  8740. result.repositoryOwner = splitRepository[0];
  8741. result.repositoryName = splitRepository[1];
  8742. // Repository path
  8743. result.repositoryPath = core.getInput('path') || '.';
  8744. result.repositoryPath = path.resolve(githubWorkspacePath, result.repositoryPath);
  8745. if (!(result.repositoryPath + path.sep).startsWith(githubWorkspacePath + path.sep)) {
  8746. throw new Error(`Repository path '${result.repositoryPath}' is not under '${githubWorkspacePath}'`);
  8747. }
  8748. // Workflow repository?
  8749. const isWorkflowRepository = qualifiedRepository.toUpperCase() ===
  8750. `${github.context.repo.owner}/${github.context.repo.repo}`.toUpperCase();
  8751. // Source branch, source version
  8752. result.ref = core.getInput('ref');
  8753. if (!result.ref) {
  8754. if (isWorkflowRepository) {
  8755. result.ref = github.context.ref;
  8756. result.commit = github.context.sha;
  8757. }
  8758. if (!result.ref && !result.commit) {
  8759. result.ref = 'refs/heads/master';
  8760. }
  8761. }
  8762. // SHA?
  8763. else if (result.ref.match(/^[0-9a-fA-F]{40}$/)) {
  8764. result.commit = result.ref;
  8765. result.ref = '';
  8766. }
  8767. core.debug(`ref = '${result.ref}'`);
  8768. core.debug(`commit = '${result.commit}'`);
  8769. // Clean
  8770. result.clean = (core.getInput('clean') || 'true').toUpperCase() === 'TRUE';
  8771. core.debug(`clean = ${result.clean}`);
  8772. // Submodules
  8773. if (core.getInput('submodules')) {
  8774. throw new Error("The input 'submodules' is not supported in actions/checkout@v2");
  8775. }
  8776. // Fetch depth
  8777. result.fetchDepth = Math.floor(Number(core.getInput('fetch-depth') || '1'));
  8778. if (isNaN(result.fetchDepth) || result.fetchDepth < 0) {
  8779. result.fetchDepth = 0;
  8780. }
  8781. core.debug(`fetch depth = ${result.fetchDepth}`);
  8782. // LFS
  8783. result.lfs = (core.getInput('lfs') || 'false').toUpperCase() === 'TRUE';
  8784. core.debug(`lfs = ${result.lfs}`);
  8785. // Access token
  8786. result.accessToken = core.getInput('token');
  8787. return result;
  8788. }
  8789. exports.getInputs = getInputs;
  8790. /***/ }),
  8791. /***/ 835:
  8792. /***/ (function(module) {
  8793. module.exports = require("url");
  8794. /***/ }),
  8795. /***/ 850:
  8796. /***/ (function(module, __unusedexports, __webpack_require__) {
  8797. module.exports = paginationMethodsPlugin
  8798. function paginationMethodsPlugin (octokit) {
  8799. octokit.getFirstPage = __webpack_require__(777).bind(null, octokit)
  8800. octokit.getLastPage = __webpack_require__(649).bind(null, octokit)
  8801. octokit.getNextPage = __webpack_require__(550).bind(null, octokit)
  8802. octokit.getPreviousPage = __webpack_require__(563).bind(null, octokit)
  8803. octokit.hasFirstPage = __webpack_require__(536)
  8804. octokit.hasLastPage = __webpack_require__(336)
  8805. octokit.hasNextPage = __webpack_require__(929)
  8806. octokit.hasPreviousPage = __webpack_require__(558)
  8807. }
  8808. /***/ }),
  8809. /***/ 854:
  8810. /***/ (function(module) {
  8811. /**
  8812. * lodash (Custom Build) <https://lodash.com/>
  8813. * Build: `lodash modularize exports="npm" -o ./`
  8814. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  8815. * Released under MIT license <https://lodash.com/license>
  8816. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  8817. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  8818. */
  8819. /** Used as the `TypeError` message for "Functions" methods. */
  8820. var FUNC_ERROR_TEXT = 'Expected a function';
  8821. /** Used to stand-in for `undefined` hash values. */
  8822. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  8823. /** Used as references for various `Number` constants. */
  8824. var INFINITY = 1 / 0;
  8825. /** `Object#toString` result references. */
  8826. var funcTag = '[object Function]',
  8827. genTag = '[object GeneratorFunction]',
  8828. symbolTag = '[object Symbol]';
  8829. /** Used to match property names within property paths. */
  8830. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  8831. reIsPlainProp = /^\w*$/,
  8832. reLeadingDot = /^\./,
  8833. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  8834. /**
  8835. * Used to match `RegExp`
  8836. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  8837. */
  8838. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  8839. /** Used to match backslashes in property paths. */
  8840. var reEscapeChar = /\\(\\)?/g;
  8841. /** Used to detect host constructors (Safari). */
  8842. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  8843. /** Detect free variable `global` from Node.js. */
  8844. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  8845. /** Detect free variable `self`. */
  8846. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  8847. /** Used as a reference to the global object. */
  8848. var root = freeGlobal || freeSelf || Function('return this')();
  8849. /**
  8850. * Gets the value at `key` of `object`.
  8851. *
  8852. * @private
  8853. * @param {Object} [object] The object to query.
  8854. * @param {string} key The key of the property to get.
  8855. * @returns {*} Returns the property value.
  8856. */
  8857. function getValue(object, key) {
  8858. return object == null ? undefined : object[key];
  8859. }
  8860. /**
  8861. * Checks if `value` is a host object in IE < 9.
  8862. *
  8863. * @private
  8864. * @param {*} value The value to check.
  8865. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  8866. */
  8867. function isHostObject(value) {
  8868. // Many host objects are `Object` objects that can coerce to strings
  8869. // despite having improperly defined `toString` methods.
  8870. var result = false;
  8871. if (value != null && typeof value.toString != 'function') {
  8872. try {
  8873. result = !!(value + '');
  8874. } catch (e) {}
  8875. }
  8876. return result;
  8877. }
  8878. /** Used for built-in method references. */
  8879. var arrayProto = Array.prototype,
  8880. funcProto = Function.prototype,
  8881. objectProto = Object.prototype;
  8882. /** Used to detect overreaching core-js shims. */
  8883. var coreJsData = root['__core-js_shared__'];
  8884. /** Used to detect methods masquerading as native. */
  8885. var maskSrcKey = (function() {
  8886. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  8887. return uid ? ('Symbol(src)_1.' + uid) : '';
  8888. }());
  8889. /** Used to resolve the decompiled source of functions. */
  8890. var funcToString = funcProto.toString;
  8891. /** Used to check objects for own properties. */
  8892. var hasOwnProperty = objectProto.hasOwnProperty;
  8893. /**
  8894. * Used to resolve the
  8895. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  8896. * of values.
  8897. */
  8898. var objectToString = objectProto.toString;
  8899. /** Used to detect if a method is native. */
  8900. var reIsNative = RegExp('^' +
  8901. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  8902. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  8903. );
  8904. /** Built-in value references. */
  8905. var Symbol = root.Symbol,
  8906. splice = arrayProto.splice;
  8907. /* Built-in method references that are verified to be native. */
  8908. var Map = getNative(root, 'Map'),
  8909. nativeCreate = getNative(Object, 'create');
  8910. /** Used to convert symbols to primitives and strings. */
  8911. var symbolProto = Symbol ? Symbol.prototype : undefined,
  8912. symbolToString = symbolProto ? symbolProto.toString : undefined;
  8913. /**
  8914. * Creates a hash object.
  8915. *
  8916. * @private
  8917. * @constructor
  8918. * @param {Array} [entries] The key-value pairs to cache.
  8919. */
  8920. function Hash(entries) {
  8921. var index = -1,
  8922. length = entries ? entries.length : 0;
  8923. this.clear();
  8924. while (++index < length) {
  8925. var entry = entries[index];
  8926. this.set(entry[0], entry[1]);
  8927. }
  8928. }
  8929. /**
  8930. * Removes all key-value entries from the hash.
  8931. *
  8932. * @private
  8933. * @name clear
  8934. * @memberOf Hash
  8935. */
  8936. function hashClear() {
  8937. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  8938. }
  8939. /**
  8940. * Removes `key` and its value from the hash.
  8941. *
  8942. * @private
  8943. * @name delete
  8944. * @memberOf Hash
  8945. * @param {Object} hash The hash to modify.
  8946. * @param {string} key The key of the value to remove.
  8947. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  8948. */
  8949. function hashDelete(key) {
  8950. return this.has(key) && delete this.__data__[key];
  8951. }
  8952. /**
  8953. * Gets the hash value for `key`.
  8954. *
  8955. * @private
  8956. * @name get
  8957. * @memberOf Hash
  8958. * @param {string} key The key of the value to get.
  8959. * @returns {*} Returns the entry value.
  8960. */
  8961. function hashGet(key) {
  8962. var data = this.__data__;
  8963. if (nativeCreate) {
  8964. var result = data[key];
  8965. return result === HASH_UNDEFINED ? undefined : result;
  8966. }
  8967. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  8968. }
  8969. /**
  8970. * Checks if a hash value for `key` exists.
  8971. *
  8972. * @private
  8973. * @name has
  8974. * @memberOf Hash
  8975. * @param {string} key The key of the entry to check.
  8976. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  8977. */
  8978. function hashHas(key) {
  8979. var data = this.__data__;
  8980. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  8981. }
  8982. /**
  8983. * Sets the hash `key` to `value`.
  8984. *
  8985. * @private
  8986. * @name set
  8987. * @memberOf Hash
  8988. * @param {string} key The key of the value to set.
  8989. * @param {*} value The value to set.
  8990. * @returns {Object} Returns the hash instance.
  8991. */
  8992. function hashSet(key, value) {
  8993. var data = this.__data__;
  8994. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  8995. return this;
  8996. }
  8997. // Add methods to `Hash`.
  8998. Hash.prototype.clear = hashClear;
  8999. Hash.prototype['delete'] = hashDelete;
  9000. Hash.prototype.get = hashGet;
  9001. Hash.prototype.has = hashHas;
  9002. Hash.prototype.set = hashSet;
  9003. /**
  9004. * Creates an list cache object.
  9005. *
  9006. * @private
  9007. * @constructor
  9008. * @param {Array} [entries] The key-value pairs to cache.
  9009. */
  9010. function ListCache(entries) {
  9011. var index = -1,
  9012. length = entries ? entries.length : 0;
  9013. this.clear();
  9014. while (++index < length) {
  9015. var entry = entries[index];
  9016. this.set(entry[0], entry[1]);
  9017. }
  9018. }
  9019. /**
  9020. * Removes all key-value entries from the list cache.
  9021. *
  9022. * @private
  9023. * @name clear
  9024. * @memberOf ListCache
  9025. */
  9026. function listCacheClear() {
  9027. this.__data__ = [];
  9028. }
  9029. /**
  9030. * Removes `key` and its value from the list cache.
  9031. *
  9032. * @private
  9033. * @name delete
  9034. * @memberOf ListCache
  9035. * @param {string} key The key of the value to remove.
  9036. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  9037. */
  9038. function listCacheDelete(key) {
  9039. var data = this.__data__,
  9040. index = assocIndexOf(data, key);
  9041. if (index < 0) {
  9042. return false;
  9043. }
  9044. var lastIndex = data.length - 1;
  9045. if (index == lastIndex) {
  9046. data.pop();
  9047. } else {
  9048. splice.call(data, index, 1);
  9049. }
  9050. return true;
  9051. }
  9052. /**
  9053. * Gets the list cache value for `key`.
  9054. *
  9055. * @private
  9056. * @name get
  9057. * @memberOf ListCache
  9058. * @param {string} key The key of the value to get.
  9059. * @returns {*} Returns the entry value.
  9060. */
  9061. function listCacheGet(key) {
  9062. var data = this.__data__,
  9063. index = assocIndexOf(data, key);
  9064. return index < 0 ? undefined : data[index][1];
  9065. }
  9066. /**
  9067. * Checks if a list cache value for `key` exists.
  9068. *
  9069. * @private
  9070. * @name has
  9071. * @memberOf ListCache
  9072. * @param {string} key The key of the entry to check.
  9073. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  9074. */
  9075. function listCacheHas(key) {
  9076. return assocIndexOf(this.__data__, key) > -1;
  9077. }
  9078. /**
  9079. * Sets the list cache `key` to `value`.
  9080. *
  9081. * @private
  9082. * @name set
  9083. * @memberOf ListCache
  9084. * @param {string} key The key of the value to set.
  9085. * @param {*} value The value to set.
  9086. * @returns {Object} Returns the list cache instance.
  9087. */
  9088. function listCacheSet(key, value) {
  9089. var data = this.__data__,
  9090. index = assocIndexOf(data, key);
  9091. if (index < 0) {
  9092. data.push([key, value]);
  9093. } else {
  9094. data[index][1] = value;
  9095. }
  9096. return this;
  9097. }
  9098. // Add methods to `ListCache`.
  9099. ListCache.prototype.clear = listCacheClear;
  9100. ListCache.prototype['delete'] = listCacheDelete;
  9101. ListCache.prototype.get = listCacheGet;
  9102. ListCache.prototype.has = listCacheHas;
  9103. ListCache.prototype.set = listCacheSet;
  9104. /**
  9105. * Creates a map cache object to store key-value pairs.
  9106. *
  9107. * @private
  9108. * @constructor
  9109. * @param {Array} [entries] The key-value pairs to cache.
  9110. */
  9111. function MapCache(entries) {
  9112. var index = -1,
  9113. length = entries ? entries.length : 0;
  9114. this.clear();
  9115. while (++index < length) {
  9116. var entry = entries[index];
  9117. this.set(entry[0], entry[1]);
  9118. }
  9119. }
  9120. /**
  9121. * Removes all key-value entries from the map.
  9122. *
  9123. * @private
  9124. * @name clear
  9125. * @memberOf MapCache
  9126. */
  9127. function mapCacheClear() {
  9128. this.__data__ = {
  9129. 'hash': new Hash,
  9130. 'map': new (Map || ListCache),
  9131. 'string': new Hash
  9132. };
  9133. }
  9134. /**
  9135. * Removes `key` and its value from the map.
  9136. *
  9137. * @private
  9138. * @name delete
  9139. * @memberOf MapCache
  9140. * @param {string} key The key of the value to remove.
  9141. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  9142. */
  9143. function mapCacheDelete(key) {
  9144. return getMapData(this, key)['delete'](key);
  9145. }
  9146. /**
  9147. * Gets the map value for `key`.
  9148. *
  9149. * @private
  9150. * @name get
  9151. * @memberOf MapCache
  9152. * @param {string} key The key of the value to get.
  9153. * @returns {*} Returns the entry value.
  9154. */
  9155. function mapCacheGet(key) {
  9156. return getMapData(this, key).get(key);
  9157. }
  9158. /**
  9159. * Checks if a map value for `key` exists.
  9160. *
  9161. * @private
  9162. * @name has
  9163. * @memberOf MapCache
  9164. * @param {string} key The key of the entry to check.
  9165. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  9166. */
  9167. function mapCacheHas(key) {
  9168. return getMapData(this, key).has(key);
  9169. }
  9170. /**
  9171. * Sets the map `key` to `value`.
  9172. *
  9173. * @private
  9174. * @name set
  9175. * @memberOf MapCache
  9176. * @param {string} key The key of the value to set.
  9177. * @param {*} value The value to set.
  9178. * @returns {Object} Returns the map cache instance.
  9179. */
  9180. function mapCacheSet(key, value) {
  9181. getMapData(this, key).set(key, value);
  9182. return this;
  9183. }
  9184. // Add methods to `MapCache`.
  9185. MapCache.prototype.clear = mapCacheClear;
  9186. MapCache.prototype['delete'] = mapCacheDelete;
  9187. MapCache.prototype.get = mapCacheGet;
  9188. MapCache.prototype.has = mapCacheHas;
  9189. MapCache.prototype.set = mapCacheSet;
  9190. /**
  9191. * Gets the index at which the `key` is found in `array` of key-value pairs.
  9192. *
  9193. * @private
  9194. * @param {Array} array The array to inspect.
  9195. * @param {*} key The key to search for.
  9196. * @returns {number} Returns the index of the matched value, else `-1`.
  9197. */
  9198. function assocIndexOf(array, key) {
  9199. var length = array.length;
  9200. while (length--) {
  9201. if (eq(array[length][0], key)) {
  9202. return length;
  9203. }
  9204. }
  9205. return -1;
  9206. }
  9207. /**
  9208. * The base implementation of `_.get` without support for default values.
  9209. *
  9210. * @private
  9211. * @param {Object} object The object to query.
  9212. * @param {Array|string} path The path of the property to get.
  9213. * @returns {*} Returns the resolved value.
  9214. */
  9215. function baseGet(object, path) {
  9216. path = isKey(path, object) ? [path] : castPath(path);
  9217. var index = 0,
  9218. length = path.length;
  9219. while (object != null && index < length) {
  9220. object = object[toKey(path[index++])];
  9221. }
  9222. return (index && index == length) ? object : undefined;
  9223. }
  9224. /**
  9225. * The base implementation of `_.isNative` without bad shim checks.
  9226. *
  9227. * @private
  9228. * @param {*} value The value to check.
  9229. * @returns {boolean} Returns `true` if `value` is a native function,
  9230. * else `false`.
  9231. */
  9232. function baseIsNative(value) {
  9233. if (!isObject(value) || isMasked(value)) {
  9234. return false;
  9235. }
  9236. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  9237. return pattern.test(toSource(value));
  9238. }
  9239. /**
  9240. * The base implementation of `_.toString` which doesn't convert nullish
  9241. * values to empty strings.
  9242. *
  9243. * @private
  9244. * @param {*} value The value to process.
  9245. * @returns {string} Returns the string.
  9246. */
  9247. function baseToString(value) {
  9248. // Exit early for strings to avoid a performance hit in some environments.
  9249. if (typeof value == 'string') {
  9250. return value;
  9251. }
  9252. if (isSymbol(value)) {
  9253. return symbolToString ? symbolToString.call(value) : '';
  9254. }
  9255. var result = (value + '');
  9256. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  9257. }
  9258. /**
  9259. * Casts `value` to a path array if it's not one.
  9260. *
  9261. * @private
  9262. * @param {*} value The value to inspect.
  9263. * @returns {Array} Returns the cast property path array.
  9264. */
  9265. function castPath(value) {
  9266. return isArray(value) ? value : stringToPath(value);
  9267. }
  9268. /**
  9269. * Gets the data for `map`.
  9270. *
  9271. * @private
  9272. * @param {Object} map The map to query.
  9273. * @param {string} key The reference key.
  9274. * @returns {*} Returns the map data.
  9275. */
  9276. function getMapData(map, key) {
  9277. var data = map.__data__;
  9278. return isKeyable(key)
  9279. ? data[typeof key == 'string' ? 'string' : 'hash']
  9280. : data.map;
  9281. }
  9282. /**
  9283. * Gets the native function at `key` of `object`.
  9284. *
  9285. * @private
  9286. * @param {Object} object The object to query.
  9287. * @param {string} key The key of the method to get.
  9288. * @returns {*} Returns the function if it's native, else `undefined`.
  9289. */
  9290. function getNative(object, key) {
  9291. var value = getValue(object, key);
  9292. return baseIsNative(value) ? value : undefined;
  9293. }
  9294. /**
  9295. * Checks if `value` is a property name and not a property path.
  9296. *
  9297. * @private
  9298. * @param {*} value The value to check.
  9299. * @param {Object} [object] The object to query keys on.
  9300. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  9301. */
  9302. function isKey(value, object) {
  9303. if (isArray(value)) {
  9304. return false;
  9305. }
  9306. var type = typeof value;
  9307. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  9308. value == null || isSymbol(value)) {
  9309. return true;
  9310. }
  9311. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  9312. (object != null && value in Object(object));
  9313. }
  9314. /**
  9315. * Checks if `value` is suitable for use as unique object key.
  9316. *
  9317. * @private
  9318. * @param {*} value The value to check.
  9319. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  9320. */
  9321. function isKeyable(value) {
  9322. var type = typeof value;
  9323. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  9324. ? (value !== '__proto__')
  9325. : (value === null);
  9326. }
  9327. /**
  9328. * Checks if `func` has its source masked.
  9329. *
  9330. * @private
  9331. * @param {Function} func The function to check.
  9332. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  9333. */
  9334. function isMasked(func) {
  9335. return !!maskSrcKey && (maskSrcKey in func);
  9336. }
  9337. /**
  9338. * Converts `string` to a property path array.
  9339. *
  9340. * @private
  9341. * @param {string} string The string to convert.
  9342. * @returns {Array} Returns the property path array.
  9343. */
  9344. var stringToPath = memoize(function(string) {
  9345. string = toString(string);
  9346. var result = [];
  9347. if (reLeadingDot.test(string)) {
  9348. result.push('');
  9349. }
  9350. string.replace(rePropName, function(match, number, quote, string) {
  9351. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  9352. });
  9353. return result;
  9354. });
  9355. /**
  9356. * Converts `value` to a string key if it's not a string or symbol.
  9357. *
  9358. * @private
  9359. * @param {*} value The value to inspect.
  9360. * @returns {string|symbol} Returns the key.
  9361. */
  9362. function toKey(value) {
  9363. if (typeof value == 'string' || isSymbol(value)) {
  9364. return value;
  9365. }
  9366. var result = (value + '');
  9367. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  9368. }
  9369. /**
  9370. * Converts `func` to its source code.
  9371. *
  9372. * @private
  9373. * @param {Function} func The function to process.
  9374. * @returns {string} Returns the source code.
  9375. */
  9376. function toSource(func) {
  9377. if (func != null) {
  9378. try {
  9379. return funcToString.call(func);
  9380. } catch (e) {}
  9381. try {
  9382. return (func + '');
  9383. } catch (e) {}
  9384. }
  9385. return '';
  9386. }
  9387. /**
  9388. * Creates a function that memoizes the result of `func`. If `resolver` is
  9389. * provided, it determines the cache key for storing the result based on the
  9390. * arguments provided to the memoized function. By default, the first argument
  9391. * provided to the memoized function is used as the map cache key. The `func`
  9392. * is invoked with the `this` binding of the memoized function.
  9393. *
  9394. * **Note:** The cache is exposed as the `cache` property on the memoized
  9395. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  9396. * constructor with one whose instances implement the
  9397. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  9398. * method interface of `delete`, `get`, `has`, and `set`.
  9399. *
  9400. * @static
  9401. * @memberOf _
  9402. * @since 0.1.0
  9403. * @category Function
  9404. * @param {Function} func The function to have its output memoized.
  9405. * @param {Function} [resolver] The function to resolve the cache key.
  9406. * @returns {Function} Returns the new memoized function.
  9407. * @example
  9408. *
  9409. * var object = { 'a': 1, 'b': 2 };
  9410. * var other = { 'c': 3, 'd': 4 };
  9411. *
  9412. * var values = _.memoize(_.values);
  9413. * values(object);
  9414. * // => [1, 2]
  9415. *
  9416. * values(other);
  9417. * // => [3, 4]
  9418. *
  9419. * object.a = 2;
  9420. * values(object);
  9421. * // => [1, 2]
  9422. *
  9423. * // Modify the result cache.
  9424. * values.cache.set(object, ['a', 'b']);
  9425. * values(object);
  9426. * // => ['a', 'b']
  9427. *
  9428. * // Replace `_.memoize.Cache`.
  9429. * _.memoize.Cache = WeakMap;
  9430. */
  9431. function memoize(func, resolver) {
  9432. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  9433. throw new TypeError(FUNC_ERROR_TEXT);
  9434. }
  9435. var memoized = function() {
  9436. var args = arguments,
  9437. key = resolver ? resolver.apply(this, args) : args[0],
  9438. cache = memoized.cache;
  9439. if (cache.has(key)) {
  9440. return cache.get(key);
  9441. }
  9442. var result = func.apply(this, args);
  9443. memoized.cache = cache.set(key, result);
  9444. return result;
  9445. };
  9446. memoized.cache = new (memoize.Cache || MapCache);
  9447. return memoized;
  9448. }
  9449. // Assign cache to `_.memoize`.
  9450. memoize.Cache = MapCache;
  9451. /**
  9452. * Performs a
  9453. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9454. * comparison between two values to determine if they are equivalent.
  9455. *
  9456. * @static
  9457. * @memberOf _
  9458. * @since 4.0.0
  9459. * @category Lang
  9460. * @param {*} value The value to compare.
  9461. * @param {*} other The other value to compare.
  9462. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  9463. * @example
  9464. *
  9465. * var object = { 'a': 1 };
  9466. * var other = { 'a': 1 };
  9467. *
  9468. * _.eq(object, object);
  9469. * // => true
  9470. *
  9471. * _.eq(object, other);
  9472. * // => false
  9473. *
  9474. * _.eq('a', 'a');
  9475. * // => true
  9476. *
  9477. * _.eq('a', Object('a'));
  9478. * // => false
  9479. *
  9480. * _.eq(NaN, NaN);
  9481. * // => true
  9482. */
  9483. function eq(value, other) {
  9484. return value === other || (value !== value && other !== other);
  9485. }
  9486. /**
  9487. * Checks if `value` is classified as an `Array` object.
  9488. *
  9489. * @static
  9490. * @memberOf _
  9491. * @since 0.1.0
  9492. * @category Lang
  9493. * @param {*} value The value to check.
  9494. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  9495. * @example
  9496. *
  9497. * _.isArray([1, 2, 3]);
  9498. * // => true
  9499. *
  9500. * _.isArray(document.body.children);
  9501. * // => false
  9502. *
  9503. * _.isArray('abc');
  9504. * // => false
  9505. *
  9506. * _.isArray(_.noop);
  9507. * // => false
  9508. */
  9509. var isArray = Array.isArray;
  9510. /**
  9511. * Checks if `value` is classified as a `Function` object.
  9512. *
  9513. * @static
  9514. * @memberOf _
  9515. * @since 0.1.0
  9516. * @category Lang
  9517. * @param {*} value The value to check.
  9518. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  9519. * @example
  9520. *
  9521. * _.isFunction(_);
  9522. * // => true
  9523. *
  9524. * _.isFunction(/abc/);
  9525. * // => false
  9526. */
  9527. function isFunction(value) {
  9528. // The use of `Object#toString` avoids issues with the `typeof` operator
  9529. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  9530. var tag = isObject(value) ? objectToString.call(value) : '';
  9531. return tag == funcTag || tag == genTag;
  9532. }
  9533. /**
  9534. * Checks if `value` is the
  9535. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  9536. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  9537. *
  9538. * @static
  9539. * @memberOf _
  9540. * @since 0.1.0
  9541. * @category Lang
  9542. * @param {*} value The value to check.
  9543. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  9544. * @example
  9545. *
  9546. * _.isObject({});
  9547. * // => true
  9548. *
  9549. * _.isObject([1, 2, 3]);
  9550. * // => true
  9551. *
  9552. * _.isObject(_.noop);
  9553. * // => true
  9554. *
  9555. * _.isObject(null);
  9556. * // => false
  9557. */
  9558. function isObject(value) {
  9559. var type = typeof value;
  9560. return !!value && (type == 'object' || type == 'function');
  9561. }
  9562. /**
  9563. * Checks if `value` is object-like. A value is object-like if it's not `null`
  9564. * and has a `typeof` result of "object".
  9565. *
  9566. * @static
  9567. * @memberOf _
  9568. * @since 4.0.0
  9569. * @category Lang
  9570. * @param {*} value The value to check.
  9571. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  9572. * @example
  9573. *
  9574. * _.isObjectLike({});
  9575. * // => true
  9576. *
  9577. * _.isObjectLike([1, 2, 3]);
  9578. * // => true
  9579. *
  9580. * _.isObjectLike(_.noop);
  9581. * // => false
  9582. *
  9583. * _.isObjectLike(null);
  9584. * // => false
  9585. */
  9586. function isObjectLike(value) {
  9587. return !!value && typeof value == 'object';
  9588. }
  9589. /**
  9590. * Checks if `value` is classified as a `Symbol` primitive or object.
  9591. *
  9592. * @static
  9593. * @memberOf _
  9594. * @since 4.0.0
  9595. * @category Lang
  9596. * @param {*} value The value to check.
  9597. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  9598. * @example
  9599. *
  9600. * _.isSymbol(Symbol.iterator);
  9601. * // => true
  9602. *
  9603. * _.isSymbol('abc');
  9604. * // => false
  9605. */
  9606. function isSymbol(value) {
  9607. return typeof value == 'symbol' ||
  9608. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  9609. }
  9610. /**
  9611. * Converts `value` to a string. An empty string is returned for `null`
  9612. * and `undefined` values. The sign of `-0` is preserved.
  9613. *
  9614. * @static
  9615. * @memberOf _
  9616. * @since 4.0.0
  9617. * @category Lang
  9618. * @param {*} value The value to process.
  9619. * @returns {string} Returns the string.
  9620. * @example
  9621. *
  9622. * _.toString(null);
  9623. * // => ''
  9624. *
  9625. * _.toString(-0);
  9626. * // => '-0'
  9627. *
  9628. * _.toString([1, 2, 3]);
  9629. * // => '1,2,3'
  9630. */
  9631. function toString(value) {
  9632. return value == null ? '' : baseToString(value);
  9633. }
  9634. /**
  9635. * Gets the value at `path` of `object`. If the resolved value is
  9636. * `undefined`, the `defaultValue` is returned in its place.
  9637. *
  9638. * @static
  9639. * @memberOf _
  9640. * @since 3.7.0
  9641. * @category Object
  9642. * @param {Object} object The object to query.
  9643. * @param {Array|string} path The path of the property to get.
  9644. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  9645. * @returns {*} Returns the resolved value.
  9646. * @example
  9647. *
  9648. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  9649. *
  9650. * _.get(object, 'a[0].b.c');
  9651. * // => 3
  9652. *
  9653. * _.get(object, ['a', '0', 'b', 'c']);
  9654. * // => 3
  9655. *
  9656. * _.get(object, 'a.b.c', 'default');
  9657. * // => 'default'
  9658. */
  9659. function get(object, path, defaultValue) {
  9660. var result = object == null ? undefined : baseGet(object, path);
  9661. return result === undefined ? defaultValue : result;
  9662. }
  9663. module.exports = get;
  9664. /***/ }),
  9665. /***/ 855:
  9666. /***/ (function(module, __unusedexports, __webpack_require__) {
  9667. module.exports = registerPlugin;
  9668. const factory = __webpack_require__(47);
  9669. function registerPlugin(plugins, pluginFunction) {
  9670. return factory(
  9671. plugins.includes(pluginFunction) ? plugins : plugins.concat(pluginFunction)
  9672. );
  9673. }
  9674. /***/ }),
  9675. /***/ 863:
  9676. /***/ (function(module, __unusedexports, __webpack_require__) {
  9677. module.exports = authenticationBeforeRequest;
  9678. const btoa = __webpack_require__(675);
  9679. const withAuthorizationPrefix = __webpack_require__(143);
  9680. function authenticationBeforeRequest(state, options) {
  9681. if (typeof state.auth === "string") {
  9682. options.headers.authorization = withAuthorizationPrefix(state.auth);
  9683. // https://developer.github.com/v3/previews/#integrations
  9684. if (
  9685. /^bearer /i.test(state.auth) &&
  9686. !/machine-man/.test(options.headers.accept)
  9687. ) {
  9688. const acceptHeaders = options.headers.accept
  9689. .split(",")
  9690. .concat("application/vnd.github.machine-man-preview+json");
  9691. options.headers.accept = acceptHeaders.filter(Boolean).join(",");
  9692. }
  9693. return;
  9694. }
  9695. if (state.auth.username) {
  9696. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  9697. options.headers.authorization = `Basic ${hash}`;
  9698. if (state.otp) {
  9699. options.headers["x-github-otp"] = state.otp;
  9700. }
  9701. return;
  9702. }
  9703. if (state.auth.clientId) {
  9704. // There is a special case for OAuth applications, when `clientId` and `clientSecret` is passed as
  9705. // Basic Authorization instead of query parameters. The only routes where that applies share the same
  9706. // URL though: `/applications/:client_id/tokens/:access_token`.
  9707. //
  9708. // 1. [Check an authorization](https://developer.github.com/v3/oauth_authorizations/#check-an-authorization)
  9709. // 2. [Reset an authorization](https://developer.github.com/v3/oauth_authorizations/#reset-an-authorization)
  9710. // 3. [Revoke an authorization for an application](https://developer.github.com/v3/oauth_authorizations/#revoke-an-authorization-for-an-application)
  9711. //
  9712. // We identify by checking the URL. It must merge both "/applications/:client_id/tokens/:access_token"
  9713. // as well as "/applications/123/tokens/token456"
  9714. if (/\/applications\/:?[\w_]+\/tokens\/:?[\w_]+($|\?)/.test(options.url)) {
  9715. const hash = btoa(`${state.auth.clientId}:${state.auth.clientSecret}`);
  9716. options.headers.authorization = `Basic ${hash}`;
  9717. return;
  9718. }
  9719. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  9720. options.url += `client_id=${state.auth.clientId}&client_secret=${state.auth.clientSecret}`;
  9721. return;
  9722. }
  9723. return Promise.resolve()
  9724. .then(() => {
  9725. return state.auth();
  9726. })
  9727. .then(authorization => {
  9728. options.headers.authorization = withAuthorizationPrefix(authorization);
  9729. });
  9730. }
  9731. /***/ }),
  9732. /***/ 866:
  9733. /***/ (function(module, __unusedexports, __webpack_require__) {
  9734. "use strict";
  9735. var shebangRegex = __webpack_require__(816);
  9736. module.exports = function (str) {
  9737. var match = str.match(shebangRegex);
  9738. if (!match) {
  9739. return null;
  9740. }
  9741. var arr = match[0].replace(/#! ?/, '').split(' ');
  9742. var bin = arr[0].split('/').pop();
  9743. var arg = arr[1];
  9744. return (bin === 'env' ?
  9745. arg :
  9746. bin + (arg ? ' ' + arg : '')
  9747. );
  9748. };
  9749. /***/ }),
  9750. /***/ 881:
  9751. /***/ (function(module) {
  9752. "use strict";
  9753. const isWin = process.platform === 'win32';
  9754. function notFoundError(original, syscall) {
  9755. return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
  9756. code: 'ENOENT',
  9757. errno: 'ENOENT',
  9758. syscall: `${syscall} ${original.command}`,
  9759. path: original.command,
  9760. spawnargs: original.args,
  9761. });
  9762. }
  9763. function hookChildProcess(cp, parsed) {
  9764. if (!isWin) {
  9765. return;
  9766. }
  9767. const originalEmit = cp.emit;
  9768. cp.emit = function (name, arg1) {
  9769. // If emitting "exit" event and exit code is 1, we need to check if
  9770. // the command exists and emit an "error" instead
  9771. // See https://github.com/IndigoUnited/node-cross-spawn/issues/16
  9772. if (name === 'exit') {
  9773. const err = verifyENOENT(arg1, parsed, 'spawn');
  9774. if (err) {
  9775. return originalEmit.call(cp, 'error', err);
  9776. }
  9777. }
  9778. return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params
  9779. };
  9780. }
  9781. function verifyENOENT(status, parsed) {
  9782. if (isWin && status === 1 && !parsed.file) {
  9783. return notFoundError(parsed.original, 'spawn');
  9784. }
  9785. return null;
  9786. }
  9787. function verifyENOENTSync(status, parsed) {
  9788. if (isWin && status === 1 && !parsed.file) {
  9789. return notFoundError(parsed.original, 'spawnSync');
  9790. }
  9791. return null;
  9792. }
  9793. module.exports = {
  9794. hookChildProcess,
  9795. verifyENOENT,
  9796. verifyENOENTSync,
  9797. notFoundError,
  9798. };
  9799. /***/ }),
  9800. /***/ 883:
  9801. /***/ (function(module) {
  9802. /**
  9803. * lodash (Custom Build) <https://lodash.com/>
  9804. * Build: `lodash modularize exports="npm" -o ./`
  9805. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  9806. * Released under MIT license <https://lodash.com/license>
  9807. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  9808. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  9809. */
  9810. /** Used as the `TypeError` message for "Functions" methods. */
  9811. var FUNC_ERROR_TEXT = 'Expected a function';
  9812. /** Used to stand-in for `undefined` hash values. */
  9813. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  9814. /** Used as references for various `Number` constants. */
  9815. var INFINITY = 1 / 0,
  9816. MAX_SAFE_INTEGER = 9007199254740991;
  9817. /** `Object#toString` result references. */
  9818. var funcTag = '[object Function]',
  9819. genTag = '[object GeneratorFunction]',
  9820. symbolTag = '[object Symbol]';
  9821. /** Used to match property names within property paths. */
  9822. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  9823. reIsPlainProp = /^\w*$/,
  9824. reLeadingDot = /^\./,
  9825. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  9826. /**
  9827. * Used to match `RegExp`
  9828. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  9829. */
  9830. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  9831. /** Used to match backslashes in property paths. */
  9832. var reEscapeChar = /\\(\\)?/g;
  9833. /** Used to detect host constructors (Safari). */
  9834. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  9835. /** Used to detect unsigned integer values. */
  9836. var reIsUint = /^(?:0|[1-9]\d*)$/;
  9837. /** Detect free variable `global` from Node.js. */
  9838. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  9839. /** Detect free variable `self`. */
  9840. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  9841. /** Used as a reference to the global object. */
  9842. var root = freeGlobal || freeSelf || Function('return this')();
  9843. /**
  9844. * Gets the value at `key` of `object`.
  9845. *
  9846. * @private
  9847. * @param {Object} [object] The object to query.
  9848. * @param {string} key The key of the property to get.
  9849. * @returns {*} Returns the property value.
  9850. */
  9851. function getValue(object, key) {
  9852. return object == null ? undefined : object[key];
  9853. }
  9854. /**
  9855. * Checks if `value` is a host object in IE < 9.
  9856. *
  9857. * @private
  9858. * @param {*} value The value to check.
  9859. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  9860. */
  9861. function isHostObject(value) {
  9862. // Many host objects are `Object` objects that can coerce to strings
  9863. // despite having improperly defined `toString` methods.
  9864. var result = false;
  9865. if (value != null && typeof value.toString != 'function') {
  9866. try {
  9867. result = !!(value + '');
  9868. } catch (e) {}
  9869. }
  9870. return result;
  9871. }
  9872. /** Used for built-in method references. */
  9873. var arrayProto = Array.prototype,
  9874. funcProto = Function.prototype,
  9875. objectProto = Object.prototype;
  9876. /** Used to detect overreaching core-js shims. */
  9877. var coreJsData = root['__core-js_shared__'];
  9878. /** Used to detect methods masquerading as native. */
  9879. var maskSrcKey = (function() {
  9880. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  9881. return uid ? ('Symbol(src)_1.' + uid) : '';
  9882. }());
  9883. /** Used to resolve the decompiled source of functions. */
  9884. var funcToString = funcProto.toString;
  9885. /** Used to check objects for own properties. */
  9886. var hasOwnProperty = objectProto.hasOwnProperty;
  9887. /**
  9888. * Used to resolve the
  9889. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  9890. * of values.
  9891. */
  9892. var objectToString = objectProto.toString;
  9893. /** Used to detect if a method is native. */
  9894. var reIsNative = RegExp('^' +
  9895. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  9896. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  9897. );
  9898. /** Built-in value references. */
  9899. var Symbol = root.Symbol,
  9900. splice = arrayProto.splice;
  9901. /* Built-in method references that are verified to be native. */
  9902. var Map = getNative(root, 'Map'),
  9903. nativeCreate = getNative(Object, 'create');
  9904. /** Used to convert symbols to primitives and strings. */
  9905. var symbolProto = Symbol ? Symbol.prototype : undefined,
  9906. symbolToString = symbolProto ? symbolProto.toString : undefined;
  9907. /**
  9908. * Creates a hash object.
  9909. *
  9910. * @private
  9911. * @constructor
  9912. * @param {Array} [entries] The key-value pairs to cache.
  9913. */
  9914. function Hash(entries) {
  9915. var index = -1,
  9916. length = entries ? entries.length : 0;
  9917. this.clear();
  9918. while (++index < length) {
  9919. var entry = entries[index];
  9920. this.set(entry[0], entry[1]);
  9921. }
  9922. }
  9923. /**
  9924. * Removes all key-value entries from the hash.
  9925. *
  9926. * @private
  9927. * @name clear
  9928. * @memberOf Hash
  9929. */
  9930. function hashClear() {
  9931. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  9932. }
  9933. /**
  9934. * Removes `key` and its value from the hash.
  9935. *
  9936. * @private
  9937. * @name delete
  9938. * @memberOf Hash
  9939. * @param {Object} hash The hash to modify.
  9940. * @param {string} key The key of the value to remove.
  9941. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  9942. */
  9943. function hashDelete(key) {
  9944. return this.has(key) && delete this.__data__[key];
  9945. }
  9946. /**
  9947. * Gets the hash value for `key`.
  9948. *
  9949. * @private
  9950. * @name get
  9951. * @memberOf Hash
  9952. * @param {string} key The key of the value to get.
  9953. * @returns {*} Returns the entry value.
  9954. */
  9955. function hashGet(key) {
  9956. var data = this.__data__;
  9957. if (nativeCreate) {
  9958. var result = data[key];
  9959. return result === HASH_UNDEFINED ? undefined : result;
  9960. }
  9961. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  9962. }
  9963. /**
  9964. * Checks if a hash value for `key` exists.
  9965. *
  9966. * @private
  9967. * @name has
  9968. * @memberOf Hash
  9969. * @param {string} key The key of the entry to check.
  9970. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  9971. */
  9972. function hashHas(key) {
  9973. var data = this.__data__;
  9974. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  9975. }
  9976. /**
  9977. * Sets the hash `key` to `value`.
  9978. *
  9979. * @private
  9980. * @name set
  9981. * @memberOf Hash
  9982. * @param {string} key The key of the value to set.
  9983. * @param {*} value The value to set.
  9984. * @returns {Object} Returns the hash instance.
  9985. */
  9986. function hashSet(key, value) {
  9987. var data = this.__data__;
  9988. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  9989. return this;
  9990. }
  9991. // Add methods to `Hash`.
  9992. Hash.prototype.clear = hashClear;
  9993. Hash.prototype['delete'] = hashDelete;
  9994. Hash.prototype.get = hashGet;
  9995. Hash.prototype.has = hashHas;
  9996. Hash.prototype.set = hashSet;
  9997. /**
  9998. * Creates an list cache object.
  9999. *
  10000. * @private
  10001. * @constructor
  10002. * @param {Array} [entries] The key-value pairs to cache.
  10003. */
  10004. function ListCache(entries) {
  10005. var index = -1,
  10006. length = entries ? entries.length : 0;
  10007. this.clear();
  10008. while (++index < length) {
  10009. var entry = entries[index];
  10010. this.set(entry[0], entry[1]);
  10011. }
  10012. }
  10013. /**
  10014. * Removes all key-value entries from the list cache.
  10015. *
  10016. * @private
  10017. * @name clear
  10018. * @memberOf ListCache
  10019. */
  10020. function listCacheClear() {
  10021. this.__data__ = [];
  10022. }
  10023. /**
  10024. * Removes `key` and its value from the list cache.
  10025. *
  10026. * @private
  10027. * @name delete
  10028. * @memberOf ListCache
  10029. * @param {string} key The key of the value to remove.
  10030. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  10031. */
  10032. function listCacheDelete(key) {
  10033. var data = this.__data__,
  10034. index = assocIndexOf(data, key);
  10035. if (index < 0) {
  10036. return false;
  10037. }
  10038. var lastIndex = data.length - 1;
  10039. if (index == lastIndex) {
  10040. data.pop();
  10041. } else {
  10042. splice.call(data, index, 1);
  10043. }
  10044. return true;
  10045. }
  10046. /**
  10047. * Gets the list cache value for `key`.
  10048. *
  10049. * @private
  10050. * @name get
  10051. * @memberOf ListCache
  10052. * @param {string} key The key of the value to get.
  10053. * @returns {*} Returns the entry value.
  10054. */
  10055. function listCacheGet(key) {
  10056. var data = this.__data__,
  10057. index = assocIndexOf(data, key);
  10058. return index < 0 ? undefined : data[index][1];
  10059. }
  10060. /**
  10061. * Checks if a list cache value for `key` exists.
  10062. *
  10063. * @private
  10064. * @name has
  10065. * @memberOf ListCache
  10066. * @param {string} key The key of the entry to check.
  10067. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  10068. */
  10069. function listCacheHas(key) {
  10070. return assocIndexOf(this.__data__, key) > -1;
  10071. }
  10072. /**
  10073. * Sets the list cache `key` to `value`.
  10074. *
  10075. * @private
  10076. * @name set
  10077. * @memberOf ListCache
  10078. * @param {string} key The key of the value to set.
  10079. * @param {*} value The value to set.
  10080. * @returns {Object} Returns the list cache instance.
  10081. */
  10082. function listCacheSet(key, value) {
  10083. var data = this.__data__,
  10084. index = assocIndexOf(data, key);
  10085. if (index < 0) {
  10086. data.push([key, value]);
  10087. } else {
  10088. data[index][1] = value;
  10089. }
  10090. return this;
  10091. }
  10092. // Add methods to `ListCache`.
  10093. ListCache.prototype.clear = listCacheClear;
  10094. ListCache.prototype['delete'] = listCacheDelete;
  10095. ListCache.prototype.get = listCacheGet;
  10096. ListCache.prototype.has = listCacheHas;
  10097. ListCache.prototype.set = listCacheSet;
  10098. /**
  10099. * Creates a map cache object to store key-value pairs.
  10100. *
  10101. * @private
  10102. * @constructor
  10103. * @param {Array} [entries] The key-value pairs to cache.
  10104. */
  10105. function MapCache(entries) {
  10106. var index = -1,
  10107. length = entries ? entries.length : 0;
  10108. this.clear();
  10109. while (++index < length) {
  10110. var entry = entries[index];
  10111. this.set(entry[0], entry[1]);
  10112. }
  10113. }
  10114. /**
  10115. * Removes all key-value entries from the map.
  10116. *
  10117. * @private
  10118. * @name clear
  10119. * @memberOf MapCache
  10120. */
  10121. function mapCacheClear() {
  10122. this.__data__ = {
  10123. 'hash': new Hash,
  10124. 'map': new (Map || ListCache),
  10125. 'string': new Hash
  10126. };
  10127. }
  10128. /**
  10129. * Removes `key` and its value from the map.
  10130. *
  10131. * @private
  10132. * @name delete
  10133. * @memberOf MapCache
  10134. * @param {string} key The key of the value to remove.
  10135. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  10136. */
  10137. function mapCacheDelete(key) {
  10138. return getMapData(this, key)['delete'](key);
  10139. }
  10140. /**
  10141. * Gets the map value for `key`.
  10142. *
  10143. * @private
  10144. * @name get
  10145. * @memberOf MapCache
  10146. * @param {string} key The key of the value to get.
  10147. * @returns {*} Returns the entry value.
  10148. */
  10149. function mapCacheGet(key) {
  10150. return getMapData(this, key).get(key);
  10151. }
  10152. /**
  10153. * Checks if a map value for `key` exists.
  10154. *
  10155. * @private
  10156. * @name has
  10157. * @memberOf MapCache
  10158. * @param {string} key The key of the entry to check.
  10159. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  10160. */
  10161. function mapCacheHas(key) {
  10162. return getMapData(this, key).has(key);
  10163. }
  10164. /**
  10165. * Sets the map `key` to `value`.
  10166. *
  10167. * @private
  10168. * @name set
  10169. * @memberOf MapCache
  10170. * @param {string} key The key of the value to set.
  10171. * @param {*} value The value to set.
  10172. * @returns {Object} Returns the map cache instance.
  10173. */
  10174. function mapCacheSet(key, value) {
  10175. getMapData(this, key).set(key, value);
  10176. return this;
  10177. }
  10178. // Add methods to `MapCache`.
  10179. MapCache.prototype.clear = mapCacheClear;
  10180. MapCache.prototype['delete'] = mapCacheDelete;
  10181. MapCache.prototype.get = mapCacheGet;
  10182. MapCache.prototype.has = mapCacheHas;
  10183. MapCache.prototype.set = mapCacheSet;
  10184. /**
  10185. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  10186. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  10187. * for equality comparisons.
  10188. *
  10189. * @private
  10190. * @param {Object} object The object to modify.
  10191. * @param {string} key The key of the property to assign.
  10192. * @param {*} value The value to assign.
  10193. */
  10194. function assignValue(object, key, value) {
  10195. var objValue = object[key];
  10196. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  10197. (value === undefined && !(key in object))) {
  10198. object[key] = value;
  10199. }
  10200. }
  10201. /**
  10202. * Gets the index at which the `key` is found in `array` of key-value pairs.
  10203. *
  10204. * @private
  10205. * @param {Array} array The array to inspect.
  10206. * @param {*} key The key to search for.
  10207. * @returns {number} Returns the index of the matched value, else `-1`.
  10208. */
  10209. function assocIndexOf(array, key) {
  10210. var length = array.length;
  10211. while (length--) {
  10212. if (eq(array[length][0], key)) {
  10213. return length;
  10214. }
  10215. }
  10216. return -1;
  10217. }
  10218. /**
  10219. * The base implementation of `_.isNative` without bad shim checks.
  10220. *
  10221. * @private
  10222. * @param {*} value The value to check.
  10223. * @returns {boolean} Returns `true` if `value` is a native function,
  10224. * else `false`.
  10225. */
  10226. function baseIsNative(value) {
  10227. if (!isObject(value) || isMasked(value)) {
  10228. return false;
  10229. }
  10230. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  10231. return pattern.test(toSource(value));
  10232. }
  10233. /**
  10234. * The base implementation of `_.set`.
  10235. *
  10236. * @private
  10237. * @param {Object} object The object to modify.
  10238. * @param {Array|string} path The path of the property to set.
  10239. * @param {*} value The value to set.
  10240. * @param {Function} [customizer] The function to customize path creation.
  10241. * @returns {Object} Returns `object`.
  10242. */
  10243. function baseSet(object, path, value, customizer) {
  10244. if (!isObject(object)) {
  10245. return object;
  10246. }
  10247. path = isKey(path, object) ? [path] : castPath(path);
  10248. var index = -1,
  10249. length = path.length,
  10250. lastIndex = length - 1,
  10251. nested = object;
  10252. while (nested != null && ++index < length) {
  10253. var key = toKey(path[index]),
  10254. newValue = value;
  10255. if (index != lastIndex) {
  10256. var objValue = nested[key];
  10257. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  10258. if (newValue === undefined) {
  10259. newValue = isObject(objValue)
  10260. ? objValue
  10261. : (isIndex(path[index + 1]) ? [] : {});
  10262. }
  10263. }
  10264. assignValue(nested, key, newValue);
  10265. nested = nested[key];
  10266. }
  10267. return object;
  10268. }
  10269. /**
  10270. * The base implementation of `_.toString` which doesn't convert nullish
  10271. * values to empty strings.
  10272. *
  10273. * @private
  10274. * @param {*} value The value to process.
  10275. * @returns {string} Returns the string.
  10276. */
  10277. function baseToString(value) {
  10278. // Exit early for strings to avoid a performance hit in some environments.
  10279. if (typeof value == 'string') {
  10280. return value;
  10281. }
  10282. if (isSymbol(value)) {
  10283. return symbolToString ? symbolToString.call(value) : '';
  10284. }
  10285. var result = (value + '');
  10286. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  10287. }
  10288. /**
  10289. * Casts `value` to a path array if it's not one.
  10290. *
  10291. * @private
  10292. * @param {*} value The value to inspect.
  10293. * @returns {Array} Returns the cast property path array.
  10294. */
  10295. function castPath(value) {
  10296. return isArray(value) ? value : stringToPath(value);
  10297. }
  10298. /**
  10299. * Gets the data for `map`.
  10300. *
  10301. * @private
  10302. * @param {Object} map The map to query.
  10303. * @param {string} key The reference key.
  10304. * @returns {*} Returns the map data.
  10305. */
  10306. function getMapData(map, key) {
  10307. var data = map.__data__;
  10308. return isKeyable(key)
  10309. ? data[typeof key == 'string' ? 'string' : 'hash']
  10310. : data.map;
  10311. }
  10312. /**
  10313. * Gets the native function at `key` of `object`.
  10314. *
  10315. * @private
  10316. * @param {Object} object The object to query.
  10317. * @param {string} key The key of the method to get.
  10318. * @returns {*} Returns the function if it's native, else `undefined`.
  10319. */
  10320. function getNative(object, key) {
  10321. var value = getValue(object, key);
  10322. return baseIsNative(value) ? value : undefined;
  10323. }
  10324. /**
  10325. * Checks if `value` is a valid array-like index.
  10326. *
  10327. * @private
  10328. * @param {*} value The value to check.
  10329. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  10330. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  10331. */
  10332. function isIndex(value, length) {
  10333. length = length == null ? MAX_SAFE_INTEGER : length;
  10334. return !!length &&
  10335. (typeof value == 'number' || reIsUint.test(value)) &&
  10336. (value > -1 && value % 1 == 0 && value < length);
  10337. }
  10338. /**
  10339. * Checks if `value` is a property name and not a property path.
  10340. *
  10341. * @private
  10342. * @param {*} value The value to check.
  10343. * @param {Object} [object] The object to query keys on.
  10344. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  10345. */
  10346. function isKey(value, object) {
  10347. if (isArray(value)) {
  10348. return false;
  10349. }
  10350. var type = typeof value;
  10351. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  10352. value == null || isSymbol(value)) {
  10353. return true;
  10354. }
  10355. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  10356. (object != null && value in Object(object));
  10357. }
  10358. /**
  10359. * Checks if `value` is suitable for use as unique object key.
  10360. *
  10361. * @private
  10362. * @param {*} value The value to check.
  10363. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  10364. */
  10365. function isKeyable(value) {
  10366. var type = typeof value;
  10367. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  10368. ? (value !== '__proto__')
  10369. : (value === null);
  10370. }
  10371. /**
  10372. * Checks if `func` has its source masked.
  10373. *
  10374. * @private
  10375. * @param {Function} func The function to check.
  10376. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  10377. */
  10378. function isMasked(func) {
  10379. return !!maskSrcKey && (maskSrcKey in func);
  10380. }
  10381. /**
  10382. * Converts `string` to a property path array.
  10383. *
  10384. * @private
  10385. * @param {string} string The string to convert.
  10386. * @returns {Array} Returns the property path array.
  10387. */
  10388. var stringToPath = memoize(function(string) {
  10389. string = toString(string);
  10390. var result = [];
  10391. if (reLeadingDot.test(string)) {
  10392. result.push('');
  10393. }
  10394. string.replace(rePropName, function(match, number, quote, string) {
  10395. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  10396. });
  10397. return result;
  10398. });
  10399. /**
  10400. * Converts `value` to a string key if it's not a string or symbol.
  10401. *
  10402. * @private
  10403. * @param {*} value The value to inspect.
  10404. * @returns {string|symbol} Returns the key.
  10405. */
  10406. function toKey(value) {
  10407. if (typeof value == 'string' || isSymbol(value)) {
  10408. return value;
  10409. }
  10410. var result = (value + '');
  10411. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  10412. }
  10413. /**
  10414. * Converts `func` to its source code.
  10415. *
  10416. * @private
  10417. * @param {Function} func The function to process.
  10418. * @returns {string} Returns the source code.
  10419. */
  10420. function toSource(func) {
  10421. if (func != null) {
  10422. try {
  10423. return funcToString.call(func);
  10424. } catch (e) {}
  10425. try {
  10426. return (func + '');
  10427. } catch (e) {}
  10428. }
  10429. return '';
  10430. }
  10431. /**
  10432. * Creates a function that memoizes the result of `func`. If `resolver` is
  10433. * provided, it determines the cache key for storing the result based on the
  10434. * arguments provided to the memoized function. By default, the first argument
  10435. * provided to the memoized function is used as the map cache key. The `func`
  10436. * is invoked with the `this` binding of the memoized function.
  10437. *
  10438. * **Note:** The cache is exposed as the `cache` property on the memoized
  10439. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  10440. * constructor with one whose instances implement the
  10441. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  10442. * method interface of `delete`, `get`, `has`, and `set`.
  10443. *
  10444. * @static
  10445. * @memberOf _
  10446. * @since 0.1.0
  10447. * @category Function
  10448. * @param {Function} func The function to have its output memoized.
  10449. * @param {Function} [resolver] The function to resolve the cache key.
  10450. * @returns {Function} Returns the new memoized function.
  10451. * @example
  10452. *
  10453. * var object = { 'a': 1, 'b': 2 };
  10454. * var other = { 'c': 3, 'd': 4 };
  10455. *
  10456. * var values = _.memoize(_.values);
  10457. * values(object);
  10458. * // => [1, 2]
  10459. *
  10460. * values(other);
  10461. * // => [3, 4]
  10462. *
  10463. * object.a = 2;
  10464. * values(object);
  10465. * // => [1, 2]
  10466. *
  10467. * // Modify the result cache.
  10468. * values.cache.set(object, ['a', 'b']);
  10469. * values(object);
  10470. * // => ['a', 'b']
  10471. *
  10472. * // Replace `_.memoize.Cache`.
  10473. * _.memoize.Cache = WeakMap;
  10474. */
  10475. function memoize(func, resolver) {
  10476. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  10477. throw new TypeError(FUNC_ERROR_TEXT);
  10478. }
  10479. var memoized = function() {
  10480. var args = arguments,
  10481. key = resolver ? resolver.apply(this, args) : args[0],
  10482. cache = memoized.cache;
  10483. if (cache.has(key)) {
  10484. return cache.get(key);
  10485. }
  10486. var result = func.apply(this, args);
  10487. memoized.cache = cache.set(key, result);
  10488. return result;
  10489. };
  10490. memoized.cache = new (memoize.Cache || MapCache);
  10491. return memoized;
  10492. }
  10493. // Assign cache to `_.memoize`.
  10494. memoize.Cache = MapCache;
  10495. /**
  10496. * Performs a
  10497. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  10498. * comparison between two values to determine if they are equivalent.
  10499. *
  10500. * @static
  10501. * @memberOf _
  10502. * @since 4.0.0
  10503. * @category Lang
  10504. * @param {*} value The value to compare.
  10505. * @param {*} other The other value to compare.
  10506. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  10507. * @example
  10508. *
  10509. * var object = { 'a': 1 };
  10510. * var other = { 'a': 1 };
  10511. *
  10512. * _.eq(object, object);
  10513. * // => true
  10514. *
  10515. * _.eq(object, other);
  10516. * // => false
  10517. *
  10518. * _.eq('a', 'a');
  10519. * // => true
  10520. *
  10521. * _.eq('a', Object('a'));
  10522. * // => false
  10523. *
  10524. * _.eq(NaN, NaN);
  10525. * // => true
  10526. */
  10527. function eq(value, other) {
  10528. return value === other || (value !== value && other !== other);
  10529. }
  10530. /**
  10531. * Checks if `value` is classified as an `Array` object.
  10532. *
  10533. * @static
  10534. * @memberOf _
  10535. * @since 0.1.0
  10536. * @category Lang
  10537. * @param {*} value The value to check.
  10538. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  10539. * @example
  10540. *
  10541. * _.isArray([1, 2, 3]);
  10542. * // => true
  10543. *
  10544. * _.isArray(document.body.children);
  10545. * // => false
  10546. *
  10547. * _.isArray('abc');
  10548. * // => false
  10549. *
  10550. * _.isArray(_.noop);
  10551. * // => false
  10552. */
  10553. var isArray = Array.isArray;
  10554. /**
  10555. * Checks if `value` is classified as a `Function` object.
  10556. *
  10557. * @static
  10558. * @memberOf _
  10559. * @since 0.1.0
  10560. * @category Lang
  10561. * @param {*} value The value to check.
  10562. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  10563. * @example
  10564. *
  10565. * _.isFunction(_);
  10566. * // => true
  10567. *
  10568. * _.isFunction(/abc/);
  10569. * // => false
  10570. */
  10571. function isFunction(value) {
  10572. // The use of `Object#toString` avoids issues with the `typeof` operator
  10573. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  10574. var tag = isObject(value) ? objectToString.call(value) : '';
  10575. return tag == funcTag || tag == genTag;
  10576. }
  10577. /**
  10578. * Checks if `value` is the
  10579. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  10580. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  10581. *
  10582. * @static
  10583. * @memberOf _
  10584. * @since 0.1.0
  10585. * @category Lang
  10586. * @param {*} value The value to check.
  10587. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  10588. * @example
  10589. *
  10590. * _.isObject({});
  10591. * // => true
  10592. *
  10593. * _.isObject([1, 2, 3]);
  10594. * // => true
  10595. *
  10596. * _.isObject(_.noop);
  10597. * // => true
  10598. *
  10599. * _.isObject(null);
  10600. * // => false
  10601. */
  10602. function isObject(value) {
  10603. var type = typeof value;
  10604. return !!value && (type == 'object' || type == 'function');
  10605. }
  10606. /**
  10607. * Checks if `value` is object-like. A value is object-like if it's not `null`
  10608. * and has a `typeof` result of "object".
  10609. *
  10610. * @static
  10611. * @memberOf _
  10612. * @since 4.0.0
  10613. * @category Lang
  10614. * @param {*} value The value to check.
  10615. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  10616. * @example
  10617. *
  10618. * _.isObjectLike({});
  10619. * // => true
  10620. *
  10621. * _.isObjectLike([1, 2, 3]);
  10622. * // => true
  10623. *
  10624. * _.isObjectLike(_.noop);
  10625. * // => false
  10626. *
  10627. * _.isObjectLike(null);
  10628. * // => false
  10629. */
  10630. function isObjectLike(value) {
  10631. return !!value && typeof value == 'object';
  10632. }
  10633. /**
  10634. * Checks if `value` is classified as a `Symbol` primitive or object.
  10635. *
  10636. * @static
  10637. * @memberOf _
  10638. * @since 4.0.0
  10639. * @category Lang
  10640. * @param {*} value The value to check.
  10641. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  10642. * @example
  10643. *
  10644. * _.isSymbol(Symbol.iterator);
  10645. * // => true
  10646. *
  10647. * _.isSymbol('abc');
  10648. * // => false
  10649. */
  10650. function isSymbol(value) {
  10651. return typeof value == 'symbol' ||
  10652. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  10653. }
  10654. /**
  10655. * Converts `value` to a string. An empty string is returned for `null`
  10656. * and `undefined` values. The sign of `-0` is preserved.
  10657. *
  10658. * @static
  10659. * @memberOf _
  10660. * @since 4.0.0
  10661. * @category Lang
  10662. * @param {*} value The value to process.
  10663. * @returns {string} Returns the string.
  10664. * @example
  10665. *
  10666. * _.toString(null);
  10667. * // => ''
  10668. *
  10669. * _.toString(-0);
  10670. * // => '-0'
  10671. *
  10672. * _.toString([1, 2, 3]);
  10673. * // => '1,2,3'
  10674. */
  10675. function toString(value) {
  10676. return value == null ? '' : baseToString(value);
  10677. }
  10678. /**
  10679. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  10680. * it's created. Arrays are created for missing index properties while objects
  10681. * are created for all other missing properties. Use `_.setWith` to customize
  10682. * `path` creation.
  10683. *
  10684. * **Note:** This method mutates `object`.
  10685. *
  10686. * @static
  10687. * @memberOf _
  10688. * @since 3.7.0
  10689. * @category Object
  10690. * @param {Object} object The object to modify.
  10691. * @param {Array|string} path The path of the property to set.
  10692. * @param {*} value The value to set.
  10693. * @returns {Object} Returns `object`.
  10694. * @example
  10695. *
  10696. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  10697. *
  10698. * _.set(object, 'a[0].b.c', 4);
  10699. * console.log(object.a[0].b.c);
  10700. * // => 4
  10701. *
  10702. * _.set(object, ['x', '0', 'y', 'z'], 5);
  10703. * console.log(object.x[0].y.z);
  10704. * // => 5
  10705. */
  10706. function set(object, path, value) {
  10707. return object == null ? object : baseSet(object, path, value);
  10708. }
  10709. module.exports = set;
  10710. /***/ }),
  10711. /***/ 898:
  10712. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  10713. "use strict";
  10714. Object.defineProperty(exports, '__esModule', { value: true });
  10715. var request = __webpack_require__(753);
  10716. var universalUserAgent = __webpack_require__(796);
  10717. const VERSION = "4.3.1";
  10718. class GraphqlError extends Error {
  10719. constructor(request, response) {
  10720. const message = response.data.errors[0].message;
  10721. super(message);
  10722. Object.assign(this, response.data);
  10723. this.name = "GraphqlError";
  10724. this.request = request; // Maintains proper stack trace (only available on V8)
  10725. /* istanbul ignore next */
  10726. if (Error.captureStackTrace) {
  10727. Error.captureStackTrace(this, this.constructor);
  10728. }
  10729. }
  10730. }
  10731. const NON_VARIABLE_OPTIONS = ["method", "baseUrl", "url", "headers", "request", "query"];
  10732. function graphql(request, query, options) {
  10733. options = typeof query === "string" ? options = Object.assign({
  10734. query
  10735. }, options) : options = query;
  10736. const requestOptions = Object.keys(options).reduce((result, key) => {
  10737. if (NON_VARIABLE_OPTIONS.includes(key)) {
  10738. result[key] = options[key];
  10739. return result;
  10740. }
  10741. if (!result.variables) {
  10742. result.variables = {};
  10743. }
  10744. result.variables[key] = options[key];
  10745. return result;
  10746. }, {});
  10747. return request(requestOptions).then(response => {
  10748. if (response.data.errors) {
  10749. throw new GraphqlError(requestOptions, {
  10750. data: response.data
  10751. });
  10752. }
  10753. return response.data.data;
  10754. });
  10755. }
  10756. function withDefaults(request$1, newDefaults) {
  10757. const newRequest = request$1.defaults(newDefaults);
  10758. const newApi = (query, options) => {
  10759. return graphql(newRequest, query, options);
  10760. };
  10761. return Object.assign(newApi, {
  10762. defaults: withDefaults.bind(null, newRequest),
  10763. endpoint: request.request.endpoint
  10764. });
  10765. }
  10766. const graphql$1 = withDefaults(request.request, {
  10767. headers: {
  10768. "user-agent": `octokit-graphql.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  10769. },
  10770. method: "POST",
  10771. url: "/graphql"
  10772. });
  10773. function withCustomRequest(customRequest) {
  10774. return withDefaults(customRequest, {
  10775. method: "POST",
  10776. url: "/graphql"
  10777. });
  10778. }
  10779. exports.graphql = graphql$1;
  10780. exports.withCustomRequest = withCustomRequest;
  10781. //# sourceMappingURL=index.js.map
  10782. /***/ }),
  10783. /***/ 899:
  10784. /***/ (function(module, __unusedexports, __webpack_require__) {
  10785. module.exports = registerEndpoints;
  10786. const { Deprecation } = __webpack_require__(692);
  10787. function registerEndpoints(octokit, routes) {
  10788. Object.keys(routes).forEach(namespaceName => {
  10789. if (!octokit[namespaceName]) {
  10790. octokit[namespaceName] = {};
  10791. }
  10792. Object.keys(routes[namespaceName]).forEach(apiName => {
  10793. const apiOptions = routes[namespaceName][apiName];
  10794. const endpointDefaults = ["method", "url", "headers"].reduce(
  10795. (map, key) => {
  10796. if (typeof apiOptions[key] !== "undefined") {
  10797. map[key] = apiOptions[key];
  10798. }
  10799. return map;
  10800. },
  10801. {}
  10802. );
  10803. endpointDefaults.request = {
  10804. validate: apiOptions.params
  10805. };
  10806. let request = octokit.request.defaults(endpointDefaults);
  10807. // patch request & endpoint methods to support deprecated parameters.
  10808. // Not the most elegant solution, but we don’t want to move deprecation
  10809. // logic into octokit/endpoint.js as it’s out of scope
  10810. const hasDeprecatedParam = Object.keys(apiOptions.params || {}).find(
  10811. key => apiOptions.params[key].deprecated
  10812. );
  10813. if (hasDeprecatedParam) {
  10814. const patch = patchForDeprecation.bind(null, octokit, apiOptions);
  10815. request = patch(
  10816. octokit.request.defaults(endpointDefaults),
  10817. `.${namespaceName}.${apiName}()`
  10818. );
  10819. request.endpoint = patch(
  10820. request.endpoint,
  10821. `.${namespaceName}.${apiName}.endpoint()`
  10822. );
  10823. request.endpoint.merge = patch(
  10824. request.endpoint.merge,
  10825. `.${namespaceName}.${apiName}.endpoint.merge()`
  10826. );
  10827. }
  10828. if (apiOptions.deprecated) {
  10829. octokit[namespaceName][apiName] = function deprecatedEndpointMethod() {
  10830. octokit.log.warn(
  10831. new Deprecation(`[@octokit/rest] ${apiOptions.deprecated}`)
  10832. );
  10833. octokit[namespaceName][apiName] = request;
  10834. return request.apply(null, arguments);
  10835. };
  10836. return;
  10837. }
  10838. octokit[namespaceName][apiName] = request;
  10839. });
  10840. });
  10841. }
  10842. function patchForDeprecation(octokit, apiOptions, method, methodName) {
  10843. const patchedMethod = options => {
  10844. options = Object.assign({}, options);
  10845. Object.keys(options).forEach(key => {
  10846. if (apiOptions.params[key] && apiOptions.params[key].deprecated) {
  10847. const aliasKey = apiOptions.params[key].alias;
  10848. octokit.log.warn(
  10849. new Deprecation(
  10850. `[@octokit/rest] "${key}" parameter is deprecated for "${methodName}". Use "${aliasKey}" instead`
  10851. )
  10852. );
  10853. if (!(aliasKey in options)) {
  10854. options[aliasKey] = options[key];
  10855. }
  10856. delete options[key];
  10857. }
  10858. });
  10859. return method(options);
  10860. };
  10861. Object.keys(method).forEach(key => {
  10862. patchedMethod[key] = method[key];
  10863. });
  10864. return patchedMethod;
  10865. }
  10866. /***/ }),
  10867. /***/ 929:
  10868. /***/ (function(module, __unusedexports, __webpack_require__) {
  10869. module.exports = hasNextPage
  10870. const deprecate = __webpack_require__(370)
  10871. const getPageLinks = __webpack_require__(577)
  10872. function hasNextPage (link) {
  10873. deprecate(`octokit.hasNextPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  10874. return getPageLinks(link).next
  10875. }
  10876. /***/ }),
  10877. /***/ 948:
  10878. /***/ (function(module) {
  10879. "use strict";
  10880. /**
  10881. * Tries to execute a function and discards any error that occurs.
  10882. * @param {Function} fn - Function that might or might not throw an error.
  10883. * @returns {?*} Return-value of the function when no error occurred.
  10884. */
  10885. module.exports = function(fn) {
  10886. try { return fn() } catch (e) {}
  10887. }
  10888. /***/ }),
  10889. /***/ 954:
  10890. /***/ (function(module) {
  10891. module.exports = validateAuth;
  10892. function validateAuth(auth) {
  10893. if (typeof auth === "string") {
  10894. return;
  10895. }
  10896. if (typeof auth === "function") {
  10897. return;
  10898. }
  10899. if (auth.username && auth.password) {
  10900. return;
  10901. }
  10902. if (auth.clientId && auth.clientSecret) {
  10903. return;
  10904. }
  10905. throw new Error(`Invalid "auth" option: ${JSON.stringify(auth)}`);
  10906. }
  10907. /***/ }),
  10908. /***/ 955:
  10909. /***/ (function(module, __unusedexports, __webpack_require__) {
  10910. "use strict";
  10911. const path = __webpack_require__(622);
  10912. const childProcess = __webpack_require__(129);
  10913. const crossSpawn = __webpack_require__(20);
  10914. const stripEof = __webpack_require__(768);
  10915. const npmRunPath = __webpack_require__(621);
  10916. const isStream = __webpack_require__(323);
  10917. const _getStream = __webpack_require__(145);
  10918. const pFinally = __webpack_require__(697);
  10919. const onExit = __webpack_require__(260);
  10920. const errname = __webpack_require__(427);
  10921. const stdio = __webpack_require__(168);
  10922. const TEN_MEGABYTES = 1000 * 1000 * 10;
  10923. function handleArgs(cmd, args, opts) {
  10924. let parsed;
  10925. opts = Object.assign({
  10926. extendEnv: true,
  10927. env: {}
  10928. }, opts);
  10929. if (opts.extendEnv) {
  10930. opts.env = Object.assign({}, process.env, opts.env);
  10931. }
  10932. if (opts.__winShell === true) {
  10933. delete opts.__winShell;
  10934. parsed = {
  10935. command: cmd,
  10936. args,
  10937. options: opts,
  10938. file: cmd,
  10939. original: {
  10940. cmd,
  10941. args
  10942. }
  10943. };
  10944. } else {
  10945. parsed = crossSpawn._parse(cmd, args, opts);
  10946. }
  10947. opts = Object.assign({
  10948. maxBuffer: TEN_MEGABYTES,
  10949. buffer: true,
  10950. stripEof: true,
  10951. preferLocal: true,
  10952. localDir: parsed.options.cwd || process.cwd(),
  10953. encoding: 'utf8',
  10954. reject: true,
  10955. cleanup: true
  10956. }, parsed.options);
  10957. opts.stdio = stdio(opts);
  10958. if (opts.preferLocal) {
  10959. opts.env = npmRunPath.env(Object.assign({}, opts, {cwd: opts.localDir}));
  10960. }
  10961. if (opts.detached) {
  10962. // #115
  10963. opts.cleanup = false;
  10964. }
  10965. if (process.platform === 'win32' && path.basename(parsed.command) === 'cmd.exe') {
  10966. // #116
  10967. parsed.args.unshift('/q');
  10968. }
  10969. return {
  10970. cmd: parsed.command,
  10971. args: parsed.args,
  10972. opts,
  10973. parsed
  10974. };
  10975. }
  10976. function handleInput(spawned, input) {
  10977. if (input === null || input === undefined) {
  10978. return;
  10979. }
  10980. if (isStream(input)) {
  10981. input.pipe(spawned.stdin);
  10982. } else {
  10983. spawned.stdin.end(input);
  10984. }
  10985. }
  10986. function handleOutput(opts, val) {
  10987. if (val && opts.stripEof) {
  10988. val = stripEof(val);
  10989. }
  10990. return val;
  10991. }
  10992. function handleShell(fn, cmd, opts) {
  10993. let file = '/bin/sh';
  10994. let args = ['-c', cmd];
  10995. opts = Object.assign({}, opts);
  10996. if (process.platform === 'win32') {
  10997. opts.__winShell = true;
  10998. file = process.env.comspec || 'cmd.exe';
  10999. args = ['/s', '/c', `"${cmd}"`];
  11000. opts.windowsVerbatimArguments = true;
  11001. }
  11002. if (opts.shell) {
  11003. file = opts.shell;
  11004. delete opts.shell;
  11005. }
  11006. return fn(file, args, opts);
  11007. }
  11008. function getStream(process, stream, {encoding, buffer, maxBuffer}) {
  11009. if (!process[stream]) {
  11010. return null;
  11011. }
  11012. let ret;
  11013. if (!buffer) {
  11014. // TODO: Use `ret = util.promisify(stream.finished)(process[stream]);` when targeting Node.js 10
  11015. ret = new Promise((resolve, reject) => {
  11016. process[stream]
  11017. .once('end', resolve)
  11018. .once('error', reject);
  11019. });
  11020. } else if (encoding) {
  11021. ret = _getStream(process[stream], {
  11022. encoding,
  11023. maxBuffer
  11024. });
  11025. } else {
  11026. ret = _getStream.buffer(process[stream], {maxBuffer});
  11027. }
  11028. return ret.catch(err => {
  11029. err.stream = stream;
  11030. err.message = `${stream} ${err.message}`;
  11031. throw err;
  11032. });
  11033. }
  11034. function makeError(result, options) {
  11035. const {stdout, stderr} = result;
  11036. let err = result.error;
  11037. const {code, signal} = result;
  11038. const {parsed, joinedCmd} = options;
  11039. const timedOut = options.timedOut || false;
  11040. if (!err) {
  11041. let output = '';
  11042. if (Array.isArray(parsed.opts.stdio)) {
  11043. if (parsed.opts.stdio[2] !== 'inherit') {
  11044. output += output.length > 0 ? stderr : `\n${stderr}`;
  11045. }
  11046. if (parsed.opts.stdio[1] !== 'inherit') {
  11047. output += `\n${stdout}`;
  11048. }
  11049. } else if (parsed.opts.stdio !== 'inherit') {
  11050. output = `\n${stderr}${stdout}`;
  11051. }
  11052. err = new Error(`Command failed: ${joinedCmd}${output}`);
  11053. err.code = code < 0 ? errname(code) : code;
  11054. }
  11055. err.stdout = stdout;
  11056. err.stderr = stderr;
  11057. err.failed = true;
  11058. err.signal = signal || null;
  11059. err.cmd = joinedCmd;
  11060. err.timedOut = timedOut;
  11061. return err;
  11062. }
  11063. function joinCmd(cmd, args) {
  11064. let joinedCmd = cmd;
  11065. if (Array.isArray(args) && args.length > 0) {
  11066. joinedCmd += ' ' + args.join(' ');
  11067. }
  11068. return joinedCmd;
  11069. }
  11070. module.exports = (cmd, args, opts) => {
  11071. const parsed = handleArgs(cmd, args, opts);
  11072. const {encoding, buffer, maxBuffer} = parsed.opts;
  11073. const joinedCmd = joinCmd(cmd, args);
  11074. let spawned;
  11075. try {
  11076. spawned = childProcess.spawn(parsed.cmd, parsed.args, parsed.opts);
  11077. } catch (err) {
  11078. return Promise.reject(err);
  11079. }
  11080. let removeExitHandler;
  11081. if (parsed.opts.cleanup) {
  11082. removeExitHandler = onExit(() => {
  11083. spawned.kill();
  11084. });
  11085. }
  11086. let timeoutId = null;
  11087. let timedOut = false;
  11088. const cleanup = () => {
  11089. if (timeoutId) {
  11090. clearTimeout(timeoutId);
  11091. timeoutId = null;
  11092. }
  11093. if (removeExitHandler) {
  11094. removeExitHandler();
  11095. }
  11096. };
  11097. if (parsed.opts.timeout > 0) {
  11098. timeoutId = setTimeout(() => {
  11099. timeoutId = null;
  11100. timedOut = true;
  11101. spawned.kill(parsed.opts.killSignal);
  11102. }, parsed.opts.timeout);
  11103. }
  11104. const processDone = new Promise(resolve => {
  11105. spawned.on('exit', (code, signal) => {
  11106. cleanup();
  11107. resolve({code, signal});
  11108. });
  11109. spawned.on('error', err => {
  11110. cleanup();
  11111. resolve({error: err});
  11112. });
  11113. if (spawned.stdin) {
  11114. spawned.stdin.on('error', err => {
  11115. cleanup();
  11116. resolve({error: err});
  11117. });
  11118. }
  11119. });
  11120. function destroy() {
  11121. if (spawned.stdout) {
  11122. spawned.stdout.destroy();
  11123. }
  11124. if (spawned.stderr) {
  11125. spawned.stderr.destroy();
  11126. }
  11127. }
  11128. const handlePromise = () => pFinally(Promise.all([
  11129. processDone,
  11130. getStream(spawned, 'stdout', {encoding, buffer, maxBuffer}),
  11131. getStream(spawned, 'stderr', {encoding, buffer, maxBuffer})
  11132. ]).then(arr => {
  11133. const result = arr[0];
  11134. result.stdout = arr[1];
  11135. result.stderr = arr[2];
  11136. if (result.error || result.code !== 0 || result.signal !== null) {
  11137. const err = makeError(result, {
  11138. joinedCmd,
  11139. parsed,
  11140. timedOut
  11141. });
  11142. // TODO: missing some timeout logic for killed
  11143. // https://github.com/nodejs/node/blob/master/lib/child_process.js#L203
  11144. // err.killed = spawned.killed || killed;
  11145. err.killed = err.killed || spawned.killed;
  11146. if (!parsed.opts.reject) {
  11147. return err;
  11148. }
  11149. throw err;
  11150. }
  11151. return {
  11152. stdout: handleOutput(parsed.opts, result.stdout),
  11153. stderr: handleOutput(parsed.opts, result.stderr),
  11154. code: 0,
  11155. failed: false,
  11156. killed: false,
  11157. signal: null,
  11158. cmd: joinedCmd,
  11159. timedOut: false
  11160. };
  11161. }), destroy);
  11162. crossSpawn._enoent.hookChildProcess(spawned, parsed.parsed);
  11163. handleInput(spawned, parsed.opts.input);
  11164. spawned.then = (onfulfilled, onrejected) => handlePromise().then(onfulfilled, onrejected);
  11165. spawned.catch = onrejected => handlePromise().catch(onrejected);
  11166. return spawned;
  11167. };
  11168. // TODO: set `stderr: 'ignore'` when that option is implemented
  11169. module.exports.stdout = (...args) => module.exports(...args).then(x => x.stdout);
  11170. // TODO: set `stdout: 'ignore'` when that option is implemented
  11171. module.exports.stderr = (...args) => module.exports(...args).then(x => x.stderr);
  11172. module.exports.shell = (cmd, opts) => handleShell(module.exports, cmd, opts);
  11173. module.exports.sync = (cmd, args, opts) => {
  11174. const parsed = handleArgs(cmd, args, opts);
  11175. const joinedCmd = joinCmd(cmd, args);
  11176. if (isStream(parsed.opts.input)) {
  11177. throw new TypeError('The `input` option cannot be a stream in sync mode');
  11178. }
  11179. const result = childProcess.spawnSync(parsed.cmd, parsed.args, parsed.opts);
  11180. result.code = result.status;
  11181. if (result.error || result.status !== 0 || result.signal !== null) {
  11182. const err = makeError(result, {
  11183. joinedCmd,
  11184. parsed
  11185. });
  11186. if (!parsed.opts.reject) {
  11187. return err;
  11188. }
  11189. throw err;
  11190. }
  11191. return {
  11192. stdout: handleOutput(parsed.opts, result.stdout),
  11193. stderr: handleOutput(parsed.opts, result.stderr),
  11194. code: 0,
  11195. failed: false,
  11196. signal: null,
  11197. cmd: joinedCmd,
  11198. timedOut: false
  11199. };
  11200. };
  11201. module.exports.shellSync = (cmd, opts) => handleShell(module.exports.sync, cmd, opts);
  11202. /***/ }),
  11203. /***/ 966:
  11204. /***/ (function(module, __unusedexports, __webpack_require__) {
  11205. "use strict";
  11206. const {PassThrough} = __webpack_require__(413);
  11207. module.exports = options => {
  11208. options = Object.assign({}, options);
  11209. const {array} = options;
  11210. let {encoding} = options;
  11211. const buffer = encoding === 'buffer';
  11212. let objectMode = false;
  11213. if (array) {
  11214. objectMode = !(encoding || buffer);
  11215. } else {
  11216. encoding = encoding || 'utf8';
  11217. }
  11218. if (buffer) {
  11219. encoding = null;
  11220. }
  11221. let len = 0;
  11222. const ret = [];
  11223. const stream = new PassThrough({objectMode});
  11224. if (encoding) {
  11225. stream.setEncoding(encoding);
  11226. }
  11227. stream.on('data', chunk => {
  11228. ret.push(chunk);
  11229. if (objectMode) {
  11230. len = ret.length;
  11231. } else {
  11232. len += chunk.length;
  11233. }
  11234. });
  11235. stream.getBufferedValue = () => {
  11236. if (array) {
  11237. return ret;
  11238. }
  11239. return buffer ? Buffer.concat(ret, len) : ret.join('');
  11240. };
  11241. stream.getBufferedLength = () => len;
  11242. return stream;
  11243. };
  11244. /***/ }),
  11245. /***/ 969:
  11246. /***/ (function(module, __unusedexports, __webpack_require__) {
  11247. var wrappy = __webpack_require__(11)
  11248. module.exports = wrappy(once)
  11249. module.exports.strict = wrappy(onceStrict)
  11250. once.proto = once(function () {
  11251. Object.defineProperty(Function.prototype, 'once', {
  11252. value: function () {
  11253. return once(this)
  11254. },
  11255. configurable: true
  11256. })
  11257. Object.defineProperty(Function.prototype, 'onceStrict', {
  11258. value: function () {
  11259. return onceStrict(this)
  11260. },
  11261. configurable: true
  11262. })
  11263. })
  11264. function once (fn) {
  11265. var f = function () {
  11266. if (f.called) return f.value
  11267. f.called = true
  11268. return f.value = fn.apply(this, arguments)
  11269. }
  11270. f.called = false
  11271. return f
  11272. }
  11273. function onceStrict (fn) {
  11274. var f = function () {
  11275. if (f.called)
  11276. throw new Error(f.onceError)
  11277. f.called = true
  11278. return f.value = fn.apply(this, arguments)
  11279. }
  11280. var name = fn.name || 'Function wrapped with `once`'
  11281. f.onceError = name + " shouldn't be called more than once"
  11282. f.called = false
  11283. return f
  11284. }
  11285. /***/ }),
  11286. /***/ 986:
  11287. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  11288. "use strict";
  11289. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  11290. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  11291. return new (P || (P = Promise))(function (resolve, reject) {
  11292. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  11293. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  11294. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  11295. step((generator = generator.apply(thisArg, _arguments || [])).next());
  11296. });
  11297. };
  11298. Object.defineProperty(exports, "__esModule", { value: true });
  11299. const tr = __webpack_require__(9);
  11300. /**
  11301. * Exec a command.
  11302. * Output will be streamed to the live console.
  11303. * Returns promise with return code
  11304. *
  11305. * @param commandLine command to execute (can include additional args). Must be correctly escaped.
  11306. * @param args optional arguments for tool. Escaping is handled by the lib.
  11307. * @param options optional exec options. See ExecOptions
  11308. * @returns Promise<number> exit code
  11309. */
  11310. function exec(commandLine, args, options) {
  11311. return __awaiter(this, void 0, void 0, function* () {
  11312. const commandArgs = tr.argStringToArray(commandLine);
  11313. if (commandArgs.length === 0) {
  11314. throw new Error(`Parameter 'commandLine' cannot be null or empty.`);
  11315. }
  11316. // Path to tool to execute should be first arg
  11317. const toolPath = commandArgs[0];
  11318. args = commandArgs.slice(1).concat(args || []);
  11319. const runner = new tr.ToolRunner(toolPath, args, options);
  11320. return runner.exec();
  11321. });
  11322. }
  11323. exports.exec = exec;
  11324. //# sourceMappingURL=exec.js.map
  11325. /***/ }),
  11326. /***/ 991:
  11327. /***/ (function(module, __unusedexports, __webpack_require__) {
  11328. module.exports = authenticationRequestError;
  11329. const { RequestError } = __webpack_require__(463);
  11330. function authenticationRequestError(state, error, options) {
  11331. if (!error.headers) throw error;
  11332. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  11333. // handle "2FA required" error only
  11334. if (error.status !== 401 || !otpRequired) {
  11335. throw error;
  11336. }
  11337. if (
  11338. error.status === 401 &&
  11339. otpRequired &&
  11340. error.request &&
  11341. error.request.headers["x-github-otp"]
  11342. ) {
  11343. if (state.otp) {
  11344. delete state.otp; // no longer valid, request again
  11345. } else {
  11346. throw new RequestError(
  11347. "Invalid one-time password for two-factor authentication",
  11348. 401,
  11349. {
  11350. headers: error.headers,
  11351. request: options
  11352. }
  11353. );
  11354. }
  11355. }
  11356. if (typeof state.auth.on2fa !== "function") {
  11357. throw new RequestError(
  11358. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  11359. 401,
  11360. {
  11361. headers: error.headers,
  11362. request: options
  11363. }
  11364. );
  11365. }
  11366. return Promise.resolve()
  11367. .then(() => {
  11368. return state.auth.on2fa();
  11369. })
  11370. .then(oneTimePassword => {
  11371. const newOptions = Object.assign(options, {
  11372. headers: Object.assign(options.headers, {
  11373. "x-github-otp": oneTimePassword
  11374. })
  11375. });
  11376. return state.octokit.request(newOptions).then(response => {
  11377. // If OTP still valid, then persist it for following requests
  11378. state.otp = oneTimePassword;
  11379. return response;
  11380. });
  11381. });
  11382. }
  11383. /***/ })
  11384. /******/ });